Преглед на файлове

feat: 我的询盘页面调整以及接口调试

周玉环 преди 5 дни
родител
ревизия
e3ee557645
променени са 3 файла, в които са добавени 29 реда и са изтрити 13 реда
  1. 2 1
      xinkeaboard-web/components/Home/sourcingForm.vue
  2. 12 0
      xinkeaboard-web/components/SldDiy.vue
  3. 15 12
      xinkeaboard-web/pages/login.vue

+ 2 - 1
xinkeaboard-web/components/Home/sourcingForm.vue

@@ -123,16 +123,17 @@ const submitForm = async (formEl) => {
   if (!formEl) return;
   await formEl.validate((valid, fields) => {
     if (valid) {
-      setFormData2Cache();
       let url = apiUrl + "v3/member/front/enquiry/save";
       if (!filtersStore.getLoginFlag) {
         return openLoginDialog({
           onRegister: () => {
+            setFormData2Cache();
             router.push({
               path: "/register",
             });
           },
           onForgot: () => {
+            setFormData2Cache();
             router.push({
               path: "/member/login/forget",
             });

+ 12 - 0
xinkeaboard-web/components/SldDiy.vue

@@ -1154,6 +1154,7 @@
 
       <!-- adv_29 start-->
       <div
+          id="EnquiryWrap"
           class="w_sld_react_1210 adv_29_wrap"
           v-if="item.json_data && item.json_data.type == 'adv_29'"
           :style="{
@@ -1361,6 +1362,17 @@ const goGoodsListByCatId = (val,name) => {
 const adv19Tab = (dataId, index, key, items) => {
   items.cur_tab = key;
 };
+
+onMounted(() => {
+  // 是否锚点跳转到询盘区块
+  const EnquiryCache = localStorage.getItem("quotations") ?? "";
+  if (EnquiryCache) {
+      document.getElementById('EnquiryWrap')?.scrollIntoView({ behavior: 'smooth' });
+      setTimeout(() => {
+        localStorage.removeItem('quotations')
+      }, 1000)
+  }
+})
 </script>
 <style lang="scss" scoped>
 @import "@/assets/style/decorate.scss";

+ 15 - 12
xinkeaboard-web/pages/login.vue

@@ -214,18 +214,21 @@ const login = () => {
         .then((res) => {
           if (res.state == 200) {
             filtersStore.setMemberInfo(res.data);
-            if (window.history.state.back) {
-              router.replace({
-                path: '/'
-              })
-              // if(window.history.state.back == '/register' || window.history.state.back == '/member/login/forget' || window.history.state.back == '/member/login/forget' || window.history.state.back == '/member/login/forget'){
-              // window.location.href = "/";
-              // }else{
-              //   window.location.href = window.history.state.back;
-              // }
-            } else {
-              router.replace({ path: "/member/home" });
-            }
+            router.replace({
+              path: '/'
+            })
+            // if (window.history.state.back) {
+            //   router.replace({
+            //     path: '/'
+            //   })
+            //   // if(window.history.state.back == '/register' || window.history.state.back == '/member/login/forget' || window.history.state.back == '/member/login/forget' || window.history.state.back == '/member/login/forget'){
+            //   // window.location.href = "/";
+            //   // }else{
+            //   //   window.location.href = window.history.state.back;
+            //   // }
+            // } else {
+            //   router.replace({ path: "/member/home" });
+            // }
           }
         }).catch(err => {
           loginLoding.value = false;