myorder.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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. var that=this;
  135. this.$http('worldKeepCar/maintainOrder/orderPay', {
  136. sheetID: item.ID
  137. }, 'POST').then(res => {
  138. uni.hideLoading();
  139. if(res.isPay==0){
  140. uni.showToast({
  141. title: '支付成功',
  142. icon: 'none',
  143. duration: 2000
  144. });
  145. that.getData()
  146. }else{
  147. var payInfo = JSON.parse(res.data.payInfo)
  148. uni.requestPayment({
  149. provider: 'wxpay',
  150. // timeStamp: String(Date.now()),
  151. timeStamp: payInfo.timeStamp,
  152. nonceStr: payInfo.nonceStr,
  153. package: payInfo.package,
  154. signType: payInfo.signType,
  155. paySign: payInfo.paySign,
  156. success: function(res) {
  157. console.log('success:' + JSON.stringify(res));
  158. uni.showToast({
  159. title: '支付成功',
  160. icon: 'none',
  161. duration: 2000
  162. });
  163. that.getData()
  164. },
  165. fail: function(err) {
  166. console.log('fail:' + JSON.stringify(err));
  167. }
  168. });
  169. }
  170. })
  171. },
  172. },
  173. onReachBottom() {
  174. this.page++;
  175. this.getData()
  176. },
  177. onPullDownRefresh() {
  178. this.page = 1;
  179. this.getData()
  180. setTimeout(function() {
  181. uni.stopPullDownRefresh();
  182. }, 1000);
  183. }
  184. }
  185. </script>
  186. <style scoped>
  187. .box {
  188. min-height: 100vh;
  189. background: #F4F5F7;
  190. }
  191. .tab {
  192. background: #FFFFFF;
  193. display: flex;
  194. justify-content: space-between;
  195. line-height: 92rpx;
  196. position: fixed;
  197. width: 100%;
  198. height: 92rpx;
  199. z-index: 11;
  200. }
  201. .tabLine {
  202. width: 180rpx;
  203. text-align: center;
  204. }
  205. .tabActive {
  206. color: #FF4F00;
  207. border-bottom: 4rpx solid #FF4F00;
  208. }
  209. .main {
  210. padding-top: 92rpx;
  211. padding-bottom: 20rpx;
  212. background-color: #F4F5F7;
  213. }
  214. .itemBg {
  215. margin: 20rpx 24rpx;
  216. background-color: #FFFFFF;
  217. border-radius: 10rpx;
  218. padding: 20rpx;
  219. }
  220. .itemTop {
  221. display: flex;
  222. justify-content: space-between;
  223. }
  224. .itemSheetState {
  225. font-size: 24rpx;
  226. color: #FF2400
  227. }
  228. .itemShopBg {
  229. display: flex;
  230. justify-content: space-between;
  231. margin-top: 20rpx;
  232. }
  233. .shopName {
  234. color: #333333;
  235. font-size: 30rpx;
  236. }
  237. .price {
  238. color: #333333;
  239. font-size: 32rpx;
  240. }
  241. .itemName {
  242. color: #666666;
  243. font-size: 24rpx;
  244. padding: 16rpx 0;
  245. height: 30rpx;
  246. overflow: hidden;
  247. text-overflow: ellipsis;
  248. white-space: nowrap;
  249. }
  250. .plateBg{
  251. display: flex;
  252. justify-content: space-between;
  253. align-items: center;
  254. }
  255. .plateNumber {
  256. color: #666666;
  257. font-size: 24rpx;
  258. margin-bottom: 20rpx;
  259. display: flex;
  260. }
  261. .itemLineBottom {
  262. display: flex;
  263. justify-content: flex-end;
  264. }
  265. .itemBtn1 {
  266. width: 150rpx;
  267. height: 56rpx;
  268. border-radius: 36rpx;
  269. border: 2rpx solid #DDDDDD;
  270. text-align: center;
  271. line-height: 56rpx;
  272. font-size: 28rpx;
  273. color: #3C3C3C;
  274. margin-left: 40rpx;
  275. }
  276. .itemBtn2 {
  277. width: 150rpx;
  278. height: 56rpx;
  279. border-radius: 36rpx;
  280. border: 2rpx solid #FF4F00;
  281. text-align: center;
  282. line-height: 56rpx;
  283. font-size: 28rpx;
  284. color: #FF4F00;
  285. margin-left: 40rpx;
  286. }
  287. .orderState{
  288. color: #F19D01;
  289. font-size: 24rpx;
  290. padding-left: 20rpx;
  291. }
  292. </style>