feat: 新增预售书重复购买提示
在结算页面中新增预售备注的弹窗功能,用户在结算时可查看相关备注信息。更新manifest.json中的版本号至1.2.87。
This commit is contained in:
@@ -13,8 +13,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"sassImplementationName" : "node-sass",
|
"sassImplementationName" : "node-sass",
|
||||||
"versionName" : "1.2.86",
|
"versionName" : "1.2.87",
|
||||||
"versionCode" : 1286,
|
"versionCode" : 1287,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"compatible" : {
|
"compatible" : {
|
||||||
"ignoreVersion" : true
|
"ignoreVersion" : true
|
||||||
|
|||||||
@@ -374,6 +374,18 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
|
<u-modal
|
||||||
|
:show="presaleRemarkModalShow"
|
||||||
|
title="提示"
|
||||||
|
:content="presaleRemarkModalContent"
|
||||||
|
:showCancelButton="true"
|
||||||
|
confirmText="继续购买"
|
||||||
|
cancelText="取消"
|
||||||
|
@confirm="handlePresaleRemarkConfirm"
|
||||||
|
@cancel="handlePresaleRemarkCancel"
|
||||||
|
@close="handlePresaleRemarkCancel"
|
||||||
|
></u-modal>
|
||||||
|
|
||||||
<music-play :playData="playData"></music-play>
|
<music-play :playData="playData"></music-play>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -413,6 +425,9 @@ export default {
|
|||||||
realPrice: 0,
|
realPrice: 0,
|
||||||
payType: 1,
|
payType: 1,
|
||||||
nowClick: true,
|
nowClick: true,
|
||||||
|
presaleRemarkModalShow: false,
|
||||||
|
presaleRemarkModalContent: "",
|
||||||
|
presaleRemarkModalResolve: null,
|
||||||
paylist: [
|
paylist: [
|
||||||
{
|
{
|
||||||
title: "支付宝",
|
title: "支付宝",
|
||||||
@@ -556,6 +571,59 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取优惠券列表
|
// 获取优惠券列表
|
||||||
|
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() {
|
||||||
|
const productIds = this.cartList
|
||||||
|
.map((e) => e.productId)
|
||||||
|
.filter((id) => id)
|
||||||
|
.join(",");
|
||||||
|
if (!productIds) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const res = await $http.request({
|
||||||
|
url: "book/buyOrder/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;
|
||||||
|
}
|
||||||
|
},
|
||||||
getCourpe() {
|
getCourpe() {
|
||||||
let proId = "";
|
let proId = "";
|
||||||
for (let i = 0; i < this.cartList.length; i++) {
|
for (let i = 0; i < this.cartList.length; i++) {
|
||||||
@@ -894,7 +962,7 @@ export default {
|
|||||||
this.youhuiShow = false;
|
this.youhuiShow = false;
|
||||||
},
|
},
|
||||||
// 提交结算
|
// 提交结算
|
||||||
goBuyJie() {
|
async goBuyJie() {
|
||||||
if (this.addressList.length == 0) {
|
if (this.addressList.length == 0) {
|
||||||
this.dizhiShow = true; // 如果没有地址信息
|
this.dizhiShow = true; // 如果没有地址信息
|
||||||
return;
|
return;
|
||||||
@@ -923,6 +991,11 @@ export default {
|
|||||||
quantity: this.cartList[i].productAmount,
|
quantity: this.cartList[i].productAmount,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
const passPresaleRemark = await this.checkPresaleRemark();
|
||||||
|
if (!passPresaleRemark) {
|
||||||
|
this.nowClick = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
let data = {
|
let data = {
|
||||||
buyType: this.typeId, //0- 商品页直接下单 1- 购物车结算
|
buyType: this.typeId, //0- 商品页直接下单 1- 购物车结算
|
||||||
userId: this.userInfo.id, //下单人ID
|
userId: this.userInfo.id, //下单人ID
|
||||||
|
|||||||
Reference in New Issue
Block a user