Commit 10f5961296d9860f8cf2998c2006c77a7436de4e
1 parent
c3fd09af
feat: update 商品详情显示价格
Showing
4 changed files
with
34 additions
and
18 deletions
Too many changes to show.
To preserve performance only 4 of 5 files are displayed.
components/ProductDetail.vue
@@ -39,17 +39,19 @@ | @@ -39,17 +39,19 @@ | ||
39 | <tr class="bg-grey-lighten-3"> | 39 | <tr class="bg-grey-lighten-3"> |
40 | <th class="text-left headerBorder text-grey-darken-1">Product Name / Code</th> | 40 | <th class="text-left headerBorder text-grey-darken-1">Product Name / Code</th> |
41 | <th class="text-left headerBorder text-grey-darken-1">Specification and model</th> | 41 | <th class="text-left headerBorder text-grey-darken-1">Specification and model</th> |
42 | - <th class="text-left headerBorder text-grey-darken-1">Price</th> | 42 | + <th v-if="info.priceShow!==undefined && info.priceShow" class="text-left headerBorder text-grey-darken-1">Price</th> |
43 | + <th class="text-left headerBorder text-grey-darken-1">Actions</th> | ||
43 | </tr> | 44 | </tr> |
44 | </thead> | 45 | </thead> |
45 | <tbody> | 46 | <tbody> |
46 | <tr class="tr" v-for="item in info.ticketTypes || []" :key="item.rank"> | 47 | <tr class="tr" v-for="item in info.ticketTypes || []" :key="item.rank"> |
47 | <td class="td text-grey-darken-4 font-weight-medium">{{ item.rank }}</td> | 48 | <td class="td text-grey-darken-4 font-weight-medium">{{ item.rank }}</td> |
48 | <td class="td text-grey-darken-4 font-weight-medium">{{ item.typeName }}</td> | 49 | <td class="td text-grey-darken-4 font-weight-medium">{{ item.typeName }}</td> |
49 | - <!-- <td class="td">{{ item.price }}</td> --> | 50 | + <td v-if="item.priceShow" class="td">{{ item.price+" "+item.priceUnit }}</td> |
50 | <td class="td"> | 51 | <td class="td"> |
51 | - <v-btn size="small" color="blue-darken-1" @click="router.push('/contact')"> | ||
52 | - Quotation Inquiry | 52 | + <v-btn size="small" color="blue-darken-1" @click="router.push('/contact')"> |
53 | + <!-- Quotation Inquiry --> | ||
54 | + Quote | ||
53 | </v-btn> | 55 | </v-btn> |
54 | </td> | 56 | </td> |
55 | </tr> | 57 | </tr> |
deploy/prod.sh
1 | -#!/bin/bash | ||
2 | - | ||
3 | # 变量定义 | 1 | # 变量定义 |
4 | -IMAGE_NAME="canrud-outside-front" | ||
5 | -TAG="1.0.6" | ||
6 | -TAR_FILE="${IMAGE_NAME}_${TAG}.tar" | ||
7 | -REMOTE_HOST="root@112.74.45.244" | ||
8 | -REMOTE_DIR="/root/web/canrud-outside-nuxt-front" | 2 | +$IMAGE_NAME = "canrud-outside-front" |
3 | +$TAG = "1.0.7" | ||
4 | +$TAR_FILE = "${IMAGE_NAME}_${TAG}.tar" | ||
5 | +$REMOTE_HOST = "root@112.74.45.244" | ||
6 | +$REMOTE_DIR = "/root/web/canrud-outside-nuxt-front" | ||
9 | 7 | ||
10 | # 步骤1: 构建 Docker 镜像 | 8 | # 步骤1: 构建 Docker 镜像 |
11 | -echo "Building Docker image..." | 9 | +Write-Output "Building Docker image..." |
12 | docker build -t ${IMAGE_NAME}:${TAG} . | 10 | docker build -t ${IMAGE_NAME}:${TAG} . |
13 | 11 | ||
14 | # 步骤2: 将 Docker 镜像导出为 tar 文件 | 12 | # 步骤2: 将 Docker 镜像导出为 tar 文件 |
15 | -echo "Saving Docker image to tar file..." | 13 | +Write-Output "Saving Docker image to tar file..." |
16 | docker save -o ${TAR_FILE} ${IMAGE_NAME}:${TAG} | 14 | docker save -o ${TAR_FILE} ${IMAGE_NAME}:${TAG} |
17 | 15 | ||
18 | # 步骤3: 上传 tar 文件到服务器 | 16 | # 步骤3: 上传 tar 文件到服务器 |
19 | -echo "Uploading tar file to server..." | ||
20 | -scp ${TAR_FILE} ${REMOTE_HOST}:${REMOTE_DIR} | 17 | +Write-Output "Uploading tar file to server..." |
18 | +# 使用 PowerShell 的内置命令来实现 SCP 功能 | ||
19 | +$sourcePath = (Resolve-Path $TAR_FILE).Path | ||
20 | +$destinationPath = "${REMOTE_HOST}:${REMOTE_DIR}" | ||
21 | +Invoke-Expression "scp -o StrictHostKeyChecking=no $sourcePath $destinationPath" | ||
21 | 22 | ||
22 | -echo "All tasks completed!" | 23 | +Write-Output "All tasks completed!" |
23 | \ No newline at end of file | 24 | \ No newline at end of file |
nuxt.config.ts
@@ -39,6 +39,7 @@ export default defineNuxtConfig({ | @@ -39,6 +39,7 @@ export default defineNuxtConfig({ | ||
39 | devProxy: { | 39 | devProxy: { |
40 | '/shop': { | 40 | '/shop': { |
41 | target: 'http://47.89.254.121:8002/shop', // 线上代理地址 | 41 | target: 'http://47.89.254.121:8002/shop', // 线上代理地址 |
42 | + // target: 'http://127.0.0.1:8002/shop/**', | ||
42 | // target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名 | 43 | // target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名 |
43 | changeOrigin: true, // 表示是否跨域 | 44 | changeOrigin: true, // 表示是否跨域 |
44 | } | 45 | } |
@@ -47,6 +48,7 @@ export default defineNuxtConfig({ | @@ -47,6 +48,7 @@ export default defineNuxtConfig({ | ||
47 | routeRules: { | 48 | routeRules: { |
48 | '/shop/**': { | 49 | '/shop/**': { |
49 | proxy: 'http://47.89.254.121:8002/shop/**' | 50 | proxy: 'http://47.89.254.121:8002/shop/**' |
51 | + // proxy: 'http://127.0.0.1:8002/shop/**' | ||
50 | // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**' | 52 | // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**' |
51 | } | 53 | } |
52 | } | 54 | } |
pages/products/index.vue
@@ -56,7 +56,7 @@ import { watchEffect, computed, ref } from 'vue' | @@ -56,7 +56,7 @@ import { watchEffect, computed, ref } from 'vue' | ||
56 | const productStore = useProductListStore() | 56 | const productStore = useProductListStore() |
57 | const categoryStore = useCategoryStore() | 57 | const categoryStore = useCategoryStore() |
58 | const loading = ref(false) | 58 | const loading = ref(false) |
59 | - | 59 | +const route = useRoute() // 获取路由信息 |
60 | useHead({ | 60 | useHead({ |
61 | title: 'canrud', | 61 | title: 'canrud', |
62 | meta: [{ | 62 | meta: [{ |
@@ -74,7 +74,9 @@ useHead({ | @@ -74,7 +74,9 @@ useHead({ | ||
74 | } | 74 | } |
75 | ] | 75 | ] |
76 | }) | 76 | }) |
77 | -watchEffect(async () => { | 77 | + |
78 | + | ||
79 | +const loadProducts = async () => { | ||
78 | let params: any = { | 80 | let params: any = { |
79 | pageNo: productStore.pageNo, | 81 | pageNo: productStore.pageNo, |
80 | pageSize: 20 | 82 | pageSize: 20 |
@@ -102,6 +104,15 @@ watchEffect(async () => { | @@ -102,6 +104,15 @@ watchEffect(async () => { | ||
102 | await productStore.getList(params) | 104 | await productStore.getList(params) |
103 | } | 105 | } |
104 | loading.value = false | 106 | loading.value = false |
107 | +} | ||
108 | + | ||
109 | + | ||
110 | + | ||
111 | +watchEffect(async () => { | ||
112 | + if(route.query.keyword !== undefined){ | ||
113 | + productStore.keyword = route.query.keyword | ||
114 | + } | ||
115 | + loadProducts(); | ||
105 | }) | 116 | }) |
106 | 117 | ||
107 | const length = computed(() => | 118 | const length = computed(() => |