myOrder.vue 4.3 KB

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