ticket-centre.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. <view v-if="itemData.length === 0" class="scroll-view-css">
  8. <EnBlank :customSrc='true'>
  9. <template v-slot:blankImg>
  10. <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
  11. </template>
  12. </EnBlank>
  13. </view>
  14. <scroll-view v-else :scroll-y="true" class="scroll-view-css" @scrolltolower="scrolltolower">
  15. <view class="liat-box ">
  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 {couponGrant,receiveCoupon} from '@/api/coupon.js';
  45. import tools from "@/service/tools";
  46. import EnBlank from "@/components/en-utils/en-blank/en-blank";
  47. export default {
  48. components: {EnBlank},
  49. data() {
  50. return {
  51. itemData: [],
  52. isAJAX:false,
  53. };
  54. },
  55. onShow(){
  56. this.getList();
  57. },
  58. methods: {
  59. getList(){
  60. let operate_id = uni.getStorageSync('operate_id');
  61. couponGrant({operate_id:operate_id}).then((res)=>{
  62. if(res.code === 1){
  63. this.itemData = res.data;
  64. }
  65. })
  66. },
  67. goToUrl() {
  68. uni.navigateTo({
  69. url:'/pages-my/my-ticket'
  70. })
  71. },
  72. scrolltolower() {},
  73. receive(item) {
  74. if(this.isAJAX){
  75. return
  76. }
  77. this.isAJAX = true;
  78. receiveCoupon({grant_id:item.grant_id,coupon_id:item.coupon_id}).then((res)=>{
  79. if(res.code === 1){
  80. this.isAJAX = false;
  81. tools.success('领取成功');
  82. this.getList();
  83. }else{
  84. this.isAJAX = false;
  85. tools.success('领取失败');
  86. }
  87. })
  88. }
  89. },
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .lqzx-bg {
  94. position: fixed;
  95. left: 0;
  96. top: 0;
  97. width: 100%;
  98. height: 489rpx;
  99. }
  100. .lqzx-blank {
  101. width: 100%;
  102. height: 272rpx;
  103. }
  104. .wdyhq {
  105. position: fixed;
  106. top: 204rpx;
  107. right: 0;
  108. width: 52rpx;
  109. height: 152rpx;
  110. }
  111. .liat-box {
  112. border-radius: 50rpx 50rpx 0 0;
  113. background: linear-gradient(180deg, #FBE9E4 0%, #F5F4F9 10%, #F5F4F9 100%);
  114. border-image: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0)) 2 2;
  115. padding: 24rpx;
  116. box-sizing: border-box;
  117. }
  118. .item-hr {
  119. width: 0px;
  120. height: auto;
  121. border-right: 1rpx dashed #FB7850;
  122. }
  123. .item-hr-two {
  124. width: 0px;
  125. height: auto;
  126. border-right: 1rpx dashed #999;
  127. }
  128. .item-left {
  129. width: 200rpx;
  130. height: auto;
  131. padding: 20rpx 24rpx;
  132. box-sizing: border-box;
  133. position: relative;
  134. border-radius: 0 20rpx 20rpx 0;
  135. }
  136. .ball {
  137. width: 24rpx;
  138. height: 24rpx;
  139. border-radius: 50%;
  140. position: absolute;
  141. top: -12rpx;
  142. left: -12rpx;
  143. background: #F5F5F5;
  144. z-index: 2;
  145. }
  146. .ball-two {
  147. width: 24rpx;
  148. height: 24rpx;
  149. border-radius: 50%;
  150. position: absolute;
  151. background: #F5F5F5;
  152. z-index: 10;
  153. bottom: -12rpx;
  154. left: -12rpx;
  155. }
  156. .item-right {
  157. padding: 24rpx;
  158. box-sizing: border-box;
  159. border-radius: 20rpx 0 0 20rpx;
  160. position: relative;
  161. }
  162. .but-box {
  163. width: 152rpx;
  164. height: 52rpx;
  165. line-height: 52rpx;
  166. text-align: center;
  167. background: linear-gradient(225deg, #FB3D03 0%, #FF6901 100%);
  168. border-radius: 200rpx;
  169. }
  170. </style>