myorder.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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="$noMultipleClicks(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. noClick:true,
  65. }
  66. },
  67. onLoad(opt) {
  68. this.tabIndex = opt.num;
  69. this.getData()
  70. },
  71. onShow() {
  72. console.log(this.tabIndex)
  73. this.getData()
  74. },
  75. methods: {
  76. goEvaluate(item) {
  77. uni.navigateTo({
  78. url: 'evaluate?shopID=' + item.ShopID + '&sheetID=' + item.ID
  79. })
  80. },
  81. gopingjia(item) {
  82. uni.navigateTo({
  83. url: '../me/myAppraiseDetail?id=' + item.ID
  84. })
  85. },
  86. tabClick(num) {
  87. this.tabIndex = num;
  88. this.page = 1;
  89. this.getData()
  90. },
  91. goDetail(id) {
  92. uni.navigateTo({
  93. url: 'orderDetail?id=' + id
  94. })
  95. },
  96. getData() {
  97. uni.showLoading({
  98. title: '加载中'
  99. });
  100. this.isload = false;
  101. if (this.tabIndex == 6) {
  102. var padata = {
  103. page: this.page,
  104. limit: 10,
  105. }
  106. } else {
  107. if (this.tabIndex == 5) {
  108. var padata = {
  109. page: this.page,
  110. limit: 10,
  111. evaluateState: '待评价'
  112. }
  113. } else {
  114. var padata = {
  115. page: this.page,
  116. limit: 10,
  117. state: this.tabIndex
  118. }
  119. }
  120. }
  121. this.$http('worldKeepCar/keepCarMy/listMiNiTMSheetPage', 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. orderPay(item) {
  133. uni.showLoading({
  134. title: '支付中'
  135. })
  136. var that=this;
  137. this.$http('worldKeepCar/maintainOrder/orderPay', {
  138. sheetID: item.ID
  139. }, 'POST').then(res => {
  140. uni.hideLoading();
  141. if(res.isPay==0){
  142. uni.showToast({
  143. title: '支付成功',
  144. icon: 'none',
  145. duration: 2000
  146. });
  147. that.getData()
  148. }else{
  149. var payInfo = JSON.parse(res.data.payInfo)
  150. uni.requestPayment({
  151. provider: 'wxpay',
  152. // timeStamp: String(Date.now()),
  153. timeStamp: payInfo.timeStamp,
  154. nonceStr: payInfo.nonceStr,
  155. package: payInfo.package,
  156. signType: payInfo.signType,
  157. paySign: payInfo.paySign,
  158. success: function(res) {
  159. console.log('success:' + JSON.stringify(res));
  160. uni.showToast({
  161. title: '支付成功',
  162. icon: 'none',
  163. duration: 2000
  164. });
  165. that.getData()
  166. },
  167. fail: function(err) {
  168. console.log('fail:' + JSON.stringify(err));
  169. }
  170. });
  171. }
  172. })
  173. },
  174. },
  175. onReachBottom() {
  176. this.page++;
  177. this.getData()
  178. },
  179. onPullDownRefresh() {
  180. this.page = 1;
  181. this.getData()
  182. setTimeout(function() {
  183. uni.stopPullDownRefresh();
  184. }, 1000);
  185. }
  186. }
  187. </script>
  188. <style scoped>
  189. .box {
  190. min-height: 100vh;
  191. background: #F4F5F7;
  192. }
  193. .tab {
  194. background: #FFFFFF;
  195. display: flex;
  196. justify-content: space-between;
  197. line-height: 92rpx;
  198. position: fixed;
  199. width: calc(100vw - 48rpx);
  200. padding-left: 24rpx;
  201. padding-right: 24rpx;
  202. height: 92rpx;
  203. z-index: 11;
  204. }
  205. .tabLine {
  206. font-size: 30rpx;
  207. text-align: center;
  208. }
  209. .tabActive {
  210. color: #FF4F00;
  211. border-bottom: 4rpx solid #FF4F00;
  212. }
  213. .main {
  214. padding-top: 92rpx;
  215. padding-bottom: 20rpx;
  216. background-color: #F4F5F7;
  217. }
  218. .itemBg {
  219. margin: 20rpx 24rpx;
  220. background-color: #FFFFFF;
  221. border-radius: 10rpx;
  222. padding: 20rpx;
  223. }
  224. .itemTop {
  225. display: flex;
  226. justify-content: space-between;
  227. }
  228. .itemSheetState {
  229. font-size: 24rpx;
  230. color: #FF2400
  231. }
  232. .itemShopBg {
  233. display: flex;
  234. justify-content: space-between;
  235. margin-top: 20rpx;
  236. }
  237. .shopName {
  238. color: #333333;
  239. font-size: 30rpx;
  240. }
  241. .price {
  242. color: #333333;
  243. font-size: 32rpx;
  244. }
  245. .itemName {
  246. color: #666666;
  247. font-size: 24rpx;
  248. padding: 16rpx 0;
  249. height: 30rpx;
  250. overflow: hidden;
  251. text-overflow: ellipsis;
  252. white-space: nowrap;
  253. }
  254. .plateBg{
  255. display: flex;
  256. justify-content: space-between;
  257. align-items: center;
  258. }
  259. .plateNumber {
  260. color: #666666;
  261. font-size: 24rpx;
  262. margin-bottom: 20rpx;
  263. display: flex;
  264. }
  265. .itemLineBottom {
  266. display: flex;
  267. justify-content: flex-end;
  268. }
  269. .itemBtn1 {
  270. width: 150rpx;
  271. height: 56rpx;
  272. border-radius: 36rpx;
  273. border: 2rpx solid #DDDDDD;
  274. text-align: center;
  275. line-height: 56rpx;
  276. font-size: 28rpx;
  277. color: #3C3C3C;
  278. margin-left: 40rpx;
  279. }
  280. .itemBtn2 {
  281. width: 150rpx;
  282. height: 56rpx;
  283. border-radius: 36rpx;
  284. border: 2rpx solid #FF4F00;
  285. text-align: center;
  286. line-height: 56rpx;
  287. font-size: 28rpx;
  288. color: #FF4F00;
  289. margin-left: 40rpx;
  290. }
  291. .orderState{
  292. color: #F19D01;
  293. font-size: 24rpx;
  294. padding-left: 20rpx;
  295. }
  296. </style>