jkDetail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <img :src="info.img" alt="" class="topimg">
  5. </view>
  6. <view class="cont">
  7. <view class="name">
  8. <view class="ptNameBz" v-if="info.groupType">
  9. {{info.groupNumber}}人团
  10. </view>
  11. <view style="width: 550rpx;">{{info.activityName}}</view>
  12. </view>
  13. <view class="name2">{{info.startTime.slice(0,10)}}~{{info.endTime.slice(0,10)}}</view>
  14. <view class="name3">{{info.activityContent}}</view>
  15. </view>
  16. <view class="couponPackageData" v-if="info.couponPackageName">
  17. <view class="couponPackageTitle">{{info.couponPackageName}}</view>
  18. <view class="linecouponCont" v-for="item in packageDetailList">
  19. <view class="linecouponContLeft">
  20. <view class="couponType" v-if="item.discountType==1">满减券</view>
  21. <view class="couponType" v-if="item.discountType==2">商品券</view>
  22. <view class="couponType" v-if="item.discountType==3">服务券</view>
  23. <view class="couponName">{{item.actName}}</view>
  24. </view>
  25. <view class="couponNum">x{{item.actQty}}</view>
  26. </view>
  27. </view>
  28. <view class="shopBox">
  29. <view class="shopBoxTop">
  30. <view class="shopMs">活动门店</view>
  31. <view class="shopTy" @click="showuse">
  32. <view class="shopTyTxt">{{shopNum}}家门店通用</view>
  33. <img src="../../static/img/jt2.png" alt="" class="shopjt">
  34. </view>
  35. </view>
  36. <view class="shopCont">
  37. <view class="shopContLeft">
  38. <view class="shopName">{{shopInfo.shopName}}</view>
  39. <view class="shopaddress">{{shopInfo.address}}</view>
  40. </view>
  41. <view class="shopContRight">
  42. <view class="shopContRightLine" @click="getmap">
  43. <img src="../../static/img/icon_map.png" alt="" class="shopRightIcon">
  44. <view class="shopRightTxt">地图</view>
  45. </view>
  46. <view class="shopRightSx"></view>
  47. <view class="shopContRightLine" @click="call">
  48. <img src="../../static/img/icon_phone.png" alt="" class="shopRightIcon">
  49. <view class="shopRightTxt">电话</view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="detailBOx" v-if="info.imgList">
  55. <view class="detailTitle">活动详情</view>
  56. <view class="detailImgBox" v-for="(item,index) in info.imgList.split(',')">
  57. <img :src="item" alt="" class="detailImg">
  58. </view>
  59. </view>
  60. <view style="height: 120rpx;"></view>
  61. <view class="bottom" v-if="type==1">
  62. <view class="bottomLeft" @click="edit1">编辑活动内容</view>
  63. <view class="bottomRight" @click="generate">生成活动</view>
  64. </view>
  65. <!-- 适用门店 -->
  66. <view class="baomingBox ckshopBox" v-if="useShopShow" @click="noShowShop2">
  67. <view class="baomingCont" @click.stop="">
  68. <view class="bmTop">
  69. <view class="bmTitle">活动门店</view>
  70. <img src="../../static/img/chahao.png" alt="" class="bmChimg" @click="noShowShop2">
  71. </view>
  72. <view style="padding: 0 24rpx; height: 65vh;overflow-y: scroll;">
  73. <view class="ckshopLine" v-for="(item,index) in shopckList" >
  74. <view class="shoplineLeft">
  75. <image :src="item.doorImg1" mode="" class="shopImg" v-if="item.doorImg1"></image>
  76. <image :src="item.doorImg2" mode="" class="shopImg" v-else-if="item.doorImg2"></image>
  77. <image src="../../static/img/noimg.png" mode="" class="shopImg" v-else></image>
  78. </view>
  79. <view class="shopright" style="padding-left: 20rpx;">
  80. <view class="shopTop">
  81. <view class="shopName">{{item.shopName}}</view>
  82. </view>
  83. <view class="brandsBg" v-if="item.brands">
  84. <view class="brands" v-for="(v,index2) in item.brands.split(',')">{{v}}</view>
  85. </view>
  86. <view class="shopTime"><span v-if="item.startTime">{{item.startTime}}</span> - <span
  87. v-if="item.endTime">{{item.endTime}}</span> </view>
  88. <view class="shopBottomLeft">
  89. <span class="shopaddress"
  90. v-if="item.address">{{item.provinceName}}{{item.cityName}}{{item.areaName}}{{item.address}}</span>
  91. <span v-if="item.distance&&item.distance!= '0.00'">{{item.distance}}km</span>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. <!-- <audio id="video" controls autoplay="autoplay" ref="iosclick" loop="loop" >
  99. <source src="http://dmsimg.66km.com/music/sakuratears.mp3" type="audio/mpeg">
  100. </audio> -->
  101. <img src="../../static/img/mp3.png" class="mp3Img" @click="play()" v-if="!payshow&mp3Url!=''">
  102. <img src=".../../static/img/mp31.png" class="mp3Img" @click="play2()" id="bofang" v-if="payshow&mp3Url!=''">
  103. </view>
  104. </template>
  105. <script>
  106. export default {
  107. data() {
  108. return {
  109. info:'',
  110. type:'',
  111. shopNum:'',
  112. shopInfo:'',
  113. useShopShow:false,
  114. shopckList:'',
  115. ckmusic:'',
  116. bgmMusic:'',
  117. payshow:false,
  118. mp3Url:'',
  119. packageDetailList:'',
  120. }
  121. },
  122. onLoad(opt) {
  123. if(opt.type==1){
  124. this.type=1;
  125. this.info = uni.getStorageSync("editdata");
  126. this.shopNum=this.info.shopList.split(',').length
  127. uni.setNavigationBarTitle({
  128. title:this.info.activityName
  129. })
  130. if(this.info.couponPackageId){
  131. this.$http('openH5SetTheGuest/couponPackageDetailList', {
  132. couponPackageId:this.info.couponPackageId
  133. },'GET').then(res => {
  134. this.packageDetailList=res.data
  135. })
  136. }
  137. }
  138. this.getShopinfo()
  139. this.shopckList= uni.getStorageSync("shopckList");
  140. this.ckmusic=uni.getStorageSync("ckmusic");
  141. if(this.ckmusic){
  142. this.mp3Url=this.ckmusic.music;
  143. this.bgmMusic = uni.createInnerAudioContext();
  144. this.bgmMusic.autoplay = true;//自动播放
  145. this.bgmMusic.loop = true;//循环播放
  146. //this.bgmMusic.src = 'http://dmsimg.66km.com/music/sakuratears.mp3';//背景音乐地址
  147. this.bgmMusic.src=this.ckmusic.music
  148. this.bgmMusic.onPlay(function(){
  149. console.log('背景音乐播放中');
  150. });
  151. this.bgmMusic.onError((res) => {
  152. console.log(res.errMsg);
  153. console.log(res.errCode);
  154. });
  155. }
  156. //console.log(this.bgmMusic)
  157. },
  158. onUnload(){
  159. this.bgmMusic.stop()
  160. },
  161. onHide(){
  162. this.bgmMusic.stop(()=>{
  163. console.log('背景音乐停止了');
  164. });
  165. },
  166. methods: {
  167. play2(){
  168. this.bgmMusic.play();
  169. this.payshow=false;
  170. },
  171. play(){
  172. this.payshow=true;
  173. this.bgmMusic.stop(()=>{
  174. console.log('背景音乐停止了');
  175. });
  176. },
  177. noShowShop2(){
  178. this.useShopShow=false;
  179. },
  180. showuse(){
  181. this.useShopShow=true;
  182. },
  183. call() {
  184. uni.makePhoneCall({
  185. phoneNumber: this.shopInfo.mobilePhone
  186. });
  187. },
  188. getmap() {
  189. console.log("打开地图");
  190. return false;
  191. var that = this;
  192. if (!that.shopInfo.lat || !that.shopInfo.lng) {
  193. uni.showToast({
  194. title: '该店铺未设置定位',
  195. icon: 'none',
  196. duration: 3000
  197. });
  198. } else {
  199. uni.openLocation({
  200. latitude: Number(that.shopInfo.lat),
  201. longitude: Number(that.shopInfo.lng),
  202. name: that.shopInfo.shopName,
  203. address: that.shopInfo.provinceName + that.shopInfo.cityName + that.shopInfo.areaName + that.shopInfo.address,
  204. success: function() {
  205. console.log('success');
  206. },
  207. fail(err) {
  208. console.log(err)
  209. }
  210. });
  211. }
  212. },
  213. edit1(){
  214. uni.navigateBack(-1)
  215. },
  216. auditSetTheGuest(){
  217. uni.showLoading({
  218. title: '加载中'
  219. })
  220. this.$http('openH5SetTheGuest/auditSetTheGuest', this.info,'POST').then(res => {
  221. uni.hideLoading();
  222. if(res.code==0){
  223. uni.showToast({
  224. title: '活动已生成',
  225. icon:'none',
  226. duration: 2000
  227. });
  228. /* uni.navigateTo({
  229. url:'activity?type=2'
  230. }) */
  231. uni.navigateTo({
  232. url:'activity'
  233. })
  234. }
  235. //this.list=res.data
  236. })
  237. },
  238. getShopinfo(){
  239. this.$http('openH5SetTheGuest/getShopInfo',{},'GET').then(res => {
  240. //this.shopInfo=res.data;
  241. var shopinfo=res.data;
  242. this.shopckList.forEach(item=>{
  243. if(item.id==shopinfo.id){
  244. this.shopInfo=shopinfo
  245. }
  246. })
  247. if(this.shopInfo==''){
  248. this.shopInfo=this.shopckList[0]
  249. }
  250. })
  251. },
  252. generate(){
  253. var that=this;
  254. uni.showModal({
  255. title: '提示',
  256. content: '活动已生成,是否立即启用',
  257. cancelText:'暂不启用',
  258. confirmText:'立即启用',
  259. success: function(res) {
  260. if (res.confirm) {
  261. that.info.clState=2;
  262. that.auditSetTheGuest()
  263. }else{
  264. console.log("no")
  265. that.info.clState=1;
  266. that.auditSetTheGuest()
  267. }
  268. }
  269. });
  270. }
  271. }
  272. }
  273. </script>
  274. <style scoped>
  275. .ptNameBz{
  276. font-weight: 500;line-height: 32rpx;
  277. font-size: 22rpx;height: 32rpx;
  278. color: #FD0F00;margin-top: 5rpx;margin-right: 10rpx;
  279. background: url('http://dmsphoto.66km.com.cn/thFiles/2AF1130F-C318-45D3-B057-FA0728B41046.png') no-repeat;
  280. background-size: 100% 100%;
  281. padding-left: 64rpx;padding-right: 4rpx;
  282. }
  283. .name{
  284. display: flex;
  285. }
  286. .mp3Img{
  287. /* transform: translate(-1584.4%, 121.5%) scale(1); */
  288. position: fixed;
  289. top: 100rpx;
  290. right: 40rpx;
  291. width: 60rpx;
  292. height: 60rpx;
  293. }
  294. .shopImg {
  295. width: 146rpx;
  296. height: 146rpx;
  297. border-radius: 6rpx;
  298. }
  299. .ckshopLine{
  300. display: flex;
  301. padding: 20rpx 0;
  302. border-bottom: 1px solid #EEEEEE;
  303. }
  304. .baomingBox{
  305. width: 750rpx;
  306. height: 100vh;
  307. background: rgba(0, 0, 0, 0.4);
  308. position: fixed;
  309. top: 0;
  310. left: 0;
  311. z-index: 11;
  312. }
  313. .bmshopjt{
  314. width: 12rpx;
  315. height: 20rpx;
  316. margin-top: 10rpx;
  317. }
  318. .bmlineInput{
  319. color: #333333;
  320. font-size: 28rpx;
  321. height: 98rpx;
  322. line-height: 98rpx;
  323. }
  324. .bmshopname{
  325. font-weight: 400;
  326. color: #999999;
  327. font-size: 28rpx;
  328. line-height: 40rpx;
  329. width: 500rpx;
  330. white-space:nowrap;
  331. overflow:hidden;
  332. text-overflow:ellipsis;
  333. }
  334. .bmshopLine{
  335. display: flex;
  336. justify-content: space-between;
  337. padding: 26rpx 0;
  338. border-bottom: 1px solid #EEEEEE;
  339. }
  340. .bmLine{
  341. border-bottom: 1px solid #EEEEEE;
  342. }
  343. .bmTop{
  344. display: flex;
  345. justify-content: space-between;
  346. padding: 40rpx 24rpx 10rpx 24rpx;
  347. }
  348. .bmTitle{
  349. font-weight: 500;
  350. color: #3C3C3C;
  351. font-size: 30rpx;
  352. line-height: 36rpx;
  353. }
  354. .bmChimg{
  355. width: 36rpx;
  356. height: 36rpx;
  357. }
  358. .baomingCont{
  359. position: absolute;
  360. width: 750rpx;
  361. /* height:850rpx; */
  362. /* padding-bottom: constant(safe-area-inset-bottom);
  363. padding-bottom: env(safe-area-inset-bottom); */
  364. left: 0;
  365. bottom: 0;
  366. background: #ffffff;
  367. border-radius: 24rpx 24rpx 0px 0px;
  368. padding-bottom: 10rpx;
  369. }
  370. .shopRightIcon{
  371. width: 44rpx;
  372. height: 44rpx;
  373. display: block;
  374. margin: 0 auto;
  375. margin-bottom: 10rpx;
  376. }
  377. .shopName{
  378. color: #3C3C3C;
  379. font-size: 28rpx;
  380. width: 500rpx;
  381. }
  382. .shopaddress{
  383. font-weight: 400;
  384. color: #999999;
  385. font-size: 24rpx;
  386. padding-top: 10rpx;
  387. width: 500rpx;
  388. }
  389. .shopRightSx{
  390. width: 2rpx;
  391. height: 69rpx;
  392. background:#EEEEEE ;
  393. margin-left: 34rpx;
  394. margin-right: 34rpx;
  395. margin-top: 14rpx;
  396. }
  397. .shopCont{
  398. display: flex;
  399. justify-content: space-between;
  400. padding-top: 25rpx;
  401. }
  402. .shopContRight{
  403. display: flex;
  404. }
  405. .shopContRightLine{
  406. text-align: center;
  407. color: #999999;
  408. font-size: 24rpx;
  409. }
  410. .content{
  411. min-height: 100vh;
  412. background:#F4F5F7;
  413. }
  414. .detailImg{
  415. width: 750rpx;
  416. display: block;
  417. }
  418. .detailBOx{
  419. background: #ffffff;
  420. margin-top: 20rpx;
  421. }
  422. .detailTitle{
  423. color: #3C3C3C;
  424. font-weight: 500;
  425. padding: 20rpx 24rpx;
  426. font-size: 30rpx;
  427. }
  428. .topimg{
  429. width: 750rpx;
  430. }
  431. .shopMs{
  432. font-weight: 500;
  433. color: #222222;
  434. line-height: 42rpx;
  435. font-size: 30rpx;
  436. }
  437. .shopBox{
  438. background: #ffffff;
  439. margin-top: 20rpx;
  440. padding: 20rpx 34rpx;
  441. }
  442. .shopBoxTop{
  443. display: flex;
  444. justify-content: space-between;
  445. }
  446. .shopTy{
  447. display: flex;
  448. }
  449. .shopTyTxt{
  450. font-weight: 400;
  451. color: #666666;
  452. font-size: 24rpx;
  453. line-height: 42rpx;
  454. }
  455. .shopjt{
  456. width: 14rpx;
  457. height: 23rpx;
  458. margin-top: 10rpx;
  459. margin-left: 10rpx;
  460. }
  461. .cont{
  462. background: #ffffff;
  463. border-radius: 24rpx 24rpx 0px 0px;
  464. margin-top: -30rpx;
  465. padding: 30rpx 24rpx;
  466. position: relative;
  467. }
  468. .name{
  469. color: #3C3C3C;
  470. line-height: 42rpx;
  471. font-weight: 500;
  472. font-size: 30rpx;
  473. }
  474. .name2{
  475. color: #3C3C3C;
  476. line-height: 36rpx;
  477. font-weight: 400;
  478. font-size: 26rpx;
  479. padding-top: 16rpx;
  480. }
  481. .name3{
  482. color: #999999;
  483. line-height: 36rpx;
  484. font-weight: 400;
  485. font-size: 26rpx;
  486. padding-top: 16rpx;
  487. }
  488. .bottom{
  489. width: 750rpx;
  490. height: 98rpx;
  491. background: #FFFFFF;
  492. position: fixed;
  493. bottom: 0;
  494. left: 0;
  495. display: flex;
  496. }
  497. .bottomLeft{
  498. width: 375rpx;
  499. line-height: 98rpx;
  500. text-align: center;
  501. color: #3C3C3C;
  502. font-size: 30rpx;
  503. }
  504. .bottomRight{
  505. width: 375rpx;
  506. height: 98rpx;
  507. background: #3F90F7;
  508. line-height: 98rpx;
  509. text-align: center;
  510. color: #FFFFFF;
  511. font-size: 30rpx;
  512. }
  513. .brandsBg {
  514. display: flex;
  515. height: 38rpx;
  516. flex-wrap: wrap;
  517. align-items: center;
  518. overflow: hidden;
  519. padding: 5rpx 0rpx;
  520. }
  521. .brands {
  522. border-radius: 4rpx;
  523. padding: 0 5rpx;
  524. color: #F19D01;
  525. height: 28rpx;
  526. border: 1px solid #F19D01;
  527. font-size: 20rpx;
  528. line-height: 28rpx;
  529. margin: 5rpx 10rpx 5rpx 0rpx;
  530. }
  531. .timeBg {
  532. display: flex;
  533. }
  534. .shopTime {
  535. color: #666666;
  536. font-size: 22rpx;
  537. }
  538. .addressBox {
  539. color: #666666;
  540. font-size: 22rpx;
  541. }
  542. .couponPackageData{
  543. background: #ffffff;
  544. margin-top: 20rpx;
  545. }
  546. .couponPackageTitle{
  547. padding-left: 24rpx;
  548. padding-top: 30rpx;
  549. color: #333333;
  550. font-size: 32rpx;
  551. line-height: 45rpx;
  552. font-weight: 500;
  553. }
  554. .linecoupon{
  555. justify-content: space-between;
  556. }
  557. .linecouponCont{
  558. display: flex;
  559. justify-content: space-between;
  560. padding: 15rpx 24rpx;
  561. }
  562. .linecouponContLeft{
  563. display: flex;
  564. }
  565. .couponType{
  566. color: #FFA511;
  567. border: 1px solid #FFA511;
  568. border-radius: 4rpx;
  569. font-size: 18rpx;
  570. line-height: 26rpx;
  571. padding: 0 8rpx;
  572. height: 26rpx;
  573. margin-top: 5rpx;
  574. }
  575. .couponName{
  576. font-size: 26rpx;line-height: 38rpx;color: #3C3C3C;
  577. padding-left: 20rpx;
  578. }
  579. .couponNum{
  580. font-size: 26rpx;line-height: 38rpx;color: #999999;
  581. }
  582. </style>