Commit aefd149fab9dd6994e6fc9653660637d2a02fdb0

Authored by boyang
1 parent 287559f2

feat: 开发期刊推荐

components/ProductDetail.vue
... ... @@ -292,7 +292,7 @@
292 292 </div>
293 293 </div>
294 294  
295   - <div class="tw-pb-[64px]">
  295 + <!-- <div class="tw-pb-[64px]">
296 296 <v-tabs
297 297 class="tabs"
298 298 v-model="tab"
... ... @@ -303,7 +303,6 @@
303 303 >
304 304 <v-tab :value="1">Product Details</v-tab>
305 305 <v-tab :value="2">Specification</v-tab>
306   - <!-- <v-tab :value="3">商品百科</v-tab> -->
307 306 </v-tabs>
308 307 <v-window v-model="tab" class="tw-p-[24px]">
309 308 <v-window-item key="1" :value="1">
... ... @@ -347,8 +346,126 @@
347 346 </tbody>
348 347 </v-table>
349 348 </v-window-item>
350   - <!-- <v-window-item key="3" :value="3"> 2 </v-window-item> -->
351 349 </v-window>
  350 + </div> -->
  351 + <div style="display: flex">
  352 + <div class="tw-pb-[64px]" style="width: 70%; margin-right: 10px">
  353 + <v-tabs
  354 + class="tabs"
  355 + v-model="tab"
  356 + color="white"
  357 + bg-color="#eeeeee"
  358 + slider-color="blue-lighten-1"
  359 + selected-class="active"
  360 + >
  361 + <v-tab :value="1">Product Details</v-tab>
  362 + <v-tab :value="2">Specification</v-tab>
  363 + <!-- <v-tab :value="3">商品百科</v-tab> -->
  364 + </v-tabs>
  365 + <v-window v-model="tab" class="tw-p-[24px]">
  366 + <v-window-item key="1" :value="1">
  367 + <div v-if="info.advantage" class="tw-mb-[24px]">
  368 + <div class="text-h6">Advantage</div>
  369 + <v-divider class="tw-mb-[12px]"></v-divider>
  370 + <div v-html="info.advantage"></div>
  371 + </div>
  372 + <div v-if="info.physicalproperty" class="tw-mb-[24px]">
  373 + <div class="text-h6">Physical Property</div>
  374 + <v-divider class="tw-mb-[12px]"></v-divider>
  375 + <div v-html="info.physicalproperty"></div>
  376 + </div>
  377 + <div v-if="info.storage" class="tw-mb-[24px]">
  378 + <div class="text-h6">Storage</div>
  379 + <v-divider class="tw-mb-[12px]"></v-divider>
  380 + <div v-html="info.storage"></div>
  381 + </div>
  382 + <div v-if="info.introduction" class="tw-mb-[24px]">
  383 + <div class="text-h6">Introduction</div>
  384 + <v-divider class="tw-mb-[12px]"></v-divider>
  385 + <div v-html="info.introduction"></div>
  386 + </div>
  387 + <div v-if="info.description" class="tw-mb-[24px]">
  388 + <div class="text-h6">Description</div>
  389 + <v-divider class="tw-mb-[12px]"></v-divider>
  390 + <div v-html="info.description"></div>
  391 + </div>
  392 + </v-window-item>
  393 + <v-window-item key="2" :value="2">
  394 + <v-table density="compact" class="table2">
  395 + <tbody>
  396 + <tr
  397 + class="tr"
  398 + v-for="item in info.productAttributeList || []"
  399 + :key="item.name"
  400 + >
  401 + <td class="td tw-w-[400px]">{{ item.name }}</td>
  402 + <td class="td">{{ item.value }}</td>
  403 + </tr>
  404 + </tbody>
  405 + </v-table>
  406 + </v-window-item>
  407 + <!-- <v-window-item key="3" :value="3"> 2 </v-window-item> -->
  408 + </v-window>
  409 + </div>
  410 + <div style="width: 30%">
  411 + <v-tabs
  412 + v-model="tabPeriodical"
  413 + color="white"
  414 + bg-color="#eeeeee"
  415 + slider-color="blue-lighten-1"
  416 + selected-class="active"
  417 + grow
  418 + >
  419 + <v-tab value="one">Blog recommendation</v-tab>
  420 + </v-tabs>
  421 + <!-- <v-list rounded>
  422 + <v-list-item-group v-model="selectedItem" color="primary">
  423 + <v-list-item
  424 + v-for="item in info.journals"
  425 + :key="item.id"
  426 + @click="navigateToUrl(item.link)"
  427 + >
  428 + <v-list-item-content>
  429 + <v-list-item-title v-text="item.title"></v-list-item-title>
  430 + </v-list-item-content>
  431 + </v-list-item>
  432 + </v-list-item-group>
  433 + </v-list> -->
  434 + <v-list rounded>
  435 + <v-list-item-group v-model="selectedItem" color="primary">
  436 + <v-list-item
  437 + v-for="item in info.journals"
  438 + :key="item.id"
  439 + @click="navigateToUrl(item.link)"
  440 + >
  441 + <v-list-item-content>
  442 + <v-hover v-slot:default="{ isHovering, props }">
  443 + <div v-bind="props">
  444 + <v-list-item-title
  445 + v-if="!isHovering"
  446 + v-text="item.title"
  447 + style="
  448 + overflow: hidden;
  449 + text-overflow: ellipsis;
  450 + white-space: nowrap;
  451 + "
  452 + ></v-list-item-title>
  453 + <span v-if="isHovering" bottom style="color: #1e88e5">{{
  454 + item.title
  455 + }}</span>
  456 + <!-- <v-tooltip v-if="isHovering" bottom>
  457 + <template v-slot:activator="{ props: tooltipProps }">
  458 + <span v-bind="tooltipProps">{{ item.title }}</span>
  459 + </template>
  460 + <span>{{ item.title }}</span>
  461 + </v-tooltip> -->
  462 + </div>
  463 + </v-hover>
  464 + </v-list-item-content>
  465 + </v-list-item>
  466 + </v-list-item-group>
  467 + </v-list>
  468 + </div>
