|
@@ -6,14 +6,22 @@
|
|
|
<image :src="i.cover_url" class="p_img" mode="aspectFill" />
|
|
<image :src="i.cover_url" class="p_img" mode="aspectFill" />
|
|
|
<div class="p_con">
|
|
<div class="p_con">
|
|
|
<div class="t">{{ i.product_name }}</div>
|
|
<div class="t">{{ i.product_name }}</div>
|
|
|
- <div class="p">{{ egralfun(i.official_price) }}</div>
|
|
|
|
|
- <div class="fp">官方价¥{{ $h.Div(i.official_price, 100) }}</div>
|
|
|
|
|
|
|
+ <div class="p" v-if="i.custom_price>0">{{ $h.Sub($h.Div(i.custom_price, 100), i.custom_integral) }}</div>
|
|
|
|
|
+ <div class="p" v-else>{{ egralfun(i.official_price) }}</div>
|
|
|
|
|
+ <div class="fp" v-if="i.custom_price>0">官方价¥{{ $h.Div(i.custom_price, 100) }}</div>
|
|
|
|
|
+ <div class="fp" v-else>官方价¥{{ $h.Div(i.official_price, 100) }}</div>
|
|
|
<span v-if="i.checked" class="colg iconfont"></span>
|
|
<span v-if="i.checked" class="colg iconfont"></span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="product_con">
|
|
<div class="product_con">
|
|
|
|
|
+ <div class="card">
|
|
|
|
|
+ <div class="li flex_r flex_jb">
|
|
|
|
|
+ <span>使用账号</span>
|
|
|
|
|
+ <input v-model="mobile" placeholder="请输入需要使用的账号" class="inp" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
<div class="card">
|
|
<div class="card">
|
|
|
<div class="li flex_r flex_jb">
|
|
<div class="li flex_r flex_jb">
|
|
|
<span>购买数量</span>
|
|
<span>购买数量</span>
|
|
@@ -26,7 +34,7 @@
|
|
|
<span>¥{{ cartTotal || 0 }}</span>
|
|
<span>¥{{ cartTotal || 0 }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="li flex_r flex_jb">
|
|
<div class="li flex_r flex_jb">
|
|
|
- <span>消费金抵扣<span class="corg">{{Integral}}%</span></span>
|
|
|
|
|
|
|
+ <span>消费金抵扣<span class="corg" v-if="selectitem.custom_price==0">{{Integral}}%</span></span>
|
|
|
<span class="corg">-¥{{ deduction || 0 }}</span>
|
|
<span class="corg">-¥{{ deduction || 0 }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="li flex_r flex_jb">
|
|
<div class="li flex_r flex_jb">
|
|
@@ -67,6 +75,7 @@ export default {
|
|
|
actuallypaid: 0,
|
|
actuallypaid: 0,
|
|
|
chabao: 0,
|
|
chabao: 0,
|
|
|
stock_num: 1,
|
|
stock_num: 1,
|
|
|
|
|
+ mobile: uni.getStorageSync("userinfo").mobile,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -91,6 +100,14 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ // 获取产品详情
|
|
|
|
|
+ getproductInfo(va){
|
|
|
|
|
+ post("local/coupon/productInfo", { product_no: va, type: 0 }).then(res => {
|
|
|
|
|
+ if (res.code == 0 && res.data.code == 200) {
|
|
|
|
|
+ this.stock_num = res.data.data.stock_num;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
ontag(key) {
|
|
ontag(key) {
|
|
|
let da = this.products;
|
|
let da = this.products;
|
|
|
da.forEach(value => this.$set(value, 'checked', false));
|
|
da.forEach(value => this.$set(value, 'checked', false));
|
|
@@ -100,11 +117,16 @@ export default {
|
|
|
this.getproductInfo(da[key].product_no);
|
|
this.getproductInfo(da[key].product_no);
|
|
|
},
|
|
},
|
|
|
egralf() {
|
|
egralf() {
|
|
|
- let i1 = this.egral.integral,
|
|
|
|
|
- i2 = this.egral.chabao;
|
|
|
|
|
|
|
+ let i1 = this.egral.integral, i2 = this.egral.chabao;
|
|
|
this.Integral = this.$h.Mul(i1, 100);
|
|
this.Integral = this.$h.Mul(i1, 100);
|
|
|
- this.cartTotal = this.$h.Mul(this.$h.Div(this.selectitem.official_price, 100), this.count)
|
|
|
|
|
- this.deduction = this.$h.Mul(this.cartTotal, i1);
|
|
|
|
|
|
|
+ if(this.selectitem.custom_price > 0){
|
|
|
|
|
+ this.cartTotal = this.$h.Mul(this.$h.Div(this.selectitem.custom_price, 100), this.count)
|
|
|
|
|
+ this.deduction = this.$h.Mul(this.selectitem.custom_integral, this.count);
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ this.cartTotal = this.$h.Mul(this.$h.Div(this.selectitem.official_price, 100), this.count)
|
|
|
|
|
+ this.deduction = this.$h.Mul(this.cartTotal, i1);
|
|
|
|
|
+ }
|
|
|
this.actuallypaid = this.$h.Sub(this.cartTotal, this.deduction);
|
|
this.actuallypaid = this.$h.Sub(this.cartTotal, this.deduction);
|
|
|
this.chabao = this.$h.Mul(this.actuallypaid, i2);
|
|
this.chabao = this.$h.Mul(this.actuallypaid, i2);
|
|
|
},
|
|
},
|
|
@@ -116,7 +138,7 @@ export default {
|
|
|
let da = {
|
|
let da = {
|
|
|
type: 3,
|
|
type: 3,
|
|
|
count: this.count,
|
|
count: this.count,
|
|
|
- phone: uni.getStorageSync("userinfo").mobile,
|
|
|
|
|
|
|
+ phone: this.mobile,
|
|
|
product_no: this.selectitem.product_no,
|
|
product_no: this.selectitem.product_no,
|
|
|
}
|
|
}
|
|
|
post("local/coupon/addOrder", da).then(res => {
|
|
post("local/coupon/addOrder", da).then(res => {
|
|
@@ -131,14 +153,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- },
|
|
|
|
|
- // 获取产品详情
|
|
|
|
|
- getproductInfo(va){
|
|
|
|
|
- post("local/coupon/productInfo", { product_no: va, type: 0 }).then(res => {
|
|
|
|
|
- if (res.code == 0 && res.data.code == 200) {
|
|
|
|
|
- this.stock_num = res.data.data.stock_num;
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -250,6 +264,9 @@ export default {
|
|
|
|
|
|
|
|
.product_con {
|
|
.product_con {
|
|
|
padding: 28rpx 30rpx;
|
|
padding: 28rpx 30rpx;
|
|
|
|
|
+ .inp{
|
|
|
|
|
+ text-align: right;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.money {
|
|
.money {
|