discountDlq.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="box">
  3. <view style="height: 20rpx;"></view>
  4. <view class="line" v-for="(item,index) in list">
  5. <view class="linetop">
  6. <view class="lineTopleft">
  7. <view class="lineTop1">
  8. <view class="linemoney">¥ <span style="font-size: 40rpx;">{{item.actMoney}}</span> </view>
  9. <view class="lineTopName">新人优惠券</view>
  10. </view>
  11. <view class="linetop2">
  12. <view class="mdsky">{{item.whereMoney!==0?'满'+item.whereMoney+'可用':'无限制'}}</view>
  13. <view class="endOffsetDays">
  14. <span v-if="item.endOffsetDays">领取后{{item.endOffsetDays}}天有效</span>
  15. <span v-else>{{item.startTime|dateformat}}-{{item.endTime|dateformat}}</span>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="receiveBtn1" @click="receive(item.id)">领取</view>
  20. </view>
  21. <view class="lineBottom">
  22. <view>可用次数:{{item.avaQty}}</view>
  23. <view>查看详情></view>
  24. </view>
  25. </view>
  26. <nodata v-if="list.length==0"></nodata>
  27. </view>
  28. </template>
  29. <script>
  30. import nodata from '../../components/nodata/nodata.vue'
  31. export default {
  32. components: {
  33. nodata
  34. },
  35. data() {
  36. return {
  37. list:'',
  38. themeColor:'',
  39. userInfo:'',
  40. stateMap: ['待审核', '审核通过', '审核拒绝'],
  41. }
  42. },
  43. onLoad(opt) {
  44. this.themeColor = uni.getStorageSync("themeColor");
  45. this.userInfo = uni.getStorageSync("userInfo");
  46. this.getList()
  47. },
  48. onShow() {
  49. },
  50. methods: {
  51. receive(id){
  52. uni.showLoading({
  53. title: '领取中'
  54. })
  55. this.$http('opencoupon/getCoupons', {
  56. id: id,
  57. }, 'GET').then(res => {
  58. uni.hideLoading();
  59. uni.showToast({
  60. title: '领取成功',
  61. icon:'none',
  62. duration: 3000
  63. });
  64. //this.getList();
  65. //var data=res.data.Items;
  66. //this.list=this.list.concat(data);
  67. //console.log('list+=', this.queryShopList);
  68. })
  69. },
  70. getList(){
  71. uni.showLoading({
  72. title: '加载中'
  73. })
  74. this.$http('opencoupon/getCouponList', {
  75. discount:1
  76. }, 'GET').then(res => {
  77. uni.hideLoading();
  78. this.list = res.data;
  79. //var data=res.data.Items;
  80. //this.list=this.list.concat(data);
  81. //console.log('list+=', this.queryShopList);
  82. })
  83. }
  84. },
  85. onReachBottom(){
  86. //this.page++;
  87. this.getList()
  88. //console.log("shanglas")
  89. },
  90. onPullDownRefresh(){
  91. //this.page=1;
  92. //this.list=[];
  93. this.getList();
  94. setTimeout(() => {
  95. uni.stopPullDownRefresh(); // 关闭下拉刷新
  96. }, 2000);
  97. }
  98. }
  99. </script>
  100. <style scoped lang="less">
  101. .box {
  102. width: 100vw;
  103. min-height: 100vh;
  104. background: #F4F5F7;
  105. }
  106. .receiveBtn1{
  107. width: 144rpx;
  108. height: 56rpx;
  109. font-size: 28rpx;
  110. line-height: 56rpx;
  111. color: #D53533;
  112. border-radius: 36rpx;
  113. border: 2rpx solid #D53533;
  114. text-align: center;
  115. }
  116. .lineTop1{
  117. display: flex;
  118. }
  119. .linetop2{
  120. display: flex;font-size: 24rpx;
  121. padding-bottom: 39rpx;
  122. padding-top: 10rpx;
  123. }
  124. .mdsky{
  125. color: #666666;
  126. }
  127. .endOffsetDays{
  128. color: #666666;
  129. }
  130. .linemoney{
  131. width: 260rpx;
  132. }
  133. .linetop{
  134. display: flex;
  135. justify-content: space-between;
  136. }
  137. .mdsky{
  138. width: 260rpx;
  139. }
  140. .lineBottom{
  141. display: flex;
  142. justify-content: space-between;
  143. color: #999999;
  144. font-size: 24rpx;
  145. padding-top: 20rpx;
  146. border-top: 1px dashed #EEEEEE;
  147. }
  148. .linemoney{
  149. color: #FF3B30;font-size: 26rpx;
  150. }
  151. .lineTopName{
  152. font-size: 30rpx;
  153. font-family: PingFangSC-Medium, PingFang SC;
  154. font-weight: 500;
  155. color: #333333;
  156. }
  157. .line{
  158. width: 662rpx;
  159. background: #FFFFFF;
  160. border-radius: 10rpx;
  161. margin-bottom: 20rpx;
  162. margin-left: 24rpx;
  163. padding: 30rpx 20rpx 20rpx 20rpx;
  164. }
  165. </style>