hml 2 lat temu
rodzic
commit
d944ddc0c0

+ 4 - 4
purchase_H5/src/templates/templateTogether-Col/index.vue

@@ -335,9 +335,7 @@ export default {
           this.$store.commit("setPageData", this.pageData);
         });
       }
-      setTimeout(() => {
-           this.callSvg()
-       }, 500)
+       this.callSvg()
     },
     extendClick () {
       if (this.pageData.remarks.extendVal && this.pageData.remarks.extendVal === "1") {
@@ -727,7 +725,8 @@ export default {
     callSvg () {
       let lottieBox = document.getElementById('lottie_box')
       lottieBox.innerHTML = ''
-      if (this.pageData.mainProduct.bannerPics[1] && 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',
@@ -736,6 +735,7 @@ export default {
           path: this.imgUrl + this.pageData.mainProduct.bannerPics[1]
         })
       }
+       }, 200)
     }
   },
 };

+ 55 - 36
purchase_H5/src/templates/templateTogether/index.vue

@@ -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);
     },
   },
 };