|
@@ -57,11 +57,11 @@
|
|
<view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
|
|
<view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
|
|
<view class="footer-le">
|
|
<view class="footer-le">
|
|
<view class="footer-count">
|
|
<view class="footer-count">
|
|
- <text>共{{allCount}}件商品</text>
|
|
|
|
|
|
+ <text>共{{ totalCount }}件商品</text>
|
|
</view>
|
|
</view>
|
|
<view class="footer-price">
|
|
<view class="footer-price">
|
|
<view class="sum" :class="totalDiscountAmount == 0 ? 'none' : ''">
|
|
<view class="sum" :class="totalDiscountAmount == 0 ? 'none' : ''">
|
|
- 总价:<text class="price">¥{{payAllPrice | NumFormat}}</text>
|
|
|
|
|
|
+ 总价:<text class="price">¥{{ orderShouldPayFee | NumFormat }}</text>
|
|
</view>
|
|
</view>
|
|
<view class="sum-none" v-if="totalDiscountAmount > 0">
|
|
<view class="sum-none" v-if="totalDiscountAmount > 0">
|
|
<text class="money-reduced">共减<text>¥{{ totalDiscountAmount | NumFormat}}</text></text>
|
|
<text class="money-reduced">共减<text>¥{{ totalDiscountAmount | NumFormat}}</text></text>
|
|
@@ -116,20 +116,39 @@
|
|
import freight from '@/components/cm-module/creatOrder/freight'
|
|
import freight from '@/components/cm-module/creatOrder/freight'
|
|
import freightAlert from '@/components/cm-module/modelAlert/freightAlert'
|
|
import freightAlert from '@/components/cm-module/modelAlert/freightAlert'
|
|
const defaultProductParam = {
|
|
const defaultProductParam = {
|
|
- productCount:0,
|
|
|
|
- productId:0,
|
|
|
|
- source:2,
|
|
|
|
- userId:0
|
|
|
|
|
|
+ productCount:0, // 商品数量
|
|
|
|
+ productId:0, // 商品Id
|
|
|
|
+ source:2, // 来源:1WWW 2小程序
|
|
|
|
+ userId:0 // 用户Id
|
|
};
|
|
};
|
|
const defaultCartParam = {
|
|
const defaultCartParam = {
|
|
- productIds:0,
|
|
|
|
- source:2,
|
|
|
|
- userId:0
|
|
|
|
|
|
+ productIds:0, // 商品Id(逗号隔开)
|
|
|
|
+ source:2, // 来源:1WWW 2小程序
|
|
|
|
+ userId:0 // 用户Id
|
|
};
|
|
};
|
|
const defaultPostageParam = {
|
|
const defaultPostageParam = {
|
|
- productIds:0,
|
|
|
|
- userId:0,
|
|
|
|
- townId:0
|
|
|
|
|
|
+ productIds:0, // 商品Id(逗号隔开)
|
|
|
|
+ userId:0, // 用户Id
|
|
|
|
+ townId:0 // 地区Id
|
|
|
|
+ };
|
|
|
|
+ const defaultConfirmParam = {
|
|
|
|
+ cartType:1, // 购买类型:(1自主下单, 3协销下单)
|
|
|
|
+ orderSource:6, // 订单来源 1WWW 6小程序[采美,星范]
|
|
|
|
+ addressId:0, // 收货地址Id
|
|
|
|
+ clubCouponId:0, // 关联优惠券Id
|
|
|
|
+ clubId:0, // 机构Id
|
|
|
|
+ orderInfo:[], // 订单商品数据
|
|
|
|
+ orderInvoice:{type:0}, // 订单发票信息
|
|
|
|
+ payInfo:{ // 订单金额数据
|
|
|
|
+ orderShouldPayFee: 0, // 订单最终支付金额
|
|
|
|
+ balancePayFlag: 0, // 勾选余额的状态(1使用,0不使用)
|
|
|
|
+ clauseId:0, // 条款Id
|
|
|
|
+ postage: 0, // 运费金额
|
|
|
|
+ postageFlag: 0, // 运费类型
|
|
|
|
+ userBeans: 0, // 抵扣采美豆数量
|
|
|
|
+ rebateFlag:0 // 是否返佣订单
|
|
|
|
+ },
|
|
|
|
+ unionId:uni.getStorageSync('unionId'),// 用户unionId
|
|
};
|
|
};
|
|
export default {
|
|
export default {
|
|
components:{
|
|
components:{
|
|
@@ -147,24 +166,21 @@
|
|
isSubLoading:false,
|
|
isSubLoading:false,
|
|
confirmType:1,
|
|
confirmType:1,
|
|
orderID:0,
|
|
orderID:0,
|
|
- cartParam: Object.assign({}, defaultCartParam), // 购物车立即结算确认订单参数
|
|
|
|
- productParam: Object.assign({}, defaultProductParam), // 商品立即购买确认订单参数
|
|
|
|
- postageParam: Object.assign({}, defaultPostageParam), // 邮费计算参数
|
|
|
|
|
|
+ cartParam: Object.assign({}, defaultCartParam), // 购物车立即结算确认订单参数
|
|
|
|
+ productParam: Object.assign({}, defaultProductParam), // 商品立即购买确认订单参数
|
|
|
|
+ postageParam: Object.assign({}, defaultPostageParam), // 邮费计算参数
|
|
|
|
+ confirmParam: Object.assign({}, defaultConfirmParam), // 提交订单参数
|
|
productIds:'', // 获取上一级页面商品信息
|
|
productIds:'', // 获取上一级页面商品信息
|
|
- classifyIDS:'', // 获取上一级页面商品分类
|
|
|
|
- clubId:'', // 用户ID
|
|
|
|
submitState:'', // 提交状态
|
|
submitState:'', // 提交状态
|
|
- balanceDeductionFlag:2, // 勾选余额的状态(1使用,2不使用)
|
|
|
|
- allCount:1, // 订单提交总数量
|
|
|
|
|
|
+ totalCount:1, // 订单提交总数量
|
|
reducedPrice:0, // 满减金额
|
|
reducedPrice:0, // 满减金额
|
|
couponAmount:0, // 优惠券金额
|
|
couponAmount:0, // 优惠券金额
|
|
totalDiscountAmount:0, // 共减金额
|
|
totalDiscountAmount:0, // 共减金额
|
|
- payAllPrice:0.00, // 订单提交总金额
|
|
|
|
allPrice:0.00, // 订单总金额
|
|
allPrice:0.00, // 订单总金额
|
|
|
|
+ orderShouldPayFee:0, // 订单最终支付金额
|
|
surplusMoney:0.00, // 显示勾选后的剩余抵扣
|
|
surplusMoney:0.00, // 显示勾选后的剩余抵扣
|
|
userMoney:0.00, // 显示可使用余额
|
|
userMoney:0.00, // 显示可使用余额
|
|
deductMoney:0.00, // 显示已使用的余额
|
|
deductMoney:0.00, // 显示已使用的余额
|
|
- addressId:'', // 地址ID
|
|
|
|
isRequest:false, // 是否加载完成渲染子组件
|
|
isRequest:false, // 是否加载完成渲染子组件
|
|
isFreight:false, // 是否加载完成渲染子组件
|
|
isFreight:false, // 是否加载完成渲染子组件
|
|
isAddress:false, // 是否加载完成地址
|
|
isAddress:false, // 是否加载完成地址
|
|
@@ -179,11 +195,8 @@
|
|
invoiceData:{type:0}, // 初始化发票信息
|
|
invoiceData:{type:0}, // 初始化发票信息
|
|
freightData:{}, // 邮费数据
|
|
freightData:{}, // 邮费数据
|
|
orderInfo:[], // 提交的商品信息
|
|
orderInfo:[], // 提交的商品信息
|
|
- payInfo:{}, // 订单信息
|
|
|
|
- clubCouponId:0, // 用户关联优惠Id
|
|
|
|
rechargeGoods:null, // 判断订单里有定金商品或者充值商品时,余额抵扣部分不显示
|
|
rechargeGoods:null, // 判断订单里有定金商品或者充值商品时,余额抵扣部分不显示
|
|
freightBeansMoney:0, // 存储采美豆抵扣金额
|
|
freightBeansMoney:0, // 存储采美豆抵扣金额
|
|
- hanldUserBeans:0, // 抵扣的采美豆数
|
|
|
|
isCouponShow:false, // 是否显示可选优惠券
|
|
isCouponShow:false, // 是否显示可选优惠券
|
|
isCheckedBeans:false, // 是否抵扣采美豆
|
|
isCheckedBeans:false, // 是否抵扣采美豆
|
|
isCouponModel:false, // 兑换优惠券成功提示
|
|
isCouponModel:false, // 兑换优惠券成功提示
|
|
@@ -195,7 +208,7 @@
|
|
console.log('infodata',data)
|
|
console.log('infodata',data)
|
|
this.$api.getStorage().then((resolve) =>{
|
|
this.$api.getStorage().then((resolve) =>{
|
|
this.productParam.userId = this.cartParam.userId = this.postageParam.userId = resolve.userId ? resolve.userId : 0
|
|
this.productParam.userId = this.cartParam.userId = this.postageParam.userId = resolve.userId ? resolve.userId : 0
|
|
- this.clubId = resolve.clubId ? resolve.clubId : 0
|
|
|
|
|
|
+ this.confirmParam.clubId = resolve.clubId ? resolve.clubId : 0
|
|
if(option.type =='prodcut'){
|
|
if(option.type =='prodcut'){
|
|
this.confirmType = 1
|
|
this.confirmType = 1
|
|
this.productParam.productCount = data.data.productCount
|
|
this.productParam.productCount = data.data.productCount
|
|
@@ -224,14 +237,15 @@
|
|
this.couponList = data.couponList
|
|
this.couponList = data.couponList
|
|
this.userMoney = data.userMoney
|
|
this.userMoney = data.userMoney
|
|
this.reducedPrice = data.reducedPrice
|
|
this.reducedPrice = data.reducedPrice
|
|
|
|
+ this.totalCount = data.totalCount
|
|
this.allPrice = data.totalPrice
|
|
this.allPrice = data.totalPrice
|
|
this.rechargeGoods = data.rechargeGoods
|
|
this.rechargeGoods = data.rechargeGoods
|
|
if(this.couponList.length>0){
|
|
if(this.couponList.length>0){
|
|
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.payAllPrice = this.allPrice - this.couponAmount
|
|
|
|
|
|
+ this.confirmParam.clubCouponId = data.couponList[0].clubCouponId
|
|
}
|
|
}
|
|
|
|
+ this.orderShouldPayFee = this.allPrice - this.couponAmount
|
|
this.totalDiscountAmount = this.reducedPrice + this.couponAmount
|
|
this.totalDiscountAmount = this.reducedPrice + this.couponAmount
|
|
})
|
|
})
|
|
.catch(error =>{
|
|
.catch(error =>{
|
|
@@ -246,14 +260,15 @@
|
|
this.couponList = data.couponList
|
|
this.couponList = data.couponList
|
|
this.userMoney = data.userMoney
|
|
this.userMoney = data.userMoney
|
|
this.reducedPrice = data.reducedPrice
|
|
this.reducedPrice = data.reducedPrice
|
|
|
|
+ this.totalCount = data.totalCount
|
|
this.allPrice = data.totalPrice
|
|
this.allPrice = data.totalPrice
|
|
this.rechargeGoods = data.rechargeGoods
|
|
this.rechargeGoods = data.rechargeGoods
|
|
if(this.couponList.length>0){
|
|
if(this.couponList.length>0){
|
|
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.payAllPrice = this.allPrice - this.couponAmount
|
|
|
|
|
|
+ this.confirmParam.clubCouponId = data.couponList[0].clubCouponId
|
|
}
|
|
}
|
|
|
|
+ this.orderShouldPayFee = this.allPrice - this.couponAmount
|
|
this.totalDiscountAmount = this.reducedPrice + this.couponAmount
|
|
this.totalDiscountAmount = this.reducedPrice + this.couponAmount
|
|
})
|
|
})
|
|
.catch(error =>{
|
|
.catch(error =>{
|
|
@@ -263,18 +278,19 @@
|
|
getFreightData(){// 获取邮费信息
|
|
getFreightData(){// 获取邮费信息
|
|
this.isFreight = false
|
|
this.isFreight = false
|
|
this.OrderService.GetOrderPostage(this.postageParam).then(response =>{
|
|
this.OrderService.GetOrderPostage(this.postageParam).then(response =>{
|
|
|
|
+ const data = response.data
|
|
this.isFreight = true
|
|
this.isFreight = true
|
|
this.isCheckedBeans = false
|
|
this.isCheckedBeans = false
|
|
- this.freightData = response.data
|
|
|
|
- this.hanldFreePostFlag = response.data.postageFlag
|
|
|
|
- this.hanldFreight = response.data.freight
|
|
|
|
|
|
+ this.freightData = data
|
|
|
|
+ this.hanldFreePostFlag = data.postageFlag
|
|
|
|
+ this.hanldFreight = data.postage
|
|
if(this.hanldFreePostFlag == 1){
|
|
if(this.hanldFreePostFlag == 1){
|
|
if( this.freightData.userBeans > 0 ){
|
|
if( this.freightData.userBeans > 0 ){
|
|
this.freightBeansMoney = this.hanldFreight
|
|
this.freightBeansMoney = this.hanldFreight
|
|
}else{
|
|
}else{
|
|
this.freightBeansMoney = 0
|
|
this.freightBeansMoney = 0
|
|
}
|
|
}
|
|
- this.payAllPrice = this.allPrice + response.data.freight
|
|
|
|
|
|
+ this.orderShouldPayFee = this.allPrice + data.postage
|
|
this.attributePallPrice()
|
|
this.attributePallPrice()
|
|
this.hanldFreightBeans(this.isCheckedBeans)
|
|
this.hanldFreightBeans(this.isCheckedBeans)
|
|
}else{
|
|
}else{
|
|
@@ -283,7 +299,7 @@
|
|
}else{
|
|
}else{
|
|
this.freightBeansMoney = 0
|
|
this.freightBeansMoney = 0
|
|
}
|
|
}
|
|
- this.payAllPrice = this.allPrice
|
|
|
|
|
|
+ this.orderShouldPayFee = this.allPrice
|
|
this.attributePallPrice()
|
|
this.attributePallPrice()
|
|
this.hanldFreightBeans(this.isCheckedBeans)
|
|
this.hanldFreightBeans(this.isCheckedBeans)
|
|
}
|
|
}
|
|
@@ -296,7 +312,7 @@
|
|
this.isAddress = true
|
|
this.isAddress = true
|
|
this.addressData = {}
|
|
this.addressData = {}
|
|
if( data.list && data.list.length > 0 ){
|
|
if( data.list && data.list.length > 0 ){
|
|
- this.addressId = data.list[0].addressId;
|
|
|
|
|
|
+ this.confirmParam.addressId = data.list[0].addressId;
|
|
this.postageParam.townId = data.list[0].townId;
|
|
this.postageParam.townId = data.list[0].townId;
|
|
this.addressData = data.list[0];
|
|
this.addressData = data.list[0];
|
|
this.getFreightData()
|
|
this.getFreightData()
|
|
@@ -310,24 +326,24 @@
|
|
this.goodsData = data;
|
|
this.goodsData = data;
|
|
},
|
|
},
|
|
handleChoiceaInvoiceData(data){//获取发票信息
|
|
handleChoiceaInvoiceData(data){//获取发票信息
|
|
- this.invoiceData = data
|
|
|
|
|
|
+ this.confirmParam.orderInvoice = data
|
|
},
|
|
},
|
|
hanldFreightFn(data){//显示邮费弹窗
|
|
hanldFreightFn(data){//显示邮费弹窗
|
|
- console.log(data)
|
|
|
|
- switch(data.freePostFlag){
|
|
|
|
|
|
+ console.log('邮费信息',data)
|
|
|
|
+ switch(data.postageFlag){
|
|
case 1:
|
|
case 1:
|
|
- this.hanldFreight = this.freightData.freight
|
|
|
|
- this.hanldFreePostFlag = data.freePostFlag
|
|
|
|
|
|
+ this.hanldFreight = this.freightData.postage
|
|
|
|
+ this.hanldFreePostFlag = data.postageFlag
|
|
this.freightBeansMoney = data.freightBeansMoney
|
|
this.freightBeansMoney = data.freightBeansMoney
|
|
- this.payAllPrice =this.allPrice + this.hanldFreight
|
|
|
|
|
|
+ this.orderShouldPayFee =this.allPrice + this.hanldFreight
|
|
this.attributePallPrice()
|
|
this.attributePallPrice()
|
|
this.hanldFreightBeans(this.isCheckedBeans)
|
|
this.hanldFreightBeans(this.isCheckedBeans)
|
|
break
|
|
break
|
|
case -1:
|
|
case -1:
|
|
this.hanldFreight = 0
|
|
this.hanldFreight = 0
|
|
- this.hanldFreePostFlag = data.freePostFlag
|
|
|
|
|
|
+ this.hanldFreePostFlag = data.postageFlag
|
|
this.freightBeansMoney = data.freightBeansMoney
|
|
this.freightBeansMoney = data.freightBeansMoney
|
|
- this.payAllPrice = this.allPrice
|
|
|
|
|
|
+ this.orderShouldPayFee = this.allPrice
|
|
this.attributePallPrice()
|
|
this.attributePallPrice()
|
|
this.hanldFreightBeans(this.isCheckedBeans)
|
|
this.hanldFreightBeans(this.isCheckedBeans)
|
|
break
|
|
break
|
|
@@ -338,9 +354,9 @@
|
|
if(this.isCheckedBeans){
|
|
if(this.isCheckedBeans){
|
|
// 判断如果采美豆大于等于运费*100
|
|
// 判断如果采美豆大于等于运费*100
|
|
if( this.freightData.userBeans > 0 ){
|
|
if( this.freightData.userBeans > 0 ){
|
|
- this.hanldUserBeans = this.freightBeansMoney*100
|
|
|
|
|
|
+ this.confirmParam.payInfo.userBeans = this.freightBeansMoney*100
|
|
}else{
|
|
}else{
|
|
- this.hanldUserBeans = 0
|
|
|
|
|
|
+ this.confirmParam.payInfo.userBeans = 0
|
|
}
|
|
}
|
|
// 计算抵扣后的总价
|
|
// 计算抵扣后的总价
|
|
if(this.hanldFreePostFlag == 1){
|
|
if(this.hanldFreePostFlag == 1){
|
|
@@ -348,21 +364,21 @@
|
|
if(this.ischecked){
|
|
if(this.ischecked){
|
|
let totalAmount = this.allPrice - this.couponAmount
|
|
let totalAmount = this.allPrice - this.couponAmount
|
|
if(this.userMoney >= totalAmount){
|
|
if(this.userMoney >= totalAmount){
|
|
- this.payAllPrice = 0.00
|
|
|
|
|
|
+ this.orderShouldPayFee = 0.00
|
|
this.deductMoney = this.allPrice - this.couponAmount // 当前使用金额等于订单金额
|
|
this.deductMoney = this.allPrice - this.couponAmount // 当前使用金额等于订单金额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余金额等于余额-当前使用金额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余金额等于余额-当前使用金额
|
|
}else{
|
|
}else{
|
|
- this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于订单金额-账户余额
|
|
|
|
|
|
+ this.orderShouldPayFee = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于订单金额-账户余额
|
|
this.deductMoney = this.userMoney // 当前使用金额等于总余额
|
|
this.deductMoney = this.userMoney // 当前使用金额等于总余额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于总余额-当前使用金额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于总余额-当前使用金额
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- this.payAllPrice = this.allPrice + this.hanldFreight - this.freightBeansMoney - this.couponAmount
|
|
|
|
|
|
+ this.orderShouldPayFee = this.allPrice + this.hanldFreight - this.freightBeansMoney - this.couponAmount
|
|
}
|
|
}
|
|
- console.log('抵扣',this.payAllPrice)
|
|
|
|
|
|
+ console.log('抵扣',this.orderShouldPayFee)
|
|
}
|
|
}
|
|
}else{// 采美豆不抵扣运费
|
|
}else{// 采美豆不抵扣运费
|
|
- this.hanldUserBeans = 0
|
|
|
|
|
|
+ this.confirmParam.payInfo.userBeans = 0
|
|
// 不抵扣时计算总价
|
|
// 不抵扣时计算总价
|
|
if(this.hanldFreePostFlag == 1){
|
|
if(this.hanldFreePostFlag == 1){
|
|
this.attributeHashfreight(this.hanldFreight)
|
|
this.attributeHashfreight(this.hanldFreight)
|
|
@@ -373,7 +389,7 @@
|
|
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.confirmParam.clubCouponId = data.clubCouponId
|
|
this.attributePallPrice()
|
|
this.attributePallPrice()
|
|
this.hanldFreightBeans(this.isCheckedBeans)
|
|
this.hanldFreightBeans(this.isCheckedBeans)
|
|
},
|
|
},
|
|
@@ -381,21 +397,21 @@
|
|
if(this.userMoney > 0){
|
|
if(this.userMoney > 0){
|
|
this.ischecked = !this.ischecked
|
|
this.ischecked = !this.ischecked
|
|
if(this.ischecked){
|
|
if(this.ischecked){
|
|
- this.balanceDeductionFlag =1
|
|
|
|
|
|
+ this.confirmParam.payInfo.balancePayFlag = 1
|
|
this.attributePallPrice()
|
|
this.attributePallPrice()
|
|
}else{
|
|
}else{
|
|
if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){ //如果是有运费时
|
|
if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){ //如果是有运费时
|
|
if(this.isCheckedBeans){
|
|
if(this.isCheckedBeans){
|
|
- this.payAllPrice = this.allPrice - this.couponAmount
|
|
|
|
|
|
+ this.orderShouldPayFee = this.allPrice - this.couponAmount
|
|
}else{
|
|
}else{
|
|
- this.payAllPrice = this.allPrice+parseInt(this.freightData.freight) - this.couponAmount
|
|
|
|
|
|
+ this.orderShouldPayFee = this.allPrice+parseInt(this.freightData.postage) - this.couponAmount
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- this.payAllPrice = this.allPrice - this.couponAmount
|
|
|
|
|
|
+ this.orderShouldPayFee = this.allPrice - this.couponAmount
|
|
}
|
|
}
|
|
- this.balanceDeductionFlag = 2
|
|
|
|
|
|
+ this.confirmParam.payInfo.balancePayFlag = 0
|
|
}
|
|
}
|
|
- console.log('最终订单支付金额',this.payAllPrice)
|
|
|
|
|
|
+ console.log('最终订单支付金额',this.orderShouldPayFee)
|
|
console.log('优惠券金额',this.couponAmount)
|
|
console.log('优惠券金额',this.couponAmount)
|
|
}else{
|
|
}else{
|
|
return
|
|
return
|
|
@@ -403,7 +419,7 @@
|
|
},
|
|
},
|
|
attributePallPrice(){// 计算价格
|
|
attributePallPrice(){// 计算价格
|
|
if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){
|
|
if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){
|
|
- this.attributeHashfreight(this.freightData.freight)
|
|
|
|
|
|
+ this.attributeHashfreight(this.freightData.postage)
|
|
}else{
|
|
}else{
|
|
this.attributeNofreight()
|
|
this.attributeNofreight()
|
|
}
|
|
}
|
|
@@ -412,60 +428,61 @@
|
|
if(this.ischecked){
|
|
if(this.ischecked){
|
|
let totalAmount = this.allPrice - this.couponAmount
|
|
let totalAmount = this.allPrice - this.couponAmount
|
|
if(this.userMoney >= totalAmount){
|
|
if(this.userMoney >= totalAmount){
|
|
- this.payAllPrice = 0.00
|
|
|
|
|
|
+ this.orderShouldPayFee = 0.00
|
|
this.deductMoney = this.allPrice - this.couponAmount // 当前使用金额等于订单金额
|
|
this.deductMoney = this.allPrice - this.couponAmount // 当前使用金额等于订单金额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余金额等于余额-当前使用金额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余金额等于余额-当前使用金额
|
|
}else{
|
|
}else{
|
|
- this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于订单金额-账户余额
|
|
|
|
|
|
+ this.orderShouldPayFee = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于订单金额-账户余额
|
|
this.deductMoney = this.userMoney // 当前使用金额等于总余额
|
|
this.deductMoney = this.userMoney // 当前使用金额等于总余额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于总余额-当前使用金额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于总余额-当前使用金额
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- this.payAllPrice = this.allPrice - this.couponAmount;
|
|
|
|
|
|
+ this.orderShouldPayFee = this.allPrice - this.couponAmount;
|
|
this.deductMoney = 0.00; // 当前使用
|
|
this.deductMoney = 0.00; // 当前使用
|
|
this.surplusMoney = this.userMoney; // 剩余余额
|
|
this.surplusMoney = this.userMoney; // 剩余余额
|
|
}
|
|
}
|
|
- console.log('最终订单支付金额',this.payAllPrice)
|
|
|
|
|
|
+ console.log('最终订单支付金额',this.orderShouldPayFee)
|
|
console.log('优惠券金额',this.couponAmount)
|
|
console.log('优惠券金额',this.couponAmount)
|
|
},
|
|
},
|
|
- attributeHashfreight(freight){// 计算需要邮费的支付价格
|
|
|
|
- let totalAmount = this.allPrice + parseInt(freight) - this.couponAmount//计算不包邮的价格 总价等于商品价格+邮费
|
|
|
|
|
|
+ attributeHashfreight(postage){// 计算需要邮费的支付价格
|
|
|
|
+ console.log()
|
|
|
|
+ let totalAmount = this.allPrice + parseInt(postage) - this.couponAmount//计算不包邮的价格 总价等于商品价格+邮费
|
|
if(this.ischecked){
|
|
if(this.ischecked){
|
|
if(this.userMoney >= totalAmount){// 全部抵扣
|
|
if(this.userMoney >= totalAmount){// 全部抵扣
|
|
- this.payAllPrice =0.00
|
|
|
|
|
|
+ this.orderShouldPayFee =0.00
|
|
if(this.isCheckedBeans){// 抵扣运费了
|
|
if(this.isCheckedBeans){// 抵扣运费了
|
|
this.deductMoney = this.allPrice - this.couponAmount // 当前使用金额等于订单金额
|
|
this.deductMoney = this.allPrice - this.couponAmount // 当前使用金额等于订单金额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余金额等于余额减去当前使用金额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余金额等于余额减去当前使用金额
|
|
}else{
|
|
}else{
|
|
- this.deductMoney = this.allPrice + parseInt(freight)- this.couponAmount // 当前使用金额等于订单金额+运费金额
|
|
|
|
|
|
+ this.deductMoney = this.allPrice + parseInt(postage)- this.couponAmount // 当前使用金额等于订单金额+运费金额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于总余额-当前使用金额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于总余额-当前使用金额
|
|
}
|
|
}
|
|
}else{// 部分抵扣
|
|
}else{// 部分抵扣
|
|
if(this.isCheckedBeans){// 抵扣运费了
|
|
if(this.isCheckedBeans){// 抵扣运费了
|
|
- this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于总订单金额-账户余额-优惠券金额
|
|
|
|
|
|
+ this.orderShouldPayFee = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于总订单金额-账户余额-优惠券金额
|
|
this.deductMoney = this.userMoney // 当前使用金额等于账户余额
|
|
this.deductMoney = this.userMoney // 当前使用金额等于账户余额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于账户余额-当前使用金额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于账户余额-当前使用金额
|
|
}else{
|
|
}else{
|
|
- this.payAllPrice = this.allPrice + parseInt(freight) - this.userMoney - this.couponAmount//订单支付金额等于订单金额+运费-账户余额-优惠券
|
|
|
|
|
|
+ this.orderShouldPayFee = this.allPrice + parseInt(postage) - this.userMoney - this.couponAmount//订单支付金额等于订单金额+运费-账户余额-优惠券
|
|
this.deductMoney = this.userMoney // 当前使用金额等于账户余额
|
|
this.deductMoney = this.userMoney // 当前使用金额等于账户余额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于账户余额-当前使用金额
|
|
this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于账户余额-当前使用金额
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- this.payAllPrice = this.allPrice + parseInt(freight) - this.couponAmount
|
|
|
|
|
|
+ this.orderShouldPayFee = this.allPrice + parseInt(postage) - this.couponAmount
|
|
this.deductMoney = 0.00 // 当前使用金额
|
|
this.deductMoney = 0.00 // 当前使用金额
|
|
this.surplusMoney = this.userMoney // 剩余余额
|
|
this.surplusMoney = this.userMoney // 剩余余额
|
|
}
|
|
}
|
|
- console.log('最终订单支付金额',this.payAllPrice)
|
|
|
|
|
|
+ console.log('最终订单支付金额',this.orderShouldPayFee)
|
|
console.log('优惠券金额',this.couponAmount)
|
|
console.log('优惠券金额',this.couponAmount)
|
|
},
|
|
},
|
|
orderSubmitMit(){// 提交订单
|
|
orderSubmitMit(){// 提交订单
|
|
if(this.isSubLoading){ return; }
|
|
if(this.isSubLoading){ return; }
|
|
- if(this.addressId == ''){
|
|
|
|
|
|
+ if(this.confirmParam.addressId == ''){
|
|
this.$util.msg('请先添加收货地址~',2000)
|
|
this.$util.msg('请先添加收货地址~',2000)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- this.orderInfo = this.goodsData.map(el => {
|
|
|
|
|
|
+ this.confirmParam.orderInfo = this.goodsData.map(el => {
|
|
let productInfo = [];
|
|
let productInfo = [];
|
|
el.cartList.forEach(item => {
|
|
el.cartList.forEach(item => {
|
|
productInfo.push({
|
|
productInfo.push({
|
|
@@ -475,45 +492,33 @@
|
|
productType:item.productType
|
|
productType:item.productType
|
|
})
|
|
})
|
|
})
|
|
})
|
|
- return {shopId:el.id,note:el.note?el.note:'',productInfo:productInfo}
|
|
|
|
|
|
+ return {shopId:el.shopId,note:el.note?el.note:'',productInfo:productInfo}
|
|
})
|
|
})
|
|
- //订单信息
|
|
|
|
- this.payInfo = {
|
|
|
|
- clauseId:0,//条款(暂时保留)
|
|
|
|
- orderShouldPayFee:this.payAllPrice.toFixed(2),//提交的总价
|
|
|
|
- balancePayFlag:this.balanceDeductionFlag,//余额抵扣的状态
|
|
|
|
- freight:parseInt(this.hanldFreight).toFixed(2),//邮费
|
|
|
|
- freePostFlag:parseInt(this.hanldFreePostFlag),//运费形式
|
|
|
|
- userBeans:this.hanldUserBeans
|
|
|
|
- }
|
|
|
|
- let param = {
|
|
|
|
- clubCouponId:this.clubCouponId,
|
|
|
|
- orderSource:6,
|
|
|
|
- clubUserId:this.userID,
|
|
|
|
- addressId:this.addressId,
|
|
|
|
- orderInfo:this.orderInfo,
|
|
|
|
- payInfo:this.payInfo, //订单信息
|
|
|
|
- orderInvoice:this.invoiceData
|
|
|
|
- }
|
|
|
|
- console.log(param)
|
|
|
|
|
|
+ this.confirmParam.payInfo.postage = parseInt(this.hanldFreight).toFixed(2)
|
|
|
|
+ this.confirmParam.payInfo.postageFlag = parseInt(this.hanldFreePostFlag)
|
|
|
|
+ this.confirmParam.payInfo.orderShouldPayFee = this.orderShouldPayFee.toFixed(2)
|
|
|
|
+ this.confirmParam.payInfo = JSON.stringify(this.confirmParam.payInfo)
|
|
|
|
+ this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
|
|
|
|
+ this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
|
|
|
|
+ console.log(this.confirmParam)
|
|
this.isSubLoading = true;
|
|
this.isSubLoading = true;
|
|
- this.OrderService.CreatedOrderSubmit({'params':JSON.stringify(param)}).then(response =>{
|
|
|
|
- const data = response.data;
|
|
|
|
|
|
+ this.OrderService.CreatedOrderSubmit(this.confirmParam).then(response =>{
|
|
|
|
+ let 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', {
|
|
Um_Key_PageName: '机构提交订单',
|
|
Um_Key_PageName: '机构提交订单',
|
|
Um_Key_SourcePage: '确认订单',
|
|
Um_Key_SourcePage: '确认订单',
|
|
- Um_Key_OrderID:`${data.orderID}`
|
|
|
|
|
|
+ Um_Key_OrderID:`${data.orderId}`
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- if(data.code === '1'){
|
|
|
|
|
|
+ console.log('机构提交订单机构提交订单机构提交订单机构提交订单')
|
|
|
|
+ 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}
|
|
|
|
- this.$api.navigateTo(`/pages/user/order/success?data=${JSON.stringify({data:data})}`)
|
|
|
|
|
|
+ this.$api.navigateTo(`/pages/user/order/success?data=${JSON.stringify({data:{orderId:data.orderId}})}`)
|
|
}else{
|
|
}else{
|
|
this.submitState ='confirm'
|
|
this.submitState ='confirm'
|
|
this.$util.msg('订单提交成功',3000,true,'success')
|
|
this.$util.msg('订单提交成功',3000,true,'success')
|
|
@@ -521,7 +526,7 @@
|
|
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=${data.orderId}`)
|
|
},3000)
|
|
},3000)
|
|
}
|
|
}
|
|
}).catch(error =>{
|
|
}).catch(error =>{
|
|
@@ -545,13 +550,12 @@
|
|
},
|
|
},
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
- // this.addressID = ''
|
|
|
|
let pages = getCurrentPages();
|
|
let pages = getCurrentPages();
|
|
let currPage = pages[pages.length-1];
|
|
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');
|
|
let SelectData = uni.getStorageSync('selectAddress');
|
|
- this.addressId = SelectData.addressId;
|
|
|
|
|
|
+ this.confirmParam.addressId = SelectData.addressId;
|
|
this.postageParam.townId = SelectData.townId
|
|
this.postageParam.townId = SelectData.townId
|
|
this.addressData = SelectData
|
|
this.addressData = SelectData
|
|
this.getFreightData()
|
|
this.getFreightData()
|