敢为人鲜小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
2.9 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. <!-- 优惠券弹窗 -->
  2. <template>
  3. <view class="couponPopup">
  4. <uv-popup ref="couponPopup"
  5. customStyle="background-color: transparent;"
  6. :z-index="999999">
  7. <view class="couponPopup-wrapper">
  8. <view class="main-container"
  9. @click="toCoupon">
  10. <view class="body">
  11. <image :src="configList.coupon_image" mode="widthFix" class="coupon-bg"></image>
  12. <image @click.stop="close" src="@/static/image/coupon/close-btn.png" mode="widthFix"
  13. class="close-btn">
  14. </image>
  15. <view class="coupon-money">
  16. <text class="unit"></text>
  17. <view class="money">
  18. {{ riceInfo.getCouponMoney }}
  19. </view>
  20. </view>
  21. <image :src="configList.qd_image" mode="widthFix" class="register-success"></image>
  22. <view class="shopping">下单即可抵扣</view>
  23. </view>
  24. <image
  25. :src="configList.down_image" mode="widthFix"
  26. class="examine" />
  27. </view>
  28. </view>
  29. </uv-popup>
  30. </view>
  31. </template>
  32. <script>
  33. import {
  34. mapState
  35. } from 'vuex'
  36. export default {
  37. name: "CouponPopup",
  38. data() {
  39. return {}
  40. },
  41. mounted() {
  42. this.$refs.couponPopup.open()
  43. this.$api('queryFetchCouponList', res => {
  44. if(res.code == 200){
  45. this.couponList = res.result.records
  46. }
  47. })
  48. },
  49. computed: {
  50. ...mapState(['riceInfo'])
  51. },
  52. methods: {
  53. //跳转优惠券页面
  54. toCoupon() {
  55. this.$refs.couponPopup.close()
  56. this.$api('getRiceCoupon', res => {
  57. if(res.code == 200){
  58. uni.navigateTo({
  59. url: "/pages_order/mine/coupon"
  60. })
  61. }
  62. })
  63. },
  64. close(){
  65. this.$refs.couponPopup.close()
  66. },
  67. },
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .couponPopup {
  72. .couponPopup-wrapper {
  73. width: 100%;
  74. height: 100vh;
  75. display: flex;
  76. justify-content: center;
  77. align-items: center;
  78. .main-container {
  79. // background-color: red;
  80. .body {
  81. position: relative;
  82. background-color: red;
  83. .coupon-bg {
  84. }
  85. .close-btn {
  86. position: absolute;
  87. right: 0;
  88. top: 0;
  89. width: 50rpx;
  90. height: 50rpx;
  91. }
  92. .coupon-money {
  93. display: flex;
  94. justify-content: center;
  95. align-items: flex-end;
  96. position: absolute;
  97. left: 50%;
  98. top: 34%;
  99. width: 40%;
  100. color: #FF6733;
  101. transform: translateX(-30%);
  102. font-weight: bold;
  103. .unit {
  104. font-size: 40rpx;
  105. }
  106. .money {
  107. font-size: 120rpx;
  108. line-height: 120rpx;
  109. }
  110. }
  111. .register-success {
  112. position: absolute;
  113. top: 7%;
  114. left: 50%;
  115. transform: translateX(-50%);
  116. width: 80%;
  117. }
  118. .shopping {
  119. position: absolute;
  120. bottom: 5%;
  121. left: 50%;
  122. transform: translateX(-50%);
  123. color: #FEF3DD;
  124. text-align: center;
  125. font-size: 40rpx;
  126. width: 80%;
  127. }
  128. }
  129. .examine {
  130. display: block;
  131. width: 70%;
  132. margin: 20rpx auto;
  133. }
  134. }
  135. }
  136. }
  137. </style>