ticket-centre.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view class="flex-common-css">
  3. <Nav title=" " titleColor="" bgckgroundBox='transparent' leftColor='#fff'></Nav>
  4. <image class="lqzx-bg" src="@/static/img/my/lqzx-bg.png" mode=""></image>
  5. <image @click="goToUrl" class="wdyhq" src="@/static/img/my/wdyhq.png" mode=""></image>
  6. <view class="lqzx-blank"></view>
  7. <scroll-view :scroll-y="true" class="scroll-view-css" @scrolltolower="scrolltolower">
  8. <view v-if="itemData.length === 0" class="scroll-view-css liat-box">
  9. <EnBlank :customSrc='true'>
  10. <template v-slot:blankImg>
  11. <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
  12. </template>
  13. </EnBlank>
  14. </view>
  15. <view class="liat-box" v-else>
  16. <view class="item-box display-flex mb-20" v-for="(item,index) in itemData" :key="index">
  17. <view class="item-right flex-direction flex-justify-center flex-1 bgc-f">
  18. <view class="fs-28 mb-12 ticket-name text-overflow-ellipsis fc-3 fw-600">
  19. {{item.name}}
  20. </view>
  21. <view class="fs-24 fc-6 mb-12">
  22. 有效时间:{{item.time_type_str}}
  23. </view>
  24. <view class="fs-22 fc-6">
  25. 券类型:{{item.scene == 1?'外卖卷':'代取卷'}}
  26. </view>
  27. </view>
  28. <view class="item-hr"></view>
  29. <view class="item-left flex-direction align-items-center flex-justify-center bgc-FCE7E2">
  30. <view class="align-items-center">
  31. <view class="fs-30 fw-600 fc-FB3D03">¥</view>
  32. <view class="fs-48 fw-600 fc-FB3D03">{{item.money}}</view>
  33. </view>
  34. <view class="fs-24 mb-18 fc-6">
  35. 需满{{item.full_money}}元
  36. </view>
  37. <view class="but-box fs-28 fc-f" @click="receive(item)">立即领取</view>
  38. <view class="ball"></view>
  39. <view class="ball-two"></view>
  40. </view>
  41. </view>
  42. </view>
  43. </scroll-view>
  44. </view>
  45. </template>
  46. <script>
  47. import {
  48. couponGrant,
  49. receiveCoupon
  50. } from '@/api/coupon.js';
  51. import tools from "@/service/tools";
  52. import EnBlank from "@/components/en-utils/en-blank/en-blank";
  53. export default {
  54. components: {
  55. EnBlank
  56. },
  57. data() {
  58. return {
  59. itemData: [],
  60. isAJAX: false,
  61. };
  62. },
  63. onShow() {
  64. this.getList();
  65. },
  66. methods: {
  67. getList() {
  68. let operate_id = uni.getStorageSync('operate_id');
  69. couponGrant({
  70. operate_id: operate_id
  71. }).then((res) => {
  72. if (res.code === 1) {
  73. this.itemData = res.data;
  74. }
  75. })
  76. },
  77. goToUrl() {
  78. uni.navigateTo({
  79. url: '/pages-my/my-ticket'
  80. })
  81. },
  82. scrolltolower() {},
  83. receive(item) {
  84. if (this.isAJAX) {
  85. return
  86. }
  87. this.isAJAX = true;
  88. receiveCoupon({
  89. grant_id: item.grant_id,
  90. coupon_id: item.coupon_id
  91. }).then((res) => {
  92. if (res.code === 1) {
  93. this.isAJAX = false;
  94. tools.success('领取成功');
  95. this.getList();
  96. } else {
  97. this.isAJAX = false;
  98. tools.success('领取失败');
  99. }
  100. })
  101. }
  102. },
  103. }
  104. </script>
  105. <style lang="scss" scoped>
  106. .lqzx-bg {
  107. position: fixed;
  108. left: 0;
  109. top: 0;
  110. width: 100%;
  111. height: 489rpx;
  112. }
  113. .lqzx-blank {
  114. width: 100%;
  115. height: 272rpx;
  116. }
  117. .wdyhq {
  118. position: fixed;
  119. top: 204rpx;
  120. right: 0;
  121. width: 52rpx;
  122. height: 152rpx;
  123. }
  124. .liat-box {
  125. border-radius: 50rpx 50rpx 0 0;
  126. background: linear-gradient(180deg, #FBE9E4 0%, #F5F4F9 10%, #F5F4F9 100%);
  127. border-image: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0)) 2 2;
  128. padding: 24rpx;
  129. box-sizing: border-box;
  130. }
  131. .item-hr {
  132. width: 0px;
  133. height: auto;
  134. border-right: 1rpx dashed #FB7850;
  135. }
  136. .item-hr-two {
  137. width: 0px;
  138. height: auto;
  139. border-right: 1rpx dashed #999;
  140. }
  141. .item-left {
  142. width: 200rpx;
  143. height: auto;
  144. padding: 20rpx 24rpx;
  145. box-sizing: border-box;
  146. position: relative;
  147. border-radius: 0 20rpx 20rpx 0;
  148. }
  149. .ball {
  150. width: 24rpx;
  151. height: 24rpx;
  152. border-radius: 50%;
  153. position: absolute;
  154. top: -12rpx;
  155. left: -12rpx;
  156. background: #F5F5F5;
  157. z-index: 2;
  158. }
  159. .ball-two {
  160. width: 24rpx;
  161. height: 24rpx;
  162. border-radius: 50%;
  163. position: absolute;
  164. background: #F5F5F5;
  165. z-index: 10;
  166. bottom: -12rpx;
  167. left: -12rpx;
  168. }
  169. .item-right {
  170. padding: 24rpx;
  171. box-sizing: border-box;
  172. border-radius: 20rpx 0 0 20rpx;
  173. position: relative;
  174. }
  175. .but-box {
  176. width: 152rpx;
  177. height: 52rpx;
  178. line-height: 52rpx;
  179. text-align: center;
  180. background: linear-gradient(225deg, #FB3D03 0%, #FF6901 100%);
  181. border-radius: 200rpx;
  182. }
  183. </style>