Commit 29c972fd52b93bd0973a38ea5592779f2f6cfc56
1 parent
f112b6434a
Exists in
master
再次购买、确认订单修改
Showing
9 changed files
with
97 additions
and
46 deletions
Show diff stats
src/nocart.png
19 KB
src/pages/cart/cart.vue
1 | 1 | <template> |
2 | - <view class="content"> | |
3 | - <block v-if="cartList.length==0"> | |
4 | - <view class="nocard"> | |
5 | - <image src="../../static/nocart.png" class="nocartPic" mode="aspectFill"></image> | |
6 | - <text class="nocartText">购物车竟然是空的</text> | |
7 | - </view> | |
2 | + <view :class="cartList.length === 0 ? 'content no_content' : 'content'"> | |
3 | + <block v-if="cartList.length ===0"> | |
4 | + <view class="nocard"> | |
5 | + <image | |
6 | + src="../../static/nocart.jpeg" | |
7 | + class="nocartPic" | |
8 | + mode="aspectFill" | |
9 | + ></image> | |
10 | + <text class="nocartText">购物车竟然是空的,快去加购吧!</text> | |
11 | + </view> | |
8 | 12 | </block> |
9 | 13 | <block v-else> |
10 | 14 | <view class="card"> |
... | ... | @@ -22,7 +26,7 @@ |
22 | 26 | <text>非常戴镜</text> |
23 | 27 | </view> |
24 | 28 | <view |
25 | - class="cardBody" | |
29 | + class="cardBody" | |
26 | 30 | v-for="(item,index) in cartList" |
27 | 31 | :key="index" |
28 | 32 | @longpress="delCart(item.cart_id,index)" |
... | ... | @@ -93,7 +97,10 @@ |
93 | 97 | </view> |
94 | 98 | </view> |
95 | 99 | </block> |
96 | - <view class="footer"> | |
100 | + <view | |
101 | + v-if="cartList.length !==0 " | |
102 | + class="footer" | |
103 | + > | |
97 | 104 | <view class="footerLeft">实付金额:<text>¥{{totalPrice}}</text></view> |
98 | 105 | <view class="footerRight"> |
99 | 106 | <view |
... | ... | @@ -332,22 +339,22 @@ export default { |
332 | 339 | justify-content: space-between; |
333 | 340 | padding: 20rpx 40rpx; |
334 | 341 | box-sizing: border-box; |
335 | - .nocard{ | |
336 | - width: 100%; | |
337 | - display: flex; | |
338 | - flex-direction: column; | |
339 | - align-items: center; | |
340 | - justify-content: space-between; | |
341 | - .nocartPic{ | |
342 | - height: 400rpx; | |
343 | - border-radius: 200rpx; | |
344 | - margin: 40rpx 0; | |
345 | - } | |
346 | - .nocartText{ | |
347 | - color: #333333; | |
348 | - font-size: 28rpx; | |
349 | - } | |
350 | - } | |
342 | + .nocard { | |
343 | + width: 100%; | |
344 | + display: flex; | |
345 | + flex-direction: column; | |
346 | + align-items: center; | |
347 | + justify-content: space-between; | |
348 | + .nocartPic { | |
349 | + width: 320rpx; | |
350 | + height: 300rpx; | |
351 | + margin: 40rpx 0; | |
352 | + } | |
353 | + .nocartText { | |
354 | + color: #999; | |
355 | + font-size: 28rpx; | |
356 | + } | |
357 | + } | |
351 | 358 | .partentCheck { |
352 | 359 | width: 16px; |
353 | 360 | height: 16px; |
... | ... | @@ -554,6 +561,9 @@ export default { |
554 | 561 | } |
555 | 562 | } |
556 | 563 | } |
564 | +.no_content { | |
565 | + background-color: #fff; | |
566 | +} | |
557 | 567 | /* 隐藏滚动条 */ |
558 | 568 | ::-webkit-scrollbar { |
559 | 569 | width: 0; | ... | ... |
src/pages/confirmOrder/confirmOrder.vue
... | ... | @@ -449,6 +449,8 @@ export default { |
449 | 449 | shopid: 0, |
450 | 450 | payCate: 2020, |
451 | 451 | payMoney: this.totalPrice * 100, |
452 | + // 测试 | |
453 | + // payMoney: 1, | |
452 | 454 | payWoodId: `fcdj-${uid}-${keyName}`, |
453 | 455 | payWoodDesc: '在【非常戴镜】的微信付款凭证', |
454 | 456 | nonceStr, |
... | ... | @@ -475,6 +477,8 @@ export default { |
475 | 477 | timeStamp, |
476 | 478 | nonceStr, |
477 | 479 | total_fee: this.totalPrice, |
480 | + // 测试 | |
481 | + // total_fee: 1, | |
478 | 482 | package: `prepay_id=${data.prepay_id}`, |
479 | 483 | signType: 'MD5', |
480 | 484 | paySign: MD5Util.MD5(stringSignTemp).toUpperCase(), | ... | ... |
src/pages/myOrder/components/OrderCard.vue
... | ... | @@ -65,7 +65,10 @@ |
65 | 65 | class="btns" |
66 | 66 | v-if="status == '1'" |
67 | 67 | > |
68 | - <view class="btn-type2">确认收货</view> | |
68 | + <view | |
69 | + @tap="confirmOrder" | |
70 | + class="btn-type2" | |
71 | + >确认收货</view> | |
69 | 72 | </view> |
70 | 73 | <view |
71 | 74 | class="btns" |
... | ... | @@ -144,7 +147,10 @@ |
144 | 147 | class="btns" |
145 | 148 | v-if="status == '1'" |
146 | 149 | > |
147 | - <view class="btn-type2">确认收货</view> | |
150 | + <view | |
151 | + class="btn-type2" | |
152 | + @tap="confirmOrder" | |
153 | + >确认收货</view> | |
148 | 154 | </view> |
149 | 155 | <view |
150 | 156 | class="btns" |
... | ... | @@ -152,7 +158,7 @@ |
152 | 158 | > |
153 | 159 | <view |
154 | 160 | class="btn-type2" |
155 | - @click="toDetail(order.order_info[0].pid)" | |
161 | + @click="toDetail(order.order_info.list[0].pid)" | |
156 | 162 | >再次购买</view> |
157 | 163 | </view> |
158 | 164 | </view> |
... | ... | @@ -288,7 +294,38 @@ export default { |
288 | 294 | // }) |
289 | 295 | }) |
290 | 296 | }, |
291 | - | |
297 | + confirmOrder() { | |
298 | + // 确认收货 way1 ==>way2 | |
299 | + console.log('this.order.order_info', this.order) | |
300 | + store | |
301 | + .dispatch('statusConfirm/confirm', { | |
302 | + oldway: '1', | |
303 | + way: '2', | |
304 | + pay_id: this.order.pay_id, | |
305 | + judgeContent: '', | |
306 | + orderInfo: JSON.stringify(this.order.order_info), | |
307 | + }) | |
308 | + .then((res) => { | |
309 | + if (res.data.code === 1) { | |
310 | + uni.showToast({ | |
311 | + title: '已确认', | |
312 | + mask: true, | |
313 | + duration: 1500, | |
314 | + icon: 'success', | |
315 | + }) | |
316 | + } else { | |
317 | + uni.showToast({ | |
318 | + title: '服务器错误,确认失败!', | |
319 | + mask: true, | |
320 | + }) | |
321 | + } | |
322 | + setTimeout(() => { | |
323 | + store.dispatch('myOrder/getList', { | |
324 | + way: '', | |
325 | + }) | |
326 | + }, 1500) | |
327 | + }) | |
328 | + }, | |
292 | 329 | async cancleOrder(e) { |
293 | 330 | const { keyname } = this.order.order_info |
294 | 331 | console.log('keyname', keyname) | ... | ... |
src/pages/myOrderPaying/myOrderPaying.vue
... | ... | @@ -386,9 +386,10 @@ export default { |
386 | 386 | way: '2', |
387 | 387 | pay_id: this.payId, |
388 | 388 | judgeContent: '', |
389 | - orderInfo: this.orderInfo.order_info, | |
389 | + orderInfo: JSON.stringify(this.orderInfo.order_info), | |
390 | 390 | }) |
391 | 391 | .then((res) => { |
392 | + console.log('ressssss', res) | |
392 | 393 | if (res.data.code === 1) { |
393 | 394 | uni.showToast({ |
394 | 395 | title: '已确认', | ... | ... |
src/static/nocart.jpeg
5.15 KB
src/static/nocart.png
19 KB
src/store/modules/details.js
... | ... | @@ -104,7 +104,7 @@ const actions = { |
104 | 104 | goodsInfo: { |
105 | 105 | name: data.p_name, |
106 | 106 | price: data.priceArea.Min_Price, |
107 | - discountPrice: data.priceArea.Min_Price - Number(data.priceArea.discount), | |
107 | + discountPrice: parseInt(data.priceArea.Min_Price * (1 + Number(data.priceArea.discount) / 100)), | |
108 | 108 | tradeNumber: data.trade_num, |
109 | 109 | }, |
110 | 110 | tag: data.tag, | ... | ... |
src/store/modules/statusConfirm.js
1 | -import urlAlias from '../url'; | |
2 | -import request from '../request'; | |
1 | +import urlAlias from '../url' | |
2 | +import request from '../request' | |
3 | 3 | |
4 | 4 | const { |
5 | - statusConfirm | |
6 | -} = urlAlias; | |
7 | - | |
8 | -// const openid = uni.getStorageSync('openid'); | |
5 | + statusConfirm, | |
6 | +} = urlAlias | |
7 | + | |
9 | 8 | const actions = { |
10 | 9 | confirm({ commit }, param) { |
11 | - request({ | |
12 | - url: statusConfirm, | |
13 | - data: param|| { }, | |
14 | - success: (res) => { | |
15 | - console.log(res.data); | |
16 | - | |
17 | - }, | |
18 | - }) | |
19 | - } | |
10 | + return new Promise((resolve) => request({ | |
11 | + url: statusConfirm, | |
12 | + data: param || {}, | |
13 | + success: (res) => { | |
14 | + console.log(res.data) | |
15 | + resolve(res) | |
16 | + }, | |
17 | + })) | |
18 | + }, | |
20 | 19 | } |
21 | 20 | |
22 | 21 | export default { |
23 | 22 | namespaced: true, |
24 | 23 | actions, |
25 | -} | |
26 | 24 | \ No newline at end of file |
25 | +} | ... | ... |