Commit aefd149fab9dd6994e6fc9653660637d2a02fdb0
1 parent
287559f2
feat: 开发期刊推荐
Showing
3 changed files
with
141 additions
and
30 deletions
components/ProductDetail.vue
@@ -292,7 +292,7 @@ | @@ -292,7 +292,7 @@ | ||
292 | </div> | 292 | </div> |
293 | </div> | 293 | </div> |
294 | 294 | ||
295 | - <div class="tw-pb-[64px]"> | 295 | + <!-- <div class="tw-pb-[64px]"> |
296 | <v-tabs | 296 | <v-tabs |
297 | class="tabs" | 297 | class="tabs" |
298 | v-model="tab" | 298 | v-model="tab" |
@@ -303,7 +303,6 @@ | @@ -303,7 +303,6 @@ | ||
303 | > | 303 | > |
304 | <v-tab :value="1">Product Details</v-tab> | 304 | <v-tab :value="1">Product Details</v-tab> |
305 | <v-tab :value="2">Specification</v-tab> | 305 | <v-tab :value="2">Specification</v-tab> |
306 | - <!-- <v-tab :value="3">商品百科</v-tab> --> | ||
307 | </v-tabs> | 306 | </v-tabs> |
308 | <v-window v-model="tab" class="tw-p-[24px]"> | 307 | <v-window v-model="tab" class="tw-p-[24px]"> |
309 | <v-window-item key="1" :value="1"> | 308 | <v-window-item key="1" :value="1"> |
@@ -347,8 +346,126 @@ | @@ -347,8 +346,126 @@ | ||
347 | </tbody> | 346 | </tbody> |
348 | </v-table> | 347 | </v-table> |
349 | </v-window-item> | 348 | </v-window-item> |
350 | - <!-- <v-window-item key="3" :value="3"> 2 </v-window-item> --> | ||
351 | </v-window> | 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 | </div> | 469 | </div> |
353 | <div class="social-share-container"> | 470 | <div class="social-share-container"> |
354 | <SocialShare | 471 | <SocialShare |
@@ -378,26 +495,6 @@ | @@ -378,26 +495,6 @@ | ||
378 | style="color: #1e88e5; width: 140px" | 495 | style="color: #1e88e5; width: 140px" |
379 | /> | 496 | /> |
380 | </div> | 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 | </v-container> | 498 | </v-container> |
402 | </template> | 499 | </template> |
403 | 500 | ||
@@ -421,6 +518,20 @@ const dialogStore = useDialogStore(); | @@ -421,6 +518,20 @@ const dialogStore = useDialogStore(); | ||
421 | const href1 = ref("/products"); | 518 | const href1 = ref("/products"); |
422 | const href2 = ref("/products"); | 519 | const href2 = ref("/products"); |
423 | const idHref = ref("/products"); | 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 | const productStore = useProductListStore(); | 535 | const productStore = useProductListStore(); |
425 | const currentUrl = ref("https://www.canrud.com/products"); | 536 | const currentUrl = ref("https://www.canrud.com/products"); |
426 | // 定义单个 item 的接口 | 537 | // 定义单个 item 的接口 |
@@ -587,7 +698,7 @@ watchEffect(() => { | @@ -587,7 +698,7 @@ watchEffect(() => { | ||
587 | // }) | 698 | // }) |
588 | const currentIndex = ref(0); | 699 | const currentIndex = ref(0); |
589 | const navigateToUrl = (url) => { | 700 | const navigateToUrl = (url) => { |
590 | - // window.open(url); // 在新标签页中打开链接 | 701 | + window.open(url); // 在新标签页中打开链接 |
591 | }; | 702 | }; |
592 | const toggleRow = () => { | 703 | const toggleRow = () => { |
593 | currentIndex.value = currentIndex.value === 0 ? 1 : 0; | 704 | currentIndex.value = currentIndex.value === 0 ? 1 : 0; |
nuxt.config.ts
@@ -41,8 +41,8 @@ export default defineNuxtConfig({ | @@ -41,8 +41,8 @@ export default defineNuxtConfig({ | ||
41 | nitro: { | 41 | nitro: { |
42 | devProxy: { | 42 | devProxy: { |
43 | "/shop": { | 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 | // target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名 | 46 | // target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名 |
47 | changeOrigin: true, // 表示是否跨域 | 47 | changeOrigin: true, // 表示是否跨域 |
48 | }, | 48 | }, |
@@ -50,8 +50,8 @@ export default defineNuxtConfig({ | @@ -50,8 +50,8 @@ export default defineNuxtConfig({ | ||
50 | // 该配置用于服务端请求转发 | 50 | // 该配置用于服务端请求转发 |
51 | routeRules: { | 51 | routeRules: { |
52 | "/shop/**": { | 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 | // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**' | 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 () => { | @@ -149,14 +149,15 @@ const loadProducts = async () => { | ||
149 | if (categoryStore.selectedFuncCategory) { | 149 | if (categoryStore.selectedFuncCategory) { |
150 | params.productFunctionId = categoryStore.selectedFuncCategory; | 150 | params.productFunctionId = categoryStore.selectedFuncCategory; |
151 | if (firstIndex.value == 1) { | 151 | if (firstIndex.value == 1) { |
152 | - // categoryStore.selectedFuncCategory = selectedFuncCategoryBak.value; | ||
153 | params.productFunctionId = selectedFuncCategoryBak.value; | 152 | params.productFunctionId = selectedFuncCategoryBak.value; |
154 | firstIndex.value += 1; | 153 | firstIndex.value += 1; |
155 | if ( | 154 | if ( |
156 | params.productFunctionId == "" && | 155 | params.productFunctionId == "" && |
157 | selectedFuncCategoryBak.value == "" | 156 | selectedFuncCategoryBak.value == "" |
158 | ) { | 157 | ) { |
158 | + categoryStore.selectedFuncCategory = selectedFuncCategoryBak.value; | ||
159 | params.productFunctionId = categoryStore.selectedFuncCategory; | 159 | params.productFunctionId = categoryStore.selectedFuncCategory; |
160 | + // categoryStore.selectedFuncCategory = selectedFuncCategoryBak.value; | ||
160 | } | 161 | } |
161 | console.log( | 162 | console.log( |
162 | params.productFunctionId, | 163 | params.productFunctionId, |
@@ -248,7 +249,6 @@ watchEffect(async () => { | @@ -248,7 +249,6 @@ watchEffect(async () => { | ||
248 | // const foundFuncCategory = funcCategoryList.value.find( | 249 | // const foundFuncCategory = funcCategoryList.value.find( |
249 | // (func) => func.name === functionName | 250 | // (func) => func.name === functionName |
250 | // ); | 251 | // ); |
251 | -// console.log(foundFuncCategory, "5656functionName"); | ||
252 | 252 | ||
253 | // if (foundFuncCategory) { | 253 | // if (foundFuncCategory) { |
254 | // const funcCategoryId = foundFuncCategory.id; | 254 | // const funcCategoryId = foundFuncCategory.id; |