Commit 694fce9f authored by 黄奎's avatar 黄奎

页面修改

parent 1abbd1fe
This diff is collapsed.
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
<text class="price" :style="{ color: mc }">-¥{{ couponPrice.toFixed(2) }}</text> <text class="price" :style="{ color: mc }">-¥{{ couponPrice.toFixed(2) }}</text>
</view> </view>
</view> </view>
<view class="filed" v-if="mchs.length>0&&mchs[0].is_deduction_commission"> <view class="filed" v-if="mchs.length>0&&mchs[0].is_deduction_commission">
<view class="left">佣金抵扣</view> <view class="left">佣金抵扣</view>
<view class="right"> <view class="right">
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
<text class="price" :style="{ color: mc }">-¥{{ userInt ? integral.deduction_price.toFixed(2) : '0.00' }}</text> <text class="price" :style="{ color: mc }">-¥{{ userInt ? integral.deduction_price.toFixed(2) : '0.00' }}</text>
</view> </view>
</view> </view>
<view class="filed" v-if="IsDeposit==1 && mchs[0].deposit.can_use == true"> <view class="filed" v-if="IsDeposit==1 && mchs[0].deposit.can_use == true">
<view class="left">储蓄卡抵扣</view> <view class="left">储蓄卡抵扣</view>
<view class="right"> <view class="right">
<text class="price" :style="{ color: mc }">-¥{{ cashPrice.toFixed(2) }}</text> <text class="price" :style="{ color: mc }">-¥{{ cashPrice.toFixed(2) }}</text>
...@@ -203,11 +203,10 @@ ...@@ -203,11 +203,10 @@
</u-button> </u-button>
</view> </view>
</view> </view>
<coupon v-if="couponList.length > 0 && showCoupon" :list="couponList" :current="formdata.User_Coupon_Id" <coupon v-if="couponList.length > 0 && showCoupon" :list="couponList" :current="formdata.User_Coupon_Id" @close="closeCouponHandler"></coupon>
@close="closeCouponHandler"></coupon> <cashCard v-if="cashCardList.length > 0 && showcashcard" :list="cashCardList" :current="formdata.Use_Deposit_Id"
<cashCard v-if="cashCardList.length > 0 && showcashcard" :list="cashCardList" :current="formdata.Use_Deposit_Id" @close="closecashcard"></cashCard>
@close="closecashcard"></cashCard>
<view class="notOption" v-if="submitOrder"></view> <view class="notOption" v-if="submitOrder"></view>
<good-list :list="goodData" v-if="showGoodList" @close="closeGoodListHandler"></good-list> <good-list :list="goodData" v-if="showGoodList" @close="closeGoodListHandler"></good-list>
<payCom v-if="payBtn" :payInfo="payInfo" @closePay="closePay"></payCom> <payCom v-if="payBtn" :payInfo="payInfo" @closePay="closePay"></payCom>
...@@ -256,7 +255,7 @@ ...@@ -256,7 +255,7 @@
import payCom from '@/components/pay/pay'; import payCom from '@/components/pay/pay';
import peisong from '@/components/peisong/index'; import peisong from '@/components/peisong/index';
import coupon from '@/components/coupon/index'; import coupon from '@/components/coupon/index';
import cashCard from '@/components/coupon/cashCard';//储蓄卡 import cashCard from '@/components/coupon/cashCard'; //储蓄卡
import goodList from '@/components/goods/order-good-list'; import goodList from '@/components/goods/order-good-list';
export default { export default {
components: { components: {
...@@ -301,7 +300,7 @@ ...@@ -301,7 +300,7 @@
expressPrice: 0.0, expressPrice: 0.0,
goodPrice: 0.0, goodPrice: 0.0,
couponPrice: 0.0, couponPrice: 0.0,
cashPrice:0.0, cashPrice: 0.0,
integral: { integral: {
can_use: false, can_use: false,
use: false, use: false,
...@@ -331,11 +330,11 @@ ...@@ -331,11 +330,11 @@
BuyerMessage: '', BuyerMessage: '',
showReviceModal: false, showReviceModal: false,
//抵扣金额 //抵扣金额
deduction_commission:0, deduction_commission: 0,
cashCardList:[], cashCardList: [],
showcashcard:false, showcashcard: false,
onecoupon:true,//第一次进页面的时候选最优的优惠券 onecoupon: true, //第一次进页面的时候选最优的优惠券
IsDeposit:0,//是否开启储蓄卡功能 IsDeposit: 0, //是否开启储蓄卡功能
}; };
}, },
onLoad(option) { onLoad(option) {
...@@ -345,7 +344,7 @@ ...@@ -345,7 +344,7 @@
if (option.formData) { if (option.formData) {
this.formData = JSON.parse(decodeURIComponent(option.formData)); this.formData = JSON.parse(decodeURIComponent(option.formData));
this.formdata = JSON.parse(decodeURIComponent(option.formData)); this.formdata = JSON.parse(decodeURIComponent(option.formData));
this.formdata.Use_Deposit_Id = 0;//储蓄卡ID 2021-4-8加的 this.formdata.Use_Deposit_Id = 0; //储蓄卡ID 2021-4-8加的
} }
if (option.IsFormShoppingCart) { if (option.IsFormShoppingCart) {
this.IsFormShoppingCart = option.IsFormShoppingCart; this.IsFormShoppingCart = option.IsFormShoppingCart;
...@@ -354,7 +353,7 @@ ...@@ -354,7 +353,7 @@
this.ShoppingCartIdList = JSON.parse(option.ShoppingCartIdList); this.ShoppingCartIdList = JSON.parse(option.ShoppingCartIdList);
} }
this.payInfo.OpenId = uni.getStorageSync('mall_UserInfo').OpenId; this.payInfo.OpenId = uni.getStorageSync('mall_UserInfo').OpenId;
this.IsDeposit = uni.getStorageSync('basedata')?uni.getStorageSync('basedata').mall.setting.IsDeposit:0 this.IsDeposit = uni.getStorageSync('basedata') ? uni.getStorageSync('basedata').mall.setting.IsDeposit : 0
this.initPage(); this.initPage();
this.mc = this.$uiConfig.mainColor; this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary; this.secondary = this.$uiConfig.secondary;
...@@ -424,17 +423,17 @@ ...@@ -424,17 +423,17 @@
form.DetailList = that.DetailList; form.DetailList = that.DetailList;
form.User_Coupon_Id = that.formdata.User_Coupon_Id; form.User_Coupon_Id = that.formdata.User_Coupon_Id;
form.Use_Deposit_Id = that.formdata.Use_Deposit_Id; form.Use_Deposit_Id = that.formdata.Use_Deposit_Id;
form.DepositMoney = that.cashPrice;//储蓄卡抵扣金额 form.DepositMoney = that.cashPrice; //储蓄卡抵扣金额
form.DepositFreightMoney = that.expressPrice;//储蓄卡抵扣运费 form.DepositFreightMoney = that.expressPrice; //储蓄卡抵扣运费
form.CouponMoney = that.couponPrice; form.CouponMoney = that.couponPrice;
form.FreightMoney = that.expressPrice; form.FreightMoney = that.expressPrice;
form.Income = that.ds.total_price; form.Income = that.ds.total_price;
form.IsFormShoppingCart = that.IsFormShoppingCart; form.IsFormShoppingCart = that.IsFormShoppingCart;
form.Use_Integral = that.formdata.Use_Integral; form.Use_Integral = that.formdata.Use_Integral;
form.ShoppingCartIdList = that.ShoppingCartIdList; form.ShoppingCartIdList = that.ShoppingCartIdList;
form.AnchorName = uni.getStorageSync("AnchorName") ? uni.getStorageSync("AnchorName").AnchorName : ''; //直播名称 form.AnchorName = uni.getStorageSync("AnchorName") ? uni.getStorageSync("AnchorName").AnchorName : ''; //直播名称
if(that.mchs&&that.mchs.length>0){ if (that.mchs && that.mchs.length > 0) {
that.deduction_commission = that.mchs[0].deduction_commission; that.deduction_commission = that.mchs[0].deduction_commission;
} }
form.DeductionCommission = that.deduction_commission; form.DeductionCommission = that.deduction_commission;
...@@ -446,7 +445,6 @@ ...@@ -446,7 +445,6 @@
if (res.resultCode == 1) { if (res.resultCode == 1) {
if (that.checked == true) { if (that.checked == true) {
that.zhaoren = true; that.zhaoren = true;
let u = uni.getStorageSync("mall_UserInfo"); let u = uni.getStorageSync("mall_UserInfo");
let uid = u.UserId ? u.UserId : 0; let uid = u.UserId ? u.UserId : 0;
let Up = u.UserPageType ? u.UserPageType : 0; let Up = u.UserPageType ? u.UserPageType : 0;
...@@ -457,21 +455,17 @@ ...@@ -457,21 +455,17 @@
} }
that.path = '/pages/index/index?OrderId=' + res.data.OrderId + "&user_id=" + uid + "&Up=" + Up + that.path = '/pages/index/index?OrderId=' + res.data.OrderId + "&user_id=" + uid + "&Up=" + Up +
"&SmallShopId=" + SmallShopId + '&JumpType=4'; "&SmallShopId=" + SmallShopId + '&JumpType=4';
console.log(that.path)
} else { } else {
that.payInfo.OrderId = res.data.OrderId; that.payInfo.OrderId = res.data.OrderId;
that.payInfo.total_price = that.ds.total_price; that.payInfo.total_price = that.ds.total_price;
if(that.formdata.Use_Deposit_Id!=0 && that.ds.total_price ==0){//如果使用了储蓄卡 就直接支付成功 跳入支付结果 if (that.formdata.Use_Deposit_Id != 0 && that.ds.total_price == 0) { //如果使用了储蓄卡 就直接支付成功 跳入支付结果
uni.reLaunch({ uni.reLaunch({
url: '/pages/order-submit/pay-success?payInfo='+JSON.stringify(that.payInfo) url: '/pages/order-submit/pay-success?payInfo=' + JSON.stringify(that.payInfo)
}) })
}else{//没使用的话 就弹出支付页面 } else { //没使用的话 就弹出支付页面
that.payBtn = true; that.payBtn = true;
} }
} }
} else { } else {
that.$refs.uToast.show({ that.$refs.uToast.show({
title: res.data.message, title: res.data.message,
...@@ -481,7 +475,6 @@ ...@@ -481,7 +475,6 @@
uni.hideNavigationBarLoading(); uni.hideNavigationBarLoading();
} }
); );
} }
}); });
} }
...@@ -493,7 +486,7 @@ ...@@ -493,7 +486,7 @@
} }
this.showCoupon = false; this.showCoupon = false;
}, },
closecashcard(e){ closecashcard(e) {
if (e != -1) { if (e != -1) {
this.formdata.Use_Deposit_Id = e; this.formdata.Use_Deposit_Id = e;
this.init(); this.init();
...@@ -503,13 +496,12 @@ ...@@ -503,13 +496,12 @@
showCouponHandler() { showCouponHandler() {
this.showCoupon = true; this.showCoupon = true;
}, },
showcashcardbtn(){ showcashcardbtn() {
this.showcashcard = true; this.showcashcard = true;
}, },
initCoupon() { initCoupon() {
let ProductList = []; let ProductList = [];
this.DetailList = []; this.DetailList = [];
this.mchs.forEach(item => { this.mchs.forEach(item => {
item.goods_list.forEach(list => { item.goods_list.forEach(list => {
let obj = { let obj = {
...@@ -536,10 +528,10 @@ ...@@ -536,10 +528,10 @@
res => { res => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.couponList = res.data; this.couponList = res.data;
if(this.onecoupon == true){ if (this.onecoupon == true) {
this.onecoupon=false this.onecoupon = false
this.couponList.map(x=>{ this.couponList.map(x => {
if(x.isBest==1){//进去页面优先选择优惠券 if (x.isBest == 1) { //进去页面优先选择优惠券
this.formdata.User_Coupon_Id = x.id this.formdata.User_Coupon_Id = x.id
this.init() this.init()
return return
...@@ -563,7 +555,6 @@ ...@@ -563,7 +555,6 @@
}, },
changeSendTypeHandler(e) { changeSendTypeHandler(e) {
let i = e.index; let i = e.index;
let obj = this.mchs[i]; let obj = this.mchs[i];
obj.delivery.showDelivery = false; obj.delivery.showDelivery = false;
this.$set(this.mchs, i, obj); this.$set(this.mchs, i, obj);
...@@ -613,7 +604,6 @@ ...@@ -613,7 +604,6 @@
res => { res => {
this.loading = false; this.loading = false;
if (res.resultCode == 1) { if (res.resultCode == 1) {
console.log(res,'数据来了');
this.address = res.data.address; this.address = res.data.address;
this.address_enable = res.data.address_enable; this.address_enable = res.data.address_enable;
this.mchs = res.data.mch_list; this.mchs = res.data.mch_list;
...@@ -640,7 +630,6 @@ ...@@ -640,7 +630,6 @@
}; };
this.formatPrice(); this.formatPrice();
this.initCoupon(); this.initCoupon();
// this.formatAttr();
this.adressInfo = { this.adressInfo = {
Consignee: this.address.name, Consignee: this.address.name,
Mobile: this.address.mobile, Mobile: this.address.mobile,
...@@ -650,30 +639,34 @@ ...@@ -650,30 +639,34 @@
ShoppingAddress: this.address.detail ShoppingAddress: this.address.detail
}; };
} }
uni.hideNavigationBarLoading(); uni.hideNavigationBarLoading();
} }
); );
}, },
formatPrice() { formatPrice() {
this.mchs.forEach(x => { console.log("this.mchs", this.mchs);
x.delivery.showDelivery = false; if (this.mchs) {
x.delivery.send_type_list.forEach(y => { this.mchs.forEach(x => {
if (y.value == x.delivery.send_type) { x.delivery.showDelivery = false;
x.delivery.send_type_name = y.name; if (x.delivery.send_type_list && x.delivery.send_type_list.length > 0) {
x.delivery.send_type_list.forEach(y => {
if (y.value == x.delivery.send_type) {
x.delivery.send_type_name = y.name;
}
});
}
this.goodPrice += parseFloat(x.total_goods_price);
this.expressPrice += parseFloat(x.express_price);
this.couponPrice += parseFloat(x.coupon.coupon_discount || 0.0);
this.cashPrice += parseFloat(x.deposit.deposit_price || 0.0);
if (x.integral.can_use) {
this.integral.can_use = true;
this.integral.use = false;
this.integral.use_num += x.integral.use_num;
this.integral.deduction_price += parseFloat(x.integral.deduction_price);
} }
}); });
this.goodPrice += parseFloat(x.total_goods_price); }
this.expressPrice += parseFloat(x.express_price);
this.couponPrice += parseFloat(x.coupon.coupon_discount || 0.0);
this.cashPrice += parseFloat(x.deposit.deposit_price || 0.0);
if (x.integral.can_use) {
this.integral.can_use = true;
this.integral.use = false;
this.integral.use_num += x.integral.use_num;
this.integral.deduction_price += parseFloat(x.integral.deduction_price);
}
});
}, },
formatAttr() { formatAttr() {
this.mchs.forEach(x => { this.mchs.forEach(x => {
...@@ -691,7 +684,6 @@ ...@@ -691,7 +684,6 @@
}); });
}, },
checkboxChange(val) { checkboxChange(val) {
console.log(val)
if (val.value == true) { if (val.value == true) {
this.btntext = '找人代付' this.btntext = '找人代付'
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment