myOrder.vue 7.5 KB

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