jkDetail.vue 29 KB

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