myOrder.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <template>
  2. <view class="box">
  3. <view class="tab">
  4. <view class="tabLine" :class="{tabActive:tabIndex==0}" @click="tabClick(0)">全部</view>
  5. <view class="tabLine" :class="{tabActive:tabIndex==1}" @click="tabClick(1)">待付款</view>
  6. <view class="tabLine" :class="{tabActive:tabIndex==2}" @click="tabClick(2)">待服务</view>
  7. <view class="tabLine" :class="{tabActive:tabIndex==3}" @click="tabClick(3)">已完成</view>
  8. </view>
  9. <view class="main">
  10. <view class="itemBg" v-for="(item,index) in items" @click="goDetail(item.ID)">
  11. <view class="itemTop">
  12. <view style="color: #999999; font-size: 24rpx;">保养订单</view>
  13. <view class="itemSheetState" v-if="item.SheetState==1">待付款</view>
  14. <view class="itemSheetState" v-if="item.SheetState==2">待确认</view>
  15. <view class="itemSheetState" v-if="item.SheetState==3">待收货</view>
  16. <view class="itemSheetState" v-if="item.SheetState==4">待服务</view>
  17. <view class="itemSheetState" v-if="item.SheetState==5">已完成</view>
  18. <view class="itemSheetState" v-if="item.SheetState==0">已取消</view>
  19. </view>
  20. <view class="itemShopBg">
  21. <view class="shopName">{{item.ShopName}}</view>
  22. <view class="price">¥{{item.raleMoney}}</view>
  23. </view>
  24. <view class="itemName">{{item.itemNameList?item.itemNameList:''}},{{item.goodNameList?item.goodNameList:''}}</view>
  25. </view>
  26. <nodata v-show="items==''&&isload"></nodata>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import nodata from '@/components/nodata/nodata.vue'
  32. export default {
  33. components: {
  34. nodata
  35. },
  36. data() {
  37. return {
  38. page: 1,
  39. tabIndex: '',
  40. items: [],
  41. isload: false,
  42. }
  43. },
  44. onLoad(opt) {
  45. this.tabIndex = opt.num;
  46. this.getData()
  47. },
  48. onShow() {
  49. console.log(this.tabIndex)
  50. this.getData()
  51. },
  52. methods: {
  53. tabClick(num) {
  54. this.tabIndex = num;
  55. this.page = 1;
  56. this.getData()
  57. },
  58. goDetail(id) {
  59. uni.navigateTo({
  60. url: 'orderDetail?id=' + id
  61. })
  62. },
  63. getData() {
  64. uni.showLoading({
  65. title: '加载中'
  66. });
  67. this.isload = false;
  68. if (this.tabIndex == 6) {
  69. var padata = {
  70. page: this.page,
  71. limit: 10,
  72. }
  73. } else {
  74. if (this.tabIndex == 5) {
  75. var padata = {
  76. page: this.page,
  77. limit: 10,
  78. evaluateState: '待评价'
  79. }
  80. } else {
  81. var padata = {
  82. page: this.page,
  83. limit: 10,
  84. state: this.tabIndex
  85. }
  86. }
  87. }
  88. this.$http('worldKeepCar/keepCarMy/listMiNiTMSheetPage', padata, 'GET').then(res => {
  89. uni.hideLoading();
  90. this.isload = true;
  91. var list = res.data.Items;
  92. if (this.page == 1) {
  93. this.items = list
  94. } else {
  95. this.items = this.items.concat(list)
  96. }
  97. })
  98. },
  99. },
  100. onReachBottom() {
  101. this.page++;
  102. this.getData()
  103. },
  104. onPullDownRefresh() {
  105. this.page = 1;
  106. this.getData()
  107. setTimeout(function() {
  108. uni.stopPullDownRefresh();
  109. }, 1000);
  110. }
  111. }
  112. </script>
  113. <style scoped>
  114. .box {
  115. min-height: 100vh;
  116. background: #F4F5F7;
  117. }
  118. .tab {
  119. background: #FFFFFF;
  120. display: flex;
  121. justify-content: space-between;
  122. line-height: 92rpx;
  123. position: fixed;
  124. width: calc(100vw - 48rpx);
  125. padding-left: 24rpx;
  126. padding-right: 24rpx;
  127. height: 92rpx;
  128. z-index: 11;
  129. }
  130. .tabLine {
  131. font-size: 30rpx;
  132. text-align: center;
  133. }
  134. .tabActive {
  135. color: #FF4F00;
  136. border-bottom: 4rpx solid #FF4F00;
  137. }
  138. .main {
  139. padding-top: 92rpx;
  140. padding-bottom: 20rpx;
  141. background-color: #F4F5F7;
  142. }
  143. .itemBg {
  144. margin: 20rpx 24rpx;
  145. background-color: #FFFFFF;
  146. border-radius: 10rpx;
  147. padding: 20rpx;
  148. }
  149. .itemTop {
  150. display: flex;
  151. justify-content: space-between;
  152. }
  153. .itemSheetState {
  154. font-size: 24rpx;
  155. color: #FF2400
  156. }
  157. .itemShopBg {
  158. display: flex;
  159. justify-content: space-between;
  160. margin-top: 20rpx;
  161. }
  162. .shopName {
  163. color: #333333;
  164. font-size: 30rpx;
  165. }
  166. .price {
  167. color: #333333;
  168. font-size: 32rpx;
  169. }
  170. .itemName {
  171. color: #666666;
  172. font-size: 24rpx;
  173. padding: 16rpx 0;
  174. height: 30rpx;
  175. overflow: hidden;
  176. text-overflow: ellipsis;
  177. white-space: nowrap;
  178. }
  179. .plateBg{
  180. display: flex;
  181. justify-content: space-between;
  182. align-items: center;
  183. }
  184. .plateNumber {
  185. color: #666666;
  186. font-size: 24rpx;
  187. margin-bottom: 20rpx;
  188. display: flex;
  189. }
  190. .itemLineBottom {
  191. display: flex;
  192. justify-content: flex-end;
  193. }
  194. .itemBtn1 {
  195. width: 150rpx;
  196. height: 56rpx;
  197. border-radius: 36rpx;
  198. border: 2rpx solid #DDDDDD;
  199. text-align: center;
  200. line-height: 56rpx;
  201. font-size: 28rpx;
  202. color: #3C3C3C;
  203. margin-left: 40rpx;
  204. }
  205. .itemBtn2 {
  206. width: 150rpx;
  207. height: 56rpx;
  208. border-radius: 36rpx;
  209. border: 2rpx solid #FF4F00;
  210. text-align: center;
  211. line-height: 56rpx;
  212. font-size: 28rpx;
  213. color: #FF4F00;
  214. margin-left: 40rpx;
  215. }
  216. .orderState{
  217. color: #F19D01;
  218. font-size: 24rpx;
  219. padding-left: 20rpx;
  220. }
  221. </style>