352 469 </div>
353 470 <div class="social-share-container">
354 471 <SocialShare
... ... @@ -378,26 +495,6 @@
378 495 style="color: #1e88e5; width: 140px"
379 496 />
380 497 </div>
381   - <!-- <div class="social-share-container">
382   - <div
383   - v-for="network in ['facebook', 'twitter', 'linkedin']"
384   - :key="network"
385   - class="social-share-item"
386   - >
387   - <h3 class="social-share-title" style="color: #1e88e5">
388   - {{ getTitle(network) }}
389   - </h3>
390   - <SocialShare
391   - :network="network"
392   - :styled="true"
393   - style="color: #1e88e5"
394   - :label="getTitle(network)"
395   - :title="info.name"
396   - :url="currentUrl"
397   - class="p-4 rounded-none"
398   - />
399   - </div>
400   - </div> -->
401 498 </v-container>
402 499 </template>
403 500  
... ... @@ -421,6 +518,20 @@ const dialogStore = useDialogStore();
421 518 const href1 = ref("/products");
422 519 const href2 = ref("/products");
423 520 const idHref = ref("/products");
  521 +const itemsss = [
  522 + {
  523 + name: "Item #1",
  524 + id: 1,
  525 + },
  526 + {
  527 + name: "Item #2",
  528 + id: 2,
  529 + },
  530 + {
  531 + name: "Item #3",
  532 + id: 3,
  533 + },
  534 +];
424 535 const productStore = useProductListStore();
425 536 const currentUrl = ref("https://www.canrud.com/products");
426 537 // 定义单个 item 的接口
... ... @@ -587,7 +698,7 @@ watchEffect(() =&gt; {
587 698 // })
588 699 const currentIndex = ref(0);
589 700 const navigateToUrl = (url) => {
590   - // window.open(url); // 在新标签页中打开链接
  701 + window.open(url); // 在新标签页中打开链接
591 702 };
592 703 const toggleRow = () => {
593 704 currentIndex.value = currentIndex.value === 0 ? 1 : 0;
... ...
nuxt.config.ts
... ... @@ -41,8 +41,8 @@ export default defineNuxtConfig({
41 41 nitro: {
42 42 devProxy: {
43 43 "/shop": {
44   - target: "http://47.89.254.121:8002/shop", // 线上代理地址
45   - // target: "http://127.0.0.1:8002/shop",
  44 + // target: "http://47.89.254.121:8002/shop", // 线上代理地址
  45 + target: "http://127.0.0.1:8002/shop",
46 46 // target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名
47 47 changeOrigin: true, // 表示是否跨域
48 48 },
... ... @@ -50,8 +50,8 @@ export default defineNuxtConfig({
50 50 // 该配置用于服务端请求转发
51 51 routeRules: {
52 52 "/shop/**": {
53   - proxy: "http://47.89.254.121:8002/shop/**",
54   - // proxy: "http://127.0.0.1:8002/shop/**",
  53 + // proxy: "http://47.89.254.121:8002/shop/**",
  54 + proxy: "http://127.0.0.1:8002/shop/**",
55 55 // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
56 56 },
57 57 },
... ...
pages/products/index.vue
... ... @@ -149,14 +149,15 @@ const loadProducts = async () =&gt; {
149 149 if (categoryStore.selectedFuncCategory) {
150 150 params.productFunctionId = categoryStore.selectedFuncCategory;
151 151 if (firstIndex.value == 1) {
152   - // categoryStore.selectedFuncCategory = selectedFuncCategoryBak.value;
153 152 params.productFunctionId = selectedFuncCategoryBak.value;
154 153 firstIndex.value += 1;
155 154 if (
156 155 params.productFunctionId == "" &&
157 156 selectedFuncCategoryBak.value == ""
158 157 ) {
  158 + categoryStore.selectedFuncCategory = selectedFuncCategoryBak.value;
159 159 params.productFunctionId = categoryStore.selectedFuncCategory;
  160 + // categoryStore.selectedFuncCategory = selectedFuncCategoryBak.value;
160 161 }
161 162 console.log(
162 163 params.productFunctionId,
... ... @@ -248,7 +249,6 @@ watchEffect(async () =&gt; {
248 249 // const foundFuncCategory = funcCategoryList.value.find(
249 250 // (func) => func.name === functionName
250 251 // );
251   -// console.log(foundFuncCategory, "5656functionName");
252 252  
253 253 // if (foundFuncCategory) {
254 254 // const funcCategoryId = foundFuncCategory.id;
... ...