jkDetail.vue 31 KB

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