jkDetail.vue 32 KB

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