ticket-centre.vue 4.2 KB

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