refundMoneyList.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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.ServiceCode}}</view>
  21. <view class="rightView">
  22. <image src="../../static/img/icon_tuikuan2.png" mode="aspectFit" style="width: 30rpx; height: 30rpx;"></image>
  23. <view style="color: #666666; font-size: 24rpx; margin-left: 10rpx;">退款</view>
  24. </view>
  25. </view>
  26. <view class="shopName">{{item.ShopName}}</view>
  27. <view class="itemName">{{item.itemNameList}},{{item.goodNameList}}</view>
  28. <view class="itemName">车牌号:{{item.PlateNumber?item.PlateNumber:''}}</view>
  29. <!-- ServiceState":1待处理2退款成功3退款关闭 -->
  30. <view class="stateView" v-if="item.ServiceState==1">待平台处理</view>
  31. <view class="stateView" v-if="item.ServiceState==2">退款成功 退款金额¥{{item.Money}}元</view>
  32. <view class="stateView" v-if="item.ServiceState==3">退款关闭</view>
  33. <view style="display: flex; justify-content: flex-end;">
  34. <view class="detail" @click="goDetail(item.ID)">退款详情</view>
  35. </view>
  36. </view>
  37. </view>
  38. <!-- 上拉 加载更多 -->
  39. <view class="noMore" v-if="noMoreShow">没有更多数据</view>
  40. <!-- 无数据空白页 -->
  41. <view class="nodataBox" v-if="itemData.length == 0">
  42. <image src="../../static/img/pic_empty_def.png" mode="widthFix" class="nodataImg"></image>
  43. <view class="noTxt">暂无数据</view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import searchBox from '@/components/searchBox/searchBox.vue'
  49. export default {
  50. components: {
  51. searchBox
  52. },
  53. data() {
  54. return {
  55. searchValue: '',
  56. page: 1,
  57. tabIndex: 1,
  58. itemData:[],
  59. noMoreShow: false,
  60. num:'',
  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:'refundMoneyDetail?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 serviceStateStr = ''
  92. if (this.tabIndex == 1) {
  93. serviceStateStr = '1'
  94. }
  95. let url = 'worldKeepCar/keepCarMy/listTMSheetAfterServicePage',
  96. params = {
  97. page: this.page,
  98. limit: 10,
  99. name: this.searchValue,
  100. serviceState:serviceStateStr,
  101. }
  102. this.$http(url, params, 'GET').then(res => {
  103. uni.hideLoading()
  104. var list = res.data.Items
  105. this.num = res.data.afterService
  106. // 处理 undefined和null转为空白字符串
  107. list.forEach((item, index) => {
  108. for (const key in item) {
  109. item[key] = this.$praseStrEmpty(item[key])
  110. }
  111. })
  112. if (this.page == 1) {
  113. this.itemData = list
  114. } else {
  115. this.itemData = this.itemData.concat(list)
  116. }
  117. if (list.length < 10) {
  118. this.noMoreShow = true
  119. } else {
  120. this.noMoreShow = false
  121. }
  122. })
  123. }
  124. },
  125. onPullDownRefresh() {
  126. this.page = 1;
  127. this.getData()
  128. setTimeout(function() {
  129. uni.stopPullDownRefresh();
  130. }, 1000);
  131. },
  132. onReachBottom() {
  133. this.page++;
  134. this.getData()
  135. }
  136. }
  137. </script>
  138. <style>
  139. .content {
  140. background: #F4F5F7;
  141. min-height: 100vh;
  142. }
  143. .topView {
  144. background: #FFFFFF;
  145. position: fixed;
  146. width: 100%;
  147. height: 210rpx;
  148. z-index: 99;
  149. }
  150. .tab {
  151. background: #FFFFFF;
  152. display: flex;
  153. justify-content: space-around;
  154. line-height: 90rpx;
  155. height: 90rpx;
  156. width: 100%;
  157. }
  158. .tabLine {
  159. text-align: center;
  160. position: relative;
  161. }
  162. .tabActive {
  163. color: #FF4F00;
  164. border-bottom: 4rpx solid #FF4F00;
  165. }
  166. .orderNum {
  167. line-height: 26rpx;
  168. background: #FF4F00;
  169. padding: 0 8rpx;
  170. border-radius: 13rpx;
  171. color: #FFFFFF;
  172. font-size: 20rpx;
  173. position: absolute;
  174. top: 10rpx;
  175. right: -10rpx;
  176. z-index: 11;
  177. }
  178. .searchBoxBg {
  179. width: 100%;
  180. background-color: #FFFFFF;
  181. border-top: 1rpx solid #EEEEEE;
  182. }
  183. .searchBox {
  184. display: flex;
  185. height: 72rpx;
  186. margin: 24rpx;
  187. background-color: #F4F5F7;
  188. border-radius: 36rpx;
  189. }
  190. .listContent{
  191. padding-top: 210rpx;
  192. padding-bottom: 20rpx;
  193. }
  194. .itemBg {
  195. background-color: #FFFFFF;
  196. margin: 20rpx 24rpx;
  197. border-radius: 10rpx;
  198. padding: 20rpx;
  199. }
  200. .firstView{
  201. padding-bottom: 20rpx;
  202. display: flex;
  203. justify-content: space-between;
  204. }
  205. .rightView{
  206. display: flex;
  207. align-items: center;
  208. }
  209. .shopName{
  210. padding-bottom: 20rpx;
  211. color: #333333;
  212. font-size: 30rpx;
  213. }
  214. .itemName{
  215. padding-bottom: 20rpx;
  216. color: #666666;
  217. font-size: 24rpx;
  218. overflow: hidden;
  219. text-overflow: ellipsis;
  220. white-space: nowrap;
  221. }
  222. .stateView{
  223. background-color: #F8F9FB;
  224. border-radius: 10rpx;
  225. color: #333333;
  226. font-size: 26rpx;
  227. padding: 20rpx;
  228. }
  229. .detail{
  230. color: #FF2400;
  231. font-size: 26rpx;
  232. margin-top: 20rpx;
  233. width: 150rpx;
  234. height: 56rpx;
  235. line-height: 56rpx;
  236. text-align: center;
  237. border-radius: 36rpx;
  238. border: 1rpx #FF2400 solid;
  239. }
  240. /* 空白页css */
  241. .nodataBox {
  242. text-align: center;
  243. }
  244. .nodataImg {
  245. width: 400rpx;
  246. padding-top: 300rpx;
  247. }
  248. .noTxt {
  249. font-size: 30rpx;
  250. color: #999999;
  251. padding-top: 50rpx;
  252. }
  253. .noMore {
  254. text-align: center;
  255. line-height: 50rpx;
  256. color: #999999;
  257. font-size: 28rpx;
  258. }
  259. </style>