jkDetail.vue 31 KB

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