jkDetail.vue 14 KB

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