changeStoreList.vue 5.8 KB

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