index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view class="">
  3. <view class="application-record" v-if="listData.length">
  4. <view class="card-list" v-for="item in listData" :key="item.mer_intention_id">
  5. <view class="card-top">
  6. <view class="title">{{item.mer_name}}</view>
  7. <view class="time">{{$t(`提交时间`)}}:{{item.create_time}}</view>
  8. <view v-if="item.fail_msg" class="reason">{{$t(`原因`)}}:{{item.fail_msg}}</view>
  9. </view>
  10. <view class="line"></view>
  11. <view class="card-bottom">
  12. <view class="card-status">
  13. <image class="status-icon" v-if="item.status === 0" src="../static/images/pending.png" mode=""></image>
  14. <image class="status-icon" v-else-if="item.status === 1" src="../static/images/passed.png" mode=""></image>
  15. <image class="status-icon" v-else-if="item.status === 2" src="../static/images/not-pass.png" mode=""></image>
  16. <text class="status-text">{{statusText(item.status)}}</text>
  17. </view>
  18. <view class="status-btn" @click="jump(item)">{{statusBtn(item.status)}}</view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class='no-shop' v-if="!listData.length && !loading">
  23. <view class='pictrue' style="margin: 0 auto;">
  24. <image src='/static/images/no-shop.png'></image>
  25. <text>{{$t(`暂无申请记录,快去申请吧!`)}}</text>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. // import {
  32. // getApplicationRecordList
  33. // } from '@/api/store.js'
  34. export default {
  35. data() {
  36. return {
  37. loading: false,
  38. listData: [],
  39. pageData: {
  40. page: 1,
  41. limit: 10,
  42. }
  43. }
  44. },
  45. onLoad() {
  46. // this.getListData()
  47. },
  48. // 滚动到底部
  49. onReachBottom() {
  50. if (this.count == this.listData.length) {
  51. uni.showToast({
  52. title: this.$t(`没有更多啦`),
  53. icon: 'none',
  54. duration: 1000
  55. });
  56. } else {
  57. this.pageData.page += 1
  58. this.getListData()
  59. }
  60. },
  61. methods: {
  62. getListData() {
  63. this.loading = true
  64. uni.showLoading({
  65. title: this.$t(`正在加载中`),
  66. });
  67. getApplicationRecordList(this.pageData).then(res => {
  68. this.count = res.data.count
  69. this.listData = this.listData.concat(res.data.list)
  70. uni.hideLoading();
  71. this.loading = false
  72. })
  73. },
  74. // 跳转逻辑
  75. jump(item) {
  76. if ([0, 2].includes(item.status)) {
  77. uni.navigateTo({
  78. url: `/pages/store/settled/index?mer_i_id=${item.mer_intention_id}`
  79. })
  80. } else if (item.status === 1) {
  81. uni.navigateTo({
  82. url: `/pages/store/merchantDetails/index?mer_i_id=${item.mer_intention_id}&mer_id=${item.mer_id}`
  83. })
  84. }
  85. },
  86. //状态判断
  87. statusText(number) {
  88. // 使用对象
  89. let statusData = {
  90. 0: this.$t(`待审核`),
  91. 1: this.$t(`审核通过`),
  92. 2: this.$t(`审核未通过`),
  93. };
  94. return statusData[number]
  95. },
  96. // button显示文字
  97. statusBtn(number) {
  98. // 使用对象
  99. let statusData = {
  100. 0: this.$t(`编辑`),
  101. 1: this.$t(`查看`),
  102. 2: this.$t(`重新提交`),
  103. };
  104. return statusData[number]
  105. },
  106. }
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. .main {}
  111. .application-record {
  112. display: flex;
  113. flex-direction: column;
  114. align-items: center;
  115. background-color: #F5F5F5;
  116. padding: 20rpx 30rpx;
  117. .card-list {
  118. width: 100%;
  119. background-color: #fff;
  120. padding: 20rpx 24rpx;
  121. margin: 10rpx 20rpx;
  122. border-radius: 12rpx;
  123. .card-top {
  124. height: 140rpx;
  125. .title {
  126. font-size: 28rpx;
  127. font-weight: bold;
  128. color: #333333;
  129. }
  130. .time {
  131. color: #999999;
  132. font-size: 24rpx;
  133. padding: 5rpx 0;
  134. }
  135. .reason {
  136. color: #E93323;
  137. font-weight: bold;
  138. font-size: 24rpx;
  139. }
  140. }
  141. .line {
  142. height: 2rpx;
  143. margin: 20rpx 0 20rpx 0;
  144. background-color: #EEEEEE;
  145. }
  146. .card-bottom {
  147. display: flex;
  148. justify-content: space-between;
  149. align-items: center;
  150. color: #333;
  151. .card-status {
  152. display: flex;
  153. align-items: center;
  154. .status-icon {
  155. width: 30rpx;
  156. height: 30rpx;
  157. margin: 10rpx;
  158. }
  159. .status-text {
  160. font-size: 28rpx;
  161. font-weight: 500;
  162. }
  163. }
  164. .status-btn {
  165. font-size: 26rpx;
  166. color: #555;
  167. border: 1px solid #999999;
  168. padding: 8rpx 32rpx;
  169. border-radius: 40rpx;
  170. }
  171. }
  172. }
  173. }
  174. .no-shop {
  175. width: 100%;
  176. background-color: #fff;
  177. height: 100vh;
  178. .pictrue {
  179. display: flex;
  180. flex-direction: column;
  181. align-items: center;
  182. color: $uni-nothing-text;
  183. image {
  184. width: 414rpx;
  185. height: 380rpx;
  186. }
  187. }
  188. }
  189. </style>