activityDetail.vue 14 KB

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