Browse Source

修复

master
lincm 4 years ago
parent
commit
6d1f074317
  1. 20
      pages/order/confirmation.vue
  2. 34
      pages/shippingCart/index.vue

20
pages/order/confirmation.vue

@ -37,7 +37,7 @@
<view class="method_item" v-for="(item,index) in shipping_list " :key="index"> <view class="method_item" v-for="(item,index) in shipping_list " :key="index">
<view class="method_item_image" @click="cartselectshipping(item.shipping_id)"> <view class="method_item_image" @click="cartselectshipping(item.shipping_id)">
<image src="../../static/img/select1.png" style="width: 30rpx;height: 30rpx;" v-if="order.shipping_id==item.shipping_id"></image> <image src="../../static/img/select1.png" style="width: 30rpx;height: 30rpx;" v-if="orderId==item.shipping_id"></image>
<image src="../../static/img/select2.png" style="width: 30rpx;height: 30rpx;"v-else ></image> <image src="../../static/img/select2.png" style="width: 30rpx;height: 30rpx;"v-else ></image>
</view> </view>
@ -221,10 +221,13 @@
shipping_list:[], shipping_list:[],
bonus_list:[], bonus_list:[],
total:{}, total:{},
order:{}, order:{
shipping_id:11
},
// : 0 1 2 4 // : 0 1 2 4
pay_index:0, pay_index:0,
tag:0, tag:0,
orderId:0,
} }
}, },
@ -236,7 +239,8 @@
if(res.error==0){ if(res.error==0){
this.total=res.data.total this.total=res.data.total
this.order=res.data.order // this.order=res.data.order
this.orderId=res.data.order.shiping_id
} }
}) })
}, },
@ -340,6 +344,7 @@
postscript:'', postscript:'',
bonus:this.order.bonus, bonus:this.order.bonus,
surplus:this.order.surplus, surplus:this.order.surplus,
// shipping_id:this.orderId,
shipping_id:this.order.shipping_id, shipping_id:this.order.shipping_id,
directshopping:0, directshopping:0,
} }
@ -358,7 +363,8 @@
if(res.error==0){ if(res.error==0){
this.tag = 1 this.tag = 1
this.total=res.data.total this.total=res.data.total
this.order=res.data.order this.order=res.data.order
this.orderId=res.data.order.shipping_id
} }
}) })
}, },
@ -429,10 +435,12 @@
onLoad(e) { onLoad(e) {
this.query=JSON.parse(e.query) this.query=JSON.parse(e.query)
console.log(this.query,'///') this.orderId = e.orderId
console.log(this.orderId,'///')
this.getList() this.getList()
}, },
onShow() { onShow(e) {
this.getList() this.getList()
uni.$once('query' ,(query)=>{ uni.$once('query' ,(query)=>{
console.info(query) console.info(query)

34
pages/shippingCart/index.vue

@ -18,7 +18,7 @@
<template v-else> <template v-else>
<view class="cart_info"> <view class="cart_info">
<image src="/static/img/Shipped.png" mode=""></image> <image src="/static/img/Shipped.png" mode=""></image>
<view class="cart_title_content">Buy US$32.00 more to enjoy FREE STANDARD SHIPPING!</view> <view class="cart_title_content">Buy US$<text v-if="money==0||money>0">{{ money }}</text>more to enjoy FREE STANDARD SHIPPING!</view>
<view class="cart_title_right" @click="gotAdd()">Add</view> <view class="cart_title_right" @click="gotAdd()">Add</view>
</view> </view>
<view class="cart"> <view class="cart">
@ -203,6 +203,7 @@
import { import {
defaultRequest, defaultRequest,
defaultRequest2, defaultRequest2,
defaultRequest3,
defaultRequest4 defaultRequest4
} from '../../api/index.js' } from '../../api/index.js'
export default { export default {
@ -216,6 +217,7 @@
goods_price: 0, goods_price: 0,
goods_count: 0 goods_count: 0
}, },
money:0,
// //
goods_list: [], goods_list: [],
// 1-2-3- // 1-2-3-
@ -257,7 +259,14 @@
Attr_img:'', Attr_img:'',
gotoPay:0, gotoPay:0,
num:1., num:1.,
str_select:[] str_select:[],
query:{
_action:'cartcheckout',
is_new:0,
direct_shopping:0,
consignee:''
},
orderId:0,
} }
}, },
onBackPress(options) { onBackPress(options) {
@ -347,7 +356,7 @@
consignee:'' consignee:''
} }
uni.navigateTo({ uni.navigateTo({
url: '../order/confirmation?query=' + JSON.stringify(data) url: '../order/confirmation?query=' + JSON.stringify(data) + '&orderId='+this.orderId
}) })
}, },
@ -446,6 +455,7 @@
defaultRequest4(data).then(res => { defaultRequest4(data).then(res => {
if (res.error == 0) { if (res.error == 0) {
this.getList() this.getList()
this.getorder()
} }
}) })
}, },
@ -607,6 +617,21 @@
}, },
getorder(){
defaultRequest3(this.query,'consignee').then(res =>{
console.log(res)
if(res.error ==0){
console.log(res.data.shipping_list[0].free_money)
this.orderId = res.data.shipping_list[0].shipping_id
if(res.data.shipping_list[0].free_money >this.total.goods_price){
this.money = parseInt(res.data.shipping_list[0].free_money) - parseInt(this.total.goods_price)
console.log(this.money)
}else{
this.money = 0
}
}
})
},
// //
ChangeAttr(item) { ChangeAttr(item) {
console.log(item) console.log(item)
@ -735,11 +760,12 @@
this.getList() this.getList()
this.getCatList(0) this.getCatList(0)
this.getAddress() this.getAddress()
this.getorder()
}, },
onShow() { onShow() {
this.getList() this.getList()
this.getorder()
}, },
onPullDownRefresh() { onPullDownRefresh() {

Loading…
Cancel
Save