myorder.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. <template>
  2. <view class="box">
  3. <view class="tab">
  4. <view class="tabLine" :class="{tabActive:tabIndex==6}" @click="tabClick(6)">全部</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 class="tabLine" :class="{tabActive:tabIndex==4}" @click="tabClick(4)">待服务</view>
  9. <view class="tabLine" :class="{tabActive:tabIndex==5}" @click="tabClick(5)">待评价</view>
  10. </view>
  11. <view class="main">
  12. <view class="itemBg" v-for="(item,index) in items" @click="goDetail(item.ID)">
  13. <view class="itemTop">
  14. <view style="color: #999999; font-size: 24rpx;">保养订单</view>
  15. <view class="itemSheetState" v-if="item.SheetState==1">待付款</view>
  16. <view class="itemSheetState" v-if="item.SheetState==2">待确认</view>
  17. <view class="itemSheetState" v-if="item.SheetState==3">待收货</view>
  18. <view class="itemSheetState" v-if="item.SheetState==4">待服务</view>
  19. <view class="itemSheetState" v-if="item.SheetState==5">已完成</view>
  20. <view class="itemSheetState" v-if="item.SheetState==0">已取消</view>
  21. </view>
  22. <view class="itemShopBg">
  23. <view class="shopName">{{item.ShopName}}</view>
  24. <view class="price">¥{{item.raleMoney}}</view>
  25. </view>
  26. <view class="itemName">{{item.itemNameList?item.itemNameList:''}},{{item.goodNameList?item.goodNameList:''}}</view>
  27. <view class="plateBg">
  28. <view class="plateNumber">{{item.PlateNumber}}</view>
  29. <view class="plateNumber">
  30. <!-- ChangeState 更换门店:1待处理2更换成功3更换关闭 3的不展示 -->
  31. <view class="orderState" v-if="item.ChangeState==1">更换门店中</view>
  32. <view class="orderState" v-if="item.ChangeState==2">更换成功</view>
  33. <!-- ServiceState 退款申请:1待处理2退款成功3退款关闭 3的不展示 -->
  34. <view class="orderState" v-if="item.ServiceState==1">退款中</view>
  35. <view class="orderState" v-if="item.ServiceState==2">退款成功</view>
  36. </view>
  37. </view>
  38. <view class="itemLineBottom">
  39. <view class="itemBtn2" v-if="item.SheetState==1" @click.stop="orderPay(item)">立即支付</view>
  40. <view class="itemBtn2" v-if="item.SheetState==5&&item.EvaluateState==0&&item.EState==1"
  41. @click.stop="goEvaluate(item)">
  42. 立即评价</view>
  43. <view class="itemBtn1" v-if="item.SheetState==5&&item.EvaluateState==1"
  44. @click.stop="gopingjia(item)">
  45. 查看评价</view>
  46. </view>
  47. </view>
  48. <nodata v-show="items==''&&isload"></nodata>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import nodata from '@/components/nodata/nodata.vue'
  54. export default {
  55. components: {
  56. nodata
  57. },
  58. data() {
  59. return {
  60. page: 1,
  61. tabIndex: '',
  62. items: [],
  63. isload: false,
  64. }
  65. },
  66. onLoad(opt) {
  67. this.tabIndex = opt.num;
  68. this.getData()
  69. },
  70. onShow() {
  71. console.log(this.tabIndex)
  72. this.getData()
  73. },
  74. methods: {
  75. goEvaluate(item) {
  76. uni.navigateTo({
  77. url: 'evaluate?shopID=' + item.ShopID + '&sheetID=' + item.ID
  78. })
  79. },
  80. gopingjia(item) {
  81. uni.navigateTo({
  82. url: '../me/myAppraiseDetail?id=' + item.ID
  83. })
  84. },
  85. tabClick(num) {
  86. this.tabIndex = num;
  87. this.page = 1;
  88. this.getData()
  89. },
  90. goDetail(id) {
  91. uni.navigateTo({
  92. url: 'orderDetail?id=' + id
  93. })
  94. },
  95. getData() {
  96. uni.showLoading({
  97. title: '加载中'
  98. });
  99. this.isload = false;
  100. if (this.tabIndex == 6) {
  101. var padata = {
  102. page: this.page,
  103. limit: 10,
  104. }
  105. } else {
  106. if (this.tabIndex == 5) {
  107. var padata = {
  108. page: this.page,
  109. limit: 10,
  110. evaluateState: '待评价'
  111. }
  112. } else {
  113. var padata = {
  114. page: this.page,
  115. limit: 10,
  116. state: this.tabIndex
  117. }
  118. }
  119. }
  120. this.$http('worldKeepCar/keepCarMy/listMiNiTMSheetPage', padata, 'GET').then(res => {
  121. uni.hideLoading();
  122. this.isload = true;
  123. var list = res.data.Items;
  124. if (this.page == 1) {
  125. this.items = list
  126. } else {
  127. this.items = this.items.concat(list)
  128. }
  129. })
  130. },
  131. orderPay(item) {
  132. uni.showLoading({});
  133. var that=this;
  134. this.$http('worldKeepCar/maintainOrder/orderPay', {
  135. sheetID: item.ID
  136. }, 'POST').then(res => {
  137. uni.hideLoading();
  138. if(res.isPay==0){
  139. uni.showToast({
  140. title: '支付成功',
  141. icon: 'none',
  142. duration: 2000
  143. });
  144. that.getData()
  145. }else{
  146. var payInfo = JSON.parse(res.data.payInfo)
  147. uni.requestPayment({
  148. provider: 'wxpay',
  149. // timeStamp: String(Date.now()),
  150. timeStamp: payInfo.timeStamp,
  151. nonceStr: payInfo.nonceStr,
  152. package: payInfo.package,
  153. signType: payInfo.signType,
  154. paySign: payInfo.paySign,
  155. success: function(res) {
  156. console.log('success:' + JSON.stringify(res));
  157. uni.showToast({
  158. title: '支付成功',
  159. icon: 'none',
  160. duration: 2000
  161. });
  162. that.getData()
  163. },
  164. fail: function(err) {
  165. console.log('fail:' + JSON.stringify(err));
  166. }
  167. });
  168. }
  169. })
  170. },
  171. },
  172. onReachBottom() {
  173. this.page++;
  174. this.getData()
  175. },
  176. onPullDownRefresh() {
  177. this.page = 1;
  178. this.getData()
  179. setTimeout(function() {
  180. uni.stopPullDownRefresh();
  181. }, 1000);
  182. }
  183. }
  184. </script>
  185. <style scoped>
  186. .box {
  187. min-height: 100vh;
  188. background: #F4F5F7;
  189. }
  190. .tab {
  191. background: #FFFFFF;
  192. display: flex;
  193. justify-content: space-between;
  194. line-height: 92rpx;
  195. position: fixed;
  196. width: 100%;
  197. height: 92rpx;
  198. z-index: 11;
  199. }
  200. .tabLine {
  201. width: 180rpx;
  202. text-align: center;
  203. }
  204. .tabActive {
  205. color: #FF4F00;
  206. border-bottom: 4rpx solid #FF4F00;
  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. .itemSheetState {
  224. font-size: 24rpx;
  225. color: #FF2400
  226. }
  227. .itemShopBg {
  228. display: flex;
  229. justify-content: space-between;
  230. margin-top: 20rpx;
  231. }
  232. .shopName {
  233. color: #333333;
  234. font-size: 30rpx;
  235. }
  236. .price {
  237. color: #333333;
  238. font-size: 32rpx;
  239. }
  240. .itemName {
  241. color: #666666;
  242. font-size: 24rpx;
  243. padding: 16rpx 0;
  244. height: 30rpx;
  245. overflow: hidden;
  246. text-overflow: ellipsis;
  247. white-space: nowrap;
  248. }
  249. .plateBg{
  250. display: flex;
  251. justify-content: space-between;
  252. align-items: center;
  253. }
  254. .plateNumber {
  255. color: #666666;
  256. font-size: 24rpx;
  257. margin-bottom: 20rpx;
  258. display: flex;
  259. }
  260. .itemLineBottom {
  261. display: flex;
  262. justify-content: flex-end;
  263. }
  264. .itemBtn1 {
  265. width: 150rpx;
  266. height: 56rpx;
  267. border-radius: 36rpx;
  268. border: 2rpx solid #DDDDDD;
  269. text-align: center;
  270. line-height: 56rpx;
  271. font-size: 28rpx;
  272. color: #3C3C3C;
  273. margin-left: 40rpx;
  274. }
  275. .itemBtn2 {
  276. width: 150rpx;
  277. height: 56rpx;
  278. border-radius: 36rpx;
  279. border: 2rpx solid #FF4F00;
  280. text-align: center;
  281. line-height: 56rpx;
  282. font-size: 28rpx;
  283. color: #FF4F00;
  284. margin-left: 40rpx;
  285. }
  286. .orderState{
  287. color: #F19D01;
  288. font-size: 24rpx;
  289. padding-left: 20rpx;
  290. }
  291. </style>