myOrder.vue 5.5 KB

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