diff --git a/README-CDN.md b/README-CDN.md new file mode 100644 index 0000000..f60206b --- /dev/null +++ b/README-CDN.md @@ -0,0 +1,58 @@ +# 灵睿官网3.0 - CDN图片处理指南 + +## 静态生成模式下的CDN图片处理 + +本项目已配置为支持在使用 `nuxt generate` 静态生成模式下自动处理图片CDN路径。以下是相关功能和使用方法的说明。 + +### 配置说明 + +1. CDN基础URL已配置为 `https://cdn.web.0rui.cn/` +2. 在 `nuxt.config.ts` 中已添加相关配置 +3. 创建了专用的CDN图片处理插件和组件 + +### 使用方法 + +#### 方法一:使用CdnImage组件(推荐) + +```vue + +``` + +#### 方法二:使用全局$cdnImage方法 + +```vue + + + +``` + +### 路径处理规则 + +- 以 `public/` 开头的路径会自动转换为 `https://cdn.web.0rui.cn/img/...` +- 已经是完整URL的路径(以http://或https://开头)不会被修改 +- 其他路径会直接拼接CDN基础URL + +### 开发与生产环境 + +- 在开发环境中,默认使用本地路径,不进行CDN转换 +- 在生产环境(静态生成)中,自动应用CDN路径 +- 如需在开发环境中测试CDN路径,可以使用 `` 强制启用CDN + +### 静态生成命令 + +```bash +# 生成静态网站 +npm run generate + +# 预览生成的静态网站 +npm run preview +``` + +生成的静态文件将位于 `.output/public` 目录中,可以部署到任何静态文件服务器。 \ No newline at end of file diff --git a/app.vue b/app.vue index af859f5..4b22a9b 100644 --- a/app.vue +++ b/app.vue @@ -1,10 +1,14 @@ @@ -643,74 +639,156 @@ const submitForm = () => { } .group_666 .swiper-slide img { - width: 100%; - height: 500px; - height: auto; - transition: 1s linear 2s; - transform: scale(1.1, 1.1); + width: 100%; + height: 500px; + height: auto; + transition: 1s linear 2s; + transform: scale(1.1, 1.1); } .group_666 .swiper-slide-active img, .swiper-slide-duplicate-active img { - transition: 6s linear; - transform: scale(1, 1); + transition: 6s linear; + transform: scale(1, 1); } -.bottom_imgs{ + +.bottom_imgs { background: url(/public/img/qall.png); - width: 1230px; - height: 272px; - background-size: 100%; + background-size: 100%; } -.content_box{ - background: url(/public/img/m1.png);; - width: 561px;height: 521px; + +.content_box { + background: url(/public/img/m1.png); + width: 561px; + height: 521px; z-index: 1; position: absolute; - right: -12px; - bottom: -13px; - background-size: 100%; + right: -12px; + bottom: -13px; + background-size: 100%; } -.contactForm{ + +.contactForm { width: 100%; - .inputform{ + + .inputform { display: flex; justify-content: center; align-items: center; width: 1200px; } - + } -.contactInput{ + +.contactInput { width: 380px; -height: 50px; -background: #FFFFFF; -border-radius: 6px 6px 6px 6px; -padding-left: 20px; + height: 50px; + background: #FFFFFF; + border-radius: 6px 6px 6px 6px; + padding-left: 20px; } -.contactInput::placeholder {color: #768597; } -.contactInput:focus {outline: none;} -#myTextarea{ + +.contactInput::placeholder { + color: #768597; +} + +.contactInput:focus { + outline: none; +} + +#myTextarea { width: 1200px; height: 167px; background: #FFFFFF; border-radius: 6px 6px 6px 6px; opacity: 0.8; - padding-left: 20px;padding-top: 20px; + padding-left: 20px; + padding-top: 20px; resize: none; } -#myTextarea::placeholder {color: #768597; } -#myTextarea:focus {outline: none;} -.char-count {position: absolute;bottom: 5px; /* 根据需要调整距离底部的位置 */right: 10px; /* 根据需要调整距离右侧的位置 */font-size: 12px; /* 根据需要调整字体大小 */color: #A8CBFF;} -@media (max-width: 768px) { - .contactInput { - font-size: 18px; - height: 40px; - } + +#myTextarea::placeholder { + color: #768597; } -.contactBut{width: 108px; + +#myTextarea:focus { + outline: none; +} + +.char-count { + position: absolute; + bottom: 5px; + /* 根据需要调整距离底部的位置 */ + right: 10px; + /* 根据需要调整距离右侧的位置 */ + font-size: 12px; + /* 根据需要调整字体大小 */ + color: #A8CBFF; +} + +@media (max-width: 768px) { + .contactInput { + font-size: 18px; + height: 40px; + } +} + +.contactBut { + width: 108px; border-radius: 4px 4px 4px 4px; - position: absolute; - bottom: 20px; - right: 30px; -height: 36px; background-color: #222222; border: none; font-weight: 400;font-size: 16px;line-height: 28px;color: #FFFFFF;} + position: absolute; + bottom: 20px; + right: 30px; + height: 36px; + background-color: #222222; + border: none; + font-weight: 400; + font-size: 16px; + line-height: 28px; + color: #FFFFFF; +} + +.pop { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, .8); + z-index: 200; + display: none; +} + +.popCont { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} + +.pop_video_close { + border-radius: 50%; + position: absolute; + top: 0; + right: -75px; + width: 50px; + height: 50px; + background: url('/public/img/close.png') no-repeat 0 0; + background-size: 100% auto; + border: 6px solid #979797; +} + +.pop_video_cont { + width: 600px; + border: 6px solid #979797; + background: #000; +} + +.pop_video_cont video { + display: block; + width: 100%; + height: 100%; +} +strong{ +} diff --git a/pages/info/[id].vue b/pages/info/[id].vue new file mode 100644 index 0000000..76c7d30 --- /dev/null +++ b/pages/info/[id].vue @@ -0,0 +1,72 @@ + + + + + diff --git a/pages/proServices.vue b/pages/proServices.vue index fe7d2dc..f48cbfd 100644 --- a/pages/proServices.vue +++ b/pages/proServices.vue @@ -1,7 +1,7 @@