敢为人鲜小程序前端代码仓库
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.

140 lines
2.7 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 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"></image>
  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. },
  44. computed: {
  45. ...mapState(['riceInfo'])
  46. },
  47. methods: {
  48. //跳转优惠券页面
  49. toCoupon() {
  50. this.$refs.couponPopup.close()
  51. this.$api('getRiceCoupon', res => {
  52. if(res.code == 200){
  53. uni.navigateTo({
  54. url: "/pages_order/mine/coupon"
  55. })
  56. }
  57. })
  58. },
  59. close(){
  60. this.$refs.couponPopup.close()
  61. },
  62. },
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .couponPopup {
  67. .couponPopup-wrapper {
  68. width: 100%;
  69. height: 100vh;
  70. display: flex;
  71. justify-content: center;
  72. align-items: center;
  73. .main-container {
  74. .body {
  75. position: relative;
  76. .coupon-bg {
  77. }
  78. .close-btn {
  79. position: absolute;
  80. right: 0;
  81. top: 0;
  82. width: 50rpx;
  83. height: 50rpx;
  84. }
  85. .coupon-money {
  86. display: flex;
  87. justify-content: center;
  88. align-items: flex-end;
  89. position: absolute;
  90. left: 50%;
  91. top: 34%;
  92. width: 40%;
  93. color: #FF6733;
  94. transform: translateX(-30%);
  95. font-weight: bold;
  96. .unit {
  97. font-size: 40rpx;
  98. }
  99. .money {
  100. font-size: 120rpx;
  101. line-height: 120rpx;
  102. }
  103. }
  104. .register-success {
  105. position: absolute;
  106. top: 7%;
  107. left: 50%;
  108. transform: translateX(-50%);
  109. width: 80%;
  110. }
  111. .shopping {
  112. position: absolute;
  113. bottom: 5%;
  114. left: 50%;
  115. transform: translateX(-50%);
  116. color: #FEF3DD;
  117. text-align: center;
  118. font-size: 40rpx;
  119. width: 80%;
  120. }
  121. }
  122. .examine {
  123. display: block;
  124. width: 70%;
  125. margin: 20rpx auto;
  126. }
  127. }
  128. }
  129. }
  130. </style>