jkDetail.vue 32 KB

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