discountCardDetail.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  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">
  7. <view class="use">¥<span class="use2">{{detail.actMoney}}</span></view>
  8. <!-- <view class="used" v-else>¥<span class="used2">{{detail.actMoney}}</span></view> -->
  9. <view class="tiaojian">{{detail.whereMoney!==0?'满'+detail.whereMoney+'元可用':'满任意金额可用'}}</view>
  10. </view>
  11. <view class="centerB">
  12. <view class="name">{{detail.actName}}</view>
  13. <view class="time" v-if="detail.startTime">
  14. 有效期:{{detail.startTime.slice(0,10)}}-{{detail.endTime.slice(0,10)}}</view>
  15. <view class="time" v-else>有效期:</view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="comtentBox">
  20. <view style="margin-bottom: 30rpx;">
  21. <!-- <view class="titleBox">
  22. <image src="../../static/img/icon_youhui_red.png" mode="" class="redPoint"></image>
  23. <view class="title">可用次数</view>
  24. </view>
  25. <view class="content">{{detail.avaQty}}次</view> -->
  26. </view>
  27. <view style="margin-bottom: 30rpx;">
  28. <view class="titleBox">
  29. <image src="../../static/img/icon_youhui_red.png" mode="" class="redPoint"></image>
  30. <view class="title">适用门店</view>
  31. </view>
  32. <view v-for="(v,index) in detail.shopNames.split(',')">
  33. <view class="content">{{v}}</view>
  34. </view>
  35. </view>
  36. <view>
  37. <view class="titleBox">
  38. <image src="../../static/img/icon_youhui_red.png" mode="" class="redPoint"></image>
  39. <view class="title">使用说明</view>
  40. </view>
  41. <view v-if="detail.couContent" v-html="detail.couContent"></view>
  42. <view v-else class="content">暂无</view>
  43. </view>
  44. </view>
  45. <view class="comtentBox" v-if="detail.usedState==1">
  46. <view class="titleBox">
  47. <image src="../../static/img/icon_youhui_red.png" mode="" class="redPoint"></image>
  48. <view class="title">使用记录</view>
  49. </view>
  50. <view class="couponCodeBox">
  51. <view class="couponCodeYd"></view>
  52. <view class="ouponCode">{{detail.couponCode}}</view>
  53. <view class="couponCodeUse">已使用</view>
  54. </view>
  55. <view class="couponCodeLine">
  56. <view class="couponCodeLeft">核销时间:</view>
  57. <view class="couponCodeLineRight">{{detail.usedTime}}</view>
  58. </view>
  59. <view class="couponCodeLine">
  60. <view class="couponCodeLeft">核销门店:</view>
  61. <view class="couponCodeLineRight">{{detail.usedShopName}}</view>
  62. </view>
  63. </view>
  64. <view style="height: 120rpx;"></view>
  65. <view class="useBox" v-if="detail.usedState==0">
  66. <view class="useBtn">去使用</view>
  67. </view>
  68. <!-- 手机号授权 -->
  69. <view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
  70. <view class="authorizCont" @click.stop="">
  71. <view class="authorizName">{{wxOpenData.miniAppName}}</view>
  72. <view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
  73. <button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
  74. </view>
  75. <view style="text-align: center;padding-top: 56rpx;">
  76. <image src="../../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
  77. </view>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. export default {
  83. data() {
  84. return {
  85. id: '',
  86. detail: {},
  87. themeColor:'',
  88. type:'',
  89. userInfo:'',
  90. ext:'',
  91. wxOpenData:'',
  92. authorizShow:false,
  93. }
  94. },
  95. onLoad(opt) {
  96. this.themeColor = uni.getStorageSync("themeColor");
  97. this.id = opt.id;
  98. this.type=opt.type;
  99. this.userInfo=this.$store.state.userInfo;
  100. this.ext=this.$common.getExtStoreId();
  101. if(this.userInfo){
  102. if (this.id) {
  103. this.getData();
  104. }
  105. }else{
  106. this.$common.automaticlogin().then(val => {
  107. this.userInfo=this.$store.state.userInfo;
  108. this.wxOpenData=this.$store.state.wxOpenData;
  109. this.themeColor = uni.getStorageSync("themeColor");
  110. if (this.id) {
  111. this.getData();
  112. }
  113. if(!this.userInfo){
  114. this.authorizShow=true
  115. }
  116. })
  117. }
  118. //this.getData();
  119. },
  120. methods: {
  121. getData() {
  122. uni.showLoading({
  123. title: '加载中'
  124. });
  125. if(this.type==2){
  126. var url='opencoupon/detailsCouponDetails';
  127. var params={
  128. id: this.id,
  129. custId:this.$store.state.wxOpenData.loginInfo.customerInfo.id
  130. }
  131. }else{
  132. var url='opencoupon/detailsCoupon'
  133. var params={
  134. id: this.id,
  135. }
  136. }
  137. this.$http(url, params, 'GET').then(res => {
  138. uni.hideLoading();
  139. this.detail = res.data;
  140. })
  141. },
  142. }
  143. }
  144. </script>
  145. <style scoped>
  146. .couponCodeBox{
  147. display: flex;
  148. padding-top: 15rpx;
  149. }
  150. .useBox{
  151. height: 120rpx;
  152. width: 750rpx;
  153. position: fixed;
  154. left: 0;
  155. bottom: 0;
  156. background: #FFFFFF;
  157. box-shadow: 0rpx -2rpx 10rpx 0rpx rgba(153,153,153,0.2);
  158. }
  159. .useBtn{
  160. width: 690rpx;
  161. height: 74rpx;
  162. background: #D53533;
  163. border-radius: 37rpx;
  164. font-weight: 500;
  165. color: #FFFFFF;
  166. font-size: 30rpx;
  167. text-align: center;
  168. line-height: 74rpx;
  169. margin-top: 23rpx;
  170. margin-left: 30rpx;
  171. }
  172. .couponCodeYd{
  173. width: 10rpx;
  174. height: 10rpx;
  175. background: #FF0000;
  176. border-radius: 50%;
  177. margin-top: 10rpx;
  178. margin-right: 12rpx;
  179. }
  180. .ouponCode{
  181. color: #666666;
  182. line-height: 33rpx;
  183. font-size: 24rpx;
  184. text-decoration: line-through;
  185. }
  186. .couponCodeUse{
  187. width: 86rpx;
  188. height: 32rpx;
  189. border-radius: 4rpx;
  190. border: 1rpx solid #DDDDDD;
  191. color: #999999;
  192. line-height: 32rpx;
  193. text-align: center;
  194. font-size: 22rpx;
  195. margin-left: 12rpx;
  196. }
  197. .couponCodeLine{
  198. padding-left: 20rpx;display: flex;
  199. color: #999999;font-size: 24rpx;
  200. line-height: 33rpx;padding-top: 8rpx;
  201. }
  202. .boxtop{
  203. background: #FF0000;
  204. }
  205. .box {
  206. min-height: 100vh;
  207. background: #F4F5F7;
  208. }
  209. .detailBg {
  210. margin: -100rpx 24rpx 0rpx;
  211. background-color: #FFFFFF;
  212. border-radius: 10rpx;
  213. padding: 40rpx 20rpx;
  214. }
  215. .detailTop {
  216. display: flex;
  217. justify-content: flex-start;
  218. }
  219. .use {
  220. font-size: 26rpx;
  221. color: #FF0000;
  222. }
  223. .use2 {
  224. font-size: 40rpx;
  225. font-weight: 500;
  226. color: #FF0000;
  227. line-height: 56rpx;
  228. }
  229. .used {
  230. font-size: 26rpx;
  231. color: #666666;
  232. }
  233. .used2 {
  234. font-size: 40rpx;
  235. font-weight: 500;
  236. color: #666666;
  237. line-height: 56rpx;
  238. }
  239. .tiaojian {
  240. font-size: 24rpx;
  241. color: #666666;
  242. }
  243. .name {
  244. font-size: 30rpx;
  245. font-weight: 500;
  246. color: #333333;
  247. line-height: 56rpx;
  248. }
  249. .time {
  250. font-size: 24rpx;
  251. color: #666666;
  252. }
  253. .leftB {
  254. margin-right: 15rpx;
  255. }
  256. .comtentBox {
  257. margin: 20rpx 24rpx;
  258. background-color: #FFFFFF;
  259. border-radius: 10rpx;
  260. padding: 20rpx;
  261. }
  262. .titleBox {
  263. display: flex;
  264. align-items: center;
  265. }
  266. .redPoint {
  267. width: 18rpx;
  268. height: 18rpx;
  269. margin-right: 10rpx;
  270. }
  271. .title {
  272. font-size: 30rpx;
  273. color: #333333;
  274. font-weight: bold;
  275. }
  276. .content {
  277. font-size: 26rpx;
  278. color: #666666;
  279. margin-top: 16rpx;
  280. margin-left: 28rpx;
  281. }
  282. .authorizBox{
  283. width: 100vw;
  284. height: 100vh;
  285. background: rgba(0, 0, 0, 0.5);
  286. position: fixed;
  287. top: 0;
  288. left: 0;
  289. }
  290. .authorizCont{
  291. margin-top: 30vh;
  292. width: 564rpx;
  293. height: 408rpx;
  294. background: #FFFFFF;
  295. border-radius: 24rpx;
  296. margin-left: 93rpx;
  297. position: relative;
  298. }
  299. .authorizCloseImg{
  300. width: 62rpx;
  301. height: 62rpx;
  302. }
  303. .sqLogoBox{
  304. width: 180rpx;
  305. height: 180rpx;
  306. background: #FFFFFF;
  307. border-radius: 90rpx;
  308. text-align: center;
  309. position: absolute;
  310. top: -50rpx;
  311. left: 192rpx;
  312. }
  313. .authorizName{
  314. color: #333333;
  315. line-height: 42rpx;
  316. font-size: 30rpx;
  317. text-align: center;
  318. padding-top: 58rpx;
  319. }
  320. .authorizMs{
  321. color: #999999;
  322. line-height: 36rpx;
  323. font-size: 26rpx;
  324. width: 452rpx;
  325. padding-top: 24rpx;
  326. text-align: center;
  327. margin-left: 56rpx;
  328. }
  329. .authorizContbutton{
  330. width: 422rpx;
  331. height: 88rpx;
  332. background: #D53533;
  333. border-radius: 44rpx;
  334. line-height: 88rpx;
  335. text-align: center;
  336. font-size:30rpx;
  337. color: #FFFFFF;
  338. margin-top: 62rpx;
  339. margin-left:71rpx;
  340. }
  341. .shopBoxpt{
  342. margin-top: 20rpx;
  343. }
  344. button::after{
  345. border: none;
  346. }
  347. button{
  348. position: relative;
  349. display: block;
  350. margin-left: 0;
  351. margin-right: 0;
  352. padding-left: 0px;
  353. padding-right: 0px;
  354. box-sizing: border-box;
  355. // font-size: 18px;
  356. text-align: center;
  357. text-decoration: none;
  358. // line-height: 1;
  359. line-height: 1.35;
  360. // border-radius: 5px;
  361. -webkit-tap-highlight-color: transparent;
  362. overflow: hidden;
  363. color: #000000;
  364. background-color: #fff;
  365. height: 100%;
  366. }
  367. </style>