couponLog.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <view class="content">
  3. <view class="page-top">
  4. <uni-search-bar :radius="100" placeholder="搜索" @confirm="search"></uni-search-bar>
  5. </view>
  6. <no-none v-if='list.length<=0'></no-none>
  7. <block v-else>
  8. <navigator @click="bindDetail(item.id)" style="margin-top: 30rpx;" class="item" v-for="(item,index) of list"
  9. :key='index'>
  10. <view class="border-b item-title flex-y-center">
  11. <view class="item-type flex-center"
  12. :class="item.status=='USED'?'item-type-one':item.status=='ENABLED'?'item-type-two':item.status=='DELETE'?'item-type-one':'item-type-three'">
  13. <!-- {{item.status=='I'?'未生效':item.status=='S'?'已生效':item.status=='D'?'已删除':'已过期'}} -->
  14. {{item.status == 'ENABLED'?'未使用': item.status=='USED'? '已使用': item.status=='DELETE'?'已删除':
  15. item.status=='REFUNDED'?'已退款': item.status=='EXPIRED'? '已过期':item.status=='UNC' ?'未领取': item.status=='USING'? '使用中':
  16. item.status=='TRANS'? '发放中':item.status=='TRANSFER'? '已转增' :item.status=='REFUNDING'? '使用中' :item.status=='UNACTIVE'? '未激活':
  17. item.status=='DISABLED'?'不可用':'' }}
  18. </view>
  19. <text>优惠券ID:{{item.voucher_id}}</text>
  20. </view>
  21. <view class="item-bottom flex-y-center">
  22. <view class="flex-grow-1">
  23. <view class="box-pack-between item-bottom-right">
  24. <text><text class="item-bottom-number">模板id</text>:{{item.template_id}}</text>
  25. </view>
  26. <view class="box-pack-between item-bottom-right flex-y-center">
  27. <text><text class="item-bottom-number">用户ID</text>:{{item.user_id}} </text>
  28. <text class="iconfont icongengduo"></text>
  29. </view>
  30. </view>
  31. </view>
  32. </navigator>
  33. </block>
  34. <!-- <view style="height: 75px;"></view>
  35. <navigator style="margin-bottom:0" url='./addCoupon' class="bottom-bar flex-center">
  36. <button formType="submit" class="flex-center ft28">+新增优惠劵</button>
  37. </navigator>
  38. -->
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. defaultIndex: 0,
  46. list: [],
  47. page: 1,
  48. $test: this.$test.$test,
  49. URL: getApp().globalData.URL,
  50. is_load: false
  51. }
  52. },
  53. onLoad() {
  54. uni.setNavigationBarTitle({
  55. title: "优惠列表"
  56. })
  57. },
  58. onShow() {
  59. this.page = 1;
  60. this.list = [];
  61. this.http();
  62. },
  63. onReachBottom(e) {
  64. if (!this.is_load) {
  65. this.page = this.page + 1;
  66. this.http();
  67. }
  68. },
  69. methods: {
  70. enit(id) {
  71. uni.navigateTo({
  72. url: "./add?id=" + id
  73. })
  74. },
  75. previewImg(logourl) {
  76. let URL = this.URL + logourl;
  77. uni.previewImage({
  78. urls: [URL]
  79. });
  80. },
  81. bindDetail(id) {
  82. uni.navigateTo({
  83. url: "./couponLog_detail?id=" + id
  84. })
  85. },
  86. http() {
  87. let url = "Smdcshop/getCouponList";
  88. this.request({
  89. url,
  90. data: {
  91. admin_id: uni.getStorageSync("admin_id"),
  92. page: this.page,
  93. limit: 10,
  94. coupon_type: 2
  95. },
  96. showLoading: true,
  97. }).then(res => {
  98. console.log(res, "res")
  99. if (res.code === "200") {
  100. this.list = this.list.concat(res.data);
  101. if (res.data.length == 0) {
  102. this.is_load = true
  103. } else {
  104. this.is_load = false
  105. }
  106. }
  107. });
  108. },
  109. },
  110. }
  111. </script>
  112. <style lang="scss">
  113. page {
  114. background: #F5F7FA;
  115. }
  116. .page-top{
  117. background: #fff;
  118. position: sticky;
  119. top: 0;
  120. z-index: 99;
  121. padding:10rpx 0;
  122. box-shadow: 0 5rpx 10rpx #f0f0f0;
  123. }
  124. .item {
  125. width: 690rpx;
  126. background: #ffffff;
  127. margin: 0 auto;
  128. padding: 0rpx 24rpx;
  129. opacity: 1;
  130. border-radius: 8rpx;
  131. box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(213, 213, 213, 0.04);
  132. .item-title {
  133. opacity: 1;
  134. font-size: 28rpx;
  135. font-family: PingFang SC, PingFang SC-Medium;
  136. font-weight: 500;
  137. color: #333333;
  138. padding: 24rpx 0;
  139. .item-type {
  140. margin-right: 16rpx;
  141. // width: 78rpx;
  142. height: 40rpx;
  143. font-size: 21rpx;
  144. opacity: 1;
  145. border-radius: 4rpx;
  146. color: #FFFFFF;
  147. border-bottom: 1rpx solid #F1F1F1;
  148. padding: 0 13rpx;
  149. min-width: 100rpx;
  150. }
  151. .item-type-one {
  152. background: linear-gradient(134deg, #FF8C1A 2%, #FF8C1A 98%);
  153. }
  154. .item-type-two {
  155. background: linear-gradient(135deg, #4992ff 2%, #61a8fc 97%);
  156. }
  157. .item-type-three {
  158. background: linear-gradient(134deg, #febe07 2%, #ffcc3e 98%);
  159. }
  160. }
  161. .item-bottom {
  162. font-size: 26rpx;
  163. padding: 20rpx 0 24rpx 0;
  164. color: #666666;
  165. .item-bottom-left {
  166. width: 90rpx;
  167. height: 90rpx;
  168. margin-right: 24rpx;
  169. min-width: 90rpx;
  170. margin-bottom: 16rpx;
  171. }
  172. .item-bottom-right {
  173. margin-bottom: 16rpx;
  174. .item-bottom-number {
  175. color: #99A0AD;
  176. }
  177. }
  178. }
  179. }
  180. .color-ffa {
  181. color: #3387FF;
  182. }
  183. .icongengduo {
  184. color: #999;
  185. font-size: 24rpx;
  186. }
  187. .bottom-bar {
  188. position: fixed;
  189. bottom: 0px;
  190. width: 100%;
  191. z-index: 1000;
  192. background: #FFFFFF;
  193. padding: 30rpx 0;
  194. }
  195. .bottom-bar button {
  196. width: 690rpx;
  197. height: 98rpx;
  198. opacity: 1;
  199. background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
  200. border-radius: 8rpx;
  201. box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(51, 135, 255, 0.20);
  202. margin: 0 auto;
  203. opacity: 1;
  204. font-size: 36rpx;
  205. font-family: PingFang SC, PingFang SC-Medium;
  206. font-weight: 500;
  207. color: #ffffff;
  208. }
  209. .label {
  210. min-width: 70rpx;
  211. height: 44rpx;
  212. /* line-height: 44rpx; */
  213. padding: 0 10rpx;
  214. color: #FFFFFF;
  215. font-size: 24rpx;
  216. background-color: #1E9FFF;
  217. margin-left: 20rpx;
  218. border-radius: 5rpx;
  219. }
  220. </style>