复读价格问题
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
v-for="(v, i) in goodsDataList"
|
||||
>
|
||||
<span
|
||||
v-if="v.isVipPrice == 1 && v.vipPrice != 0 && v.vipPrice != null"
|
||||
v-if="v.isVipPrice == 1 && v.vipPrice != 0 && v.vipPrice != null&&!options.isFudu"
|
||||
style="
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
@@ -84,38 +84,11 @@
|
||||
style="justify-content: space-between; position: relative"
|
||||
>
|
||||
<view class="curriulum_title">{{ v.productName }} </view>
|
||||
<!-- <view
|
||||
style="
|
||||
width: 120rpx !important;
|
||||
text-align: right;
|
||||
padding-top: 10rpx;
|
||||
"
|
||||
class=" "
|
||||
>
|
||||
<view class="">
|
||||
¥{{
|
||||
v.activityPrice && v.activityPrice > 0
|
||||
? v.activityPrice
|
||||
: v.price
|
||||
}}
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view
|
||||
v-if="v.activityPrice > 0 && v.activityPrice < v.price"
|
||||
style="
|
||||
position: absolute;
|
||||
right: 0rpx;
|
||||
top: 45rpx;
|
||||
color: #999;
|
||||
text-decoration: line-through;
|
||||
font-size: 24rpx;
|
||||
"
|
||||
>原价:¥{{ v.price }}</view> -->
|
||||
</view>
|
||||
<view>
|
||||
<text
|
||||
v-if="
|
||||
v.isVipPrice == 1 && v.vipPrice != 0 && v.vipPrice != null
|
||||
v.isVipPrice == 1 && v.vipPrice != 0 && v.vipPrice != null&&!options.isFudu
|
||||
"
|
||||
>
|
||||
<text style="color: #e97512; font-size: 12px; font-weight: bold"
|
||||
@@ -136,7 +109,7 @@
|
||||
>
|
||||
</text>
|
||||
|
||||
<text v-else-if="v.activityPrice && v.activityPrice > 0">
|
||||
<text v-else-if="v.activityPrice && v.activityPrice > 0&&!options.isFudu">
|
||||
<text style="color: #e97512; font-size: 12px; font-weight: bold"
|
||||
>¥{{ v.activityPrice.toFixed(2) }}</text
|
||||
>
|
||||
@@ -823,68 +796,96 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getGoodsList() {
|
||||
this.$http
|
||||
.request({
|
||||
// url: "book/buyOrder/calculateTransportPrice/",
|
||||
url: "/book/buyOrder/getShopProductListByIds",
|
||||
// url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
productIds: this.options.goods.map((e) => e.productId).toString(),
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
this.goodsDataList = res.shopProductList;
|
||||
console.log("this.goodsDataList at line 780:", this.goodsDataList);
|
||||
await this.getVipFei();
|
||||
await this.getDistrictAmount();
|
||||
await this.getActiveCouponList();
|
||||
var list = [...this.goodsDataList];
|
||||
list = list.map((e) => e.goodsType);
|
||||
this.haveCourse = list.some((ele) => ele === "05");
|
||||
|
||||
if (this.options.sourceType == "curriculum") {
|
||||
this.goToInfo = {
|
||||
url: "/pages/curriculum/order/index/index",
|
||||
type: 2,
|
||||
};
|
||||
} else {
|
||||
this.goToInfo = {
|
||||
url: "/pages/bookShop/orderList",
|
||||
type: 1,
|
||||
};
|
||||
}
|
||||
this.initPrepareOrder();
|
||||
});
|
||||
//判断复读逻辑
|
||||
if(this.options.isFudu){
|
||||
this.$http
|
||||
.request({
|
||||
url: "/common/courseRelearn/relearnShopProductList",
|
||||
method: "POST",
|
||||
data: {
|
||||
catalogueId: this.options.fuduId
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
this.goodsDataList =res.productList.filter((e)=>this.options.goods[0].productName == e.productName);
|
||||
// await this.getVipFei();
|
||||
// await this.getDistrictAmount();
|
||||
await this.getActiveCouponList();
|
||||
var list = [...this.goodsDataList];
|
||||
list = list.map((e) => e.goodsType);
|
||||
this.haveCourse = list.some((ele) => ele === "05");
|
||||
|
||||
if (this.options.sourceType == "curriculum") {
|
||||
this.goToInfo = {
|
||||
url: "/pages/curriculum/order/index/index",
|
||||
type: 2,
|
||||
};
|
||||
} else {
|
||||
this.goToInfo = {
|
||||
url: "/pages/bookShop/orderList",
|
||||
type: 1,
|
||||
};
|
||||
}
|
||||
this.initPrepareOrder();
|
||||
});
|
||||
}else{
|
||||
this.$http
|
||||
.request({
|
||||
url: "/book/buyOrder/getShopProductListByIds",
|
||||
method: "POST",
|
||||
data: {
|
||||
productIds: this.options.goods.map((e) => e.productId).toString(),
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
this.goodsDataList = res.shopProductList;
|
||||
console.log("this.goodsDataList at line 780:", this.goodsDataList);
|
||||
await this.getVipFei();
|
||||
await this.getDistrictAmount();
|
||||
await this.getActiveCouponList();
|
||||
var list = [...this.goodsDataList];
|
||||
list = list.map((e) => e.goodsType);
|
||||
this.haveCourse = list.some((ele) => ele === "05");
|
||||
|
||||
if (this.options.sourceType == "curriculum") {
|
||||
this.goToInfo = {
|
||||
url: "/pages/curriculum/order/index/index",
|
||||
type: 2,
|
||||
};
|
||||
} else {
|
||||
this.goToInfo = {
|
||||
url: "/pages/bookShop/orderList",
|
||||
type: 1,
|
||||
};
|
||||
}
|
||||
this.initPrepareOrder();
|
||||
});
|
||||
}
|
||||
},
|
||||
async getVipFei() {
|
||||
let key = [];
|
||||
let dataToString = "";
|
||||
// console.log(this.adressMoRen, '默认地址')
|
||||
this.goodsDataList.forEach((item, index) => {
|
||||
key.push({
|
||||
productId: item.productId,
|
||||
quantity: this.orderNumber,
|
||||
});
|
||||
// dataToString = dataToString.concat(item.productId+"="+item.productAmount+"&")
|
||||
});
|
||||
// console.log(key,'this.adressMoRen.areaidpath')
|
||||
|
||||
await $http
|
||||
.request({
|
||||
// url: "book/buyOrder/calculateTransportPrice/",
|
||||
url: "/book/buyOrder/getVipDiscountAmount",
|
||||
// url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
productList: key,
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
@@ -892,7 +893,6 @@ export default {
|
||||
if (res.code == 0) {
|
||||
console.log("res.code at line 538:", res);
|
||||
this.vipPrice = res.discountAmount;
|
||||
// console.log('需要的运费', res.result)
|
||||
await this.getTotalPrice();
|
||||
}
|
||||
});
|
||||
@@ -949,14 +949,6 @@ export default {
|
||||
},
|
||||
// 查询商品可用优惠券
|
||||
async getActiveCouponList() {
|
||||
// if (this.goodsDataList.length <= 0) {
|
||||
// uni.showToast({
|
||||
// title: "商品参数错误,无法获取优惠券",
|
||||
// icon: "none",
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
|
||||
var list = [];
|
||||
this.goodsDataList.forEach((e) => {
|
||||
var str = `${e.productId}:${
|
||||
@@ -1124,7 +1116,7 @@ export default {
|
||||
}
|
||||
if (
|
||||
this.goodsDataList[0].activityPrice &&
|
||||
this.goodsDataList[0].activityPrice > 0
|
||||
this.goodsDataList[0].activityPrice > 0 &&!this.options.isFudu
|
||||
) {
|
||||
this.priceBreakdownList.push({
|
||||
text: "活动立减",
|
||||
@@ -1135,7 +1127,7 @@ export default {
|
||||
if (
|
||||
this.goodsDataList[0].isVipPrice &&
|
||||
this.goodsDataList[0].vipPrice &&
|
||||
this.goodsDataList[0].vipPrice > 0
|
||||
this.goodsDataList[0].vipPrice > 0 &&!this.options.isFudu
|
||||
) {
|
||||
this.priceBreakdownList.push({
|
||||
text: "VIP专享立减",
|
||||
@@ -1289,11 +1281,7 @@ export default {
|
||||
var s = 0;
|
||||
var that = this;
|
||||
for (var i = this.goodsDataList.length - 1; i >= 0; i--) {
|
||||
s +=
|
||||
// this.goodsDataList[i].activityPrice &&
|
||||
// this.goodsDataList[i].activityPrice > 0
|
||||
// ? this.goodsDataList[i].activityPrice
|
||||
this.goodsDataList[i].price;
|
||||
s += this.goodsDataList[i].price;
|
||||
}
|
||||
that.totalPrice = s * this.orderNumber;
|
||||
var couponAmount = 0;
|
||||
|
||||
Reference in New Issue
Block a user