|
|
@@ -126,10 +126,10 @@
|
|
|
</view>
|
|
|
<view class="order_list flex_r flex_ac flex_jb" v-if="['1','2','3'].includes(Data.type)">
|
|
|
<view class="list_name">可用云宝</view>
|
|
|
- <view class="list_con p_color">¥{{ userinfo.user_money }}</view>
|
|
|
+ <view class="list_con g_color">¥{{ userinfo.user_money }}</view>
|
|
|
</view>
|
|
|
- <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type==4 && isAct">
|
|
|
- <view class="list_name">佣金余额</view>
|
|
|
+ <view class="order_list flex_r flex_ac flex_jb" v-if="['1','2','3', '4'].includes(Data.type) && isAct">
|
|
|
+ <view class="list_name">数智余额</view>
|
|
|
<view class="list_con g_color">¥{{ local_uinfo.property }}</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -178,11 +178,11 @@ export default {
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
this.Data = e;
|
|
|
- this.getLU();
|
|
|
- this.isActivation();
|
|
|
- this.getuserInfo();
|
|
|
- this.loadAddress();
|
|
|
- this.loadData(e);
|
|
|
+ this.isActivation(); //查询是否激活数智生活
|
|
|
+ this.getLU(); //获取数智生活用户信息
|
|
|
+ this.getuserInfo(); //获取云店用户信息
|
|
|
+ this.loadAddress(); //获取收货地址
|
|
|
+ this.loadData(e); //加载订单商品数据
|
|
|
|
|
|
this.modularName = this.tidyTpye(e.type);
|
|
|
},
|
|
|
@@ -220,41 +220,43 @@ export default {
|
|
|
if (this.goodsInfo.shipping_method != 2) this.prom_type = this.goodsInfo.shipping_method
|
|
|
post("v1/goods/freight", { type: da.type, id: da.id }).then((res) => {
|
|
|
if (res.code === 0) this.freight = res.data.freight;
|
|
|
+
|
|
|
+ let type = this.Data.type; // 商品类型(零售、批发 ...)
|
|
|
|
|
|
// 计算待支付
|
|
|
- let p = this.Data.type == 2 ? this.goodsInfo.trade_price : this.goodsInfo.cost_price; //商品单价
|
|
|
- let y = 0; //运费
|
|
|
- if(this.Data.type == 2){
|
|
|
- if(this.Data.is_sell == 1){
|
|
|
- y = this.freight.service
|
|
|
- }
|
|
|
- else if(this.prom_type != 1 && this.Data.is_sell != 1){
|
|
|
- y = this.freight.freight
|
|
|
- }
|
|
|
- }else{
|
|
|
- y = this.prom_type == 1 ? 0 : this.freight; // 运费单价 寄卖、自提 运费为0
|
|
|
+ let p = type == 2 ? this.goodsInfo.trade_price : this.goodsInfo.cost_price; //商品单价
|
|
|
+ let y = 0; //运费单价
|
|
|
+ if(type == 2){
|
|
|
+ if(this.Data.is_sell == 1) y = this.freight.service
|
|
|
+ else if(this.prom_type != 1 && this.Data.is_sell != 1) y = this.freight.freight
|
|
|
}
|
|
|
+ else y = this.prom_type == 1 ? 0 : this.freight; // 运费单价 寄卖、自提 运费为0
|
|
|
let ps = this.$h.Mul(p, this.Data.num); //商品总价
|
|
|
- this.originalPrice = ps; this.CommodityPrice = ps;
|
|
|
let ys = this.$h.Mul(y, this.Data.num) //运费总价
|
|
|
let a = this.$h.Add(ps, ys); //商品总价加运费
|
|
|
- let b = this.$h.Sub(a, this.userinfo.user_money); //待支付金额
|
|
|
- let b1 = this.$h.Sub(ps, this.userinfo.user_money); //待支付金额 零售&批发&云宝货易 运费必须现金支付
|
|
|
- if (this.Data.type == 4) {
|
|
|
- if(this.isAct){
|
|
|
- let um = this.local_uinfo.property; //数智生活模块佣金余额
|
|
|
- let up = this.local_uinfo.integral; //数智生活模块消费金
|
|
|
- let goldnum = this.$h.Mul(this.goodsInfo.consume, this.Data.num)
|
|
|
- this.goldNum = up > goldnum ? goldnum : up;
|
|
|
- let sp = this.$h.Sub(ps, this.goldNum);
|
|
|
+ this.originalPrice = ps; this.CommodityPrice = ps;
|
|
|
+
|
|
|
+ let um = 0; //数智生活余额
|
|
|
+ if(this.isAct) um = this.local_uinfo.property; //数智生活余额
|
|
|
+ let userBalance = this.$h.Add(this.userinfo.user_money, um); //用户总余额(数智生活余额+云宝)
|
|
|
+
|
|
|
+ let b = this.$h.Sub(a, userBalance); //待支付金额
|
|
|
+ let b1 = this.$h.Sub(ps, userBalance); //待支付金额 - 零售&批发&云宝货易 运费必须现金支付
|
|
|
+
|
|
|
+ if (type == 4) {
|
|
|
+ if(this.isAct){
|
|
|
+ let up = this.local_uinfo.integral; //数智生活消费金
|
|
|
+ let goldnum = this.$h.Mul(this.goodsInfo.consume, this.Data.num); //商品消费金 可抵金额
|
|
|
+ this.goldNum = up > goldnum ? goldnum : up; //可抵金额,消费金不够及余额多少抵多少
|
|
|
+ let sp = this.$h.Sub(ps, this.goldNum); //抵扣后价格
|
|
|
this.CommodityPrice = sp;
|
|
|
let b2 = this.$h.Sub(sp, um); //消费金电商 可以使用数智生活佣金支付
|
|
|
this.obligation = b2 > 0 ? b2 : 0;
|
|
|
}
|
|
|
else this.obligation = a;
|
|
|
}
|
|
|
- else if (["5", "6"].includes(this.Data.type)) this.obligation = a;
|
|
|
- else if (["1", "2", "3"].includes(this.Data.type)) this.obligation = b1 > 0 ? this.$h.Add(b1, ys) : ys;
|
|
|
+ else if (["5", "6"].includes(type)) this.obligation = a;
|
|
|
+ else if (["1", "2", "3"].includes(type)) this.obligation = b1 > 0 ? this.$h.Add(b1, ys) : ys;
|
|
|
else this.obligation = b > 0 ? b : 0;
|
|
|
});
|
|
|
}
|