|
@@ -175,7 +175,7 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(option){//商品数据
|
|
onLoad(option){//商品数据
|
|
- let data = JSON.parse(option.data);
|
|
|
|
|
|
+ let data = JSON.parse(option.data)
|
|
if(option.type =='prodcut'){
|
|
if(option.type =='prodcut'){
|
|
this.cartType = 2
|
|
this.cartType = 2
|
|
this.productCount = data.data.productCount
|
|
this.productCount = data.data.productCount
|
|
@@ -187,12 +187,12 @@
|
|
}
|
|
}
|
|
this.$api.getStorage().then((resolve) =>{
|
|
this.$api.getStorage().then((resolve) =>{
|
|
this.userID = resolve.userId ? resolve.userId : 0
|
|
this.userID = resolve.userId ? resolve.userId : 0
|
|
- this.getInitCrearOrder();
|
|
|
|
|
|
+ this.getInitCrearOrder()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
filters:{
|
|
filters:{
|
|
NumFormat(value) {//处理金额
|
|
NumFormat(value) {//处理金额
|
|
- return Number(value).toFixed(2);
|
|
|
|
|
|
+ return Number(value).toFixed(2)
|
|
},
|
|
},
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -216,8 +216,8 @@
|
|
this.isCouponShow = true
|
|
this.isCouponShow = true
|
|
this.couponAmount = data.couponList[0].couponAmount
|
|
this.couponAmount = data.couponList[0].couponAmount
|
|
this.clubCouponId = data.couponList[0].clubCouponId
|
|
this.clubCouponId = data.couponList[0].clubCouponId
|
|
- this.payAllPrice = this.allPrice - this.couponAmount
|
|
|
|
}
|
|
}
|
|
|
|
+ this.payAllPrice = this.allPrice - this.couponAmount
|
|
this.totalDiscountAmount = this.reducedPrice + this.couponAmount
|
|
this.totalDiscountAmount = this.reducedPrice + this.couponAmount
|
|
})
|
|
})
|
|
.catch(error =>{
|
|
.catch(error =>{
|
|
@@ -265,18 +265,18 @@
|
|
this.isAddress = true
|
|
this.isAddress = true
|
|
this.addressData = {}
|
|
this.addressData = {}
|
|
if(response.data.results != ''){
|
|
if(response.data.results != ''){
|
|
- this.addressID = response.data.results[0].addressID;
|
|
|
|
- this.townID = response.data.results[0].townID;
|
|
|
|
- this.addressData = response.data.results[0];
|
|
|
|
|
|
+ this.addressID = response.data.results[0].addressID
|
|
|
|
+ this.townID = response.data.results[0].townID
|
|
|
|
+ this.addressData = response.data.results[0]
|
|
this.getFreightData()
|
|
this.getFreightData()
|
|
}else{
|
|
}else{
|
|
- this.addressData = this.addressData;
|
|
|
|
|
|
+ this.addressData = this.addressData
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
handChangeInputGoodsList(data){//对应供应商的留言信息
|
|
handChangeInputGoodsList(data){//对应供应商的留言信息
|
|
- this.goodsData = data;
|
|
|
|
|
|
+ this.goodsData = data
|
|
},
|
|
},
|
|
handleChoiceaInvoiceData(data){//获取发票信息
|
|
handleChoiceaInvoiceData(data){//获取发票信息
|
|
this.invoiceData = data
|
|
this.invoiceData = data
|
|
@@ -303,7 +303,7 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
hanldFreightBeans(data){//是否勾选采美豆抵扣
|
|
hanldFreightBeans(data){//是否勾选采美豆抵扣
|
|
- this.isCheckedBeans = data;
|
|
|
|
|
|
+ this.isCheckedBeans = data
|
|
if(this.isCheckedBeans){
|
|
if(this.isCheckedBeans){
|
|
// 判断如果采美豆大于等于运费*100
|
|
// 判断如果采美豆大于等于运费*100
|
|
if( this.freightData.userBeans > 0 ){
|
|
if( this.freightData.userBeans > 0 ){
|
|
@@ -341,7 +341,7 @@
|
|
handleChoiceaCouponData(data){// 勾选使用优惠券
|
|
handleChoiceaCouponData(data){// 勾选使用优惠券
|
|
console.log('优惠券信息',data)
|
|
console.log('优惠券信息',data)
|
|
this.couponAmount = data.couponAmount
|
|
this.couponAmount = data.couponAmount
|
|
- this.totalDiscountAmount = this.reducedPrice + this.couponAmount;
|
|
|
|
|
|
+ this.totalDiscountAmount = this.reducedPrice + this.couponAmount
|
|
this.clubCouponId = data.clubCouponId
|
|
this.clubCouponId = data.clubCouponId
|
|
this.attributePallPrice()
|
|
this.attributePallPrice()
|
|
this.hanldFreightBeans(this.isCheckedBeans)
|
|
this.hanldFreightBeans(this.isCheckedBeans)
|
|
@@ -390,9 +390,9 @@
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于总余额-当前使用金额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于总余额-当前使用金额
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- this.payAllPrice = this.allPrice - this.couponAmount;
|
|
|
|
- this.deductMoney = 0.00; // 当前使用
|
|
|
|
- this.surplusMoney = this.userMoney; // 剩余余额
|
|
|
|
|
|
+ this.payAllPrice = this.allPrice - this.couponAmount
|
|
|
|
+ this.deductMoney = 0.00 // 当前使用
|
|
|
|
+ this.surplusMoney = this.userMoney // 剩余余额
|
|
}
|
|
}
|
|
console.log('最终订单支付金额',this.payAllPrice)
|
|
console.log('最终订单支付金额',this.payAllPrice)
|
|
console.log('优惠券金额',this.couponAmount)
|
|
console.log('优惠券金额',this.couponAmount)
|
|
@@ -429,13 +429,13 @@
|
|
console.log('优惠券金额',this.couponAmount)
|
|
console.log('优惠券金额',this.couponAmount)
|
|
},
|
|
},
|
|
orderSubmitMit(){// 提交订单
|
|
orderSubmitMit(){// 提交订单
|
|
- if(this.isSubLoading){ return; }
|
|
|
|
|
|
+ if(this.isSubLoading){ return }
|
|
if(this.addressID == ''){
|
|
if(this.addressID == ''){
|
|
this.$util.msg('请先添加收货地址~',2000)
|
|
this.$util.msg('请先添加收货地址~',2000)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.orderInfo = this.goodsData.map(el => {
|
|
this.orderInfo = this.goodsData.map(el => {
|
|
- let productInfo = [];
|
|
|
|
|
|
+ let productInfo = []
|
|
el.cartList.forEach(item => {
|
|
el.cartList.forEach(item => {
|
|
productInfo.push({
|
|
productInfo.push({
|
|
productId:item.productId,
|
|
productId:item.productId,
|
|
@@ -466,9 +466,9 @@
|
|
orderInvoice:this.invoiceData
|
|
orderInvoice:this.invoiceData
|
|
}
|
|
}
|
|
console.log(param)
|
|
console.log(param)
|
|
- this.isSubLoading = true;
|
|
|
|
|
|
+ this.isSubLoading = true
|
|
this.OrderService.CreatedOrderSubmit({'params':JSON.stringify(param)}).then(response =>{
|
|
this.OrderService.CreatedOrderSubmit({'params':JSON.stringify(param)}).then(response =>{
|
|
- const data = response.data;
|
|
|
|
|
|
+ const data = response.data
|
|
// 友盟埋点收集机构自主提交订单
|
|
// 友盟埋点收集机构自主提交订单
|
|
if(process.env.NODE_ENV != 'development'){
|
|
if(process.env.NODE_ENV != 'development'){
|
|
this.$uma.trackEvent('Um_Event_ConfirmOrder', {
|
|
this.$uma.trackEvent('Um_Event_ConfirmOrder', {
|
|
@@ -480,7 +480,7 @@
|
|
if(data.code === '1'){
|
|
if(data.code === '1'){
|
|
this.submitState ='success'
|
|
this.submitState ='success'
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
- this.isSubLoading = false;
|
|
|
|
|
|
+ this.isSubLoading = false
|
|
},2000)
|
|
},2000)
|
|
let data = {orderID:response.data.orderID}
|
|
let data = {orderID:response.data.orderID}
|
|
this.$api.navigateTo(`/pages/user/order/success?data=${JSON.stringify({data:data})}`)
|
|
this.$api.navigateTo(`/pages/user/order/success?data=${JSON.stringify({data:data})}`)
|
|
@@ -488,35 +488,35 @@
|
|
this.submitState ='confirm'
|
|
this.submitState ='confirm'
|
|
this.$util.msg('订单提交成功',3000,true,'success')
|
|
this.$util.msg('订单提交成功',3000,true,'success')
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
- this.isSubLoading = false;
|
|
|
|
|
|
+ this.isSubLoading = false
|
|
},2000)
|
|
},2000)
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
this.$api.redirectTo(`/pages/user/order/order-payment?type=${this.submitState}&orderID=${response.data.orderID}`)
|
|
this.$api.redirectTo(`/pages/user/order/order-payment?type=${this.submitState}&orderID=${response.data.orderID}`)
|
|
},3000)
|
|
},3000)
|
|
}
|
|
}
|
|
}).catch(error =>{
|
|
}).catch(error =>{
|
|
- this.$util.msg(error.msg,3000);
|
|
|
|
|
|
+ this.$util.msg(error.msg,3000)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
handFreightAlertShow(){//显示邮费弹窗
|
|
handFreightAlertShow(){//显示邮费弹窗
|
|
- this.isfreightTip = true;
|
|
|
|
|
|
+ this.isfreightTip = true
|
|
},
|
|
},
|
|
handleClickCancel(){// 关闭优惠券弹窗
|
|
handleClickCancel(){// 关闭优惠券弹窗
|
|
- this.isCouponModel = false;
|
|
|
|
- this.getInitCrearOrder();
|
|
|
|
|
|
+ this.isCouponModel = false
|
|
|
|
+ this.getInitCrearOrder()
|
|
},
|
|
},
|
|
hideFreight(){//关闭邮费弹窗
|
|
hideFreight(){//关闭邮费弹窗
|
|
- this.isfreightTip = false;
|
|
|
|
|
|
+ this.isfreightTip = false
|
|
},
|
|
},
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
// this.addressID = ''
|
|
// this.addressID = ''
|
|
- let pages = getCurrentPages();
|
|
|
|
- let currPage = pages[pages.length-1];
|
|
|
|
|
|
+ let pages = getCurrentPages()
|
|
|
|
+ let currPage = pages[pages.length-1]
|
|
if(currPage.data.select =='select'){
|
|
if(currPage.data.select =='select'){
|
|
this.isAddress = true
|
|
this.isAddress = true
|
|
- let SelectData = uni.getStorageSync('selectAddress');
|
|
|
|
- this.addressID = SelectData.addressID;
|
|
|
|
|
|
+ let SelectData = uni.getStorageSync('selectAddress')
|
|
|
|
+ this.addressID = SelectData.addressID
|
|
this.addressData = SelectData
|
|
this.addressData = SelectData
|
|
this.getFreightData()
|
|
this.getFreightData()
|
|
}else{
|
|
}else{
|