myPromote.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view>
  3. <view class="search">
  4. <u-search @custom="search" border-color="#fff" bg-color="#fff" placeholder="输入商家名称" v-model="keyword"></u-search>
  5. </view>
  6. <view class="content">
  7. <view class="flex text-bold" style="padding:0 20rpx 0 40rpx">
  8. <view class="area1">
  9. 加入时间
  10. </view>
  11. <view class="area2">
  12. 商户名称
  13. </view>
  14. <view class="area3">
  15. 审核状态
  16. </view>
  17. </view>
  18. <mescroll-body :height="height" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
  19. :up="upOption">
  20. <navigator :url="'/pagesB/pages/shop-detail?id='+item.id" hover-class="none" class="item" v-for="(item,index) in list" :key="index">
  21. <view class="area1 flex flex-direction justify-end padding-left-20" >
  22. {{item.createTime}}
  23. </view>
  24. <view class="area2 text-cut-1">
  25. {{item.name}}
  26. </view>
  27. <view class="area3">
  28. <text class="text-green" v-if="item.auditStatus=='PASS'">审核通过</text>
  29. <text class="text-red" v-if="item.auditStatus=='FAIL'">审核失败</text>
  30. <text class="text-red" v-if="item.auditStatus=='STOP'">已停用</text>
  31. <text class="text-orange" v-if="item.auditStatus.includes('WAITING')">待审核</text>
  32. </view>
  33. </navigator>
  34. </mescroll-body>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
  40. export default {
  41. mixins: [MescrollMixin],
  42. data() {
  43. return {
  44. list:[],
  45. downOption:{
  46. auto:false
  47. },
  48. total:0,
  49. keyword:''
  50. }
  51. },
  52. methods: {
  53. downCallback() {
  54. setTimeout(() => {
  55. uni.showToast({
  56. title: "刷新成功",
  57. icon: "none"
  58. })
  59. this.mescroll.resetUpScroll();
  60. }, 1000)
  61. },
  62. upCallback(mescroll) {
  63. let params = {
  64. agenter:this.vuex_userId,
  65. current:mescroll.num,
  66. size:mescroll.size,
  67. }
  68. if (!this.$isEmpty(this.keyword)) {
  69. params.name=this.keyword
  70. }
  71. try {
  72. this.$api.shop.list(params).then(res => {
  73. let data = res.data.records
  74. let total = res.data.total
  75. this.total=total
  76. mescroll.endBySize(data.length, total);
  77. if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
  78. this.list = this.list.concat(data); //追加新数据
  79. })
  80. } catch (e) {
  81. this.mescroll.endErr()
  82. }
  83. },
  84. search(){
  85. this.mescroll.resetUpScroll();
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. .search{
  92. padding: 30rpx 30rpx 50rpx;
  93. }
  94. .tips{
  95. color: #ff9900;
  96. padding: 30rpx 30rpx 0rpx;
  97. }
  98. .content{
  99. .area1 {
  100. width: 50%;
  101. }
  102. .area2 {
  103. width: 30%;
  104. }
  105. .area3 {
  106. width: 20%;
  107. }
  108. .item{
  109. margin-top: 20rpx;
  110. background-color: #FFFFFF;
  111. display: flex;
  112. padding-top: 20rpx;
  113. padding-bottom: 20rpx;
  114. }
  115. }
  116. </style>