jkDetail.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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">{{info.activityName}}</view>
  8. <view class="name2">{{info.startTime}}~{{info.endTime}}</view>
  9. <view class="name3">{{info.activityContent}}</view>
  10. </view>
  11. <view class="shopBox">
  12. <view class="shopBoxTop">
  13. <view class="shopMs">活动门店</view>
  14. <view class="shopTy" @click="showuse">
  15. <view class="shopTyTxt">{{shopNum}}家门店通用</view>
  16. <img src="../../static/img/jt2.png" alt="" class="shopjt">
  17. </view>
  18. </view>
  19. <view class="shopCont">
  20. <view class="shopContLeft">
  21. <view class="shopName">{{shopInfo.shopName}}</view>
  22. <view class="shopaddress">{{shopInfo.address}}</view>
  23. </view>
  24. <view class="shopContRight">
  25. <view class="shopContRightLine" @click="getmap">
  26. <img src="../../static/img/icon_map.png" alt="" class="shopRightIcon">
  27. <view class="shopRightTxt">地图</view>
  28. </view>
  29. <view class="shopRightSx"></view>
  30. <view class="shopContRightLine" @click="call">
  31. <img src="../../static/img/icon_phone.png" alt="" class="shopRightIcon">
  32. <view class="shopRightTxt">电话</view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="detailBOx" v-if="info.imgList">
  38. <view class="detailTitle">活动详情</view>
  39. <view class="detailImgBox" v-for="(item,index) in info.imgList.split(',')">
  40. <img :src="item" alt="" class="detailImg">
  41. </view>
  42. </view>
  43. <view style="height: 120rpx;"></view>
  44. <view class="bottom" v-if="type==1">
  45. <view class="bottomLeft" @click="edit1">编辑活动内容</view>
  46. <view class="bottomRight" @click="generate">生成活动</view>
  47. </view>
  48. <!-- 适用门店 -->
  49. <view class="baomingBox ckshopBox" v-if="useShopShow" @click="noShowShop2">
  50. <view class="baomingCont" @click.stop="">
  51. <view class="bmTop">
  52. <view class="bmTitle">活动门店</view>
  53. <img src="../../static/img/chahao.png" alt="" class="bmChimg" @click="noShowShop2">
  54. </view>
  55. <view style="padding: 0 24rpx; height: 45vh;overflow-y: scroll;">
  56. <view class="ckshopLine" v-for="(item,index) in shopckList" >
  57. <view class="shoplineLeft">
  58. <image :src="item.photoPath" mode="" class="shopImg" v-if="item.photoPath"></image>
  59. <image src="../../static/img/noimg.png" mode="" class="shopImg" v-else></image>
  60. </view>
  61. <view class="shopright" style="padding-left: 20rpx;">
  62. <view class="shopTop">
  63. <view class="shopName">{{item.shopName}}</view>
  64. </view>
  65. <view class="brandsBg" v-if="item.brands">
  66. <view class="brands" v-for="(v,index2) in item.brands.split(',')">{{v}}</view>
  67. </view>
  68. <view class="shopTime"><span v-if="item.startTime">{{item.startTime}}</span> - <span
  69. v-if="item.endTime">{{item.endTime}}</span> </view>
  70. <view class="shopBottomLeft">
  71. <span class="shopaddress"
  72. v-if="item.address">{{item.provinceName}}{{item.cityName}}{{item.areaName}}{{item.address}}</span>
  73. <span v-if="item.distance&&item.distance!= '0.00'">{{item.distance}}km</span>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. export default {
  84. data() {
  85. return {
  86. info:'',
  87. type:'',
  88. shopNum:'',
  89. shopInfo:'',
  90. useShopShow:false,
  91. shopckList:'',
  92. }
  93. },
  94. onLoad(opt) {
  95. if(opt.type==1){
  96. this.type=1;
  97. this.info = uni.getStorageSync("editdata");
  98. this.shopNum=this.info.shopList.split(',').length
  99. uni.setNavigationBarTitle({
  100. title:this.info.activityName
  101. })
  102. }
  103. this.getShopinfo()
  104. this.shopckList= uni.getStorageSync("shopckList");
  105. },
  106. methods: {
  107. noShowShop2(){
  108. this.useShopShow=false;
  109. },
  110. showuse(){
  111. this.useShopShow=true;
  112. },
  113. call() {
  114. uni.makePhoneCall({
  115. phoneNumber: this.shopInfo.mobilePhone
  116. });
  117. },
  118. getmap() {
  119. console.log("打开地图");
  120. return false;
  121. var that = this;
  122. if (!that.shopInfo.lat || !that.shopInfo.lng) {
  123. uni.showToast({
  124. title: '该店铺未设置定位',
  125. icon: 'none',
  126. duration: 3000
  127. });
  128. } else {
  129. uni.openLocation({
  130. latitude: Number(that.shopInfo.lat),
  131. longitude: Number(that.shopInfo.lng),
  132. name: that.shopInfo.shopName,
  133. address: that.shopInfo.provinceName + that.shopInfo.cityName + that.shopInfo.areaName + that.shopInfo.address,
  134. success: function() {
  135. console.log('success');
  136. },
  137. fail(err) {
  138. console.log(err)
  139. }
  140. });
  141. }
  142. },
  143. edit1(){
  144. uni.navigateBack(-1)
  145. },
  146. auditSetTheGuest(){
  147. uni.showLoading({
  148. title: '加载中'
  149. })
  150. this.$http('openH5SetTheGuest/auditSetTheGuest', this.info,'POST').then(res => {
  151. uni.hideLoading();
  152. if(res.code==0){
  153. uni.showToast({
  154. title: '活动已生成',
  155. icon:'none',
  156. duration: 2000
  157. });
  158. }
  159. //this.list=res.data
  160. })
  161. },
  162. getShopinfo(){
  163. this.$http('openH5SetTheGuest/getShopinfo',{},'GET').then(res => {
  164. this.shopInfo=res.data
  165. })
  166. },
  167. generate(){
  168. var that=this;
  169. uni.showModal({
  170. title: '提示',
  171. content: '活动已生成,是否立即启用',
  172. cancelText:'暂不启用',
  173. confirmText:'立即启用',
  174. success: function(res) {
  175. if (res.confirm) {
  176. that.info.clState=2;
  177. that.auditSetTheGuest()
  178. }else{
  179. console.log("no")
  180. that.info.clState=1;
  181. that.auditSetTheGuest()
  182. }
  183. }
  184. });
  185. }
  186. }
  187. }
  188. </script>
  189. <style scoped>
  190. .shopImg {
  191. width: 146rpx;
  192. height: 146rpx;
  193. border-radius: 6rpx;
  194. }
  195. .ckshopLine{
  196. display: flex;
  197. padding: 20rpx 0;
  198. border-bottom: 1px solid #EEEEEE;
  199. }
  200. .baomingBox{
  201. width: 750rpx;
  202. height: 100vh;
  203. background: rgba(0, 0, 0, 0.4);
  204. position: fixed;
  205. top: 0;
  206. left: 0;
  207. z-index: 11;
  208. }
  209. .bmshopjt{
  210. width: 12rpx;
  211. height: 20rpx;
  212. margin-top: 10rpx;
  213. }
  214. .bmlineInput{
  215. color: #333333;
  216. font-size: 28rpx;
  217. height: 98rpx;
  218. line-height: 98rpx;
  219. }
  220. .bmshopname{
  221. font-weight: 400;
  222. color: #999999;
  223. font-size: 28rpx;
  224. line-height: 40rpx;
  225. width: 500rpx;
  226. white-space:nowrap;
  227. overflow:hidden;
  228. text-overflow:ellipsis;
  229. }
  230. .bmshopLine{
  231. display: flex;
  232. justify-content: space-between;
  233. padding: 26rpx 0;
  234. border-bottom: 1px solid #EEEEEE;
  235. }
  236. .bmLine{
  237. border-bottom: 1px solid #EEEEEE;
  238. }
  239. .bmTop{
  240. display: flex;
  241. justify-content: space-between;
  242. padding: 40rpx 24rpx 10rpx 24rpx;
  243. }
  244. .bmTitle{
  245. font-weight: 500;
  246. color: #3C3C3C;
  247. font-size: 30rpx;
  248. line-height: 36rpx;
  249. }
  250. .bmChimg{
  251. width: 36rpx;
  252. height: 36rpx;
  253. }
  254. .baomingCont{
  255. position: absolute;
  256. width: 750rpx;
  257. height:850rpx;
  258. padding-bottom: constant(safe-area-inset-bottom);
  259. padding-bottom: env(safe-area-inset-bottom);
  260. left: 0;
  261. bottom: 0;
  262. background: #ffffff;
  263. border-radius: 24rpx 24rpx 0px 0px;
  264. }
  265. .shopRightIcon{
  266. width: 44rpx;
  267. height: 44rpx;
  268. display: block;
  269. margin: 0 auto;
  270. margin-bottom: 10rpx;
  271. }
  272. .shopName{
  273. color: #3C3C3C;
  274. font-size: 28rpx;
  275. }
  276. .shopaddress{
  277. font-weight: 400;
  278. color: #999999;
  279. font-size: 24rpx;
  280. padding-top: 10rpx;
  281. width: 500rpx;
  282. }
  283. .shopRightSx{
  284. width: 2rpx;
  285. height: 69rpx;
  286. background:#EEEEEE ;
  287. margin-left: 34rpx;
  288. margin-right: 34rpx;
  289. margin-top: 14rpx;
  290. }
  291. .shopCont{
  292. display: flex;
  293. justify-content: space-between;
  294. padding-top: 25rpx;
  295. }
  296. .shopContRight{
  297. display: flex;
  298. }
  299. .shopContRightLine{
  300. text-align: center;
  301. color: #999999;
  302. font-size: 24rpx;
  303. }
  304. .content{
  305. min-height: 100vh;
  306. background:#F4F5F7;
  307. }
  308. .detailImg{
  309. width: 750rpx;
  310. display: block;
  311. }
  312. .detailBOx{
  313. background: #ffffff;
  314. margin-top: 20rpx;
  315. }
  316. .detailTitle{
  317. color: #3C3C3C;
  318. font-weight: 500;
  319. padding: 20rpx 24rpx;
  320. font-size: 30rpx;
  321. }
  322. .topimg{
  323. width: 750rpx;
  324. }
  325. .shopMs{
  326. font-weight: 500;
  327. color: #222222;
  328. line-height: 42rpx;
  329. font-size: 30rpx;
  330. }
  331. .shopBox{
  332. background: #ffffff;
  333. margin-top: 20rpx;
  334. padding: 20rpx 34rpx;
  335. }
  336. .shopBoxTop{
  337. display: flex;
  338. justify-content: space-between;
  339. }
  340. .shopTy{
  341. display: flex;
  342. }
  343. .shopTyTxt{
  344. font-weight: 400;
  345. color: #666666;
  346. font-size: 24rpx;
  347. line-height: 42rpx;
  348. }
  349. .shopjt{
  350. width: 14rpx;
  351. height: 23rpx;
  352. margin-top: 10rpx;
  353. margin-left: 10rpx;
  354. }
  355. .cont{
  356. background: #ffffff;
  357. border-radius: 24rpx 24rpx 0px 0px;
  358. margin-top: -30rpx;
  359. padding: 30rpx 24rpx;
  360. position: relative;
  361. }
  362. .name{
  363. color: #3C3C3C;
  364. line-height: 42rpx;
  365. font-weight: 500;
  366. font-size: 30rpx;
  367. }
  368. .name2{
  369. color: #3C3C3C;
  370. line-height: 36rpx;
  371. font-weight: 400;
  372. font-size: 26rpx;
  373. padding-top: 16rpx;
  374. }
  375. .name3{
  376. color: #999999;
  377. line-height: 36rpx;
  378. font-weight: 400;
  379. font-size: 26rpx;
  380. padding-top: 16rpx;
  381. }
  382. .bottom{
  383. width: 750rpx;
  384. height: 98rpx;
  385. background: #FFFFFF;
  386. position: fixed;
  387. bottom: 0;
  388. left: 0;
  389. display: flex;
  390. }
  391. .bottomLeft{
  392. width: 375rpx;
  393. line-height: 98rpx;
  394. text-align: center;
  395. color: #3C3C3C;
  396. font-size: 30rpx;
  397. }
  398. .bottomRight{
  399. width: 375rpx;
  400. height: 98rpx;
  401. background: #3F90F7;
  402. line-height: 98rpx;
  403. text-align: center;
  404. color: #FFFFFF;
  405. font-size: 30rpx;
  406. }
  407. .brandsBg {
  408. display: flex;
  409. height: 38rpx;
  410. flex-wrap: wrap;
  411. align-items: center;
  412. overflow: hidden;
  413. padding: 5rpx 0rpx;
  414. }
  415. .brands {
  416. border-radius: 4rpx;
  417. padding: 0 5rpx;
  418. color: #F19D01;
  419. height: 28rpx;
  420. border: 1px solid #F19D01;
  421. font-size: 20rpx;
  422. line-height: 28rpx;
  423. margin: 5rpx 10rpx 5rpx 0rpx;
  424. }
  425. .timeBg {
  426. display: flex;
  427. }
  428. .shopTime {
  429. color: #666666;
  430. font-size: 22rpx;
  431. }
  432. .addressBox {
  433. color: #666666;
  434. font-size: 22rpx;
  435. }
  436. </style>