yhqDetail.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. <template>
  2. <view class="content">
  3. <view class="" style="height: 20rpx;"></view>
  4. <view class="yhq-wrap">
  5. <view class="yhq-info p-r">
  6. <image src="../../static/img/yhq-w.png" mode="widthFix"></image>
  7. <view class="info-name p-a">
  8. 地锅印象代金券
  9. </view>
  10. <view class="info-info p-a">
  11. 79元代100元券
  12. </view>
  13. <view class="info-time p-a">
  14. 周一至周日可用
  15. </view>
  16. </view>
  17. <view class="yhq-price flex f-j-s">
  18. <view class="price-left flex f-j-s fg1">
  19. <view class="left-new-price">
  20. 79
  21. </view>
  22. <view class="left-zk">
  23. 7.9折
  24. </view>
  25. <view class="left-old-price">
  26. ¥100
  27. </view>
  28. </view>
  29. <view class="price-right fs0">
  30. 1020人买过
  31. </view>
  32. </view>
  33. <view class="yhq-tit">
  34. 有效期
  35. </view>
  36. <view class="yhq-val">
  37. 2021.12.17至2022.5.16 23:59(周末、法定节假日通用)
  38. </view>
  39. <view class="yhq-tit">
  40. 使用时间
  41. </view>
  42. <view class="yhq-val">
  43. 11:00-2300
  44. </view>
  45. <view class="yhq-tit">
  46. 适用范围
  47. </view>
  48. <view class="yhq-val">
  49. 除酒水饮料外全场通用
  50. </view>
  51. <view class="yhq-tit">
  52. 使用规则
  53. </view>
  54. <view class="yhq-val">
  55. 仅限堂食
  56. </view>
  57. </view>
  58. <!-- 底部填充 -->
  59. <view class="" style="height: 120rpx;"></view>
  60. <!-- 底部购买收藏 -->
  61. <view class="btm-btn flex">
  62. <!-- <view class="sc fs0 flex f-j-c">
  63. <image src="../../static/icon/shoucang.png" mode=""></image>
  64. </view> -->
  65. <view class="buy-now-btn fg1" @click="buyNow()">
  66. 立即购买
  67. </view>
  68. </view>
  69. <!-- 购买数量弹窗 -->
  70. <uni-popup ref="buyNumPopup" type="center">
  71. <view class="buy-num p-r">
  72. <view class="buy-num-tit">
  73. 购买数量
  74. </view>
  75. <add-number class="buy-num-wrap" :isMin="true" :value="buyNum" :min="1" :max="goodsNumberMax"
  76. @eventChange="numberChange"></add-number>
  77. <view class="buy-num-hj">
  78. 合计¥188
  79. </view>
  80. <view class="buy-num-btn flex">
  81. <view class="buy-close fg1" @click="buyNumClose">
  82. 取消
  83. </view>
  84. <view class="buy-true fg1" style="color: #FF4C4C;" @click="openPay">
  85. 确定
  86. </view>
  87. </view>
  88. </view>
  89. </uni-popup>
  90. <!-- 选择支付方式弹窗 -->
  91. <uni-popup ref="popup" type="bottom">
  92. <view class="zf-wrap">
  93. <view class="zf-top flex f-j-sb">
  94. <view class="top-left">
  95. 选择支付方式
  96. </view>
  97. <image src="../../static/icon/colse.png" mode="" @click="close"></image>
  98. </view>
  99. <view class="zf-type flex" @click="changePayType(1)">
  100. <view class="type-left">
  101. <text class="icon iconfont iconweixin"></text>
  102. <text style="margin-left: 20rpx;">微信支付</text>
  103. </view>
  104. <label class="radio">
  105. <radio value="" color="#FF4C4C" :checked="payType == 1"></radio>
  106. </label>
  107. </view>
  108. <view class="zf-type flex" @click="changePayType(3)">
  109. <view class="type-left">
  110. <text class="icon iconfont iconyue"></text>
  111. <text style="margin-left: 20rpx;">余额支付</text>
  112. </view>
  113. <label class="radio">
  114. <radio value="" color="#FF4C4C" :checked="payType == 3"></radio>
  115. </label>
  116. </view>
  117. <view class="" style="width: 750rpx;height: 20rpx;background: #F6F6F6;"></view>
  118. <view class="zf-btn flex">
  119. <view class="btn-left">
  120. 合计:<text class="zf-price">100</text>
  121. </view>
  122. <view class="btn-right" @click="buying?'':buy()">
  123. 立即支付
  124. </view>
  125. </view>
  126. </view>
  127. </uni-popup>
  128. </view>
  129. </template>
  130. <script>
  131. import addNumber from '@/components/add-number.vue';
  132. export default {
  133. components: {
  134. addNumber
  135. },
  136. data() {
  137. return {
  138. goodsNumberMax: 999,
  139. buyNum: 1,
  140. payType: 1,
  141. buying: false,
  142. payName: 'weixin'
  143. }
  144. },
  145. onLoad() {
  146. },
  147. onShow() {
  148. },
  149. onReachBottom() {
  150. },
  151. onReady() {
  152. },
  153. methods: {
  154. buyNow() {
  155. let obj = this
  156. obj.$refs.buyNumPopup.open()
  157. },
  158. // 购买数量变化
  159. numberChange(e) {
  160. this.buyNum = e.number;
  161. },
  162. buyNumClose() {
  163. let obj = this
  164. obj.$refs.buyNumPopup.close()
  165. },
  166. // 打开支付弹窗
  167. openPay() {
  168. let obj = this
  169. obj.$refs.buyNumPopup.close()
  170. obj.$refs.popup.open()
  171. },
  172. closePay() {
  173. let obj = this
  174. obj.$refs.popup.close()
  175. },
  176. changePayType(type) {
  177. this.payType = type;
  178. if (this.payType == 1) {
  179. this.payName = 'weixin';
  180. }
  181. if (this.payType == 2) {
  182. this.payName = 'ali';
  183. }
  184. if (this.payType == 3) {
  185. this.payName = 'yue';
  186. }
  187. if (this.payType == 4) {
  188. this.payName = 'pink_integral';
  189. }
  190. if (this.payType == 5) {
  191. this.payName = 'cash';
  192. }
  193. },
  194. //支付
  195. buy() {
  196. let obj = this
  197. if (obj.payType == 0) {
  198. return obj.$api.msg('请选择支付方式')
  199. }
  200. if (obj.buying) {
  201. return
  202. }
  203. obj.buying = true
  204. obj.closePay()
  205. },
  206. }
  207. }
  208. </script>
  209. <style lang="scss">
  210. .yhq-wrap {
  211. width: 702rpx;
  212. // height: 1065rpx;
  213. background: #FFFFFF;
  214. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  215. border-radius: 20rpx;
  216. margin: auto;
  217. padding: 30rpx 24rpx 50rpx;
  218. .yhq-info {
  219. width: 655rpx;
  220. height: 230rpx;
  221. // border: 1px solid #FCC7AE;
  222. margin: auto;
  223. image {
  224. width: 655rpx;
  225. }
  226. view {
  227. padding-left: 22rpx;
  228. }
  229. .info-name {
  230. top: 25rpx;
  231. font-size: 24rpx;
  232. font-weight: bold;
  233. color: #333333;
  234. }
  235. .info-info {
  236. top: 70rpx;
  237. font-size: 45rpx;
  238. font-weight: bold;
  239. color: #333333;
  240. }
  241. .info-time {
  242. bottom: 25rpx;
  243. }
  244. }
  245. }
  246. .yhq-price {
  247. width: 643rpx;
  248. margin: auto;
  249. height: 110rpx;
  250. border-bottom: 1rpx solid #f6f6f6;
  251. .price-right {
  252. font-size: 25rpx;
  253. font-weight: 500;
  254. color: #999999;
  255. }
  256. .left-new-price {
  257. font-size: 56rpx;
  258. font-weight: bold;
  259. color: #FF4C4C;
  260. &:before {
  261. content: '¥';
  262. font-size: 29rpx;
  263. color: #FF4C4C;
  264. }
  265. }
  266. .left-zk {
  267. display: inline-block;
  268. padding: 5rpx 8rpx;
  269. border: 1px solid #FF4C4C;
  270. border-radius: 8rpx;
  271. font-size: 22rpx;
  272. font-weight: 500;
  273. color: #FF4C4C;
  274. margin: 0 10rpx 0 12rpx;
  275. }
  276. .left-old-price {
  277. font-size: 25rpx;
  278. font-weight: 500;
  279. text-decoration: line-through;
  280. color: #999999;
  281. }
  282. }
  283. .yhq-tit {
  284. padding-top: 45rpx;
  285. font-size: 28rpx;
  286. font-weight: bold;
  287. color: #333333;
  288. }
  289. .yhq-val {
  290. padding-top: 20rpx;
  291. font-size: 28rpx;
  292. font-weight: 500;
  293. color: #333333;
  294. text-align: justify;
  295. }
  296. .btm-btn {
  297. background-color: #fff;
  298. box-shadow: 0px 0px 40px 0px rgba(50, 50, 52, 0.06);
  299. position: fixed;
  300. bottom: 0;
  301. width: 750rpx;
  302. height: 100rpx;
  303. .sc {
  304. width: 103rpx;
  305. image {
  306. width: 42rpx;
  307. height: 64rpx;
  308. }
  309. }
  310. .buy-now-btn {
  311. line-height: 100rpx;
  312. background: #FF4C4C;
  313. font-size: 36rpx;
  314. font-weight: 500;
  315. color: #FFFFFF;
  316. text-align: center;
  317. }
  318. }
  319. .buy-num {
  320. width: 537rpx;
  321. height: 449rpx;
  322. background: #FFFFFF;
  323. border-radius: 30rpx;
  324. font-size: 30rpx;
  325. text-align: center;
  326. .buy-num-tit {
  327. font-weight: bold;
  328. color: #333333;
  329. padding-top: 60rpx;
  330. }
  331. .buy-num-wrap {
  332. margin: 60rpx auto 45rpx;
  333. }
  334. .buy-num-hj {
  335. font-weight: 500;
  336. color: #333333;
  337. }
  338. .buy-num-btn {
  339. position: absolute;
  340. bottom: 0;
  341. width: 100%;
  342. text-align: center;
  343. height: 90rpx;
  344. }
  345. }
  346. .zf-wrap {
  347. width: 750rpx;
  348. height: 404rpx;
  349. background: #FFFFFF;
  350. border-radius: 10rpx 10rpx 0px 0px;
  351. .zf-top {
  352. height: 86rpx;
  353. border-bottom: #EEEEEE solid 1rpx;
  354. padding: 0 25rpx;
  355. font-size: 28rpx;
  356. font-weight: bold;
  357. color: #333333;
  358. image {
  359. width: 15rpx;
  360. height: 15rpx;
  361. }
  362. }
  363. .zf-type {
  364. margin-left: 23rpx;
  365. width: 727rpx;
  366. height: 100rpx;
  367. border-bottom: #EEEEEE solid 1rpx;
  368. padding: 0 25rpx;
  369. font-size: 28rpx;
  370. font-weight: 400;
  371. color: #3F454B;
  372. &:last-of-type {
  373. border-bottom: none;
  374. }
  375. }
  376. .zf-btn {
  377. .btn-right {
  378. width: 360rpx;
  379. line-height: 100rpx;
  380. background: #FF4C4C;
  381. text-align: center;
  382. font-size: 32rpx;
  383. font-weight: bold;
  384. color: #FFFFFF;
  385. }
  386. .btn-left {
  387. width: 390rpx;
  388. line-height: 100rpx;
  389. padding-left: 24rpx;
  390. font-size: 28rpx;
  391. font-weight: 400;
  392. color: #3F454B;
  393. .zf-price {
  394. font-size: 36rpx;
  395. font-weight: bold;
  396. color: #FF4C4C;
  397. &::before {
  398. content: '¥';
  399. font-size: 24rpx;
  400. color: #FF4C4C;
  401. }
  402. }
  403. }
  404. }
  405. }
  406. .iconweixin {
  407. color: #36cb59;
  408. }
  409. .iconyue {
  410. color: #fe8e2e;
  411. }
  412. </style>