activityDetail.vue 16 KB

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