jkDetail.vue 14 KB

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