myOrder.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <template>
  2. <view class="box">
  3. <!-- 自定义导航 -->
  4. <view class="zdyNavBox">
  5. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  6. <view class="zdyNav">
  7. <view class="zdyNavLeft">
  8. <image src="../../static/img/nav_icon_back.png" mode="aspectFit" class="backImg" @click="goback">
  9. </image>
  10. </view>
  11. <view class="zdyNavTitle">订单管理</view>
  12. <view style="width: 50px;"></view>
  13. </view>
  14. </view>
  15. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  16. <view style="height: 44px;"></view>
  17. <view class="tab">
  18. <view class="tabLine" :class="{tabActive:tabIndex==0}" @click="tabClick(0)">全部</view>
  19. <view class="tabLine" :class="{tabActive:tabIndex==1}" @click="tabClick(1)">待付款</view>
  20. <view class="tabLine" :class="{tabActive:tabIndex==2}" @click="tabClick(2)">待服务</view>
  21. <view class="tabLine" :class="{tabActive:tabIndex==3}" @click="tabClick(3)">已完成</view>
  22. </view>
  23. <view class="main">
  24. <view class="itemBg" v-for="(item,index) in items" @click="goDetail(item)">
  25. <view class="itemTop">
  26. <view class="itemType" v-if="item.SheetType==1">商城-商品订单</view>
  27. <view class="itemType" v-if="item.SheetType==2">商城-项目订单</view>
  28. <view class="itemType" v-if="item.SheetType==3">商城-套餐订单</view>
  29. <view class="itemType" v-if="item.SheetType==4">救援订单</view>
  30. <view class="itemType" v-if="item.SheetType==5">钣喷订单</view>
  31. <view class="itemType" v-if="item.SheetType==6">集客订单</view>
  32. <view class="itemSheetState redColor" v-if="item.SheetState==1">待付款</view>
  33. <view class="itemSheetState orangeColor" v-if="item.SheetState==2">待服务</view>
  34. <view class="itemSheetState greenColor" v-if="item.SheetState==3">已完成</view>
  35. <view class="itemSheetState" v-if="item.SheetState==4">已取消</view>
  36. </view>
  37. <view class="itemShopBg">
  38. <view class="shopName">{{item.SheetContent}}</view>
  39. <view style="color: #333333;font-size: 22rpx;">¥<span class="price">{{item.RealMoney}}</span></view>
  40. </view>
  41. <view class="itemName">{{item.CreateTime}}</view>
  42. </view>
  43. <nodata v-show="items==''&&isload"></nodata>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import nodata from '@/components/nodata/nodata.vue'
  49. export default {
  50. components: {
  51. nodata
  52. },
  53. data() {
  54. return {
  55. page: 1,
  56. tabIndex: 0,
  57. items: [],
  58. isload: false,
  59. }
  60. },
  61. onLoad(opt) {
  62. this.getData()
  63. },
  64. onShow() {
  65. console.log(this.tabIndex)
  66. this.getData()
  67. },
  68. methods: {
  69. goback(){
  70. //app交互
  71. var standalone = window.navigator.standalone
  72. var userAgent = window.navigator.userAgent.toLowerCase()
  73. var safari = /safari/.test(userAgent)
  74. var ios = /iphone|ipod|ipad|mac/.test(userAgent)
  75. var android = /android/.test(userAgent)
  76. if (ios) {
  77. if ( true) {//!standalone&& !safari
  78. window.webkit.messageHandlers.goMyNav.postMessage(null)
  79. }
  80. } else if (android) {
  81. window.android.postMessage()
  82. }
  83. },
  84. tabClick(num) {
  85. this.tabIndex = num;
  86. this.page = 1;
  87. this.getData()
  88. },
  89. goDetail(item) {
  90. //SheetType 1 商品2项目3套餐4救援5钣喷6集客
  91. if((item.SheetType==1)||(item.SheetType==2)||(item.SheetType==3)){
  92. uni.navigateTo({
  93. url: "mallOrderDetail?id=" + item.ID +"&SheetType=" + item.SheetType
  94. })
  95. }
  96. else if (item.SheetType==5){
  97. uni.navigateTo({
  98. url: "paintOrderDetail?id=" + item.ID
  99. })
  100. }
  101. else if (item.SheetType==6){
  102. uni.navigateTo({
  103. url: "activityOrderDetail?id=" + item.ID
  104. })
  105. }
  106. },
  107. getData() {
  108. uni.showLoading({
  109. title: '加载中'
  110. });
  111. this.isload = false;
  112. var padata = {
  113. page: this.page,
  114. limit: 10,
  115. sheetState: this.tabIndex > 0 ? this.tabIndex : ''
  116. }
  117. this.$http('openH5Indent/getOpenSheetList', padata, 'GET').then(res => {
  118. uni.hideLoading();
  119. this.isload = true;
  120. var list = res.data.Items;
  121. if (this.page == 1) {
  122. this.items = list
  123. } else {
  124. this.items = this.items.concat(list)
  125. }
  126. })
  127. },
  128. },
  129. onReachBottom() {
  130. this.page++;
  131. this.getData()
  132. },
  133. onPullDownRefresh() {
  134. this.page = 1;
  135. this.getData()
  136. setTimeout(function() {
  137. uni.stopPullDownRefresh();
  138. }, 1000);
  139. }
  140. }
  141. </script>
  142. <style scoped>
  143. .box {
  144. min-height: 100vh;
  145. background: #F4F5F7;
  146. }
  147. .zdyNavBox {
  148. width: 100vw;
  149. background: #FFFFFF;
  150. position: fixed;
  151. top: 0;
  152. left: 0;
  153. z-index: 9999999;
  154. }
  155. .zdyNav {
  156. height: 44px;
  157. display: flex;
  158. justify-content: space-between;
  159. align-items: center;
  160. }
  161. .backImg {
  162. width: 44rpx;
  163. height: 44rpx;
  164. margin-left: 10rpx;
  165. margin-right: 20rpx;
  166. }
  167. .homeImg {
  168. width: 44rpx;
  169. height: 44rpx;
  170. }
  171. .zdyNavLeft {
  172. display: flex;
  173. align-items: center;
  174. }
  175. .zdyNavTitle {
  176. height: 44px;
  177. background: #FFFFFF;
  178. text-align: center;
  179. font-size: 34rpx;
  180. line-height: 44px;
  181. }
  182. .tab {
  183. background: #FFFFFF;
  184. display: flex;
  185. justify-content: space-between;
  186. line-height: 92rpx;
  187. position: fixed;
  188. width: calc(100vw - 100rpx);
  189. padding-left: 50rpx;
  190. padding-right: 50rpx;
  191. height: 92rpx;
  192. z-index: 11;
  193. }
  194. .tabLine {
  195. font-size: 28rpx;
  196. color: #333333;
  197. text-align: center;
  198. }
  199. .tabActive {
  200. color: #FF0000;
  201. font-weight: bold;
  202. border-bottom: 4rpx solid #FF0000;
  203. }
  204. .main {
  205. padding-top: 92rpx;
  206. padding-bottom: 20rpx;
  207. background-color: #F4F5F7;
  208. }
  209. .itemBg {
  210. margin: 20rpx 24rpx;
  211. background-color: #FFFFFF;
  212. border-radius: 10rpx;
  213. padding: 20rpx;
  214. }
  215. .itemTop {
  216. display: flex;
  217. justify-content: space-between;
  218. }
  219. .itemType {
  220. color: #999999;
  221. font-size: 24rpx;
  222. }
  223. .itemSheetState {
  224. font-size: 24rpx;
  225. color: #999999
  226. }
  227. .redColor {
  228. color: #FF0000;
  229. }
  230. .orangeColor {
  231. color: #F19D01;
  232. }
  233. .greenColor {
  234. color: #00A040;
  235. }
  236. .itemShopBg {
  237. display: flex;
  238. justify-content: space-between;
  239. margin-top: 20rpx;
  240. }
  241. .shopName {
  242. color: #333333;
  243. font-size: 30rpx;
  244. font-weight: bold;
  245. /* 隐藏文字显示 ...不换行 */
  246. overflow: hidden;
  247. text-overflow: ellipsis;
  248. white-space: nowrap;
  249. }
  250. .price {
  251. color: #333333;
  252. font-weight: bold;
  253. font-size: 32rpx;
  254. }
  255. .itemName {
  256. color: #666666;
  257. font-size: 24rpx;
  258. padding: 16rpx 0;
  259. height: 30rpx;
  260. overflow: hidden;
  261. text-overflow: ellipsis;
  262. white-space: nowrap;
  263. }
  264. .plateBg {
  265. display: flex;
  266. justify-content: space-between;
  267. align-items: center;
  268. }
  269. .plateNumber {
  270. color: #666666;
  271. font-size: 24rpx;
  272. margin-bottom: 20rpx;
  273. display: flex;
  274. }
  275. .itemLineBottom {
  276. display: flex;
  277. justify-content: flex-end;
  278. }
  279. .itemBtn1 {
  280. width: 150rpx;
  281. height: 56rpx;
  282. border-radius: 36rpx;
  283. border: 2rpx solid #DDDDDD;
  284. text-align: center;
  285. line-height: 56rpx;
  286. font-size: 28rpx;
  287. color: #3C3C3C;
  288. margin-left: 40rpx;
  289. }
  290. .itemBtn2 {
  291. width: 150rpx;
  292. height: 56rpx;
  293. border-radius: 36rpx;
  294. border: 2rpx solid #FF4F00;
  295. text-align: center;
  296. line-height: 56rpx;
  297. font-size: 28rpx;
  298. color: #FF4F00;
  299. margin-left: 40rpx;
  300. }
  301. .orderState {
  302. color: #F19D01;
  303. font-size: 24rpx;
  304. padding-left: 20rpx;
  305. }
  306. </style>