activityDetail.vue 16 KB

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