changeStoreList.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <template>
  2. <view class="content">
  3. <view class="topView">
  4. <!-- tab -->
  5. <view class="tab">
  6. <view class="tabLine" :class="{tabActive:tabIndex==1}" @click="tabClick(1)">待处理</view>
  7. <view class="tabLine" :class="{tabActive:tabIndex==2}" @click="tabClick(2)">申请记录</view>
  8. </view>
  9. <!-- 搜索 -->
  10. <view class="searchBoxBg">
  11. <searchBox placeholder="订单号、申请单号" @search='search($event)'></searchBox>
  12. </view>
  13. </view>
  14. <!-- list -->
  15. <view class="listContent">
  16. <view class="itemBg" v-for="(item,index) in itemData">
  17. <view class="firstView">
  18. <view style="font-size: 24rpx; color: #999999;">申请单号:{{item.ChangeCode}}</view>
  19. <view class="rightView">
  20. <image src="../../static/img/icon_change.png" mode="" style="width: 30rpx; height: 30rpx; margin-right: 10rpx;"></image>
  21. <view style="color: #666666; font-size: 24rpx;">更换门店</view>
  22. </view>
  23. </view>
  24. <view class="shopName">
  25. <text style="color: #999999; font-size: 26rpx;">更换前门店:</text>
  26. {{item.OldShopName}}</view>
  27. <view class="shopName">
  28. <text style="color: #999999; font-size: 26rpx;">更换后门店:</text>
  29. {{item.NewShopName}}</view>
  30. <!-- "ChangeState": //备注:1待处理2更换成功3更换关闭 -->
  31. <view class="stateView" v-if="item.ChangeState==1">待平台处理</view>
  32. <view class="stateView" v-if="item.ChangeState==2">更换成功</view>
  33. <view class="stateView" v-if="item.ChangeState==3">更换关闭</view>
  34. <view style="display: flex; justify-content: flex-end;">
  35. <view class="detail" @click="goDetail(item.ID)">更换详情</view>
  36. </view>
  37. </view>
  38. </view>
  39. <!-- 上拉 加载更多 -->
  40. <view class="noMore" v-if="noMoreShow">没有更多数据</view>
  41. <!-- 无数据空白页 -->
  42. <view class="nodataBox" v-if="itemData.length == 0">
  43. <image src="../../static/img/pic_empty_def.png" mode="widthFix" class="nodataImg"></image>
  44. <view class="noTxt">暂无数据</view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import searchBox from '@/components/searchBox/searchBox.vue'
  50. export default {
  51. components: {
  52. searchBox
  53. },
  54. data() {
  55. return {
  56. searchValue: '',
  57. page: 1,
  58. tabIndex: 1,
  59. itemData:[],
  60. noMoreShow: false,
  61. }
  62. },
  63. onLoad() {
  64. this.getData();
  65. },
  66. onShow() {
  67. this.page = 1
  68. this.getData();
  69. },
  70. methods: {
  71. goDetail(id){
  72. uni.navigateTo({
  73. url:'changeStoreDetail?id='+id
  74. })
  75. },
  76. tabClick(num) {
  77. this.tabIndex = num;
  78. this.page = 1;
  79. this.getData()
  80. },
  81. search(val) {
  82. // console.log(val);
  83. this.searchValue = val
  84. this.page = 1
  85. this.getData()
  86. },
  87. getData() {
  88. uni.showLoading({
  89. title: '加载中'
  90. })
  91. var changeStateStr = ''
  92. if (this.tabIndex == 1) {
  93. changeStateStr = '1'
  94. }
  95. let url = 'worldKeepCar/keepCarMy/listTMSheetChangeShopPage',
  96. params = {
  97. page: this.page,
  98. limit: 10,
  99. name: this.searchValue,
  100. changeState:changeStateStr,
  101. }
  102. this.$http(url, params, 'GET').then(res => {
  103. uni.hideLoading()
  104. var list = res.data.Items
  105. // 处理 undefined和null转为空白字符串
  106. list.forEach((item, index) => {
  107. for (const key in item) {
  108. item[key] = this.$praseStrEmpty(item[key])
  109. }
  110. })
  111. if (this.page == 1) {
  112. this.itemData = list
  113. } else {
  114. this.itemData = this.itemData.concat(list)
  115. }
  116. if (list.length < 10) {
  117. this.noMoreShow = false
  118. } else {
  119. this.noMoreShow = true
  120. }
  121. })
  122. }
  123. },
  124. onPullDownRefresh() {
  125. this.page = 1;
  126. this.getData()
  127. setTimeout(function() {
  128. uni.stopPullDownRefresh();
  129. }, 1000);
  130. },
  131. onReachBottom() {
  132. this.page++;
  133. this.getData()
  134. }
  135. }
  136. </script>
  137. <style>
  138. .content {
  139. background: #F4F5F7;
  140. min-height: 100vh;
  141. }
  142. .topView {
  143. background: #FFFFFF;
  144. position: fixed;
  145. width: 100%;
  146. height: 210rpx;
  147. z-index: 99;
  148. }
  149. .tab {
  150. background: #FFFFFF;
  151. display: flex;
  152. justify-content: space-around;
  153. line-height: 90rpx;
  154. height: 90rpx;
  155. width: 100%;
  156. }
  157. .tabLine {
  158. text-align: center;
  159. }
  160. .tabActive {
  161. color: #FF4F00;
  162. border-bottom: 4rpx solid #FF4F00;
  163. }
  164. .searchBoxBg {
  165. width: 100%;
  166. background-color: #FFFFFF;
  167. border-top: 1rpx solid #EEEEEE;
  168. }
  169. .searchBox {
  170. display: flex;
  171. height: 72rpx;
  172. margin: 24rpx;
  173. background-color: #F4F5F7;
  174. border-radius: 36rpx;
  175. }
  176. .listContent{
  177. padding-top: 210rpx;
  178. padding-bottom: 20rpx;
  179. }
  180. .itemBg {
  181. background-color: #FFFFFF;
  182. margin: 20rpx 24rpx;
  183. border-radius: 10rpx;
  184. padding: 20rpx;
  185. }
  186. .firstView{
  187. padding-bottom: 20rpx;
  188. display: flex;
  189. justify-content: space-between;
  190. }
  191. .rightView{
  192. display: flex;
  193. align-items: center;
  194. }
  195. .shopName{
  196. padding-bottom: 20rpx;
  197. color: #333333;
  198. font-size: 26rpx;
  199. }
  200. .stateView{
  201. background-color: #F8F9FB;
  202. border-radius: 10rpx;
  203. color: #333333;
  204. font-size: 26rpx;
  205. padding: 20rpx;
  206. }
  207. .detail{
  208. color: #FF2400;
  209. font-size: 26rpx;
  210. margin-top: 20rpx;
  211. width: 150rpx;
  212. height: 56rpx;
  213. line-height: 56rpx;
  214. text-align: center;
  215. border-radius: 36rpx;
  216. border: 1rpx #FF2400 solid;
  217. }
  218. /* 空白页css */
  219. .nodataBox {
  220. text-align: center;
  221. }
  222. .nodataImg {
  223. width: 400rpx;
  224. padding-top: 300rpx;
  225. }
  226. .noTxt {
  227. font-size: 30rpx;
  228. color: #999999;
  229. padding-top: 50rpx;
  230. }
  231. .noMore {
  232. text-align: center;
  233. line-height: 50rpx;
  234. color: #999999;
  235. font-size: 28rpx;
  236. }
  237. </style>