Browse Source

product goto link

fengchang 1 year ago
parent
commit
2cd37e8441

+ 5 - 0
hichina-admin-backend/src/main/java/com/hichina/admin/hichinaadminbackend/controller/PublicController.java

@@ -16,4 +16,9 @@ public class PublicController {
     public String getPublicServiceUrl(){
         return env.getProperty("base.serving.url");
     }
+
+    @GetMapping("/mainsitebaseurl")
+    public String getMainsiteBaseUrl(){
+        return env.getProperty("mainsite.base");
+    }
 }

+ 1 - 0
hichina-admin-backend/src/main/resources/application-dev.properties

@@ -29,6 +29,7 @@ hichina.root.access.key.id=LTAI5tHiFqvcRHbZYcKZ7Ksm
 
 default.page.size=100
 
+mainsite.base=http://localhost:9053
 origin.base=http://localhost:9051
 base.serving.url=http://localhost:9050
 

+ 1 - 0
hichina-admin-backend/src/main/resources/application-qa.properties

@@ -29,6 +29,7 @@ hichina.root.access.key.id=LTAI5tHiFqvcRHbZYcKZ7Ksm
 
 default.page.size=100
 
+mainsite.base=https://qa.hichinatravel.com
 origin.base=https://admin-qa.hichinatravel.com
 base.serving.url=https://admin-qa.hichinatravel.com/service
 

+ 24 - 4
hichina-admin-front/src/pages/SkuGroupPage.vue

@@ -118,17 +118,17 @@
               v-if="props.row.enabled == false"
               color="blue-grey-3"
               style="cursor: pointer"
-              @click="copyText(props.row.skuGroupId)"
+              @click="copyTextAndOpen(props.row.skuGroupId)"
               type="button"
-              >{{ props.row.skuGroupId }}</q-btn
+              ><a>复制id并前往</a></q-btn
             >
             <q-btn
               v-if="props.row.enabled == true"
               color="green"
               style="cursor: pointer"
-              @click="copyText(props.row.skuGroupId)"
+              @click="copyTextAndOpen(props.row.skuGroupId)"
               type="button"
-              >{{ props.row.skuGroupId }}</q-btn
+              ><a>复制id并前往</a></q-btn
             >
           </q-td>
         </template>
@@ -187,9 +187,23 @@ export default {
     };
   },
   mounted() {
+    this.loadMainsiteBaseUrl();
     this.$refs.skuGroupTableRef.requestServerInteraction();
   },
   methods: {
+    loadMainsiteBaseUrl() {
+      api
+        .get("/api/public/mainsitebaseurl")
+        .then((response) => {
+          console.log("main site base:");
+          this.mainsiteBaseUrl = response.data;
+          console.log(response.data);
+        })
+        .catch((e) => {
+          console.log(e);
+          this.showNotifyMessageFail(e.response);
+        });
+    },
     unBind() {
       if (!this.selected_right_destination?.trim()) {
         alert("Haven't selected anything");
@@ -296,6 +310,11 @@ export default {
       this.loadBindedDestinations(skuGroupId);
       this.popupBindDestinationWindow = true;
     },
+    copyTextAndOpen(text) {
+      this.copyText(text);
+      var goto = this.mainsiteBaseUrl + "/product-detail/" + text;
+      window.location.href = goto;
+    },
     copyText(text) {
       const unsecuredCopyToClipboard = (text) => {
         const textArea = document.createElement("textarea");
@@ -381,6 +400,7 @@ export default {
   },
   data() {
     return {
+      mainsiteBaseUrl: "",
       bindedDestinations: [],
       currentSkuGroupId: "",
       selected_left_destination: "",

+ 40 - 20
hichina-main-front/src/layout/components/XNav/index.vue

@@ -1,4 +1,21 @@
 <template>
+  <!-- <div class="banner">
+    <div class="logo">
+      <img src="@/assets/images/logo.png" alt="Logo" />
+    </div>
+    <el-menu
+      class="menu"
+      mode="horizontal"
+      :router="true"
+      :default-active="activeMenuItem"
+      @select="handleMenuSelect"
+    >
+      <el-menu-item index="home">Home</el-menu-item>
+      <el-menu-item index="products">Products</el-menu-item>
+      <el-menu-item index="about">About</el-menu-item>
+      <el-menu-item index="contact">Contact</el-menu-item>
+    </el-menu>
+  </div> -->
   <div class="nav flex-between" @scroll="handleScroll">
     <img class="logo" src="@/assets/images/logo.png" @click="goPage('/home')" alt="" />
 
@@ -7,24 +24,6 @@
       <el-menu-item class="nav-title menuitem" index="2" @click="goPage('/blog')" >Blogs/Vlogs</el-menu-item>
       <el-menu-item class="nav-title menuitem" index="3" @click="goPage('/product')" >Travel Shop</el-menu-item>
       <el-menu-item class="nav-title menuitem" index="4" @click="goPage('/destination')" >Destinations</el-menu-item>
-      <!-- <el-sub-menu index="2">
-        <template #title>
-          <span class="nav-title">Blogs/Vlogs</span>
-        </template>
-        <el-menu-item @click="goPage('/blog')" index="2-1">View Blogs</el-menu-item>
-      </el-sub-menu> -->
-      <!-- <el-sub-menu index="3"> -->
-        <!-- <template #title>
-          <span class="nav-title">Travel Shop</span>
-        </template> -->
-        <!-- <el-menu-item @click="goPage('/product')" index="3-1">Travel Products</el-menu-item> -->
-      <!-- </el-sub-menu> -->
-      <!-- <el-sub-menu index="4">
-        <template #title>
-          <span class="nav-title">Destinations</span>
-        </template>
-        <el-menu-item @click="goPage('/destination')" index="4-1">All destinations</el-menu-item>
-      </el-sub-menu> -->
     </el-menu>
 
     <div class="flex-between">
@@ -54,7 +53,6 @@
           </el-dropdown-menu>
         </template>
       </el-dropdown>
-      
     </div>
   </div>
 </template>
@@ -68,6 +66,13 @@
   import { ArrowDown } from '@element-plus/icons-vue'
   const activeIndex = ref(1)
 
+  const activeMenuItem =ref('home')
+
+  function handleMenuSelect(index) {
+    activeMenuItem.value = index;
+    // Handle menu selection logic here
+  }
+
   function handleScroll(el) {
     console.log("scoll me")
     if((el.srcElement.offsetHeight + el.srcElement.scrollTop) >= el.srcElement.scrollHeight) {
@@ -160,5 +165,20 @@
   .menuitem{
     margin-left: 20px;
   }
-
+  // .banner {
+  //   display: flex;
+  //   justify-content: space-between;
+  //   align-items: center;
+  //   padding: 10px;
+  //   background-color: #f5f5f5;
+  // }
+
+  // .logo img {
+  //   height: 40px;
+  //   width: auto;
+  // }
+
+  // .menu {
+  //   background-color: #f5f5f5;
+  // }
 </style>