jkDetail.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <img :src="mainImg" alt="" class="topimg" mode="widthFix">
  5. </view>
  6. <view class="cont">
  7. <view class="name">{{info.activityName}}</view>
  8. <view class="name2">{{info.startTime.slice(0,10)}}~{{info.endTime.slice(0,10)}}</view>
  9. <view class="name3">{{info.activityContent}}</view>
  10. </view>
  11. <view class="shopBox">
  12. <view class="shopBoxTop">
  13. <view class="shopMs">活动门店</view>
  14. <view class="shopTy" @click="useShow">
  15. <view class="shopTyTxt">{{info.shopCount}}家门店通用</view>
  16. <img src="../../static/timg/jt2.png" alt="" class="shopjt">
  17. </view>
  18. </view>
  19. <view class="shopCont">
  20. <view class="shopContLeft">
  21. <view class="shopName">{{shopInfo.shopName}}</view>
  22. <view class="shopaddress">{{shopInfo.address?shopInfo.address:''}}</view>
  23. </view>
  24. <view class="shopContRight">
  25. <view class="shopContRightLine" @click="getmap">
  26. <img src="../../static/timg/icon_map.png" alt="" class="shopRightIcon">
  27. <view class="shopRightTxt">地图</view>
  28. </view>
  29. <view class="shopRightSx"></view>
  30. <view class="shopContRightLine" @click="call">
  31. <img src="../../static/timg/icon_phone.png" alt="" class="shopRightIcon">
  32. <view class="shopRightTxt">电话</view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 多少人报名 -->
  38. <view class="signupBox" v-if="info.signUserList.length">
  39. <view class="signupTop">
  40. <span class="signupTops1">{{info.signUserList.length}}</span>
  41. <span class="signupTops1">人已报名</span>
  42. </view>
  43. <view class="signupCont">
  44. <view class="signupLine" v-for="(item,index) in info.signUserList">
  45. <view class="signupLineL">
  46. <img :src="item.headImg" alt="" class="signupLineLImg">
  47. <view class="signupLineLName">{{item.nickName}}</view>
  48. </view>
  49. <view class="signupLineM">{{item.plateNumber?item.plateNumber:''}}</view>
  50. <view class="signupLineR">{{item.createTime}}</view>
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 多少人报名 -->
  55. <!-- 多少人看过 -->
  56. <view class="signupBox" v-if="info.lookCount">
  57. <view class="signupTop">
  58. <span class="signupTops1">{{info.lookCount}}</span>
  59. <span class="signupTops1">人看过</span>
  60. </view>
  61. <!-- <view class="seeBox">
  62. <view class="seeLine" v-for="(item,index) in 15">
  63. <img src="http://dmsphoto.66km.com.cn/marketing//accompany/3885B510-6405-4A5E-BD64-B6C09CEE070E.jpg" alt="" class="signupLineLImg">
  64. </view>
  65. </view> -->
  66. </view>
  67. <view class="detailBOx" v-if="dimgList">
  68. <view class="detailTitle">活动详情</view>
  69. <view class="detailImgBox" v-for="(item,index) in dimgList">
  70. <img :src="item.img" alt="" class="detailImg" mode="widthFix">
  71. </view>
  72. </view>
  73. <view style="height: 200rpx;padding-bottom: constant(safe-area-inset-bottom);
  74. padding-bottom: env(safe-area-inset-bottom);"></view>
  75. <view class="bottom">
  76. <view class="timeTbox" v-if="!activityEnd">
  77. <view class="timeviewTxt" v-if="activityNoOpen"> 距开始</view>
  78. <view class="timeviewTxt" v-if="!activityNoOpen"> 距结束</view>
  79. <view class="timeK">{{shengyuD}}</view>
  80. <view class="timeviewTxt" > 天</view>
  81. <view class="timeK">{{shengyuH}}</view>
  82. <view class="timeviewTxt"> 时</view>
  83. <view class="timeK">{{shengyuM}}</view>
  84. <view class="timeviewTxt" > 分</view>
  85. </view>
  86. <view class="bottomBtnBox">
  87. <!-- <view class="bottomBtnBoxLeft">
  88. <img src="../../static/timg/share.png" alt="" class="shareIcon">
  89. <view class="shareTxt">分享</view>
  90. </view> -->
  91. <button open-type="share" class="bottomBtnBoxLeft shareBtn" >
  92. <image src="../../static/timg/share.png" mode="" class="shareIcon"></image>
  93. <view class="shareTxt">分享</view>
  94. </button>
  95. <!-- 状态1未开始 2进行中3已结束 -->
  96. <view class="bottomBtn" v-if="info.state==2" @click="signUp">
  97. <span v-if="info.money">¥{{info.money}} &nbsp; 立即抢购</span>
  98. <span v-else>立即报名</span>
  99. </view>
  100. <view class="bottomBtn2" v-if="info.state==1">报名未开始</view>
  101. <view class="bottomBtn2" v-if="info.state==3">报名已结束</view>
  102. </view>
  103. </view>
  104. <!-- 报名弹框 -->
  105. <view class="baomingBox" v-if="bmShow" @click="nobmshow">
  106. <view class="baomingCont" @click.stop="" :style="{bottom: jpHeight}">
  107. <view class="bmTop">
  108. <view class="bmTitle">登记信息</view>
  109. <img src="../../static/timg/chahao.png" alt="" class="bmChimg" @click="nobmshow">
  110. </view>
  111. <view style="padding: 0 24rpx;">
  112. <view class="bmshopLine" @click="showCkshop">
  113. <view class="bmshopname" v-if="!shopName">请选择门店</view>
  114. <view class="bmshopname" style="color: #333333;">{{shopName}}</view>
  115. <img src="../../static/timg/icon_arrow_right.png" alt="" class="bmshopjt">
  116. </view>
  117. <!-- clWhere报名凭证1,2,3,4 1手机号2车牌号3姓名4单位 -->
  118. <view class="bmLine" v-if="info.clWhere.indexOf(1)!=-1" @click="focusState1cl">
  119. <!-- :focus="focusState1" --> <input type="number" :hold-keyboard="true" :adjust-position="false" @blur="inputBindBlur" @focus="inputBindFocus" v-model="mobilePhone" class="bmlineInput" placeholder="输入手机号" placeholder-style="color:#999999">
  120. </view>
  121. <view class="bmLine" v-if="info.clWhere.indexOf(2)!=-1" @click="focusState2cl">
  122. <input type="text" :hold-keyboard="true" :adjust-position="false" @blur="inputBindBlur" @focus="inputBindFocus" v-model="plateNumber" class="bmlineInput" placeholder="输入车牌号" placeholder-style="color:#999999">
  123. </view>
  124. <view class="bmLine" v-if="info.clWhere.indexOf(3)!=-1" @click="focusState3cl">
  125. <input type="text" :hold-keyboard="true" :adjust-position="false" @blur="inputBindBlur" @focus="inputBindFocus" v-model="customerName" class="bmlineInput" placeholder="输入姓名" placeholder-style="color:#999999">
  126. </view>
  127. <view class="bmLine" v-if="info.clWhere.indexOf(4)!=-1" @click="focusState4cl">
  128. <input type="text" :adjust-position="false" :hold-keyboard="true" @blur="inputBindBlur" @focus="inputBindFocus" v-model="unit" class="bmlineInput" placeholder="输入单位" placeholder-style="color:#999999">
  129. </view>
  130. </view>
  131. <view class="bmTtnBox">
  132. <view style="height: 1rpx;"></view>
  133. <view class="bmBtn" @click="submitOrder">
  134. <span v-if="info.money">¥{{info.money}} &nbsp; 立即抢购</span>
  135. <span v-else>立即报名</span>
  136. </view>
  137. </view>
  138. </view>
  139. </view>
  140. <!-- 门店弹框 -->
  141. <view class="baomingBox ckshopBox" v-if="ckshopShow">
  142. <view class="baomingCont">
  143. <view class="bmTop">
  144. <view class="bmTitle">选择门店</view>
  145. <img src="../../static/timg/chahao.png" alt="" class="bmChimg" @click="noShowShop">
  146. </view>
  147. <view style="padding: 0 24rpx; height: 45vh;overflow-y: scroll;">
  148. <view class="ckshopLine" v-for="(item,index) in info.shopList" @click="ckshop(item)">
  149. <view class="shoplineLeft">
  150. <image :src="item.photoPath" mode="" class="shopImg" v-if="item.photoPath"></image>
  151. <image src="../../static/img/noimg.png" mode="" class="shopImg" v-else></image>
  152. </view>
  153. <view class="shopright" style="padding-left: 20rpx;">
  154. <view class="shopTop">
  155. <view class="shopName">{{item.shopName}}</view>
  156. </view>
  157. <view class="brandsBg" v-if="item.brands">
  158. <view class="brands" v-for="(v,index2) in item.brands.split(',')">{{v}}</view>
  159. </view>
  160. <view class="shopTime"><span v-if="item.startTime">{{item.startTime}}</span> - <span
  161. v-if="item.endTime">{{item.endTime}}</span> </view>
  162. <view class="shopBottomLeft">
  163. <span class="shopaddress"
  164. v-if="item.address">{{item.provinceName}}{{item.cityName}}{{item.areaName}}{{item.address}}</span>
  165. <span v-if="item.distance&&item.distance!= '0.00'">{{item.distance}}km</span>
  166. </view>
  167. </view>
  168. </view>
  169. </view>
  170. </view>
  171. </view>
  172. <!-- 适用门店 -->
  173. <view class="baomingBox ckshopBox" v-if="useShopShow" @click="noShowShop2">
  174. <view class="baomingCont" @click.stop="">
  175. <view class="bmTop">
  176. <view class="bmTitle">选择门店</view>
  177. <img src="../../static/timg/chahao.png" alt="" class="bmChimg" @click="noShowShop2">
  178. </view>
  179. <view style="padding: 0 24rpx; height: 45vh;overflow-y: scroll;">
  180. <view class="ckshopLine" v-for="(item,index) in info.shopList" @click="ckshop(item)">
  181. <view class="shoplineLeft">
  182. <image :src="item.photoPath" mode="" class="shopImg" v-if="item.photoPath"></image>
  183. <image src="../../static/img/noimg.png" mode="" class="shopImg" v-else></image>
  184. </view>
  185. <view class="shopright" style="padding-left: 20rpx;">
  186. <view class="shopTop">
  187. <view class="shopName">{{item.shopName}}</view>
  188. </view>
  189. <view class="brandsBg" v-if="item.brands">
  190. <view class="brands" v-for="(v,index2) in item.brands.split(',')">{{v}}</view>
  191. </view>
  192. <view class="shopTime"><span v-if="item.startTime">{{item.startTime}}</span> - <span
  193. v-if="item.endTime">{{item.endTime}}</span> </view>
  194. <view class="shopBottomLeft">
  195. <span class="shopaddress"
  196. v-if="item.address">{{item.provinceName}}{{item.cityName}}{{item.areaName}}{{item.address}}</span>
  197. <span v-if="item.distance&&item.distance!= '0.00'">{{item.distance}}km</span>
  198. </view>
  199. </view>
  200. </view>
  201. </view>
  202. </view>
  203. </view>
  204. <img src="../../static/timg/mp3.png" class="mp3Img" @click="play()" v-if="!payshow&mp3Url!=''">
  205. <img src=".../../static/timg/mp31.png" class="mp3Img" @click="play2()" id="bofang" v-if="payshow&mp3Url!=''">
  206. </view>
  207. </template>
  208. <script>
  209. export default {
  210. data() {
  211. return {
  212. info:'',
  213. type:'',
  214. shopNum:'',
  215. shopInfo:'',
  216. activityEnd:true,
  217. activityNoOpen:true,
  218. shengyuD:'',
  219. shengyuH:'',
  220. shengyuM:'',
  221. queryShopList:'',
  222. collectingID:'',
  223. bmShow:false,
  224. ckshopShow:false,
  225. mainImg:'',
  226. dimgList:[],
  227. shopName:'',
  228. ckshopdata:'',
  229. customerName:'',
  230. mobilePhone:'',
  231. unit:'',
  232. plateNumber:'',
  233. comment:'',
  234. userInfo:'',
  235. useShopShow:false,
  236. jpHeight:0,
  237. isPlay: false,
  238. mp3Url:'',
  239. payshow:false,
  240. jpNum:1,
  241. focusState1:false,
  242. focusState2:false,
  243. focusState3:false,
  244. focusState4:false,
  245. shareId:'',
  246. }
  247. },
  248. onLoad(opt) {
  249. console.log(opt)
  250. if(opt.shareId){
  251. this.shareId=opt.shareId
  252. }
  253. this.userInfo=this.$store.state.userInfo;
  254. if(this.userInfo){
  255. this.collectingID=opt.id;
  256. //this.getInfo();
  257. this.queryActivityInfo();
  258. this.queryGoodsLook()
  259. }else{
  260. this.$common.automaticlogin().then(val => {
  261. this.userInfo=this.$store.state.userInfo;
  262. this.collectingID=opt.id;
  263. //this.getInfo();
  264. this.queryActivityInfo();
  265. this.queryGoodsLook()
  266. })
  267. }
  268. uni.onKeyboardHeightChange((obj)=>{
  269. // 获取系统信息
  270. let _sysInfo = uni.getSystemInfoSync();
  271. // let _heightDiff = _sysInfo.screenHeight - _sysInfo.windowHeight
  272. // let _diff = obj.height - _heightDiff
  273. // // 键盘高度
  274. // this.jpHeight = (_diff > 0 ? _diff : 0) - 2 + "px";
  275. })
  276. this.shopckList= uni.getStorageSync("shopckList");
  277. //this.ckmusic=uni.getStorageSync("ckmusic");
  278. },
  279. onPullDownRefresh(){
  280. //this.getInfo();
  281. this.queryActivityInfo();
  282. setTimeout(() => {
  283. uni.stopPullDownRefresh(); // 关闭下拉刷新
  284. }, 1000);
  285. },
  286. onHide(){
  287. this.bgmMusic.stop(()=>{
  288. console.log('背景音乐停止了');
  289. });
  290. },
  291. onUnload(){
  292. this.bgmMusic.stop()
  293. },
  294. methods: {
  295. focusState1cl(){
  296. this.focusState1=true;
  297. },
  298. focusState2cl(){
  299. this.focusState2=true;
  300. },
  301. focusState3cl(){
  302. this.focusState3=true;
  303. },
  304. focusState4cl(){
  305. this.focusState4=true;
  306. },
  307. inputBindFocus(e){
  308. //console.log( e.detail.height);
  309. this.jpHeight=e.detail.height+ "px";
  310. //console.log(this.jpHeight)
  311. },
  312. inputBindBlur(){
  313. //return false;
  314. uni.onKeyboardHeightChange((obj)=>{
  315. console.log("inputBindBlur"+obj.height)
  316. let _sysInfo = uni.getSystemInfoSync();
  317. let _heightDiff = _sysInfo.screenHeight - _sysInfo.windowHeight
  318. let _diff = obj.height - _heightDiff;
  319. console.log(_diff)
  320. if(_diff<0||_diff==0){
  321. this.jpHeight=0
  322. }
  323. // 键盘高度
  324. //this.jpHeight = (_diff > 0 ? _diff : 0) - 2 + "px";
  325. })
  326. if(this.jpNum==1){
  327. this.jpHeight=0
  328. }
  329. this.jpNum++;
  330. },
  331. queryGoodsLook(){
  332. this.$http('openmy/queryGoodsLook', {
  333. goodsId:this.collectingID,
  334. openId:this.userInfo.openId
  335. },'POST').then(res => {
  336. })
  337. },
  338. noShowShop2(){
  339. this.useShopShow=false;
  340. },
  341. useShow(){
  342. this.useShopShow=true;
  343. },
  344. submitOrder(){
  345. var jsonArray={
  346. itemId:this.collectingID,
  347. itemName:this.info.activityName,
  348. itemQty:1,
  349. salePrice:this.info.money?this.info.money:0,
  350. totalPrice:this.info.money?this.info.money:0,
  351. }
  352. if(this.ckshopdata==''){
  353. uni.showToast({
  354. title: '请选择服务门店',
  355. icon: 'none',
  356. duration: 3000
  357. });
  358. return false;
  359. }
  360. if(this.info.clWhere.indexOf(1)!=-1&&this.mobilePhone==''){
  361. uni.showToast({
  362. title: '请输入手机号',
  363. icon: 'none',
  364. duration: 3000
  365. });
  366. return false;
  367. }
  368. if(this.info.clWhere.indexOf(2)!=-1&&this.plateNumber==''){
  369. uni.showToast({
  370. title: '请输入车牌号',
  371. icon: 'none',
  372. duration: 3000
  373. });
  374. return false;
  375. }
  376. if(this.info.clWhere.indexOf(3)!=-1&&this.customerName==''){
  377. uni.showToast({
  378. title: '请输入姓名',
  379. icon: 'none',
  380. duration: 3000
  381. });
  382. return false;
  383. }
  384. if(this.info.clWhere.indexOf(4)!=-1&&this.unit==''){
  385. uni.showToast({
  386. title: '请输入单位',
  387. icon: 'none',
  388. duration: 3000
  389. });
  390. return false;
  391. }
  392. var arr=[]
  393. arr.push(jsonArray)
  394. var params={
  395. sheetType:'6',
  396. sheetContent:this.info.activityName,
  397. customerName:this.customerName,
  398. mobilePhone:this.mobilePhone,
  399. unit:this.unit,
  400. plateNumber:this.plateNumber,
  401. //carModel:this.carInfo.carModel,
  402. totalMoney:this.info.money?this.info.money:0,
  403. shopId:this.ckshopdata.id,
  404. comment:this.comment,
  405. sheetDetail:JSON.stringify(arr),
  406. payType:this.info.payType
  407. }
  408. uni.showLoading({
  409. title: '加载中'
  410. })
  411. this.$http('openMallOrder/submitOrder', params,'POST').then(res => {
  412. uni.hideLoading();
  413. if(res.code==0){
  414. this.orderData=res.data
  415. if(this.info.payType==1){
  416. this.unifiedPay(res.data)
  417. }else{
  418. uni.showToast({
  419. title: '报名成功',
  420. icon: 'none',
  421. duration: 3000
  422. });
  423. uni.redirectTo({
  424. url: "../user/myOrder/activityOrderDetail?id=" + this.orderData.id +"&SheetType=" + this.orderData.sheetType
  425. })
  426. }
  427. }else{
  428. uni.showToast({
  429. title: res.msg,
  430. icon: 'none',
  431. duration: 3000
  432. });
  433. }
  434. })
  435. },
  436. unifiedPay(res){
  437. this.$http('openMallOrder/unifiedPay', {
  438. sheetId:res.id
  439. },'POST').then(res => {
  440. if(res.code==0){
  441. this.requestPayment(res.data)
  442. }else{
  443. uni.showToast({
  444. title: res.msg,
  445. icon: 'none',
  446. duration: 3000
  447. });
  448. }
  449. })
  450. },
  451. requestPayment(res){
  452. var payInfo=res;
  453. //console.log(payInfo)
  454. //console.log(String(Date.now()))
  455. var that=this;
  456. uni.requestPayment({
  457. provider: 'wxpay',
  458. //timeStamp: String(Date.now()),
  459. timeStamp: payInfo.timeStamp,
  460. nonceStr: payInfo.nonceStr,
  461. package:payInfo.package,
  462. signType: payInfo.signType,
  463. paySign: payInfo.paySign,
  464. appid:payInfo.appId,
  465. success: function (res) {
  466. console.log('success:' + JSON.stringify(res));
  467. uni.showToast({
  468. title: '支付成功',
  469. icon:'none',
  470. duration: 2000
  471. });
  472. uni.redirectTo({
  473. url: "../user/myOrder/activityOrderDetail?id=" + that.orderData.id +"&SheetType=" + that.orderData.sheetType
  474. })
  475. },
  476. fail: function (err) {
  477. console.log(err)
  478. uni.showToast({
  479. title: '支付失败',
  480. icon:'none',
  481. duration: 2000
  482. });
  483. console.log(that.orderData)
  484. uni.redirectTo({
  485. url: "../user/myOrder/activityOrderDetail?id=" + that.orderData.id +"&SheetType=" + that.orderData.sheetType
  486. })
  487. }
  488. });
  489. },
  490. signUp(){
  491. this.info.shopList.forEach(item=>{
  492. if(item.id == this.shopInfo.id){
  493. this.ckshopdata=item;
  494. this.shopName=item.shopName;
  495. }
  496. })
  497. this.bmShow=true;
  498. },
  499. nobmshow(){
  500. this.bmShow=false;
  501. },
  502. ckshop(item){
  503. this.ckshopdata=item;
  504. this.shopName=item.shopName;
  505. this.ckshopShow=false;
  506. this.shopInfo=item
  507. this.useShopShow=false;
  508. },
  509. showCkshop(){
  510. console.log("选择门店")
  511. this.ckshopShow=true;
  512. },
  513. noShowShop(){
  514. this.ckshopShow=false;
  515. },
  516. queryActivityInfo(){
  517. uni.showLoading({
  518. title: '加载中'
  519. })
  520. this.$http('openHome/queryActivityInfo', {
  521. collectingID:this.collectingID
  522. }, 'GET').then(res => {
  523. //uni.hideLoading();
  524. this.info = res.data;
  525. this.getInfo()
  526. if(this.info.imgList){
  527. this.info.imgList.forEach(item=>{
  528. if(item.imgType==1){
  529. this.mainImg=item.img
  530. }else{
  531. this.dimgList.push(item)
  532. }
  533. })
  534. }
  535. if (this.info.endTime < this.info.startTime) {
  536. // this.$vux.toast.text('时间设置错误')
  537. return
  538. }
  539. // this.activityNoOpen
  540. if (Number(new Date().getTime()) > (Number(new Date(this.info.startTime.replace(/-/g, '/')).getTime()) || 0)) {
  541. console.log("现在时间大于开始时间")
  542. this.activityNoOpen = false
  543. } else {
  544. this.activityNoOpen = true
  545. }
  546. if (Number(new Date().getTime()) > Number(new Date(this.info.endTime.replace(/-/g, '/')).getTime())) {
  547. console.log("现在时间大于结束时间")
  548. this.activityEnd = true
  549. } else {
  550. this.activityEnd = false
  551. }
  552. if (!this.activityNoOpen && !this.activityEnd) {
  553. this.clock()
  554. }
  555. if (this.activityNoOpen && !this.activityEnd) {
  556. this.clock2()
  557. }
  558. if(this.info.music){
  559. this.bgmMusic = uni.createInnerAudioContext();
  560. this.bgmMusic.autoplay = true;//自动播放
  561. this.bgmMusic.loop = true;//循环播放
  562. this.mp3Url='http://dmsimg.66km.com/music/sakuratears.mp3';
  563. this.bgmMusic.src ='http://dmsimg.66km.com/music/sakuratears.mp3'//, mp3Url;//背景音乐地址
  564. this.bgmMusic.onPlay(function(){
  565. console.log('背景音乐播放中');
  566. });
  567. this.bgmMusic.onError((res) => {
  568. console.log(res.errMsg);
  569. console.log(res.errCode);
  570. });
  571. }
  572. })
  573. },
  574. play2(){
  575. this.bgmMusic.play();
  576. this.payshow=false;
  577. },
  578. play(){
  579. this.payshow=true;
  580. this.bgmMusic.stop(()=>{
  581. console.log('背景音乐停止了');
  582. });
  583. },
  584. getInfo(){
  585. this.$http('openreservation/getInfo', {
  586. lat: '',
  587. lng: '',
  588. }, 'GET').then(res => {
  589. uni.hideLoading();
  590. //this.shopInfo = res.data.shopInfo
  591. var shopinfo=res.data.shopInfo;
  592. this.info.shopList.forEach(item=>{
  593. //console.log(item.id)
  594. //console.log(shopinfo.id)
  595. if(item.id==shopinfo.id){
  596. this.shopInfo=shopinfo
  597. }
  598. })
  599. if(this.shopInfo==''){
  600. this.shopInfo=this.info.shopList[0]
  601. }
  602. })
  603. },
  604. call() {
  605. uni.makePhoneCall({
  606. phoneNumber: this.shopInfo.mobilePhone
  607. });
  608. },
  609. getmap() {
  610. console.log("打开地图")
  611. var that = this;
  612. if (!that.shopInfo.lat || !that.shopInfo.lng) {
  613. uni.showToast({
  614. title: '该店铺未设置定位',
  615. icon: 'none',
  616. duration: 3000
  617. });
  618. } else {
  619. uni.openLocation({
  620. latitude: Number(that.shopInfo.lat),
  621. longitude: Number(that.shopInfo.lng),
  622. name: that.shopInfo.shopName,
  623. address: that.shopInfo.provinceName + that.shopInfo.cityName + that.shopInfo.areaName + that.shopInfo.address,
  624. success: function() {
  625. console.log('success');
  626. },
  627. fail(err) {
  628. console.log(err)
  629. }
  630. });
  631. }
  632. },
  633. clock () {
  634. let _this = this
  635. let today = new Date() // 当前时间
  636. let h = today.getHours()
  637. let m = today.getMinutes()
  638. let s = today.getSeconds()
  639. let stopTime = new Date(_this.info.endTime.replace(/-/g, '/')) // 结束时间
  640. if (Number(new Date(_this.info.endTime).getTime()) < Number(new Date().getTime())) {
  641. this.activityEnd = true
  642. return
  643. }
  644. let stopH = stopTime.getHours()
  645. let stopM = stopTime.getMinutes()
  646. let stopS = stopTime.getSeconds()
  647. let shenyu = stopTime.getTime() - today.getTime() // 倒计时毫秒数
  648. let shengyuD = parseInt(shenyu / (60 * 60 * 24 * 1000)) // 转换为天
  649. let D = parseInt(shenyu) - parseInt(shengyuD * 60 * 60 * 24 * 1000)// 除去天的毫秒数
  650. let shengyuH = parseInt(D / (60 * 60 * 1000)) // 除去天的毫秒数转换成小时
  651. let H = D - shengyuH * 60 * 60 * 1000 // 除去天、小时的毫秒数
  652. let shengyuM = parseInt(H / (60 * 1000)) // 除去天的毫秒数转换成分钟
  653. let M = H - shengyuM * 60 * 1000// 除去天、小时、分的毫秒数
  654. let S = parseInt((shenyu - shengyuD * 60 * 60 * 24 * 1000 - shengyuH * 60 * 60 * 1000 - shengyuM * 60 * 1000) / 1000)// 除去天、小时、分的毫秒数转化为秒
  655. this.daojishi = '报名倒计时:' + shengyuD + '天' + shengyuH + '小时' + shengyuM + '分' + S + '秒'
  656. // setTimeout("clock()",500);
  657. this.shengyuM=shengyuM;
  658. this.shengyuD=shengyuD;
  659. this.shengyuH=shengyuH;
  660. setTimeout(_this.clock, 500)
  661. },
  662. clock2(){
  663. let _this = this
  664. let today = new Date() // 当前时间
  665. let h = today.getHours()
  666. let m = today.getMinutes()
  667. let s = today.getSeconds()
  668. let startTime = new Date(_this.info.startTime.replace(/-/g, '/')) // 结束时间
  669. if (Number(new Date(_this.info.startTime).getTime()) < Number(new Date().getTime())) {
  670. this.activityNoOpen = true
  671. return
  672. }
  673. let stopH = startTime.getHours()
  674. let stopM = startTime.getMinutes()
  675. let stopS = startTime.getSeconds()
  676. let shenyu = startTime.getTime() - today.getTime() // 倒计时毫秒数
  677. let shengyuD = parseInt(shenyu / (60 * 60 * 24 * 1000)) // 转换为天
  678. let D = parseInt(shenyu) - parseInt(shengyuD * 60 * 60 * 24 * 1000)// 除去天的毫秒数
  679. let shengyuH = parseInt(D / (60 * 60 * 1000)) // 除去天的毫秒数转换成小时
  680. let H = D - shengyuH * 60 * 60 * 1000 // 除去天、小时的毫秒数
  681. let shengyuM = parseInt(H / (60 * 1000)) // 除去天的毫秒数转换成分钟
  682. let M = H - shengyuM * 60 * 1000// 除去天、小时、分的毫秒数
  683. let S = parseInt((shenyu - shengyuD * 60 * 60 * 24 * 1000 - shengyuH * 60 * 60 * 1000 - shengyuM * 60 * 1000) / 1000)// 除去天、小时、分的毫秒数转化为秒
  684. this.daojishi = '报名倒计时:' + shengyuD + '天' + shengyuH + '小时' + shengyuM + '分' + S + '秒'
  685. // setTimeout("clock()",500);
  686. this.shengyuM=shengyuM;
  687. this.shengyuD=shengyuD;
  688. this.shengyuH=shengyuH;
  689. setTimeout(_this.clock2, 500)
  690. }
  691. },
  692. onShareAppMessage(res) {
  693. console.log(this.userInfo)
  694. var img='';
  695. /* if(this.info.ImgList.length>0){
  696. img=this.info.ImgList[0].url
  697. } */
  698. return {
  699. title: this.info.activityName,
  700. imageUrl:this.mainImg,
  701. path: 'pages/activity/jkDetail?id=' + this.collectingID+'&shareId='+this.userInfo.openId,
  702. success(res){
  703. uni.showToast({
  704. title:'分享成功'
  705. })
  706. },
  707. fail(res){
  708. uni.showToast({
  709. title:'分享失败',
  710. icon:'none',
  711. duration: 3000
  712. })
  713. }
  714. }
  715. },
  716. }
  717. </script>
  718. <style scoped>
  719. .mp3Img{
  720. /* transform: translate(-1584.4%, 121.5%) scale(1); */
  721. position: fixed;
  722. top: 40rpx;
  723. right: 40rpx;
  724. width: 60rpx;
  725. height: 60rpx;
  726. }
  727. .ckshopBox{
  728. z-index: 111 !important;
  729. }
  730. .shopline {
  731. padding: 20rpx 0;
  732. background-color: #FFFFFF;
  733. border-radius: 10rpx;
  734. display: flex;
  735. }
  736. .baomingBox{
  737. width: 750rpx;
  738. height: 100vh;
  739. background: rgba(0, 0, 0, 0.4);
  740. position: fixed;
  741. top: 0;
  742. left: 0;
  743. z-index: 11;
  744. /* display: flex;
  745. align-items: center; */
  746. }
  747. .bmTtnBox{
  748. width: 750rpx;
  749. height: 120rpx;
  750. background: #FFFFFF;
  751. box-shadow: 0px -2px 10rpx 0px rgba(153,153,153,0.2000);
  752. /* position: absolute;
  753. left: 0;
  754. bottom: 0; */
  755. /* padding-bottom: constant(safe-area-inset-bottom);
  756. padding-bottom: env(safe-area-inset-bottom); */
  757. }
  758. .bmBtn{
  759. width: 690rpx;
  760. height: 74rpx;
  761. background: #D53533;
  762. border-radius: 37rpx;
  763. text-align: center;
  764. line-height: 74rpx;
  765. color: #ffffff;
  766. font-size: 30rpx;
  767. margin-top: 23rpx;
  768. margin-left: 30rpx;
  769. margin-top: 20rpx;
  770. }
  771. .bmshopjt{
  772. width: 12rpx;
  773. height: 20rpx;
  774. margin-top: 10rpx;
  775. }
  776. .bmlineInput{
  777. color: #333333;
  778. font-size: 28rpx;
  779. height: 98rpx;
  780. line-height: 98rpx;
  781. }
  782. .bmshopname{
  783. font-weight: 400;
  784. color: #999999;
  785. font-size: 28rpx;
  786. line-height: 40rpx;
  787. width: 500rpx;
  788. white-space:nowrap;
  789. overflow:hidden;
  790. text-overflow:ellipsis;
  791. }
  792. .bmshopLine{
  793. display: flex;
  794. justify-content: space-between;
  795. padding: 26rpx 0;
  796. border-bottom: 1px solid #EEEEEE;
  797. }
  798. .bmLine{
  799. border-bottom: 1px solid #EEEEEE;
  800. }
  801. .bmTop{
  802. display: flex;
  803. justify-content: space-between;
  804. padding: 40rpx 24rpx 10rpx 24rpx;
  805. }
  806. .bmTitle{
  807. font-weight: 500;
  808. color: #3C3C3C;
  809. font-size: 30rpx;
  810. line-height: 36rpx;
  811. }
  812. .bmChimg{
  813. width: 36rpx;
  814. height: 36rpx;
  815. }
  816. .baomingCont{
  817. position: absolute;
  818. width: 750rpx;
  819. /* height:850rpx; */
  820. /* padding-bottom: constant(safe-area-inset-bottom);
  821. padding-bottom: env(safe-area-inset-bottom); */
  822. left: 0;
  823. bottom: 0;
  824. background: #ffffff;
  825. border-radius: 24rpx 24rpx 0px 0px;
  826. }
  827. .shareIcon{
  828. width: 48rpx;
  829. height: 48rpx;
  830. display: block;
  831. }
  832. .bottomBtnBox{
  833. display: flex;
  834. }
  835. .bottomBtnBoxLeft{
  836. padding-left: 40rpx;
  837. padding-top: 21rpx;
  838. }
  839. .shareTxt{
  840. color: #666666;font-size: 20rpx;
  841. text-align: center;
  842. }
  843. .bottomBtn{
  844. width: 598rpx;
  845. height: 74rpx;
  846. background: #D53533;
  847. border-radius: 37rpx;
  848. line-height: 74rpx;
  849. text-align: center;
  850. color: #ffffff;
  851. font-size: 30rpx;
  852. margin-top: 24rpx;
  853. margin-left: 34rpx;
  854. }
  855. .bottomBtn2{
  856. width: 598rpx;
  857. height: 74rpx;
  858. background: #DDDDDD;
  859. border-radius: 37rpx;
  860. line-height: 74rpx;
  861. text-align: center;
  862. color: #ffffff;
  863. font-size: 30rpx;
  864. margin-top: 24rpx;
  865. margin-left: 34rpx;
  866. }
  867. .timeTbox{
  868. width: 750rpx;
  869. height: 60rpx;
  870. background:#FFF5F0;
  871. border-radius: 24rpx 24rpx 0px 0px;
  872. border: 1px solid #EFE1D5;
  873. display: flex;
  874. justify-content: center;
  875. font-size: 24rpx;
  876. font-family: PingFangSC-Regular, PingFang SC;
  877. font-weight: 400;
  878. color: #764D49;
  879. }
  880. .timeviewTxt{
  881. line-height: 41rpx;
  882. padding-top: 10rpx;
  883. }
  884. .timeDivTxt{
  885. line-height: 60rpx;
  886. padding: 0 10rpx;
  887. }
  888. .timeK{
  889. height: 41rpx;
  890. line-height: 41rpx;
  891. color: #FFFFFF;
  892. width: 41rpx;
  893. text-align: center;
  894. background: #F03B3B;
  895. border-radius: 6rpx;
  896. margin-top: 9rpx;
  897. margin-left: 15rpx;
  898. margin-right: 15rpx;
  899. }
  900. .bottom{
  901. width: 750rpx;
  902. height: 180rpx;
  903. background: #FFFFFF;
  904. border-radius: 24rpx 24rpx 0px 0px;
  905. position: fixed;
  906. left: 0;
  907. bottom: 0;
  908. padding-bottom: constant(safe-area-inset-bottom);
  909. padding-bottom: env(safe-area-inset-bottom);
  910. }
  911. .signupBox{
  912. background: #ffffff;
  913. margin-top: 20rpx;
  914. }
  915. .seeBox{
  916. display: flex;
  917. flex-wrap: wrap;
  918. padding-left: 24rpx;
  919. padding-bottom: 20rpx;
  920. }
  921. .seeLine{
  922. padding-top: 14rpx;
  923. padding-right: 16rpx;
  924. }
  925. .signupLine{
  926. display: flex;
  927. justify-content: space-between;
  928. padding: 11rpx 0;
  929. border-bottom: 1px solid #DDDDDD;
  930. }
  931. .signupLineM{
  932. color: #3C3C3C;font-size: 26rpx;
  933. line-height: 56rpx;
  934. }
  935. .signupLineR{
  936. color: #999999;
  937. font-size: 26rpx;
  938. line-height: 56rpx;
  939. }
  940. .signupLineLName{
  941. font-weight: 400;
  942. color: #3C3C3C;
  943. font-size: 26rpx;
  944. padding-left: 16rpx;
  945. line-height: 56rpx;
  946. width: 150rpx;
  947. white-space:nowrap;
  948. overflow:hidden;
  949. text-overflow:ellipsis;
  950. }
  951. .signupCont{
  952. padding: 0 24rpx;
  953. }
  954. .signupLineLImg{
  955. width: 56rpx;
  956. height: 56rpx;
  957. border-radius: 8rpx;
  958. }
  959. .signupLineL{
  960. display: flex;
  961. }
  962. .signupTop{
  963. width: 750rpx;
  964. height: 78rpx;
  965. background: url(http://dmsphoto.66km.com.cn/thFiles/FF582E15-1971-4C04-8AB3-F7618FFB961D.png);
  966. background-size: 100% 100%;
  967. text-align: center;
  968. line-height: 78rpx;
  969. }
  970. .signupTops1{
  971. color: #FF0000;font-weight: 500;
  972. font-size: 28rpx;
  973. }
  974. .signupTops1{
  975. color: #703917;font-weight: 500;
  976. font-size: 28rpx;
  977. }
  978. .shopRightIcon{
  979. width: 44rpx;
  980. height: 44rpx;
  981. display: block;
  982. margin: 0 auto;
  983. margin-bottom: 10rpx;
  984. }
  985. .shopName{
  986. color: #3C3C3C;
  987. font-size: 28rpx;
  988. }
  989. .shopaddress{
  990. font-weight: 400;
  991. color: #999999;
  992. font-size: 24rpx;
  993. padding-top: 10rpx;
  994. width: 500rpx;
  995. }
  996. .shopRightSx{
  997. width: 2rpx;
  998. height: 69rpx;
  999. background:#EEEEEE ;
  1000. margin-left: 34rpx;
  1001. margin-right: 34rpx;
  1002. margin-top: 14rpx;
  1003. }
  1004. .shopCont{
  1005. display: flex;
  1006. justify-content: space-between;
  1007. padding-top: 25rpx;
  1008. }
  1009. .shopContRight{
  1010. display: flex;
  1011. }
  1012. .shopContRightLine{
  1013. text-align: center;
  1014. color: #999999;
  1015. font-size: 24rpx;
  1016. }
  1017. .content{
  1018. min-height: 100vh;
  1019. background:#F4F5F7;
  1020. }
  1021. .detailImg{
  1022. width: 750rpx;
  1023. display: block;
  1024. }
  1025. .detailBOx{
  1026. background: #ffffff;
  1027. margin-top: 20rpx;
  1028. }
  1029. .detailTitle{
  1030. color: #222222;
  1031. font-weight: 500;
  1032. padding: 20rpx 24rpx;
  1033. font-size: 30rpx;
  1034. }
  1035. .topimg{
  1036. width: 750rpx;
  1037. }
  1038. .shopMs{
  1039. font-weight: 500;
  1040. color: #222222;
  1041. line-height: 42rpx;
  1042. font-size: 30rpx;
  1043. }
  1044. .shopBox{
  1045. background: #ffffff;
  1046. margin-top: 20rpx;
  1047. padding: 20rpx 24rpx;
  1048. }
  1049. .shopBoxTop{
  1050. display: flex;
  1051. justify-content: space-between;
  1052. }
  1053. .shopTy{
  1054. display: flex;
  1055. }
  1056. .shopTyTxt{
  1057. font-weight: 400;
  1058. color: #666666;
  1059. font-size: 24rpx;
  1060. line-height: 42rpx;
  1061. }
  1062. .shopjt{
  1063. width: 14rpx;
  1064. height: 23rpx;
  1065. margin-top: 10rpx;
  1066. margin-left: 10rpx;
  1067. }
  1068. .cont{
  1069. background: #ffffff;
  1070. border-radius: 24rpx 24rpx 0px 0px;
  1071. margin-top: -30rpx;
  1072. padding: 30rpx 24rpx;
  1073. position: relative;
  1074. }
  1075. .name{
  1076. color: #3C3C3C;
  1077. line-height: 42rpx;
  1078. font-weight: 500;
  1079. font-size: 30rpx;
  1080. }
  1081. .name2{
  1082. color: #3C3C3C;
  1083. line-height: 36rpx;
  1084. font-weight: 400;
  1085. font-size: 26rpx;
  1086. padding-top: 16rpx;
  1087. }
  1088. .name3{
  1089. color: #999999;
  1090. line-height: 36rpx;
  1091. font-weight: 400;
  1092. font-size: 26rpx;
  1093. padding-top: 16rpx;
  1094. }
  1095. .shopImg {
  1096. width: 146rpx;
  1097. height: 146rpx;
  1098. border-radius: 6rpx;
  1099. }
  1100. .shopBox2 {
  1101. padding-top: 30rpx;
  1102. display: flex;
  1103. }
  1104. .flex {
  1105. display: flex;
  1106. justify-content: space-between;
  1107. }
  1108. .shopCont2 {
  1109. padding-left: 22rpx;
  1110. width: 520rpx;
  1111. }
  1112. .shopName {
  1113. color: #333333;
  1114. font-size: 26rpx;
  1115. font-weight: 600;
  1116. }
  1117. .span1 {
  1118. color: #FF4F00;
  1119. font-size: 36rpx;
  1120. }
  1121. .span2 {
  1122. color: #FF4F00;
  1123. font-size: 22rpx;
  1124. }
  1125. .span3 {
  1126. color: #333333;
  1127. font-size: 22rpx;
  1128. padding-left: 22rpx;
  1129. }
  1130. .shopBq {
  1131. color: #FF4F00;
  1132. font-size: 22rpx;
  1133. border-radius: 4rpx;
  1134. border: 1px solid #FF4F00;
  1135. line-height: 30rpx;
  1136. height: 30rpx;
  1137. padding: 0rpx 5rpx;
  1138. margin-top: 10rpx;
  1139. }
  1140. .brandsBg {
  1141. display: flex;
  1142. height: 38rpx;
  1143. flex-wrap: wrap;
  1144. align-items: center;
  1145. overflow: hidden;
  1146. padding: 5rpx 0rpx;
  1147. }
  1148. .brands {
  1149. border-radius: 4rpx;
  1150. padding: 0 5rpx;
  1151. color: #F19D01;
  1152. height: 28rpx;
  1153. border: 1px solid #F19D01;
  1154. font-size: 20rpx;
  1155. line-height: 28rpx;
  1156. margin: 5rpx 10rpx 5rpx 0rpx;
  1157. }
  1158. .timeBg {
  1159. display: flex;
  1160. }
  1161. .shopTime {
  1162. color: #666666;
  1163. font-size: 22rpx;
  1164. }
  1165. .addressBox {
  1166. color: #666666;
  1167. font-size: 22rpx;
  1168. }
  1169. .ckshopLine{
  1170. display: flex;
  1171. padding: 20rpx 0;
  1172. border-bottom: 1px solid #EEEEEE;
  1173. }
  1174. button::after{
  1175. border: none;
  1176. }
  1177. button{
  1178. position: relative;
  1179. display: block;
  1180. margin-left: 0;
  1181. margin-right: 0;
  1182. padding-left: 0px;
  1183. padding-right: 0px;
  1184. box-sizing: border-box;
  1185. // font-size: 18px;
  1186. text-align: center;
  1187. text-decoration: none;
  1188. // line-height: 1;
  1189. line-height: 1.35;
  1190. // border-radius: 5px;
  1191. -webkit-tap-highlight-color: transparent;
  1192. overflow: hidden;
  1193. color: #000000;
  1194. background-color: #fff;
  1195. height: 100%;
  1196. }
  1197. .shareBtn{
  1198. /* width: 100rpx; */
  1199. background: #FFFFFF;
  1200. }
  1201. </style>