Commit 9b642ad1fbc1f565804a6b3af1b87bc317879d6e
Merge branch 'master' into by
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 | 39 | <tr class="bg-grey-lighten-3"> |
40 | 40 | <th class="text-left headerBorder text-grey-darken-1">Product Name / Code</th> |
41 | 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 | 44 | </tr> |
44 | 45 | </thead> |
45 | 46 | <tbody> |
46 | 47 | <tr class="tr" v-for="item in info.ticketTypes || []" :key="item.rank"> |
47 | 48 | <td class="td text-grey-darken-4 font-weight-medium">{{ item.rank }}</td> |
48 | 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 | 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 | 55 | </v-btn> |
54 | 56 | </td> |
55 | 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 | 8 | # 步骤1: 构建 Docker 镜像 |
11 | -echo "Building Docker image..." | |
9 | +Write-Output "Building Docker image..." | |
12 | 10 | docker build -t ${IMAGE_NAME}:${TAG} . |
13 | 11 | |
14 | 12 | # 步骤2: 将 Docker 镜像导出为 tar 文件 |
15 | -echo "Saving Docker image to tar file..." | |
13 | +Write-Output "Saving Docker image to tar file..." | |
16 | 14 | docker save -o ${TAR_FILE} ${IMAGE_NAME}:${TAG} |
17 | 15 | |
18 | 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 | 24 | \ No newline at end of file | ... | ... |
nuxt.config.ts
... | ... | @@ -39,6 +39,7 @@ export default defineNuxtConfig({ |
39 | 39 | devProxy: { |
40 | 40 | '/shop': { |
41 | 41 | target: 'http://47.89.254.121:8002/shop', // 线上代理地址 |
42 | + // target: 'http://127.0.0.1:8002/shop/**', | |
42 | 43 | // target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名 |
43 | 44 | changeOrigin: true, // 表示是否跨域 |
44 | 45 | } |
... | ... | @@ -47,6 +48,7 @@ export default defineNuxtConfig({ |
47 | 48 | routeRules: { |
48 | 49 | '/shop/**': { |
49 | 50 | proxy: 'http://47.89.254.121:8002/shop/**' |
51 | + // proxy: 'http://127.0.0.1:8002/shop/**' | |
50 | 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 | 56 | const productStore = useProductListStore() |
57 | 57 | const categoryStore = useCategoryStore() |
58 | 58 | const loading = ref(false) |
59 | - | |
59 | +const route = useRoute() // 获取路由信息 | |
60 | 60 | useHead({ |
61 | 61 | title: 'canrud', |
62 | 62 | meta: [{ |
... | ... | @@ -74,7 +74,9 @@ useHead({ |
74 | 74 | } |
75 | 75 | ] |
76 | 76 | }) |
77 | -watchEffect(async () => { | |
77 | + | |
78 | + | |
79 | +const loadProducts = async () => { | |
78 | 80 | let params: any = { |
79 | 81 | pageNo: productStore.pageNo, |
80 | 82 | pageSize: 20 |
... | ... | @@ -102,6 +104,15 @@ watchEffect(async () => { |
102 | 104 | await productStore.getList(params) |
103 | 105 | } |
104 | 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 | 118 | const length = computed(() => | ... | ... |