discountCardDetail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. <template>
  2. <view class="box">
  3. <view style="width: 750rpx;height: 172rpx;" class="boxtop" :style="{background:'#'+themeColor}"></view>
  4. <view class="detailBg">
  5. <view class="detailTop">
  6. <view class="leftB" v-if="detail.discountType==1">
  7. <view class="use">¥<span class="use2">{{detail.actMoney}}</span></view>
  8. <view class="tiaojian">{{detail.whereMoney!==0?'满'+detail.whereMoney+'元可用':'满任意金额可用'}}</view>
  9. </view>
  10. <view v-if="detail.discountType!=1" class="leftB" style="display: flex;align-items: center;justify-content: center;">
  11. <image src="http://dmsphoto.66km.com.cn/thFiles/5340A784-FEE2-43FA-8ED1-C509FADFDBED.png"
  12. mode="" style="width: 77rpx;height:48rpx;"></image>
  13. </view>
  14. <view class="centerB">
  15. <view class="name">
  16. <span class="djq" v-if="detail.discountType==1">代金券</span>
  17. <span class="djq" v-if="detail.discountType==2">商品券</span>
  18. <span class="djq" v-if="detail.discountType==3">服务券</span>
  19. <span>{{detail.actName}}</span>
  20. </view>
  21. <view class="time" v-if="detail.startTime">
  22. 有效期:{{detail.startTime.slice(0,10)}}至{{detail.endTime.slice(0,10)}}</view>
  23. <view class="time" v-else>有效期:领取后{{detail.endOffsetDays}}天</view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="comtentBox">
  28. <view style="margin-bottom: 30rpx;">
  29. <view style="display: flex;justify-content: space-between;">
  30. <view class="titleBox">
  31. <image src="../../static/img/icon_youhui_red.png" mode="" class="redPoint"></image>
  32. <view class="title">适用门店</view>
  33. </view>
  34. <view v-if="detail.shopList.length" @click="spShopS" style="color: #666666;font-size: 24rpx;line-height: 24rpx;display: flex;">
  35. {{detail.shopList.length}}家门店通用
  36. <image src="../../static/img/little_rightArrow.png" mode="" style="width: 24rpx;height: 24rpx;"></image>
  37. </view>
  38. </view>
  39. <view v-if="detail.shopList.length">
  40. <view class="shopline" >
  41. <view class="newdistance" v-if="detail.shopList[0].distance&&detail.shopList[0].distance!= '0.00'">
  42. <image src="../../static/img2/dh.png" mode="" class="dhImg"></image>
  43. <view style="padding-top: 6rpx;"><span >{{detail.shopList[0].distance}}km</span></view>
  44. </view>
  45. <view class="shoplineLeft">
  46. <image :src="detail.shopList[0].doorImg1" mode="" class="shopImg" v-if="detail.shopList[0].doorImg1"></image>
  47. <image :src="detail.shopList[0].doorImg2" mode="" class="shopImg" v-else-if="detail.shopList[0].doorImg2"></image>
  48. <image src="../../static/timg/noimg.png" mode="" class="shopImg" v-else></image>
  49. </view>
  50. <view class="shopright">
  51. <view style="width: 410rpx;">
  52. <view class="shopTop">
  53. <view class="shopName">{{detail.shopList[0].shopName}}</view>
  54. </view>
  55. </view>
  56. <view class="shopTime">营业时间:<span v-if="detail.shopList[0].startTime">{{detail.shopList[0].startTime}}</span> - <span
  57. v-if="detail.shopList[0].endTime">{{detail.shopList[0].endTime}}</span> </view>
  58. <view class="shopBottomLeft">
  59. <span class="shopaddress"
  60. v-if="detail.shopList[0].address">{{detail.shopList[0].provinceName}}{{detail.shopList[0].cityName}}{{detail.shopList[0].areaName}}{{detail.shopList[0].address}}</span>
  61. <!-- <span v-if="item.distance&&item.distance!= '0.00'">{{item.distance}}km</span> -->
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <view>
  68. <view class="titleBox">
  69. <image src="../../static/img/icon_youhui_red.png" mode="" class="redPoint"></image>
  70. <view class="title">使用说明</view>
  71. </view>
  72. <view style="font-size: 20rpx;" v-if="detail.couContent" v-html="detail.couContent"></view>
  73. <view v-else class="content">暂无</view>
  74. </view>
  75. </view>
  76. <view class="comtentBox" v-if="detail.usedState==1">
  77. <view class="titleBox">
  78. <image src="../../static/img/icon_youhui_red.png" mode="" class="redPoint"></image>
  79. <view class="title">使用记录</view>
  80. </view>
  81. <view class="couponCodeBox">
  82. <view class="couponCodeYd"></view>
  83. <view class="ouponCode">{{detail.couponCode}}</view>
  84. <view class="couponCodeUse">已使用</view>
  85. </view>
  86. <view class="couponCodeLine">
  87. <view class="couponCodeLeft">核销时间:</view>
  88. <view class="couponCodeLineRight">{{detail.usedTime}}</view>
  89. </view>
  90. <view class="couponCodeLine">
  91. <view class="couponCodeLeft">核销门店:</view>
  92. <view class="couponCodeLineRight">{{detail.usedShopName}}</view>
  93. </view>
  94. </view>
  95. <view style="height: 120rpx;"></view>
  96. <view class="useBox" v-if="detail.state==0">
  97. <view class="useBtn" @click="hxHide">去使用</view>
  98. </view>
  99. <!-- 核销码 -->
  100. <view class="authorizBox" v-if="hxShow" @click="hxclose">
  101. <view class="hxBox" @click.stop="">
  102. <view class="chBox">
  103. <img src="../../static/timg/chahao.png" alt="" class="chahaoImg" @click="hxclose"/>
  104. </view>
  105. <view class="hxName">{{detail.actName}}</view>
  106. <view class="hxTime" v-if="detail.startTime">
  107. 有效期:{{detail.startTime.slice(0,10)}}至{{detail.endTime.slice(0,10)}}</view>
  108. <view class="hxTime" v-else>有效期:领取后{{detail.endOffsetDays}}天</view>
  109. <view style="display: flex;justify-content: center;padding-top:50rpx;">
  110. <tki-qrcode cid="qrcode1" ref="qrcode" :val="detail.couponCode" :size="400" :unit="unit"
  111. :pdground="pdground" :icon="icon" :iconSize="iconsize" :lv="lv" :onval="onval"
  112. :loadMake="loadMake" :usingComponents="true" @result="qrR" />
  113. </view>
  114. <view class="couponCode">{{detail.couponCode}}</view>
  115. <view class="couponCodeTs">请到店出示券码即可开始服务</view>
  116. </view>
  117. </view>
  118. <!-- 适用门店 -->
  119. <view class="authorizBox" v-if="spShopShow" @click="spShopHide">
  120. <view class="syShopBox" @click.stop="">
  121. <view class="chBox2">
  122. <view class="syShopTitle">适用门店</view>
  123. <img src="../../static/timg/chahao.png" alt="" class="chahaoImg" @click="spShopHide"/>
  124. </view>
  125. <view class="spShopLineBox">
  126. <view class="spShopLine" v-for="(item,index) in detail.shopNames.split(',')">{{item}}</view>
  127. </view>
  128. </view>
  129. </view>
  130. <!-- 手机号授权 -->
  131. <view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
  132. <view class="authorizCont" @click.stop="">
  133. <view class="authorizName">{{wxOpenData.miniAppName}}</view>
  134. <view class="authorizMs">未注册的手机号登录后将自动创建会员账号,如果您不同意授权获取手机号,会影响您使用我们的产品和服务。</view>
  135. <button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
  136. </view>
  137. <view style="text-align: center;padding-top: 56rpx;">
  138. <image src="../../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
  139. </view>
  140. </view>
  141. </view>
  142. </template>
  143. <script>
  144. import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue"
  145. export default {
  146. components: {
  147. tkiQrcode,
  148. },
  149. data() {
  150. return {
  151. id: '',
  152. detail: {},
  153. themeColor:'',
  154. type:'',
  155. userInfo:'',
  156. ext:'',
  157. wxOpenData:'',
  158. authorizShow:false,
  159. onval: true, // val值变化时自动重新生成二维码
  160. loadMake: true, // 组件加载完成后自动生成二维码
  161. val: '二维码', // 要生成的二维码值
  162. unit: 'upx', // 单位
  163. background: '#b4e9e2', // 背景色
  164. foreground: '#309286', // 前景色
  165. pdground: '#262637', // 角标色
  166. icon: '', // 二维码图标
  167. iconsize: 40, // 二维码图标大小
  168. lv: 3, // 二维码容错级别 , 一般不用设置,默认就行
  169. src: '', // 二维码生成后的图片地址或base64
  170. hxShow:false,
  171. spShopShow:false,
  172. }
  173. },
  174. onLoad(opt) {
  175. this.themeColor = uni.getStorageSync("themeColor");
  176. this.id = opt.id;
  177. this.type=opt.type;
  178. this.userInfo=this.$store.state.userInfo;
  179. this.ext=this.$common.getExtStoreId();
  180. if(this.userInfo){
  181. if (this.id) {
  182. this.getData();
  183. }
  184. }else{
  185. this.$common.automaticlogin().then(val => {
  186. this.userInfo=this.$store.state.userInfo;
  187. this.wxOpenData=this.$store.state.wxOpenData;
  188. this.themeColor = uni.getStorageSync("themeColor");
  189. if (this.id) {
  190. this.getData();
  191. }
  192. if(!this.userInfo){
  193. this.authorizShow=true
  194. }
  195. })
  196. }
  197. //this.getData();
  198. },
  199. methods: {
  200. spShopHide(){
  201. this.spShopShow=false;
  202. },
  203. spShopS(){
  204. this.spShopShow=true;
  205. },
  206. hxHide(){
  207. this.hxShow=true;
  208. },
  209. hxclose(){
  210. this.hxShow=false;
  211. },
  212. getData() {
  213. uni.showLoading({
  214. title: '加载中'
  215. });
  216. if(this.type==2){
  217. var url='opencoupon/detailsCouponDetails';
  218. var params={
  219. id: this.id,
  220. custId:this.$store.state.wxOpenData.loginInfo.customerInfo.id
  221. }
  222. }else{
  223. var url='opencoupon/detailsCoupon'
  224. var params={
  225. id: this.id,
  226. }
  227. }
  228. this.$http(url, params, 'GET').then(res => {
  229. uni.hideLoading();
  230. if(res.data.couContent){
  231. res.data.couContent=res.data.couContent.replaceAll('font-size:15px', 'font-size:12px');
  232. res.data.couContent=res.data.couContent.replaceAll('font-size: 15px', 'font-size:12px');
  233. res.data.couContent=res.data.couContent.replaceAll('font-size:14px', 'font-size:12px');
  234. }
  235. this.detail = res.data;
  236. })
  237. },
  238. }
  239. }
  240. </script>
  241. <style scoped>
  242. .djq{
  243. background: linear-gradient(128deg, #FFE4C5 0%, #FDC692 100%);
  244. border-radius: 4rpx;
  245. height: 34rpx;
  246. width: 76rpx;
  247. line-height: 34rpx;
  248. text-align: center;
  249. color: #2B2219;
  250. font-size: 20rpx;
  251. margin-top: 4rpx;
  252. margin-right: 10rpx;
  253. }
  254. .titleBox span{
  255. font-size: 12px;
  256. }
  257. .centerB{
  258. padding-top: 10rpx;
  259. }
  260. .syShopBox{
  261. background: #FFFFFF;
  262. border-radius: 32rpx 32rpx 0rpx 0rpx;
  263. width: 750rpx;
  264. height: 80vh;
  265. margin-top: 20vh;
  266. }
  267. .spShopLineBox{
  268. height: calc(80vh - 90rpx);
  269. overflow-y: scroll;
  270. }
  271. .spShopLine{
  272. color: #333333;font-size: 26rpx;
  273. padding: 26rpx 30rpx;
  274. border-bottom: 1px solid #EEEEEE;
  275. }
  276. .chBox2{
  277. display: flex;justify-content: space-between;
  278. padding-left: 30rpx;
  279. padding-top: 30rpx;
  280. padding-right: 24rpx;
  281. padding-bottom: 10rpx;
  282. }
  283. .syShopTitle{
  284. font-weight: 500;
  285. color: #333333;
  286. font-size: 30rpx;
  287. line-height: 42rpx;
  288. }
  289. .hxBox{
  290. width: 750rpx;
  291. height: 70vh;
  292. margin-top: 30vh;
  293. background: #FFFFFF;
  294. border-radius: 32rpx 32rpx 0rpx 0rpx;
  295. }
  296. .couponCode{
  297. font-weight: 500;
  298. color: #333333;
  299. font-size: 30rpx;
  300. padding-top: 40rpx;
  301. text-align: center;
  302. }
  303. .couponCodeTs{
  304. color: #666666;font-size: 24rpx;
  305. text-align: center;padding-top: 10rpx;
  306. }
  307. .hxName{
  308. font-weight: 500;
  309. color: #333333;
  310. line-height: 42rpx;
  311. font-size: 30rpx;
  312. text-align: center;
  313. padding-top: 26rpx;
  314. }
  315. .hxTime{
  316. color: #3C3C3C;font-size: 24rpx; text-align: center;padding-top: 16rpx;
  317. padding-bottom: 50rpx;
  318. border-bottom: 1px dashed #C3C3C3;
  319. }
  320. .chahaoImg{
  321. width: 36rpx;height: 36rpx;
  322. }
  323. .chBox{
  324. text-align: right;
  325. padding-top: 33rpx;
  326. padding-right: 24rpx;
  327. }
  328. .couponCodeBox{
  329. display: flex;
  330. padding-top: 15rpx;
  331. }
  332. .useBox{
  333. height: 120rpx;
  334. width: 750rpx;
  335. position: fixed;
  336. left: 0;
  337. bottom: 0;
  338. background: #FFFFFF;
  339. box-shadow: 0rpx -2rpx 10rpx 0rpx rgba(153,153,153,0.2);
  340. }
  341. .useBtn{
  342. width: 690rpx;
  343. height: 74rpx;
  344. background: #EC0F0A;
  345. border-radius: 37rpx;
  346. font-weight: 500;
  347. color: #FFFFFF;
  348. font-size: 30rpx;
  349. text-align: center;
  350. line-height: 74rpx;
  351. margin-top: 23rpx;
  352. margin-left: 30rpx;
  353. }
  354. .couponCodeYd{
  355. width: 10rpx;
  356. height: 10rpx;
  357. background: #EC0F0A;
  358. border-radius: 50%;
  359. margin-top: 10rpx;
  360. margin-right: 12rpx;
  361. }
  362. .ouponCode{
  363. color: #666666;
  364. line-height: 33rpx;
  365. font-size: 24rpx;
  366. text-decoration: line-through;
  367. }
  368. .couponCodeUse{
  369. width: 86rpx;
  370. height: 32rpx;
  371. border-radius: 4rpx;
  372. border: 1rpx solid #DDDDDD;
  373. color: #999999;
  374. line-height: 32rpx;
  375. text-align: center;
  376. font-size: 22rpx;
  377. margin-left: 12rpx;
  378. }
  379. .couponCodeLine{
  380. padding-left: 20rpx;display: flex;
  381. color: #999999;font-size: 24rpx;
  382. line-height: 33rpx;padding-top: 8rpx;
  383. }
  384. .boxtop{
  385. background: #EC0F0A;
  386. }
  387. .box {
  388. min-height: 100vh;
  389. background: #F4F5F7;
  390. }
  391. .detailBg {
  392. margin: -100rpx 24rpx 0rpx;
  393. background-color: #FFFFFF;
  394. border-radius: 10rpx;
  395. padding: 40rpx 20rpx;
  396. }
  397. .detailTop {
  398. display: flex;
  399. justify-content: flex-start;
  400. }
  401. .use {
  402. text-align: center;
  403. font-size: 26rpx;
  404. color: #EC0F0A;
  405. }
  406. .use2 {
  407. font-size: 40rpx;
  408. font-weight: 500;
  409. color: #EC0F0A;
  410. line-height: 56rpx;
  411. }
  412. .used {
  413. font-size: 26rpx;
  414. color: #666666;
  415. }
  416. .used2 {
  417. font-size: 40rpx;
  418. font-weight: 500;
  419. color: #666666;
  420. line-height: 56rpx;
  421. }
  422. .tiaojian {
  423. font-size: 24rpx;
  424. color: #666666;
  425. }
  426. .name {
  427. line-height: 42rpx;
  428. font-size: 30rpx;
  429. display: flex;
  430. font-weight: 500;
  431. color: #333333;
  432. }
  433. .time {
  434. font-size: 24rpx;
  435. color: #666666;
  436. }
  437. .leftB {
  438. margin-right: 15rpx;
  439. }
  440. .comtentBox {
  441. margin: 20rpx 24rpx;
  442. background-color: #FFFFFF;
  443. border-radius: 10rpx;
  444. padding: 20rpx;
  445. }
  446. .titleBox {
  447. display: flex;
  448. align-items: center;
  449. }
  450. .redPoint {
  451. width: 18rpx;
  452. height: 18rpx;
  453. margin-right: 10rpx;
  454. }
  455. .title {
  456. font-size: 30rpx;
  457. color: #333333;
  458. font-weight: bold;
  459. }
  460. .content {
  461. font-size: 26rpx;
  462. color: #666666;
  463. margin-top: 16rpx;
  464. margin-left: 28rpx;
  465. }
  466. .authorizBox{
  467. width: 100vw;
  468. height: 100vh;
  469. background: rgba(0, 0, 0, 0.5);
  470. position: fixed;
  471. top: 0;
  472. left: 0;
  473. }
  474. .authorizCont{
  475. margin-top: 30vh;
  476. width: 564rpx;
  477. height: 408rpx;
  478. background: #FFFFFF;
  479. border-radius: 24rpx;
  480. margin-left: 93rpx;
  481. position: relative;
  482. }
  483. .authorizCloseImg{
  484. width: 62rpx;
  485. height: 62rpx;
  486. }
  487. .sqLogoBox{
  488. width: 180rpx;
  489. height: 180rpx;
  490. background: #FFFFFF;
  491. border-radius: 90rpx;
  492. text-align: center;
  493. position: absolute;
  494. top: -50rpx;
  495. left: 192rpx;
  496. }
  497. .authorizName{
  498. color: #333333;
  499. line-height: 42rpx;
  500. font-size: 30rpx;
  501. text-align: center;
  502. padding-top: 58rpx;
  503. }
  504. .authorizMs{
  505. color: #999999;
  506. line-height: 36rpx;
  507. font-size: 26rpx;
  508. width: 452rpx;
  509. padding-top: 24rpx;
  510. text-align: center;
  511. margin-left: 56rpx;
  512. }
  513. .authorizContbutton{
  514. width: 422rpx;
  515. height: 88rpx;
  516. background: #EC0F0A;
  517. border-radius: 44rpx;
  518. line-height: 88rpx;
  519. text-align: center;
  520. font-size:30rpx;
  521. color: #FFFFFF;
  522. margin-top: 62rpx;
  523. margin-left:71rpx;
  524. }
  525. .shopBoxpt{
  526. margin-top: 20rpx;
  527. }
  528. button::after{
  529. border: none;
  530. }
  531. button{
  532. position: relative;
  533. display: block;
  534. margin-left: 0;
  535. margin-right: 0;
  536. padding-left: 0px;
  537. padding-right: 0px;
  538. box-sizing: border-box;
  539. // font-size: 18px;
  540. text-align: center;
  541. text-decoration: none;
  542. // line-height: 1;
  543. line-height: 1.35;
  544. // border-radius: 5px;
  545. -webkit-tap-highlight-color: transparent;
  546. overflow: hidden;
  547. color: #000000;
  548. background-color: #fff;
  549. height: 100%;
  550. }
  551. .shopline {
  552. margin: 0rpx 24rpx 20rpx;
  553. padding: 20rpx;
  554. background-color: #FFFFFF;
  555. border-radius: 10rpx;
  556. position: relative;
  557. display: flex;
  558. }
  559. .newdistance{
  560. position: absolute;top: 22rpx;right: 18rpx;
  561. text-align: center;
  562. font-size: 22rpx;
  563. color: #666666;
  564. }
  565. .shopbox {
  566. padding: 0 16rpx;
  567. }
  568. .shopImg {
  569. width: 146rpx;
  570. height: 146rpx;
  571. border-radius: 10rpx;
  572. }
  573. .shopCallImg {
  574. width: 38rpx;
  575. height: 46rpx;
  576. }
  577. .shopTop {
  578. display: flex;
  579. justify-content: space-between;
  580. width: 510rpx;
  581. }
  582. .shopright {
  583. padding-left: 20rpx;
  584. }
  585. .shopName {
  586. width: 450rpx;
  587. white-space: nowrap;
  588. overflow: hidden;
  589. text-overflow: ellipsis;
  590. }
  591. .shopScore1 {
  592. font-size: 36rpx;
  593. font-weight: bold;
  594. color: #FF4F00;
  595. height: 50rpx;
  596. line-height: 50rpx;
  597. }
  598. .shopScore11 {
  599. font-size: 22rpx;
  600. color: #FF4F00;
  601. margin-right: 14rpx;
  602. }
  603. .shopScore2 {
  604. font-size: 22rpx;
  605. color: #666666;
  606. margin-right: 14rpx;
  607. padding: 8rpx 0;
  608. }
  609. .shopScore3 {
  610. font-size: 22rpx;
  611. color: #333333;
  612. padding-left: 20rpx;
  613. }
  614. .shopaddress {
  615. width: 400rpx;
  616. /* 隐藏文字显示 ...不换行 */
  617. overflow: hidden;
  618. text-overflow: ellipsis;
  619. white-space: nowrap;
  620. color: #999999;
  621. }
  622. .shopCont {
  623. padding-left: 22rpx;
  624. width: 520rpx;
  625. }
  626. .shopName {
  627. font-size: 32rpx;
  628. font-weight: bold;
  629. color: #222222;
  630. line-height: 40rpx;
  631. width: 450rpx;
  632. white-space: nowrap;
  633. overflow: hidden;
  634. text-overflow: ellipsis;
  635. }
  636. .shopTime {
  637. color: #666666;
  638. font-size: 26rpx;
  639. padding-top: 4rpx;
  640. }
  641. .addressBox {
  642. color: #666666;
  643. font-size: 22rpx;
  644. }
  645. .shopaddress {
  646. width: 400rpx;
  647. /* 隐藏文字显示 ...不换行 */
  648. overflow: hidden;
  649. text-overflow: ellipsis;
  650. white-space: nowrap;
  651. color: #999999;
  652. }
  653. </style>