activityDetail.vue 13 KB

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