[200~1.兼容中国台湾、中国香港手机号码
This commit is contained in:
@@ -59,7 +59,8 @@
|
||||
<slot name="goodsInfoPriceSlot" :row="v" :rowIndex="i"></slot>
|
||||
|
||||
<u-number-box
|
||||
v-model="orderNumber"
|
||||
v-model="v.productAmount"
|
||||
@change="valChange($event, v)"
|
||||
style="float: right"
|
||||
v-if="showNumber"
|
||||
>
|
||||
@@ -70,13 +71,13 @@
|
||||
slot="input"
|
||||
style="width: auto; text-align: center; border: none"
|
||||
class="input"
|
||||
>{{ orderNumber }}</text
|
||||
>{{ v.productAmount }}</text
|
||||
>
|
||||
<view slot="plus" class="plus">
|
||||
<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
|
||||
</view>
|
||||
</u-number-box>
|
||||
<text v-else style="float: right"> X {{ orderNumber }}</text>
|
||||
<text v-else style="float: right"> X {{ v.productAmount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -576,9 +577,6 @@
|
||||
if (this.orderNumber >= 1) {
|
||||
this.$nextTick(async () => {
|
||||
await this.getGoodsList();
|
||||
// await this.getVipFei();
|
||||
// await this.getDistrictAmount();
|
||||
// await this.getActiveCouponList();
|
||||
});
|
||||
}
|
||||
this.$forceUpdate();
|
||||
@@ -810,33 +808,31 @@
|
||||
this.xieyiShow = true;
|
||||
},
|
||||
async getGoodsList() {
|
||||
//获取商品信息
|
||||
// await this.getGoodsDataInfo();
|
||||
await this.initPrepareOrder();
|
||||
this.$nextTick(async () => {
|
||||
if (this.pageType == "vip") {
|
||||
await this.getTotalPrice();
|
||||
} else {
|
||||
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/course/myCourse",
|
||||
type: 2,
|
||||
};
|
||||
} else {
|
||||
this.goToInfo = {
|
||||
url: "/pages/bookShop/orderList",
|
||||
type: 1,
|
||||
};
|
||||
}
|
||||
});
|
||||
//获取商品信息
|
||||
await this.initPrepareOrder();
|
||||
|
||||
if (this.pageType == "vip") {
|
||||
await this.getTotalPrice();
|
||||
} else {
|
||||
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/course/myCourse",
|
||||
type: 2,
|
||||
};
|
||||
} else {
|
||||
this.goToInfo = {
|
||||
url: "/pages/bookShop/orderList",
|
||||
type: 1,
|
||||
};
|
||||
}
|
||||
},
|
||||
async getVipFei() {
|
||||
let key = [];
|
||||
@@ -844,14 +840,14 @@
|
||||
this.goodsDataList.forEach((item, index) => {
|
||||
key.push({
|
||||
productId: item.productId,
|
||||
quantity: this.orderNumber,
|
||||
quantity: item.productAmount
|
||||
});
|
||||
});
|
||||
|
||||
await $http
|
||||
.request({
|
||||
url: "/book/buyOrder/getVipDiscountAmount",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
method: "POST",
|
||||
data: {
|
||||
productList: key,
|
||||
},
|
||||
@@ -861,7 +857,7 @@
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (res.code == 0) {
|
||||
console.log("res.code at line 538:", res);
|
||||
console.log("getVipDiscountAmount---------:", res);
|
||||
this.vipPrice = res.discountAmount;
|
||||
await this.getTotalPrice();
|
||||
}
|
||||
@@ -874,31 +870,24 @@
|
||||
this.goodsDataList.forEach((item, index) => {
|
||||
key.push({
|
||||
productId: item.productId,
|
||||
quantity: this.orderNumber,
|
||||
quantity: item.productAmount
|
||||
});
|
||||
// dataToString = dataToString.concat(item.productId+"="+item.productAmount+"&")
|
||||
});
|
||||
console.log(key, "this.adressMoRen.areaidpath");
|
||||
|
||||
await $http
|
||||
.request({
|
||||
// url: "book/buyOrder/calculateTransportPrice/",
|
||||
url: "/book/buyOrder/getDistrictAmount",
|
||||
// url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
method: "POST",
|
||||
data: {
|
||||
productList: key,
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (res.code == 0) {
|
||||
console.log("res.code at line 538111111111111111:", res);
|
||||
this.districtAmount = res.districtAmount;
|
||||
// console.log('需要的运费', res.result)
|
||||
await this.getTotalPrice();
|
||||
}
|
||||
});
|
||||
@@ -923,7 +912,7 @@
|
||||
this.goodsDataList.forEach((e) => {
|
||||
var str = `${e.productId}:${
|
||||
e.activityPrice > 0 ? e.activityPrice : e[this.priceKey]
|
||||
}:${this.orderNumber}`;
|
||||
}:${e.productAmount}`;
|
||||
list.push(str);
|
||||
});
|
||||
|
||||
@@ -1061,6 +1050,32 @@
|
||||
this.$forceUpdate();
|
||||
});
|
||||
},
|
||||
//修改数量
|
||||
valChange(e, item) {
|
||||
let productItem = {};
|
||||
productItem = item;
|
||||
productItem.productAmount = e.value;
|
||||
this.updateCart(productItem);
|
||||
this.$nextTick(async () => {
|
||||
await this.getGoodsList();
|
||||
});
|
||||
},
|
||||
//更新购物车
|
||||
updateCart(data) {
|
||||
$http.request({
|
||||
url: "book/ordercart/update",
|
||||
method: "POST",
|
||||
data: data,
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
console.log('更新购物车---')
|
||||
}
|
||||
});
|
||||
},
|
||||
onHandleClickBuy() {
|
||||
this.orderModalShow = false;
|
||||
this.remark = this.content;
|
||||
@@ -1112,21 +1127,14 @@
|
||||
},
|
||||
];
|
||||
}
|
||||
if (
|
||||
this.goodsDataList[0].activityPrice &&
|
||||
this.goodsDataList[0].activityPrice > 0
|
||||
) {
|
||||
if (this.goodsDataList.some(item => item.activityPrice && item.activityPrice > 0)) {
|
||||
this.priceBreakdownList.push({
|
||||
text: "活动立减",
|
||||
imgUrl: "",
|
||||
type: 5,
|
||||
});
|
||||
}
|
||||
if (
|
||||
this.goodsDataList[0].isVipPrice &&
|
||||
this.goodsDataList[0].vipPrice &&
|
||||
this.goodsDataList[0].vipPrice > 0
|
||||
) {
|
||||
if (this.goodsDataList.some(item => item.isVipPrice==1 && item.vipPrice && item.vipPrice > 0)) {
|
||||
this.priceBreakdownList.push({
|
||||
text: "VIP专享立减",
|
||||
imgUrl: "",
|
||||
@@ -1210,7 +1218,7 @@
|
||||
products: this.goodsDataList.map((e) => {
|
||||
return {
|
||||
productId: e.productId,
|
||||
quantity: this.orderNumber,
|
||||
quantity: e.productAmount
|
||||
};
|
||||
}),
|
||||
regionCode: this.addressData.regionCode,
|
||||
@@ -1244,11 +1252,14 @@
|
||||
async getTotalPrice() {
|
||||
var s = 0;
|
||||
var that = this;
|
||||
for (var i = this.goodsDataList.length - 1; i >= 0; i--) {
|
||||
s += this.goodsDataList[i][this.priceKey];
|
||||
}
|
||||
that.totalPrice = s * this.orderNumber;
|
||||
console.log("that.totalPrice at line 1226:", that.totalPrice);
|
||||
that.goodsDataList.forEach((item, index) => {
|
||||
let price = 0;
|
||||
price = (item.productAmount * item.price).toFixed(2);
|
||||
s += Number(price);
|
||||
});
|
||||
|
||||
that.totalPrice = s;
|
||||
|
||||
var couponAmount = 0;
|
||||
var couponData = this.selectcouponList.filter(
|
||||
(e) => e.couponId == that.curCouponId
|
||||
@@ -1427,12 +1438,11 @@
|
||||
productList: this.goodsDataList.map((e) => {
|
||||
return {
|
||||
productId: e.productId,
|
||||
quantity: this.orderNumber,
|
||||
quantity: e.productAmount
|
||||
};
|
||||
}), //订单列表商品
|
||||
orderType: "order", //订单类型
|
||||
addressId:
|
||||
this.options.goods[0].goodsType != "05" ? this.addressData.id : 0, // 地址ID
|
||||
addressId: this.options.goods[0].goodsType != "05" ? this.addressData.id : 0, // 地址ID
|
||||
appName: this.appName,
|
||||
come: this.come,
|
||||
};
|
||||
@@ -1855,14 +1865,10 @@
|
||||
width: calc(100% - 160rpx);
|
||||
height: auto;
|
||||
float: right;
|
||||
|
||||
// overflow: hidden;
|
||||
|
||||
.normal_box_top {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
||||
height: 100rpx;
|
||||
// margin-bottom: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user