jkDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  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. uni.navigateTo({
  210. url:'activity'
  211. })
  212. }
  213. //this.list=res.data
  214. })
  215. },
  216. getShopinfo(){
  217. this.$http('openH5SetTheGuest/getShopInfo',{},'GET').then(res => {
  218. //this.shopInfo=res.data;
  219. var shopinfo=res.data;
  220. this.shopckList.forEach(item=>{
  221. if(item.id==shopinfo.id){
  222. this.shopInfo=shopinfo
  223. }
  224. })
  225. if(this.shopInfo==''){
  226. this.shopInfo=this.shopckList[0]
  227. }
  228. })
  229. },
  230. generate(){
  231. var that=this;
  232. uni.showModal({
  233. title: '提示',
  234. content: '活动已生成,是否立即启用',
  235. cancelText:'暂不启用',
  236. confirmText:'立即启用',
  237. success: function(res) {
  238. if (res.confirm) {
  239. that.info.clState=2;
  240. that.auditSetTheGuest()
  241. }else{
  242. console.log("no")
  243. that.info.clState=1;
  244. that.auditSetTheGuest()
  245. }
  246. }
  247. });
  248. }
  249. }
  250. }
  251. </script>
  252. <style scoped>
  253. .ptNameBz{
  254. font-weight: 500;line-height: 32rpx;
  255. font-size: 22rpx;height: 32rpx;
  256. color: #FD0F00;margin-top: 5rpx;margin-right: 10rpx;
  257. background: url('http://dmsphoto.66km.com.cn/thFiles/2AF1130F-C318-45D3-B057-FA0728B41046.png') no-repeat;
  258. background-size: 100% 100%;
  259. padding-left: 64rpx;padding-right: 4rpx;
  260. }
  261. .name{
  262. display: flex;
  263. }
  264. .mp3Img{
  265. /* transform: translate(-1584.4%, 121.5%) scale(1); */
  266. position: fixed;
  267. top: 100rpx;
  268. right: 40rpx;
  269. width: 60rpx;
  270. height: 60rpx;
  271. }
  272. .shopImg {
  273. width: 146rpx;
  274. height: 146rpx;
  275. border-radius: 6rpx;
  276. }
  277. .ckshopLine{
  278. display: flex;
  279. padding: 20rpx 0;
  280. border-bottom: 1px solid #EEEEEE;
  281. }
  282. .baomingBox{
  283. width: 750rpx;
  284. height: 100vh;
  285. background: rgba(0, 0, 0, 0.4);
  286. position: fixed;
  287. top: 0;
  288. left: 0;
  289. z-index: 11;
  290. }
  291. .bmshopjt{
  292. width: 12rpx;
  293. height: 20rpx;
  294. margin-top: 10rpx;
  295. }
  296. .bmlineInput{
  297. color: #333333;
  298. font-size: 28rpx;
  299. height: 98rpx;
  300. line-height: 98rpx;
  301. }
  302. .bmshopname{
  303. font-weight: 400;
  304. color: #999999;
  305. font-size: 28rpx;
  306. line-height: 40rpx;
  307. width: 500rpx;
  308. white-space:nowrap;
  309. overflow:hidden;
  310. text-overflow:ellipsis;
  311. }
  312. .bmshopLine{
  313. display: flex;
  314. justify-content: space-between;
  315. padding: 26rpx 0;
  316. border-bottom: 1px solid #EEEEEE;
  317. }
  318. .bmLine{
  319. border-bottom: 1px solid #EEEEEE;
  320. }
  321. .bmTop{
  322. display: flex;
  323. justify-content: space-between;
  324. padding: 40rpx 24rpx 10rpx 24rpx;
  325. }
  326. .bmTitle{
  327. font-weight: 500;
  328. color: #3C3C3C;
  329. font-size: 30rpx;
  330. line-height: 36rpx;
  331. }
  332. .bmChimg{
  333. width: 36rpx;
  334. height: 36rpx;
  335. }
  336. .baomingCont{
  337. position: absolute;
  338. width: 750rpx;
  339. /* height:850rpx; */
  340. /* padding-bottom: constant(safe-area-inset-bottom);
  341. padding-bottom: env(safe-area-inset-bottom); */
  342. left: 0;
  343. bottom: 0;
  344. background: #ffffff;
  345. border-radius: 24rpx 24rpx 0px 0px;
  346. padding-bottom: 10rpx;
  347. }
  348. .shopRightIcon{
  349. width: 44rpx;
  350. height: 44rpx;
  351. display: block;
  352. margin: 0 auto;
  353. margin-bottom: 10rpx;
  354. }
  355. .shopName{
  356. color: #3C3C3C;
  357. font-size: 28rpx;
  358. width: 500rpx;
  359. }
  360. .shopaddress{
  361. font-weight: 400;
  362. color: #999999;
  363. font-size: 24rpx;
  364. padding-top: 10rpx;
  365. width: 500rpx;
  366. }
  367. .shopRightSx{
  368. width: 2rpx;
  369. height: 69rpx;
  370. background:#EEEEEE ;
  371. margin-left: 34rpx;
  372. margin-right: 34rpx;
  373. margin-top: 14rpx;
  374. }
  375. .shopCont{
  376. display: flex;
  377. justify-content: space-between;
  378. padding-top: 25rpx;
  379. }
  380. .shopContRight{
  381. display: flex;
  382. }
  383. .shopContRightLine{
  384. text-align: center;
  385. color: #999999;
  386. font-size: 24rpx;
  387. }
  388. .content{
  389. min-height: 100vh;
  390. background:#F4F5F7;
  391. }
  392. .detailImg{
  393. width: 750rpx;
  394. display: block;
  395. }
  396. .detailBOx{
  397. background: #ffffff;
  398. margin-top: 20rpx;
  399. }
  400. .detailTitle{
  401. color: #3C3C3C;
  402. font-weight: 500;
  403. padding: 20rpx 24rpx;
  404. font-size: 30rpx;
  405. }
  406. .topimg{
  407. width: 750rpx;
  408. }
  409. .shopMs{
  410. font-weight: 500;
  411. color: #222222;
  412. line-height: 42rpx;
  413. font-size: 30rpx;
  414. }
  415. .shopBox{
  416. background: #ffffff;
  417. margin-top: 20rpx;
  418. padding: 20rpx 34rpx;
  419. }
  420. .shopBoxTop{
  421. display: flex;
  422. justify-content: space-between;
  423. }
  424. .shopTy{
  425. display: flex;
  426. }
  427. .shopTyTxt{
  428. font-weight: 400;
  429. color: #666666;
  430. font-size: 24rpx;
  431. line-height: 42rpx;
  432. }
  433. .shopjt{
  434. width: 14rpx;
  435. height: 23rpx;
  436. margin-top: 10rpx;
  437. margin-left: 10rpx;
  438. }
  439. .cont{
  440. background: #ffffff;
  441. border-radius: 24rpx 24rpx 0px 0px;
  442. margin-top: -30rpx;
  443. padding: 30rpx 24rpx;
  444. position: relative;
  445. }
  446. .name{
  447. color: #3C3C3C;
  448. line-height: 42rpx;
  449. font-weight: 500;
  450. font-size: 30rpx;
  451. }
  452. .name2{
  453. color: #3C3C3C;
  454. line-height: 36rpx;
  455. font-weight: 400;
  456. font-size: 26rpx;
  457. padding-top: 16rpx;
  458. }
  459. .name3{
  460. color: #999999;
  461. line-height: 36rpx;
  462. font-weight: 400;
  463. font-size: 26rpx;
  464. padding-top: 16rpx;
  465. }
  466. .bottom{
  467. width: 750rpx;
  468. height: 98rpx;
  469. background: #FFFFFF;
  470. position: fixed;
  471. bottom: 0;
  472. left: 0;
  473. display: flex;
  474. }
  475. .bottomLeft{
  476. width: 375rpx;
  477. line-height: 98rpx;
  478. text-align: center;
  479. color: #3C3C3C;
  480. font-size: 30rpx;
  481. }
  482. .bottomRight{
  483. width: 375rpx;
  484. height: 98rpx;
  485. background: #3F90F7;
  486. line-height: 98rpx;
  487. text-align: center;
  488. color: #FFFFFF;
  489. font-size: 30rpx;
  490. }
  491. .brandsBg {
  492. display: flex;
  493. height: 38rpx;
  494. flex-wrap: wrap;
  495. align-items: center;
  496. overflow: hidden;
  497. padding: 5rpx 0rpx;
  498. }
  499. .brands {
  500. border-radius: 4rpx;
  501. padding: 0 5rpx;
  502. color: #F19D01;
  503. height: 28rpx;
  504. border: 1px solid #F19D01;
  505. font-size: 20rpx;
  506. line-height: 28rpx;
  507. margin: 5rpx 10rpx 5rpx 0rpx;
  508. }
  509. .timeBg {
  510. display: flex;
  511. }
  512. .shopTime {
  513. color: #666666;
  514. font-size: 22rpx;
  515. }
  516. .addressBox {
  517. color: #666666;
  518. font-size: 22rpx;
  519. }
  520. </style>