myOrder.vue 6.0 KB

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