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

页面修改

parent 1abbd1fe
......@@ -7,37 +7,16 @@
<view class="chosen-info">
<view class="price" :style="{ color: mc }">
<text class="small"></text>
<!-- <text v-show="notes">{{ goodprice2 }}</text> -->
<text>{{ goodprice }}</text>
</view>
<!-- <view class="amount">{{g.form_id ==1?'余位':'库存'}} {{ goodamount }} {{ g.unit }}</view> -->
<!-- <view class="sku">{{ skuObj ? '已选择' : '选择' }} {{ sku }}</view> -->
<view class="amount amount2">可报名额 {{ goodamount }}</view>
<view class="sku_close">
<u-icon name="cross" color="#9F9F9F" @click="cloGood()" size="40" />
</view>
</view>
</view>
<!-- <scroll-view scroll-y class="sku-box">
<view class="sku-item" v-for="(x, i) in g.attr_groups" :key="i">
<view class="sku-title">{{ x.attr_group_name }}</view>
<view>
<view class="sku-chi" :style="{
background: y.attr_id == x.checkId ? mc : '#eee',
color: y.attr_id == x.checkId ? '#FFF' : '#333'
}" :class="{ disable: notStockGood.indexOf(y.attr_id) != -1 }" v-for="(y, yi) in x.attr_list" :key="yi"
@click="clickSkuItemHandler(yi, i)">
<image :src="y.pic_url" class="img" v-if="i == 0 && y.pic_url"></image>
<text class="val">{{ y.attr_name }}</text>
</view>
</view>
</view>
</scroll-view> -->
<view class="count-box">
<text class="label">数量</text>
<!-- :max="goodamount" -->
<!-- <u-number-box :disabled="!skuObj" v-model="gc" :min="1" :max="g.attr_groups[0].service_time"
@change="valChange"></u-number-box> -->
</view>
<view class="sku-chi2" :style="{
background: y.attr_id == x.checkId ? mc : '#eee',
......@@ -46,27 +25,20 @@
<text class="val2">{{g.attr_groups[0].service_time}}</text>
</view>
<view class="count-box" v-show="g.goodsRelevanceList.length>0">
<text >
<text>
<text class="label2">物品</text>
<text class="label3">
说明:以下物品需与当前课程绑定购买
</text>
</text>
<!-- :max="goodamount" -->
<!-- <u-number-box :disabled="!skuObj" v-model="gc" :min="1" :max="g.attr_groups[0].service_time"
@change="valChange"></u-number-box> -->
</view>
<!-- 是否购买讲义 -->
<!-- <view v-show="g.goodsRelevanceList.length>0">
<u-checkbox-group @change="checkboxChange">
<u-checkbox v-model="checkboxValue1" shape="circle" v-for="(item, index) in checkboxList1"
:key="index" :label="item.name" :name="item.name">{{ item.name}}</u-checkbox>
</u-checkbox-group>
</view> -->
<view class="val3 sku-chi2" :style="{
background: y.attr_id == x.checkId ? mc : '#eee',
color: y.attr_id == x.checkId ? '#FFF' : '#333'
}" v-if="notes" v-for="(item, index) in g.goodsRelevanceList" :key="index">
}"
v-if="notes" v-for="(item, index) in g.goodsRelevanceList" :key="index">
<text>{{item.RelevanceName}}</text>
<text></text>
<text>{{item.RelevancePrice}}</text>
......@@ -215,8 +187,6 @@
res => {
this.g = res.data.goods;
this.g.totalStock = 0;
// console.log("进入新的",this.g.attr_groups[0].service_time);
this.g.attr.forEach(x => {
this.g.totalStock += x.stock
})
......@@ -225,59 +195,27 @@
this.fu = this.$uiConfig.secondary;
this.secondary = this.$uiConfig.secondary;
this.skuObj = this.skued.id ? this.skued : null;
console.log("this.skuObj", this.skuObj);
if (this.skuObj) {
this.goodimage = this.skuObj.pic_url || this.g.cover_pic;
// this.goodprice = (parseFloat(this.skuObj.price) * 1).toFixed(2);
this.goodamount = this.skuObj.stock;
// 新增讲义
if (this.notes) {
this.$nextTick(() => {
var tempGoodprice = (parseFloat(this.skuObj.price) * parseFloat(this.g.attr_groups[0].service_time)).toFixed(2);
if (this.g.goodsRelevanceList && this.g.goodsRelevanceList.length > 0) {
this.g.goodsRelevanceList.forEach(item => {
this.goodprice = (parseFloat(this.skuObj.price) * parseFloat(this.g.attr_groups[0].service_time) + parseFloat(
item
.RelevancePrice)).toFixed(2);
})
});
} else {
this.$nextTick(() => {
this.goodprice = (parseFloat(this.skuObj.price) * parseFloat(this.g.attr_groups[0].service_time)).toFixed(2);
tempGoodprice += parseFloat(item.RelevancePrice).toFixed(2)
});
}
this.goodprice = tempGoodprice
} else {
this.goodimage = this.g.cover_pic;
// this.goodprice = this.g.price_min && this.g.price_min != '' ? this.g.price_min : this.g
// .price_content;
// 新增讲义
if (this.notes) {
this.$nextTick(() => {
var tempGoodprice = (parseFloat(this.g.price) * parseFloat(this.g.attr_groups[0].service_time)).toFixed(2);
if (this.g.goodsRelevanceList && this.g.goodsRelevanceList.length > 0) {
this.g.goodsRelevanceList.forEach(item => {
// this.goodprice2 =(parseFloat(this.goodprice)+parseFloat(item.RelevancePrice)).toFixed(2);
this.goodprice = this.g.price_min && this.g.price_min != '' ? (
parseFloat(
this.g.price_min)* parseFloat(this.g.attr_groups[0].service_time) + parseFloat(item.RelevancePrice))
.toFixed(2) :
(parseFloat(this.g.price_content) * parseFloat(this.g.attr_groups[0].service_time)+ parseFloat(item
.RelevancePrice))
.toFixed(2)
tempGoodprice += parseFloat(item.RelevancePrice).toFixed(2);
})
console.log('22222222222222222222', this.goodprice)
});
// this.goodprice2 =parseFloat(this.goodprice)+parseFloat(this.g.goodsRelevanceList[0].RelevancePrice)
} else {
this.$nextTick(() => {
this.goodprice = this.g.price_min && this.g.price_min != '' ?parseFloat(this.g
.price_min) * parseFloat(this.g.attr_groups[0].service_time) : parseFloat(this.g
.price_content)* parseFloat(this.g.attr_groups[0].service_time);
});
}
this.goodprice=tempGoodprice;
this.goodamount = this.g.goods_stock;
}
this.bian = this.$utils.is_biang;
this.btn1.background = this.secondary;
......@@ -290,7 +228,6 @@
if (this.g.attr_groups && this.g.attr_groups.length > 0) {
this.g.attr_groups.forEach(x => {
if (!this.skuObj) {
//(x.checkId = 0), (x.checkName = x.attr_group_name);
(x.checkId = 0), (x.checkName = x.attr_list[0].attr_name);
x.checkId = x.attr_list[0].attr_id;
} else {
......@@ -307,31 +244,10 @@
this.getfu()
this.formatDisableSku();
this.formatChosenTips();
}
);
// this.g = this.good;
});
},
methods: {
// checkboxChange(n) {
// this.notes = !this.notes
// if (!this.notes) {
// this.g.goodsRelevanceList.forEach(item => {
// this.goodprice = (parseFloat(this.goodprice) - parseFloat(item
// .RelevancePrice)).toFixed(2);
// })
// // this.goodprice = this.goodprice+this.g.goodsRelevanceList[0].RelevancePrice
// } else {
// this.g.goodsRelevanceList.forEach(item => {
// this.goodprice = (parseFloat(this.goodprice) + parseFloat(item
// .RelevancePrice)).toFixed(2);
// })
// }
// // if(n.length>0) {
// // this.goodprice = this.goodprice+this.g.goodsRelevanceList[0].RelevancePrice
// // }
// },
getfu() {
let fucolor = this.colorRgb(this.fu);
var RgbValue = fucolor.replace("rgb(", "").replace(")", "");
var RgbValueArry = RgbValue.split(",");
......@@ -342,7 +258,6 @@
} else {
this.btn1.color = '#FFF';
}
},
colorRgb(color) {
var sColor = color.toLowerCase();
......@@ -367,14 +282,21 @@
return sColor;
},
joinCar() {
console.log("商品信息", this.g);
if (this.skuObj && this.skuObj.id) {
this.request2({
url: '/api/AppletOrder/SetGoodsShoppingCartInfo',
data: {
var postMsg = {
GoodsId: this.skuObj.goods_id,
SpecificationSort: this.skuObj.sign_id,
Number: this.gc == 0 ? 1 : this.gc
Number: this.gc == 0 ? 1 : this.gc,
RelationId: 0, //关联讲义编号
};
//有讲义的添加讲义
if (this.g && this.g.goodsRelevanceList && this.g.goodsRelevanceList.length > 0) {
postMsg.RelationId = this.g.goodsRelevanceList[0].RelevanceId;
}
this.request2({
url: '/api/AppletOrder/SetGoodsShoppingCartInfo',
data: postMsg
},
res => {
uni.showToast({
......@@ -486,7 +408,6 @@
let chosen = '';
if (this.g.attr_groups && this.g.attr_groups.length > 0) {
this.g.attr_groups.forEach(x => {
// if (x.checkId != 0) {
if (x.checkId != -1) {
chosen += (chosen == '' ? '' : ',') + x.checkName;
} else {
......@@ -499,7 +420,8 @@
this.sku = unchosen;
this.skuObj = null;
this.goodimage = this.g.cover_pic;
this.goodprice = this.g.price_min && this.g.price_min != '' ? parseFloat(this.g.price_min)* parseFloat(this.g.attr_groups[0].service_time) : parseFloat(this.g.price_content)* parseFloat(this.g.attr_groups[0].service_time);
this.goodprice = this.g.price_min && this.g.price_min != '' ? parseFloat(this.g.price_min) * parseFloat(this.g.attr_groups[
0].service_time) : parseFloat(this.g.price_content) * parseFloat(this.g.attr_groups[0].service_time);
this.goodamount = this.g.goods_stock;
} else {
this.sku = chosen;
......@@ -514,7 +436,6 @@
sign.push(`${x.checkId}`);
}
});
if (sign.length == this.g.attr_groups.length - 1) {
this.formatDisable(sign);
} else if (sign.length == this.g.attr_groups.length) {
......@@ -572,7 +493,6 @@
if (this.skuObj != null) {
this.goodimage = this.skuObj.pic_url || this.g.cover_pic;
// this.goodprice = (parseFloat(this.skuObj.price) * parseFloat(this.gc)).toFixed(2);
this.goodprice = (parseFloat(this.skuObj.price) * parseFloat(this.g.attr_groups[0].service_time)).toFixed(2);
this.goodamount = this.skuObj.stock;
}
......@@ -585,29 +505,20 @@
valChange(e) {
this.gc = e.value;
if (this.skuObj) {
// this.goodprice = (parseFloat(this.skuObj.price) * parseFloat(this.gc)).toFixed(2);
this.goodprice = (parseFloat(this.skuObj.price) * parseFloat(this.g.attr_groups[0].service_time)).toFixed(2);
if (this.notes) {
this.$nextTick(() => {
this.g.goodsRelevanceList.forEach(item => {
// this.goodprice = (parseFloat(this.skuObj.price) * parseFloat(this.gc) +
// parseFloat(item.RelevancePrice)).toFixed(2);
// this.goodprice = (parseFloat(this.goodprice) + parseFloat(item.RelevancePrice))
// .toFixed(2);
this.goodprice = (parseFloat(this.skuObj.price) * parseFloat(this.g.attr_groups[0].service_time) +
parseFloat(item.RelevancePrice)).toFixed(2);
})
})
} else {
this.$nextTick(() => {
// this.goodprice = (parseFloat(this.skuObj.price) * parseFloat(this.gc)).toFixed(2);
this.goodprice = (parseFloat(this.skuObj.price) * parseFloat(this.g.attr_groups[0].service_time)).toFixed(2);
})
}
}
},
previewImage(index, images) {
images = [images]
......@@ -709,7 +620,8 @@
margin-right: 10px;
font-size: 13px;
}
.sku-chi2{
.sku-chi2 {
background: #eee;
border-radius: 3px;
padding: 3px;
......@@ -720,6 +632,7 @@
margin-right: 10px;
font-size: 13px;
}
.goodsku .sku-box .sku-item .sku-chi.disable {
background: #eee !important;
color: #ddd !important;
......@@ -731,18 +644,21 @@
line-height: 24px;
padding: 0 7px;
}
.val2{
.val2 {
/* width: 1px; */
height: 24px;
line-height: 24px;
padding: 0 7px;
}
.val3{
.val3 {
/* width: 1px; */
height: 24px;
line-height: 24px;
padding: 0 26rpx;
}
.goodsku .sku-box .sku-item .sku-chi .img {
width: 24px;
height: 24px;
......@@ -762,19 +678,22 @@
width: 1px;
flex: 1;
}
.label2{
.label2 {
font-size: 14px;
color: #333;
width: 1px;
flex: 1;
}
.label3{
.label3 {
font-size: 20rpx;
color: #333;
width: 1px;
flex: 1;
margin-left: 10rpx;
}
.goodsku .btn-box {
display: flex;
background: #fff;
......
......@@ -203,8 +203,7 @@
</u-button>
</view>
</view>
<coupon v-if="couponList.length > 0 && showCoupon" :list="couponList" :current="formdata.User_Coupon_Id"
@close="closeCouponHandler"></coupon>
<coupon v-if="couponList.length > 0 && showCoupon" :list="couponList" :current="formdata.User_Coupon_Id" @close="closeCouponHandler"></coupon>
<cashCard v-if="cashCardList.length > 0 && showcashcard" :list="cashCardList" :current="formdata.Use_Deposit_Id"
@close="closecashcard"></cashCard>
......@@ -256,7 +255,7 @@
import payCom from '@/components/pay/pay';
import peisong from '@/components/peisong/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';
export default {
components: {
......@@ -301,7 +300,7 @@
expressPrice: 0.0,
goodPrice: 0.0,
couponPrice: 0.0,
cashPrice:0.0,
cashPrice: 0.0,
integral: {
can_use: false,
use: false,
......@@ -331,11 +330,11 @@
BuyerMessage: '',
showReviceModal: false,
//抵扣金额
deduction_commission:0,
cashCardList:[],
showcashcard:false,
onecoupon:true,//第一次进页面的时候选最优的优惠券
IsDeposit:0,//是否开启储蓄卡功能
deduction_commission: 0,
cashCardList: [],
showcashcard: false,
onecoupon: true, //第一次进页面的时候选最优的优惠券
IsDeposit: 0, //是否开启储蓄卡功能
};
},
onLoad(option) {
......@@ -345,7 +344,7 @@
if (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) {
this.IsFormShoppingCart = option.IsFormShoppingCart;
......@@ -354,7 +353,7 @@
this.ShoppingCartIdList = JSON.parse(option.ShoppingCartIdList);
}
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.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
......@@ -424,8 +423,8 @@
form.DetailList = that.DetailList;
form.User_Coupon_Id = that.formdata.User_Coupon_Id;
form.Use_Deposit_Id = that.formdata.Use_Deposit_Id;
form.DepositMoney = that.cashPrice;//储蓄卡抵扣金额
form.DepositFreightMoney = that.expressPrice;//储蓄卡抵扣运费
form.DepositMoney = that.cashPrice; //储蓄卡抵扣金额
form.DepositFreightMoney = that.expressPrice; //储蓄卡抵扣运费
form.CouponMoney = that.couponPrice;
form.FreightMoney = that.expressPrice;
form.Income = that.ds.total_price;
......@@ -434,7 +433,7 @@
form.Use_Integral = that.formdata.Use_Integral;
form.ShoppingCartIdList = that.ShoppingCartIdList;
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;
}
form.DeductionCommission = that.deduction_commission;
......@@ -446,7 +445,6 @@
if (res.resultCode == 1) {
if (that.checked == true) {
that.zhaoren = true;
let u = uni.getStorageSync("mall_UserInfo");
let uid = u.UserId ? u.UserId : 0;
let Up = u.UserPageType ? u.UserPageType : 0;
......@@ -457,21 +455,17 @@
}
that.path = '/pages/index/index?OrderId=' + res.data.OrderId + "&user_id=" + uid + "&Up=" + Up +
"&SmallShopId=" + SmallShopId + '&JumpType=4';
console.log(that.path)
} else {
that.payInfo.OrderId = res.data.OrderId;
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({
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;
}
}
} else {
that.$refs.uToast.show({
title: res.data.message,
......@@ -481,7 +475,6 @@
uni.hideNavigationBarLoading();
}
);
}
});
}
......@@ -493,7 +486,7 @@
}
this.showCoupon = false;
},
closecashcard(e){
closecashcard(e) {
if (e != -1) {
this.formdata.Use_Deposit_Id = e;
this.init();
......@@ -503,13 +496,12 @@
showCouponHandler() {
this.showCoupon = true;
},
showcashcardbtn(){
showcashcardbtn() {
this.showcashcard = true;
},
initCoupon() {
let ProductList = [];
this.DetailList = [];
this.mchs.forEach(item => {
item.goods_list.forEach(list => {
let obj = {
......@@ -536,10 +528,10 @@
res => {
if (res.resultCode == 1) {
this.couponList = res.data;
if(this.onecoupon == true){
this.onecoupon=false
this.couponList.map(x=>{
if(x.isBest==1){//进去页面优先选择优惠券
if (this.onecoupon == true) {
this.onecoupon = false
this.couponList.map(x => {
if (x.isBest == 1) { //进去页面优先选择优惠券
this.formdata.User_Coupon_Id = x.id
this.init()
return
......@@ -563,7 +555,6 @@
},
changeSendTypeHandler(e) {
let i = e.index;
let obj = this.mchs[i];
obj.delivery.showDelivery = false;
this.$set(this.mchs, i, obj);
......@@ -613,7 +604,6 @@
res => {
this.loading = false;
if (res.resultCode == 1) {
console.log(res,'数据来了');
this.address = res.data.address;
this.address_enable = res.data.address_enable;
this.mchs = res.data.mch_list;
......@@ -640,7 +630,6 @@
};
this.formatPrice();
this.initCoupon();
// this.formatAttr();
this.adressInfo = {
Consignee: this.address.name,
Mobile: this.address.mobile,
......@@ -650,19 +639,22 @@
ShoppingAddress: this.address.detail
};
}
uni.hideNavigationBarLoading();
}
);
},
formatPrice() {
console.log("this.mchs", this.mchs);
if (this.mchs) {
this.mchs.forEach(x => {
x.delivery.showDelivery = false;
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);
......@@ -674,6 +666,7 @@
this.integral.deduction_price += parseFloat(x.integral.deduction_price);
}
});
}
},
formatAttr() {
this.mchs.forEach(x => {
......@@ -691,7 +684,6 @@
});
},
checkboxChange(val) {
console.log(val)
if (val.value == true) {
this.btntext = '找人代付'
} 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