jkDetail.vue 12 KB

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