feat: 新增预售书重复购买提示
- 更新应用版本号至1.0.52 - 在订单提交页面新增预售备注确认弹窗,用户可在购买前查看并确认备注内容 - 添加相关方法以处理预售备注的显示和确认逻辑 - 更新请求配置,增加预售备注接口
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
"name" : "心灵空间",
|
||||
"appid" : "__UNI__BBBDFD2",
|
||||
"description" : "心灵空间",
|
||||
"versionName" : "1.0.51",
|
||||
"versionName" : "1.0.52",
|
||||
"sassImplementationName" : "node-sass",
|
||||
"versionCode" : 1051,
|
||||
"versionCode" : 1052,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
|
||||
@@ -510,6 +510,17 @@
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-modal
|
||||
:show="presaleRemarkModalShow"
|
||||
title="提示"
|
||||
:content="presaleRemarkModalContent"
|
||||
:showCancelButton="true"
|
||||
confirmText="继续购买"
|
||||
cancelText="取消"
|
||||
@confirm="handlePresaleRemarkConfirm"
|
||||
@cancel="handlePresaleRemarkCancel"
|
||||
@close="handlePresaleRemarkCancel"
|
||||
></u-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -607,6 +618,9 @@
|
||||
|
||||
orderModalShowInfo: {},
|
||||
orderModalShow: false,
|
||||
presaleRemarkModalShow: false,
|
||||
presaleRemarkModalContent: "",
|
||||
presaleRemarkModalResolve: null,
|
||||
payType: 1,
|
||||
freightNum: 0,
|
||||
addressData: {
|
||||
@@ -1339,6 +1353,62 @@
|
||||
this.content = this.remark;
|
||||
}
|
||||
},
|
||||
openPresaleRemarkModal(content) {
|
||||
this.presaleRemarkModalContent = content;
|
||||
this.presaleRemarkModalShow = true;
|
||||
return new Promise((resolve) => {
|
||||
this.presaleRemarkModalResolve = resolve;
|
||||
});
|
||||
},
|
||||
handlePresaleRemarkConfirm() {
|
||||
this.presaleRemarkModalShow = false;
|
||||
if (this.presaleRemarkModalResolve) {
|
||||
const resolve = this.presaleRemarkModalResolve;
|
||||
this.presaleRemarkModalResolve = null;
|
||||
resolve(true);
|
||||
}
|
||||
},
|
||||
handlePresaleRemarkCancel() {
|
||||
this.presaleRemarkModalShow = false;
|
||||
if (this.presaleRemarkModalResolve) {
|
||||
const resolve = this.presaleRemarkModalResolve;
|
||||
this.presaleRemarkModalResolve = null;
|
||||
resolve(false);
|
||||
}
|
||||
},
|
||||
async checkPresaleRemark() {
|
||||
if (this.pageType != "goods") {
|
||||
return true;
|
||||
}
|
||||
const productIds = this.goodsDataList
|
||||
.map((e) => e.productId)
|
||||
.filter((id) => id)
|
||||
.join(",");
|
||||
if (!productIds || !this.urlList.presaleRemark) {
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
const res = await this.$http.request({
|
||||
url: `${this.urlList.presaleRemark}`,
|
||||
method: "POST",
|
||||
data: {
|
||||
productIds,
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
const remark =
|
||||
res && typeof res.remark == "string" ? res.remark.trim() : "";
|
||||
if (!remark) {
|
||||
return true;
|
||||
}
|
||||
return await this.openPresaleRemarkModal(remark);
|
||||
} catch (error) {
|
||||
console.log("presaleRemark error:", error);
|
||||
return true;
|
||||
}
|
||||
},
|
||||
async goBuyJie() {
|
||||
if (this.pageType == "vip") {
|
||||
if (this.radioValue != "1") {
|
||||
@@ -1446,6 +1516,11 @@
|
||||
});
|
||||
thisproduct = thisproduct.join(",");
|
||||
}
|
||||
const passPresaleRemark = await this.checkPresaleRemark();
|
||||
if (!passPresaleRemark) {
|
||||
this.buyingFlag = false;
|
||||
return;
|
||||
}
|
||||
if (
|
||||
this.historyOrderInfo &&
|
||||
thisproduct == this.historyOrderInfo.product &&
|
||||
@@ -2405,4 +2480,4 @@
|
||||
color: $themeColor;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@ export default {
|
||||
list: "app/phone.do?getCourseDetail_new",
|
||||
initPrepareOrder: "common/buyOrder/initPrepareOrder",
|
||||
buyOrder: "book/buyOrder/placeOrder",
|
||||
presaleRemark: "book/buyOrder/presaleRemark",
|
||||
curriculumInfo: "app/phone.do?getCourseInfo",
|
||||
detailInfo: "app/phoneDoctor.do?getTaiHuClassInfo_new",
|
||||
userInfo: "common/user/getUserInfo",
|
||||
|
||||
Reference in New Issue
Block a user