discountDlq.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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">{{item.actName}}</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 @click="goDetail(item.id)">查看详情></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. bizUserId:'',
  42. discount:'',
  43. }
  44. },
  45. onLoad(opt) {
  46. this.themeColor = uni.getStorageSync("themeColor");
  47. this.userInfo = uni.getStorageSync("userInfo");
  48. this.bizUserId=opt.bizUserId;
  49. this.discount=opt.discount;
  50. this.getList()
  51. },
  52. onShow() {
  53. },
  54. methods: {
  55. goDetail(id) {
  56. uni.navigateTo({
  57. url: 'discountCardDetail?id=' + id+'&type=2'
  58. })
  59. },
  60. receive(id){
  61. uni.showLoading({
  62. title: '领取中'
  63. })
  64. this.$http('opencoupon/getCoupons', {
  65. id: id,
  66. }, 'GET').then(res => {
  67. uni.hideLoading();
  68. uni.showToast({
  69. title: '领取成功',
  70. icon:'none',
  71. duration: 3000
  72. });
  73. //this.getList();
  74. //var data=res.data.Items;
  75. //this.list=this.list.concat(data);
  76. //console.log('list+=', this.queryShopList);
  77. })
  78. },
  79. getList(){
  80. uni.showLoading({
  81. title: '加载中'
  82. })
  83. if(this.discount!=2){
  84. var params={
  85. discount:this.discount
  86. }
  87. }else{
  88. var params={
  89. discount:this.discount,
  90. bizId:this.bizUserId
  91. }
  92. }
  93. this.$http('opencoupon/getCouponList', params, 'GET').then(res => {
  94. uni.hideLoading();
  95. this.list = res.data;
  96. //var data=res.data.Items;
  97. //this.list=this.list.concat(data);
  98. //console.log('list+=', this.queryShopList);
  99. })
  100. }
  101. },
  102. onReachBottom(){
  103. //this.page++;
  104. this.getList()
  105. //console.log("shanglas")
  106. },
  107. onPullDownRefresh(){
  108. //this.page=1;
  109. //this.list=[];
  110. this.getList();
  111. setTimeout(() => {
  112. uni.stopPullDownRefresh(); // 关闭下拉刷新
  113. }, 2000);
  114. }
  115. }
  116. </script>
  117. <style scoped lang="less">
  118. .box {
  119. width: 100vw;
  120. min-height: 100vh;
  121. background: #F4F5F7;
  122. }
  123. .receiveBtn1{
  124. width: 144rpx;
  125. height: 56rpx;
  126. font-size: 28rpx;
  127. line-height: 56rpx;
  128. color: #D53533;
  129. border-radius: 36rpx;
  130. border: 2rpx solid #D53533;
  131. text-align: center;
  132. }
  133. .lineTop1{
  134. display: flex;
  135. }
  136. .linetop2{
  137. display: flex;font-size: 24rpx;
  138. padding-bottom: 39rpx;
  139. padding-top: 10rpx;
  140. }
  141. .mdsky{
  142. color: #666666;
  143. }
  144. .endOffsetDays{
  145. color: #666666;
  146. }
  147. .linemoney{
  148. width: 260rpx;
  149. }
  150. .linetop{
  151. display: flex;
  152. justify-content: space-between;
  153. }
  154. .mdsky{
  155. width: 260rpx;
  156. }
  157. .lineBottom{
  158. display: flex;
  159. justify-content: space-between;
  160. color: #999999;
  161. font-size: 24rpx;
  162. padding-top: 20rpx;
  163. border-top: 1px dashed #EEEEEE;
  164. }
  165. .linemoney{
  166. color: #FF3B30;font-size: 26rpx;
  167. }
  168. .lineTopName{
  169. font-size: 30rpx;
  170. font-family: PingFangSC-Medium, PingFang SC;
  171. font-weight: 500;
  172. color: #333333;
  173. }
  174. .line{
  175. width: 662rpx;
  176. background: #FFFFFF;
  177. border-radius: 10rpx;
  178. margin-bottom: 20rpx;
  179. margin-left: 24rpx;
  180. padding: 30rpx 20rpx 20rpx 20rpx;
  181. }
  182. </style>