activityDetail.vue 15 KB

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