myOrder.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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. else if (item.SheetType==5){
  69. uni.navigateTo({
  70. url: "paintOrderDetail?id=" + item.ID
  71. })
  72. }
  73. else if (item.SheetType==6){
  74. uni.navigateTo({
  75. url: "activityOrderDetail?id=" + item.ID
  76. })
  77. }
  78. },
  79. getData() {
  80. uni.showLoading({
  81. title: '加载中'
  82. });
  83. this.isload = false;
  84. var padata = {
  85. page: this.page,
  86. limit: 10,
  87. sheetState: this.tabIndex > 0 ? this.tabIndex : ''
  88. }
  89. this.$http('openOrderManagement/getOpenSheetList', padata, 'GET').then(res => {
  90. uni.hideLoading();
  91. this.isload = true;
  92. var list = res.data.Items;
  93. if (this.page == 1) {
  94. this.items = list
  95. } else {
  96. this.items = this.items.concat(list)
  97. }
  98. })
  99. },
  100. },
  101. onReachBottom() {
  102. this.page++;
  103. this.getData()
  104. },
  105. onPullDownRefresh() {
  106. this.page = 1;
  107. this.getData()
  108. setTimeout(function() {
  109. uni.stopPullDownRefresh();
  110. }, 1000);
  111. }
  112. }
  113. </script>
  114. <style scoped>
  115. .box {
  116. min-height: 100vh;
  117. background: #F4F5F7;
  118. }
  119. .tab {
  120. background: #FFFFFF;
  121. display: flex;
  122. justify-content: space-between;
  123. line-height: 92rpx;
  124. position: fixed;
  125. width: calc(100vw - 100rpx);
  126. padding-left: 50rpx;
  127. padding-right: 50rpx;
  128. height: 92rpx;
  129. z-index: 11;
  130. }
  131. .tabLine {
  132. font-size: 28rpx;
  133. text-align: center;
  134. }
  135. .tabActive {
  136. color: #FF0000;
  137. font-weight: bold;
  138. border-bottom: 4rpx solid #FF0000;
  139. }
  140. .main {
  141. padding-top: 92rpx;
  142. padding-bottom: 20rpx;
  143. background-color: #F4F5F7;
  144. }
  145. .itemBg {
  146. margin: 20rpx 24rpx;
  147. background-color: #FFFFFF;
  148. border-radius: 10rpx;
  149. padding: 20rpx;
  150. }
  151. .itemTop {
  152. display: flex;
  153. justify-content: space-between;
  154. }
  155. .itemType {
  156. color: #999999;
  157. font-size: 24rpx;
  158. }
  159. .itemSheetState {
  160. font-size: 24rpx;
  161. color: #999999
  162. }
  163. .redColor {
  164. color: #FF0000;
  165. }
  166. .orangeColor {
  167. color: #F19D01;
  168. }
  169. .greenColor {
  170. color: #00A040;
  171. }
  172. .itemShopBg {
  173. display: flex;
  174. justify-content: space-between;
  175. margin-top: 20rpx;
  176. }
  177. .shopName {
  178. color: #333333;
  179. font-size: 30rpx;
  180. font-weight: bold;
  181. /* 隐藏文字显示 ...不换行 */
  182. overflow: hidden;
  183. text-overflow: ellipsis;
  184. white-space: nowrap;
  185. }
  186. .price {
  187. color: #333333;
  188. font-weight: bold;
  189. font-size: 32rpx;
  190. }
  191. .itemName {
  192. color: #666666;
  193. font-size: 24rpx;
  194. padding: 16rpx 0;
  195. height: 30rpx;
  196. overflow: hidden;
  197. text-overflow: ellipsis;
  198. white-space: nowrap;
  199. }
  200. .plateBg {
  201. display: flex;
  202. justify-content: space-between;
  203. align-items: center;
  204. }
  205. .plateNumber {
  206. color: #666666;
  207. font-size: 24rpx;
  208. margin-bottom: 20rpx;
  209. display: flex;
  210. }
  211. .itemLineBottom {
  212. display: flex;
  213. justify-content: flex-end;
  214. }
  215. .itemBtn1 {
  216. width: 150rpx;
  217. height: 56rpx;
  218. border-radius: 36rpx;
  219. border: 2rpx solid #DDDDDD;
  220. text-align: center;
  221. line-height: 56rpx;
  222. font-size: 28rpx;
  223. color: #3C3C3C;
  224. margin-left: 40rpx;
  225. }
  226. .itemBtn2 {
  227. width: 150rpx;
  228. height: 56rpx;
  229. border-radius: 36rpx;
  230. border: 2rpx solid #FF4F00;
  231. text-align: center;
  232. line-height: 56rpx;
  233. font-size: 28rpx;
  234. color: #FF4F00;
  235. margin-left: 40rpx;
  236. }
  237. .orderState {
  238. color: #F19D01;
  239. font-size: 24rpx;
  240. padding-left: 20rpx;
  241. }
  242. </style>