index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. console.log(res)
  69. this.count = res.data.count
  70. this.listData = this.listData.concat(res.data.list)
  71. uni.hideLoading();
  72. this.loading = false
  73. })
  74. },
  75. // 跳转逻辑
  76. jump(item) {
  77. console.log(item)
  78. if ([0, 2].includes(item.status)) {
  79. uni.navigateTo({
  80. url: `/pages/store/settled/index?mer_i_id=${item.mer_intention_id}`
  81. })
  82. } else if (item.status === 1) {
  83. uni.navigateTo({
  84. url: `/pages/store/merchantDetails/index?mer_i_id=${item.mer_intention_id}&mer_id=${item.mer_id}`
  85. })
  86. }
  87. },
  88. //状态判断
  89. statusText(number) {
  90. // 使用对象
  91. let statusData = {
  92. 0: this.$t(`待审核`),
  93. 1: this.$t(`审核通过`),
  94. 2: this.$t(`审核未通过`),
  95. };
  96. return statusData[number]
  97. },
  98. // button显示文字
  99. statusBtn(number) {
  100. // 使用对象
  101. let statusData = {
  102. 0: this.$t(`编辑`),
  103. 1: this.$t(`查看`),
  104. 2: this.$t(`重新提交`),
  105. };
  106. return statusData[number]
  107. },
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. .main {}
  113. .application-record {
  114. display: flex;
  115. flex-direction: column;
  116. align-items: center;
  117. background-color: #F5F5F5;
  118. padding: 20rpx 30rpx;
  119. .card-list {
  120. width: 100%;
  121. background-color: #fff;
  122. padding: 20rpx 24rpx;
  123. margin: 10rpx 20rpx;
  124. border-radius: 12rpx;
  125. .card-top {
  126. height: 140rpx;
  127. .title {
  128. font-size: 28rpx;
  129. font-weight: bold;
  130. color: #333333;
  131. }
  132. .time {
  133. color: #999999;
  134. font-size: 24rpx;
  135. padding: 5rpx 0;
  136. }
  137. .reason {
  138. color: #E93323;
  139. font-weight: bold;
  140. font-size: 24rpx;
  141. }
  142. }
  143. .line {
  144. height: 2rpx;
  145. margin: 20rpx 0 20rpx 0;
  146. background-color: #EEEEEE;
  147. }
  148. .card-bottom {
  149. display: flex;
  150. justify-content: space-between;
  151. align-items: center;
  152. color: #333;
  153. .card-status {
  154. display: flex;
  155. align-items: center;
  156. .status-icon {
  157. width: 30rpx;
  158. height: 30rpx;
  159. margin: 10rpx;
  160. }
  161. .status-text {
  162. font-size: 28rpx;
  163. font-weight: 500;
  164. }
  165. }
  166. .status-btn {
  167. font-size: 26rpx;
  168. color: #555;
  169. border: 1px solid #999999;
  170. padding: 8rpx 32rpx;
  171. border-radius: 40rpx;
  172. }
  173. }
  174. }
  175. }
  176. .no-shop {
  177. width: 100%;
  178. background-color: #fff;
  179. height: 100vh;
  180. .pictrue {
  181. display: flex;
  182. flex-direction: column;
  183. align-items: center;
  184. color: $uni-nothing-text;
  185. image {
  186. width: 414rpx;
  187. height: 380rpx;
  188. }
  189. }
  190. }
  191. </style>