coupon-list-wf.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <view class="page">
  3. <view class="body after-navber">
  4. <view class="info">
  5. <view class="info-list" style="width:100%;">
  6. <block v-for="(item, index) in coupon_list" :key="index">
  7. <block>
  8. <view class="info-one">
  9. <image class="bga" src="../../static/icon-coupon-enabled.png">
  10. </image>
  11. <view class="info-content flex-row flex-x-center flex-y-center fs-b">
  12. <navigator hover-class="none"
  13. class="info-content flex-row flex-x-center flex-y-center">
  14. <view class="flex-grow-0">
  15. <view class="flex-row flex-y-bottom">
  16. <block>
  17. <view class="flex-grow-0">¥</view>
  18. <view class="flex-grow-1" style="font-size:23pt;">
  19. {{ Number(item.price) }}
  20. </view>
  21. </block>
  22. </view>
  23. </view>
  24. <view class="flex-grow-1">
  25. <view style="margin-left:16rpx;">
  26. <view style="margin-bottom:4rpx;">{{item.goods_name}}</view>
  27. <view style="font-size: 26rpx;">
  28. {{ item.discount_type==1?'满减券':item.discount_type==2 ?'折扣券':item.discount_type==3?'特价券':''}}
  29. </view>
  30. </view>
  31. </view>
  32. </navigator>
  33. <view class="flex-grow-0">
  34. <block>
  35. <view @tap="receive(index)" :data-index="index"
  36. class="flex-x-center flex-y-center info-btn fs-sm" :data-id="item.id"
  37. style="color:#ff4544;">立即查看</view>
  38. </block>
  39. <!-- <block v-if="coupon.state == 2">
  40. <view class="flex-x-center flex-y-center info-btn fs-sm"
  41. style="color:#999;">已领取</view>
  42. </block> -->
  43. </view>
  44. </view>
  45. <view class="info-footer fs-sm box-pack-between flex-y-center">
  46. <view class="">
  47. <!-- <view v-if="item.type==2" style="font-size: 24rpx;">指定商品可用</view> -->
  48. <view class="info-day">描述:{{item.body}}</view>
  49. </view>
  50. <!-- <image v-if="item.type==2" @click.stop="bindChecked(index)" class="more-down"
  51. :class="item.checked?'more-down-deg':''" src="../../static/more-down.png">
  52. </image> -->
  53. </view>
  54. <!--
  55. <view class="coupon-foot flex-grow-1" v-if="coupon.checked">
  56. <view class="box-pack-between">
  57. <view class="mrt16 flex flex-grow-1">
  58. <text style="min-width: 190rpx;">指定商品:</text>
  59. <view class="flex-grow-1">
  60. <view class="box-pack-between" v-for="(item,index) of coupon.goods">
  61. {{item.name}} <text style="color: red;">¥{{item.price}}</text>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view> -->
  67. </view>
  68. </block>
  69. </block>
  70. </view>
  71. <block v-if="coupon_list.length <= 0">
  72. <view class="flex-x-center"><text style="margin-top:50rpx;color: #999;">暂无优惠券</text></view>
  73. </block>
  74. </view>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. var share_count = 0;
  80. let hideLoading = true;
  81. export default {
  82. data() {
  83. return {
  84. coupon_list: [
  85. // {goods_name:'发发发发发',body:'2这',discount_type:1,price:'110'},{},
  86. ],
  87. get_coupon_list: "",
  88. wxapp_img: {},
  89. staff_id: "",
  90. is_load: false,
  91. is_load_more: false,
  92. setColor: "",
  93. systemInfo: {},
  94. limit: 10,
  95. page: 1,
  96. };
  97. },
  98. props: {},
  99. onLoad: function(t) {
  100. uni.setNavigationBarColor({
  101. frontColor: '#ffffff',
  102. backgroundColor: this.$store.state.color,
  103. })
  104. this.setColor = this.$store.state.color;
  105. this.http();
  106. this.systemInfo = uni.getStorageSync('systemInfo');
  107. },
  108. onShareAppMessage(e) {
  109. return {}
  110. },
  111. onShow: function() {},
  112. onReachBottom() {
  113. // if (!this.is_load) {
  114. // this.page = this.page + 1;
  115. this.http();
  116. // }
  117. },
  118. methods: {
  119. bindChecked(index) {
  120. this.coupon_list[index].checked = !this.coupon_list[index].checked;
  121. },
  122. http() {
  123. this.$http.request('xcx/wofu_coupon_list', {
  124. // user_id: uni.getStorageSync('user_id'),
  125. store_id: uni.getStorageSync('store_id'),
  126. limit: this.limit,
  127. page: this.page,
  128. }, "", "", hideLoading).then(res => {
  129. console.log(res, "LqCoupons_lists")
  130. this.coupon_list = this.coupon_list.concat(res.data);
  131. this.page = this.page + 1;
  132. })
  133. },
  134. receive(index) {
  135. // #ifdef MP-WEIXIN
  136. uni.showToast({
  137. title: '请到支付宝端领取',
  138. icon: 'none'
  139. })
  140. // #endif
  141. // #ifdef MP-ALIPAY
  142. let url = this.coupon_list[index].link_url;
  143. my.ap.navigateToAlipayPage({
  144. // 例如跳转到共享单车页面,其 scheme 格式为:
  145. // alipays://platformapi/startapp?appId=60000155&chInfo=ch_${appid},${appid} 替换为自己的16位 appid,例如:
  146. path: url,
  147. success: (res) => {
  148. // my.alert({content:'系统信息' + JSON.stringify(res)});
  149. },
  150. fail: (error) => {
  151. // my.alert({content:'系统信息' + JSON.stringify(error)});
  152. }
  153. })
  154. // #endif
  155. },
  156. }
  157. };
  158. </script>
  159. <style>
  160. @import "./coupon-list.css";
  161. </style>