Commit 1a4cad719648876059924d3cdaff6a25c9efe96f

Authored by BigBoss
1 parent 0df2ead740
Exists in master

修改待付款支付跳转逻辑&新增已完成订单详情

src/pages/cart/cart.vue
... ... @@ -167,8 +167,8 @@ export default {
167 167 item.isChecked = false
168 168 })
169 169 },
170   - onLoad: async function() {
171   - },
  170 + // onLoad: async function() {
  171 + // },
172 172 methods: {
173 173 // 全选按钮
174 174 pClick() {
... ...
src/pages/confirmOrder/confirmOrder.vue
... ... @@ -334,7 +334,7 @@ export default {
334 334 // return this.$store.state.cart.checkedCartLst
335 335 // },
336 336 goodInfo() {
337   - console.log('state', this.$store.state.read.goodInfo)
  337 + // console.log('state', this.$store.state.read.goodInfo)
338 338 return this.$store.state.read.goodInfo
339 339 },
340 340 skuInfo() {
... ...
src/pages/myOrder/components/OrderCard.vue
... ... @@ -52,8 +52,8 @@
52 52 class="btns"
53 53 v-if="status == '0'"
54 54 >
55   - <view class="btn-type1">取消订单</view>
56   - <view class="btn-type2">去支付</view>
  55 + <view class="btn-type1" @click="cancleOrder">取消订单</view>
  56 + <view class="btn-type2" @click="paylog">去支付</view>
57 57 </view>
58 58 <view
59 59 class="btns"
... ... @@ -141,6 +141,28 @@
141 141 };
142 142 },
143 143 methods:{
  144 + cancleOrder() {
  145 + // const openid = uni.getStorageSync('openid')
  146 + // const uid = this.order.uid;
  147 + // const openid = openid;
  148 + // const keyname = this.orderInfo.order_info.keyname
  149 + // // console.log('keyname',this.orderInfo.keyname)
  150 + // uni.showModal({
  151 + // title: "提示",
  152 + // content: "现在取消,订单不可恢复哦,确认取消吗?",
  153 + // success: function(res) {
  154 + // if (res.confirm) {
  155 + // store.dispatch("cancelOrder/cancel", {
  156 + // keyname: keyname,
  157 + // uid: uid,
  158 + // openid: openid
  159 + // });
  160 + // } else if (res.cancel) {
  161 + // console.log("用户点击取消");
  162 + // }
  163 + // }
  164 + // });
  165 + },
144 166 toDetail(pid){
145 167 console.log('pid',pid)
146 168 uni.navigateTo({
... ... @@ -177,7 +199,7 @@
177 199 })
178 200  
179 201 break;
180   - case '2 || 3':
  202 + case '2' || '3':
181 203 uni.navigateTo({
182 204 url:`../myOrderPaying/myOrderPaying?status=`+status+`&payId=`+payId,
183 205 fail(errMsg) {
... ...
src/pages/myOrderPaying/myOrderPaying.vue
1 1 <!-- 订单待付款 待收货 -->
2 2 <template>
3   - <view class="content">
  3 + <view class="content">
  4 + <view
  5 + class="headerBanner"
  6 + v-if="status == '2'||'3'"
  7 + >
  8 + <view class="bannerLeft">
  9 + <view class="T1">订单已完成</view>
  10 + </view>
  11 + <image
  12 + src="../../static/car.png"
  13 + mode="aspectFill"
  14 + ></image>
  15 + </view>
4 16 <!-- 待付款 -->
5   - <view
6   - class="order-time"
7   - v-if="status == '0'"
8   - >
  17 + <view class="order-time" v-if="status == '0'" >
9 18 <text>请在</text>
10 19 <uni-countdown
11 20 color="#EC5D3B"
... ... @@ -13,24 +22,24 @@
13 22 :show-day="false"
14 23 :hour="0"
15 24 :second="getTime"
16   - @timeup=timeup
17   - ></uni-countdown>
  25 + @timeup=timeup >
  26 + </uni-countdown>
  27 +
18 28 <text>内完成付款</text>
19   - </view>
20   - <!-- 待收货 -->
21   - <view
22   - class="headerBanner"
23   - v-if="status == '1'"
24   - >
  29 + </view>
  30 +
  31 + <view class="headerBanner" v-if="status == '1'">
25 32 <view class="bannerLeft">
26 33 <view class="T1">卖家已发货</view>
27   - <view class="T2">还剩 确认收货</view>
  34 + <!-- <view class="T2">还剩 确认收货</view> -->
28 35 </view>
29 36 <image
30 37 src="../../static/car.png"
31 38 mode="aspectFill"
32 39 ></image>
33   - </view>
  40 + </view>
  41 +
  42 +
34 43 <view class="order">
35 44 <view class="order-user">
36 45 <view class="order-user-head">
... ... @@ -120,7 +129,17 @@
120 129 class="b2"
121 130 @click="confirmOrder"
122 131 >确认收货</button>
123   - </view>
  132 + </view>
  133 + <view
  134 + class="order-confim"
  135 + v-if="status == '2'"
  136 + >
  137 + <button
  138 + class="b2"
  139 + @click="toDetail"
  140 + >再次购买</button>
  141 + </view>
  142 +
124 143 </view>
125 144 </template>
126 145  
... ... @@ -146,10 +165,10 @@ export default {
146 165 };
147 166 },
148 167 onLoad:async function ({payId,status,isPay}) {
149   - // console.log('++++++++++++++++++',payId,status,isPay)
150 168 this.payId = payId
151 169 this.status = status
152 170 this.isPay = isPay
  171 + console.log('++++++++++++++++++',this.status)
153 172 const openid = uni.getStorageSync('openid')
154 173 const uid = this.$store.state.user.userInfo.uid
155 174 this.uid = uid
... ... @@ -197,8 +216,17 @@ export default {
197 216 // console.log(totalDiscount)
198 217 return totalDiscount;
199 218 }
200   - },
201   - methods: {
  219 + },
  220 +
  221 + methods: {
  222 + //再次购买 暂时只支持跳转第一个商品
  223 + toDetail(){
  224 + const pid = this.orderInfo.order_info.list[0].pid
  225 + uni.navigateTo({
  226 + url: '../details/details?pid='+pid,
  227 + fail: (res) => {console.log(res)},
  228 + });
  229 + },
202 230 // 取消订单
203 231 timeup() {
204 232 this.cancleOrder();
... ... @@ -272,7 +300,7 @@ export default {
272 300 })
273 301 // 跳转订单详情页->状态 待收货
274 302 uni.reLaunch({
275   - url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=2&isPay=1`,
  303 + url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=1&isPay=1`,
276 304 })
277 305 },
278 306 fail: (res) => {
... ... @@ -282,9 +310,9 @@ export default {
282 310 showCancel: false,
283 311 })
284 312 // 跳转订单详情页->刷新本页面
285   - uni.redirectTo({
286   - url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=1&isPay=1`,
287   - })
  313 + // uni.redirectTo({
  314 + // url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`,
  315 + // })
288 316 },
289 317 complete: () => {
290 318 uni.hideLoading()
... ... @@ -297,9 +325,9 @@ export default {
297 325 })
298 326 console.log('支付失败')
299 327 uni.hideLoading()
300   - uni.redirectTo({
301   - url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=1&isPay=1`,
302   - })
  328 + // uni.redirectTo({
  329 + // url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`,
  330 + // })
303 331 }
304 332 })
305 333  
... ...