|
@@ -653,6 +653,26 @@ export default {
|
|
|
this.param.spid = info.data.spid;
|
|
|
document.title = info.data.remark;
|
|
|
this.$store.commit("setPageData", this.pageData);
|
|
|
+ if (this.user.userid) {
|
|
|
+ await orderList({
|
|
|
+ userid: this.user.userid,
|
|
|
+ cpid: this.param.cpid,
|
|
|
+ spid: this.param.spid,
|
|
|
+ }).then((res) => {
|
|
|
+ let data = res.data;
|
|
|
+ if (data.length === 0) {
|
|
|
+ this.isBuy = "未订购";
|
|
|
+ } else {
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ if (data[i].STATUS === "0") {
|
|
|
+ this.isBuy = "已订购";
|
|
|
+ } else {
|
|
|
+ this.isBuy = "已退订";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
} else {
|
|
|
detMainProduct({
|
|
|
productId: val,
|
|
@@ -665,6 +685,26 @@ export default {
|
|
|
this.param.spid = res.data.spid;
|
|
|
document.title = res.data.remark;
|
|
|
this.$store.commit("setPageData", this.pageData);
|
|
|
+ if (this.user.userid) {
|
|
|
+ await orderList({
|
|
|
+ userid: this.user.userid,
|
|
|
+ cpid: this.param.cpid,
|
|
|
+ spid: this.param.spid,
|
|
|
+ }).then((res) => {
|
|
|
+ let data = res.data;
|
|
|
+ if (data.length === 0) {
|
|
|
+ this.isBuy = "未订购";
|
|
|
+ } else {
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ if (data[i].STATUS === "0") {
|
|
|
+ this.isBuy = "已订购";
|
|
|
+ } else {
|
|
|
+ this.isBuy = "已退订";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -699,30 +739,7 @@ export default {
|
|
|
this.times = String(Math.ceil(times * add) + start);
|
|
|
this.numberNum = String(Math.ceil(times * add) + start);
|
|
|
}
|
|
|
-
|
|
|
- if (this.user.userid) {
|
|
|
- await orderList({
|
|
|
- userid: this.user.userid,
|
|
|
- cpid: this.param.cpid,
|
|
|
- spid: this.param.spid,
|
|
|
- }).then((res) => {
|
|
|
- let data = res.data;
|
|
|
- if (data.length === 0) {
|
|
|
- this.isBuy = "未订购";
|
|
|
- } else {
|
|
|
- for (let i = 0; i < data.length; i++) {
|
|
|
- if (data[i].STATUS === "0") {
|
|
|
- this.isBuy = "已订购";
|
|
|
- } else {
|
|
|
- this.isBuy = "已退订";
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- setTimeout(() => {
|
|
|
- this.callSvg()
|
|
|
- }, 500)
|
|
|
+ this.callSvg();
|
|
|
},
|
|
|
result(a, b) {
|
|
|
return (a - b).toFixed(2);
|
|
@@ -1128,18 +1145,20 @@ export default {
|
|
|
callSvg() {
|
|
|
let lottieBox = document.getElementById("lottie_box");
|
|
|
lottieBox.innerHTML = "";
|
|
|
- if (
|
|
|
- this.pageData.mainProduct.bannerPics[1] &&
|
|
|
- this.pageData.mainProduct.bannerPics[1] !== ""
|
|
|
- ) {
|
|
|
- this.lottie = lottie.loadAnimation({
|
|
|
- container: lottieBox,
|
|
|
- renderer: "svg",
|
|
|
- loop: true,
|
|
|
- autoplay: true,
|
|
|
- path: this.imgUrl + this.pageData.mainProduct.bannerPics[1],
|
|
|
- });
|
|
|
- }
|
|
|
+ setTimeout(() => {
|
|
|
+ if (
|
|
|
+ this.pageData.mainProduct.bannerPics[1] &&
|
|
|
+ this.pageData.mainProduct.bannerPics[1] !== ""
|
|
|
+ ) {
|
|
|
+ this.lottie = lottie.loadAnimation({
|
|
|
+ container: lottieBox,
|
|
|
+ renderer: "svg",
|
|
|
+ loop: true,
|
|
|
+ autoplay: true,
|
|
|
+ path: this.imgUrl + this.pageData.mainProduct.bannerPics[1],
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, 200);
|
|
|
},
|
|
|
},
|
|
|
};
|