discountDlq.vue 3.9 KB

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