暂存code
This commit is contained in:
+74
-68
@@ -12,7 +12,7 @@ const _sfc_main = {
|
||||
return {
|
||||
id: 0,
|
||||
swiperList: [],
|
||||
currentNum: 1,
|
||||
currentNum: 0,
|
||||
specificationShow: false,
|
||||
specificationShowType: "",
|
||||
// 弹框类型
|
||||
@@ -164,15 +164,8 @@ const _sfc_main = {
|
||||
}
|
||||
this.orderInfo.quantity = currentQuantity;
|
||||
},
|
||||
// 立即购买,确定订单页面
|
||||
byFun() {
|
||||
this.addCart();
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/order_submit/order_submit"
|
||||
});
|
||||
},
|
||||
// 加入购入车
|
||||
async addCart() {
|
||||
async addCart(isBy = false) {
|
||||
const selectTempl = this.selectSpecificationTempl;
|
||||
if (!selectTempl || Object.keys(selectTempl).length === 0) {
|
||||
common_vendor.index.showToast({
|
||||
@@ -193,17 +186,26 @@ const _sfc_main = {
|
||||
};
|
||||
const resp = await api_product.addGoods(params);
|
||||
if (resp && resp.bizcode === 100) {
|
||||
common_vendor.index.showToast({
|
||||
title: "成功加入购物车",
|
||||
icon: "success",
|
||||
// 可选 success/loading/none
|
||||
duration: 2e3
|
||||
// 持续时长,单位ms
|
||||
});
|
||||
if (isBy) {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/order_submit/order_submit?ids=" + resp.data
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: "成功加入购物车",
|
||||
icon: "success",
|
||||
// 可选 success/loading/none
|
||||
duration: 2e3
|
||||
// 持续时长,单位ms
|
||||
});
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.checkSpecification(false, null);
|
||||
}, 2e3);
|
||||
}
|
||||
},
|
||||
// 跳转到分享页面
|
||||
jumpShare() {
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -223,108 +225,111 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t($data.currentNum + 1),
|
||||
b: common_vendor.t($data.swiperList.length),
|
||||
c: common_vendor.p({
|
||||
c: common_vendor.o((e) => $data.currentNum = e.current),
|
||||
d: common_vendor.p({
|
||||
list: $data.swiperList,
|
||||
height: "280"
|
||||
}),
|
||||
d: common_vendor.o($options.jumpLeft),
|
||||
e: common_vendor.p({
|
||||
e: common_vendor.o($options.jumpLeft),
|
||||
f: common_vendor.p({
|
||||
src: "/static/common/left_b_st.png",
|
||||
width: "30",
|
||||
height: "30",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
f: common_vendor.o(_ctx.jumpShare),
|
||||
g: common_vendor.p({
|
||||
g: common_vendor.o($options.jumpShare),
|
||||
h: common_vendor.p({
|
||||
src: "/static/common/share_st.png",
|
||||
width: "30",
|
||||
height: "30",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
h: $data.orderInfo.maxPrice && $data.orderInfo.maxPrice !== 0
|
||||
}, $data.orderInfo.maxPrice && $data.orderInfo.maxPrice !== 0 ? {
|
||||
i: common_vendor.t($data.orderInfo.minPrice),
|
||||
j: common_vendor.t($data.orderInfo.maxPrice)
|
||||
i: $data.orderInfo.minPrice && $data.orderInfo.maxPrice
|
||||
}, $data.orderInfo.minPrice && $data.orderInfo.maxPrice ? {
|
||||
j: common_vendor.t($data.orderInfo.minPrice),
|
||||
k: common_vendor.t($data.orderInfo.maxPrice)
|
||||
} : {
|
||||
k: common_vendor.t($data.orderInfo.minPrice)
|
||||
l: common_vendor.t($data.orderInfo.minPrice)
|
||||
}, {
|
||||
l: common_vendor.t($data.orderInfo.adPrice),
|
||||
m: common_vendor.t($data.orderInfo.name),
|
||||
n: common_vendor.t($data.selectSpecificationTempl.combTypes || "暂未选择规格"),
|
||||
o: common_vendor.p({
|
||||
m: common_vendor.t($data.orderInfo.adPrice),
|
||||
n: common_vendor.t($data.orderInfo.name),
|
||||
o: common_vendor.t($data.selectSpecificationTempl.combTypes || "暂未选择规格"),
|
||||
p: common_vendor.p({
|
||||
src: "/static/common/right.png",
|
||||
width: "20",
|
||||
height: "20",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
p: common_vendor.o(($event) => $options.checkSpecification(true)),
|
||||
q: common_vendor.p({
|
||||
q: common_vendor.o(($event) => $options.checkSpecification(true)),
|
||||
r: common_vendor.p({
|
||||
src: "/static/common/address2.png",
|
||||
width: "10",
|
||||
height: "10",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
r: common_vendor.t($options.getValue($options.PRODUCT_DELIVERY_TIME, $data.orderInfo.deliveryTime)),
|
||||
s: common_vendor.p({
|
||||
s: common_vendor.t($options.getValue($options.PRODUCT_DELIVERY_TIME, $data.orderInfo.deliveryTime)),
|
||||
t: common_vendor.p({
|
||||
src: "/static/product/product_b.png",
|
||||
width: "10",
|
||||
height: "12",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
t: common_vendor.p({
|
||||
v: common_vendor.p({
|
||||
src: "/static/product/product_js.png",
|
||||
width: "10",
|
||||
height: "10",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
v: $data.orderInfo.detailInfo,
|
||||
w: common_vendor.o(($event) => $options.jumpOther("home")),
|
||||
x: common_vendor.p({
|
||||
w: $data.orderInfo.detailInfo,
|
||||
x: common_vendor.o(($event) => $options.jumpOther("home")),
|
||||
y: common_vendor.p({
|
||||
src: "/static/product/home.png",
|
||||
width: "20",
|
||||
height: "20",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
y: common_vendor.o(($event) => $options.jumpOther("share")),
|
||||
z: common_vendor.p({
|
||||
z: common_vendor.o(($event) => $options.jumpOther("share")),
|
||||
A: common_vendor.p({
|
||||
src: "/static/product/kefu.png",
|
||||
width: "20",
|
||||
height: "20",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
A: common_vendor.o(($event) => $options.jumpOther("cart")),
|
||||
B: common_vendor.p({
|
||||
B: common_vendor.o(($event) => $options.jumpOther("cart")),
|
||||
C: common_vendor.p({
|
||||
src: "/static/product/cart.png",
|
||||
width: "24",
|
||||
height: "20",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
C: common_vendor.o(($event) => $options.checkSpecification(true, "addCart")),
|
||||
D: common_vendor.o(($event) => $options.checkSpecification(true, "buy")),
|
||||
E: common_vendor.p({
|
||||
D: common_vendor.o(($event) => $options.checkSpecification(true, "addCart")),
|
||||
E: common_vendor.o(($event) => $options.checkSpecification(true, "buy")),
|
||||
F: common_vendor.p({
|
||||
src: $data.orderInfo.mainGraph,
|
||||
width: "100",
|
||||
height: "100",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
F: $data.selectSpecificationTempl && Object.keys($data.selectSpecificationTempl).length !== 0
|
||||
G: $data.selectSpecificationTempl && Object.keys($data.selectSpecificationTempl).length !== 0
|
||||
}, $data.selectSpecificationTempl && Object.keys($data.selectSpecificationTempl).length !== 0 ? {
|
||||
G: common_vendor.t($data.selectSpecificationTempl.price)
|
||||
} : {
|
||||
H: common_vendor.t($data.orderInfo.minPrice),
|
||||
I: common_vendor.t($data.orderInfo.maxPrice)
|
||||
}, {
|
||||
J: $data.orderInfo.couponPrice && $data.orderInfo.couponPrice !== 0
|
||||
H: common_vendor.t($data.selectSpecificationTempl.price)
|
||||
} : common_vendor.e({
|
||||
I: common_vendor.t($data.orderInfo.minPrice),
|
||||
J: $data.orderInfo.maxPrice
|
||||
}, $data.orderInfo.maxPrice ? {
|
||||
K: common_vendor.t($data.orderInfo.maxPrice)
|
||||
} : {}), {
|
||||
L: $data.orderInfo.couponPrice && $data.orderInfo.couponPrice !== 0
|
||||
}, $data.orderInfo.couponPrice && $data.orderInfo.couponPrice !== 0 ? {
|
||||
K: common_vendor.t($data.orderInfo.couponPrice)
|
||||
M: common_vendor.t($data.orderInfo.couponPrice)
|
||||
} : {}, {
|
||||
L: common_vendor.t($data.orderInfo.adPrice),
|
||||
M: $data.orderInfo.couponPrice && $data.orderInfo.couponPrice !== 0
|
||||
N: common_vendor.t($data.orderInfo.adPrice),
|
||||
O: $data.orderInfo.couponPrice && $data.orderInfo.couponPrice !== 0
|
||||
}, $data.orderInfo.couponPrice && $data.orderInfo.couponPrice !== 0 ? {
|
||||
N: common_vendor.t($data.orderInfo.couponPrice)
|
||||
P: common_vendor.t($data.orderInfo.couponPrice)
|
||||
} : {}, {
|
||||
O: common_vendor.t($data.orderInfo.inventory || 0),
|
||||
P: common_vendor.f($data.specificationList, (item, index, i0) => {
|
||||
Q: common_vendor.t($data.orderInfo.inventory || 0),
|
||||
R: common_vendor.f($data.specificationList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.type),
|
||||
b: common_vendor.f(item.items, (oItem, oIndex, i1) => {
|
||||
@@ -338,20 +343,21 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
c: item.id
|
||||
};
|
||||
}),
|
||||
Q: common_vendor.o(($event) => $options.quantityFun("minus")),
|
||||
R: common_vendor.t($data.orderInfo.quantity),
|
||||
S: common_vendor.o(($event) => $options.quantityFun("add")),
|
||||
T: $data.specificationShowType === "buy"
|
||||
S: common_vendor.o(($event) => $options.quantityFun("minus")),
|
||||
T: common_vendor.t($data.orderInfo.quantity),
|
||||
U: common_vendor.o(($event) => $options.quantityFun("add")),
|
||||
V: $data.specificationShowType === "buy"
|
||||
}, $data.specificationShowType === "buy" ? {
|
||||
U: common_vendor.o((...args) => $options.byFun && $options.byFun(...args))
|
||||
W: common_vendor.o(($event) => $options.addCart(true))
|
||||
} : $data.specificationShowType === "addCart" ? {
|
||||
W: common_vendor.o((...args) => $options.addCart && $options.addCart(...args))
|
||||
Y: common_vendor.o(($event) => $options.addCart(false))
|
||||
} : {
|
||||
X: common_vendor.o((...args) => $options.addCart && $options.addCart(...args)),
|
||||
Y: common_vendor.o((...args) => $options.byFun && $options.byFun(...args))
|
||||
Z: common_vendor.o(($event) => $options.addCart(false)),
|
||||
aa: common_vendor.o(($event) => $options.addCart(true))
|
||||
}, {
|
||||
V: $data.specificationShowType === "addCart",
|
||||
Z: common_vendor.p({
|
||||
X: $data.specificationShowType === "addCart",
|
||||
ab: common_vendor.o(($event) => $data.specificationShow = false),
|
||||
ac: common_vendor.p({
|
||||
show: $data.specificationShow,
|
||||
round: 10,
|
||||
closeOnClickOverlay: false,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -323,6 +323,9 @@
|
||||
color: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.popup_but.data-v-ceb0d096 {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.popup_but .but_comm.data-v-ceb0d096 {
|
||||
width: 40%;
|
||||
}
|
||||
Reference in New Issue
Block a user