myorder.vue 6.9 KB

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