Compare commits
16 Commits
6af8fd7b09
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7722e19df | ||
|
|
0b974bd36a | ||
|
|
a067fd8357 | ||
|
|
367380e44c | ||
|
|
77dbabb1f1 | ||
|
|
f917062d76 | ||
|
|
093cf9acd0 | ||
|
|
5fa940e9ba | ||
|
|
f552dd370c | ||
|
|
fe9492ab69 | ||
|
|
d0779fe37c | ||
|
|
b0e9fe6450 | ||
|
|
631d54f269 | ||
|
|
0f038e7818 | ||
|
|
53f23d4e69 | ||
|
|
6ecc649a1c |
@@ -1,382 +1,335 @@
|
||||
---
|
||||
name: vue-project-structure
|
||||
description: cz-web 项目(Vue 3 + TypeScript + Vite 网页端站点)的目录结构与编码规范强制 skill。当在本项目中新增、创建、移动、重构或修改任何 src/ 下的代码文件(.vue/.ts/.less)、路由、store、API、组件、页面时,必须加载本 skill,先读取项目目录、再按本规范确定文件归属与写法。本项目是**网页端站点(非中后台)**:页面按名称组织(home/news/product…),接口层在 api/、数据层在 Pinia、页面只经 store 取数,样式使用**less**。凡是涉及"新文件放哪"、"页面数据怎么拿"、"页面/公共组件归属"、"命名"、"功能对应哪些文件"的任务也必须使用本 skill。
|
||||
version: 2.0.0
|
||||
description: Vue 3 与 uni-app(Vue3) 项目的目录结构与编码规范通用 skill。当在任意 Vue 3 或 uni-app(Vue3) 项目中新增、创建、移动、重构、修改 src/ 下的代码文件(.vue/.ts/.less/.scss)、路由、Pinia store、API、组件、页面、分包时,必须先加载本 skill。核心内容:先探测项目形态(Vue3 网页端/中后台 或 uni-app 小程序),再套用对应目录骨架;页面统一为「index.vue + cpns/」两件套(不使用 index.ts barrel);数据流固定为 页面 → store → api 单向;含 pages.json 注册与分包规范。凡是涉及"新文件放哪""页面数据怎么拿""公共组件 vs 页面私有组件归属""命名""分包""功能对应哪些文件"的任务也必须使用本 skill。本 skill 与具体仓库无关,可在任何 Vue 3 / uni-app 项目中直接复用。
|
||||
version: 4.0.0
|
||||
---
|
||||
|
||||
# cz-web 项目目录结构规范(强制 · 网页端)
|
||||
# Vue 3项目目录结构规范(通用 · 先探测后套用)
|
||||
|
||||
> 完整版调试文档见 `docs/vue-project-guide.md`(其中中后台相关部分已废弃),**本 skill 为唯一现行规范,以其为准**;未覆盖场景参照 Vue 3 官方目录约定。
|
||||
> 适用范围:**Vue 3**(含 uni-app 的 Vue 3 版本)。不涉及 Vue 2。
|
||||
> 本 skill 与具体仓库无关:执行顺序永远是 **① 探测现状 → ② 选定骨架变体 → ③ 按规范落位**。项目内已有显式文档(`AGENTS.md`/`CLAUDE.md`、`docs/` 下的结构说明)优先级高于本 skill。
|
||||
|
||||
## 第一步:读取项目目录(每次加载必做)
|
||||
---
|
||||
|
||||
动手写任何代码前,先用工具映射当前项目结构,确认正在操作的正确层级:
|
||||
## 第零步:探测项目形态(每次加载必做)
|
||||
|
||||
1. 用 `codegraph_files` 或 `glob` 列出 `src/` 下的现行目录结构(如某目录尚不存在,应在对应职责目录创建,而不是自创新顶层目录)。
|
||||
2. 读取目标文件及其同级文件,确认现有命名风格与组织方式(页面名、store 名、api 名必须一致)。
|
||||
3. 只有在目录树确认完毕后,才允许创建/修改文件。
|
||||
### 0.1 读取证据
|
||||
|
||||
## 核心原则
|
||||
| 要看什么 | 怎么看 |
|
||||
| ---------- | --------------------------------------------------------------------------- |
|
||||
| 依赖清单 | `package.json`:是否有 `@dcloudio/*`、`pinia`、`vue-router` |
|
||||
| 是否小程序 | 存在 `pages.json`、`manifest.json`;`App.vue` 含 `onLaunch` |
|
||||
| 构建工具 | `vite.config.*`(Vue 3 必配);`vue.config.*` 为 Vue CLI |
|
||||
| 目录现状 | 列出 `src/`(uni-app 通常无 src 包裹,直接根目录)的实际结构 |
|
||||
| 样式方案 | 现有 `.less` → less;`.scss` → scss |
|
||||
| 语言 | 有 `tsconfig.json` → TypeScript |
|
||||
| 目标平台 | `manifest.json` 的 `mp-weixin`/`h5`/`app` 等;`pages.json` 的 `subPackages` |
|
||||
|
||||
1. **三层数据流(页面 → store → api)**:页面组件只通过 **Pinia store** 获取数据;store 是数据层,负责调用 **api 层**接口取数并维护状态;api 层只发请求。**页面禁止直接 import api**。
|
||||
2. **按页面/页面名组织(一页一套)**:`views/<page>/`、`api/<page>.ts`、`stores/modules/<page>.ts`、`types/business/<page>.d.ts` 四者同名对应,方便分层查看。
|
||||
3. **组件两级归属**:`components/` 只放**跨页面复用的公共组件**;`views/<page>/cpns/` 放**该页面独有的组件**。
|
||||
4. **网页端(非中后台)**:无侧边栏菜单/权限路由/TabsBar 体系;页面以业务(首页、新闻、产品、关于我们…)划分。
|
||||
5. **样式使用 less**:全局样式为 `.less` 文件,组件内 `<style lang="less" scoped>`。
|
||||
### 0.2 判定形态
|
||||
|
||||
## 数据流架构(强约束)
|
||||
```mermaid
|
||||
graph TD
|
||||
A[读 package.json + 目录] --> B{含 @dcloudio/* ?}
|
||||
B -->|是| U[形态 B: uni-app Vue3]
|
||||
B -->|否| D{有 layout 壳 + 权限路由?}
|
||||
D -->|是| M[形态 A2: 中后台]
|
||||
D -->|否| W[形态 A1: 网页端站点]
|
||||
U --> U1{pages.json 有 subPackages?}
|
||||
U1 -->|是| U2[大应用: 必须分包]
|
||||
U1 -->|否| U3[小应用: 主包即可]
|
||||
```
|
||||
|
||||
| 形态 | 判据 | 骨架 |
|
||||
| ---------------------- | ---------------------------------------------- | ----------------------------------- |
|
||||
| **A1 Vue3 网页端站点** | 无权限路由,业务按页面名划分 | 骨架 A |
|
||||
| **A2 Vue3 中后台** | 有 `layout/` 壳、`permission.ts`、表格表单密集 | 骨架 A + 中后台补充 |
|
||||
| **B uni-app(Vue3)** | 依赖含 `@dcloudio/*`,存在 `pages.json` | 骨架 B(**页面注册用 pages.json**) |
|
||||
|
||||
### 0.3 探测结论必须先复述
|
||||
|
||||
动手改代码前,先输出:
|
||||
|
||||
```
|
||||
探测结论:形态=B uni-app(Vue3 + Vite + TS + Pinia + scss,含 subPackages 3 个)
|
||||
页面结构:index.vue + cpns/(无 index.ts)
|
||||
样式方案:scss(uni.scss 已存在)
|
||||
```
|
||||
|
||||
探测不明确时**先问用户**,不要猜。
|
||||
|
||||
---
|
||||
|
||||
## 第一步:读取目标区域(探测后必做)
|
||||
|
||||
1. 列出将要操作目录的现行结构(目录不存在则新建,**不要自创新顶层目录**)。
|
||||
2. 读取目标文件 + 同级 2 个文件,确认既有命名/导出/样式风格。
|
||||
3. 确认该业务域"页面 / api / store / 类型"在本项目中的实际路径。
|
||||
|
||||
---
|
||||
|
||||
## 核心原则(形态无关)
|
||||
|
||||
1. **三层数据流:页面 → store → api**。页面只通过 store 取数;store 调用 api 并维护状态;api 只发请求。**页面禁止直接 import api**。
|
||||
2. **业务同名单点**:同一业务域的 `页面目录` / `api 文件` / `store 文件` / `类型文件` 同名对应。
|
||||
3. **页面两件套(无 barrel)**:页面目录 = `index.vue` + `cpns/`。**不建 `index.ts`**,路由直接指向 `@/views/<page>/index.vue`。
|
||||
4. **组件两级归属**:跨 ≥2 个页面/分包复用 → 全局 `components/`;单页面独有 → 该页面的 `cpns/`。
|
||||
5. **技术选型跟随现状**:用 Pinia 就不引 Vuex;用 scss 就不写 less;用 TS 就不落 `.js`。**不擅自更换技术栈**。
|
||||
6. **最小改动**:只改与本次需求相关的行;无关死代码只报告、不删除。
|
||||
|
||||
---
|
||||
|
||||
## 骨架 A:Vue 3 网页端 / 中后台
|
||||
|
||||
```
|
||||
src/
|
||||
├── api/<domain>.ts # 接口层:按业务命名,一域一文件
|
||||
├── assets/ # 参与构建的静态资源(images/ icons/ fonts/)
|
||||
├── components/ # 跨页面复用的公共组件(禁含具体业务)
|
||||
│ └── index.ts # barrel 统一导出(仅公共组件目录需要)
|
||||
├── composables/ # 通用组合式逻辑(useLoading / useScroll / useCountDown)
|
||||
├── directives/ # 自定义指令(lazy / debounce / throttle)+ index.ts 注册
|
||||
├── layout/ # 全站骨架(网页端:Header+router-view+Footer)
|
||||
├── router/ # index.ts(createRouter)、routes.ts、guard.ts
|
||||
├── stores/
|
||||
│ ├── index.ts # pinia 实例
|
||||
│ └── modules/<domain>.ts
|
||||
├── styles/ # variables / mixins / reset / common + 入口
|
||||
├── types/ # api.d.ts / router.d.ts / business/<domain>.d.ts
|
||||
├── utils/ # request.ts(唯一 axios 实例)/ storage / validate / format
|
||||
└── views/
|
||||
└── <page>/ # ★ 页面 = index.vue + cpns/
|
||||
├── index.vue # 页面主组件(路由直接指向它)
|
||||
├── detail.vue # 同页面模块的次级页面(如列表/详情)
|
||||
└── cpns/ # 仅本页使用的组件
|
||||
├── Head.vue
|
||||
└── Banner.vue
|
||||
```
|
||||
|
||||
路由写法(**不经过 index.ts**):
|
||||
|
||||
```ts
|
||||
{
|
||||
path: '/news',
|
||||
name: 'News',
|
||||
component: () => import('@/views/news/index.vue'), // 直接指向 .vue
|
||||
meta: { title: '新闻列表' },
|
||||
}
|
||||
{
|
||||
path: '/news/:id',
|
||||
name: 'NewsDetail',
|
||||
component: () => import('@/views/news/detail.vue'),
|
||||
meta: { title: '新闻详情' },
|
||||
}
|
||||
```
|
||||
|
||||
### A2 中后台补充(在骨架 A 上增加)
|
||||
|
||||
```
|
||||
src/
|
||||
├── layout/
|
||||
│ ├── index.vue # 后台外壳:侧边栏 + 顶栏 + tab 缓存 + <router-view/>
|
||||
│ └── components/ # Sider / Header / Breadcrumb / TagsView
|
||||
├── router/
|
||||
│ ├── routes.ts # constantRoutes(无权限)
|
||||
│ └── modules.ts # asyncRoutes(按角色过滤)
|
||||
├── permission.ts # 守卫:登录态 → 白名单 → 动态路由注入
|
||||
├── stores/modules/ # user(token/角色/权限)、permission(动态路由)、app(侧栏/主题)
|
||||
└── views/<module>/<page>/ # 按模块再分页面,如 views/system/user/index.vue
|
||||
```
|
||||
|
||||
- 权限:`meta: { title, icon, roles: [], perms: [] }`,由 `permission.ts` 统一处理,页面用 `hasPermi('sys:user:add')` 判断。
|
||||
- 表格页统一结构:`搜索区 + 工具栏 + 表格 + 分页`,分页用公共 `Pagination` 组件。
|
||||
- 动态路由必须 `router.addRoute` 注入后 `next({ ...to, replace: true })`,避免空白页。
|
||||
|
||||
---
|
||||
|
||||
## 骨架 B:uni-app(Vue 3)
|
||||
|
||||
```
|
||||
├── pages.json # ★ 唯一页面注册入口(路径、导航栏、分包)
|
||||
├── manifest.json # 应用配置(appid、平台配置、原生插件)
|
||||
├── uni.scss # ★ 全局 scss 变量(uni-app 约定入口)
|
||||
├── App.vue # 全局生命周期 onLaunch/onShow/onHide
|
||||
├── main.ts # createApp、注册 pinia、引入全局样式
|
||||
├── api/<domain>.ts # 接口层(uni.request 封装为函数)
|
||||
├── stores/modules/<domain>.ts # 状态层
|
||||
├── utils/
|
||||
│ ├── request.ts # 封装 uni.request 的唯一请求层
|
||||
│ └── storage.ts # uni.getStorageSync 封装
|
||||
├── components/ # 跨页面/跨分包复用的自定义组件
|
||||
├── static/ # 不参与编译的静态资源(不要用 assets)
|
||||
├── composables/
|
||||
├── types/
|
||||
├── pages/ # ★ 主包页面
|
||||
│ ├── index/
|
||||
│ │ ├── index.vue
|
||||
│ │ └── cpns/
|
||||
│ └── login/
|
||||
│ ├── index.vue
|
||||
│ └── cpns/
|
||||
└── subpackages/ # 分包页面(仅分包项目)
|
||||
└── news/
|
||||
├── detail.vue
|
||||
└── cpns/
|
||||
```
|
||||
|
||||
uni-app 硬性约定:
|
||||
|
||||
- 页面**必须**在 `pages.json` 的 `pages` / `subPackages[].pages` 注册,路径不带扩展名、不以 `/` 开头。
|
||||
- 页面目录同样遵循 **`index.vue` + `cpns/`**,不建 `index.ts`。
|
||||
- 主包体积敏感:**非首屏必需**页面一律放 `subPackages`;静态大图放 `static/`。
|
||||
- 跨分包随意 import 受限;公共依赖优先放主包或做分包异步化。
|
||||
- 平台差异(`#ifdef MP-WEIXIN / H5 / APP-PLUS`)集中封装并注释,禁止散落全项目。
|
||||
- 用 `uni.request` / `uni.chooseImage` / `uni.navigateTo`,不混用 `wx.*`;tabBar 页用 `switchTab`(不能带参数)。
|
||||
- 组件模板优先 `view/text/image`,不用 `div/span/img`。
|
||||
|
||||
---
|
||||
|
||||
## 数据流架构(强约束,两形态通用)
|
||||
|
||||
```text
|
||||
页面组件 (views/home/index.vue)
|
||||
│ ① 页面只调用 store 的 action / 读取 store 的 state(模板渲染数据)
|
||||
页面组件 (views/news/index.vue 或 pages/news/index.vue)
|
||||
│ ① 只读 store state / 调 store action
|
||||
▼
|
||||
Pinia store (stores/modules/home.ts) —— 数据层
|
||||
│ ② store 的 action 内部调用 api 接口函数 → await → 写入 state / 返回结果
|
||||
状态层 (stores/modules/news.ts) —— 数据层:取数 + 状态 + 缓存 + 跨页共享
|
||||
│ ② action 内部调用 api 函数 → await → 写 state
|
||||
▼
|
||||
API (api/home.ts) —— 接口层
|
||||
│ ③ 经 utils/request.ts 发 HTTP 请求
|
||||
API (api/news.ts) —— 接口层:只发请求、只返回带类型的数据
|
||||
│ ③ request.ts(axios / uni.request 封装)
|
||||
▼
|
||||
后端服务器
|
||||
后端
|
||||
```
|
||||
|
||||
铁律:
|
||||
|
||||
- **页面禁止 `import` api 层文件**;获取数据必须调对应页面 store 的方法。
|
||||
- **api 层是纯接口层**:只发请求、返回数据(带类型),不做业务状态处理、不缓存。
|
||||
- **store 承担取数 + 数据状态 + 页面间共享 + 缓存**;与页面同名的 store 责任边界即该页面。
|
||||
- 调用链必须是 `页面 → store → api` 单向,禁止跳过 store 或反向依赖。
|
||||
- 页面**禁止** import api;取数必须走 store。
|
||||
- api 是**纯接口层**:不发业务判断、不缓存、不 toast。
|
||||
- store 承担取数、状态、缓存、跨页共享;本地缓存用 `storage.ts`,不直接写 `localStorage` / `uni.setStorageSync`。
|
||||
- 依赖方向单向:`页面 → store → api`,禁止反向与跨层直连。
|
||||
|
||||
## src/ 目录结构(强制划分)
|
||||
---
|
||||
|
||||
```
|
||||
src/
|
||||
├── api/ # ★ 接口层:按页面命名,一页一文件(home.ts、news.ts、product.ts、about.ts)
|
||||
├── assets/ # 参与构建的静态资源(images/、icons/、fonts/)
|
||||
├── components/ # ★ 公共组件:仅跨页面复用的全站通用组件(禁含具体页面业务)
|
||||
│ ├── AppHeader.vue # 全站头部(导航)
|
||||
│ ├── AppFooter.vue # 全站页脚
|
||||
│ ├── AppButton.vue # 通用按钮
|
||||
│ ├── AppSwiper.vue # 通用轮播
|
||||
│ └── index.ts # 统一导出
|
||||
├── composables/ # 通用组合式逻辑(useScroll、useLoading、useCountDown、useIntersection)
|
||||
├── directives/ # 自定义指令(lazy 图片懒加载、debounce、throttle + index.ts 统一注册)
|
||||
├── layout/ # 全站布局骨架:index.vue = <AppHeader/> + <router-view/> + <AppFooter/>
|
||||
├── router/ # 路由:index.ts(入口)、routes.ts(静态路由表)、guard.ts(守卫,可选)
|
||||
├── stores/ # ★ 数据层(Pinia):按页面命名,一页一 store
|
||||
│ ├── index.ts # pinia 实例(main.ts 中 app.use(pinia))
|
||||
│ └── modules/
|
||||
│ ├── home.ts # useHomeStore:首页数据(banner、推荐、公告)
|
||||
│ ├── news.ts # useNewsStore:新闻列表/分页/详情
|
||||
│ ├── product.ts # useProductStore:产品列表/详情
|
||||
│ └── site.ts # useSiteStore:站点公共数据(站点配置、全局 loading),非页面级
|
||||
├── styles/ # ★ 全局样式(less)
|
||||
│ ├── index.less # 样式入口(main.ts 引入),组织以下文件
|
||||
│ ├── variables.less # ★ less 变量唯一来源(颜色/间距/字号/圆角),禁止组件内魔法色值
|
||||
│ ├── mixins.less # 混合宏(flex、文本省略、滚动条)
|
||||
│ ├── reset.less # 样式重置
|
||||
│ └── common.less # 通用工具类(容器宽度、间距类)
|
||||
├── types/ # 类型定义
|
||||
│ ├── global.d.ts # 全局声明(Window 扩展、import.meta.env 兜底)
|
||||
│ ├── api.d.ts # 接口通用结构:ApiResponse<T>、PageResult<T>
|
||||
│ ├── router.d.ts # RouteMeta 扩展
|
||||
│ └── business/ # 按页面与 api 对应:home.d.ts / news.d.ts / product.d.ts
|
||||
├── utils/ # 纯函数工具(无 Vue 依赖):request.ts、storage.ts、validate.ts、format.ts
|
||||
└── views/ # ★ 页面:一页一目录
|
||||
├── home/
|
||||
│ ├── index.vue # 页面主组件(路由通过 index.ts 加载)
|
||||
│ ├── index.ts # 页面出口(barrel):export default 页面 + 导出本页独有组件
|
||||
│ └── cpns/ # 页面独有组件(head、banner、news-list 等,仅本页面使用)
|
||||
│ ├── Head.vue
|
||||
│ └── Banner.vue
|
||||
├── news/
|
||||
│ ├── index.vue # 列表页
|
||||
│ ├── detail.vue # 详情页
|
||||
│ ├── index.ts
|
||||
│ └── cpns/
|
||||
├── product/ # 同上结构
|
||||
├── about/ # 同上结构
|
||||
└── login/ # 登录(仅存在会员体系时)
|
||||
## 各层职责速查
|
||||
|
||||
| 层 | 目录 | 一句话职责 | 禁止 |
|
||||
| ------------ | --------------------------------------------------------- | ---------------------------------------- | ------------------------------ |
|
||||
| 页面 | `views/<page>/index.vue`(uni:`pages/<page>/index.vue`) | 渲染 + 交互 + 编排 | 直接调 api、直接 axios/request |
|
||||
| 页面私有组件 | `views/<page>/cpns/`(uni 同名) | 仅本页用 | 被其他页 import |
|
||||
| 公共组件 | `components/` | ≥2 处复用 | 含单页业务逻辑 |
|
||||
| 状态层 | `stores/modules/<domain>.ts` | 取数 + 状态 + 缓存 | 拼 URL、写 UI 逻辑 |
|
||||
| 接口层 | `api/<domain>.ts` | 请求分发 + 类型 | 状态、弹窗提示 |
|
||||
| 请求层 | `utils/request.ts` | 唯一实例/封装:token、统一解包、错误提示 | 被页面直接 import axios |
|
||||
| 工具 | `utils/`(纯函数) / `composables/`(响应式) | — | 互相混放 |
|
||||
|
||||
> **页面私有组件目录名统一用 `cpns/`**(不再用 `components/`,避免与全局 `components/` 混淆)。
|
||||
|
||||
### 组件归属判定(唯一判据)
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
A[新组件] --> B{被几个页面/分包使用?}
|
||||
B -->|1 个| C[放该页面 cpns/]
|
||||
B -->|≥2 个| D{业务无关还是业务相关?}
|
||||
D -->|业务无关<br/>按钮/弹窗/上传| E[全局 components/]
|
||||
D -->|业务相关| F[全局 components/<domain>/]
|
||||
F --> G[差异用 props 注入]
|
||||
```
|
||||
|
||||
**命名一致性(可分层互查)**:页面 `home` → `api/home.ts` + `stores/modules/home.ts`(`useHomeStore`) + `types/business/home.d.ts` + `views/home/`,四者同名。
|
||||
### 命名一致性
|
||||
|
||||
## src/ 每个文件的作用(新建/修改文件前先对照本节定位)
|
||||
同一业务域 `news` 的四层落位:
|
||||
|
||||
### 入口与根文件
|
||||
| 层 | Vue 形态 | uni-app 形态 |
|
||||
| -------- | ----------------------------------------- | ------------------------------------------ |
|
||||
| 页面 | `views/news/index.vue` | `pages/news/index.vue` + `pages.json` 注册 |
|
||||
| 私有组件 | `views/news/cpns/` | `pages/news/cpns/` |
|
||||
| 接口 | `api/news.ts` | `api/news.ts` |
|
||||
| 状态 | `stores/modules/news.ts` → `useNewsStore` | 同左 |
|
||||
| 类型 | `types/business/news.d.ts` | `types/business/news.d.ts` |
|
||||
|
||||
| 文件 | 作用 |
|
||||
| -------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `src/main.ts` | 应用入口:`createApp(App)`,注册 `pinia`、`router`、自定义指令(`setupDirectives`)、引入全局 `styles/index.less`。不写业务逻辑。 |
|
||||
| `src/App.vue` | 根组件,承载 `<router-view/>` 与全局过渡;不含业务代码。 |
|
||||
| `src/env.d.ts` | Vite 环境变量类型声明(`ImportMetaEnv` / `ImportMeta`)。 |
|
||||
---
|
||||
|
||||
### `api/` —— 接口层(一页一文件,与页面同名)
|
||||
|
||||
| 文件 | 作用 |
|
||||
| ---------------- | ------------------------------------------------------ |
|
||||
| `api/home.ts` | 首页接口:`getHomeBanner`、`getRecommend`、`getNotice` |
|
||||
| `api/news.ts` | 新闻接口:`getNewsList`、`getNewsDetail` |
|
||||
| `api/product.ts` | 产品接口:`getProductList`、`getProductDetail` |
|
||||
| `api/about.ts` | 关于我们/公司介绍接口 |
|
||||
| `api/auth.ts` | 登录/注册/用户信息(仅会员体系需要时) |
|
||||
|
||||
> **纯接口层**:函数只负责 `request<T>({ url, method, params/data })`,不做数据加工、不维护状态。新增页面 → 新建 `api/<page>.ts`。
|
||||
|
||||
### `components/` —— 公共组件(仅跨页面复用)
|
||||
|
||||
| 文件 | 作用 |
|
||||
| -------------------------- | ------------------------------------------------------------ |
|
||||
| `components/AppHeader.vue` | 全站头部:logo、导航菜单(路由跳转) |
|
||||
| `components/AppFooter.vue` | 全站页脚:版权、友链 |
|
||||
| `components/AppButton.vue` | 通用按钮(disabled/loading/类型统一) |
|
||||
| `components/AppSwiper.vue` | 通用轮播(首页 banner、产品图) |
|
||||
| `components/index.ts` | 统一导出(barrel),页面与页面组件统一从 `@/components` 导入 |
|
||||
|
||||
> 判定:被 ≥2 个页面使用 → 放这里;仅 1 个页面使用 → 放 `views/<page>/cpns/`。
|
||||
|
||||
### `composables/` —— 通用组合式逻辑(与 UI 解耦)
|
||||
|
||||
| 文件 | 作用 |
|
||||
| -------------------------------- | ------------------------ |
|
||||
| `composables/useScroll.ts` | 滚动监听/吸顶/回到顶部 |
|
||||
| `composables/useLoading.ts` | 请求 loading 状态管理 |
|
||||
| `composables/useCountDown.ts` | 倒计时(验证码等) |
|
||||
| `composables/useIntersection.ts` | 元素可见性(配合懒加载) |
|
||||
|
||||
### `directives/` —— 自定义指令
|
||||
|
||||
| 文件 | 作用 |
|
||||
| ------------------------ | --------------------------------------------- |
|
||||
| `directives/lazy.ts` | `v-lazy` 图片懒加载(网页端常用) |
|
||||
| `directives/debounce.ts` | `v-debounce` 防抖 |
|
||||
| `directives/throttle.ts` | `v-throttle` 节流 |
|
||||
| `directives/index.ts` | `setupDirectives(app)` 统一注册,main.ts 调用 |
|
||||
|
||||
### `layout/` —— 全站布局骨架
|
||||
|
||||
| 文件 | 作用 |
|
||||
| -------------------- | -------------------------------------------------------------------------- |
|
||||
| `layout/index.vue` | 全站公共布局:`<AppHeader/>` + `<router-view/>` + `<AppFooter/>`,仅此一层 |
|
||||
| `layout/components/` | 布局内部组件(如返回顶部按钮);需要全站复用的上移 `components/` |
|
||||
|
||||
### `router/` —— 路由系统(网页端:静态路由为主)
|
||||
|
||||
| 文件 | 作用 |
|
||||
| ------------------ | ------------------------------------------------------------------------- |
|
||||
| `router/index.ts` | 创建 `createRouter`(createWebHistory)+ 注册静态路由 + 挂守卫 |
|
||||
| `router/routes.ts` | 静态路由表:`/home`、`/news`、`/news/:id`、`/product`、`/about`、404 兜底 |
|
||||
| `router/guard.ts` | 路由守卫(可选):登录态校验(会员页)、滚动位置恢复、document.title |
|
||||
|
||||
```ts
|
||||
// 路由加载页面(指向 views/home/index.ts —— 页面出口)
|
||||
{
|
||||
path: '/home',
|
||||
name: 'Home',
|
||||
component: () => import('@/views/home'), // 解析到 index.ts 的 default(index.vue)
|
||||
meta: { title: '首页' },
|
||||
}
|
||||
```
|
||||
|
||||
### `stores/modules/` —— 数据层(Pinia,一页一 store,与页面同名)
|
||||
|
||||
| 文件 | 作用 |
|
||||
| --------------------------- | ------------------------------------------------------------------------------------------- |
|
||||
| `stores/modules/home.ts` | `useHomeStore`:state(banner/推荐/公告)+ actions(`fetchHomeData`,内部调 `api/home.ts`) |
|
||||
| `stores/modules/news.ts` | `useNewsStore`:列表/分页/详情 state + `fetchNewsList`、`fetchNewsDetail` |
|
||||
| `stores/modules/product.ts` | `useProductStore`:产品列表/详情/分类筛选 |
|
||||
| `stores/modules/site.ts` | `useSiteStore`:站点配置、全局 loading、主题(非页面级公共数据) |
|
||||
| `stores/modules/user.ts` | `useUserStore`:登录态/token(仅会员体系需要时) |
|
||||
|
||||
```ts
|
||||
// stores/modules/home.ts —— 数据层写法示例(页面 → store → api)
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
import { getHomeBanner, getRecommend } from '@/api/home'
|
||||
import type { Banner, RecommendItem } from '@/types/business/home'
|
||||
|
||||
export const useHomeStore = defineStore('home', () => {
|
||||
const banners = ref<Banner[]>([])
|
||||
const recommends = ref<RecommendItem[]>([])
|
||||
|
||||
async function fetchHomeData() {
|
||||
// ① store 调 api 层拿数据
|
||||
const [bannerData, recommendData] = await Promise.all([
|
||||
getHomeBanner(),
|
||||
getRecommend(),
|
||||
])
|
||||
// ② 写入 state——完成页面所需数据
|
||||
banners.value = bannerData
|
||||
recommends.value = recommendData
|
||||
}
|
||||
|
||||
return { banners, recommends, fetchHomeData }
|
||||
})
|
||||
```
|
||||
|
||||
### `styles/` —— 全局样式(less)
|
||||
|
||||
| 文件 | 作用 |
|
||||
| ----------------------- | ------------------------------------------------------------------------------------ |
|
||||
| `styles/index.less` | 入口,main.ts `import '@/styles/index.less'` |
|
||||
| `styles/variables.less` | ★ 变量唯一来源:`@primary-color`、`@text-color`、`@font-size-base`、`@spacing-base`… |
|
||||
| `styles/mixins.less` | 混合宏(flex、文本省略) |
|
||||
| `styles/reset.less` | 重置 |
|
||||
| `styles/common.less` | 通用工具类 |
|
||||
|
||||
组件内样式:`<style lang="less" scoped>`,变量经 vite `css.preprocessorOptions.less.additionalData` 自动注入 `@import '@/styles/variables.less';`,组件内直接使用 `@primary-color`。
|
||||
|
||||
### `types/` —— 类型定义
|
||||
|
||||
| 文件 | 作用 |
|
||||
| -------------------------- | --------------------------------------------------------------------- |
|
||||
| `types/api.d.ts` | `ApiResponse<T> { code, msg, data }`、`PageResult<T> { list, total }` |
|
||||
| `types/router.d.ts` | `declare module 'vue-router'` 扩展 `RouteMeta`(title 等) |
|
||||
| `types/business/home.d.ts` | 首页实体类型(Banner/RecommendItem),与 `api/home.ts` 对应 |
|
||||
| `types/business/news.d.ts` | 新闻实体(NewsItem/NewsQuery),与 `api/news.ts` 对应 |
|
||||
|
||||
> 新页面 → 新建 `types/business/<page>.d.ts`;禁止在组件内散落实体类型。
|
||||
|
||||
### `utils/` —— 纯函数工具
|
||||
|
||||
| 文件 | 作用 |
|
||||
| ------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `utils/request.ts` | ★ 唯一 axios 实例:拦截器注入 token/统一解包 `ApiResponse`/统一错误提示,导出 `request<T>`。组件与页面禁止再 import axios |
|
||||
| `utils/storage.ts` | localStorage/sessionStorage 泛型封装 |
|
||||
| `utils/validate.ts` | 校验规则(手机号/邮箱/URL) |
|
||||
| `utils/format.ts` | 格式化(金额/日期/千分位) |
|
||||
|
||||
### `views/` —— 页面(一页一目录,三件套:index.vue + index.ts + cpns/)
|
||||
|
||||
| 文件/目录 | 作用 |
|
||||
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
||||
| `views/home/index.vue` | 首页主组件:组合 `cpns/` 的独有组件,数据由 `useHomeStore` 提供 |
|
||||
| `views/home/index.ts` | **页面出口(barrel)**:`export { default } from './index.vue'` + 导出 `cpns/` 组件;路由与外部引用统一走它"展示"页面 |
|
||||
| `views/home/cpns/Head.vue` | 首页独有头部区块(banner 下导航条等),仅本页使用 |
|
||||
| `views/home/cpns/Banner.vue` | 首页独有轮播区块(渲染 store 的 banners) |
|
||||
| `views/news/index.vue` | 新闻列表页 |
|
||||
| `views/news/detail.vue` | 新闻详情页(与 index.vue 同目录,同页面模块) |
|
||||
| `views/news/index.ts` | 出口 barrel(同上) |
|
||||
| `views/news/cpns/` | 新闻页独有组件(筛选栏、列表项卡片) |
|
||||
|
||||
```ts
|
||||
// views/home/index.ts —— 页面出口(barrel)写法
|
||||
export { default } from './index.vue' // 页面主组件(default)
|
||||
export { default as HomeHead } from './cpns/Head.vue'
|
||||
export { default as HomeBanner } from './cpns/Banner.vue'
|
||||
```
|
||||
|
||||
> 页面独有组件的归属判定:**只属于某一个页面 → 进该页面 `cpns/`;被 ≥2 个页面共用 → 上移 `components/`**。
|
||||
|
||||
## 项目功能模块图(功能 → 涉及文件)
|
||||
|
||||
| 功能 | 涉及文件 | 说明 |
|
||||
| --------------------- | --------------------------------------------------------------------------------------- | ------------------------------ |
|
||||
| 全站布局(头部/页脚) | `layout/index.vue` + `components/AppHeader.vue` + `components/AppFooter.vue` | 路由首层挂在 layout 下 |
|
||||
| 首页 | `api/home.ts` + `stores/modules/home.ts` + `views/home/`(index.vue + index.ts + cpns) | 页面 → store → api 取数 |
|
||||
| 新闻中心 | `api/news.ts` + `stores/modules/news.ts` + `views/news/` | 列表 + 详情 |
|
||||
| 产品展示 | `api/product.ts` + `stores/modules/product.ts` + `views/product/` | 列表 + 详情 + 分类 |
|
||||
| 关于我们 | `api/about.ts` + `stores/modules/about.ts` + `views/about/` | 公司介绍内容 |
|
||||
| 会员登录(可选) | `api/auth.ts` + `stores/modules/user.ts` + `views/login/` + `router/guard.ts` | 登录态/token |
|
||||
| 轮播/动效 | `components/AppSwiper.vue` + `composables/useScroll.ts` + `directives/lazy.ts` | 首页 banner、图片懒加载 |
|
||||
| 站点公共数据 | `stores/modules/site.ts` + `styles/variables.less` | 站点配置、全局 loading、主题色 |
|
||||
|
||||
## 统一规范速查
|
||||
|
||||
### 路由规范
|
||||
|
||||
- 路由 `component` 指向页面出口:`() => import('@/views/<page>')`(解析到 `index.ts` 的 default = `index.vue`)
|
||||
- 每个路由必须声明 `meta.title`;`RouteMeta` 扩展在 `src/types/router.d.ts`
|
||||
- 网页端以静态路由为主,无需动态权限路由;嵌套页面(news 列表/详情)在同一页面目录下
|
||||
- 公共页面挂载在 `layout/index.vue` 下,页面自身不重复写 header/footer
|
||||
|
||||
### 状态管理(Pinia)规范 —— 数据层
|
||||
|
||||
- store 文件:`src/stores/modules/<page>.ts`,命名 `use<Page>Store`(PascalCase),与 api/views 同名
|
||||
- **统一组合式(setup)写法**:state 用 `ref`,getters 用 `computed`,actions 用普通函数,最后 return 全部
|
||||
- **store 的 action 负责调用对应页面 api 层的接口取数**,页面只调 action
|
||||
- 组件内:state/getters 用 `storeToRefs` 解构;actions 直接解构调用
|
||||
- 简单展示型数据也走 store(保持数据层统一),页面禁止直接 import api
|
||||
|
||||
### 接口 API 规范 —— 接口层
|
||||
|
||||
- **全项目唯一 axios 实例**在 `src/utils/request.ts`,禁止页面/组件 import axios
|
||||
- 统一响应结构 `ApiResponse<T> { code, msg, data }`(见 `types/api.d.ts`)
|
||||
- 接口函数名 = 动词 + 资源:`getHomeBanner` / `getNewsList` / `getNewsDetail` / `getProductList`
|
||||
- `api/<page>.ts` 只做请求分发,不做数据处理;处理与状态归 store
|
||||
- baseURL 用环境变量 `import.meta.env.VITE_API_BASE_URL` 区分环境(.env / .env.development / .env.production)
|
||||
- 错误统一由拦截器兜底,store/页面仅在需特殊处理时 catch
|
||||
## 规范速查(形态无关的硬性项)
|
||||
|
||||
### 组件规范
|
||||
|
||||
- 公共组件 `components/`:文件 PascalCase(AppHeader.vue);被 ≥2 页面使用才放这里
|
||||
- 页面独有组件 `views/<page>/cpns/`:**严禁被其他页面 import**;语义化命名(Head.vue、Banner.vue)
|
||||
- 页面结构三件套:`index.vue`(页面) + `index.ts`(出口 barrel) + `cpns/`(独有组件)
|
||||
- 组件统一 `<script setup lang="ts">`;props 用 `defineProps<Props>()` + `withDefaults`;emits 用 `defineEmits<{ 事件名: [参数类型] }>()`
|
||||
- 组件事件 camelCase 命名;模板内不放复杂表达式;样式默认 `<style lang="less" scoped>`
|
||||
- 单文件超 400 行即拆分到 `cpns/`
|
||||
- 统一 `<script setup lang="ts">`。
|
||||
- props:`defineProps<Props>()` + `withDefaults`;emits:`defineEmits<{ change: [val: number] }>()`,事件名 camelCase。
|
||||
- 模板内不写复杂表达式(超过一次三元/逻辑运算即抽方法或 computed)。
|
||||
- 单文件 > 400 行 → 拆到同页面 `cpns/`。
|
||||
- uni-app 组件模板用 `view/text/image`。
|
||||
|
||||
### 样式规范(less)
|
||||
### 样式规范
|
||||
|
||||
- 全项目使用 **less**,禁止新增 `.scss/.css` 业务样式
|
||||
- 全局变量统一在 `styles/variables.less`;组件内禁止魔法色值
|
||||
- vite `css.preprocessorOptions.less` 配置 `additionalData` 自动注入 variables
|
||||
- 依赖:`pnpm add -D less`(vite 内置 less 编译支持)
|
||||
- **跟随项目既有方案**(less 或 scss),不混用两套预处理器。
|
||||
- 变量单一来源:Vue 项目 `src/styles/variables.*`;uni-app 项目 `uni.scss`。
|
||||
- 组件内禁止魔法色值/魔法间距。
|
||||
- Vue 项目:`<style scoped lang="less|scss">`;uni-app 页面样式**不加 `scoped`**(小程序不支持),靠类名隔离。
|
||||
|
||||
### 工程化硬性约定
|
||||
### 类型规范
|
||||
|
||||
- **导入一律 `@/` 别名**;禁止跨目录相对路径(`../` 超过一层即违规)
|
||||
- utils 与 composables 判据:**需要响应式状态或生命周期 → composables;否则 → utils**
|
||||
- 类型归位:实体类型 → `types/business/<page>.d.ts`(与 api 同名);接口结构 → `types/api.d.ts`
|
||||
- **禁止 `as any` / `@ts-ignore` / `@ts-expect-error`**
|
||||
- 实体类型 → `types/business/<domain>.d.ts`;接口通用结构 → `types/api.d.ts`。
|
||||
- **禁止** `as any` / `@ts-ignore` / `@ts-expect-error`。
|
||||
|
||||
## 后续使用方式(工作流)
|
||||
### 导入规范
|
||||
|
||||
### 场景速查:想做什么 → 去找哪个文件
|
||||
- 有别名(`@/`)的项目一律用别名;禁止多级跨层 `../../../`。
|
||||
- uni-app 需在 `vite.config` 的 `resolve.alias` 或 `tsconfig` 的 `paths` 配置 `@/`。
|
||||
|
||||
| 想做的事 | 动哪个文件 | 注意 |
|
||||
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
|
||||
| 给首页加一块新数据 | `api/home.ts` 加接口函数 → `stores/modules/home.ts` 加 action/state → `views/home/index.vue` 调 store action,结构放 `views/home/cpns/` 新组件 | 遵循数据流:页面 → store → api |
|
||||
| 新增一个页面模块(如 news) | `types/business/news.d.ts` → `api/news.ts` → `stores/modules/news.ts` → `views/news/`(index.vue+index.ts+cpns) → `router/routes.ts` 注册 | 四者同名,走七步流程 |
|
||||
| 页面要取数据 | 调对应 `use<Page>Store` 的 action(`storeToRefs` 取 state) | **禁止直接 import api** |
|
||||
| 一个组件多个页面要用 | 放 `components/`(公共组件) | 从 `@/components` 导入 |
|
||||
| 一个组件只有本页面用 | 放 `views/<page>/cpns/` | 禁止其他页面引用 |
|
||||
| 改全站颜色/字体/间距 | `styles/variables.less` | 禁止组件内魔法值 |
|
||||
| 图片懒加载 | 模板 `v-lazy`(`directives/lazy.ts`) | 勿手写滚动判断 |
|
||||
| 通用逻辑(响应式) | `composables/` | 纯函数则 `utils/` |
|
||||
| 弹窗/表单等小块 | 页面内 `cpns/` | 复用时上移 components/ |
|
||||
| 路由新增页面 | `router/routes.ts` 注册 | component 指向 `@/views/<page>` |
|
||||
### 请求规范
|
||||
|
||||
### 新增页面模块七步流程(以"新闻 news"为例)
|
||||
- 全项目**唯一**请求实例/封装:`utils/request.ts`;页面与组件禁止直接 `axios` / `uni.request` / `fetch`。
|
||||
- baseURL 走环境变量(`import.meta.env.VITE_*`)。
|
||||
- 错误统一由拦截器兜底,业务侧仅在需要特殊处理时 `catch`。
|
||||
|
||||
1. **类型**:`types/business/news.d.ts` 定义 `NewsItem / NewsQuery / PageResult`
|
||||
2. **接口层**:`api/news.ts`(`getNewsList`、`getNewsDetail`,走 `request<T>`)
|
||||
3. **数据层**:`stores/modules/news.ts`(`useNewsStore`,action 内调用 api 函数取数)
|
||||
4. **页面**:`views/news/index.vue`(列表)+ `views/news/detail.vue`(详情)+ `views/news/index.ts`(出口 barrel)+ `views/news/cpns/`(独有组件)
|
||||
5. **路由**:`router/routes.ts` 注册(`component: () => import('@/views/news')`,配 `meta.title`)
|
||||
6. **复用检查**:被 ≥2 页面使用的组件上移 `components/`
|
||||
7. **验证**:`pnpm build`(含 vue-tsc 类型检查)零错误
|
||||
---
|
||||
|
||||
### 日常开发姿势
|
||||
## 工作流
|
||||
|
||||
- **每次动手前**:按"第一步"读取目录,确认目标文件存在与现状,再决定新建还是修改。
|
||||
- **新建文件前**:对照"src/ 每个文件的作用"确认归属(api/stores/views 四者同名)。
|
||||
- **改数据相关代码**:先确认数据流方向——页面只碰 store,store 只碰 api,api 只发请求。
|
||||
- **组件归属**:先自问"有几个页面用它"——1 个 → cpns/;≥2 个 → components/。
|
||||
- **规格冲突时**:本 skill 为唯一现行规范;未覆盖场景 → 询问用户或按最贴近的既有模式执行后复述假设。
|
||||
### 场景速查:想做什么 → 改哪些文件
|
||||
|
||||
| 想做的事 | 动作 |
|
||||
| ---------------------- | ------------------------------------------------------------------------------------------ |
|
||||
| 给已有页面加一块新数据 | api 加函数 → store 加 action/state → 页面调 action,UI 放该页 `cpns/` 新组件 |
|
||||
| 新增业务模块 | 类型 → api → store → 页面目录(index.vue + cpns/) → 路由(Vue)或 `pages.json`(uni-app) |
|
||||
| 页面要取数据 | 调 `use<Domain>Store`;**禁止**直接 import api |
|
||||
| 组件多页要用 | 上移 `components/` |
|
||||
| 组件仅本页用 | 留在该页面 `cpns/` |
|
||||
| 改全局颜色/间距 | 样式变量文件(`variables.*` / `uni.scss`) |
|
||||
| 小程序主包体积超标 | 把非首屏页面迁入 `subPackages` |
|
||||
|
||||
### 新增业务模块流程(以 `news` 为例)
|
||||
|
||||
1. **类型** `types/business/news.d.ts`
|
||||
2. **接口** `api/news.ts`
|
||||
3. **状态** `stores/modules/news.ts`(action 内调 api)
|
||||
4. **页面** `views/news/index.vue`(或 `pages/news/index.vue`)+ `cpns/`
|
||||
5. **注册** `router/routes.ts`(`component: () => import('@/views/news/index.vue')`)或 `pages.json`
|
||||
6. **复用检查** ≥2 处复用的上移 `components/`
|
||||
7. **验证** 类型检查 + 构建零错误(`pnpm build` / `npm run build` / `vue-tsc --noEmit`)
|
||||
|
||||
### 最小改动纪律
|
||||
|
||||
- 每次动手前先读现状,确认是"新建"还是"修改"。
|
||||
- 只碰与需求相关的行;不顺手重构、不顺手换技术栈。
|
||||
- 规范冲突时:项目内显式文档 > 本 skill;本 skill 未覆盖时,先说明假设再执行。
|
||||
|
||||
---
|
||||
|
||||
## 修改代码时的强制检查清单
|
||||
|
||||
修改任何已存在文件时,逐条核对(不满足即视为违反规范,必须先修正再继续):
|
||||
修改任何已存在文件时逐条核对,不满足必须先修正:
|
||||
|
||||
- [ ] 文件是否位于其职责对应的目录(接口在 api/、数据在 stores/modules/、页面在 views/<page>/ 等)
|
||||
- [ ] **页面是否直接 import 了 api 层?(违规——数据必须经 store)**
|
||||
- [ ] **store 名 / api 文件名 / 页面目录名 / 类型文件名 是否与页面一致(可分层互查)**
|
||||
- [ ] 导入是否使用 `@/` 别名
|
||||
- [ ] 组件归属是否正确:≥2 页面共用 → components/;单页面独有 → views/<page>/cpns/
|
||||
- [ ] 不在组件里直接 new axios 实例 / 直接调用原生 fetch
|
||||
- [ ] 样式是否使用 **less**(`<style lang="less" scoped>` / \*.less),颜色是否取自 variables.less
|
||||
- [ ] 类型是否齐全(无 `as any`、无 `@ts-ignore`)
|
||||
- [ ] 新页面是否有完整三件套(index.vue + index.ts + cpns/)并在 router 注册
|
||||
- [ ] 运行时 `pnpm build`(含 vue-tsc 类型检查)零错误
|
||||
- [ ] 文件位于其职责对应目录(接口在 api/、状态在 stores/、页面在 views|pages/)
|
||||
- [ ] **页面是否直接 import 了 api?**(违规)
|
||||
- [ ] api / store / 页面 / 类型 是否同业务域命名一致
|
||||
- [ ] 页面目录是否只有 `index.vue`(+ 同模块次级页面)+ `cpns/`,**没有多余 `index.ts`**
|
||||
- [ ] 私有组件是否在 `cpns/` 且无其他页面 import
|
||||
- [ ] 导入使用 `@/` 别名,无多级跨层相对路径
|
||||
- [ ] 未在组件内直接 `axios` / `uni.request` / `fetch`
|
||||
- [ ] 样式沿用项目既有预处理器,色值取自变量文件
|
||||
- [ ] uni-app:新页面已在 `pages.json` 注册;未把非首屏页放进主包;页面样式未加 `scoped`
|
||||
- [ ] 无 `as any` / `@ts-ignore`
|
||||
- [ ] 构建/类型检查零错误
|
||||
|
||||
> 本规范为项目强约束:**新增与修改的代码必须严格遵循**。发现不符合结构约定的代码,应指出问题并要求按规范调整,而不是放任通过。
|
||||
> 发现不符合规范的历史代码:**指出问题并给出改法**,除非本次需求正好涉及,否则不擅自批量重构。
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -19,6 +19,7 @@ RTK.md
|
||||
specs2
|
||||
.shots
|
||||
docs
|
||||
.claude
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
|
||||
@@ -344,60 +344,61 @@ export function submitFeedback(feedback: Feedback): Promise<void> {
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
/** TODO(api): 后端帮助中心接口就绪后改为 request 调用;暂用设计稿假数据 */
|
||||
export function getHelpFaqs(): Promise<HelpFaqGroup[]> {
|
||||
return Promise.resolve([
|
||||
{
|
||||
title: '1. 账户与登录',
|
||||
title: '账户与登录',
|
||||
items: [
|
||||
{
|
||||
q: '如何注册账号?',
|
||||
a: '点击页面右上角"注册",输入手机号并获取验证码,设置 6-20 位登录密码即可完成注册。',
|
||||
q: '如何注册账号?',
|
||||
a: '打开APP后点击“注册”,输入手机号获取验证码,设置登录密码即可完成注册。',
|
||||
},
|
||||
{
|
||||
q: '忘记密码怎么办?',
|
||||
a: '在登录页点击"忘记密码",通过绑定手机号验证码验证身份后即可重新设置密码。',
|
||||
q: '忘记密码怎么办?',
|
||||
a: '在登录页面点击“忘记密码”,输入注册手机号获取验证码,验证通过后即可重置新密码。',
|
||||
},
|
||||
{
|
||||
q: '一个账号可以多地登录吗?',
|
||||
a: '同一账号同时仅允许在 1 台设备上保持在线,超出将自动踢出最早登录的设备。',
|
||||
q: '一个账号可以多端登录吗?',
|
||||
a: '同一账号仅允许在 1 台设备上保持在线,超出将自动踢出最早登录的设备。',
|
||||
},
|
||||
{
|
||||
q: '如何修改绑定手机号?',
|
||||
a: '进入 个人中心 → 账号安全 → 绑定手机,验证原手机号后即可绑定新号码。',
|
||||
q: '如何修改绑定手机号?',
|
||||
a: '进入「我的 -> 设置 -> 账户安全 -> 更换手机号」,验证原手机号后即可绑定新号码。',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '2. 功能使用指南',
|
||||
title: '功能使用指南',
|
||||
items: [
|
||||
{
|
||||
q: '如何提交需求?',
|
||||
a: '进入"发布需求"页面,填写需求描述、预算、周期等信息并提交,专业顾问将在一个工作日内与您联系。',
|
||||
q: '如何提交报修/工单?',
|
||||
a: '首页点击「报修」 -> 选择报修类型 -> 填写问题描述并上传图片 -> 提交。提交后可在「我的 -> 我的工单」中查看处理进度。',
|
||||
},
|
||||
{
|
||||
q: '如何查看我的消息?',
|
||||
a: '登录后点击右上角消息图标,或进入 个人中心 → 消息通知,即可查看系统通知与顾问消息。',
|
||||
q: '如何预约会议室?',
|
||||
a: '进入「服务 -> 会议室预订」,选择日期、时间段及会议室,确认后提交预约,预约成功将收到消息通知。',
|
||||
},
|
||||
{
|
||||
q: '如何申请售后?',
|
||||
a: '在"我的订单"中找到对应项目,点击"申请售后"填写问题描述并上传附件,平台将尽快为您处理。',
|
||||
q: '如何查看我的消息通知?',
|
||||
a: '首页右上角铃铛图标进入消息中心,支持按“全部 / 未读 / 系统通知 / 业务提醒”分类查看。',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '3. 系统与权限',
|
||||
title: '系统与权限',
|
||||
items: [
|
||||
{
|
||||
q: '无权限怎么办?',
|
||||
a: '请确认当前账号角色是否具备该模块权限;如仍无法访问,请联系专属客服或平台管理员为您开通。',
|
||||
q: 'APP提示“无权限”怎么办?',
|
||||
a: '部分功能需要管理员授权后方可使用,请联系贵司系统管理员为您分配对应角色权限。',
|
||||
},
|
||||
{
|
||||
q: '收不到通知怎么办?',
|
||||
a: '请检查浏览器通知权限与消息设置是否开启;若仍未收到,请联系客服核实账号通知配置。',
|
||||
q: '为什么收不到推送通知?',
|
||||
a: '请检查:①手机系统设置中是否允许本APP发送通知;②APP内「我的 -> 设置 -> 消息推送」是否已开启。',
|
||||
},
|
||||
{
|
||||
q: '支持哪些浏览器?',
|
||||
a: '推荐使用 Chrome、Edge、Firefox、Safari 等主流浏览器的最新版本访问本平台。',
|
||||
q: 'APP支持哪些系统版本?',
|
||||
a: 'iOS 13.0 及以上版本,Android 8.0 及以上版本。建议使用最新系统版本以获得最佳体验。',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
BIN
src/assets/home/chahua.png
Normal file
BIN
src/assets/home/chahua.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.0 KiB |
@@ -85,90 +85,71 @@ const coreBusiness = [
|
||||
|
||||
<style lang="less" scoped>
|
||||
.app-footer {
|
||||
// 设计稿:footer 顶 y=1942,总高 481px。各行绝对坐标换算为相对 footer 顶:
|
||||
// 列标题 54 / 内容首行 115 / legal[0] 332 / legal[1] 371。
|
||||
min-height: @footer-height;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: @footer-bg;
|
||||
color: @white;
|
||||
padding: @spacing-xl 0 @spacing-base;
|
||||
|
||||
&__inner {
|
||||
.flex(row, flex-start, flex-start);
|
||||
.flex(row, space-between, flex-start);
|
||||
flex-wrap: wrap;
|
||||
gap: @spacing-xl;
|
||||
width: 100%;
|
||||
max-width: 1920px;
|
||||
max-width: @page-content;
|
||||
margin: 0 auto;
|
||||
height: 250px;
|
||||
box-sizing: border-box;
|
||||
padding-top: 54px;
|
||||
padding-left: clamp(
|
||||
@spacing-base,
|
||||
calc((100% - 1609px) / 2),
|
||||
155px
|
||||
);
|
||||
overflow: hidden;
|
||||
padding: 0 @page-gutter;
|
||||
}
|
||||
|
||||
&__about {
|
||||
flex: 0 1 625px; // x155 → 780
|
||||
flex: 0 1 360px;
|
||||
max-width: 420px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__brand {
|
||||
.flex(row, flex-start);
|
||||
margin-bottom: 20px;
|
||||
margin-left: 45px;
|
||||
margin-bottom: @spacing-sm;
|
||||
}
|
||||
|
||||
&__name {
|
||||
font-size: 28px;
|
||||
font-size: @font-size-lg;
|
||||
font-weight: 500;
|
||||
line-height: 41px;
|
||||
line-height: 1.4;
|
||||
color: @white;
|
||||
}
|
||||
|
||||
&__desc {
|
||||
margin-top: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 23px;
|
||||
margin: 0;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
line-height: 1.6;
|
||||
color: fade(@white, 72%);
|
||||
}
|
||||
|
||||
&__col {
|
||||
.flex(column, flex-start, flex-start);
|
||||
gap: 0;
|
||||
gap: 2px;
|
||||
flex: 0 0 auto;
|
||||
min-width: 0;
|
||||
|
||||
&--core {
|
||||
flex: 0 0 193px;
|
||||
margin-left: 142px;
|
||||
}
|
||||
&--nav {
|
||||
flex: 0 0 80px;
|
||||
margin-left: 142px;
|
||||
}
|
||||
&--contact {
|
||||
flex: 0 0 253px;
|
||||
margin-left: 174px;
|
||||
}
|
||||
}
|
||||
|
||||
&__title {
|
||||
margin-bottom: 20px;
|
||||
font-size: 28px;
|
||||
margin: 0 0 @spacing-sm;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
line-height: 41px;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
color: @white;
|
||||
}
|
||||
|
||||
&__link {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 23px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
line-height: 1.7;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
transition: color 0.2s;
|
||||
color: fade(@white, 72%);
|
||||
|
||||
&:hover {
|
||||
color: @primary-light;
|
||||
@@ -176,32 +157,31 @@ const coreBusiness = [
|
||||
}
|
||||
|
||||
&__contact {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 23px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
line-height: 1.7;
|
||||
color: fade(@white, 72%);
|
||||
}
|
||||
|
||||
&__bottom {
|
||||
width: 867px;
|
||||
max-width: calc(100% - 32px);
|
||||
margin: 0 auto;
|
||||
padding-bottom: 20px;
|
||||
text-align: left;
|
||||
// legal[0] 需落在相对 footer 顶 332px 处
|
||||
margin-top: 62px;
|
||||
width: 100%;
|
||||
max-width: @page-content;
|
||||
margin: @spacing-lg auto 0;
|
||||
padding: @spacing-base @page-gutter 0;
|
||||
border-top: 1px solid fade(@white, 10%);
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__legal {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
line-height: 23px;
|
||||
white-space: nowrap;
|
||||
color: @white;
|
||||
font-size: @font-size-xs;
|
||||
font-weight: 400;
|
||||
line-height: 1.6;
|
||||
color: fade(@white, 55%);
|
||||
|
||||
&--icp {
|
||||
margin-top: 16px;
|
||||
margin-left: 315px;
|
||||
margin-top: @spacing-xs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from 'vue'
|
||||
import { computed, onMounted } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useMessageStore } from '@/stores/modules/message'
|
||||
|
||||
@@ -18,6 +19,18 @@ const navItems: NavItem[] = [
|
||||
{ label: '个人中心', path: '/profile' },
|
||||
]
|
||||
|
||||
// 首页 path 为 '/',是其它所有路径的前缀;用 Vue Router 默认的
|
||||
// router-link-active(包含匹配)会导致首页在所有页面都被点亮。
|
||||
// 这里自算激活态:首页仅严格等于 '/' 时高亮,其它菜单等于其路径或以 '/path/' 开头
|
||||
// (覆盖子路由,如 /project/123 点亮「项目中心」)。
|
||||
const route = useRoute()
|
||||
const activePath = computed(() => route.path)
|
||||
function isActive(item: NavItem): boolean {
|
||||
const current = activePath.value
|
||||
if (item.path === '/') return current === '/'
|
||||
return current === item.path || current.startsWith(item.path + '/')
|
||||
}
|
||||
|
||||
const messageStore = useMessageStore()
|
||||
const { unreadCount } = storeToRefs(messageStore)
|
||||
onMounted(() => void messageStore.fetchUnreadCount())
|
||||
@@ -32,6 +45,7 @@ onMounted(() => void messageStore.fetchUnreadCount())
|
||||
:key="item.path"
|
||||
:to="item.path"
|
||||
class="app-header__nav-item"
|
||||
:class="{ 'app-header__nav-item--active': isActive(item) }"
|
||||
>
|
||||
{{ item.label }}
|
||||
</RouterLink>
|
||||
@@ -92,29 +106,29 @@ onMounted(() => void messageStore.fetchUnreadCount())
|
||||
|
||||
&__nav {
|
||||
.flex(row, center);
|
||||
gap: @header-nav-gap;
|
||||
gap: clamp(@spacing-lg, 4vw, 56px);
|
||||
height: 100%;
|
||||
|
||||
&-item {
|
||||
position: relative;
|
||||
.flex(row, center);
|
||||
height: 100%;
|
||||
font-size: 18px;
|
||||
font-size: @font-size-md;
|
||||
font-weight: 500;
|
||||
color: @black;
|
||||
color: @heading-color;
|
||||
transition: color 0.2s;
|
||||
|
||||
&:hover,
|
||||
&.router-link-active {
|
||||
&--active {
|
||||
color: @home-tab-active;
|
||||
}
|
||||
|
||||
&.router-link-active::after {
|
||||
&--active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: 11px;
|
||||
width: 29px;
|
||||
bottom: 12px;
|
||||
width: 24px;
|
||||
height: 2px;
|
||||
border-radius: 1px;
|
||||
background: @home-tab-active;
|
||||
@@ -125,20 +139,21 @@ onMounted(() => void messageStore.fetchUnreadCount())
|
||||
|
||||
&__actions {
|
||||
.flex(row, flex-end, center);
|
||||
gap: 29px;
|
||||
gap: @spacing-base;
|
||||
margin-left: auto;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&__action {
|
||||
.flex(row, center);
|
||||
gap: 5px;
|
||||
width: 106px;
|
||||
gap: @spacing-xs;
|
||||
min-width: 96px;
|
||||
height: 36px;
|
||||
border-radius: @radius-sm;
|
||||
padding: 0 @spacing-base;
|
||||
border-radius: @radius-round;
|
||||
background: @primary-color;
|
||||
color: @white;
|
||||
font-size: 16px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
transition: opacity 0.2s;
|
||||
|
||||
@@ -147,8 +162,8 @@ onMounted(() => void messageStore.fetchUnreadCount())
|
||||
}
|
||||
|
||||
&-icon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +197,7 @@ onMounted(() => void messageStore.fetchUnreadCount())
|
||||
}
|
||||
|
||||
&__login {
|
||||
font-size: 16px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,16 +97,16 @@ const meta = computed<Array<{ label: string; value: string }>>(() => [
|
||||
|
||||
&__tag {
|
||||
position: absolute;
|
||||
top: 87px;
|
||||
left: 22px;
|
||||
height: 44px;
|
||||
padding: 0 14px;
|
||||
top: 12px;
|
||||
left: 12px;
|
||||
height: 28px;
|
||||
padding: 0 @spacing-sm;
|
||||
border-radius: @radius-sm;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 28px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
line-height: 44px;
|
||||
line-height: 28px;
|
||||
|
||||
&--hardware {
|
||||
background: @tag-hardware;
|
||||
|
||||
@@ -292,15 +292,15 @@ function clearChips(): void {
|
||||
<style lang="less" scoped>
|
||||
.case-filter {
|
||||
flex-shrink: 0;
|
||||
width: 516px;
|
||||
padding: 15px 0 40px;
|
||||
width: @cases-filter-width;
|
||||
padding: @spacing-lg 0 @spacing-xl;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
|
||||
&__head,
|
||||
&__group,
|
||||
&__actions {
|
||||
padding: 0 50px 0 35px;
|
||||
padding: 0 @spacing-lg;
|
||||
}
|
||||
|
||||
&__head {
|
||||
@@ -308,15 +308,15 @@ function clearChips(): void {
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-size: 28px;
|
||||
font-weight: 500;
|
||||
line-height: 41px;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
color: @cases-filter-title;
|
||||
}
|
||||
|
||||
&__link {
|
||||
color: @primary-strong;
|
||||
font-size: 16px;
|
||||
font-size: @font-size-sm;
|
||||
|
||||
&:hover {
|
||||
color: @primary-hover;
|
||||
@@ -324,32 +324,36 @@ function clearChips(): void {
|
||||
}
|
||||
|
||||
&__group {
|
||||
margin-top: 24px;
|
||||
margin-top: @spacing-lg;
|
||||
}
|
||||
|
||||
&__head + &__group {
|
||||
margin-top: 11px;
|
||||
margin-top: @spacing-base;
|
||||
}
|
||||
|
||||
&__group-title {
|
||||
font-size: 24px;
|
||||
font-size: @font-size-md;
|
||||
font-weight: 500;
|
||||
line-height: 35px;
|
||||
line-height: 1.4;
|
||||
color: @cases-text;
|
||||
}
|
||||
|
||||
&__rows {
|
||||
margin-top: 19px;
|
||||
margin-top: @spacing-sm;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
&__row {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 12px;
|
||||
gap: @spacing-sm;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
padding: 0;
|
||||
height: 40px;
|
||||
padding: 0 @spacing-sm;
|
||||
border-radius: @radius-sm;
|
||||
color: @cases-text;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
text-align: left;
|
||||
transition: background 0.2s;
|
||||
|
||||
@@ -367,8 +371,8 @@ function clearChips(): void {
|
||||
&__box {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border: 1px solid @cases-input-border;
|
||||
border-radius: 2px;
|
||||
|
||||
@@ -380,9 +384,9 @@ function clearChips(): void {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
left: 4px;
|
||||
width: 5px;
|
||||
height: 8px;
|
||||
left: 3px;
|
||||
width: 4px;
|
||||
height: 7px;
|
||||
border: solid @white;
|
||||
border-width: 0 2px 2px 0;
|
||||
transform: rotate(45deg);
|
||||
@@ -397,7 +401,7 @@ function clearChips(): void {
|
||||
|
||||
&__row-count {
|
||||
color: @cases-muted;
|
||||
font-size: 16px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
@@ -409,17 +413,17 @@ function clearChips(): void {
|
||||
&__pills {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 24px 33px;
|
||||
margin-top: 21px;
|
||||
gap: @spacing-sm;
|
||||
margin-top: @spacing-sm;
|
||||
}
|
||||
|
||||
&__pill {
|
||||
height: 53px;
|
||||
height: 36px;
|
||||
padding: 0 @spacing-sm;
|
||||
border-radius: @radius-base;
|
||||
background: @pill-bg;
|
||||
color: @cases-text;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-sm;
|
||||
.ellipsis();
|
||||
transition: all 0.2s;
|
||||
|
||||
@@ -429,15 +433,14 @@ function clearChips(): void {
|
||||
|
||||
&.is-active,
|
||||
&.is-light {
|
||||
background: @pill-selected-bg;
|
||||
color: @white;
|
||||
background: @filter-selected-bg;
|
||||
color: @primary-strong;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
// ElDatePicker 有两层元素:外层 div.case-filter__date 与内部 .el-range-editor,
|
||||
// 真正控制盒子尺寸的是内层。所以尺寸/背景/圆角都要用 :deep() 打到内层,
|
||||
// 且不能写在 &__date 上——那样只命中外层,视觉上看不到变化。
|
||||
// 真正控制盒子尺寸的是内层。所以尺寸/背景/圆角都要用 :deep() 打到内层。
|
||||
&__date-wrap {
|
||||
grid-column: 1 / -1;
|
||||
width: 100%;
|
||||
@@ -448,7 +451,7 @@ function clearChips(): void {
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: 53px;
|
||||
height: 36px;
|
||||
padding: 0 @spacing-sm;
|
||||
border-radius: @radius-base;
|
||||
background: @input-bg;
|
||||
@@ -461,7 +464,7 @@ function clearChips(): void {
|
||||
&__date {
|
||||
justify-content: center;
|
||||
min-width: 0;
|
||||
height: 53px;
|
||||
height: 36px;
|
||||
padding: 0 @spacing-sm;
|
||||
border-radius: @radius-base;
|
||||
background: @input-bg;
|
||||
@@ -481,32 +484,33 @@ function clearChips(): void {
|
||||
|
||||
:deep(.el-range-input) {
|
||||
flex: 0 1 auto;
|
||||
width: 92px;
|
||||
width: 88px;
|
||||
background: transparent;
|
||||
color: @cases-text;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-sm;
|
||||
|
||||
&::placeholder {
|
||||
color: @cases-text;
|
||||
color: @cases-muted;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-range-separator) {
|
||||
flex: 0 0 auto;
|
||||
margin: 0 @spacing-xs;
|
||||
color: @cases-text;
|
||||
font-size: 20px;
|
||||
line-height: 53px;
|
||||
color: @cases-muted;
|
||||
font-size: @font-size-sm;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
&.is-focus {
|
||||
background: @input-bg;
|
||||
background: @white;
|
||||
box-shadow: 0 0 0 1px @cases-accent inset;
|
||||
}
|
||||
}
|
||||
|
||||
&__selected {
|
||||
margin: 23px 50px 0 35px;
|
||||
padding: 16px 24px 21px;
|
||||
margin: @spacing-lg @spacing-lg 0;
|
||||
padding: @spacing-base;
|
||||
border-radius: @radius-base;
|
||||
background: @chips-panel-bg;
|
||||
}
|
||||
@@ -517,30 +521,30 @@ function clearChips(): void {
|
||||
|
||||
&__selected-title {
|
||||
color: @cases-text;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
&__selected-empty {
|
||||
margin-top: @spacing-sm;
|
||||
color: @cases-muted;
|
||||
font-size: 14px;
|
||||
font-size: @font-size-sm;
|
||||
}
|
||||
|
||||
&__chips {
|
||||
.flex(row, flex-start, center);
|
||||
flex-wrap: wrap;
|
||||
gap: 14px 13px;
|
||||
margin-top: 16px;
|
||||
gap: @spacing-sm;
|
||||
margin-top: @spacing-sm;
|
||||
}
|
||||
|
||||
&__chip {
|
||||
height: 32px;
|
||||
height: 28px;
|
||||
padding: 0 @spacing-sm;
|
||||
border-radius: @radius-round;
|
||||
background: @white;
|
||||
color: @cases-accent;
|
||||
font-size: 14px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
transition: color 0.2s;
|
||||
|
||||
@@ -551,32 +555,32 @@ function clearChips(): void {
|
||||
|
||||
&__actions {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 13px;
|
||||
margin-top: 30px;
|
||||
gap: @spacing-sm;
|
||||
margin-top: @spacing-lg;
|
||||
}
|
||||
|
||||
&__reset {
|
||||
width: 135px;
|
||||
height: 30px;
|
||||
flex: 0 0 88px;
|
||||
height: 32px;
|
||||
border-radius: @radius-round;
|
||||
background: @cases-reset-bg;
|
||||
color: @black;
|
||||
font-size: 14px;
|
||||
color: @text-color;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
transition: filter 0.2s;
|
||||
transition: color 0.2s;
|
||||
|
||||
&:hover {
|
||||
filter: brightness(0.96);
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__confirm {
|
||||
flex: 1;
|
||||
height: 30px;
|
||||
height: 32px;
|
||||
border-radius: @radius-round;
|
||||
background: @cases-confirm;
|
||||
color: @white;
|
||||
font-size: 14px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
transition: background 0.2s;
|
||||
|
||||
@@ -4,9 +4,11 @@ import { computed } from 'vue'
|
||||
interface Props {
|
||||
keyword: string
|
||||
favoriteOnly: boolean
|
||||
/** 是否显示「收藏列表」切换按钮(案例库显示,收藏页本身不显示) */
|
||||
showFavoriteToggle?: boolean
|
||||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
const props = withDefaults(defineProps<Props>(), { showFavoriteToggle: true })
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:keyword': [keyword: string]
|
||||
@@ -44,6 +46,7 @@ const keyword = computed<string>({
|
||||
</button>
|
||||
|
||||
<button
|
||||
v-if="showFavoriteToggle"
|
||||
class="case-search__fav"
|
||||
:class="{ 'is-active': favoriteOnly }"
|
||||
@click="emit('toggleFavoriteOnly')"
|
||||
@@ -59,29 +62,27 @@ const keyword = computed<string>({
|
||||
<style lang="less" scoped>
|
||||
.case-search {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 24px;
|
||||
gap: @spacing-base;
|
||||
width: 100%;
|
||||
height: 128px;
|
||||
min-height: 64px;
|
||||
box-sizing: border-box;
|
||||
// 设计稿 #31:输入框 x=653(栏左 606 + 47),重置 1305,搜索 1429
|
||||
padding: 0 47px;
|
||||
padding: 0 @spacing-lg;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
|
||||
&__field {
|
||||
position: relative;
|
||||
// 输入框右边界 1245 → 重置按钮 1305,设计稿间距 60
|
||||
margin-right: 36px;
|
||||
flex: 0 0 592px;
|
||||
flex: 0 1 360px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 16px;
|
||||
right: @spacing-base;
|
||||
left: auto;
|
||||
width: 27px;
|
||||
height: 27px;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
transform: translateY(-50%);
|
||||
fill: none;
|
||||
stroke: @cases-icon;
|
||||
@@ -90,15 +91,15 @@ const keyword = computed<string>({
|
||||
|
||||
&__input {
|
||||
width: 100%;
|
||||
height: 49px;
|
||||
padding: 0 52px 0 20px;
|
||||
height: 36px;
|
||||
padding: 0 40px 0 @spacing-base;
|
||||
border: 1px solid @cases-input-border;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
border-radius: @radius-round;
|
||||
background: @input-bg;
|
||||
color: @cases-text;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
transition: border-color 0.2s, background-color 0.2s;
|
||||
|
||||
&::placeholder {
|
||||
color: @text-color-disabled;
|
||||
@@ -106,22 +107,24 @@ const keyword = computed<string>({
|
||||
|
||||
&:focus {
|
||||
border-color: @cases-accent;
|
||||
background: @white;
|
||||
}
|
||||
}
|
||||
|
||||
&__btn {
|
||||
min-width: 100px;
|
||||
height: 49px;
|
||||
padding: 0 @spacing-base;
|
||||
border-radius: @radius-sm;
|
||||
background: @cases-accent;
|
||||
color: @white;
|
||||
font-size: 20px;
|
||||
flex-shrink: 0;
|
||||
min-width: 72px;
|
||||
height: 36px;
|
||||
padding: 0 @spacing-lg;
|
||||
border-radius: @radius-round;
|
||||
background: @pill-bg;
|
||||
color: @text-color;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 400;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: @primary-hover;
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
&--primary {
|
||||
@@ -140,7 +143,7 @@ const keyword = computed<string>({
|
||||
gap: @spacing-xs;
|
||||
margin-left: auto;
|
||||
color: @heading-color;
|
||||
font-size: 16px;
|
||||
font-size: @font-size-base;
|
||||
transition: color 0.2s;
|
||||
|
||||
&:hover,
|
||||
69
src/components/EllipsisText.vue
Normal file
69
src/components/EllipsisText.vue
Normal file
@@ -0,0 +1,69 @@
|
||||
<script setup lang="ts">
|
||||
import { onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
||||
import { ElTooltip } from 'element-plus'
|
||||
|
||||
interface Props {
|
||||
text: string
|
||||
placement?: 'top' | 'bottom' | 'left' | 'right'
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
placement: 'top',
|
||||
})
|
||||
|
||||
const root = ref<HTMLElement | null>(null)
|
||||
const overflow = ref(false)
|
||||
|
||||
function check(): void {
|
||||
const el = root.value
|
||||
if (!el) return
|
||||
overflow.value = el.scrollWidth > el.clientWidth + 1
|
||||
}
|
||||
|
||||
let ro: ResizeObserver | null = null
|
||||
|
||||
onMounted(() => {
|
||||
check()
|
||||
if (root.value && typeof ResizeObserver !== 'undefined') {
|
||||
ro = new ResizeObserver(() => check())
|
||||
ro.observe(root.value)
|
||||
}
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
ro?.disconnect()
|
||||
ro = null
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.text,
|
||||
() => check(),
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span ref="root" class="ellipsis-text">
|
||||
<ElTooltip :content="text" :disabled="!overflow" :placement="placement" effect="dark">
|
||||
<span class="ellipsis-text__inner">{{ text }}</span>
|
||||
</ElTooltip>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.ellipsis-text {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-top: 6px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @profile-ink;
|
||||
line-height: 20px;
|
||||
.ellipsis();
|
||||
|
||||
&__inner {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -71,54 +71,55 @@ const emit = defineEmits<{
|
||||
|
||||
<style lang="less" scoped>
|
||||
.filter-panel {
|
||||
padding: 24px 36px;
|
||||
padding: @spacing-lg;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
|
||||
&__bar {
|
||||
.flex(row, flex-start);
|
||||
gap: 18px;
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-base;
|
||||
}
|
||||
|
||||
&__input {
|
||||
flex: 1;
|
||||
max-width: 456px;
|
||||
margin-right: 28px;
|
||||
height: 38px;
|
||||
max-width: 360px;
|
||||
margin-right: 0;
|
||||
height: 36px;
|
||||
padding: 0 @spacing-base;
|
||||
border: 1px solid @cases-input-border;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
color: @cases-text;
|
||||
font-size: 15px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-round;
|
||||
background: @input-bg;
|
||||
color: @text-color;
|
||||
font-size: @font-size-base;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
transition: border-color 0.2s, background-color 0.2s;
|
||||
|
||||
&::placeholder {
|
||||
color: @cases-input-border;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
border-color: @cases-accent;
|
||||
border-color: @primary-color;
|
||||
background: @white;
|
||||
}
|
||||
}
|
||||
|
||||
&__btn {
|
||||
min-width: 77px;
|
||||
height: 38px;
|
||||
padding: 0 @spacing-base;
|
||||
border-radius: @radius-sm;
|
||||
background: @cases-accent;
|
||||
color: @white;
|
||||
font-size: 15px;
|
||||
min-width: 72px;
|
||||
height: 36px;
|
||||
padding: 0 @spacing-lg;
|
||||
border-radius: @radius-round;
|
||||
background: @pill-bg;
|
||||
color: @text-color;
|
||||
font-size: @font-size-base;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: @primary-hover;
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
&--primary {
|
||||
background: @cases-accent;
|
||||
background: @primary-color;
|
||||
color: @white;
|
||||
|
||||
&:hover {
|
||||
@@ -131,26 +132,26 @@ const emit = defineEmits<{
|
||||
&__chips {
|
||||
.flex(row, flex-start, center);
|
||||
flex-wrap: wrap;
|
||||
gap: 11px 10px;
|
||||
gap: @spacing-sm;
|
||||
margin-top: @spacing-base;
|
||||
padding: 12px 18px 16px;
|
||||
padding: @spacing-base;
|
||||
border-radius: @radius-base;
|
||||
background: @chips-panel-bg;
|
||||
font-size: 15px;
|
||||
font-size: @font-size-base;
|
||||
}
|
||||
|
||||
&__chips-label {
|
||||
color: @cases-text;
|
||||
color: @text-color;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
&__chip {
|
||||
height: 25px;
|
||||
height: 28px;
|
||||
padding: 0 @spacing-sm;
|
||||
border-radius: @radius-round;
|
||||
background: @white;
|
||||
color: @cases-accent;
|
||||
font-size: 11px;
|
||||
color: @primary-color;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s;
|
||||
|
||||
|
||||
@@ -23,25 +23,25 @@ defineProps<Props>()
|
||||
<style lang="less" scoped>
|
||||
.page-head {
|
||||
background: @white;
|
||||
padding-bottom: 72px;
|
||||
padding: @spacing-lg 0;
|
||||
border-bottom: 1px solid @border-color;
|
||||
|
||||
&__title {
|
||||
padding-top: 52px;
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
line-height: 29px;
|
||||
color: @finance-ink;
|
||||
padding-top: 0;
|
||||
font-size: @font-size-title;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&__slogan {
|
||||
// 设计稿 #20:slogan 水平居中(当前唯一使用方为财务中心页)
|
||||
text-align: center;
|
||||
text-align: left;
|
||||
padding-bottom: 0;
|
||||
margin-top: 9px;
|
||||
font-size: 13px;
|
||||
margin-top: @spacing-sm;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
color: @finance-muted-text;
|
||||
line-height: 1.5;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -67,18 +67,18 @@ function go(page: number): void {
|
||||
.pagination {
|
||||
.flex(row, center);
|
||||
gap: @spacing-xs;
|
||||
padding: 12px 0;
|
||||
padding: @spacing-base 0;
|
||||
|
||||
&__btn {
|
||||
.flex(row, center);
|
||||
min-width: 20px;
|
||||
height: 25px;
|
||||
padding: 0 3px;
|
||||
min-width: 28px;
|
||||
height: 28px;
|
||||
padding: 0 6px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
color: @text-color-secondary;
|
||||
font-size: 11px;
|
||||
color: @text-color;
|
||||
font-size: @font-size-sm;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover:not(:disabled):not(.is-ellipsis) {
|
||||
@@ -87,9 +87,10 @@ function go(page: number): void {
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
border-color: @cases-page-active-bg;
|
||||
background: @cases-page-active-bg;
|
||||
border-color: @primary-strong;
|
||||
background: @primary-light;
|
||||
color: @primary-strong;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
&.is-ellipsis {
|
||||
|
||||
@@ -4,9 +4,11 @@ import { getPasswordLevel } from '@/utils/validate'
|
||||
|
||||
interface Props {
|
||||
password: string
|
||||
/** 是否显示右侧「密码强度:X」文字(登录/注册页显示,个人中心设计稿不显示) */
|
||||
showLabel?: boolean
|
||||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
const props = withDefaults(defineProps<Props>(), { showLabel: true })
|
||||
|
||||
const level = computed(() => getPasswordLevel(props.password))
|
||||
|
||||
@@ -28,7 +30,7 @@ const levelIndex = computed(() => (level.value === 'strong' ? 3 : level.value ==
|
||||
:class="{ 'is-on': password && i <= levelIndex, [`is-${level}`]: password && i <= levelIndex }"
|
||||
/>
|
||||
</div>
|
||||
<span class="pwd-strength__label" :class="`is-${level}`">{{ password ? `密码强度:${levelText}` : '' }}</span>
|
||||
<span v-if="showLabel" class="pwd-strength__label" :class="`is-${level}`">{{ password ? `密码强度:${levelText}` : '' }}</span>
|
||||
<p v-if="password && level === 'weak'" class="pwd-strength__tip">
|
||||
密码等级过低,请重新输入(建议字母+数字+符号组合)
|
||||
</p>
|
||||
|
||||
@@ -32,42 +32,44 @@ function onGetCode(): void {
|
||||
.sms-code {
|
||||
.flex(row, stretch);
|
||||
gap: @spacing-sm;
|
||||
width: 100%;
|
||||
|
||||
&__input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 40px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid #dde1e7;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
font-size: 13px;
|
||||
color: #1f2937;
|
||||
height: 44px;
|
||||
padding: 0 @spacing-base;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @bg-color-light;
|
||||
font-size: @font-size-base;
|
||||
color: @heading-color;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
transition: border-color 0.2s, background 0.2s;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
border-color: @primary-strong;
|
||||
background: @white;
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: #1f2937;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
}
|
||||
|
||||
// 设计稿 #38:「获取验证码」是带蓝色描边的独立按钮(62×16 文字居中),
|
||||
// 不是纯文字链接。按键宽 88px,与输入框间距 @spacing-sm。
|
||||
&__btn {
|
||||
flex-shrink: 0;
|
||||
width: 88px;
|
||||
height: 40px;
|
||||
padding: 0;
|
||||
min-width: 120px;
|
||||
height: 44px;
|
||||
padding: 0 @spacing-base;
|
||||
border: 1px solid @primary-strong;
|
||||
border-radius: @radius-sm;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
color: @primary-strong;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
@@ -78,8 +80,9 @@ function onGetCode(): void {
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
border-color: @text-color-disabled;
|
||||
color: @text-color-disabled;
|
||||
border-color: @border-color;
|
||||
background: @bg-color-light;
|
||||
color: @text-color-secondary;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,3 +15,7 @@ export { default as SmsCodeInput } from './SmsCodeInput.vue'
|
||||
export { default as PasswordStrength } from './PasswordStrength.vue'
|
||||
export { default as ConfirmDialog } from './ConfirmDialog.vue'
|
||||
export { default as QrCodePanel } from './QrCodePanel.vue'
|
||||
export { default as CasesFilter } from './CasesFilter.vue'
|
||||
export { default as CasesSearchBar } from './CasesSearchBar.vue'
|
||||
export { default as CasesGrid } from './CasesGrid.vue'
|
||||
export { default as EllipsisText } from './EllipsisText.vue'
|
||||
|
||||
@@ -8,6 +8,7 @@ const layoutRoutes: RouteRecordRaw = {
|
||||
{ path: 'business/:type', name: 'BusinessDetail', component: () => import('@/views/home/detail.vue'), meta: { title: '业务详情' } },
|
||||
{ path: 'cases', name: 'Cases', component: () => import('@/views/cases'), meta: { title: '成功案例库' } },
|
||||
{ path: 'cases/:id', name: 'CaseDetail', component: () => import('@/views/cases/detail.vue'), meta: { title: '案例详情' } },
|
||||
{ path: 'favorites', name: 'Favorites', component: () => import('@/views/profile/favorites.vue'), meta: { title: '收藏列表', requiresAuth: true } },
|
||||
{ path: 'demand', name: 'Demand', component: () => import('@/views/demand'), meta: { title: '需求提报', requiresAuth: true, noFooter: true } },
|
||||
|
||||
{ path: 'project', name: 'Project', component: () => import('@/views/project'), meta: { title: '项目中心', requiresAuth: true } },
|
||||
@@ -35,8 +36,11 @@ const layoutRoutes: RouteRecordRaw = {
|
||||
children: [
|
||||
{ path: '', redirect: '/profile/security' },
|
||||
{ path: 'security', name: 'ProfileSecurity', component: () => import('@/views/profile/security.vue'), meta: { title: '账号安全', requiresAuth: true } },
|
||||
{ path: 'security/change-password', name: 'ProfileChangePassword', component: () => import('@/views/profile/change-password.vue'), meta: { title: '修改密码', requiresAuth: true } },
|
||||
{ path: 'security/bind-phone', name: 'ProfileBindPhone', component: () => import('@/views/profile/bind-phone.vue'), meta: { title: '绑定手机号', requiresAuth: true } },
|
||||
{ path: 'security/bind-email', name: 'ProfileBindEmail', component: () => import('@/views/profile/bind-email.vue'), meta: { title: '绑定邮箱', requiresAuth: true } },
|
||||
{ path: 'security/delete-account', name: 'ProfileDeleteAccount', component: () => import('@/views/profile/delete-account.vue'), meta: { title: '注销账号', requiresAuth: true } },
|
||||
{ path: 'address', name: 'ProfileAddress', component: () => import('@/views/profile/address.vue'), meta: { title: '地址管理', requiresAuth: true } },
|
||||
{ path: 'favorites', name: 'ProfileFavorites', component: () => import('@/views/profile/favorites.vue'), meta: { title: '收藏列表', requiresAuth: true } },
|
||||
{ path: 'qualifications', name: 'ProfileQualifications', component: () => import('@/views/profile/qualifications.vue'), meta: { title: '资质列表', requiresAuth: true } },
|
||||
{ path: 'feedback', name: 'ProfileFeedback', component: () => import('@/views/profile/feedback.vue'), meta: { title: '意见反馈', requiresAuth: true } },
|
||||
{ path: 'help', name: 'ProfileHelp', component: () => import('@/views/profile/help.vue'), meta: { title: '帮助中心', requiresAuth: true } },
|
||||
|
||||
@@ -71,6 +71,7 @@ function toBusinessLine(vo: ProjectSubmissionVo): BusinessLine {
|
||||
desc: subtitle,
|
||||
slogan: subtitle,
|
||||
icon: vo.logoUrl ?? '',
|
||||
cover: vo.coverUrl ?? '',
|
||||
serviceContent,
|
||||
contents,
|
||||
serviceTypes,
|
||||
@@ -99,6 +100,7 @@ function toBusinessLineFromInfo(info: ProjectSubmissionInfo): BusinessLine {
|
||||
desc: subtitle,
|
||||
slogan: subtitle,
|
||||
icon: ps.logoUrl ?? '',
|
||||
cover: ps.coverUrl ?? '',
|
||||
serviceContent,
|
||||
contents,
|
||||
serviceTypes,
|
||||
|
||||
@@ -85,9 +85,8 @@
|
||||
.flex(column, center, center);
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
// 设计稿三页的标题顶分别为 306/287/268,卡片在 1080 视口中居中后
|
||||
// 会比标注高 15px,用上内边距把内容整体下移补平。
|
||||
padding: 80px 0 40px;
|
||||
// 底部多留白,整体视觉中心上移,「欢迎登录」不再偏下
|
||||
padding: 24px 0 120px;
|
||||
}
|
||||
|
||||
// 设计稿表单区统一 693px 宽。标题/副标题按自身文字宽度相对表单居中,
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
@header-height: 72px;
|
||||
@header-nav-gap: 94px;
|
||||
@footer-height: 481px;
|
||||
@footer-height: 280px;
|
||||
@footer-inset: 70px;
|
||||
|
||||
// 登录/注册/找回密码三页共用的品牌区宽度。设计稿 #36/#38/#39 的左侧渐变
|
||||
@@ -90,10 +90,10 @@
|
||||
@shadow-lg: 0 4px 16px rgba(31, 39, 51, 0.12);
|
||||
|
||||
@filter-selected-bg: #e7eeff;
|
||||
@pill-bg: #ededed;
|
||||
@pill-bg: #f5f6f8;
|
||||
@pill-selected-bg: #075cff;
|
||||
@chips-panel-bg: #eaf1ff;
|
||||
@input-bg: #ededed;
|
||||
@input-bg: #f5f6f8;
|
||||
@tag-hardware: #4caf50;
|
||||
@tag-iot: #5720ba;
|
||||
@tag-manufacturing: #ff8f1f;
|
||||
@@ -105,19 +105,23 @@
|
||||
@cases-filter-title: #222222;
|
||||
@cases-text: #333333;
|
||||
@cases-muted: #666666;
|
||||
@cases-input-border: #999999;
|
||||
@cases-input-border: #cdd3dd;
|
||||
@cases-icon: #797979;
|
||||
@cases-reset-bg: #f0f0f0;
|
||||
@cases-card-border: #e1dfdf;
|
||||
@cases-card-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
|
||||
@cases-reset-bg: #f5f6f8;
|
||||
@cases-card-border: #e4e7ec;
|
||||
@cases-card-shadow: 0 2px 8px rgba(31, 39, 51, 0.06);
|
||||
@cases-page-active-bg: #e0e9fa;
|
||||
@cases-filter-width: 320px;
|
||||
|
||||
@demand-selected-bg: #024fff;
|
||||
@demand-accent: #024fff;
|
||||
@demand-secondary-bg: #075cff;
|
||||
|
||||
@project-table-head-bg: #e8e8e8;
|
||||
@project-table-line: #bbbbbb;
|
||||
@project-table-head-bg: #f7f8fa;
|
||||
@project-table-line: #e4e7ec;
|
||||
@project-filter-width: 320px;
|
||||
@project-pill-bg: #f5f6f8;
|
||||
@project-input-bg: #f5f6f8;
|
||||
|
||||
@project-accent: #024fff;
|
||||
@project-track: #edeff2;
|
||||
@@ -181,8 +185,8 @@
|
||||
@demand-ink: #121212;
|
||||
@demand-heading: #333333;
|
||||
@demand-subtitle: #666666;
|
||||
@demand-line: #999999;
|
||||
@demand-upload-bg: #ededed;
|
||||
@demand-line: #e4e7ec;
|
||||
@demand-upload-bg: #f5f6f8;
|
||||
@demand-radio-idle: #c7c2c2;
|
||||
@auth-gradient-from: #505be8;
|
||||
@auth-gradient-to: #8b3fe8;
|
||||
@@ -208,7 +212,7 @@
|
||||
@project-cell: #4b5563;
|
||||
@project-card: #ffffff;
|
||||
@project-field-bg: #f3f4f6;
|
||||
@project-input-border: #dde1e7;
|
||||
@project-input-border: #e4e7ec;
|
||||
@project-head-bg: #f7f8fa;
|
||||
@project-upload-tag: #ef4444;
|
||||
@project-banner-soft: #fdeeee;
|
||||
@@ -223,12 +227,12 @@
|
||||
|
||||
@contract-accent: #075cff;
|
||||
@contract-muted: #666666;
|
||||
@contract-head-text: #222222;
|
||||
@contract-head-text: #666666;
|
||||
@contract-cell-text: #333333;
|
||||
@contract-line: #999999;
|
||||
@contract-table-head-bg: #ededed;
|
||||
@contract-line: #e4e7ec;
|
||||
@contract-table-head-bg: #f7f8fa;
|
||||
@contract-placeholder: #b3b9c4;
|
||||
@contract-reset-bg: #eef0f3;
|
||||
@contract-reset-bg: #f5f6f8;
|
||||
@contract-qr-bg: #d6d6d6;
|
||||
|
||||
@finance-hero-gradient: linear-gradient(
|
||||
@@ -239,8 +243,8 @@
|
||||
);
|
||||
@finance-chart-bar: #4a90c4;
|
||||
@finance-chart-grid: #edeef2;
|
||||
@finance-table-head-bg: #f1f3f5;
|
||||
@finance-field-bg: #f3f4f6;
|
||||
@finance-table-head-bg: #f7f8fa;
|
||||
@finance-field-bg: #f5f6f8;
|
||||
@finance-page-active: #d5e2fe;
|
||||
@finance-summary-cta: #ffb754;
|
||||
@finance-result-circle: #7ed321;
|
||||
@@ -252,9 +256,9 @@
|
||||
@profile-nav-active-bg: #e7eeff;
|
||||
@profile-card-border: #f0f1f3;
|
||||
@profile-line: #e5e7eb;
|
||||
@profile-input-border: #dde1e7;
|
||||
@profile-input-border: #e4e7ec;
|
||||
@profile-radius: 6px;
|
||||
@profile-page-bg: #f4f6f8;
|
||||
@profile-page-bg: #f4f5f9;
|
||||
@profile-ink: #1f2937;
|
||||
@profile-hotline-bg: #d6e4fb;
|
||||
@profile-icon-pwd: #c7d2fe;
|
||||
@@ -265,6 +269,9 @@
|
||||
@profile-user-avatar: #8976ed;
|
||||
@profile-page-active-bg: #d1e0fe;
|
||||
@profile-quiet-btn: #eef0f3;
|
||||
@profile-tag-ok-bg: #e0f0e0;
|
||||
@profile-input-disabled-bg: #f3f4f6;
|
||||
@profile-verify-banner-bg: #edf3fe;
|
||||
|
||||
@contract-ink: #121212;
|
||||
@contract-page-bg: #f4f6f8;
|
||||
@@ -286,3 +293,20 @@
|
||||
@finance-chart-switch-active: #024fff;
|
||||
@finance-switch-active-bg: #e8f0ff;
|
||||
@finance-switch-idle-bg: #f2f4f7;
|
||||
|
||||
// 消息中心(设计稿 #22)
|
||||
@message-page-bg: #f4f6f8;
|
||||
@message-tabs-text: #4b5563;
|
||||
@message-tabs-badge: #f53f3f;
|
||||
@message-toolbar-btn-border: #e5e7eb;
|
||||
@message-pager-active-bg: #edf3fe;
|
||||
@message-item-icon: #3b82f6;
|
||||
|
||||
// 在线客服(设计稿 #42)
|
||||
@service-card-line: #f0f1f3;
|
||||
@service-scroll-bg: #fafbfc;
|
||||
@service-input-bg: #f7f8fa;
|
||||
@service-bar-bg: #f8f8f9;
|
||||
@service-header-name: #1f2937;
|
||||
@service-avatar-text: #8d99ae;
|
||||
@service-bubble-text: #1f2937;
|
||||
|
||||
1
src/types/business/home.d.ts
vendored
1
src/types/business/home.d.ts
vendored
@@ -35,6 +35,7 @@ export interface BusinessLine {
|
||||
desc: string
|
||||
slogan: string
|
||||
icon: string
|
||||
cover: string
|
||||
serviceContent: string
|
||||
contents: ServiceContentBlock[]
|
||||
serviceTypes: ServiceType[]
|
||||
|
||||
@@ -6,30 +6,79 @@ function goHome(): void {
|
||||
|
||||
<template>
|
||||
<section class="not-found">
|
||||
<h1>404</h1>
|
||||
<p class="text-secondary">
|
||||
页面不存在或已下线
|
||||
</p>
|
||||
<button class="not-found__back link" @click="goHome">
|
||||
返回首页
|
||||
</button>
|
||||
<div class="not-found__card">
|
||||
<p class="not-found__code">
|
||||
404
|
||||
</p>
|
||||
<h1 class="not-found__title">
|
||||
页面不存在
|
||||
</h1>
|
||||
<p class="not-found__desc text-secondary">
|
||||
页面不存在或已下线,请返回首页继续浏览
|
||||
</p>
|
||||
<button
|
||||
class="not-found__back"
|
||||
type="button"
|
||||
@click="goHome"
|
||||
>
|
||||
返回首页
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.not-found {
|
||||
.flex(column, center);
|
||||
gap: @spacing-base;
|
||||
.flex(column, center, center);
|
||||
min-height: 100vh;
|
||||
padding: @spacing-lg;
|
||||
background: @bg-color;
|
||||
|
||||
h1 {
|
||||
font-size: 64px;
|
||||
&__card {
|
||||
.flex(column, center, center);
|
||||
gap: @spacing-sm;
|
||||
width: 100%;
|
||||
max-width: 420px;
|
||||
padding: @spacing-xxl @spacing-xl;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&__code {
|
||||
margin: 0;
|
||||
font-size: @font-size-hero;
|
||||
font-weight: 600;
|
||||
line-height: 1;
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
&__title {
|
||||
margin: 0;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&__back {
|
||||
color: @primary-color;
|
||||
&__desc {
|
||||
margin: 0 0 @spacing-base;
|
||||
font-size: @font-size-base;
|
||||
}
|
||||
|
||||
&__back {
|
||||
height: 40px;
|
||||
padding: 0 @spacing-xl;
|
||||
border: none;
|
||||
border-radius: @radius-round;
|
||||
background: @primary-color;
|
||||
color: @white;
|
||||
font-size: @font-size-base;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: @primary-hover;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -18,7 +18,7 @@ const coverStyle = computed(() =>
|
||||
|
||||
<template>
|
||||
<section class="case-hero" :style="coverStyle">
|
||||
<div class="container case-hero__inner">
|
||||
<div class="case-hero__inner">
|
||||
<span v-if="tag" class="case-hero__tag">{{ tag }}</span>
|
||||
<h1 class="case-hero__title">
|
||||
{{ props.item.title }}
|
||||
@@ -31,17 +31,19 @@ const coverStyle = computed(() =>
|
||||
.case-hero {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 260px;
|
||||
height: 180px;
|
||||
border-radius: @radius-base;
|
||||
background-color: @primary-color;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
overflow: hidden;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(180deg, rgba(15, 23, 42, 0) 42%, rgba(15, 23, 42, 0.55));
|
||||
background: linear-gradient(180deg, fade(@black, 0%) 40%, fade(@black, 45%));
|
||||
}
|
||||
|
||||
&__inner {
|
||||
@@ -50,7 +52,8 @@ const coverStyle = computed(() =>
|
||||
.flex(column, flex-end, flex-start);
|
||||
gap: @spacing-sm;
|
||||
height: 100%;
|
||||
padding-bottom: @spacing-lg;
|
||||
box-sizing: border-box;
|
||||
padding: 0 @spacing-lg @spacing-lg;
|
||||
}
|
||||
|
||||
&__tag {
|
||||
@@ -64,9 +67,9 @@ const coverStyle = computed(() =>
|
||||
|
||||
&__title {
|
||||
color: @white;
|
||||
font-size: @font-size-xxl;
|
||||
font-size: @font-size-title;
|
||||
font-weight: 600;
|
||||
text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
|
||||
text-shadow: 0 1px 8px fade(@black, 35%);
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
|
||||
@@ -51,19 +51,21 @@ onMounted(load)
|
||||
</div>
|
||||
|
||||
<template v-if="item">
|
||||
<CaseHero :item="item" />
|
||||
<div class="container case-detail__body">
|
||||
<CaseHero :item="item" />
|
||||
|
||||
<div class="container case-detail__main">
|
||||
<CaseDetailHeader :item="item" @favorite="onFavorite" @share="onShare" />
|
||||
<CaseRichText :item="item" />
|
||||
<div class="case-detail__main">
|
||||
<CaseDetailHeader :item="item" @favorite="onFavorite" @share="onShare" />
|
||||
<CaseRichText :item="item" />
|
||||
|
||||
<button
|
||||
class="case-detail__cta"
|
||||
type="button"
|
||||
@click="router.push('/demand')"
|
||||
>
|
||||
一键填报类似案例
|
||||
</button>
|
||||
<button
|
||||
class="case-detail__cta"
|
||||
type="button"
|
||||
@click="router.push('/demand')"
|
||||
>
|
||||
一键填报类似案例
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -75,27 +77,33 @@ onMounted(load)
|
||||
|
||||
<style lang="less" scoped>
|
||||
.case-detail {
|
||||
padding-bottom: @spacing-xxl;
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__crumb {
|
||||
padding-top: 6px;
|
||||
padding-bottom: 6px;
|
||||
font-size: @font-size-base;
|
||||
padding-top: @spacing-base;
|
||||
padding-bottom: @spacing-base;
|
||||
font-size: @font-size-sm;
|
||||
}
|
||||
|
||||
&__body {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: @spacing-base;
|
||||
}
|
||||
|
||||
&__main {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: @spacing-base;
|
||||
padding-top: @spacing-lg;
|
||||
}
|
||||
|
||||
&__cta {
|
||||
width: 100%;
|
||||
height: 44px;
|
||||
border-radius: @radius-base;
|
||||
height: 40px;
|
||||
border-radius: @radius-round;
|
||||
background: @primary-color;
|
||||
color: @white;
|
||||
font-size: @font-size-lg;
|
||||
font-size: @font-size-base;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
export { default } from './index.vue'
|
||||
export { default as CasesFilter } from './cpns/CasesFilter.vue'
|
||||
export { default as CasesSearchBar } from './cpns/CasesSearchBar.vue'
|
||||
export { default as CasesGrid } from './cpns/CasesGrid.vue'
|
||||
export { CasesFilter, CasesSearchBar, CasesGrid } from '@/components'
|
||||
export { default as CaseHero } from './cpns/CaseHero.vue'
|
||||
export { default as CaseDetailHeader } from './cpns/CaseDetailHeader.vue'
|
||||
export { default as CaseRichText } from './cpns/CaseRichText.vue'
|
||||
|
||||
@@ -3,12 +3,9 @@
|
||||
import { onMounted } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { PaginationBar } from '@/components'
|
||||
import { CasesFilter, CasesGrid, CasesSearchBar, PaginationBar } from '@/components'
|
||||
import { useCasesStore } from '@/stores/modules/cases'
|
||||
import type { CaseQuery } from '@/types/business/cases'
|
||||
import CasesFilter from './cpns/CasesFilter.vue'
|
||||
import CasesSearchBar from './cpns/CasesSearchBar.vue'
|
||||
import CasesGrid from './cpns/CasesGrid.vue'
|
||||
|
||||
const router = useRouter()
|
||||
const casesStore = useCasesStore()
|
||||
@@ -48,6 +45,8 @@ function onViewDetail(id: string): void {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 收藏页复用本 store 并会置 favoriteOnly=true,进入案例库时重置,避免状态残留
|
||||
casesStore.resetQuery()
|
||||
void Promise.all([casesStore.fetchCategories(), casesStore.fetchCases()])
|
||||
})
|
||||
</script>
|
||||
@@ -110,53 +109,49 @@ onMounted(() => {
|
||||
|
||||
<style lang="less" scoped>
|
||||
.cases {
|
||||
padding-bottom: 78px;
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__hero {
|
||||
height: 179px;
|
||||
box-sizing: border-box;
|
||||
padding-top: 32px;
|
||||
padding: @spacing-lg 0;
|
||||
background: @white;
|
||||
border-bottom: 1px solid @border-color;
|
||||
}
|
||||
|
||||
// 设计稿 #31:hero 标题 x=112、副标题 x=112;
|
||||
// 主体筛选栏 x=70、右侧操作区右边界 1850。两套留白并存,
|
||||
// 所以 hero 内容单独内缩,不动全局 .container 的 70px 留白。
|
||||
&__hero-inner {
|
||||
padding-left: 112px;
|
||||
padding-right: 112px;
|
||||
padding-left: @spacing-xl;
|
||||
padding-right: @spacing-xl;
|
||||
}
|
||||
|
||||
&__title {
|
||||
margin: 0;
|
||||
font-size: 36px;
|
||||
font-weight: 700;
|
||||
line-height: 52px;
|
||||
font-size: @font-size-title;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
color: @cases-hero-title;
|
||||
}
|
||||
|
||||
&__slogan {
|
||||
margin: 15px 0 0;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
line-height: 37px;
|
||||
margin: @spacing-sm 0 0;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: @cases-muted;
|
||||
}
|
||||
|
||||
&__body {
|
||||
.flex(row, flex-start, flex-start);
|
||||
gap: 20px;
|
||||
padding-top: 20px;
|
||||
gap: @spacing-lg;
|
||||
padding-top: @spacing-lg;
|
||||
}
|
||||
|
||||
&__main {
|
||||
// 设计稿:右侧操作区 x=606 w=1244(右边界 1850,与筛选栏区留白 70 对称)。
|
||||
// mixin 签名是 .flex(direction; justify; align),第三参才是 align-items。
|
||||
// 纵向排列时 justify 无意义,align 用 stretch 让子项撑满 1244。
|
||||
.flex(column, flex-start, stretch);
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
gap: 24px;
|
||||
gap: @spacing-lg;
|
||||
}
|
||||
|
||||
&__pager {
|
||||
|
||||
@@ -25,167 +25,172 @@ const SIGN_VARIANTS: Record<SignStatus, 'primary' | 'success' | 'warning' | 'dan
|
||||
|
||||
<template>
|
||||
<div class="contract-info">
|
||||
<h3 class="contract-info__section contract-info__section--1">
|
||||
<span class="contract-info__step">01</span>
|
||||
<span class="contract-info__section-title">合同信息</span>
|
||||
</h3>
|
||||
<div class="contract-info__field contract-info__field--1 contract-info__field--l">
|
||||
<span class="contract-info__label">项目名称</span>
|
||||
<span class="contract-info__value">{{ contract.contractName }}</span>
|
||||
</div>
|
||||
<div class="contract-info__field contract-info__field--1 contract-info__field--r">
|
||||
<span class="contract-info__label">合同类型</span>
|
||||
<span class="contract-info__value">{{ contract.contractType }}</span>
|
||||
</div>
|
||||
<div class="contract-info__field contract-info__field--2 contract-info__field--l">
|
||||
<span class="contract-info__label">合同编号</span>
|
||||
<span class="contract-info__value">{{ contract.contractNo }}</span>
|
||||
</div>
|
||||
<div class="contract-info__field contract-info__field--2 contract-info__field--r">
|
||||
<span class="contract-info__label">签订日期</span>
|
||||
<span class="contract-info__value">{{ contract.signDate || '—' }}</span>
|
||||
</div>
|
||||
<div class="contract-info__field contract-info__field--3 contract-info__field--l">
|
||||
<span class="contract-info__label">生效日期</span>
|
||||
<span class="contract-info__value">{{ contract.effectiveDate }}</span>
|
||||
</div>
|
||||
<div class="contract-info__field contract-info__field--3 contract-info__field--r">
|
||||
<span class="contract-info__label">到期日期</span>
|
||||
<span class="contract-info__value">{{ contract.expiryDate }}</span>
|
||||
</div>
|
||||
<div class="contract-info__field contract-info__field--4 contract-info__field--l">
|
||||
<span class="contract-info__label">合同状态</span>
|
||||
<StatusTag :label="contract.signStatus" :variant="SIGN_VARIANTS[contract.signStatus]" />
|
||||
</div>
|
||||
<section class="contract-info__section">
|
||||
<h3 class="contract-info__heading">
|
||||
<span class="contract-info__step">01</span>
|
||||
<span>合同信息</span>
|
||||
</h3>
|
||||
<div class="contract-info__grid">
|
||||
<div class="contract-info__field">
|
||||
<span class="contract-info__label">项目名称</span>
|
||||
<span class="contract-info__value">{{ contract.contractName }}</span>
|
||||
</div>
|
||||
<div class="contract-info__field">
|
||||
<span class="contract-info__label">合同类型</span>
|
||||
<span class="contract-info__value">{{ contract.contractType }}</span>
|
||||
</div>
|
||||
<div class="contract-info__field">
|
||||
<span class="contract-info__label">合同编号</span>
|
||||
<span class="contract-info__value">{{ contract.contractNo }}</span>
|
||||
</div>
|
||||
<div class="contract-info__field">
|
||||
<span class="contract-info__label">签订日期</span>
|
||||
<span class="contract-info__value">{{ contract.signDate || '—' }}</span>
|
||||
</div>
|
||||
<div class="contract-info__field">
|
||||
<span class="contract-info__label">生效日期</span>
|
||||
<span class="contract-info__value">{{ contract.effectiveDate }}</span>
|
||||
</div>
|
||||
<div class="contract-info__field">
|
||||
<span class="contract-info__label">到期日期</span>
|
||||
<span class="contract-info__value">{{ contract.expiryDate }}</span>
|
||||
</div>
|
||||
<div class="contract-info__field">
|
||||
<span class="contract-info__label">合同状态</span>
|
||||
<StatusTag :label="contract.signStatus" :variant="SIGN_VARIANTS[contract.signStatus]" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<h3 class="contract-info__section contract-info__section--2">
|
||||
<span class="contract-info__step">02</span>
|
||||
<span class="contract-info__section-title">关联项目</span>
|
||||
</h3>
|
||||
<div class="contract-info__field contract-info__field--5 contract-info__field--l">
|
||||
<span class="contract-info__label">
|
||||
项目名称
|
||||
<button class="contract-info__link" @click="emit('viewProject')">查看详情</button>
|
||||
</span>
|
||||
<span class="contract-info__value">{{ contract.relatedProjectName }}</span>
|
||||
</div>
|
||||
<div class="contract-info__field contract-info__field--5 contract-info__field--r">
|
||||
<span class="contract-info__label">项目编号</span>
|
||||
<span class="contract-info__value">{{ contract.projectNo }}</span>
|
||||
</div>
|
||||
|
||||
<h3 class="contract-info__section contract-info__section--3">
|
||||
<span class="contract-info__step">03</span>
|
||||
<span class="contract-info__section-title">合同文件</span>
|
||||
</h3>
|
||||
<ul class="contract-info__files">
|
||||
<li
|
||||
v-for="(file, index) in contract.files"
|
||||
:key="`${file.name}-${index}`"
|
||||
class="contract-info__file"
|
||||
>
|
||||
<div class="contract-info__file-info">
|
||||
<span class="contract-info__file-name" :title="file.name">{{ file.name }}</span>
|
||||
<span class="contract-info__file-meta">
|
||||
{{ formatFileSize(file.size) }} · {{ file.uploadTime }}
|
||||
<section class="contract-info__section">
|
||||
<h3 class="contract-info__heading">
|
||||
<span class="contract-info__step">02</span>
|
||||
<span>关联项目</span>
|
||||
</h3>
|
||||
<div class="contract-info__grid">
|
||||
<div class="contract-info__field">
|
||||
<span class="contract-info__label">
|
||||
项目名称
|
||||
<button
|
||||
type="button"
|
||||
class="contract-info__link"
|
||||
@click="emit('viewProject')"
|
||||
>
|
||||
查看详情
|
||||
</button>
|
||||
</span>
|
||||
<span class="contract-info__value">{{ contract.relatedProjectName }}</span>
|
||||
</div>
|
||||
<div class="contract-info__file-actions">
|
||||
<button class="contract-info__link" @click="emit('preview', file)">
|
||||
预览
|
||||
</button>
|
||||
<button class="contract-info__link" @click="emit('download', file)">
|
||||
下载
|
||||
</button>
|
||||
<div class="contract-info__field">
|
||||
<span class="contract-info__label">项目编号</span>
|
||||
<span class="contract-info__value">{{ contract.projectNo }}</span>
|
||||
</div>
|
||||
</li>
|
||||
<li v-if="contract.files.length === 0" class="contract-info__empty">
|
||||
暂无合同文件
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="contract-info__section">
|
||||
<h3 class="contract-info__heading">
|
||||
<span class="contract-info__step">03</span>
|
||||
<span>合同文件</span>
|
||||
</h3>
|
||||
<ul class="contract-info__files">
|
||||
<li
|
||||
v-for="(file, index) in contract.files"
|
||||
:key="`${file.name}-${index}`"
|
||||
class="contract-info__file"
|
||||
>
|
||||
<div class="contract-info__file-info">
|
||||
<span class="contract-info__file-name" :title="file.name">{{ file.name }}</span>
|
||||
<span class="contract-info__file-meta">
|
||||
{{ formatFileSize(file.size) }} · {{ file.uploadTime }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="contract-info__file-actions">
|
||||
<button
|
||||
type="button"
|
||||
class="contract-info__link"
|
||||
@click="emit('preview', file)"
|
||||
>
|
||||
预览
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="contract-info__link"
|
||||
@click="emit('download', file)"
|
||||
>
|
||||
下载
|
||||
</button>
|
||||
</div>
|
||||
</li>
|
||||
<li v-if="contract.files.length === 0" class="contract-info__empty">
|
||||
暂无合同文件
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.contract-info {
|
||||
position: relative;
|
||||
width: 1780px;
|
||||
height: 1152px;
|
||||
margin-top: 21px;
|
||||
border-radius: @radius-lg;
|
||||
width: 100%;
|
||||
margin-top: @spacing-base;
|
||||
padding: @spacing-xl;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-sizing: border-box;
|
||||
|
||||
&__section {
|
||||
position: absolute;
|
||||
left: 54px;
|
||||
top: 0;
|
||||
height: 70px;
|
||||
|
||||
&--1 { top: 36px; }
|
||||
&--2 { top: 649px; }
|
||||
&--3 { top: 901px; }
|
||||
&__section + &__section {
|
||||
margin-top: @spacing-xxl;
|
||||
}
|
||||
|
||||
&__section-title {
|
||||
position: absolute;
|
||||
left: 60px;
|
||||
top: 23px;
|
||||
margin: 0;
|
||||
font-size: 28px;
|
||||
&__heading {
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-sm;
|
||||
margin: 0 0 @spacing-lg;
|
||||
font-size: @font-size-lg;
|
||||
font-weight: 500;
|
||||
line-height: 41px;
|
||||
line-height: 1.4;
|
||||
color: @contract-cell-text;
|
||||
white-space: nowrap; // 父级 h3 内子元素全部脱流,标题会逐字换行,强制不换行
|
||||
}
|
||||
|
||||
&__step {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
font-size: 48px;
|
||||
font-weight: 500;
|
||||
line-height: 70px;
|
||||
font-size: @font-size-title;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
color: @project-accent;
|
||||
white-space: nowrap;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
&__grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: @spacing-lg;
|
||||
}
|
||||
|
||||
&__field {
|
||||
.flex(column, flex-start, stretch);
|
||||
position: absolute;
|
||||
width: 764px;
|
||||
gap: 14px;
|
||||
gap: @spacing-sm;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__field--1 { top: 174px; }
|
||||
&__field--2 { top: 296px; }
|
||||
&__field--3 { top: 418px; }
|
||||
&__field--4 { top: 540px; }
|
||||
&__field--5 { top: 770px; }
|
||||
|
||||
&__field--5:has(&__label) { top: 749px; }
|
||||
|
||||
&__field--l { left: 54px; }
|
||||
&__field--r { left: 930px; }
|
||||
|
||||
&__label {
|
||||
font-size: 20px;
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-sm;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
line-height: 29px;
|
||||
line-height: 1.4;
|
||||
color: @contract-cell-text;
|
||||
}
|
||||
|
||||
&__value {
|
||||
.flex(row, flex-start, center);
|
||||
width: 100%;
|
||||
height: 49px;
|
||||
padding: 0 18px;
|
||||
border: 1px solid @contract-line;
|
||||
border-radius: 8px;
|
||||
background: @contract-page-bg;
|
||||
font-size: 20px;
|
||||
line-height: 29px;
|
||||
height: 40px;
|
||||
padding: 0 @spacing-base;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-sm;
|
||||
background: @bg-color-light;
|
||||
font-size: @font-size-base;
|
||||
line-height: 1.4;
|
||||
color: @contract-cell-text;
|
||||
box-sizing: border-box;
|
||||
.ellipsis();
|
||||
@@ -194,19 +199,19 @@ const SIGN_VARIANTS: Record<SignStatus, 'primary' | 'success' | 'warning' | 'dan
|
||||
&__field :deep(.status-tag) {
|
||||
.flex(row, flex-start, center);
|
||||
width: 100%;
|
||||
height: 49px;
|
||||
padding: 0 18px;
|
||||
border: 1px solid @contract-line;
|
||||
border-radius: 8px;
|
||||
background: @contract-page-bg;
|
||||
font-size: 20px;
|
||||
line-height: 29px;
|
||||
height: 40px;
|
||||
padding: 0 @spacing-base;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-sm;
|
||||
background: @bg-color-light;
|
||||
font-size: @font-size-base;
|
||||
line-height: 1.4;
|
||||
color: @contract-cell-text;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__link {
|
||||
font-size: 18px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
color: @contract-accent;
|
||||
transition: opacity 0.2s;
|
||||
@@ -216,18 +221,9 @@ const SIGN_VARIANTS: Record<SignStatus, 'primary' | 'success' | 'warning' | 'dan
|
||||
}
|
||||
}
|
||||
|
||||
&__label &__link {
|
||||
margin-left: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
&__files {
|
||||
.flex(column, flex-start, stretch);
|
||||
position: absolute;
|
||||
top: 1001px; // 1153 − 152
|
||||
left: 54px; // 124 − 70
|
||||
width: 1640px;
|
||||
gap: 0;
|
||||
gap: @spacing-sm;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
@@ -236,28 +232,29 @@ const SIGN_VARIANTS: Record<SignStatus, 'primary' | 'success' | 'warning' | 'dan
|
||||
&__file {
|
||||
.flex(row, space-between, center);
|
||||
gap: @spacing-base;
|
||||
height: 90px;
|
||||
padding: 0 30px;
|
||||
background: @contract-table-head-bg;
|
||||
min-height: 64px;
|
||||
padding: 0 @spacing-base;
|
||||
border-radius: @radius-base;
|
||||
background: @bg-color-light;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__file-info {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 4px;
|
||||
gap: 2px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__file-name {
|
||||
font-size: 20px;
|
||||
line-height: 29px;
|
||||
font-size: @font-size-base;
|
||||
line-height: 1.4;
|
||||
color: @contract-cell-text;
|
||||
.ellipsis();
|
||||
}
|
||||
|
||||
&__file-meta {
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
font-size: @font-size-sm;
|
||||
line-height: 1.4;
|
||||
color: @contract-muted;
|
||||
}
|
||||
|
||||
@@ -269,9 +266,11 @@ const SIGN_VARIANTS: Record<SignStatus, 'primary' | 'success' | 'warning' | 'dan
|
||||
|
||||
&__empty {
|
||||
.flex(row, flex-start, center);
|
||||
height: 90px;
|
||||
padding: 0 30px;
|
||||
font-size: 18px;
|
||||
min-height: 64px;
|
||||
padding: 0 @spacing-base;
|
||||
border-radius: @radius-base;
|
||||
background: @bg-color-light;
|
||||
font-size: @font-size-base;
|
||||
color: @contract-muted;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ const emit = defineEmits<{ refresh: [] }>()
|
||||
<style lang="less" scoped>
|
||||
.sign-panel {
|
||||
.flex(row, flex-start, flex-start);
|
||||
gap: 48px;
|
||||
padding: 28px 32px;
|
||||
border-radius: @radius-lg;
|
||||
gap: @spacing-xl;
|
||||
padding: @spacing-xl;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
|
||||
&__left {
|
||||
|
||||
@@ -26,7 +26,6 @@ const SIGN_VARIANTS: Record<SignStatus, 'primary' | 'success' | 'warning' | 'dan
|
||||
<div class="contract-table">
|
||||
<el-table
|
||||
:data="contracts"
|
||||
border
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="contractNo" label="合同编号" show-overflow-tooltip />
|
||||
@@ -77,7 +76,7 @@ const SIGN_VARIANTS: Record<SignStatus, 'primary' | 'success' | 'warning' | 'dan
|
||||
<style lang="less" scoped>
|
||||
.contract-table {
|
||||
:deep(.el-table) {
|
||||
font-size: 20px;
|
||||
font-size: @font-size-sm;
|
||||
--el-table-border-color: @contract-line;
|
||||
--el-table-header-bg-color: @contract-table-head-bg;
|
||||
--el-table-header-text-color: @contract-head-text;
|
||||
@@ -85,20 +84,26 @@ const SIGN_VARIANTS: Record<SignStatus, 'primary' | 'success' | 'warning' | 'dan
|
||||
--el-table-row-hover-bg-color: @bg-color-light;
|
||||
background: @white;
|
||||
|
||||
&::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-table__cell {
|
||||
padding: 0;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.cell {
|
||||
padding: 0 10px;
|
||||
font-size: 20px;
|
||||
line-height: 29px;
|
||||
padding: 0 @spacing-sm;
|
||||
font-size: @font-size-sm;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
th.el-table__cell {
|
||||
height: 64px;
|
||||
font-weight: 400;
|
||||
height: 44px;
|
||||
font-weight: 500;
|
||||
background: @contract-table-head-bg;
|
||||
border-bottom: 1px solid @contract-line;
|
||||
|
||||
.cell {
|
||||
color: @contract-head-text;
|
||||
@@ -107,8 +112,9 @@ const SIGN_VARIANTS: Record<SignStatus, 'primary' | 'success' | 'warning' | 'dan
|
||||
}
|
||||
|
||||
td.el-table__cell {
|
||||
height: 96px;
|
||||
height: 64px;
|
||||
color: @contract-cell-text;
|
||||
border-bottom: 1px solid @contract-line;
|
||||
}
|
||||
|
||||
.el-table__row:hover > td.el-table__cell {
|
||||
@@ -118,11 +124,11 @@ const SIGN_VARIANTS: Record<SignStatus, 'primary' | 'success' | 'warning' | 'dan
|
||||
|
||||
&__actions {
|
||||
.flex(row, center);
|
||||
gap: @spacing-sm;
|
||||
gap: @spacing-base;
|
||||
}
|
||||
|
||||
&__btn {
|
||||
font-size: 13px;
|
||||
font-size: @font-size-sm;
|
||||
color: @contract-accent;
|
||||
background: transparent;
|
||||
border: none;
|
||||
|
||||
@@ -65,17 +65,20 @@ onMounted(load)
|
||||
|
||||
<style lang="less" scoped>
|
||||
.contract-detail {
|
||||
padding-bottom: @spacing-xxl;
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
.container {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
&__breadcrumb {
|
||||
padding-top: 32px;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
line-height: 27px;
|
||||
padding-top: @spacing-lg;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: @contract-muted;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,41 +82,40 @@ onMounted(() => {
|
||||
|
||||
<style lang="less" scoped>
|
||||
.contract {
|
||||
padding-bottom: @spacing-xxl;
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__head {
|
||||
padding: 24px 0 52px;
|
||||
padding: @spacing-lg 0;
|
||||
background: @white;
|
||||
|
||||
.container {
|
||||
padding-left: 42px;
|
||||
}
|
||||
border-bottom: 1px solid @border-color;
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-size: 36px;
|
||||
font-weight: 700;
|
||||
line-height: 52px;
|
||||
font-size: @font-size-title;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
color: @contract-ink;
|
||||
}
|
||||
|
||||
&__slogan {
|
||||
margin-top: 13.5px;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
line-height: 37px;
|
||||
margin-top: @spacing-sm;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: @contract-muted;
|
||||
}
|
||||
}
|
||||
|
||||
.contract .contract__card {
|
||||
margin-top: 20px;
|
||||
padding: 51px 64px 59px;
|
||||
border-radius: @radius-lg;
|
||||
margin-top: @spacing-lg;
|
||||
padding: @spacing-lg;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
|
||||
:deep(.filter-panel) {
|
||||
margin-bottom: 39px;
|
||||
margin-bottom: @spacing-lg;
|
||||
padding: 0;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
@@ -128,26 +127,19 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
:deep(.filter-panel__bar) {
|
||||
gap: 8px;
|
||||
|
||||
.filter-panel__btn {
|
||||
margin-left: 78px;
|
||||
}
|
||||
|
||||
.filter-panel__btn--primary {
|
||||
margin-left: 40px;
|
||||
} }
|
||||
gap: @spacing-base;
|
||||
}
|
||||
|
||||
:deep(.filter-panel__input) {
|
||||
flex: 0 0 592px;
|
||||
width: 592px;
|
||||
max-width: none;
|
||||
flex: 0 1 360px;
|
||||
width: auto;
|
||||
max-width: 360px;
|
||||
margin-right: 0;
|
||||
height: 49px;
|
||||
border-color: transparent;
|
||||
border-radius: 0;
|
||||
height: 36px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-round;
|
||||
background: @input-bg;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -157,53 +149,50 @@ onMounted(() => {
|
||||
|
||||
:deep(.filter-panel__input:focus) {
|
||||
border-color: @primary-strong;
|
||||
background: @white;
|
||||
}
|
||||
|
||||
:deep(.filter-panel__btn) {
|
||||
order: 1;
|
||||
min-width: 0;
|
||||
height: 29px;
|
||||
padding: 0 12px;
|
||||
min-width: 72px;
|
||||
height: 36px;
|
||||
padding: 0 @spacing-lg;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
color: @contract-placeholder;
|
||||
font-size: 20px;
|
||||
border-radius: @radius-round;
|
||||
background: @pill-bg;
|
||||
color: @text-color;
|
||||
font-size: @font-size-base;
|
||||
}
|
||||
|
||||
:deep(.filter-panel__btn:hover) {
|
||||
border-color: transparent;
|
||||
color: @text-color;
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
:deep(.filter-panel__btn--primary) {
|
||||
order: 2;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
color: @contract-accent;
|
||||
background: @contract-accent;
|
||||
color: @white;
|
||||
}
|
||||
|
||||
:deep(.filter-panel__btn--primary:hover) {
|
||||
background: transparent;
|
||||
color: @primary-color;
|
||||
background: @primary-color;
|
||||
color: @white;
|
||||
}
|
||||
|
||||
:deep(.pagination) {
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
gap: @spacing-xs;
|
||||
padding: 0;
|
||||
margin-top: 28px;
|
||||
margin-top: @spacing-lg;
|
||||
}
|
||||
|
||||
:deep(.pagination__btn) {
|
||||
min-width: 40px;
|
||||
height: 26px;
|
||||
padding: 0 4px;
|
||||
border: 1px solid @contract-line;
|
||||
border-radius: 0;
|
||||
min-width: 28px;
|
||||
height: 28px;
|
||||
padding: 0 6px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
color: @contract-line;
|
||||
font-size: 14px;
|
||||
color: @text-color;
|
||||
font-size: @font-size-sm;
|
||||
}
|
||||
|
||||
:deep(.pagination__btn:hover:not(:disabled):not(.is-ellipsis)) {
|
||||
@@ -213,8 +202,9 @@ onMounted(() => {
|
||||
|
||||
:deep(.pagination__btn.is-active) {
|
||||
border-color: @contract-accent;
|
||||
background: @contract-accent;
|
||||
color: @white;
|
||||
background: @primary-light;
|
||||
color: @contract-accent;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
:deep(.pagination__btn.is-ellipsis) {
|
||||
@@ -222,20 +212,5 @@ onMounted(() => {
|
||||
background: transparent;
|
||||
color: @contract-muted;
|
||||
}
|
||||
|
||||
:deep(.pagination__btn:first-child),
|
||||
:deep(.pagination__btn:last-child) {
|
||||
min-width: auto;
|
||||
padding: 0 2px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: @contract-muted;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
:deep(.pagination__btn:first-child:disabled),
|
||||
:deep(.pagination__btn:last-child:disabled) {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -63,16 +63,18 @@ onMounted(load)
|
||||
|
||||
<style lang="less" scoped>
|
||||
.contract-sign {
|
||||
min-height: 100%;
|
||||
padding-top: @spacing-lg;
|
||||
padding-bottom: @spacing-xxl;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
.container {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 12px;
|
||||
gap: @spacing-base;
|
||||
}
|
||||
|
||||
&__breadcrumb {
|
||||
font-size: 11px;
|
||||
font-size: @font-size-sm;
|
||||
color: @text-color-disabled;
|
||||
|
||||
> span:last-child {
|
||||
@@ -84,16 +86,16 @@ onMounted(load)
|
||||
&__footer {
|
||||
.flex(row, flex-end);
|
||||
width: 100%;
|
||||
margin-top: 19px;
|
||||
margin-top: @spacing-base;
|
||||
|
||||
:deep(.app-button) {
|
||||
height: 30px;
|
||||
padding: 0 24px;
|
||||
height: 36px;
|
||||
padding: 0 @spacing-lg;
|
||||
border: none;
|
||||
border-radius: @radius-sm;
|
||||
border-radius: @radius-round;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
font-size: @font-size-sm;
|
||||
}
|
||||
|
||||
:deep(.app-button:hover) {
|
||||
|
||||
@@ -49,35 +49,32 @@ const emit = defineEmits<{
|
||||
|
||||
<style lang="less" scoped>
|
||||
.demand-bar {
|
||||
// 设计稿里操作栏不是 fixed 底栏,而是卡片内的一行:
|
||||
// el66 提示文字 x=240 y=2297,按钮 el36/34/32 x=1009/1288/1567 y=2280 w=232 h=63。
|
||||
// 内容左边界 194,提示文字比它右移 46px;按钮右边界 1799 与输入框右边界齐平。
|
||||
.flex(row, space-between, center);
|
||||
margin-top: 66px;
|
||||
margin-top: @spacing-xxl;
|
||||
gap: @spacing-lg;
|
||||
|
||||
&__tip {
|
||||
// 提示文字左边界 240 = 内容左边界 194 + 46。
|
||||
margin: 0 0 0 114px;
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
line-height: 29px;
|
||||
color: @demand-heading;
|
||||
margin: 0;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
|
||||
&__actions {
|
||||
.flex(row, flex-end, center);
|
||||
gap: 47px;
|
||||
gap: @spacing-base;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&__btn {
|
||||
width: 232px;
|
||||
height: 63px;
|
||||
padding: 0;
|
||||
min-width: 120px;
|
||||
height: 40px;
|
||||
padding: 0 @spacing-lg;
|
||||
border: none;
|
||||
border-radius: @radius-base;
|
||||
border-radius: @radius-round;
|
||||
background: @demand-secondary-bg;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
color: @white;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -202,11 +202,10 @@ function onDownload(file: DemandAttachment): void {
|
||||
<style lang="less" scoped>
|
||||
.demand-attach {
|
||||
.flex(column, flex-start, stretch);
|
||||
// el59标签底 1405 → el54 顶 1419 = 14px;el54 底 1509 → el53 顶 1529 = 20px。
|
||||
gap: 14px;
|
||||
gap: @spacing-base;
|
||||
|
||||
&__list {
|
||||
gap: 20px;
|
||||
gap: @spacing-sm;
|
||||
}
|
||||
|
||||
&__head {
|
||||
@@ -215,38 +214,38 @@ function onDownload(file: DemandAttachment): void {
|
||||
|
||||
&__label {
|
||||
flex-shrink: 0;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
line-height: 29px;
|
||||
line-height: 1.4;
|
||||
color: @demand-heading;
|
||||
}
|
||||
|
||||
&__hint {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-left: 20px;
|
||||
font-size: 16px;
|
||||
margin-left: @spacing-base;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
line-height: 23px;
|
||||
color: @demand-line;
|
||||
line-height: 1.5;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
|
||||
// 设计稿 el54:x=194 y=1419 w=1605 h=90,整块浅灰上传区。
|
||||
&__drop {
|
||||
width: 100%;
|
||||
height: 90px;
|
||||
height: 72px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
border-radius: @radius-sm;
|
||||
background: @demand-upload-bg;
|
||||
border: 1px dashed @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @bg-color-light;
|
||||
font-family: inherit;
|
||||
font-size: 16px;
|
||||
color: @demand-line;
|
||||
font-size: @font-size-base;
|
||||
color: @text-color-secondary;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, color 0.2s;
|
||||
transition: background 0.2s, color 0.2s, border-color 0.2s;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background: darken(@demand-upload-bg, 4%);
|
||||
border-color: @demand-accent;
|
||||
background: @filter-selected-bg;
|
||||
color: @demand-accent;
|
||||
}
|
||||
|
||||
@@ -262,35 +261,34 @@ function onDownload(file: DemandAttachment): void {
|
||||
|
||||
&__list {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 20px;
|
||||
gap: @spacing-sm;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
// el53:x=194 y=1529 w=1605 h=90,空态占位块;有附件时列表项本身就是这个高度。
|
||||
&__list:empty {
|
||||
height: 90px;
|
||||
border-radius: @radius-sm;
|
||||
background: @demand-upload-bg;
|
||||
height: 72px;
|
||||
border-radius: @radius-base;
|
||||
background: @bg-color-light;
|
||||
}
|
||||
|
||||
&__item {
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-base;
|
||||
min-height: 90px;
|
||||
padding: 0 @spacing-lg;
|
||||
border-radius: @radius-sm;
|
||||
background: @demand-upload-bg;
|
||||
min-height: 64px;
|
||||
padding: 0 @spacing-base;
|
||||
border-radius: @radius-base;
|
||||
background: @bg-color-light;
|
||||
}
|
||||
|
||||
&__badge {
|
||||
.flex(row, center);
|
||||
flex-shrink: 0;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: @radius-sm;
|
||||
font-size: 12px;
|
||||
font-size: @font-size-xs;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.2px;
|
||||
}
|
||||
@@ -298,18 +296,18 @@ function onDownload(file: DemandAttachment): void {
|
||||
&__meta {
|
||||
.flex(column, flex-start, stretch);
|
||||
flex: 1;
|
||||
gap: 4px;
|
||||
gap: 2px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__name {
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
color: @demand-ink;
|
||||
.ellipsis();
|
||||
}
|
||||
|
||||
&__sub {
|
||||
font-size: 16px;
|
||||
font-size: @font-size-sm;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ const emit = defineEmits<{ 'update:modelValue': [value: string] }>()
|
||||
v-else
|
||||
class="biz-types__icon"
|
||||
:name="option.icon"
|
||||
:size="68"
|
||||
:size="48"
|
||||
/>
|
||||
<span class="biz-types__name">{{ option.label }}</span>
|
||||
<span v-if="option.desc" class="biz-types__desc">{{ option.desc }}</span>
|
||||
@@ -63,20 +63,17 @@ const emit = defineEmits<{ 'update:modelValue': [value: string] }>()
|
||||
&__grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
gap: 17px;
|
||||
gap: @spacing-base;
|
||||
}
|
||||
|
||||
&__card {
|
||||
position: relative;
|
||||
.flex(column, flex-start, flex-start);
|
||||
gap: 0;
|
||||
height: 206px;
|
||||
min-height: 160px;
|
||||
box-sizing: border-box;
|
||||
// 设计稿 el21 "互联网软件" y=545 → 卡片 y=439 距顶 106px。
|
||||
// 插画 el4 y=444 h=110 的框底 554 已越过 name 顶545,说明插画切片含
|
||||
// 透明边距;按文字层定位为准,插画框给68px 见方、左对齐即可。
|
||||
padding: 4px 16px 0;
|
||||
border: 1px solid @demand-line;
|
||||
padding: @spacing-lg;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
text-align: left;
|
||||
@@ -88,18 +85,17 @@ const emit = defineEmits<{ 'update:modelValue': [value: string] }>()
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
border-color: @demand-selected-bg;
|
||||
background: @demand-selected-bg;
|
||||
border-color: @demand-accent;
|
||||
background: @filter-selected-bg;
|
||||
}
|
||||
}
|
||||
|
||||
// el8 "圆形51" x=442 y=467 w=30 h=30:卡片 x=194 w=307,右内缩 29px、上移 22px。
|
||||
&__check {
|
||||
position: absolute;
|
||||
top: 22px;
|
||||
right: 19px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
top: @spacing-base;
|
||||
right: @spacing-base;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border: 1px solid @demand-radio-idle;
|
||||
border-radius: 50%;
|
||||
background: @white;
|
||||
@@ -107,41 +103,42 @@ const emit = defineEmits<{ 'update:modelValue': [value: string] }>()
|
||||
}
|
||||
|
||||
&__card.is-active &__check {
|
||||
border-color: @white;
|
||||
border-color: @demand-accent;
|
||||
background: @white;
|
||||
box-shadow: inset 0 0 0 3px @demand-selected-bg;
|
||||
box-shadow: inset 0 0 0 5px @demand-accent;
|
||||
}
|
||||
|
||||
// el4 插画 x=233 / el3 x=542 / el1 x=875 / el2 x=1190:
|
||||
// 四张卡的插画都在卡片左边线右侧 27~39px 处,不是水平居中,按左对齐处理。
|
||||
&__icon {
|
||||
margin-bottom: 33px;
|
||||
margin-bottom: @spacing-base;
|
||||
}
|
||||
|
||||
&__logo {
|
||||
width: 68px;
|
||||
height: 68px;
|
||||
margin-bottom: 33px;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin-bottom: @spacing-base;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
&__name {
|
||||
font-size: 28px;
|
||||
font-size: @font-size-lg;
|
||||
font-weight: 500;
|
||||
line-height: 45px;
|
||||
line-height: 1.4;
|
||||
color: @demand-ink;
|
||||
}
|
||||
|
||||
&__desc {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 23px;
|
||||
color: @demand-ink;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
|
||||
&__card.is-active &__name {
|
||||
color: @demand-accent;
|
||||
}
|
||||
|
||||
&__card.is-active &__name,
|
||||
&__card.is-active &__desc {
|
||||
color: @white;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -99,24 +99,24 @@ function onRemark(event: Event): void {
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
line-height: 29px;
|
||||
line-height: 1.4;
|
||||
color: @demand-heading;
|
||||
}
|
||||
|
||||
&__input {
|
||||
.text-control();
|
||||
height: 49px;
|
||||
padding: 0 18px;
|
||||
border-color: @demand-line;
|
||||
height: 40px;
|
||||
padding: 0 @spacing-base;
|
||||
border-color: @border-color;
|
||||
border-radius: @radius-sm;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
color: @demand-ink;
|
||||
|
||||
&::placeholder {
|
||||
font-weight: 400;
|
||||
color: @demand-line;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,27 +127,27 @@ function onRemark(event: Event): void {
|
||||
|
||||
&__textarea {
|
||||
.text-control();
|
||||
height: 270px;
|
||||
min-height: 270px;
|
||||
padding: 10px 18px 24px;
|
||||
border-color: @demand-line;
|
||||
height: 160px;
|
||||
min-height: 160px;
|
||||
padding: @spacing-base;
|
||||
border-color: @border-color;
|
||||
border-radius: @radius-sm;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
color: @demand-ink;
|
||||
line-height: 29px;
|
||||
line-height: 1.5;
|
||||
resize: vertical;
|
||||
|
||||
&::placeholder {
|
||||
font-weight: 400;
|
||||
color: @demand-line;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
}
|
||||
|
||||
&__count {
|
||||
position: absolute;
|
||||
right: @spacing-lg;
|
||||
right: @spacing-base;
|
||||
bottom: @spacing-sm;
|
||||
font-size: 16px;
|
||||
font-size: @font-size-sm;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,9 +201,9 @@ function onBudgetManualBlur(event: Event): void {
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
line-height: 29px;
|
||||
line-height: 1.4;
|
||||
color: @demand-heading;
|
||||
}
|
||||
|
||||
@@ -214,16 +214,16 @@ function onBudgetManualBlur(event: Event): void {
|
||||
|
||||
&__input {
|
||||
.text-control();
|
||||
height: 49px;
|
||||
padding: 0 18px;
|
||||
border-color: @demand-line;
|
||||
height: 40px;
|
||||
padding: 0 @spacing-base;
|
||||
border-color: @border-color;
|
||||
border-radius: @radius-sm;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
color: @demand-ink;
|
||||
|
||||
&::placeholder {
|
||||
font-weight: 400;
|
||||
color: @demand-line;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,47 +234,47 @@ function onBudgetManualBlur(event: Event): void {
|
||||
|
||||
&__textarea {
|
||||
.text-control();
|
||||
height: 270px;
|
||||
min-height: 270px;
|
||||
padding: 10px 18px 24px;
|
||||
border-color: @demand-line;
|
||||
height: 160px;
|
||||
min-height: 160px;
|
||||
padding: @spacing-base;
|
||||
border-color: @border-color;
|
||||
border-radius: @radius-sm;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
color: @demand-ink;
|
||||
line-height: 29px;
|
||||
line-height: 1.5;
|
||||
resize: vertical;
|
||||
|
||||
&::placeholder {
|
||||
font-weight: 400;
|
||||
color: @demand-line;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
}
|
||||
|
||||
&__count {
|
||||
position: absolute;
|
||||
right: @spacing-lg;
|
||||
right: @spacing-base;
|
||||
bottom: @spacing-sm;
|
||||
font-size: 16px;
|
||||
font-size: @font-size-sm;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
|
||||
&__budgets {
|
||||
.flex(row, flex-start, stretch);
|
||||
gap: 17px;
|
||||
gap: @spacing-base;
|
||||
}
|
||||
|
||||
&__budget {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 49px;
|
||||
height: 40px;
|
||||
padding: 0 @spacing-sm;
|
||||
border: 1px solid @demand-line;
|
||||
border-radius: @radius-sm;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 400;
|
||||
font-family: inherit;
|
||||
color: @demand-line;
|
||||
color: @text-color;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
@@ -287,8 +287,8 @@ function onBudgetManualBlur(event: Event): void {
|
||||
|
||||
&.is-active {
|
||||
border-color: @demand-accent;
|
||||
background: @demand-selected-bg;
|
||||
color: @white;
|
||||
background: @filter-selected-bg;
|
||||
color: @demand-accent;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
@@ -298,7 +298,7 @@ function onBudgetManualBlur(event: Event): void {
|
||||
|
||||
&::placeholder {
|
||||
font-weight: 400;
|
||||
color: @demand-line;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,9 @@ onMounted(() => {
|
||||
|
||||
<style lang="less" scoped>
|
||||
.demand-page {
|
||||
// 操作栏已收进卡片内(设计稿 el36 y=2280),不需要为fixed 底栏预留空白。
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&.is-loading .demand {
|
||||
opacity: 0.6;
|
||||
@@ -128,65 +130,60 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
&__hero {
|
||||
height: 179px;
|
||||
box-sizing: border-box;
|
||||
padding-top: 32px;
|
||||
padding: @spacing-lg 0;
|
||||
background: @white;
|
||||
border-bottom: 1px solid @border-color;
|
||||
}
|
||||
|
||||
&__hero-inner {
|
||||
// 设计稿 el82:标题左边界 112px(hero 白底 1920 宽,标题左起 112)。
|
||||
padding-left: 112px;
|
||||
padding-left: @spacing-xl;
|
||||
}
|
||||
|
||||
&__title {
|
||||
margin: 0;
|
||||
font-size: 36px;
|
||||
font-weight: 700;
|
||||
line-height: 52px;
|
||||
font-size: @font-size-title;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
color: @demand-ink;
|
||||
}
|
||||
|
||||
&__subtitle {
|
||||
margin: 15px 0 0;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
line-height: 35px;
|
||||
margin: @spacing-sm 0 0;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: @demand-subtitle;
|
||||
}
|
||||
}
|
||||
|
||||
.demand {
|
||||
margin-top: 20px; // 271 − (72+179) = 20
|
||||
// 设计稿 el83 卡片 x=70 w=1780;内容左边界 194(el68 输入框 x=194 w=1605),
|
||||
// 右边界 1799。故左内边距 56、右内边距 51(不对称是设计稿本身如此)。
|
||||
padding: 48px 51px 114px 56px;
|
||||
margin-top: @spacing-lg;
|
||||
padding: @spacing-xl;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
|
||||
&__heading {
|
||||
// 设计稿三个 heading 的标签都比序号低 23px(el80 "01" y=319 →
|
||||
// el79 "选择业务类型*" y=342),不是垂直居中,故用flex-start + margin-top。
|
||||
.flex(row, flex-start, flex-start);
|
||||
gap: 4px;
|
||||
margin: 0 0 50px;
|
||||
padding-left: 8px;
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-sm;
|
||||
margin: 0 0 @spacing-lg;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
&__index {
|
||||
flex-shrink: 0;
|
||||
font-size: 48px;
|
||||
font-weight: 500;
|
||||
line-height: 70px;
|
||||
font-size: @font-size-title;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
font-variant-numeric: tabular-nums;
|
||||
color: @demand-accent;
|
||||
}
|
||||
|
||||
&__label {
|
||||
// 与序号的顶部落差 23px(el80 y=319 → el79 y=342)。
|
||||
margin-top: 23px;
|
||||
font-size: 28px;
|
||||
margin-top: 0;
|
||||
font-size: @font-size-lg;
|
||||
font-weight: 500;
|
||||
line-height: 41px;
|
||||
line-height: 1.4;
|
||||
color: @demand-heading;
|
||||
}
|
||||
|
||||
@@ -195,28 +192,24 @@ onMounted(() => {
|
||||
color: @danger-color;
|
||||
}
|
||||
|
||||
// 内容左边界 194:卡片 x=70 + padding-left 56 + 内容缩进 68。
|
||||
&__heading + * {
|
||||
margin-left: 68px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
// el29业务类型卡片底 645 → el78 "02" 顶 705 = 60px。
|
||||
&__section + &__section {
|
||||
margin-top: 60px;
|
||||
margin-top: @spacing-xxl;
|
||||
}
|
||||
|
||||
// el53 附件灰块底 1619 → el76 "03" 顶 1689 = 70px。
|
||||
&__section + &__section:last-of-type {
|
||||
margin-top: 70px;
|
||||
margin-top: @spacing-xxl;
|
||||
}
|
||||
|
||||
&__section + &__section &__heading {
|
||||
margin-bottom: 0;
|
||||
margin-bottom: @spacing-lg;
|
||||
}
|
||||
|
||||
// el78 "02" 底 775 → el70 "项目名称*" 顶 789 = 14px。
|
||||
&__section + &__section &__heading + * {
|
||||
margin-top: 14px;
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -150,16 +150,17 @@ onMounted(() => {
|
||||
<style lang="less" scoped>
|
||||
.bill-detail {
|
||||
width: 100%;
|
||||
padding-bottom: 325px;
|
||||
background: @contract-page-bg;
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__breadcrumb {
|
||||
.flex(row, flex-start, center);
|
||||
height: 86px;
|
||||
padding-top: 34px;
|
||||
font-size: 13px;
|
||||
min-height: 48px;
|
||||
padding-top: @spacing-lg;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
line-height: 1.5;
|
||||
color: @project-muted;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -154,8 +154,9 @@ onMounted(() => {
|
||||
align-items: stretch;
|
||||
gap: 0;
|
||||
width: 100%;
|
||||
padding-bottom: 14px;
|
||||
background: @contract-page-bg;
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__breadcrumb {
|
||||
.flex(row, flex-start, center);
|
||||
@@ -185,9 +186,9 @@ onMounted(() => {
|
||||
&__stats {
|
||||
.flex(row, flex-start, flex-start);
|
||||
gap: 0;
|
||||
height: 106px;
|
||||
margin-top: 11px;
|
||||
border: 1px solid @finance-card-line;
|
||||
min-height: 96px;
|
||||
margin-top: @spacing-base;
|
||||
border: none;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-sizing: border-box;
|
||||
@@ -209,19 +210,19 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
&__stat-value {
|
||||
font-size: 26px;
|
||||
font-weight: 700;
|
||||
line-height: 35px;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
color: @finance-ink;
|
||||
}
|
||||
|
||||
&__toolbar {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 0;
|
||||
height: 71px;
|
||||
margin-top: 14px;
|
||||
padding: 0 0 0 22px;
|
||||
border: 1px solid @finance-card-line;
|
||||
gap: @spacing-base;
|
||||
min-height: 64px;
|
||||
margin-top: @spacing-base;
|
||||
padding: 0 @spacing-lg;
|
||||
border: none;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-sizing: border-box;
|
||||
@@ -249,27 +250,29 @@ onMounted(() => {
|
||||
|
||||
:deep(.el-radio-button.is-active .el-radio-button__inner) {
|
||||
border-color: @primary-strong;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
background: @filter-selected-bg;
|
||||
color: @primary-strong;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
box-shadow: -1px 0 0 0 @primary-strong;
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
&__search {
|
||||
width: 1300px;
|
||||
height: 37px;
|
||||
margin-left: 33px;
|
||||
flex-shrink: 0;
|
||||
flex: 0 1 360px;
|
||||
width: auto;
|
||||
height: 36px;
|
||||
margin-left: 0;
|
||||
flex-shrink: 1;
|
||||
min-width: 0;
|
||||
|
||||
:deep(.el-input__wrapper) {
|
||||
width: 1300px;
|
||||
height: 37px;
|
||||
padding: 0 16px;
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
padding: 0 @spacing-base;
|
||||
background: @finance-field-bg;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
box-shadow: 0 0 0 1px @border-color inset;
|
||||
border-radius: @radius-round;
|
||||
}
|
||||
|
||||
:deep(.el-input__inner) {
|
||||
@@ -314,36 +317,41 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
&__board {
|
||||
margin-top: 14px;
|
||||
border: 1px solid @finance-card-line;
|
||||
margin-top: @spacing-base;
|
||||
border: none;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
overflow: hidden;
|
||||
padding: @spacing-base @spacing-lg @spacing-lg;
|
||||
}
|
||||
|
||||
:deep(.pagination) {
|
||||
justify-content: flex-end;
|
||||
gap: 3.7px;
|
||||
padding: 8px 26px 30px 0;
|
||||
gap: @spacing-xs;
|
||||
padding: @spacing-base 0 0;
|
||||
}
|
||||
|
||||
:deep(.pagination__btn) {
|
||||
min-width: 0;
|
||||
height: 16px;
|
||||
padding: 0 3px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
color: @finance-muted-text;
|
||||
font-size: 12px;
|
||||
min-width: 28px;
|
||||
height: 28px;
|
||||
padding: 0 6px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
color: @text-color;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
|
||||
&.is-active {
|
||||
min-width: 21.45px;
|
||||
min-width: 28px;
|
||||
border-color: @primary-strong;
|
||||
background: @primary-light;
|
||||
color: @primary-strong;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
&:hover:not(:disabled):not(.is-ellipsis) {
|
||||
border: none;
|
||||
border-color: @primary-strong;
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
|
||||
@@ -210,11 +210,13 @@ onBeforeUnmount(() => {
|
||||
.checkout {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: @spacing-base;
|
||||
min-height: 100%;
|
||||
padding-top: @spacing-lg;
|
||||
padding-bottom: @spacing-xxl;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__breadcrumb {
|
||||
font-size: @font-size-base;
|
||||
font-size: @font-size-sm;
|
||||
}
|
||||
|
||||
&__layout {
|
||||
|
||||
@@ -126,31 +126,36 @@ watch(
|
||||
|
||||
<style lang="less" scoped>
|
||||
.bill-table {
|
||||
width: 1765px;
|
||||
margin: 6.5px 0 0 14.5px;
|
||||
font-size: 12px;
|
||||
width: 100%;
|
||||
margin: @spacing-sm 0 0;
|
||||
font-size: @font-size-sm;
|
||||
color: @finance-entry-text;
|
||||
|
||||
:deep(.el-table) {
|
||||
--el-table-border-color: @border-color;
|
||||
|
||||
&::before {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-table__header-wrapper th.el-table__cell) {
|
||||
height: 41.77px;
|
||||
height: 44px;
|
||||
padding: 0;
|
||||
background: @finance-table-head-bg;
|
||||
border-right: 1px solid @project-divider;
|
||||
border-bottom: 1px solid @project-divider;
|
||||
color: @finance-entry-text;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
border-right: none;
|
||||
border-bottom: 1px solid @border-color;
|
||||
color: @text-color-secondary;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
:deep(.el-table__header-wrapper th.el-table__cell:first-child) {
|
||||
border-left: 1px solid @project-divider;
|
||||
}
|
||||
|
||||
:deep(.el-table__body-wrapper td.el-table__cell) {
|
||||
height: 43.77px;
|
||||
height: 56px;
|
||||
padding: 0;
|
||||
border-bottom: 1px solid @project-divider;
|
||||
border-right: none;
|
||||
border-bottom: 1px solid @border-color;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -159,17 +164,16 @@ watch(
|
||||
}
|
||||
|
||||
:deep(.el-table .cell) {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-left: @spacing-sm;
|
||||
padding-right: @spacing-sm;
|
||||
line-height: normal;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
// 首列(多选)左缩进对齐设计稿
|
||||
:deep(.el-table-column--selection .cell) {
|
||||
padding-left: 43.5px;
|
||||
padding-left: @spacing-base;
|
||||
}
|
||||
|
||||
&__ops {
|
||||
@@ -177,12 +181,12 @@ watch(
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 18px;
|
||||
gap: @spacing-base;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__link {
|
||||
font-size: 12px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@@ -164,20 +164,22 @@ onMounted(() => {
|
||||
<style lang="less" scoped>
|
||||
.finance {
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__top {
|
||||
.flex(row, flex-start, stretch);
|
||||
gap: 14px;
|
||||
margin-top: -56px;
|
||||
gap: @spacing-base;
|
||||
margin-top: @spacing-lg;
|
||||
}
|
||||
|
||||
&__entries {
|
||||
.flex(row, space-between, center);
|
||||
flex: 0 0 672px;
|
||||
height: 135px;
|
||||
// 设计稿 #20:首入口中心 x=1272、尾中心 x=1756,两侧对称 padding 66px 命中
|
||||
padding: 0 66px;
|
||||
border: 1px solid @finance-card-line;
|
||||
border: none;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -137,16 +137,17 @@ onMounted(() => {
|
||||
<style lang="less" scoped>
|
||||
.invoice-titles {
|
||||
width: 100%;
|
||||
padding-bottom: 459px;
|
||||
background: @contract-page-bg;
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__breadcrumb {
|
||||
.flex(row, flex-start, center);
|
||||
height: 81px;
|
||||
padding-top: 36px;
|
||||
font-size: 13px;
|
||||
min-height: 48px;
|
||||
padding-top: @spacing-lg;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
line-height: 1.5;
|
||||
color: @project-muted;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@@ -167,9 +168,9 @@ onMounted(() => {
|
||||
|
||||
&__head {
|
||||
.flex(row, space-between, center);
|
||||
height: 62px;
|
||||
padding: 0 33.56px 0 36px;
|
||||
border: 1px solid @finance-card-line;
|
||||
min-height: 56px;
|
||||
padding: 0 @spacing-lg;
|
||||
border: none;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -265,8 +265,10 @@ onMounted(() => {
|
||||
gap: @spacing-base;
|
||||
width: 100%;
|
||||
max-width: @container-width;
|
||||
min-height: 100%;
|
||||
margin: 0 auto;
|
||||
padding: @spacing-lg @spacing-base @spacing-xxl;
|
||||
padding: @spacing-lg @spacing-base @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__breadcrumb {
|
||||
font-size: 11px;
|
||||
@@ -346,13 +348,14 @@ onMounted(() => {
|
||||
|
||||
&.is-active {
|
||||
border-color: @primary-color;
|
||||
background: @primary-color;
|
||||
color: @white;
|
||||
background: @filter-selected-bg;
|
||||
color: @primary-color;
|
||||
font-weight: 500;
|
||||
|
||||
&:hover {
|
||||
border-color: @primary-color;
|
||||
background: @primary-color;
|
||||
color: @white;
|
||||
background: @filter-selected-bg;
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,15 +131,16 @@ onMounted(() => {
|
||||
<style lang="less" scoped>
|
||||
.pay-result {
|
||||
width: 100%;
|
||||
padding-bottom: 344px;
|
||||
background: @contract-page-bg;
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__breadcrumb {
|
||||
.flex(row, flex-start, center);
|
||||
padding-top: 22px;
|
||||
font-size: 13px;
|
||||
padding-top: @spacing-lg;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
line-height: 1.5;
|
||||
color: @project-muted;
|
||||
}
|
||||
|
||||
@@ -164,13 +165,13 @@ onMounted(() => {
|
||||
|
||||
&__check {
|
||||
.flex(row, center, center);
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
margin: 0 auto;
|
||||
border-radius: 50%;
|
||||
background: @finance-result-circle;
|
||||
color: @white;
|
||||
font-size: 56px;
|
||||
font-size: @font-size-hero;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
@@ -161,8 +161,10 @@ onMounted(() => {
|
||||
.pay {
|
||||
width: 100%;
|
||||
max-width: @container-width;
|
||||
min-height: 100%;
|
||||
margin: 0 auto;
|
||||
padding: @spacing-lg @spacing-base @spacing-xxl;
|
||||
padding: @spacing-lg @spacing-base @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__breadcrumb {
|
||||
margin-bottom: @spacing-base;
|
||||
@@ -235,8 +237,8 @@ onMounted(() => {
|
||||
|
||||
&__amount {
|
||||
margin-top: 4px;
|
||||
font-size: 26px;
|
||||
font-weight: 700;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
color: @danger-color;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
@@ -61,59 +61,92 @@ onBeforeUnmount(stopAutoplay)
|
||||
|
||||
<template>
|
||||
<section class="home-banner">
|
||||
<div class="home-banner__carousel" aria-hidden="true">
|
||||
<div
|
||||
v-for="(src, index) in slides"
|
||||
:key="`${src}-${index}`"
|
||||
class="home-banner__slide"
|
||||
:class="{ 'home-banner__slide--active': index === activeIndex }"
|
||||
>
|
||||
<img
|
||||
class="home-banner__image"
|
||||
:class="{ 'home-banner__image--inline': !hasBanners }"
|
||||
:src="src"
|
||||
alt=""
|
||||
<div class="home-banner__stage">
|
||||
<div class="home-banner__carousel" aria-hidden="true">
|
||||
<div
|
||||
v-for="(src, index) in slides"
|
||||
:key="`${src}-${index}`"
|
||||
class="home-banner__slide"
|
||||
:class="{ 'home-banner__slide--active': index === activeIndex }"
|
||||
>
|
||||
<img
|
||||
class="home-banner__image"
|
||||
:class="{ 'home-banner__image--inline': !hasBanners }"
|
||||
:src="src"
|
||||
alt=""
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="home-banner__inner">
|
||||
<h1 class="home-banner__title">虫子智造研发一体化平台</h1>
|
||||
<p class="home-banner__subtitle">一站式智能软硬件研发与量产综合服务商</p>
|
||||
<div class="home-banner__inner">
|
||||
<h1 class="home-banner__title">
|
||||
虫子智造研发一体化平台
|
||||
</h1>
|
||||
<p class="home-banner__subtitle">
|
||||
一站式智能软硬件研发与量产综合服务商
|
||||
</p>
|
||||
|
||||
<div class="home-banner__actions">
|
||||
<button class="home-banner__btn home-banner__btn--primary" type="button" @click="goDemand">
|
||||
需求提报
|
||||
</button>
|
||||
<button class="home-banner__btn home-banner__btn--ghost" type="button" @click="goCases">
|
||||
案例中心
|
||||
</button>
|
||||
<div class="home-banner__actions">
|
||||
<button
|
||||
class="home-banner__btn home-banner__btn--primary"
|
||||
type="button"
|
||||
@click="goDemand"
|
||||
>
|
||||
需求提报
|
||||
</button>
|
||||
<button
|
||||
class="home-banner__btn home-banner__btn--ghost"
|
||||
type="button"
|
||||
@click="goCases"
|
||||
>
|
||||
案例中心
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="slides.length > 1" class="home-banner__dots" role="tablist" aria-label="头图轮播">
|
||||
<button
|
||||
v-for="(_, index) in slides"
|
||||
:key="index"
|
||||
class="home-banner__dot"
|
||||
:class="{ 'home-banner__dot--active': index === activeIndex }"
|
||||
type="button"
|
||||
role="tab"
|
||||
:aria-selected="index === activeIndex"
|
||||
@click="goTo(index)"
|
||||
/>
|
||||
<div
|
||||
v-if="slides.length > 1"
|
||||
class="home-banner__dots"
|
||||
role="tablist"
|
||||
aria-label="头图轮播"
|
||||
>
|
||||
<button
|
||||
v-for="(_, index) in slides"
|
||||
:key="index"
|
||||
class="home-banner__dot"
|
||||
:class="{ 'home-banner__dot--active': index === activeIndex }"
|
||||
type="button"
|
||||
role="tab"
|
||||
:aria-selected="index === activeIndex"
|
||||
@click="goTo(index)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.home-banner {
|
||||
position: relative;
|
||||
height: 661px;
|
||||
overflow: hidden;
|
||||
background: @home-banner-bg;
|
||||
width: 100%;
|
||||
flex: 0 0 auto;
|
||||
padding: @spacing-lg @home-gutter 0;
|
||||
box-sizing: border-box;
|
||||
background: transparent;
|
||||
|
||||
@media (max-width: 1600px) {
|
||||
padding: @spacing-lg @spacing-lg 0;
|
||||
}
|
||||
|
||||
&__stage {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: @home-content;
|
||||
height: 420px;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
border-radius: @radius-base;
|
||||
background: @home-banner-bg;
|
||||
}
|
||||
|
||||
&__carousel {
|
||||
position: absolute;
|
||||
@@ -138,15 +171,14 @@ onBeforeUnmount(stopAutoplay)
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
|
||||
// 内置插图:按设计稿定位与尺寸原样显示,不铺满
|
||||
&--inline {
|
||||
position: absolute;
|
||||
top: 31px;
|
||||
right: 269px;
|
||||
top: 24px;
|
||||
right: 48px;
|
||||
left: auto;
|
||||
bottom: auto;
|
||||
width: 723px;
|
||||
height: 598px;
|
||||
width: 420px;
|
||||
height: 348px;
|
||||
margin-left: auto;
|
||||
object-fit: contain;
|
||||
}
|
||||
@@ -156,50 +188,48 @@ onBeforeUnmount(stopAutoplay)
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
max-width: @container-width;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&__title {
|
||||
position: absolute;
|
||||
top: 184px;
|
||||
left: 150px;
|
||||
top: 96px;
|
||||
left: 64px;
|
||||
margin: 0;
|
||||
color: @banner-title-color;
|
||||
font-size: @font-size-hero-lg;
|
||||
font-size: @font-size-hero;
|
||||
font-weight: 700;
|
||||
line-height: 87px;
|
||||
line-height: 1.25;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__subtitle {
|
||||
position: absolute;
|
||||
top: 287px;
|
||||
left: 150px;
|
||||
top: 168px;
|
||||
left: 64px;
|
||||
margin: 0;
|
||||
color: @banner-title-color;
|
||||
font-size: 24px;
|
||||
font-size: @font-size-lg;
|
||||
font-weight: 500;
|
||||
line-height: 35px;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__actions {
|
||||
position: absolute;
|
||||
top: 392px;
|
||||
left: 150px;
|
||||
top: 232px;
|
||||
left: 64px;
|
||||
.flex(row, flex-start, center);
|
||||
gap: 20px;
|
||||
gap: @spacing-base;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
&__btn {
|
||||
width: 183px;
|
||||
height: 55px;
|
||||
border-radius: 8px;
|
||||
font-size: 18px;
|
||||
width: 140px;
|
||||
height: 44px;
|
||||
border-radius: @radius-base;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
@@ -220,7 +250,7 @@ onBeforeUnmount(stopAutoplay)
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: 8px;
|
||||
border-radius: @radius-base;
|
||||
padding: 2px;
|
||||
background: linear-gradient(135deg, @btn-gradient-from 0%, @btn-gradient-to 100%);
|
||||
-webkit-mask:
|
||||
@@ -238,16 +268,17 @@ onBeforeUnmount(stopAutoplay)
|
||||
|
||||
&__dots {
|
||||
position: absolute;
|
||||
left: 929px;
|
||||
top: 594px;
|
||||
left: 50%;
|
||||
bottom: @spacing-base;
|
||||
z-index: 1;
|
||||
.flex(row, flex-start, center);
|
||||
gap: 13px;
|
||||
.flex(row, center, center);
|
||||
gap: @spacing-sm;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
&__dot {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
@@ -255,7 +286,7 @@ onBeforeUnmount(stopAutoplay)
|
||||
cursor: pointer;
|
||||
|
||||
&--active {
|
||||
width: 44px;
|
||||
width: 28px;
|
||||
border-radius: 3px;
|
||||
background: @home-banner-dot;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { BusinessType } from '@/types/api'
|
||||
import type { BusinessLine } from '@/types/business/home'
|
||||
import defaultCover from '@/assets/home/chahua.png'
|
||||
|
||||
interface Props {
|
||||
lines: BusinessLine[]
|
||||
@@ -9,6 +10,16 @@ interface Props {
|
||||
defineProps<Props>()
|
||||
|
||||
const FALLBACK_ACTIVE: BusinessType[] = ['internet']
|
||||
|
||||
function isImageUrl(value: string): boolean {
|
||||
return /^(https?:)?\/\//i.test(value) || value.startsWith('/') || value.startsWith('data:')
|
||||
}
|
||||
|
||||
function coverSrc(line: BusinessLine): string {
|
||||
const remote = (line.cover || line.icon).trim()
|
||||
if (remote && isImageUrl(remote)) return remote
|
||||
return defaultCover
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -25,6 +36,11 @@ const FALLBACK_ACTIVE: BusinessType[] = ['internet']
|
||||
'home-business__card--active': FALLBACK_ACTIVE.includes(line.id),
|
||||
}"
|
||||
>
|
||||
<img
|
||||
class="home-business__cover"
|
||||
:src="coverSrc(line)"
|
||||
:alt="line.name"
|
||||
>
|
||||
<span class="home-business__check" aria-hidden="true" />
|
||||
<h4 class="home-business__name">
|
||||
{{ line.name }}
|
||||
@@ -39,61 +55,73 @@ const FALLBACK_ACTIVE: BusinessType[] = ['internet']
|
||||
|
||||
<style lang="less" scoped>
|
||||
.home-business {
|
||||
padding: 44px 70px 54px;
|
||||
border: 1px solid @home-section-border;
|
||||
border-radius: @radius-lg;
|
||||
padding: @spacing-xl;
|
||||
border: none;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
|
||||
&__title {
|
||||
margin: 0 0 47px;
|
||||
font-size: @font-size-xxl;
|
||||
font-weight: 700;
|
||||
margin: 0 0 @spacing-lg;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
color: @home-ink;
|
||||
}
|
||||
|
||||
&__grid {
|
||||
display: flex;
|
||||
gap: 22px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: @spacing-base;
|
||||
}
|
||||
|
||||
&__card {
|
||||
position: relative;
|
||||
.flex(column, flex-start, flex-start);
|
||||
flex: 0 1 368px;
|
||||
min-width: 0;
|
||||
height: 206px;
|
||||
min-height: 168px;
|
||||
box-sizing: border-box;
|
||||
padding: 0 20px;
|
||||
padding: @spacing-lg;
|
||||
overflow: hidden;
|
||||
border: 1px solid @home-business-border;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
transition:
|
||||
transform 0.2s,
|
||||
box-shadow 0.2s;
|
||||
box-shadow 0.2s,
|
||||
border-color 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: @primary-color;
|
||||
box-shadow: @shadow-base;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
}
|
||||
|
||||
&__cover {
|
||||
display: block;
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
object-fit: contain;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&__check {
|
||||
position: absolute;
|
||||
top: 27px;
|
||||
right: 37px;
|
||||
top: @spacing-base;
|
||||
right: @spacing-base;
|
||||
z-index: 1;
|
||||
flex-shrink: 0;
|
||||
width: 31px;
|
||||
height: 31px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border: 1px solid @home-ring;
|
||||
border-radius: @radius-round;
|
||||
background: @white;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
margin: auto;
|
||||
border-radius: @radius-round;
|
||||
background: @white;
|
||||
@@ -102,37 +130,43 @@ const FALLBACK_ACTIVE: BusinessType[] = ['internet']
|
||||
}
|
||||
|
||||
&__name {
|
||||
margin: 104px 0 0;
|
||||
font-size: @font-size-title;
|
||||
margin: @spacing-base 0 0;
|
||||
padding-right: @spacing-xl;
|
||||
font-size: @font-size-lg;
|
||||
font-weight: 500;
|
||||
line-height: 41px;
|
||||
line-height: 1.4;
|
||||
color: @home-ink;
|
||||
}
|
||||
|
||||
&__desc {
|
||||
margin: 4px 0 0;
|
||||
font-size: @font-size-md;
|
||||
font-weight: 500;
|
||||
line-height: 23px;
|
||||
color: @home-ink;
|
||||
.multi-ellipsis(1);
|
||||
margin: @spacing-xs 0 0;
|
||||
padding-right: @spacing-xl;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: @text-color-secondary;
|
||||
.multi-ellipsis(2);
|
||||
}
|
||||
|
||||
&__card--active {
|
||||
border-color: @primary-strong;
|
||||
background: @primary-strong;
|
||||
border-color: @primary-color;
|
||||
background: @filter-selected-bg;
|
||||
|
||||
.home-business__check {
|
||||
border-color: @white;
|
||||
border-color: @primary-color;
|
||||
|
||||
&::after {
|
||||
opacity: 1;
|
||||
background: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
.home-business__name,
|
||||
.home-business__name {
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
.home-business__desc {
|
||||
color: @white;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,9 +33,7 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
|
||||
<template>
|
||||
<section class="home-cases">
|
||||
<div class="home-cases__head">
|
||||
<h3 class="home-cases__title">
|
||||
案例库精选
|
||||
</h3>
|
||||
<h3 class="home-cases__title">案例库精选</h3>
|
||||
<div class="home-cases__tabs">
|
||||
<button
|
||||
v-for="cat in categories"
|
||||
@@ -60,7 +58,12 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
|
||||
@click="$router.push(`/cases/${item.id}`)"
|
||||
>
|
||||
<div class="home-cases__cover">
|
||||
<img v-if="item.cover" v-lazy="item.cover" class="home-cases__img" :alt="item.title">
|
||||
<img
|
||||
v-if="item.cover"
|
||||
v-lazy="item.cover"
|
||||
class="home-cases__img"
|
||||
:alt="item.title"
|
||||
/>
|
||||
<div v-else class="home-cases__img home-cases__img--placeholder" />
|
||||
</div>
|
||||
|
||||
@@ -85,26 +88,26 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
|
||||
|
||||
<style lang="less" scoped>
|
||||
.home-cases {
|
||||
padding: 40px 66px 60px;
|
||||
border: 1px solid @home-section-border;
|
||||
border-radius: @radius-lg;
|
||||
padding: @spacing-xl;
|
||||
border: none;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
|
||||
&__head {
|
||||
.flex(row, flex-start);
|
||||
gap: 24px;
|
||||
margin-bottom: 47px;
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-lg;
|
||||
margin-bottom: @spacing-lg;
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-size: @font-size-xxl;
|
||||
font-weight: 700;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
color: @home-ink;
|
||||
}
|
||||
|
||||
&__tabs {
|
||||
.flex(row, center);
|
||||
gap: 36px;
|
||||
gap: @spacing-lg;
|
||||
}
|
||||
|
||||
&__tab {
|
||||
@@ -140,25 +143,29 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
|
||||
}
|
||||
|
||||
&__grid {
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: @spacing-lg;
|
||||
}
|
||||
|
||||
&__card {
|
||||
overflow: hidden;
|
||||
flex: 0 1 368px;
|
||||
min-width: 0;
|
||||
height: 248px;
|
||||
min-height: 220px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid @home-case-border;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-shadow: 0 4px 10px fade(@black, 8%);
|
||||
box-shadow: none;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s, box-shadow 0.2s;
|
||||
transition:
|
||||
transform 0.2s,
|
||||
box-shadow 0.2s,
|
||||
border-color 0.2s;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 6px 14px fade(@black, 12%);
|
||||
border-color: @primary-color;
|
||||
box-shadow: @shadow-base;
|
||||
transform: translateY(-2px);
|
||||
|
||||
.home-cases__view {
|
||||
@@ -184,7 +191,7 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
|
||||
}
|
||||
|
||||
&__body {
|
||||
padding: 0 20px;
|
||||
padding: 0 20px 10px 20px;
|
||||
}
|
||||
|
||||
&__name {
|
||||
@@ -200,7 +207,7 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
gap: 0 @spacing-lg;
|
||||
margin-top: 43px;
|
||||
margin-top: 20px;
|
||||
font-size: 13px;
|
||||
line-height: 20px;
|
||||
color: @home-body;
|
||||
|
||||
@@ -173,15 +173,15 @@ function onMore(): void {
|
||||
position: relative;
|
||||
.flex(column, flex-start, stretch);
|
||||
flex-shrink: 0;
|
||||
flex: 0 0 529px;
|
||||
width: 529px;
|
||||
height: 245px;
|
||||
flex: 0 0 420px;
|
||||
width: 420px;
|
||||
min-height: 0;
|
||||
box-sizing: border-box;
|
||||
min-width: 0;
|
||||
gap: 0;
|
||||
padding: 18px 40px 28px;
|
||||
border: 1px solid @home-card-border;
|
||||
border-radius: @radius-lg;
|
||||
padding: @spacing-lg;
|
||||
border: none;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -190,22 +190,22 @@ function onMore(): void {
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-size: @font-size-xxl;
|
||||
font-weight: 700;
|
||||
line-height: 52px;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
color: @home-ink;
|
||||
}
|
||||
|
||||
&__list {
|
||||
.flex(row, flex-start, flex-start);
|
||||
gap: 30px;
|
||||
margin-top: 17px;
|
||||
gap: @spacing-base;
|
||||
margin-top: @spacing-base;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
&__item {
|
||||
.flex(column, flex-start, center);
|
||||
gap: 8px;
|
||||
gap: @spacing-sm;
|
||||
flex: none;
|
||||
transition: transform 0.2s;
|
||||
|
||||
@@ -216,14 +216,14 @@ function onMore(): void {
|
||||
|
||||
&__tile {
|
||||
display: block;
|
||||
width: 97px;
|
||||
height: 97px;
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: @radius-base;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: @font-size-lg;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
color: @home-ink;
|
||||
text-align: center;
|
||||
@@ -231,15 +231,16 @@ function onMore(): void {
|
||||
|
||||
&__more {
|
||||
position: absolute;
|
||||
top: 120px;
|
||||
right: 25px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
top: 50%;
|
||||
right: @spacing-base;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: #c9cdd4;
|
||||
color: @text-color-disabled;
|
||||
cursor: pointer;
|
||||
transform: translateY(-50%);
|
||||
transition: color 0.2s;
|
||||
|
||||
&:hover {
|
||||
|
||||
@@ -27,10 +27,10 @@ defineProps<Props>()
|
||||
.home-contents {
|
||||
&__block {
|
||||
margin-bottom: @spacing-base;
|
||||
padding: 40px 45px 0;
|
||||
border-radius: @radius-lg;
|
||||
padding: @spacing-xl;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
min-height: 593px;
|
||||
min-height: 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:last-child {
|
||||
@@ -39,10 +39,10 @@ defineProps<Props>()
|
||||
}
|
||||
|
||||
&__title {
|
||||
margin: 0 0 301px;
|
||||
font-size: 36px;
|
||||
font-weight: 700;
|
||||
line-height: 52px;
|
||||
margin: 0 0 @spacing-lg;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
color: @home-ink;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,40 +43,41 @@ function isImageIcon(icon?: string): boolean {
|
||||
|
||||
<style lang="less" scoped>
|
||||
.home-service-types {
|
||||
margin-bottom: 20px;
|
||||
padding: 24px 42px 0;
|
||||
border-radius: @radius-lg;
|
||||
margin-bottom: @spacing-base;
|
||||
padding: @spacing-lg @spacing-xl;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
height: 287px;
|
||||
min-height: 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
&__title {
|
||||
margin: 0 0 132px;
|
||||
font-size: 36px;
|
||||
font-weight: 700;
|
||||
line-height: 52px;
|
||||
margin: 0 0 @spacing-lg;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
color: @home-ink;
|
||||
}
|
||||
|
||||
&__list {
|
||||
.flex(row, flex-start);
|
||||
gap: 0;
|
||||
gap: @spacing-base;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
&__item {
|
||||
.flex(column, center);
|
||||
width: 187px;
|
||||
gap: 47px;
|
||||
width: 120px;
|
||||
gap: @spacing-base;
|
||||
}
|
||||
|
||||
&__icon {
|
||||
.flex(row, center);
|
||||
width: 68px;
|
||||
height: 68px;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: @radius-round;
|
||||
background: @primary-light;
|
||||
color: @white;
|
||||
font-size: 24px;
|
||||
font-size: @font-size-lg;
|
||||
font-weight: 600;
|
||||
overflow: hidden;
|
||||
|
||||
|
||||
@@ -30,30 +30,30 @@ const items = [
|
||||
<style lang="less" scoped>
|
||||
.home-stats {
|
||||
.flex(row, flex-end);
|
||||
gap: 30px;
|
||||
gap: @spacing-base;
|
||||
|
||||
&__item {
|
||||
.flex(column, center, center);
|
||||
gap: 0;
|
||||
width: 112px;
|
||||
height: 112px;
|
||||
min-width: 112px;
|
||||
gap: 2px;
|
||||
width: 88px;
|
||||
height: 88px;
|
||||
min-width: 88px;
|
||||
padding: 0;
|
||||
border-radius: @radius-sm;
|
||||
background: @primary-strong;
|
||||
border-radius: @radius-base;
|
||||
background: @filter-selected-bg;
|
||||
}
|
||||
|
||||
&__value {
|
||||
font-size: 48px;
|
||||
font-weight: 500;
|
||||
font-size: @font-size-title;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
color: @white;
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: @font-size-base;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
color: @white;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -37,24 +37,24 @@ const greeting = computed(() => {
|
||||
&__greeting {
|
||||
.flex(row, flex-start);
|
||||
gap: @spacing-sm;
|
||||
font-size: 52px;
|
||||
font-weight: 700;
|
||||
font-size: @font-size-title;
|
||||
font-weight: 600;
|
||||
color: @home-welcome;
|
||||
}
|
||||
|
||||
&__wave {
|
||||
.flex(row, center);
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: @radius-round;
|
||||
background: fade(@black, 4%);
|
||||
font-size: @font-size-xl;
|
||||
font-size: @font-size-lg;
|
||||
}
|
||||
|
||||
&__summary {
|
||||
font-size: 24px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 400;
|
||||
color: @home-welcome;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -58,14 +58,16 @@ onMounted(load)
|
||||
|
||||
<style lang="less" scoped>
|
||||
.business-detail {
|
||||
padding-top: 32px;
|
||||
padding-bottom: @spacing-xxl;
|
||||
min-height: 100%;
|
||||
padding-top: @spacing-lg;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__breadcrumb {
|
||||
margin-bottom: 49px;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
line-height: 37px;
|
||||
margin-bottom: @spacing-lg;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: @home-breadcrumb;
|
||||
|
||||
.link {
|
||||
@@ -74,18 +76,19 @@ onMounted(load)
|
||||
}
|
||||
|
||||
&__hero {
|
||||
.flex(column, flex-start);
|
||||
.flex(column, flex-start, flex-start);
|
||||
justify-content: center;
|
||||
margin-bottom: @spacing-base;
|
||||
padding: 129px 29px 0;
|
||||
border-radius: @radius-lg;
|
||||
padding: @spacing-xl;
|
||||
border-radius: @radius-base;
|
||||
background: @home-detail-hero-bg;
|
||||
height: 219px;
|
||||
min-height: 140px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__loading {
|
||||
padding: 80px 0;
|
||||
font-size: 16px;
|
||||
padding: @spacing-xxl 0;
|
||||
font-size: @font-size-base;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
|
||||
@@ -95,23 +98,23 @@ onMounted(load)
|
||||
|
||||
&__intro {
|
||||
.flex(column, flex-start);
|
||||
gap: 8px;
|
||||
gap: @spacing-sm;
|
||||
}
|
||||
|
||||
&__name {
|
||||
margin: 0;
|
||||
font-size: 26px;
|
||||
font-weight: 400;
|
||||
line-height: 33px;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
color: @home-body;
|
||||
}
|
||||
|
||||
&__slogan {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 400;
|
||||
line-height: 18px;
|
||||
color: @home-body;
|
||||
line-height: 1.5;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
|
||||
&__cta {
|
||||
|
||||
@@ -53,25 +53,25 @@ onMounted(() => {
|
||||
<style lang="less" scoped>
|
||||
.home {
|
||||
.flex(column, flex-start);
|
||||
gap: 20px;
|
||||
gap: @spacing-lg;
|
||||
padding-top: 0;
|
||||
padding-bottom: @spacing-xxl;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__dashboard {
|
||||
.flex(row, space-between, stretch);
|
||||
gap: 60px;
|
||||
gap: @spacing-lg;
|
||||
}
|
||||
|
||||
&__dashboard-main {
|
||||
.flex(row, space-between, center);
|
||||
flex: 0 0 1091px;
|
||||
width: 1091px;
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
box-sizing: border-box;
|
||||
gap: @spacing-lg;
|
||||
padding: 0 59px 0 105px;
|
||||
border: 1px solid @home-card-border;
|
||||
border-radius: @radius-lg;
|
||||
padding: @spacing-lg @spacing-xl;
|
||||
border: none;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,70 +67,58 @@ const localAgree = computed({
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
// 设计稿 #36(账号密码登录)纵向坐标:
|
||||
// 账号标签 457 → 密码标签 585(差 128)
|
||||
// 密码输入框底 ~648 → 勾选行 641 区间 → 登录按钮文字 688
|
||||
// 表单左边界与 title 内缩对齐:1032.5 - 982.5(title 层中心对齐后) ≈ 0,
|
||||
// 实测 title padding-left 17px 抵消 693/714 的差,故表单不再额外内缩。
|
||||
.login-form {
|
||||
.flex(column, flex-start, stretch);
|
||||
margin: 26px 0 0;
|
||||
gap: @spacing-lg;
|
||||
width: 100%;
|
||||
margin-top: @spacing-xl;
|
||||
|
||||
&__field {
|
||||
.flex(column, flex-start, stretch);
|
||||
// 标签底 474 → 输入框顶 480,间距 6px
|
||||
gap: 6px;
|
||||
gap: @spacing-sm;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
// 第一个字段底(480+40=520)→ 第二个字段标签顶 585,间距 65px
|
||||
&__field + &__field {
|
||||
margin-top: 65px;
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 13px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
line-height: 17px;
|
||||
color: #1f2937;
|
||||
text-align: center;
|
||||
line-height: 1.4;
|
||||
color: @heading-color;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
&__input {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid #dde1e7;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
font-size: 13px;
|
||||
color: #1f2937;
|
||||
height: 44px;
|
||||
padding: 0 @spacing-base;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @bg-color-light;
|
||||
font-size: @font-size-base;
|
||||
color: @heading-color;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
transition: border-color 0.2s, background 0.2s;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
border-color: @primary-strong;
|
||||
background: @white;
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: #1f2937;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
}
|
||||
|
||||
// 设计稿 #36:勾选框 (1042.2,642) 7.5×14,文字 12px 起于 x=1059。
|
||||
// 注:设计稿勾选标注 y=642 与密码输入框底 648 重叠,二者无法同时满足,
|
||||
// 这里按视觉取勾选行落在输入框下方 8px。
|
||||
&__agree {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 8px;
|
||||
margin-top: 8px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 16px;
|
||||
color: #6b7280;
|
||||
gap: @spacing-sm;
|
||||
margin: 0;
|
||||
font-size: @font-size-sm;
|
||||
line-height: 1.5;
|
||||
color: @text-color-secondary;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
|
||||
input {
|
||||
flex-shrink: 0;
|
||||
@@ -146,17 +134,15 @@ const localAgree = computed({
|
||||
}
|
||||
}
|
||||
|
||||
// 设计稿 #36:按钮文字 (1352,688) 54×20 居中,按钮盒约 693×46
|
||||
&__submit {
|
||||
width: 100%;
|
||||
height: 46px;
|
||||
// 勾选行底 657 → 按钮顶 674
|
||||
margin-top: 17px;
|
||||
height: 44px;
|
||||
margin: 0;
|
||||
border: none;
|
||||
border-radius: @radius-sm;
|
||||
border-radius: @radius-base;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 15px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
|
||||
@@ -85,65 +85,58 @@ function onSubmit(): void {
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
// 设计稿 #38(手机验证码登录)纵向坐标:
|
||||
// 手机号标签 438 → 验证码标签 520(差 82)
|
||||
// 验证码输入框底 ~588 → 勾选行 622 → 登录按钮文字 669
|
||||
.sms-login {
|
||||
.flex(column, flex-start, stretch);
|
||||
margin: 26px 0 0;
|
||||
gap: @spacing-lg;
|
||||
width: 100%;
|
||||
margin-top: @spacing-xl;
|
||||
|
||||
&__field {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 6px;
|
||||
gap: @spacing-sm;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
// 第一个字段底(457+40=497... 按标签 438+17+6+40=501)→ 第二标签 520,间距 19px
|
||||
&__field + &__field {
|
||||
margin-top: 19px;
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 13px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
line-height: 17px;
|
||||
color: #1f2937;
|
||||
text-align: center;
|
||||
line-height: 1.4;
|
||||
color: @heading-color;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
&__input {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid #dde1e7;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
font-size: 13px;
|
||||
color: #1f2937;
|
||||
height: 44px;
|
||||
padding: 0 @spacing-base;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @bg-color-light;
|
||||
font-size: @font-size-base;
|
||||
color: @heading-color;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
transition: border-color 0.2s, background 0.2s;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
border-color: @primary-strong;
|
||||
background: @white;
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: #1f2937;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
}
|
||||
|
||||
// 设计稿 #38:勾选框 (992.2,623) 7.5×14,勾选文字 622
|
||||
&__agree {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 8px;
|
||||
margin-top: 14px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 16px;
|
||||
color: #6b7280;
|
||||
gap: @spacing-sm;
|
||||
margin: 0;
|
||||
font-size: @font-size-sm;
|
||||
line-height: 1.5;
|
||||
color: @text-color-secondary;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
|
||||
input {
|
||||
flex-shrink: 0;
|
||||
@@ -159,16 +152,15 @@ function onSubmit(): void {
|
||||
}
|
||||
}
|
||||
|
||||
// 设计稿 #38:按钮文字 (1302,669) 54×20
|
||||
&__submit {
|
||||
width: 100%;
|
||||
height: 46px;
|
||||
margin-top: 17px;
|
||||
height: 44px;
|
||||
margin: 0;
|
||||
border: none;
|
||||
border-radius: @radius-sm;
|
||||
border-radius: @radius-base;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 15px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
|
||||
@@ -144,26 +144,31 @@ async function onGetCode(target: string): Promise<void> {
|
||||
|
||||
<style lang="less" scoped>
|
||||
.auth-page {
|
||||
// 设计稿 #36:两个 tab 顶 406,字号 14px,选中下划线 2px 位于 429。
|
||||
// tab 文字底 425,下划线顶 429 → padding-bottom 6px。
|
||||
// 上间距 26px:副标题底 380 → tab 文字顶 406。
|
||||
&__tabs {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 24px;
|
||||
margin: 26px 0 0;
|
||||
gap: @spacing-xl;
|
||||
width: 100%;
|
||||
margin-top: @spacing-xl;
|
||||
border-bottom: 1px solid @border-color;
|
||||
}
|
||||
|
||||
&__tab {
|
||||
position: relative;
|
||||
padding: 0 0 6px;
|
||||
padding: 0 0 @spacing-sm;
|
||||
margin-bottom: -1px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
font-size: 14px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 400;
|
||||
color: #4b5563;
|
||||
line-height: 1.4;
|
||||
color: @text-color-secondary;
|
||||
cursor: pointer;
|
||||
transition: color 0.2s;
|
||||
|
||||
&:hover {
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
font-weight: 600;
|
||||
color: @primary-strong;
|
||||
@@ -175,24 +180,23 @@ async function onGetCode(target: string): Promise<void> {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 2px;
|
||||
border-radius: 1px;
|
||||
background: @primary-strong;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 设计稿 #36:「没有账号?」(1325,774)、「立即注册」(1384.5,774) 12px。
|
||||
// 「找回密码」为设计稿外的补充入口,按同样式接在分隔符后。
|
||||
&__switch {
|
||||
align-self: center;
|
||||
margin: 53px 0 0;
|
||||
font-size: 12px;
|
||||
margin: @spacing-xl 0 0;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
line-height: 16px;
|
||||
color: #6b7280;
|
||||
line-height: 1.5;
|
||||
color: @text-color-secondary;
|
||||
|
||||
&-sep {
|
||||
margin: 0 8px;
|
||||
color: #d0d5dd;
|
||||
margin: 0 @spacing-sm;
|
||||
color: @border-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ onBeforeUnmount(() => {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid #dde1e7;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
font-size: 13px;
|
||||
|
||||
@@ -191,7 +191,7 @@ onBeforeUnmount(() => {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid #dde1e7;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
font-size: 13px;
|
||||
|
||||
@@ -7,12 +7,18 @@ interface Props {
|
||||
|
||||
defineProps<Props>()
|
||||
|
||||
const emit = defineEmits<{ view: [id: string] }>()
|
||||
const emit = defineEmits<{ view: [message: Message] }>()
|
||||
|
||||
const emojiMap: Record<MessageType, string> = {
|
||||
在线客服: '💬',
|
||||
状态通知: '📢',
|
||||
系统通知: '🔔',
|
||||
const LABEL_MAP: Record<MessageType, string> = {
|
||||
在线客服: '客',
|
||||
状态通知: '态',
|
||||
系统通知: '系',
|
||||
}
|
||||
|
||||
const TONE_MAP: Record<MessageType, string> = {
|
||||
在线客服: 'is-service',
|
||||
状态通知: 'is-status',
|
||||
系统通知: 'is-system',
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -22,94 +28,134 @@ const emojiMap: Record<MessageType, string> = {
|
||||
:class="{ 'is-unread': !message.isRead }"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
@click="emit('view', message.id)"
|
||||
@keydown.enter="emit('view', message.id)"
|
||||
@click="emit('view', message)"
|
||||
@keydown.enter="emit('view', message)"
|
||||
>
|
||||
<span class="message-item__emoji">{{ emojiMap[message.type] }}</span>
|
||||
<span
|
||||
class="message-item__icon"
|
||||
:class="TONE_MAP[message.type]"
|
||||
aria-hidden="true"
|
||||
>
|
||||
{{ LABEL_MAP[message.type] }}
|
||||
<span v-if="!message.isRead" class="message-item__dot" aria-label="未读" />
|
||||
</span>
|
||||
<div class="message-item__body">
|
||||
<div class="message-item__head">
|
||||
<span class="message-item__title">{{ message.title }}</span>
|
||||
<span class="message-item__time text-secondary">{{ message.publishTime }}</span>
|
||||
<span class="message-item__time">{{ message.publishTime }}</span>
|
||||
</div>
|
||||
<p class="message-item__summary text-secondary">
|
||||
<p class="message-item__summary">
|
||||
{{ message.summary }}
|
||||
</p>
|
||||
<span class="message-item__type">{{ message.type }}</span>
|
||||
</div>
|
||||
<span v-if="!message.isRead" class="message-item__dot" aria-label="未读" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.message-item {
|
||||
position: relative;
|
||||
.flex(row, flex-start);
|
||||
.flex(row, flex-start, flex-start);
|
||||
gap: @spacing-base;
|
||||
padding: 14px 17px;
|
||||
min-height: 88px;
|
||||
padding: @spacing-base @spacing-lg;
|
||||
background: @white;
|
||||
cursor: pointer;
|
||||
box-sizing: border-box;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: @bg-color-light;
|
||||
}
|
||||
|
||||
&__emoji {
|
||||
&__icon {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
.flex(row, center);
|
||||
width: 31px;
|
||||
height: 31px;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: @radius-round;
|
||||
background: @message-icon-bg;
|
||||
font-size: 15px;
|
||||
background: @primary-light;
|
||||
color: @primary-strong;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 600;
|
||||
line-height: 1;
|
||||
|
||||
&.is-service {
|
||||
background: @primary-light;
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
&.is-status {
|
||||
background: fade(@success-color, 12%);
|
||||
color: @success-color;
|
||||
}
|
||||
|
||||
&.is-system {
|
||||
background: fade(@warning-color, 14%);
|
||||
color: @warning-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__body {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 5px;
|
||||
gap: @spacing-xs;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
&__head {
|
||||
.flex(row, space-between);
|
||||
.flex(row, space-between, flex-start);
|
||||
gap: @spacing-base;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
line-height: 1.4;
|
||||
color: @heading-color;
|
||||
.ellipsis();
|
||||
}
|
||||
|
||||
&__time {
|
||||
flex-shrink: 0;
|
||||
font-size: 11px;
|
||||
color: @text-color-disabled;
|
||||
font-size: @font-size-xs;
|
||||
line-height: 1.4;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
|
||||
&__summary {
|
||||
font-size: 11px;
|
||||
margin: 0;
|
||||
font-size: @font-size-sm;
|
||||
line-height: 1.5;
|
||||
color: @text-color-secondary;
|
||||
.ellipsis();
|
||||
}
|
||||
|
||||
&__type {
|
||||
width: fit-content;
|
||||
padding: 0 @spacing-sm;
|
||||
border-radius: @radius-round;
|
||||
background: @bg-color-light;
|
||||
color: @text-color-secondary;
|
||||
font-size: @font-size-xs;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
&__dot {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
left: 42px;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border: 2px solid @white;
|
||||
border-radius: @radius-round;
|
||||
background: @danger-color;
|
||||
background: @message-tabs-badge;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
&.is-unread {
|
||||
.message-item__title {
|
||||
font-weight: 600;
|
||||
}
|
||||
&.is-unread .message-item__title {
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -8,7 +8,7 @@ interface Props {
|
||||
|
||||
defineProps<Props>()
|
||||
|
||||
const emit = defineEmits<{ view: [id: string] }>()
|
||||
const emit = defineEmits<{ view: [message: Message] }>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -31,19 +31,21 @@ const emit = defineEmits<{ view: [id: string] }>()
|
||||
.message-list {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 0;
|
||||
margin-top: 0;
|
||||
padding: 0;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
overflow: hidden;
|
||||
|
||||
.message-item + .message-item {
|
||||
border-top: 1px solid @project-divider;
|
||||
:deep(.message-item + .message-item) {
|
||||
border-top: 1px solid @border-color;
|
||||
}
|
||||
|
||||
&__empty {
|
||||
padding: 40px 0;
|
||||
padding: @spacing-xxl 0;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
font-size: @font-size-sm;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import type { MessageTabCounts } from '@/stores/modules/message'
|
||||
import type { MessageType } from '@/types/business/message'
|
||||
|
||||
interface Counts {
|
||||
all: number
|
||||
在线客服: number
|
||||
状态通知: number
|
||||
系统通知: number
|
||||
}
|
||||
|
||||
interface Props {
|
||||
active: MessageType | 'all'
|
||||
counts: Counts
|
||||
counts: MessageTabCounts
|
||||
}
|
||||
|
||||
defineProps<Props>()
|
||||
@@ -24,7 +18,7 @@ const tabs: Array<{ label: string; value: MessageType | 'all' }> = [
|
||||
{ label: '系统通知', value: '系统通知' },
|
||||
]
|
||||
|
||||
function countOf(value: MessageType | 'all', counts: Counts): number {
|
||||
function countOf(value: MessageType | 'all', counts: MessageTabCounts): number {
|
||||
return counts[value]
|
||||
}
|
||||
</script>
|
||||
@@ -47,51 +41,58 @@ function countOf(value: MessageType | 'all', counts: Counts): number {
|
||||
<style lang="less" scoped>
|
||||
.message-tabs {
|
||||
.flex(column, flex-start, stretch);
|
||||
padding: 18px 0;
|
||||
min-height: 338px;
|
||||
gap: 2px;
|
||||
min-height: 0;
|
||||
padding: @spacing-sm 0;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-shadow: none;
|
||||
box-sizing: border-box;
|
||||
|
||||
&__tab {
|
||||
.flex(row, space-between);
|
||||
.flex(row, space-between, center);
|
||||
gap: @spacing-sm;
|
||||
height: 32px;
|
||||
padding: 0 18px 0 25px;
|
||||
border-radius: 0;
|
||||
height: 40px;
|
||||
margin: 0 @spacing-sm;
|
||||
padding: 0 @spacing-base;
|
||||
border-radius: @radius-sm;
|
||||
background: transparent;
|
||||
color: @text-color;
|
||||
font-size: 11px;
|
||||
color: @message-tabs-text;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
transition: all 0.2s;
|
||||
line-height: 1.4;
|
||||
transition: color 0.2s, background-color 0.2s;
|
||||
|
||||
&:hover {
|
||||
color: @primary-strong;
|
||||
background: @bg-color-light;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
background: transparent;
|
||||
background: @filter-selected-bg;
|
||||
color: @primary-strong;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
&__count {
|
||||
min-width: 15px;
|
||||
height: 15px;
|
||||
padding: 0 4px;
|
||||
flex-shrink: 0;
|
||||
min-width: 18px;
|
||||
height: 18px;
|
||||
padding: 0 @spacing-xs;
|
||||
border-radius: @radius-round;
|
||||
background: @danger-color;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
line-height: 15px;
|
||||
background: @bg-color-light;
|
||||
color: @text-color-secondary;
|
||||
font-size: @font-size-xs;
|
||||
font-weight: 500;
|
||||
line-height: 18px;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.is-active &__count {
|
||||
background: @danger-color;
|
||||
color: @white;
|
||||
font-weight: 600;
|
||||
&__tab.is-active &__count {
|
||||
background: fade(@primary-strong, 12%);
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<!-- 页面:消息详情(MessageDetail) -->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { AppButton } from '@/components'
|
||||
import { PageHead } from '@/components'
|
||||
import { useMessageStore } from '@/stores/modules/message'
|
||||
import { formatFileSize } from '@/utils/format'
|
||||
|
||||
@@ -36,211 +37,270 @@ onMounted(load)
|
||||
|
||||
<template>
|
||||
<div class="message-detail">
|
||||
<nav class="message-detail__breadcrumb text-secondary">
|
||||
<RouterLink to="/message" class="link">
|
||||
消息中心
|
||||
</RouterLink>
|
||||
<span> > </span>
|
||||
<span>{{ item ? `${item.type}详情` : '消息详情' }}</span>
|
||||
</nav>
|
||||
<PageHead
|
||||
title="消息详情"
|
||||
slogan="查看站内消息完整内容与附件资料"
|
||||
/>
|
||||
|
||||
<template v-if="item">
|
||||
<article class="message-detail__card">
|
||||
<h1 class="message-detail__title">
|
||||
{{ item.title }}
|
||||
</h1>
|
||||
<p class="message-detail__time text-secondary">
|
||||
发布时间:{{ item.publishTime }}
|
||||
</p>
|
||||
<div class="message-detail__content">
|
||||
{{ item.content }}
|
||||
</div>
|
||||
<div class="container message-detail__wrap">
|
||||
<nav class="message-detail__breadcrumb">
|
||||
<RouterLink to="/message" class="message-detail__breadcrumb-link">
|
||||
消息中心
|
||||
</RouterLink>
|
||||
<span class="message-detail__breadcrumb-sep">></span>
|
||||
<span class="message-detail__breadcrumb-current">{{ item ? `${item.type}详情` : '消息详情' }}</span>
|
||||
</nav>
|
||||
|
||||
<section v-if="item.attachments.length > 0" class="message-detail__attachments">
|
||||
<h2 class="message-detail__attachments-title">
|
||||
附件({{ item.attachments.length }})
|
||||
</h2>
|
||||
<ul class="message-detail__file-list">
|
||||
<li
|
||||
v-for="(file, index) in item.attachments"
|
||||
:key="`${file.name}-${index}`"
|
||||
class="message-detail__file"
|
||||
<template v-if="item">
|
||||
<article class="message-detail__card">
|
||||
<header class="message-detail__head">
|
||||
<h1 class="message-detail__title">
|
||||
{{ item.title }}
|
||||
</h1>
|
||||
<p class="message-detail__time">
|
||||
发布时间:{{ item.publishTime }}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<div class="message-detail__content">
|
||||
{{ item.content }}
|
||||
</div>
|
||||
|
||||
<section v-if="item.attachments.length > 0" class="message-detail__attachments">
|
||||
<h2 class="message-detail__attachments-title">
|
||||
附件({{ item.attachments.length }})
|
||||
</h2>
|
||||
<ul class="message-detail__file-list">
|
||||
<li
|
||||
v-for="(file, index) in item.attachments"
|
||||
:key="`${file.name}-${index}`"
|
||||
class="message-detail__file"
|
||||
>
|
||||
<div class="message-detail__file-info">
|
||||
<span class="message-detail__file-name" :title="file.name">{{ file.name }}</span>
|
||||
<span class="message-detail__file-meta">
|
||||
{{ formatFileSize(file.size) }} · 上传于{{ file.uploadTime }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="message-detail__file-actions">
|
||||
<button
|
||||
type="button"
|
||||
class="message-detail__file-btn"
|
||||
@click="onPreview"
|
||||
>
|
||||
预览
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="message-detail__file-btn"
|
||||
@click="onDownload"
|
||||
>
|
||||
下载
|
||||
</button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<div class="message-detail__actions">
|
||||
<button
|
||||
type="button"
|
||||
class="message-detail__back"
|
||||
@click="onBack"
|
||||
>
|
||||
<div class="message-detail__file-info">
|
||||
<span class="message-detail__file-name" :title="file.name">{{ file.name }}</span>
|
||||
<span class="message-detail__file-meta text-secondary">
|
||||
{{ formatFileSize(file.size) }} · 上传于{{ file.uploadTime }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="message-detail__file-actions">
|
||||
<button class="message-detail__file-btn" @click="onPreview">
|
||||
预览
|
||||
</button>
|
||||
<button class="message-detail__file-btn" @click="onDownload">
|
||||
下载
|
||||
</button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
返回
|
||||
</button>
|
||||
</div>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<div class="message-detail__actions">
|
||||
<AppButton type="primary" @click="onBack">
|
||||
返回
|
||||
</AppButton>
|
||||
</div>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<p v-else class="message-detail__empty text-secondary">
|
||||
消息不存在
|
||||
</p>
|
||||
<p v-else class="message-detail__empty">
|
||||
消息不存在
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.message-detail {
|
||||
max-width: @container-width;
|
||||
margin: 0 auto;
|
||||
padding: @spacing-lg @spacing-base @spacing-xxl;
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 0;
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__wrap {
|
||||
padding-top: @spacing-lg;
|
||||
padding-right: @home-gutter;
|
||||
padding-left: @home-gutter;
|
||||
box-sizing: border-box;
|
||||
|
||||
@media (max-width: 1600px) {
|
||||
padding-right: @spacing-lg;
|
||||
padding-left: @spacing-lg;
|
||||
}
|
||||
}
|
||||
|
||||
&__breadcrumb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
margin-bottom: 12px;
|
||||
font-size: 11px;
|
||||
color: @text-color-disabled;
|
||||
|
||||
.link {
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
|
||||
span:last-child {
|
||||
color: @text-color;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
&__card {
|
||||
padding: 32px 36px 34px;
|
||||
border-radius: @radius-lg;
|
||||
background: @white;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&__time {
|
||||
margin-top: 11px; // 14 × 0.77
|
||||
font-size: 11px;
|
||||
color: @text-color-disabled;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&__content {
|
||||
margin-top: 24px;
|
||||
background: transparent;
|
||||
color: @text-color;
|
||||
font-size: 11px;
|
||||
line-height: 1.9;
|
||||
text-align: center;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
&__attachments {
|
||||
margin-top: 20px;
|
||||
|
||||
&-title {
|
||||
margin-bottom: 8px;
|
||||
font-size: 11px;
|
||||
font-weight: 400;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
}
|
||||
|
||||
&__file-list {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: @spacing-sm;
|
||||
}
|
||||
|
||||
&__file {
|
||||
.flex(row, space-between);
|
||||
gap: @spacing-base;
|
||||
align-items: center;
|
||||
width: fit-content;
|
||||
max-width: 100%;
|
||||
padding: 10px 14px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
background: @finance-row-bg;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
&__file-info {
|
||||
.flex(column, flex-start, flex-start);
|
||||
gap: 3px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__file-name {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
.ellipsis();
|
||||
}
|
||||
|
||||
&__file-meta {
|
||||
font-size: 11px;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
|
||||
&__file-actions {
|
||||
.flex(row, center);
|
||||
gap: @spacing-sm;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&__file-btn {
|
||||
font-size: 11px;
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-xs;
|
||||
margin-bottom: @spacing-base;
|
||||
font-size: @font-size-sm;
|
||||
line-height: 1.5;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
|
||||
&__breadcrumb-link {
|
||||
color: @text-color-secondary;
|
||||
transition: color 0.2s;
|
||||
|
||||
&:hover {
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__breadcrumb-current {
|
||||
color: @heading-color;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
&__card {
|
||||
padding: @spacing-xl;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__head {
|
||||
padding-bottom: @spacing-base;
|
||||
border-bottom: 1px solid @border-color;
|
||||
}
|
||||
|
||||
&__title {
|
||||
margin: 0;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&__time {
|
||||
margin: @spacing-sm 0 0;
|
||||
font-size: @font-size-sm;
|
||||
line-height: 1.4;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
|
||||
&__content {
|
||||
margin-top: @spacing-lg;
|
||||
color: @text-color;
|
||||
font-size: @font-size-base;
|
||||
line-height: 1.8;
|
||||
text-align: left;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
&__attachments {
|
||||
margin-top: @spacing-xl;
|
||||
}
|
||||
|
||||
&__attachments-title {
|
||||
margin: 0 0 @spacing-base;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 600;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&__file-list {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: @spacing-sm;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&__file {
|
||||
.flex(row, space-between, center);
|
||||
gap: @spacing-base;
|
||||
width: 100%;
|
||||
max-width: 520px;
|
||||
padding: @spacing-base;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @bg-color-light;
|
||||
list-style: none;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__file-info {
|
||||
.flex(column, flex-start, flex-start);
|
||||
gap: @spacing-xs;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__file-name {
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 600;
|
||||
color: @heading-color;
|
||||
.ellipsis();
|
||||
}
|
||||
|
||||
&__file-meta {
|
||||
font-size: @font-size-xs;
|
||||
color: @text-color-secondary;
|
||||
.ellipsis();
|
||||
}
|
||||
|
||||
&__file-actions {
|
||||
.flex(row, flex-end, center);
|
||||
gap: @spacing-sm;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&__file-btn {
|
||||
height: 28px;
|
||||
padding: 0 @spacing-sm;
|
||||
border: none;
|
||||
border-radius: @radius-round;
|
||||
background: transparent;
|
||||
color: @primary-strong;
|
||||
font-size: @font-size-sm;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background: fade(@primary-strong, 8%);
|
||||
}
|
||||
}
|
||||
|
||||
&__actions {
|
||||
.flex(row, flex-end);
|
||||
margin-top: 32px;
|
||||
margin-top: @spacing-xl;
|
||||
}
|
||||
|
||||
.app-button {
|
||||
height: 24px; // 31 × 0.77
|
||||
padding: 0 16px;
|
||||
border-radius: 6px;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
&__back {
|
||||
min-width: 88px;
|
||||
height: 36px;
|
||||
padding: 0 @spacing-lg;
|
||||
border: none;
|
||||
border-radius: @radius-round;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
}
|
||||
&:hover {
|
||||
background: @primary-hover;
|
||||
}
|
||||
}
|
||||
|
||||
&__empty {
|
||||
padding: @spacing-xxl 0;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
font-size: @font-size-sm;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<!-- 页面:消息中心(Message) -->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted } from 'vue'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { AppButton, FilterPanel, PaginationBar } from '@/components'
|
||||
import { ElButton, ElInput } from 'element-plus'
|
||||
import { PageHead, PaginationBar } from '@/components'
|
||||
import { useMessageStore } from '@/stores/modules/message'
|
||||
import type { MessageType } from '@/types/business/message'
|
||||
import type { Message, MessageType } from '@/types/business/message'
|
||||
import MessageTabs from './cpns/MessageTabs.vue'
|
||||
import MessageList from './cpns/MessageList.vue'
|
||||
|
||||
@@ -13,16 +14,15 @@ const router = useRouter()
|
||||
const messageStore = useMessageStore()
|
||||
const { query, list, total, unreadCount, tabCounts } = storeToRefs(messageStore)
|
||||
|
||||
const keyword = computed({
|
||||
get: () => query.value.keyword,
|
||||
set: (value: string) => messageStore.setQuery({ ...query.value, keyword: value }),
|
||||
})
|
||||
const keyword = ref(query.value.keyword)
|
||||
|
||||
function onSearch(): void {
|
||||
messageStore.setQuery({ ...query.value, keyword: keyword.value })
|
||||
void messageStore.search()
|
||||
}
|
||||
|
||||
function onReset(): void {
|
||||
keyword.value = ''
|
||||
void messageStore.resetQuery()
|
||||
}
|
||||
|
||||
@@ -35,8 +35,13 @@ function onTabChange(type: MessageType | 'all'): void {
|
||||
void messageStore.search()
|
||||
}
|
||||
|
||||
function onView(id: string): void {
|
||||
void router.push(`/message/${id}`)
|
||||
function onView(message: Message): void {
|
||||
// 用 message.type 区分:在线客服进会话页,其余进消息详情
|
||||
if (message.type === '在线客服') {
|
||||
void router.push('/service')
|
||||
return
|
||||
}
|
||||
void router.push(`/message/${message.id}`)
|
||||
}
|
||||
|
||||
function onMarkAllRead(): void {
|
||||
@@ -50,20 +55,18 @@ onMounted(() => {
|
||||
messageStore.fetchTabCounts(),
|
||||
])
|
||||
})
|
||||
|
||||
const UNREAD_LABEL = computed(() => (unreadCount.value > 0 ? `全部已读 (${unreadCount.value})` : '全部已读'))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="message">
|
||||
<header class="message__head">
|
||||
<h1 class="message__title">
|
||||
消息中心
|
||||
</h1>
|
||||
</header>
|
||||
<p class="message__subtitle text-secondary">
|
||||
统一接收项目进度、售后工单、账单待办等站内消息,重要业务动态实时提醒
|
||||
</p>
|
||||
<PageHead
|
||||
title="消息中心"
|
||||
slogan="统一接收项目进度、售后工单、账单待办等站内消息,重要业务动态实时提醒"
|
||||
/>
|
||||
|
||||
<div class="message__body">
|
||||
<div class="container message__body">
|
||||
<MessageTabs
|
||||
class="message__tabs"
|
||||
:active="query.type"
|
||||
@@ -73,21 +76,34 @@ onMounted(() => {
|
||||
|
||||
<div class="message__main">
|
||||
<div class="message__toolbar">
|
||||
<FilterPanel
|
||||
class="message__filter"
|
||||
v-model:keyword="keyword"
|
||||
keyword-placeholder="搜索消息标题、内容"
|
||||
@search="onSearch"
|
||||
@reset="onReset"
|
||||
<el-input
|
||||
v-model="keyword"
|
||||
class="message__search"
|
||||
placeholder="搜索消息标题、内容"
|
||||
clearable
|
||||
@keyup.enter="onSearch"
|
||||
/>
|
||||
<AppButton
|
||||
class="message__mark-read"
|
||||
type="default"
|
||||
|
||||
<el-button
|
||||
class="message__btn"
|
||||
@click="onReset"
|
||||
>
|
||||
重置
|
||||
</el-button>
|
||||
<el-button
|
||||
class="message__btn message__btn--primary"
|
||||
@click="onSearch"
|
||||
>
|
||||
搜索
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
class="message__btn message__btn--read"
|
||||
:disabled="unreadCount === 0"
|
||||
@click="onMarkAllRead"
|
||||
>
|
||||
全部已读
|
||||
</AppButton>
|
||||
{{ UNREAD_LABEL }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<MessageList :messages="list" @view="onView" />
|
||||
@@ -107,144 +123,133 @@ onMounted(() => {
|
||||
<style lang="less" scoped>
|
||||
.message {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: @spacing-base;
|
||||
max-width: @container-width;
|
||||
margin: 0 auto;
|
||||
padding: @spacing-xl @spacing-base @spacing-xxl;
|
||||
|
||||
&__head {
|
||||
.flex(row, flex-start);
|
||||
margin-bottom: -10px;
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&__subtitle {
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
}
|
||||
gap: 0;
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__body {
|
||||
.flex(row, flex-start);
|
||||
gap: 26px;
|
||||
align-items: flex-start;
|
||||
.flex(row, flex-start, flex-start);
|
||||
gap: @spacing-lg;
|
||||
width: 100%;
|
||||
padding-top: @spacing-lg;
|
||||
padding-right: @home-gutter;
|
||||
padding-left: @home-gutter;
|
||||
box-sizing: border-box;
|
||||
|
||||
@media (max-width: 1600px) {
|
||||
padding-right: @spacing-lg;
|
||||
padding-left: @spacing-lg;
|
||||
}
|
||||
}
|
||||
|
||||
&__tabs {
|
||||
flex-shrink: 0;
|
||||
width: 156px;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
&__main {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 15px;
|
||||
gap: @spacing-base;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__toolbar {
|
||||
.flex(row, flex-start);
|
||||
align-items: center;
|
||||
gap: 11px;
|
||||
padding: 10px 17px;
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-base;
|
||||
min-height: 64px;
|
||||
padding: 0 @spacing-lg;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
& .message__filter {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
}
|
||||
&__search {
|
||||
flex: 0 1 360px;
|
||||
height: 36px;
|
||||
|
||||
& .message__mark-read {
|
||||
flex-shrink: 0;
|
||||
height: 26px; // 34 × 0.77
|
||||
padding: 0 16px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: 6px;
|
||||
background: @white;
|
||||
color: @text-color;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
border-color: @primary-color;
|
||||
background: @white;
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
& .message__pagination {
|
||||
justify-content: flex-end;
|
||||
align-self: stretch;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.message__filter {
|
||||
:deep(.filter-panel__bar) {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
:deep(.filter-panel__body) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
:deep(.filter-panel__input) {
|
||||
order: 0;
|
||||
flex: 0 1 349px;
|
||||
max-width: 349px;
|
||||
height: 29px; // 38 × 0.77
|
||||
margin-right: 2px;
|
||||
padding: 0 10px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
:deep(.el-input__wrapper) {
|
||||
height: 36px;
|
||||
padding: 0 @spacing-base;
|
||||
border-radius: @radius-round;
|
||||
background: @finance-field-bg;
|
||||
color: @text-color;
|
||||
font-size: 11px;
|
||||
box-shadow: 0 0 0 1px @border-color inset;
|
||||
}
|
||||
|
||||
:deep(.el-input__inner) {
|
||||
color: @finance-ink;
|
||||
font-size: @font-size-base;
|
||||
|
||||
&::placeholder {
|
||||
color: @contract-placeholder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:focus {
|
||||
border: none;
|
||||
}
|
||||
&__btn {
|
||||
height: 36px;
|
||||
margin-left: 0;
|
||||
padding: 0 @spacing-lg;
|
||||
border-radius: @radius-round;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
|
||||
&:hover {
|
||||
border-color: @primary-strong;
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
:deep(.filter-panel__btn) {
|
||||
order: 1;
|
||||
min-width: 46px;
|
||||
height: 29px;
|
||||
padding: 0 12px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
background: @contract-reset-bg;
|
||||
color: @text-color;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
|
||||
&:hover {
|
||||
background: @contract-reset-bg;
|
||||
color: @text-color;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.filter-panel__btn--primary) {
|
||||
order: 2;
|
||||
&--primary {
|
||||
border-color: @primary-strong;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
|
||||
&:hover {
|
||||
background: @primary-strong;
|
||||
border-color: @primary-hover;
|
||||
background: @primary-hover;
|
||||
color: @white;
|
||||
}
|
||||
}
|
||||
|
||||
&--read {
|
||||
margin-left: auto;
|
||||
border-color: @border-color;
|
||||
background: @white;
|
||||
color: @finance-entry-text;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
border-color: @primary-strong;
|
||||
background: @white;
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__pagination {
|
||||
justify-content: flex-end;
|
||||
align-self: stretch;
|
||||
margin-top: @spacing-base;
|
||||
padding: 0;
|
||||
|
||||
:deep(.pagination__btn) {
|
||||
min-width: 28px;
|
||||
height: 28px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
color: @text-color;
|
||||
font-size: @font-size-sm;
|
||||
}
|
||||
|
||||
:deep(.pagination__btn.is-active) {
|
||||
border-color: @primary-strong;
|
||||
background: @primary-light;
|
||||
color: @primary-strong;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -28,7 +28,7 @@ import AboutPanel from './cpns/AboutPanel.vue'
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 12px;
|
||||
font-size: 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
line-height: 20px;
|
||||
@@ -38,7 +38,7 @@ import AboutPanel from './cpns/AboutPanel.vue'
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 3px;
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
border-radius: 2px;
|
||||
background: @primary-strong;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { AppButton, ConfirmDialog, PaginationBar, StatusTag } from '@/components'
|
||||
import { ConfirmDialog, PaginationBar, EllipsisText } from '@/components'
|
||||
import { useProfileStore } from '@/stores/modules/profile'
|
||||
import type { Address } from '@/types/business/profile'
|
||||
import AddressDialog from './cpns/AddressDialog.vue'
|
||||
@@ -64,51 +64,50 @@ onMounted(() => {
|
||||
<div class="address-page">
|
||||
<header class="address-page__head">
|
||||
<h2 class="address-page__title">
|
||||
收货地址
|
||||
地址管理
|
||||
</h2>
|
||||
<AppButton type="primary" @click="onCreate">
|
||||
+新增地址
|
||||
</AppButton>
|
||||
<button type="button" class="address-page__create" @click="onCreate">
|
||||
+ 新增地址
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<div class="address-page__grid">
|
||||
<div class="address-page__list">
|
||||
<article
|
||||
v-for="address in addresses"
|
||||
:key="address.id"
|
||||
class="address-card"
|
||||
class="address-row"
|
||||
>
|
||||
<div class="address-card__head">
|
||||
<h3 class="address-card__name">
|
||||
{{ address.receiverName }}
|
||||
</h3>
|
||||
<StatusTag v-if="address.isDefault" label="默认" variant="success" />
|
||||
<span v-if="address.isDefault" class="address-row__tag">默认</span>
|
||||
<div class="address-row__col">
|
||||
<p class="address-row__label">收货人姓名</p>
|
||||
<EllipsisText class="address-row__value" :text="address.receiverName" />
|
||||
</div>
|
||||
<ul class="address-card__meta">
|
||||
<li><span>联系方式:</span>{{ address.phone }}</li>
|
||||
<li><span>所在地区:</span>{{ address.region }}</li>
|
||||
<li><span>详细地址:</span>{{ address.detailAddress }}</li>
|
||||
</ul>
|
||||
<div class="address-card__actions">
|
||||
<div class="address-row__col">
|
||||
<p class="address-row__label">联系方式</p>
|
||||
<EllipsisText class="address-row__value" :text="address.phone" />
|
||||
</div>
|
||||
<div class="address-row__col">
|
||||
<p class="address-row__label">所在地区</p>
|
||||
<EllipsisText class="address-row__value" :text="address.region" />
|
||||
</div>
|
||||
<div class="address-row__col">
|
||||
<p class="address-row__label">详细地址</p>
|
||||
<EllipsisText class="address-row__value" :text="address.detailAddress" />
|
||||
</div>
|
||||
<div class="address-row__actions">
|
||||
<button
|
||||
v-if="!address.isDefault"
|
||||
class="address-card__btn"
|
||||
type="button"
|
||||
class="address-row__btn"
|
||||
@click="onToggleDefault(address)"
|
||||
>
|
||||
设为默认
|
||||
{{ address.isDefault ? '取消默认' : '设为默认' }}
|
||||
</button>
|
||||
<button
|
||||
v-else
|
||||
class="address-card__btn address-card__btn--muted"
|
||||
disabled
|
||||
>
|
||||
取消默认
|
||||
</button>
|
||||
<button class="address-card__btn" @click="onEdit(address)">
|
||||
编辑
|
||||
</button>
|
||||
<button class="address-card__btn address-card__btn--danger" @click="onDelete(address)">
|
||||
<button type="button" class="address-row__btn" @click="onDelete(address)">
|
||||
删除
|
||||
</button>
|
||||
<button type="button" class="address-row__btn" @click="onEdit(address)">
|
||||
编辑
|
||||
</button>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -145,47 +144,64 @@ onMounted(() => {
|
||||
<style lang="less" scoped>
|
||||
.address-page {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-base;
|
||||
gap: @spacing-lg;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
|
||||
&__head {
|
||||
.flex(row, space-between, center);
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 12px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
line-height: 20px;
|
||||
padding-left: 14px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @profile-ink;
|
||||
line-height: 1.4;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 3px;
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
border-radius: 2px;
|
||||
background: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
&__create {
|
||||
height: 32px;
|
||||
padding: 0 @spacing-base;
|
||||
border: none;
|
||||
border-radius: @profile-radius;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: darken(@primary-strong, 6%);
|
||||
}
|
||||
}
|
||||
|
||||
&__list {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: @spacing-base;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__empty {
|
||||
grid-column: 1 / -1;
|
||||
padding: @spacing-xxl 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
font-size: @font-size-sm;
|
||||
}
|
||||
|
||||
:deep(.pagination) {
|
||||
@@ -198,115 +214,81 @@ onMounted(() => {
|
||||
background: @profile-page-active-bg;
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
.app-button--primary {
|
||||
height: 24px;
|
||||
padding: 0 10px;
|
||||
border: none;
|
||||
border-radius: @profile-radius;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
|
||||
&:hover {
|
||||
border: none;
|
||||
background: darken(@primary-strong, 6%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.address-card {
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-lg;
|
||||
padding: @spacing-base;
|
||||
border: 1px solid @profile-card-border;
|
||||
.address-row {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-columns:
|
||||
minmax(88px, 0.9fr)
|
||||
minmax(110px, 1fr)
|
||||
minmax(120px, 1.2fr)
|
||||
minmax(160px, 1.8fr)
|
||||
auto;
|
||||
align-items: center;
|
||||
gap: @spacing-base;
|
||||
min-height: 72px;
|
||||
padding: @spacing-base @spacing-lg;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
background: @bg-color-light;
|
||||
box-sizing: border-box;
|
||||
|
||||
&__head {
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-xs;
|
||||
flex-shrink: 0;
|
||||
flex-direction: column-reverse;
|
||||
align-items: flex-start;
|
||||
&__tag {
|
||||
position: absolute;
|
||||
top: -9px;
|
||||
left: @spacing-lg;
|
||||
height: 18px;
|
||||
padding: 0 10px;
|
||||
border-radius: @radius-sm;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: @font-size-xs;
|
||||
font-weight: 500;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
&__name {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&__meta {
|
||||
.flex(row, flex-start);
|
||||
gap: @spacing-xl;
|
||||
flex: 1;
|
||||
&__col {
|
||||
min-width: 0;
|
||||
list-style: none;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
li {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
color: @heading-color;
|
||||
font-weight: 600;
|
||||
&__label {
|
||||
margin: 0;
|
||||
font-size: @font-size-sm;
|
||||
color: @text-color-secondary;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.ellipsis();
|
||||
}
|
||||
|
||||
span {
|
||||
display: block;
|
||||
margin-bottom: @spacing-xs;
|
||||
color: @text-color-secondary;
|
||||
font-weight: 400;
|
||||
}
|
||||
&__value {
|
||||
margin-top: @spacing-xs;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @profile-ink;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
&__actions {
|
||||
.flex(row, center);
|
||||
.flex(row, flex-end, center);
|
||||
flex-wrap: wrap;
|
||||
gap: @spacing-sm;
|
||||
flex-shrink: 0;
|
||||
width: auto;
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
&__btn {
|
||||
height: 24px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid @profile-line;
|
||||
border-radius: @profile-radius;
|
||||
height: 28px;
|
||||
padding: 0 @spacing-sm;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-round;
|
||||
background: @white;
|
||||
color: @text-color;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
font-size: @font-size-sm;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
&:hover {
|
||||
border-color: @primary-strong;
|
||||
color: @primary-strong;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&--muted {
|
||||
color: @text-color;
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
&--danger {
|
||||
color: @text-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.address-card .status-tag {
|
||||
padding: 2px 8px;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
|
||||
257
src/views/profile/bind-email.vue
Normal file
257
src/views/profile/bind-email.vue
Normal file
@@ -0,0 +1,257 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useProfileStore } from '@/stores/modules/profile'
|
||||
import { useCountDown } from '@/composables/useCountDown'
|
||||
|
||||
const router = useRouter()
|
||||
const profileStore = useProfileStore()
|
||||
const { profile } = storeToRefs(profileStore)
|
||||
|
||||
const hasEmail = computed(() => Boolean(profile.value?.email))
|
||||
|
||||
const email = ref('')
|
||||
const code = ref('')
|
||||
|
||||
const { seconds, isCounting, start } = useCountDown(60)
|
||||
|
||||
function onGetCode(): void {
|
||||
if (!hasEmail.value && !email.value) {
|
||||
ElMessage.warning('请输入新邮箱')
|
||||
return
|
||||
}
|
||||
start(60)
|
||||
ElMessage.success('验证码已发送')
|
||||
}
|
||||
|
||||
function onBind(): void {
|
||||
if (!hasEmail.value && !email.value) {
|
||||
ElMessage.warning('请输入新邮箱')
|
||||
return
|
||||
}
|
||||
if (!code.value) {
|
||||
ElMessage.warning('请输入验证码')
|
||||
return
|
||||
}
|
||||
// 换绑态设计稿无新邮箱输入框(#43),按现状提交当前邮箱 + 验证码
|
||||
const target = hasEmail.value ? profile.value?.email ?? '' : email.value
|
||||
void profileStore.bindEmail(target, code.value).then(() => {
|
||||
void router.push('/profile/security')
|
||||
})
|
||||
}
|
||||
|
||||
function onUnbind(): void {
|
||||
void profileStore.unbindEmail().then(() => {
|
||||
void router.push('/profile/security')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="bind-email-page">
|
||||
<h2 class="bind-email-page__title">
|
||||
绑定邮箱
|
||||
</h2>
|
||||
|
||||
<form class="bind-email-page__form" @submit.prevent="onBind">
|
||||
<div class="bind-email-page__field">
|
||||
<label class="bind-email-page__label">{{ hasEmail ? '邮箱' : '新邮箱' }}</label>
|
||||
<input
|
||||
v-if="hasEmail"
|
||||
class="bind-email-page__input bind-email-page__input--disabled"
|
||||
type="text"
|
||||
:value="profile?.email ?? ''"
|
||||
readonly
|
||||
>
|
||||
<input
|
||||
v-else
|
||||
v-model="email"
|
||||
class="bind-email-page__input"
|
||||
type="text"
|
||||
placeholder="请输入新邮箱"
|
||||
maxlength="50"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="bind-email-page__field">
|
||||
<label class="bind-email-page__label">邮箱验证码</label>
|
||||
<div class="bind-email-page__code">
|
||||
<input
|
||||
v-model="code"
|
||||
class="bind-email-page__input"
|
||||
type="text"
|
||||
placeholder="请输入验证码"
|
||||
maxlength="6"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="bind-email-page__get-code"
|
||||
:disabled="isCounting"
|
||||
@click="onGetCode"
|
||||
>
|
||||
{{ isCounting ? `${seconds}秒后重获` : '获取验证码' }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="hasEmail" class="bind-email-page__actions">
|
||||
<button type="button" class="bind-email-page__quit" @click="onUnbind">
|
||||
取消绑定
|
||||
</button>
|
||||
<button type="submit" class="bind-email-page__submit">
|
||||
更换绑定邮箱
|
||||
</button>
|
||||
</div>
|
||||
<button v-else type="submit" class="bind-email-page__submit">
|
||||
验证并绑定
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.bind-email-page {
|
||||
.flex(column, flex-start, stretch);
|
||||
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 14px;
|
||||
margin-bottom: 24px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @profile-ink;
|
||||
line-height: 20px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
border-radius: 2px;
|
||||
background: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__form {
|
||||
width: 860px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
&__field {
|
||||
.flex(column, flex-start);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
&__label {
|
||||
margin-bottom: 12px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
color: @profile-ink;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
&__input {
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding: 0 14px;
|
||||
border: 1px solid @profile-input-border;
|
||||
border-radius: @profile-radius;
|
||||
background: @white;
|
||||
font-size: 13px;
|
||||
color: @profile-ink;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
border-color: @primary-strong;
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: @finance-axis-text;
|
||||
}
|
||||
|
||||
&--disabled {
|
||||
border-color: transparent;
|
||||
background: @profile-input-disabled-bg;
|
||||
color: @finance-muted-text;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
&__code {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
||||
.bind-email-page__input {
|
||||
padding-right: 124px;
|
||||
}
|
||||
}
|
||||
|
||||
&__get-code {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 107px;
|
||||
height: 38px;
|
||||
border: 1px solid @primary-strong;
|
||||
border-radius: @profile-radius;
|
||||
background: @white;
|
||||
color: @primary-strong;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
border-color: @text-color-disabled;
|
||||
color: @text-color-disabled;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
&__actions {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 28px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
&__quit,
|
||||
&__submit {
|
||||
height: 46px;
|
||||
border: none;
|
||||
border-radius: @profile-radius;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
&__quit {
|
||||
background: @profile-quiet-btn;
|
||||
color: @finance-muted-text;
|
||||
|
||||
&:hover {
|
||||
background: darken(@profile-quiet-btn, 4%);
|
||||
}
|
||||
}
|
||||
|
||||
&__submit {
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
|
||||
&:hover {
|
||||
background: darken(@primary-strong, 6%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
235
src/views/profile/bind-phone.vue
Normal file
235
src/views/profile/bind-phone.vue
Normal file
@@ -0,0 +1,235 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useProfileStore } from '@/stores/modules/profile'
|
||||
import { useCountDown } from '@/composables/useCountDown'
|
||||
|
||||
const router = useRouter()
|
||||
const profileStore = useProfileStore()
|
||||
const { profile } = storeToRefs(profileStore)
|
||||
|
||||
const hasPhone = computed(() => Boolean(profile.value?.phone))
|
||||
|
||||
const phone = ref('')
|
||||
const code = ref('')
|
||||
|
||||
const { seconds, isCounting, start } = useCountDown(60)
|
||||
|
||||
function onGetCode(): void {
|
||||
const target = hasPhone.value ? profile.value?.phone : phone.value
|
||||
if (!target) {
|
||||
ElMessage.warning('请输入手机号')
|
||||
return
|
||||
}
|
||||
start(60)
|
||||
ElMessage.success('验证码已发送')
|
||||
}
|
||||
|
||||
function onSubmit(): void {
|
||||
const target = hasPhone.value ? profile.value?.phone : phone.value
|
||||
if (!target) {
|
||||
ElMessage.warning('请输入手机号')
|
||||
return
|
||||
}
|
||||
if (!code.value) {
|
||||
ElMessage.warning('请输入验证码')
|
||||
return
|
||||
}
|
||||
void profileStore.bindPhone(target, code.value).then(() => {
|
||||
void router.push('/profile/security')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="bind-phone-page">
|
||||
<h2 class="bind-phone-page__title">
|
||||
绑定手机号
|
||||
</h2>
|
||||
|
||||
<form class="bind-phone-page__form" @submit.prevent="onSubmit">
|
||||
<div class="bind-phone-page__field">
|
||||
<label class="bind-phone-page__label">手机号</label>
|
||||
<input
|
||||
v-if="hasPhone"
|
||||
class="bind-phone-page__input bind-phone-page__input--disabled"
|
||||
type="text"
|
||||
:value="profile?.phone ?? ''"
|
||||
readonly
|
||||
>
|
||||
<input
|
||||
v-else
|
||||
v-model="phone"
|
||||
class="bind-phone-page__input"
|
||||
type="text"
|
||||
placeholder="请输入手机号"
|
||||
maxlength="20"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="bind-phone-page__field">
|
||||
<label class="bind-phone-page__label">验证码</label>
|
||||
<div class="bind-phone-page__code">
|
||||
<input
|
||||
v-model="code"
|
||||
class="bind-phone-page__input"
|
||||
type="text"
|
||||
placeholder="请输入验证码"
|
||||
maxlength="6"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="bind-phone-page__get-code"
|
||||
:disabled="isCounting"
|
||||
@click="onGetCode"
|
||||
>
|
||||
{{ isCounting ? `${seconds}秒后重获` : '获取验证码' }}
|
||||
</button>
|
||||
</div>
|
||||
<p class="bind-phone-page__hint">
|
||||
注:更换新手机号之后,可以用新的手机号充当当前账号登录
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="bind-phone-page__submit">
|
||||
{{ hasPhone ? '验证并换绑' : '验证并绑定' }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.bind-phone-page {
|
||||
.flex(column, flex-start, stretch);
|
||||
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 14px;
|
||||
margin-bottom: 24px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @profile-ink;
|
||||
line-height: 20px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
border-radius: 2px;
|
||||
background: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__form {
|
||||
width: 860px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
&__field {
|
||||
.flex(column, flex-start);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
&__label {
|
||||
margin-bottom: 12px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
color: @profile-ink;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
&__input {
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding: 0 14px;
|
||||
border: 1px solid @profile-input-border;
|
||||
border-radius: @profile-radius;
|
||||
background: @white;
|
||||
font-size: 13px;
|
||||
color: @profile-ink;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
border-color: @primary-strong;
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: @finance-axis-text;
|
||||
}
|
||||
|
||||
&--disabled {
|
||||
border-color: transparent;
|
||||
background: @profile-input-disabled-bg;
|
||||
color: @finance-muted-text;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
&__code {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
||||
.bind-phone-page__input {
|
||||
padding-right: 124px;
|
||||
}
|
||||
}
|
||||
|
||||
&__get-code {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 107px;
|
||||
height: 38px;
|
||||
border: 1px solid @primary-strong;
|
||||
border-radius: @profile-radius;
|
||||
background: @white;
|
||||
color: @primary-strong;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
border-color: @text-color-disabled;
|
||||
color: @text-color-disabled;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
&__hint {
|
||||
margin-top: 8px;
|
||||
font-size: @font-size-sm;
|
||||
color: @finance-axis-text;
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
&__submit {
|
||||
width: 100%;
|
||||
height: 46px;
|
||||
margin-top: 2px;
|
||||
border: none;
|
||||
border-radius: @profile-radius;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: darken(@primary-strong, 6%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
283
src/views/profile/change-password.vue
Normal file
283
src/views/profile/change-password.vue
Normal file
@@ -0,0 +1,283 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { PasswordStrength } from '@/components'
|
||||
import { isValidPassword, getPasswordLevel } from '@/utils/validate'
|
||||
import { useProfileStore } from '@/stores/modules/profile'
|
||||
import { useCountDown } from '@/composables/useCountDown'
|
||||
|
||||
const router = useRouter()
|
||||
const profileStore = useProfileStore()
|
||||
const { profile } = storeToRefs(profileStore)
|
||||
|
||||
const phone = ref('')
|
||||
const code = ref('')
|
||||
const password = ref('')
|
||||
const confirm = ref('')
|
||||
const agree = ref(false)
|
||||
|
||||
const { seconds, isCounting, start } = useCountDown(60)
|
||||
|
||||
function onGetCode(): void {
|
||||
if (!phone.value) {
|
||||
ElMessage.warning('请输入手机号')
|
||||
return
|
||||
}
|
||||
start(60)
|
||||
ElMessage.success('验证码已发送')
|
||||
}
|
||||
|
||||
function onSubmit(): void {
|
||||
if (!phone.value) {
|
||||
ElMessage.warning('请输入手机号')
|
||||
return
|
||||
}
|
||||
if (!code.value) {
|
||||
ElMessage.warning('请输入验证码')
|
||||
return
|
||||
}
|
||||
if (!password.value) {
|
||||
ElMessage.warning('请输入新密码')
|
||||
return
|
||||
}
|
||||
if (password.value !== confirm.value) {
|
||||
ElMessage.warning('两次密码不一致')
|
||||
return
|
||||
}
|
||||
if (!isValidPassword(password.value) || getPasswordLevel(password.value) === 'weak') {
|
||||
ElMessage.warning('密码等级过低,请重新输入')
|
||||
return
|
||||
}
|
||||
if (!agree.value) {
|
||||
ElMessage.warning('请先阅读并同意《用户协议》和《隐私政策》')
|
||||
return
|
||||
}
|
||||
void profileStore.changePassword({ code: code.value, password: password.value }).then(() => {
|
||||
void router.push('/profile/security')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="change-pwd-page">
|
||||
<h2 class="change-pwd-page__title">
|
||||
修改密码
|
||||
</h2>
|
||||
|
||||
<form class="change-pwd-page__form" @submit.prevent="onSubmit">
|
||||
<div class="change-pwd-page__field">
|
||||
<label class="change-pwd-page__label">手机号</label>
|
||||
<input
|
||||
v-model="phone"
|
||||
class="change-pwd-page__input"
|
||||
type="text"
|
||||
:placeholder="profile?.phone ?? '请输入手机号'"
|
||||
maxlength="20"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="change-pwd-page__field">
|
||||
<label class="change-pwd-page__label">验证码</label>
|
||||
<div class="change-pwd-page__code">
|
||||
<input
|
||||
v-model="code"
|
||||
class="change-pwd-page__input"
|
||||
type="text"
|
||||
placeholder="请输入验证码"
|
||||
maxlength="6"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="change-pwd-page__get-code"
|
||||
:disabled="isCounting"
|
||||
@click="onGetCode"
|
||||
>
|
||||
{{ isCounting ? `${seconds}秒后重获` : '获取验证码' }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="change-pwd-page__field">
|
||||
<label class="change-pwd-page__label">设置密码</label>
|
||||
<input
|
||||
v-model="password"
|
||||
class="change-pwd-page__input"
|
||||
type="password"
|
||||
placeholder="请设置8-20位密码"
|
||||
maxlength="20"
|
||||
>
|
||||
<PasswordStrength :password="password" :show-label="false" />
|
||||
</div>
|
||||
|
||||
<div class="change-pwd-page__field change-pwd-page__field--last">
|
||||
<label class="change-pwd-page__label">确认密码</label>
|
||||
<input
|
||||
v-model="confirm"
|
||||
class="change-pwd-page__input"
|
||||
type="password"
|
||||
placeholder="请设置8-20位密码"
|
||||
maxlength="20"
|
||||
>
|
||||
</div>
|
||||
|
||||
<label class="change-pwd-page__agree">
|
||||
<input v-model="agree" type="checkbox">
|
||||
<span>已阅读并同意<em>《用户协议》</em>和<em>《隐私政策》</em></span>
|
||||
</label>
|
||||
|
||||
<button type="submit" class="change-pwd-page__submit">
|
||||
确认修改
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.change-pwd-page {
|
||||
.flex(column, flex-start, stretch);
|
||||
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 14px;
|
||||
margin-bottom: 24px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @profile-ink;
|
||||
line-height: 20px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
border-radius: 2px;
|
||||
background: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__form {
|
||||
width: 860px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
&__field {
|
||||
.flex(column, flex-start);
|
||||
margin-bottom: 20px;
|
||||
|
||||
&--last {
|
||||
margin-top: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
&__label {
|
||||
margin-bottom: 12px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
color: @profile-ink;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
&__input {
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding: 0 14px;
|
||||
border: 1px solid @profile-input-border;
|
||||
border-radius: @profile-radius;
|
||||
background: @white;
|
||||
font-size: 13px;
|
||||
color: @profile-ink;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
border-color: @primary-strong;
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: @finance-axis-text;
|
||||
}
|
||||
}
|
||||
|
||||
&__code {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
||||
.change-pwd-page__input {
|
||||
padding-right: 124px;
|
||||
}
|
||||
}
|
||||
|
||||
&__get-code {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 107px;
|
||||
height: 38px;
|
||||
border: 1px solid @primary-strong;
|
||||
border-radius: @profile-radius;
|
||||
background: @white;
|
||||
color: @primary-strong;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
border-color: @text-color-disabled;
|
||||
color: @text-color-disabled;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.pwd-strength) {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
&__agree {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 8px;
|
||||
margin-top: 4px;
|
||||
font-size: @font-size-sm;
|
||||
color: @finance-muted-text;
|
||||
cursor: pointer;
|
||||
|
||||
input {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
accent-color: @primary-strong;
|
||||
}
|
||||
|
||||
em {
|
||||
font-style: normal;
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__submit {
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
margin-top: 18px;
|
||||
border: none;
|
||||
border-radius: @profile-radius;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: darken(@primary-strong, 6%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,153 +1,138 @@
|
||||
<script setup lang="ts">
|
||||
const intro = '虫子智造是一站式研发智造一体化服务平台,聚焦零部件加工、模具开发、样品试制与批量生产需求,打通需求发布、方案对接、项目管控、合同结算全流程,为企业提供高效透明的智能制造外协解决方案。'
|
||||
|
||||
const mission = '连接需求方与制造资源,简化外协生产流程,降低企业研发与制造成本,助力中小制造企业数字化转型。'
|
||||
|
||||
const advantages = [
|
||||
{ title: '全流程线上化', desc: '需求发布、方案对接、进度跟踪、合同结算全程线上完成,状态实时可见。' },
|
||||
{ title: '优质制造资源', desc: '汇聚软硬件研发与量产优质服务商,严格资质审核,匹配更精准。' },
|
||||
{ title: '规范化项目管控', desc: '标准化交付节点与验收流程,里程碑透明管控,项目风险早发现早处理。' },
|
||||
{ title: '一站式服务', desc: '从零部件加工到模具开发、样品试制与批量生产,一个平台完成全部外协。' },
|
||||
{ title: '全流程线上化', desc: '需求提报、项目跟进、合同管理、财务对账全部线上完成,进度实时可见。' },
|
||||
{ title: '优质制造资源', desc: '汇聚各类加工厂商,覆盖 3D 打印、机加工、注塑、钣金等多种工艺。' },
|
||||
{ title: '规范化项目管理', desc: '统一项目流程、质量标准、售后保障,降低合作风险。' },
|
||||
{ title: '一站式服务', desc: '从样品打样到批量生产,提供完整的智造交付支撑。' },
|
||||
]
|
||||
|
||||
const contacts = [
|
||||
{ label: '客服热线:', value: '400-XXXX-XXXX' },
|
||||
{ label: '工作时间:', value: '周一至周五 09:00 - 18:00' },
|
||||
{ label: '平台官网:', value: 'www.chongzizhizao.com', link: true },
|
||||
{ label: '公司地址:', value: '山东省日照市' },
|
||||
]
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="about-panel">
|
||||
<section class="about-panel__section">
|
||||
<h3 class="about-panel__title">
|
||||
<h3 class="about-panel__section-title">
|
||||
平台简介
|
||||
</h3>
|
||||
<p class="about-panel__text">
|
||||
虫子智造是一站式研发智造一体化服务平台,聚焦零部件加工、模具开发、样品试制与批量生产需求,打通需求发布、方案对接、项目管控、合同结算全流程,为企业提供高效透明的智能制造外协解决方案。
|
||||
<p class="about-panel__center-text">
|
||||
{{ intro }}
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section class="about-panel__section">
|
||||
<h3 class="about-panel__title">
|
||||
<h3 class="about-panel__section-title">
|
||||
我们的使命
|
||||
</h3>
|
||||
<p class="about-panel__text">
|
||||
连接需求方与制造资源,简化外协生产流程,降低企业研发与制造成本,助力中小制造企业数字化转型。
|
||||
<p class="about-panel__center-text">
|
||||
{{ mission }}
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section class="about-panel__section">
|
||||
<h3 class="about-panel__title">
|
||||
核心优势
|
||||
</h3>
|
||||
<ul class="about-panel__advantages">
|
||||
<li
|
||||
v-for="item in advantages"
|
||||
:key="item.title"
|
||||
class="about-panel__advantage"
|
||||
>
|
||||
<h4 class="about-panel__advantage-title">
|
||||
{{ item.title }}
|
||||
</h4>
|
||||
<p class="about-panel__advantage-desc text-secondary">
|
||||
{{ item.desc }}
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<ol class="about-panel__advantages">
|
||||
<li
|
||||
v-for="item in advantages"
|
||||
:key="item.title"
|
||||
class="about-panel__advantage"
|
||||
>
|
||||
<span class="about-panel__advantage-title">{{ item.title }}:</span>
|
||||
<span class="about-panel__advantage-desc">{{ item.desc }}</span>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<section class="about-panel__section">
|
||||
<h3 class="about-panel__title">
|
||||
联系信息
|
||||
</h3>
|
||||
<ul class="about-panel__contact">
|
||||
<li><span>客服热线:</span>400-XXXX-XXXX</li>
|
||||
<li><span>工作时间:</span>周一至周五 09:00 - 18:00</li>
|
||||
<li>
|
||||
<span>平台官网:</span>
|
||||
<a
|
||||
href="https://www.chongzizhizao.com"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="about-panel__link"
|
||||
>
|
||||
https://www.chongzizhizao.com
|
||||
</a>
|
||||
</li>
|
||||
<li><span>公司地址:</span>山东省日照市</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section class="about-panel__section">
|
||||
<h3 class="about-panel__title">
|
||||
版本信息
|
||||
</h3>
|
||||
<p class="about-panel__text">
|
||||
当前系统版本:V1.0.0<br>
|
||||
更新时间:2026 年 09 月
|
||||
</p>
|
||||
</section>
|
||||
<ul class="about-panel__contacts">
|
||||
<li v-for="item in contacts" :key="item.label" class="about-panel__contact">
|
||||
{{ item.label }}<a
|
||||
v-if="item.link"
|
||||
href="https://www.chongzizhizao.com"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="about-panel__link"
|
||||
>{{ item.value }}</a>
|
||||
<template v-else>{{ item.value }}</template>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.about-panel {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-lg;
|
||||
width: 100%;
|
||||
|
||||
&__section {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-sm;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
& + & {
|
||||
margin-top: @spacing-lg;
|
||||
}
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-size: 11px;
|
||||
&__section-title {
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @heading-color;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&__center-text {
|
||||
margin-top: 12px;
|
||||
font-size: 13px;
|
||||
color: @text-color;
|
||||
line-height: 1.9;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&__advantages {
|
||||
margin: 56px 0 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
counter-reset: advantage;
|
||||
}
|
||||
|
||||
&__advantage {
|
||||
counter-increment: advantage;
|
||||
font-size: 13px;
|
||||
color: @text-color;
|
||||
line-height: 32px;
|
||||
|
||||
&::before {
|
||||
content: counter(advantage) '. ';
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
& + & {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&__advantage-title {
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&__text {
|
||||
font-size: 11px;
|
||||
&__advantage-desc {
|
||||
color: @text-color;
|
||||
line-height: 1.9;
|
||||
}
|
||||
|
||||
&__advantages {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: @spacing-sm;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
&__contacts {
|
||||
margin: 46px 0 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
&__advantage {
|
||||
.flex(row, flex-start);
|
||||
gap: @spacing-sm;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&__advantage-title {
|
||||
flex-shrink: 0;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: @text-color;
|
||||
}
|
||||
|
||||
&__advantage-desc {
|
||||
font-size: 11px;
|
||||
color: @text-color;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
&__contact {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-sm;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
font-size: 11px;
|
||||
font-size: 13px;
|
||||
color: @text-color;
|
||||
|
||||
span {
|
||||
color: @text-color;
|
||||
}
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
&__link {
|
||||
|
||||
@@ -148,10 +148,10 @@ function onSave(): void {
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 12px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @heading-color;
|
||||
line-height: 20px;
|
||||
line-height: 1.4;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
@@ -172,7 +172,7 @@ function onSave(): void {
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 11px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
color: @heading-color;
|
||||
}
|
||||
@@ -180,11 +180,11 @@ function onSave(): void {
|
||||
&__input,
|
||||
&__textarea {
|
||||
width: 100%;
|
||||
padding: 0 12px;
|
||||
padding: 0 @spacing-base;
|
||||
border: 1px solid @profile-input-border;
|
||||
border-radius: @profile-radius;
|
||||
background: @white;
|
||||
font-size: 11px;
|
||||
font-size: @font-size-sm;
|
||||
color: @text-color;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
@@ -195,7 +195,7 @@ function onSave(): void {
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: @heading-color;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ function onSave(): void {
|
||||
.app-button {
|
||||
flex: 1;
|
||||
height: 36px;
|
||||
font-size: 12px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
border-radius: @profile-radius;
|
||||
}
|
||||
|
||||
@@ -1,299 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { AppButton, SmsCodeInput } from '@/components'
|
||||
|
||||
export type BindContactMode =
|
||||
| 'phone-bind'
|
||||
| 'phone-rebind'
|
||||
| 'email-bind'
|
||||
| 'email-rebind'
|
||||
| 'identity'
|
||||
|
||||
interface Props {
|
||||
mode: BindContactMode
|
||||
hintPhone?: string
|
||||
hintEmail?: string
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
hintPhone: '',
|
||||
hintEmail: '',
|
||||
})
|
||||
|
||||
const visible = defineModel<boolean>('visible', { default: false })
|
||||
|
||||
const emit = defineEmits<{ submit: [payload: { contact: string; code: string }] }>()
|
||||
|
||||
const contact = ref('')
|
||||
const code = ref('')
|
||||
const agree = ref(false)
|
||||
|
||||
const isEmailMode = computed(() => props.mode === 'email-bind' || props.mode === 'email-rebind')
|
||||
const isIdentity = computed(() => props.mode === 'identity')
|
||||
|
||||
const title = computed<string>(() => {
|
||||
const map: Record<BindContactMode, string> = {
|
||||
'phone-bind': '绑定手机号',
|
||||
'phone-rebind': '验证并换绑',
|
||||
'email-bind': '绑定邮箱',
|
||||
'email-rebind': '更换绑定邮箱',
|
||||
identity: '安全身份验证',
|
||||
}
|
||||
return map[props.mode]
|
||||
})
|
||||
|
||||
const fieldLabel = computed<string>(() => {
|
||||
const map: Record<BindContactMode, string> = {
|
||||
'phone-bind': '手机号',
|
||||
'phone-rebind': '新手机号',
|
||||
'email-bind': '邮箱',
|
||||
'email-rebind': '新邮箱',
|
||||
identity: '手机号',
|
||||
}
|
||||
return map[props.mode]
|
||||
})
|
||||
|
||||
const submitText = computed<string>(() => {
|
||||
const map: Record<BindContactMode, string> = {
|
||||
'phone-bind': '验证并绑定',
|
||||
'phone-rebind': '验证并换绑',
|
||||
'email-bind': '确认修改',
|
||||
'email-rebind': '确认修改',
|
||||
identity: '验证',
|
||||
}
|
||||
return map[props.mode]
|
||||
})
|
||||
|
||||
const contactPlaceholder = computed<string>(() => {
|
||||
if (isEmailMode.value) return props.hintEmail || '请输入邮箱'
|
||||
return props.mode === 'phone-rebind' ? '请输入新手机号' : '请输入手机号'
|
||||
})
|
||||
|
||||
const identityDesc = computed(() =>
|
||||
isIdentity.value
|
||||
? `安全身份验证:为确保账号安全,请完成身份验证后再进行账号操作,发送验证码至 ${props.hintPhone}`
|
||||
: '',
|
||||
)
|
||||
|
||||
watch(visible, (open) => {
|
||||
if (!open) return
|
||||
contact.value = isIdentity.value ? props.hintPhone : ''
|
||||
code.value = ''
|
||||
agree.value = false
|
||||
})
|
||||
|
||||
function onGetCode(): void {
|
||||
ElMessage.success('验证码已发送')
|
||||
}
|
||||
|
||||
function onSubmit(): void {
|
||||
if (!contact.value.trim()) {
|
||||
ElMessage.warning(isEmailMode.value ? '请输入邮箱' : '请输入手机号')
|
||||
return
|
||||
}
|
||||
if (!code.value) {
|
||||
ElMessage.warning('请输入验证码')
|
||||
return
|
||||
}
|
||||
if (!isIdentity.value && !agree.value) {
|
||||
ElMessage.warning('请先阅读并同意《用户协议》和《隐私政策》')
|
||||
return
|
||||
}
|
||||
emit('submit', { contact: contact.value.trim(), code: code.value })
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport to="body">
|
||||
<div v-if="visible" class="bind-dialog" @click.self="visible = false">
|
||||
<div class="bind-dialog__panel">
|
||||
<h3 class="bind-dialog__title">
|
||||
{{ title }}
|
||||
</h3>
|
||||
<p v-if="identityDesc" class="bind-dialog__desc text-secondary">
|
||||
{{ identityDesc }}
|
||||
</p>
|
||||
|
||||
<div class="bind-dialog__field">
|
||||
<label class="bind-dialog__label">{{ fieldLabel }}</label>
|
||||
<input
|
||||
v-model="contact"
|
||||
class="bind-dialog__input"
|
||||
type="text"
|
||||
:placeholder="contactPlaceholder"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="bind-dialog__field">
|
||||
<label class="bind-dialog__label">验证码</label>
|
||||
<SmsCodeInput v-model:code="code" @get-code="onGetCode" />
|
||||
</div>
|
||||
|
||||
<label v-if="!isIdentity" class="bind-dialog__agree">
|
||||
<input v-model="agree" type="checkbox">
|
||||
<span>我已阅读并同意<em>《用户协议》</em>和<em>《隐私政策》</em></span>
|
||||
</label>
|
||||
|
||||
<div class="bind-dialog__footer">
|
||||
<AppButton type="default" @click="visible = false">
|
||||
取消
|
||||
</AppButton>
|
||||
<AppButton type="primary" @click="onSubmit">
|
||||
{{ submitText }}
|
||||
</AppButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.bind-dialog {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1000;
|
||||
.flex(row, center);
|
||||
background: transparent;
|
||||
overflow-y: auto;
|
||||
|
||||
&__panel {
|
||||
width: 700px;
|
||||
max-width: calc(100vw - 32px);
|
||||
max-height: calc(100vh - 48px);
|
||||
overflow-y: auto;
|
||||
padding: @spacing-base;
|
||||
border-radius: @radius-lg;
|
||||
background: @white;
|
||||
box-shadow: @shadow-lg;
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-base;
|
||||
.scrollbar();
|
||||
}
|
||||
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 12px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
line-height: 20px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 3px;
|
||||
height: 14px;
|
||||
border-radius: 2px;
|
||||
background: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__title:has(+ .bind-dialog__desc) {
|
||||
padding-left: 0;
|
||||
font-size: 11px;
|
||||
color: @primary-strong;
|
||||
|
||||
&::before {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&__desc {
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
color: @text-color-secondary;
|
||||
font-size: 11px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
&__field {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-xs;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&__input {
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid @profile-input-border;
|
||||
border-radius: @profile-radius;
|
||||
background: @white;
|
||||
font-size: 11px;
|
||||
color: @text-color;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
border-color: @primary-strong;
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: @heading-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__agree {
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-sm;
|
||||
font-size: 11px;
|
||||
color: @text-color-secondary;
|
||||
cursor: pointer;
|
||||
|
||||
input {
|
||||
accent-color: @primary-strong;
|
||||
}
|
||||
|
||||
em {
|
||||
font-style: normal;
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__footer {
|
||||
.flex(row, flex-start);
|
||||
gap: @spacing-sm;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.app-button {
|
||||
flex: 1;
|
||||
height: 36px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
border-radius: @profile-radius;
|
||||
}
|
||||
|
||||
.app-button--primary {
|
||||
border-color: @primary-strong;
|
||||
background: @primary-strong;
|
||||
|
||||
&:hover {
|
||||
border-color: darken(@primary-strong, 6%);
|
||||
background: darken(@primary-strong, 6%);
|
||||
}
|
||||
}
|
||||
|
||||
.app-button--default {
|
||||
border: none;
|
||||
background: @profile-quiet-btn;
|
||||
color: @text-color;
|
||||
|
||||
&:hover {
|
||||
border: none;
|
||||
background: darken(@profile-quiet-btn, 4%);
|
||||
color: @text-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,256 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { AppButton, PasswordStrength, SmsCodeInput } from '@/components'
|
||||
|
||||
interface Props {
|
||||
phone: string
|
||||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
|
||||
const visible = defineModel<boolean>('visible', { default: false })
|
||||
|
||||
const emit = defineEmits<{
|
||||
submit: [payload: { code: string; password: string; confirm: string }]
|
||||
}>()
|
||||
|
||||
const code = ref('')
|
||||
const password = ref('')
|
||||
const confirm = ref('')
|
||||
const agree = ref(false)
|
||||
|
||||
watch(visible, (open) => {
|
||||
if (!open) return
|
||||
code.value = ''
|
||||
password.value = ''
|
||||
confirm.value = ''
|
||||
agree.value = false
|
||||
})
|
||||
|
||||
function onGetCode(): void {
|
||||
ElMessage.success('验证码已发送')
|
||||
}
|
||||
|
||||
function onSubmit(): void {
|
||||
if (!code.value) {
|
||||
ElMessage.warning('请输入验证码')
|
||||
return
|
||||
}
|
||||
if (!password.value) {
|
||||
ElMessage.warning('请输入新密码')
|
||||
return
|
||||
}
|
||||
if (!agree.value) {
|
||||
ElMessage.warning('请先阅读并同意《用户协议》和《隐私政策》')
|
||||
return
|
||||
}
|
||||
emit('submit', {
|
||||
code: code.value,
|
||||
password: password.value,
|
||||
confirm: confirm.value,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport to="body">
|
||||
<div v-if="visible" class="change-pwd-dialog" @click.self="visible = false">
|
||||
<div class="change-pwd-dialog__panel">
|
||||
<h3 class="change-pwd-dialog__title">
|
||||
修改密码
|
||||
</h3>
|
||||
|
||||
<div class="change-pwd-dialog__field">
|
||||
<label class="change-pwd-dialog__label">手机号</label>
|
||||
<input
|
||||
class="change-pwd-dialog__input"
|
||||
type="text"
|
||||
:value="props.phone"
|
||||
readonly
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="change-pwd-dialog__field">
|
||||
<label class="change-pwd-dialog__label">验证码</label>
|
||||
<SmsCodeInput v-model:code="code" @get-code="onGetCode" />
|
||||
</div>
|
||||
|
||||
<div class="change-pwd-dialog__field">
|
||||
<label class="change-pwd-dialog__label">设置密码</label>
|
||||
<input
|
||||
v-model="password"
|
||||
class="change-pwd-dialog__input"
|
||||
type="password"
|
||||
placeholder="请输入密码(6-20位)"
|
||||
maxlength="20"
|
||||
>
|
||||
<PasswordStrength :password="password" />
|
||||
</div>
|
||||
|
||||
<div class="change-pwd-dialog__field">
|
||||
<label class="change-pwd-dialog__label">确认密码</label>
|
||||
<input
|
||||
v-model="confirm"
|
||||
class="change-pwd-dialog__input"
|
||||
type="password"
|
||||
placeholder="请再次输入密码"
|
||||
maxlength="20"
|
||||
@keyup.enter="onSubmit"
|
||||
>
|
||||
</div>
|
||||
|
||||
<label class="change-pwd-dialog__agree">
|
||||
<input v-model="agree" type="checkbox">
|
||||
<span>我已阅读并同意<em>《用户协议》</em>和<em>《隐私政策》</em></span>
|
||||
</label>
|
||||
|
||||
<div class="change-pwd-dialog__footer">
|
||||
<AppButton type="default" @click="visible = false">
|
||||
取消
|
||||
</AppButton>
|
||||
<AppButton type="primary" @click="onSubmit">
|
||||
确认修改
|
||||
</AppButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.change-pwd-dialog {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1000;
|
||||
.flex(row, center);
|
||||
background: transparent;
|
||||
overflow-y: auto;
|
||||
|
||||
&__panel {
|
||||
width: 700px;
|
||||
max-width: calc(100vw - 32px);
|
||||
max-height: calc(100vh - 48px);
|
||||
overflow-y: auto;
|
||||
padding: @spacing-base;
|
||||
border-radius: @radius-lg;
|
||||
background: @white;
|
||||
box-shadow: @shadow-lg;
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-base;
|
||||
.scrollbar();
|
||||
}
|
||||
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 12px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
line-height: 20px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 3px;
|
||||
height: 14px;
|
||||
border-radius: 2px;
|
||||
background: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__field {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-xs;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&__input {
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid @profile-input-border;
|
||||
border-radius: @profile-radius;
|
||||
background: @white;
|
||||
font-size: 11px;
|
||||
color: @text-color;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
border-color: @primary-strong;
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&:read-only {
|
||||
color: @text-color;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
&__agree {
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-sm;
|
||||
font-size: 11px;
|
||||
color: @text-color-secondary;
|
||||
cursor: pointer;
|
||||
|
||||
input {
|
||||
accent-color: @primary-strong;
|
||||
}
|
||||
|
||||
em {
|
||||
font-style: normal;
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__footer {
|
||||
.flex(row, flex-start);
|
||||
gap: @spacing-sm;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.app-button {
|
||||
flex: 1;
|
||||
height: 36px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
border-radius: @profile-radius;
|
||||
}
|
||||
|
||||
.app-button--primary {
|
||||
border-color: @primary-strong;
|
||||
background: @primary-strong;
|
||||
|
||||
&:hover {
|
||||
border-color: darken(@primary-strong, 6%);
|
||||
background: darken(@primary-strong, 6%);
|
||||
}
|
||||
}
|
||||
|
||||
.app-button--default {
|
||||
border: none;
|
||||
background: @profile-quiet-btn;
|
||||
color: @text-color;
|
||||
|
||||
&:hover {
|
||||
border: none;
|
||||
background: darken(@profile-quiet-btn, 4%);
|
||||
color: @text-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,43 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { CaseCard } from '@/components'
|
||||
import type { Case } from '@/types/business/cases'
|
||||
|
||||
interface Props {
|
||||
cases: Case[]
|
||||
}
|
||||
|
||||
defineProps<Props>()
|
||||
|
||||
const emit = defineEmits<{ view: [id: string] }>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="favorites-grid">
|
||||
<template v-if="cases.length > 0">
|
||||
<CaseCard
|
||||
v-for="item in cases"
|
||||
:key="item.id"
|
||||
:item="item"
|
||||
@view="emit('view', $event)"
|
||||
/>
|
||||
</template>
|
||||
<p v-else class="favorites-grid__empty text-secondary">
|
||||
暂无收藏案例,快去案例库挑选感兴趣的内容吧
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.favorites-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: @spacing-base;
|
||||
|
||||
&__empty {
|
||||
grid-column: 1 / -1;
|
||||
padding: @spacing-xxl 0;
|
||||
text-align: center;
|
||||
font-size: @font-size-base;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, watch } from 'vue'
|
||||
import { AppButton, FileList, UploadArea } from '@/components'
|
||||
import { reactive, ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FileInfo } from '@/types/api'
|
||||
import type { Feedback } from '@/types/business/profile'
|
||||
|
||||
@@ -12,7 +12,6 @@ const props = withDefaults(defineProps<Props>(), { resetSignal: 0 })
|
||||
|
||||
const emit = defineEmits<{
|
||||
submit: [feedback: Feedback]
|
||||
reset: []
|
||||
preview: [file: FileInfo]
|
||||
}>()
|
||||
|
||||
@@ -22,6 +21,7 @@ const form = reactive({
|
||||
})
|
||||
|
||||
const attachments = reactive<FileInfo[]>([])
|
||||
const fileInputRef = ref<HTMLInputElement | null>(null)
|
||||
|
||||
function clear(): void {
|
||||
form.title = ''
|
||||
@@ -34,13 +34,34 @@ watch(
|
||||
() => clear(),
|
||||
)
|
||||
|
||||
function onUpload(file: File): void {
|
||||
attachments.push({
|
||||
name: file.name,
|
||||
size: file.size,
|
||||
uploadTime: new Date().toISOString().slice(0, 10),
|
||||
url: '',
|
||||
})
|
||||
function openFilePicker(): void {
|
||||
fileInputRef.value?.click()
|
||||
}
|
||||
|
||||
function onFileChange(event: Event): void {
|
||||
const input = event.target as HTMLInputElement
|
||||
const files = input.files
|
||||
if (!files) return
|
||||
for (const file of Array.from(files)) {
|
||||
attachments.push({
|
||||
name: file.name,
|
||||
size: file.size,
|
||||
uploadTime: new Date().toISOString().slice(0, 10),
|
||||
url: '',
|
||||
})
|
||||
}
|
||||
input.value = ''
|
||||
}
|
||||
|
||||
function extOf(name: string): string {
|
||||
const index = name.lastIndexOf('.')
|
||||
return index >= 0 ? name.slice(index + 1, index + 4).toUpperCase() : 'FILE'
|
||||
}
|
||||
|
||||
function sizeText(size: number): string {
|
||||
if (size >= 1024 * 1024) return `${(size / 1024 / 1024).toFixed(1)}MB`
|
||||
if (size >= 1024) return `${(size / 1024).toFixed(0)}KB`
|
||||
return `${size}B`
|
||||
}
|
||||
|
||||
function onDeleteFile(file: FileInfo): void {
|
||||
@@ -48,17 +69,25 @@ function onDeleteFile(file: FileInfo): void {
|
||||
if (index >= 0) attachments.splice(index, 1)
|
||||
}
|
||||
|
||||
function onPreview(file: FileInfo): void {
|
||||
emit('preview', file)
|
||||
}
|
||||
|
||||
function onSubmit(): void {
|
||||
if (!form.title.trim()) {
|
||||
ElMessage.warning('请填写反馈标题')
|
||||
return
|
||||
}
|
||||
if (!form.description.trim()) {
|
||||
ElMessage.warning('请填写详细描述')
|
||||
return
|
||||
}
|
||||
emit('submit', {
|
||||
title: form.title,
|
||||
description: form.description,
|
||||
attachments: [...attachments],
|
||||
})
|
||||
}
|
||||
|
||||
function onReset(): void {
|
||||
emit('reset')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -69,7 +98,7 @@ function onReset(): void {
|
||||
v-model="form.title"
|
||||
class="feedback-form__input"
|
||||
type="text"
|
||||
placeholder="请简要描述您的反馈标题"
|
||||
placeholder="请输入反馈标题"
|
||||
maxlength="50"
|
||||
>
|
||||
</div>
|
||||
@@ -79,34 +108,57 @@ function onReset(): void {
|
||||
<textarea
|
||||
v-model="form.description"
|
||||
class="feedback-form__textarea"
|
||||
placeholder="请详细描述您遇到的问题或建议,便于我们更快为您处理"
|
||||
placeholder="请详细描述您的问题..."
|
||||
maxlength="500"
|
||||
rows="6"
|
||||
/>
|
||||
<span class="feedback-form__counter text-secondary">{{ form.description.length }}/500</span>
|
||||
<span class="feedback-form__counter">{{ form.description.length }}/500</span>
|
||||
</div>
|
||||
|
||||
<p class="feedback-form__tip">
|
||||
提交后我们的专业顾问将在一个工作日内与您联系,为您提供一对一服务
|
||||
</p>
|
||||
|
||||
<div class="feedback-form__field">
|
||||
<label class="feedback-form__label">附件</label>
|
||||
<UploadArea @upload="onUpload" />
|
||||
<FileList
|
||||
:files="attachments"
|
||||
@preview="emit('preview', $event)"
|
||||
@delete="onDeleteFile"
|
||||
/>
|
||||
<div class="feedback-form__attach-head">
|
||||
<h3 class="feedback-form__attach-title">
|
||||
附件上传
|
||||
</h3>
|
||||
<span class="feedback-form__attach-hint">支持图片/文档/压缩包,大小不超过1G</span>
|
||||
<button class="feedback-form__upload-btn" @click="openFilePicker">
|
||||
上传
|
||||
</button>
|
||||
<input
|
||||
ref="fileInputRef"
|
||||
class="feedback-form__file-input"
|
||||
type="file"
|
||||
multiple
|
||||
@change="onFileChange"
|
||||
>
|
||||
</div>
|
||||
|
||||
<ul class="feedback-form__files">
|
||||
<li v-for="file in attachments" :key="file.name" class="feedback-form__file">
|
||||
<span class="feedback-form__file-icon" :class="`is-${extOf(file.name).toLowerCase()}`">
|
||||
{{ extOf(file.name) }}
|
||||
</span>
|
||||
<div class="feedback-form__file-info">
|
||||
<p class="feedback-form__file-name">
|
||||
{{ file.name }}
|
||||
</p>
|
||||
<p class="feedback-form__file-meta">
|
||||
{{ sizeText(file.size) }} · 上传于 {{ file.uploadTime }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="feedback-form__file-actions">
|
||||
<button class="feedback-form__file-link" @click="onPreview(file)">
|
||||
预览
|
||||
</button>
|
||||
<button class="feedback-form__file-link is-danger" @click="onDeleteFile(file)">
|
||||
删除
|
||||
</button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="feedback-form__footer">
|
||||
<AppButton type="primary" @click="onSubmit">
|
||||
<button class="feedback-form__submit" @click="onSubmit">
|
||||
提交反馈
|
||||
</AppButton>
|
||||
<AppButton type="default" @click="onReset">
|
||||
重置
|
||||
</AppButton>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -114,21 +166,20 @@ function onReset(): void {
|
||||
<style lang="less" scoped>
|
||||
.feedback-form {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-base;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
gap: 20px;
|
||||
width: 100%;
|
||||
|
||||
&__field {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-xs;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 11px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: @heading-color;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
&__required {
|
||||
@@ -139,11 +190,11 @@ function onReset(): void {
|
||||
&__input,
|
||||
&__textarea {
|
||||
width: 100%;
|
||||
padding: 0 12px;
|
||||
padding: 0 14px;
|
||||
border: 1px solid @profile-input-border;
|
||||
border-radius: @profile-radius;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
font-size: 11px;
|
||||
font-size: 13px;
|
||||
color: @text-color;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
@@ -154,71 +205,175 @@ function onReset(): void {
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: @heading-color;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
}
|
||||
|
||||
&__input {
|
||||
height: 32px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
&__textarea {
|
||||
padding: 8px 12px;
|
||||
line-height: 1.6;
|
||||
height: 150px;
|
||||
padding: 12px 14px;
|
||||
line-height: 1.7;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
&__counter {
|
||||
align-self: flex-end;
|
||||
color: @text-color-disabled;
|
||||
font-size: 11px;
|
||||
font-size: 12px;
|
||||
line-height: 17px;
|
||||
}
|
||||
|
||||
&__tip {
|
||||
padding: @spacing-sm @spacing-base;
|
||||
border-radius: @profile-radius;
|
||||
background: @primary-light;
|
||||
color: @primary-strong;
|
||||
&__attach-head {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 14px;
|
||||
width: 100%;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
&__attach-title {
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @heading-color;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
&__attach-hint {
|
||||
font-size: 12px;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
|
||||
&__upload-btn {
|
||||
margin-left: auto;
|
||||
height: 32px;
|
||||
padding: 0 18px;
|
||||
border: 1px solid @profile-input-border;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
color: @text-color;
|
||||
font-size: 13px;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: @primary-strong;
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__file-input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&__files {
|
||||
.flex(column, flex-start);
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
&__file {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 14px;
|
||||
width: 100%;
|
||||
padding: 13px 16px;
|
||||
border-radius: @radius-base;
|
||||
background: @service-input-bg;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__file-icon {
|
||||
.flex(row, center);
|
||||
flex-shrink: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: @radius-base;
|
||||
font-size: 11px;
|
||||
line-height: 1.6;
|
||||
font-weight: 700;
|
||||
|
||||
&.is-pdf {
|
||||
background: @profile-icon-phone;
|
||||
color: @danger-color;
|
||||
}
|
||||
|
||||
&.is-doc,
|
||||
&.is-docx {
|
||||
background: @profile-page-active-bg;
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
&.is-xls,
|
||||
&.is-xlsx {
|
||||
background: @profile-tag-ok-bg;
|
||||
color: @success-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__file-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__file-name {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: @heading-color;
|
||||
line-height: 20px;
|
||||
.ellipsis();
|
||||
}
|
||||
|
||||
&__file-meta {
|
||||
margin-top: 3px;
|
||||
font-size: 12px;
|
||||
color: @text-color-disabled;
|
||||
line-height: 17px;
|
||||
}
|
||||
|
||||
&__file-actions {
|
||||
.flex(row, flex-end, center);
|
||||
gap: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&__file-link {
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: @primary-strong;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: @primary-hover;
|
||||
}
|
||||
|
||||
&.is-danger {
|
||||
color: @danger-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__footer {
|
||||
.flex(row, flex-start);
|
||||
gap: @spacing-sm;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
:deep(.upload-area) {
|
||||
min-height: 56px;
|
||||
border: 1px solid @profile-input-border;
|
||||
background: @white;
|
||||
|
||||
&:hover,
|
||||
&.is-dragging {
|
||||
background: @bg-color-light;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.upload-area__hint) {
|
||||
color: @text-color-disabled;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.app-button {
|
||||
height: 32px;
|
||||
padding: 0 16px;
|
||||
border-radius: @profile-radius;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.app-button--primary {
|
||||
border-color: @primary-strong;
|
||||
&__submit {
|
||||
height: 40px;
|
||||
padding: 0 32px;
|
||||
border: none;
|
||||
border-radius: @radius-base;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: darken(@primary-strong, 6%);
|
||||
background: darken(@primary-strong, 6%);
|
||||
background: @primary-hover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +1,50 @@
|
||||
<script setup lang="ts">
|
||||
import type { HelpFaqGroup } from '@/types/business/profile'
|
||||
import { computed } from 'vue'
|
||||
import type { HelpFaqGroup, HelpFaqItem } from '@/types/business/profile'
|
||||
|
||||
interface Props {
|
||||
groups: HelpFaqGroup[]
|
||||
}
|
||||
|
||||
defineProps<Props>()
|
||||
const props = defineProps<Props>()
|
||||
|
||||
const questions = computed<HelpFaqItem[]>(() =>
|
||||
props.groups.flatMap((group) => group.items),
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="help-faq">
|
||||
<details
|
||||
v-for="group in groups"
|
||||
:key="group.title"
|
||||
class="help-faq__group"
|
||||
open
|
||||
>
|
||||
<summary class="help-faq__summary">
|
||||
{{ group.title }}
|
||||
</summary>
|
||||
<ul class="help-faq__list">
|
||||
<li
|
||||
v-for="item in group.items"
|
||||
:key="item.q"
|
||||
class="help-faq__item"
|
||||
<aside class="help-faq__aside">
|
||||
<p
|
||||
v-for="item in questions"
|
||||
:key="item.q"
|
||||
class="help-faq__q"
|
||||
>
|
||||
Q: {{ item.q }}
|
||||
</p>
|
||||
</aside>
|
||||
|
||||
<div class="help-faq__main">
|
||||
<div class="help-faq__main-inner">
|
||||
<section
|
||||
v-for="(group, gi) in groups"
|
||||
:key="group.title"
|
||||
class="help-faq__group"
|
||||
>
|
||||
<p class="help-faq__q">
|
||||
Q:{{ item.q }}
|
||||
<h3 class="help-faq__group-title">
|
||||
{{ gi + 1 }}、{{ group.title }}
|
||||
</h3>
|
||||
<p
|
||||
v-for="item in group.items"
|
||||
:key="`${group.title}-${item.q}`"
|
||||
class="help-faq__a"
|
||||
>
|
||||
{{ item.a }}
|
||||
</p>
|
||||
<p class="help-faq__a text-secondary">
|
||||
A:{{ item.a }}
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p v-if="groups.length === 0" class="help-faq__empty text-secondary">
|
||||
暂无常见问题
|
||||
@@ -43,69 +54,79 @@ defineProps<Props>()
|
||||
|
||||
<style lang="less" scoped>
|
||||
.help-faq {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-base;
|
||||
display: grid;
|
||||
grid-template-columns: max-content 1fr;
|
||||
column-gap: @spacing-xxl;
|
||||
align-items: start;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
|
||||
&__group {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&__summary {
|
||||
.flex(row, center, center);
|
||||
justify-content: center;
|
||||
padding: 0;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
user-select: none;
|
||||
|
||||
&::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: transparent;
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__list {
|
||||
.flex(column, flex-start);
|
||||
gap: 6px;
|
||||
margin: 0;
|
||||
padding: @spacing-sm 0 0;
|
||||
list-style: none;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
&__item {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-xs;
|
||||
padding-top: 0;
|
||||
&__aside {
|
||||
.flex(column, flex-start, flex-start);
|
||||
gap: @spacing-xl;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
&__q {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
margin: 0;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @heading-color;
|
||||
line-height: 1.6;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__main {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__main-inner {
|
||||
width: 100%;
|
||||
max-width: 480px;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&__group {
|
||||
.flex(column, flex-start, center);
|
||||
gap: @spacing-base;
|
||||
width: 100%;
|
||||
|
||||
& + & {
|
||||
margin-top: @spacing-xxl;
|
||||
}
|
||||
}
|
||||
|
||||
&__group-title {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @heading-color;
|
||||
line-height: 1.4;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&__a {
|
||||
font-size: 11px;
|
||||
color: @text-color;
|
||||
line-height: 1.7;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
font-size: @font-size-sm;
|
||||
line-height: 1.8;
|
||||
color: @text-color-secondary;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&__empty {
|
||||
grid-column: 1 / -1;
|
||||
padding: @spacing-xxl 0;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
font-size: @font-size-sm;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -6,77 +6,69 @@ const WORK_TIME = '工作日 8:00-12:00 14:00-18:00'
|
||||
<template>
|
||||
<div class="hotline-panel">
|
||||
<div class="hotline-panel__card">
|
||||
<span class="hotline-panel__icon" aria-hidden="true">📞</span>
|
||||
<h3 class="hotline-panel__title">
|
||||
专属客服热线
|
||||
</h3>
|
||||
<p class="hotline-panel__number">
|
||||
{{ HOTLINE }}
|
||||
</p>
|
||||
<p class="hotline-panel__time text-secondary">
|
||||
{{ WORK_TIME }}
|
||||
</p>
|
||||
<span class="hotline-panel__icon" aria-hidden="true" />
|
||||
<div class="hotline-panel__info">
|
||||
<h3 class="hotline-panel__title">
|
||||
专属客服热线
|
||||
</h3>
|
||||
<p class="hotline-panel__number">
|
||||
{{ HOTLINE }}
|
||||
</p>
|
||||
<p class="hotline-panel__time">
|
||||
{{ WORK_TIME }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.hotline-panel {
|
||||
.flex(row, flex-start);
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
|
||||
// 设计稿 #01:浅蓝横幅卡,蓝圆 + 标题/电话/时间三行左对齐
|
||||
&__card {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
grid-template-areas:
|
||||
'icon title'
|
||||
'icon number'
|
||||
'icon time';
|
||||
column-gap: @spacing-base;
|
||||
align-content: center;
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-lg;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
padding: @spacing-lg;
|
||||
border-radius: @radius-base;
|
||||
background: @profile-hotline-bg;
|
||||
text-align: left;
|
||||
align-items: center;
|
||||
background: @filter-selected-bg;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__icon {
|
||||
.flex(row, center);
|
||||
grid-area: icon;
|
||||
flex-shrink: 0;
|
||||
width: 49px;
|
||||
height: 49px;
|
||||
margin: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: @radius-round;
|
||||
background: @primary-strong;
|
||||
font-size: @font-size-lg;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
&__info {
|
||||
.flex(column, flex-start);
|
||||
}
|
||||
|
||||
&__title {
|
||||
grid-area: title;
|
||||
align-self: end;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @heading-color;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
&__number {
|
||||
grid-area: number;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
margin-top: @spacing-sm;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
color: @primary-strong;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
&__time {
|
||||
grid-area: time;
|
||||
align-self: start;
|
||||
margin-top: @spacing-xs;
|
||||
font-size: @font-size-sm;
|
||||
color: @text-color-secondary;
|
||||
font-size: 11px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -7,7 +7,7 @@ interface MenuItem {
|
||||
const menus: MenuItem[] = [
|
||||
{ to: '/profile/security', label: '账号安全' },
|
||||
{ to: '/profile/address', label: '地址管理' },
|
||||
{ to: '/profile/favorites', label: '收藏列表' },
|
||||
{ to: '/favorites', label: '收藏列表' },
|
||||
{ to: '/profile/qualifications', label: '资质列表' },
|
||||
{ to: '/profile/feedback', label: '意见反馈' },
|
||||
{ to: '/profile/help', label: '帮助中心' },
|
||||
@@ -32,29 +32,31 @@ const menus: MenuItem[] = [
|
||||
<style lang="less" scoped>
|
||||
.profile-sider {
|
||||
.flex(column, flex-start);
|
||||
gap: 0;
|
||||
padding: 4px 0;
|
||||
border-radius: @radius-lg;
|
||||
gap: 2px;
|
||||
padding: @spacing-sm 0;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
|
||||
&__item {
|
||||
.flex(row, flex-start, center);
|
||||
height: 36px;
|
||||
padding: 0 24px;
|
||||
border-radius: @profile-radius;
|
||||
height: 40px;
|
||||
margin: 0 @spacing-sm;
|
||||
padding: 0 @spacing-base;
|
||||
border-radius: @radius-sm;
|
||||
color: @text-color;
|
||||
font-size: @font-size-base;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover {
|
||||
color: @primary-strong;
|
||||
background: @bg-color-light;
|
||||
}
|
||||
|
||||
&.router-link-active {
|
||||
background: @profile-nav-active-bg;
|
||||
background: @filter-selected-bg;
|
||||
color: @primary-strong;
|
||||
font-weight: 600;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ function save(): void {
|
||||
<style lang="less" scoped>
|
||||
.profile-user-card {
|
||||
.flex(column, center, center);
|
||||
height: 110px;
|
||||
height: 146px;
|
||||
border-radius: @radius-lg;
|
||||
background: linear-gradient(180deg, @profile-user-from 0%, @profile-user-to 100%);
|
||||
box-sizing: border-box;
|
||||
@@ -69,13 +69,13 @@ function save(): void {
|
||||
|
||||
&__name {
|
||||
width: 100%;
|
||||
height: 26px;
|
||||
margin-top: 6px;
|
||||
height: 22px;
|
||||
margin-top: 8px;
|
||||
padding: 0 @spacing-xs;
|
||||
border: 1px solid transparent;
|
||||
border-radius: @profile-radius;
|
||||
background: transparent;
|
||||
font-size: @font-size-lg;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @white;
|
||||
text-align: center;
|
||||
@@ -92,14 +92,14 @@ function save(): void {
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
font-size: @font-size-lg;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 400;
|
||||
color: fade(@white, 75%);
|
||||
}
|
||||
}
|
||||
|
||||
&__phone {
|
||||
margin-top: 6px;
|
||||
margin-top: 4px;
|
||||
font-size: @font-size-sm;
|
||||
color: @white;
|
||||
text-align: center;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { StatusTag } from '@/components'
|
||||
import { EllipsisText } from '@/components'
|
||||
import type { Qualification, QualificationStatus } from '@/types/business/profile'
|
||||
|
||||
interface Props {
|
||||
@@ -14,144 +14,139 @@ const emit = defineEmits<{
|
||||
reupload: [qualification: Qualification]
|
||||
}>()
|
||||
|
||||
const STATUS_VARIANTS: Record<QualificationStatus, 'success' | 'warning' | 'danger'> = {
|
||||
已认证: 'success',
|
||||
审核中: 'warning',
|
||||
未通过: 'danger',
|
||||
const STATUS_CLASS: Record<QualificationStatus, string> = {
|
||||
已认证: 'is-certified',
|
||||
审核中: 'is-reviewing',
|
||||
未通过: 'is-rejected',
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<article class="qual-card">
|
||||
<div class="qual-card__head">
|
||||
<h3 class="qual-card__name">
|
||||
{{ qualification.certName }}
|
||||
</h3>
|
||||
<StatusTag
|
||||
:label="qualification.status"
|
||||
:variant="STATUS_VARIANTS[qualification.status]"
|
||||
<article class="qual-row">
|
||||
<div class="qual-row__col">
|
||||
<p class="qual-row__label">资质类型</p>
|
||||
<EllipsisText class="qual-row__value" :text="qualification.type" />
|
||||
</div>
|
||||
<div class="qual-row__col qual-row__col--name">
|
||||
<p class="qual-row__label">证书名称</p>
|
||||
<EllipsisText class="qual-row__value" :text="qualification.certName" />
|
||||
</div>
|
||||
<div class="qual-row__col">
|
||||
<p class="qual-row__label">证书编号</p>
|
||||
<EllipsisText class="qual-row__value" :text="qualification.certNo" />
|
||||
</div>
|
||||
<div class="qual-row__col">
|
||||
<p class="qual-row__label">发证单位</p>
|
||||
<EllipsisText class="qual-row__value" :text="qualification.issuer" />
|
||||
</div>
|
||||
<div class="qual-row__col qual-row__col--valid">
|
||||
<p class="qual-row__label">有效期</p>
|
||||
<EllipsisText
|
||||
class="qual-row__value"
|
||||
:text="qualification.validFrom + ' 至 ' + qualification.validTo"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<ul class="qual-card__meta">
|
||||
<li><span>资质类型:</span>{{ qualification.type }}</li>
|
||||
<li><span>证书编号:</span>{{ qualification.certNo }}</li>
|
||||
<li><span>发证单位:</span>{{ qualification.issuer }}</li>
|
||||
<li><span>有效期:</span>{{ qualification.validFrom }} 至 {{ qualification.validTo }}</li>
|
||||
</ul>
|
||||
|
||||
<div class="qual-card__actions">
|
||||
<button class="qual-card__btn" @click="emit('edit', qualification)">
|
||||
编辑
|
||||
</button>
|
||||
<button class="qual-card__btn qual-card__btn--danger" @click="emit('delete', qualification)">
|
||||
<div class="qual-row__col qual-row__col--status">
|
||||
<p class="qual-row__label">状态</p>
|
||||
<p class="qual-row__value qual-row__status" :class="STATUS_CLASS[qualification.status]">
|
||||
{{ qualification.status }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="qual-row__actions">
|
||||
<button type="button" class="qual-row__btn" @click="emit('delete', qualification)">
|
||||
删除
|
||||
</button>
|
||||
<button
|
||||
v-if="qualification.status === '未通过'"
|
||||
class="qual-card__btn qual-card__btn--warning"
|
||||
type="button"
|
||||
class="qual-row__btn"
|
||||
@click="emit('reupload', qualification)"
|
||||
>
|
||||
重新上传
|
||||
</button>
|
||||
<button v-else type="button" class="qual-row__btn" @click="emit('edit', qualification)">
|
||||
编辑
|
||||
</button>
|
||||
</div>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.qual-card {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-sm;
|
||||
padding: @spacing-base;
|
||||
border: 1px solid @profile-card-border;
|
||||
.qual-row {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-columns:
|
||||
minmax(72px, 0.9fr)
|
||||
minmax(100px, 1.2fr)
|
||||
minmax(100px, 1.1fr)
|
||||
minmax(100px, 1.1fr)
|
||||
minmax(140px, 1.4fr)
|
||||
minmax(64px, 0.7fr)
|
||||
auto;
|
||||
align-items: center;
|
||||
gap: @spacing-base;
|
||||
min-height: 72px;
|
||||
padding: @spacing-base @spacing-lg;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
background: @bg-color-light;
|
||||
box-sizing: border-box;
|
||||
|
||||
&__head {
|
||||
.flex(row, space-between, flex-start);
|
||||
gap: @spacing-sm;
|
||||
&__col {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__name {
|
||||
font-size: 11px;
|
||||
&__label {
|
||||
margin: 0;
|
||||
font-size: @font-size-sm;
|
||||
color: @text-color-secondary;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
&__value {
|
||||
margin-top: @spacing-xs;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @heading-color;
|
||||
.multi-ellipsis(2);
|
||||
color: @profile-ink;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
&__meta {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-xs;
|
||||
list-style: none;
|
||||
font-size: 11px;
|
||||
color: @heading-color;
|
||||
|
||||
li {
|
||||
.ellipsis();
|
||||
font-weight: 600;
|
||||
&__status {
|
||||
&.is-reviewing {
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
span {
|
||||
color: @text-color-secondary;
|
||||
font-weight: 400;
|
||||
&.is-certified {
|
||||
color: @success-color;
|
||||
}
|
||||
|
||||
&.is-rejected {
|
||||
color: @danger-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__actions {
|
||||
.flex(row, center);
|
||||
.flex(row, flex-end, center);
|
||||
flex-wrap: wrap;
|
||||
gap: @spacing-sm;
|
||||
margin-top: auto;
|
||||
padding-top: @spacing-sm;
|
||||
border-top: 1px solid @profile-card-border;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__btn {
|
||||
height: 24px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid @profile-line;
|
||||
border-radius: @profile-radius;
|
||||
height: 28px;
|
||||
padding: 0 @spacing-sm;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-round;
|
||||
background: @white;
|
||||
color: @text-color;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
font-size: @font-size-sm;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: @primary-strong;
|
||||
color: @primary-strong;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&--danger {
|
||||
color: @text-color;
|
||||
}
|
||||
|
||||
&--warning {
|
||||
color: @text-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.qual-card .status-tag {
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
|
||||
&--success {
|
||||
background: transparent;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&--warning {
|
||||
background: transparent;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&--danger {
|
||||
background: transparent;
|
||||
color: @danger-color;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import type { Profile } from '@/types/business/profile'
|
||||
|
||||
interface Props {
|
||||
@@ -8,57 +9,89 @@ interface Props {
|
||||
|
||||
const props = defineProps<Props>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
changePassword: []
|
||||
bindPhone: []
|
||||
bindEmail: [mode: 'email-bind' | 'email-rebind']
|
||||
unbindEmail: []
|
||||
deleteAccount: []
|
||||
}>()
|
||||
const router = useRouter()
|
||||
|
||||
const hasEmail = computed(() => Boolean(props.profile?.email))
|
||||
|
||||
function goChangePassword(): void {
|
||||
void router.push('/profile/security/change-password')
|
||||
}
|
||||
|
||||
function goBindPhone(): void {
|
||||
void router.push('/profile/security/bind-phone')
|
||||
}
|
||||
|
||||
function goBindEmail(): void {
|
||||
void router.push('/profile/security/bind-email')
|
||||
}
|
||||
|
||||
function goDeleteAccount(): void {
|
||||
void router.push('/profile/security/delete-account')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="security-panel">
|
||||
<h2 class="security-panel__title">
|
||||
账号安全
|
||||
</h2>
|
||||
|
||||
<section
|
||||
class="security-panel__row"
|
||||
@click="emit('changePassword')"
|
||||
@click="goChangePassword"
|
||||
>
|
||||
<span class="security-panel__icon security-panel__icon--pwd" aria-hidden="true">
|
||||
<svg viewBox="0 0 16 16" width="18" height="18">
|
||||
<path d="M5 7V5a3 3 0 0 1 6 0v2" fill="none" stroke="#fff" stroke-width="1.5" />
|
||||
<rect x="3.5" y="7" width="9" height="6.5" rx="1.5" fill="#fff" />
|
||||
</svg>
|
||||
</span>
|
||||
<div class="security-panel__main">
|
||||
<h3 class="security-panel__title">
|
||||
<h3 class="security-panel__name">
|
||||
修改密码
|
||||
</h3>
|
||||
<p class="security-panel__sub">
|
||||
上次修改:{{ profile?.passwordModifiedAt }}
|
||||
</p>
|
||||
</div>
|
||||
<span class="security-panel__state security-panel__state--ok">已设置</span>
|
||||
<span class="security-panel__state">已设置</span>
|
||||
<span class="security-panel__arrow" aria-hidden="true">›</span>
|
||||
</section>
|
||||
|
||||
<section
|
||||
class="security-panel__row"
|
||||
@click="emit('bindPhone')"
|
||||
@click="goBindPhone"
|
||||
>
|
||||
<span class="security-panel__icon security-panel__icon--phone" aria-hidden="true">
|
||||
<svg viewBox="0 0 16 16" width="18" height="18">
|
||||
<rect x="4.5" y="1.5" width="7" height="13" rx="1.5" fill="none" stroke="#fff" stroke-width="1.5" />
|
||||
<line x1="7" y1="12.2" x2="9" y2="12.2" stroke="#fff" stroke-width="1.2" />
|
||||
</svg>
|
||||
</span>
|
||||
<div class="security-panel__main">
|
||||
<h3 class="security-panel__title">
|
||||
<h3 class="security-panel__name">
|
||||
绑定手机
|
||||
</h3>
|
||||
<p class="security-panel__sub">
|
||||
{{ profile?.phone ?? '' }}
|
||||
</p>
|
||||
</div>
|
||||
<span class="security-panel__state security-panel__state--ok">已绑定</span>
|
||||
<span class="security-panel__state">已绑定</span>
|
||||
<span class="security-panel__arrow" aria-hidden="true">›</span>
|
||||
</section>
|
||||
|
||||
<section
|
||||
class="security-panel__row"
|
||||
@click="emit('bindEmail', hasEmail ? 'email-rebind' : 'email-bind')"
|
||||
@click="goBindEmail"
|
||||
>
|
||||
<span class="security-panel__icon security-panel__icon--email" aria-hidden="true">
|
||||
<svg viewBox="0 0 16 16" width="18" height="18">
|
||||
<rect x="1.5" y="3.5" width="13" height="9" rx="1.5" fill="none" stroke="#fff" stroke-width="1.5" />
|
||||
<path d="M2 4.5 8 9l6-4.5" fill="none" stroke="#fff" stroke-width="1.5" />
|
||||
</svg>
|
||||
</span>
|
||||
<div class="security-panel__main">
|
||||
<h3 class="security-panel__title">
|
||||
<h3 class="security-panel__name">
|
||||
绑定邮箱
|
||||
</h3>
|
||||
<p class="security-panel__sub">
|
||||
@@ -67,7 +100,7 @@ const hasEmail = computed(() => Boolean(props.profile?.email))
|
||||
</div>
|
||||
<span
|
||||
class="security-panel__state"
|
||||
:class="{ 'security-panel__state--ok': hasEmail }"
|
||||
:class="{ 'security-panel__state--idle': !hasEmail }"
|
||||
>{{ hasEmail ? '已绑定' : '未绑定' }}</span>
|
||||
<span class="security-panel__arrow" aria-hidden="true">›</span>
|
||||
</section>
|
||||
@@ -75,7 +108,7 @@ const hasEmail = computed(() => Boolean(props.profile?.email))
|
||||
<button
|
||||
type="button"
|
||||
class="security-panel__delete"
|
||||
@click="emit('deleteAccount')"
|
||||
@click="goDeleteAccount"
|
||||
>
|
||||
注销账号
|
||||
</button>
|
||||
@@ -85,21 +118,67 @@ const hasEmail = computed(() => Boolean(props.profile?.email))
|
||||
<style lang="less" scoped>
|
||||
.security-panel {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: @spacing-base;
|
||||
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: @spacing-base;
|
||||
margin-bottom: @spacing-base;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @profile-ink;
|
||||
line-height: 1.4;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
border-radius: 2px;
|
||||
background: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__row {
|
||||
.flex(row, space-between, center);
|
||||
height: 86px;
|
||||
padding: 0 24px;
|
||||
border: 1px solid @profile-card-border;
|
||||
.flex(row, flex-start, center);
|
||||
min-height: 72px;
|
||||
padding: 0 @spacing-lg;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
background: @bg-color-light;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.2s;
|
||||
transition: border-color 0.2s, background-color 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: @profile-line;
|
||||
border-color: @primary-color;
|
||||
background: @filter-selected-bg;
|
||||
}
|
||||
}
|
||||
|
||||
&__row + &__row {
|
||||
margin-top: @spacing-base;
|
||||
}
|
||||
|
||||
&__icon {
|
||||
.flex(row, center);
|
||||
flex-shrink: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-right: 12px;
|
||||
border-radius: @radius-base;
|
||||
|
||||
&--pwd {
|
||||
background: @profile-icon-pwd;
|
||||
}
|
||||
|
||||
&--phone {
|
||||
background: @profile-icon-phone;
|
||||
}
|
||||
|
||||
&--email {
|
||||
background: @profile-icon-email;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,41 +186,52 @@ const hasEmail = computed(() => Boolean(props.profile?.email))
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__title {
|
||||
&__name {
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @profile-ink;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
&__sub {
|
||||
margin-top: 6px;
|
||||
margin-top: 4px;
|
||||
font-size: @font-size-sm;
|
||||
color: @finance-axis-text; // #9CA3AF
|
||||
color: @finance-axis-text;
|
||||
line-height: 16px;
|
||||
.ellipsis();
|
||||
}
|
||||
|
||||
&__state {
|
||||
flex-shrink: 0;
|
||||
margin-left: auto;
|
||||
height: 22px;
|
||||
padding: 0 8px;
|
||||
border-radius: @radius-round;
|
||||
background: @profile-tag-ok-bg;
|
||||
color: @success-color;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
color: @finance-muted-text;
|
||||
line-height: 22px;
|
||||
|
||||
&--ok {
|
||||
color: @success-color;
|
||||
&--idle {
|
||||
background: @profile-quiet-btn;
|
||||
color: @finance-axis-text;
|
||||
}
|
||||
}
|
||||
|
||||
&__arrow {
|
||||
flex-shrink: 0;
|
||||
margin-left: 20px;
|
||||
font-size: 21px;
|
||||
font-size: 18px;
|
||||
line-height: 1;
|
||||
color: @finance-axis-text;
|
||||
}
|
||||
|
||||
&__delete {
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
border: 1px solid @profile-line;
|
||||
border-radius: @radius-base;
|
||||
height: 40px;
|
||||
margin-top: @spacing-xxl;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-round;
|
||||
background: @white;
|
||||
color: @finance-axis-text;
|
||||
font-size: @font-size-base;
|
||||
|
||||
590
src/views/profile/delete-account.vue
Normal file
590
src/views/profile/delete-account.vue
Normal file
@@ -0,0 +1,590 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useProfileStore } from '@/stores/modules/profile'
|
||||
import { useCountDown } from '@/composables/useCountDown'
|
||||
|
||||
const router = useRouter()
|
||||
const profileStore = useProfileStore()
|
||||
const { profile } = storeToRefs(profileStore)
|
||||
|
||||
type DeleteStep = 'confirm' | 'verify'
|
||||
const step = ref<DeleteStep>('confirm')
|
||||
|
||||
const agree = ref(false)
|
||||
|
||||
const conditions = [
|
||||
{ label: '账号无未完成的订单', ok: true },
|
||||
{ label: '账号无未结清的款项', ok: false },
|
||||
{ label: '账号无进行中的合同', ok: true },
|
||||
{ label: '账号无处理中的工单', ok: true },
|
||||
]
|
||||
|
||||
const risks = [
|
||||
'账号注销后,您将无法登录本应用,所有个人信息将被永久删除。',
|
||||
'您名下的订单、合同、工单等业务数据将一并清除,无法找回。',
|
||||
'注销后,同一手机号/邮箱将无法再次注册本应用。',
|
||||
'如有未完成的订单或服务,请先处理完毕后再进行注销。',
|
||||
]
|
||||
|
||||
function onConfirm(): void {
|
||||
if (!agree.value) {
|
||||
ElMessage.warning('请先阅读并同意《账号注销协议》')
|
||||
return
|
||||
}
|
||||
step.value = 'verify'
|
||||
}
|
||||
|
||||
function onCancel(): void {
|
||||
void router.push('/profile/security')
|
||||
}
|
||||
|
||||
// 第二步:身份验证
|
||||
const code = ref('')
|
||||
const codeInputRef = ref<HTMLInputElement | null>(null)
|
||||
|
||||
const codeDigits = computed<string[]>(() => {
|
||||
const chars = code.value.split('')
|
||||
return Array.from({ length: 6 }, (_, i) => chars[i] ?? '')
|
||||
})
|
||||
|
||||
const maskedPhone = computed(() => {
|
||||
const phone = profile.value?.phone ?? ''
|
||||
if (phone.length < 7) return phone
|
||||
return `${phone.slice(0, 3)}****${phone.slice(-4)}`
|
||||
})
|
||||
|
||||
const { seconds, isCounting, start } = useCountDown(60)
|
||||
|
||||
function onGetCode(): void {
|
||||
if (isCounting.value) return
|
||||
start(60)
|
||||
ElMessage.success('验证码已发送')
|
||||
}
|
||||
|
||||
function focusCode(): void {
|
||||
codeInputRef.value?.focus()
|
||||
}
|
||||
|
||||
function onCodeInput(event: Event): void {
|
||||
const value = (event.target as HTMLInputElement).value.replace(/\D/g, '').slice(0, 6)
|
||||
code.value = value
|
||||
}
|
||||
|
||||
function onDeleteAccount(): void {
|
||||
if (code.value.length !== 6) {
|
||||
ElMessage.warning('请输入 6 位验证码')
|
||||
return
|
||||
}
|
||||
void (async () => {
|
||||
await profileStore.verifyIdentity(profile.value?.phone ?? '', code.value)
|
||||
await profileStore.deleteAccount()
|
||||
void router.push('/login')
|
||||
})()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="delete-page">
|
||||
<h2 class="delete-page__title">
|
||||
注销账号
|
||||
</h2>
|
||||
|
||||
<!-- 第一步:注销确认(设计稿 #08) -->
|
||||
<div v-if="step === 'confirm'" class="delete-page__confirm">
|
||||
<span class="delete-page__icon" aria-hidden="true">i</span>
|
||||
<h3 class="delete-page__question">确定要注销账号吗?</h3>
|
||||
|
||||
<h4 class="delete-page__section-title delete-page__section-title--risk">
|
||||
⚠ 注销风险提示
|
||||
</h4>
|
||||
<ul class="delete-page__risks">
|
||||
<li v-for="(item, index) in risks" :key="item">
|
||||
{{ index + 1 }}、{{ item }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h4 class="delete-page__section-title delete-page__section-title--ok">
|
||||
✓ 注销条件
|
||||
</h4>
|
||||
<ul class="delete-page__conditions">
|
||||
<li v-for="item in conditions" :key="item.label" class="delete-page__condition">
|
||||
<span>{{ item.label }}</span>
|
||||
<span
|
||||
class="delete-page__mark"
|
||||
:class="item.ok ? 'is-ok' : 'is-fail'"
|
||||
>{{ item.ok ? '✓' : '✕' }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<label class="delete-page__agree">
|
||||
<input v-model="agree" type="checkbox">
|
||||
<span>已阅读并同意<em>《账号注销协议》</em></span>
|
||||
</label>
|
||||
|
||||
<div class="delete-page__buttons">
|
||||
<button type="button" class="delete-page__btn delete-page__btn--quiet" @click="onConfirm">
|
||||
注销账号
|
||||
</button>
|
||||
<button type="button" class="delete-page__btn delete-page__btn--danger" @click="onCancel">
|
||||
暂不注销
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 第二步:安全身份验证(设计稿 #41) -->
|
||||
<div v-else class="delete-page__verify">
|
||||
<div class="delete-page__banner">
|
||||
<span class="delete-page__banner-icon" aria-hidden="true">
|
||||
<svg viewBox="0 0 16 16" width="16" height="16">
|
||||
<rect x="4.5" y="1.5" width="7" height="13" rx="1.5" fill="none" stroke="#fff" stroke-width="1.5" />
|
||||
<line x1="7" y1="12.2" x2="9" y2="12.2" stroke="#fff" stroke-width="1.2" />
|
||||
</svg>
|
||||
</span>
|
||||
<div>
|
||||
<h3 class="delete-page__banner-title">安全身份验证</h3>
|
||||
<p class="delete-page__banner-desc">为保障账号安全,需先完成身份验证后再进行注销</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="delete-page__verify-card">
|
||||
<div class="delete-page__verify-head">
|
||||
<span class="delete-page__verify-avatar" aria-hidden="true">
|
||||
<svg viewBox="0 0 16 16" width="16" height="16">
|
||||
<circle cx="8" cy="5.5" r="2.8" fill="#fff" />
|
||||
<path d="M2.5 14a5.5 5.5 0 0 1 11 0Z" fill="#fff" />
|
||||
</svg>
|
||||
</span>
|
||||
<div class="delete-page__verify-info">
|
||||
<h3 class="delete-page__verify-name">手机验证码</h3>
|
||||
<p class="delete-page__verify-sub">发送验证码至{{ maskedPhone }}</p>
|
||||
</div>
|
||||
<span class="delete-page__verify-tag">默认</span>
|
||||
<span class="delete-page__radio" aria-hidden="true" />
|
||||
</div>
|
||||
|
||||
<div class="delete-page__code-row">
|
||||
<input
|
||||
class="delete-page__code-input"
|
||||
type="text"
|
||||
placeholder="请输入验证码"
|
||||
maxlength="6"
|
||||
@input="onCodeInput"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="delete-page__get-code"
|
||||
:disabled="isCounting"
|
||||
@click="onGetCode"
|
||||
>
|
||||
{{ isCounting ? `${seconds}秒后重获` : '获取验证码' }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="delete-page__boxes"
|
||||
@click="focusCode"
|
||||
>
|
||||
<span
|
||||
v-for="(digit, index) in codeDigits"
|
||||
:key="index"
|
||||
class="delete-page__box"
|
||||
:class="{ 'is-filled': Boolean(digit) }"
|
||||
>{{ digit }}</span>
|
||||
<input
|
||||
ref="codeInputRef"
|
||||
class="delete-page__ghost-input"
|
||||
type="text"
|
||||
inputmode="numeric"
|
||||
maxlength="6"
|
||||
:value="code"
|
||||
@input="onCodeInput"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" class="delete-page__submit" @click="onDeleteAccount">
|
||||
注销账号
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.delete-page {
|
||||
.flex(column, flex-start, stretch);
|
||||
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 14px;
|
||||
margin-bottom: 24px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @profile-ink;
|
||||
line-height: 20px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
border-radius: 2px;
|
||||
background: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- 第一步:确认 ----------
|
||||
&__confirm {
|
||||
width: 760px;
|
||||
max-width: 100%;
|
||||
margin: 0 auto;
|
||||
.flex(column, flex-start, stretch);
|
||||
}
|
||||
|
||||
&__icon {
|
||||
.flex(row, center);
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin: 52px auto 0;
|
||||
border: 2px solid @danger-color;
|
||||
border-radius: @radius-round;
|
||||
color: @danger-color;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 700;
|
||||
font-style: italic;
|
||||
line-height: 1;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__question {
|
||||
margin-top: 36px;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: @profile-ink;
|
||||
text-align: center;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
&__section-title {
|
||||
margin-top: 18px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
line-height: 16px;
|
||||
|
||||
&--risk {
|
||||
margin-top: 18px;
|
||||
color: @danger-color;
|
||||
}
|
||||
|
||||
&--ok {
|
||||
margin-top: 27px;
|
||||
color: @success-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__risks {
|
||||
margin: 9px 0 0;
|
||||
padding: 0;
|
||||
.flex(column, flex-start);
|
||||
gap: 8px;
|
||||
list-style: none;
|
||||
font-size: 13px;
|
||||
color: @finance-entry-text;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
&__conditions {
|
||||
margin: 18px 0 0;
|
||||
padding: 0;
|
||||
.flex(column, flex-start);
|
||||
gap: 8px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
&__condition {
|
||||
.flex(row, space-between, center);
|
||||
height: 24px;
|
||||
font-size: 13px;
|
||||
color: @finance-entry-text;
|
||||
}
|
||||
|
||||
&__mark {
|
||||
.flex(row, center);
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: @radius-round;
|
||||
color: @white;
|
||||
font-size: 10px;
|
||||
line-height: 1;
|
||||
|
||||
&.is-ok {
|
||||
background: @success-color;
|
||||
}
|
||||
|
||||
&.is-fail {
|
||||
background: @danger-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__agree {
|
||||
.flex(row, flex-start, center);
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
margin-top: 30px;
|
||||
font-size: @font-size-sm;
|
||||
color: @finance-muted-text;
|
||||
cursor: pointer;
|
||||
|
||||
input {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
accent-color: @primary-strong;
|
||||
}
|
||||
|
||||
em {
|
||||
font-style: normal;
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__buttons {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 12px;
|
||||
margin-top: 19px;
|
||||
}
|
||||
|
||||
&__btn {
|
||||
height: 46px;
|
||||
border: none;
|
||||
border-radius: @profile-radius;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
|
||||
&--quiet {
|
||||
background: @profile-quiet-btn;
|
||||
color: @finance-muted-text;
|
||||
|
||||
&:hover {
|
||||
background: darken(@profile-quiet-btn, 4%);
|
||||
}
|
||||
}
|
||||
|
||||
&--danger {
|
||||
background: @danger-color;
|
||||
color: @white;
|
||||
|
||||
&:hover {
|
||||
background: darken(@danger-color, 6%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- 第二步:身份验证 ----------
|
||||
&__verify {
|
||||
width: 860px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
&__banner {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 14px;
|
||||
height: 75px;
|
||||
margin-top: 24px;
|
||||
padding: 0 22px;
|
||||
border-radius: @radius-base;
|
||||
background: @profile-verify-banner-bg;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__banner-icon {
|
||||
.flex(row, center);
|
||||
flex-shrink: 0;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: @radius-round;
|
||||
background: @primary-strong;
|
||||
}
|
||||
|
||||
&__banner-title {
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @profile-ink;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
&__banner-desc {
|
||||
margin-top: 3px;
|
||||
font-size: @font-size-sm;
|
||||
color: @finance-muted-text;
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
&__verify-card {
|
||||
position: relative;
|
||||
margin-top: 19px;
|
||||
padding: 20px 22px 22px;
|
||||
border: 1px solid @primary-strong;
|
||||
border-radius: @radius-base;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__verify-head {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
&__verify-avatar {
|
||||
.flex(row, center);
|
||||
flex-shrink: 0;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: @radius-round;
|
||||
background: @profile-nav-active-bg;
|
||||
}
|
||||
|
||||
&__verify-name {
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @profile-ink;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
&__verify-sub {
|
||||
margin-top: 3px;
|
||||
font-size: @font-size-sm;
|
||||
color: @finance-axis-text;
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
&__verify-tag {
|
||||
margin-left: auto;
|
||||
font-size: @font-size-sm;
|
||||
color: @finance-muted-text;
|
||||
}
|
||||
|
||||
&__radio {
|
||||
flex-shrink: 0;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-left: 10px;
|
||||
border: 4px solid @primary-strong;
|
||||
border-radius: @radius-round;
|
||||
background: @white;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__code-row {
|
||||
position: relative;
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
&__code-input {
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
padding: 0 124px 0 14px;
|
||||
border: 1px solid @profile-input-border;
|
||||
border-radius: @profile-radius;
|
||||
background: @white;
|
||||
font-size: 13px;
|
||||
color: @profile-ink;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
border-color: @primary-strong;
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: @finance-axis-text;
|
||||
}
|
||||
}
|
||||
|
||||
&__get-code {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 4px;
|
||||
width: 107px;
|
||||
height: 30px;
|
||||
border: 1px solid @primary-strong;
|
||||
border-radius: @profile-radius;
|
||||
background: @white;
|
||||
color: @primary-strong;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
border-color: @text-color-disabled;
|
||||
color: @text-color-disabled;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
&__boxes {
|
||||
position: relative;
|
||||
display: flex;
|
||||
gap: 13px;
|
||||
margin-top: 16px;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
&__box {
|
||||
.flex(row, center);
|
||||
width: 46px;
|
||||
height: 47px;
|
||||
border: 1px solid @profile-input-border;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: @primary-strong;
|
||||
|
||||
&.is-filled {
|
||||
border-color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__ghost-input {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: transparent;
|
||||
caret-color: @primary-strong;
|
||||
font-size: 18px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
&__submit {
|
||||
width: 100%;
|
||||
height: 46px;
|
||||
margin-top: 21px;
|
||||
border: none;
|
||||
border-radius: @profile-radius;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: darken(@primary-strong, 6%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,54 +1,40 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { onMounted } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { FilterPanel, PaginationBar } from '@/components'
|
||||
import type { BusinessType } from '@/types/api'
|
||||
import { useProfileStore } from '@/stores/modules/profile'
|
||||
import FavoritesGrid from './cpns/FavoritesGrid.vue'
|
||||
|
||||
interface CategoryOption {
|
||||
key: BusinessType | 'all'
|
||||
label: string
|
||||
}
|
||||
|
||||
const CATEGORY_OPTIONS: CategoryOption[] = [
|
||||
{ key: 'all', label: '全部' },
|
||||
{ key: 'internet', label: '互联网软件' },
|
||||
{ key: 'hardware', label: '硬件电路' },
|
||||
{ key: 'iot', label: '物联网全案' },
|
||||
{ key: 'manufacturing', label: '生产制造' },
|
||||
]
|
||||
import { CasesFilter, CasesGrid, CasesSearchBar, PaginationBar } from '@/components'
|
||||
import { useCasesStore } from '@/stores/modules/cases'
|
||||
import type { CaseQuery } from '@/types/business/cases'
|
||||
|
||||
const router = useRouter()
|
||||
const profileStore = useProfileStore()
|
||||
const { favorites, favoritesTotal, favoritesCounts, favoritesQuery } = storeToRefs(profileStore)
|
||||
const casesStore = useCasesStore()
|
||||
const { query, list, total, previewTotal, typeOptions, industryOptions, scaleOptions, caseTotal }
|
||||
= storeToRefs(casesStore)
|
||||
|
||||
const keyword = ref('')
|
||||
const category = ref<BusinessType | 'all'>('all')
|
||||
function onUpdateQuery(next: CaseQuery): void {
|
||||
casesStore.setQuery(next)
|
||||
}
|
||||
|
||||
function countOf(key: BusinessType | 'all'): number {
|
||||
if (key === 'all') return favoritesTotal.value
|
||||
return favoritesCounts.value[key] ?? 0
|
||||
function onUpdateKeyword(keyword: string): void {
|
||||
casesStore.setQuery({ ...query.value, keyword })
|
||||
}
|
||||
|
||||
function onSearch(): void {
|
||||
void profileStore.searchFavorites({ keyword: keyword.value, category: category.value })
|
||||
void casesStore.search()
|
||||
}
|
||||
|
||||
function onReset(): void {
|
||||
keyword.value = ''
|
||||
category.value = 'all'
|
||||
void profileStore.resetFavorites()
|
||||
void casesStore.resetQuery()
|
||||
}
|
||||
|
||||
function onSelectCategory(key: BusinessType | 'all'): void {
|
||||
category.value = key
|
||||
void profileStore.searchFavorites({ keyword: keyword.value, category: key })
|
||||
async function onFavorite(id: string): Promise<void> {
|
||||
await casesStore.toggleFavorite(id)
|
||||
// 收藏页取消收藏后,立即按 favoriteOnly 重新拉取,让卡片消失
|
||||
await casesStore.fetchCases()
|
||||
}
|
||||
|
||||
function onPageChange(page: number): void {
|
||||
void profileStore.changeFavoritesPage(page)
|
||||
void casesStore.changePage(page)
|
||||
}
|
||||
|
||||
function onViewDetail(id: string): void {
|
||||
@@ -56,90 +42,78 @@ function onViewDetail(id: string): void {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
keyword.value = favoritesQuery.value.keyword
|
||||
category.value = favoritesQuery.value.category
|
||||
void Promise.all([profileStore.fetchFavorites(), profileStore.fetchFavoritesCounts()])
|
||||
// 复用案例库 store,强制只看收藏;case 库进入时会 resetQuery 清除该态,互不污染
|
||||
casesStore.setQuery({ ...casesStore.query, favoriteOnly: true, page: 1 })
|
||||
void Promise.all([casesStore.fetchCategories(), casesStore.fetchCases()])
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="favorites-page">
|
||||
<FilterPanel
|
||||
v-model:keyword="keyword"
|
||||
keyword-placeholder="搜索收藏案例标题"
|
||||
@search="onSearch"
|
||||
@reset="onReset"
|
||||
/>
|
||||
<div class="favorites">
|
||||
<div class="container favorites__body">
|
||||
<CasesFilter
|
||||
:query="query"
|
||||
:type-options="typeOptions"
|
||||
:industry-options="industryOptions"
|
||||
:scale-options="scaleOptions"
|
||||
:case-total="caseTotal"
|
||||
:preview-total="previewTotal"
|
||||
@update:query="onUpdateQuery"
|
||||
@search="onSearch"
|
||||
@reset="onReset"
|
||||
/>
|
||||
|
||||
<div class="favorites-page__categories">
|
||||
<button
|
||||
v-for="item in CATEGORY_OPTIONS"
|
||||
:key="item.key"
|
||||
class="favorites-page__cat"
|
||||
:class="{ 'is-active': category === item.key }"
|
||||
@click="onSelectCategory(item.key)"
|
||||
>
|
||||
{{ item.label }}({{ countOf(item.key) }})
|
||||
</button>
|
||||
<div class="favorites__main">
|
||||
<CasesSearchBar
|
||||
:keyword="query.keyword"
|
||||
:favorite-only="query.favoriteOnly"
|
||||
:show-favorite-toggle="false"
|
||||
@update:keyword="onUpdateKeyword"
|
||||
@search="onSearch"
|
||||
@reset="onReset"
|
||||
/>
|
||||
|
||||
<CasesGrid
|
||||
:cases="list"
|
||||
:total="total"
|
||||
@view="onViewDetail"
|
||||
@favorite="onFavorite"
|
||||
/>
|
||||
|
||||
<div class="favorites__pager">
|
||||
<PaginationBar
|
||||
:page="query.page"
|
||||
:page-size="query.pageSize"
|
||||
:total="total"
|
||||
@page-change="onPageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<FavoritesGrid :cases="favorites" @view="onViewDetail" />
|
||||
|
||||
<PaginationBar
|
||||
:page="favoritesQuery.page"
|
||||
:page-size="favoritesQuery.pageSize"
|
||||
:total="favoritesTotal"
|
||||
@page-change="onPageChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.favorites-page {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-base;
|
||||
width: 100%;
|
||||
.favorites {
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__categories {
|
||||
.flex(row, flex-start);
|
||||
flex-wrap: wrap;
|
||||
gap: @spacing-sm;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
&__body {
|
||||
.flex(row, flex-start, flex-start);
|
||||
gap: @spacing-lg;
|
||||
padding-top: @spacing-lg;
|
||||
}
|
||||
|
||||
&__cat {
|
||||
height: 28px;
|
||||
padding: 0 @spacing-base;
|
||||
border: 1px solid @profile-line;
|
||||
border-radius: @radius-round;
|
||||
background: @white;
|
||||
color: @text-color;
|
||||
font-size: 11px;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: @primary-strong;
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
border-color: @primary-strong;
|
||||
background: @profile-nav-active-bg;
|
||||
color: @primary-strong;
|
||||
font-weight: 600;
|
||||
}
|
||||
&__main {
|
||||
.flex(column, flex-start, stretch);
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
gap: @spacing-lg;
|
||||
}
|
||||
|
||||
:deep(.pagination) {
|
||||
justify-content: flex-end;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
:deep(.pagination__btn.is-active) {
|
||||
border-color: @profile-page-active-bg;
|
||||
background: @profile-page-active-bg;
|
||||
color: @primary-strong;
|
||||
&__pager {
|
||||
.flex(row, flex-end);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -13,24 +13,12 @@ const ossStore = useOssStore()
|
||||
const resetSignal = ref(0)
|
||||
|
||||
function onSubmit(feedback: Feedback): void {
|
||||
if (!feedback.title.trim()) {
|
||||
ElMessage.warning('请填写反馈标题')
|
||||
return
|
||||
}
|
||||
if (!feedback.description.trim()) {
|
||||
ElMessage.warning('请填写详细描述')
|
||||
return
|
||||
}
|
||||
void profileStore.submitFeedback(feedback).then(() => {
|
||||
ElMessage.success('提交成功')
|
||||
resetSignal.value += 1
|
||||
})
|
||||
}
|
||||
|
||||
function onReset(): void {
|
||||
resetSignal.value += 1
|
||||
}
|
||||
|
||||
function onPreview(file: FileInfo): void {
|
||||
ossStore.openPreview(file)
|
||||
}
|
||||
@@ -42,15 +30,11 @@ function onPreview(file: FileInfo): void {
|
||||
<h2 class="feedback-page__title">
|
||||
意见反馈
|
||||
</h2>
|
||||
<p class="feedback-page__sub text-secondary">
|
||||
您的每一条建议都是我们前进的动力
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<FeedbackForm
|
||||
:reset-signal="resetSignal"
|
||||
@submit="onSubmit"
|
||||
@reset="onReset"
|
||||
@preview="onPreview"
|
||||
/>
|
||||
</div>
|
||||
@@ -63,8 +47,6 @@ function onPreview(file: FileInfo): void {
|
||||
width: 100%;
|
||||
|
||||
&__head {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-xs;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
}
|
||||
@@ -72,7 +54,7 @@ function onPreview(file: FileInfo): void {
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 12px;
|
||||
font-size: 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
line-height: 20px;
|
||||
@@ -82,15 +64,11 @@ function onPreview(file: FileInfo): void {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 3px;
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
border-radius: 2px;
|
||||
background: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__sub {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -18,9 +18,6 @@ onMounted(() => {
|
||||
<h2 class="help-page__title">
|
||||
帮助中心
|
||||
</h2>
|
||||
<p class="help-page__sub text-secondary">
|
||||
常见问题与使用指南,帮您快速上手平台
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<HelpFaq :groups="helpFaqs" />
|
||||
@@ -34,34 +31,28 @@ onMounted(() => {
|
||||
width: 100%;
|
||||
|
||||
&__head {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-xs;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 12px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
line-height: 20px;
|
||||
padding-left: 14px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @profile-ink;
|
||||
line-height: 1.4;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 3px;
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
border-radius: 2px;
|
||||
background: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__sub {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -4,12 +4,45 @@ import HotlinePanel from './cpns/HotlinePanel.vue'
|
||||
|
||||
<template>
|
||||
<div class="hotline-page">
|
||||
<header class="hotline-page__head">
|
||||
<h2 class="hotline-page__title">
|
||||
专属客服热线
|
||||
</h2>
|
||||
</header>
|
||||
|
||||
<HotlinePanel />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.hotline-page {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-base;
|
||||
width: 100%;
|
||||
|
||||
&__head {
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
line-height: 20px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
border-radius: 2px;
|
||||
background: @primary-strong;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,10 +2,7 @@ export { default } from './index.vue'
|
||||
export { default as ProfileSider } from './cpns/ProfileSider.vue'
|
||||
export { default as ProfileUserCard } from './cpns/ProfileUserCard.vue'
|
||||
export { default as SecurityPanel } from './cpns/SecurityPanel.vue'
|
||||
export { default as ChangePasswordDialog } from './cpns/ChangePasswordDialog.vue'
|
||||
export { default as BindContactDialog } from './cpns/BindContactDialog.vue'
|
||||
export { default as AddressDialog } from './cpns/AddressDialog.vue'
|
||||
export { default as FavoritesGrid } from './cpns/FavoritesGrid.vue'
|
||||
export { default as QualificationCard } from './cpns/QualificationCard.vue'
|
||||
export { default as QualificationDialog } from './cpns/QualificationDialog.vue'
|
||||
export { default as FeedbackForm } from './cpns/FeedbackForm.vue'
|
||||
|
||||
@@ -36,36 +36,34 @@ onMounted(() => {
|
||||
|
||||
<style lang="less" scoped>
|
||||
.profile {
|
||||
min-height: 737px;
|
||||
background: @profile-page-bg;
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @bg-color;
|
||||
|
||||
&__container {
|
||||
padding-top: 26px;
|
||||
padding-left: clamp(@spacing-base, calc((100% - @profile-content) / 2), @profile-gutter);
|
||||
padding-right: clamp(@spacing-base, calc((100% - @profile-content) / 2), @profile-gutter);
|
||||
padding-top: @spacing-lg;
|
||||
}
|
||||
|
||||
&__body {
|
||||
.flex(row, flex-start, stretch);
|
||||
gap: @spacing-lg;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__aside {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 6px;
|
||||
gap: @spacing-base;
|
||||
flex: 0 0 200px;
|
||||
width: 200px;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
&__main {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
min-height: 425px;
|
||||
margin-left: 40px;
|
||||
padding: 24px 24px 0;
|
||||
border: 1px solid @profile-card-border;
|
||||
border-radius: @radius-lg;
|
||||
min-height: 480px;
|
||||
margin-left: 0;
|
||||
padding: @spacing-lg @spacing-xl;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { AppButton, ConfirmDialog, PaginationBar } from '@/components'
|
||||
import { ConfirmDialog, PaginationBar } from '@/components'
|
||||
import { useProfileStore } from '@/stores/modules/profile'
|
||||
import type { Qualification, QualificationInput } from '@/types/business/profile'
|
||||
import QualificationCard from './cpns/QualificationCard.vue'
|
||||
@@ -64,11 +64,11 @@ onMounted(() => {
|
||||
<div class="qual-page">
|
||||
<header class="qual-page__head">
|
||||
<h2 class="qual-page__title">
|
||||
资质管理
|
||||
资质列表
|
||||
</h2>
|
||||
<AppButton type="primary" @click="onCreate">
|
||||
+新增资质
|
||||
</AppButton>
|
||||
<button type="button" class="qual-page__create" @click="onCreate">
|
||||
+ 新增资质
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<div class="qual-page__grid">
|
||||
@@ -114,21 +114,20 @@ onMounted(() => {
|
||||
<style lang="less" scoped>
|
||||
.qual-page {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-base;
|
||||
gap: 20px;
|
||||
width: 100%;
|
||||
|
||||
&__head {
|
||||
.flex(row, space-between, center);
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 12px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
padding-left: 14px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
color: @profile-ink;
|
||||
line-height: 20px;
|
||||
|
||||
&::before {
|
||||
@@ -136,25 +135,41 @@ onMounted(() => {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 3px;
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
border-radius: 2px;
|
||||
background: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__create {
|
||||
height: 32px;
|
||||
padding: 0 14px;
|
||||
border: none;
|
||||
border-radius: @profile-radius;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: darken(@primary-strong, 6%);
|
||||
}
|
||||
}
|
||||
|
||||
&__grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: @spacing-base;
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 15px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__empty {
|
||||
grid-column: 1 / -1;
|
||||
padding: @spacing-xxl 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
:deep(.pagination) {
|
||||
@@ -167,21 +182,5 @@ onMounted(() => {
|
||||
background: @profile-page-active-bg;
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
.app-button--primary {
|
||||
height: 24px;
|
||||
padding: 0 10px;
|
||||
border: none;
|
||||
border-radius: @profile-radius;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
|
||||
&:hover {
|
||||
border: none;
|
||||
background: darken(@primary-strong, 6%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,314 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ConfirmDialog } from '@/components'
|
||||
import { getPasswordLevel, isValidPassword } from '@/utils/validate'
|
||||
import { useProfileStore } from '@/stores/modules/profile'
|
||||
import SecurityPanel from './cpns/SecurityPanel.vue'
|
||||
import ChangePasswordDialog from './cpns/ChangePasswordDialog.vue'
|
||||
import BindContactDialog from './cpns/BindContactDialog.vue'
|
||||
import type { BindContactMode } from './cpns/BindContactDialog.vue'
|
||||
|
||||
const router = useRouter()
|
||||
const profileStore = useProfileStore()
|
||||
const { profile } = storeToRefs(profileStore)
|
||||
|
||||
const deleteVisible = ref(false)
|
||||
const agree = ref(false)
|
||||
const identityVisible = ref(false)
|
||||
|
||||
const conditions = [
|
||||
{ label: '账号无未完成的订单', ok: true },
|
||||
{ label: '账号无未结清的款项', ok: false },
|
||||
{ label: '账号无进行中的合同', ok: true },
|
||||
{ label: '账号无处理中的工单', ok: true },
|
||||
]
|
||||
|
||||
const risks = [
|
||||
'账号注销后,您将无法登录本应用,所有个人信息将被永久删除。',
|
||||
'您名下的订单、合同、工单等业务数据将一并清除,无法找回。',
|
||||
'注销后,同一手机号/邮箱将无法再次注册本应用。',
|
||||
'如有未完成的订单或服务,请先处理完毕后再进行注销。',
|
||||
]
|
||||
|
||||
function onDeleteConfirm(): void {
|
||||
if (!agree.value) {
|
||||
ElMessage.warning('请先阅读并同意《账号注销协议》')
|
||||
return
|
||||
}
|
||||
identityVisible.value = true
|
||||
}
|
||||
|
||||
const pwdVisible = ref(false)
|
||||
|
||||
function onChangePasswordSubmit(payload: { code: string; password: string; confirm: string }): void {
|
||||
if (payload.password !== payload.confirm) {
|
||||
ElMessage.warning('两次密码不一致')
|
||||
return
|
||||
}
|
||||
if (!isValidPassword(payload.password) || getPasswordLevel(payload.password) === 'weak') {
|
||||
ElMessage.warning('密码等级过低,请重新输入')
|
||||
return
|
||||
}
|
||||
void profileStore
|
||||
.changePassword({ code: payload.code, password: payload.password })
|
||||
.then(() => {
|
||||
pwdVisible.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const bindVisible = ref(false)
|
||||
const bindMode = ref<BindContactMode>('phone-rebind')
|
||||
|
||||
function onBindPhone(): void {
|
||||
bindMode.value = 'phone-rebind'
|
||||
bindVisible.value = true
|
||||
}
|
||||
|
||||
function onBindEmail(mode: 'email-bind' | 'email-rebind'): void {
|
||||
bindMode.value = mode
|
||||
bindVisible.value = true
|
||||
}
|
||||
|
||||
function onBindSubmit(payload: { contact: string; code: string }): void {
|
||||
const action
|
||||
= bindMode.value === 'phone-rebind' || bindMode.value === 'phone-bind'
|
||||
? profileStore.bindPhone(payload.contact, payload.code)
|
||||
: profileStore.bindEmail(payload.contact, payload.code)
|
||||
void action.then(() => {
|
||||
bindVisible.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const unbindVisible = ref(false)
|
||||
|
||||
function onUnbindConfirm(): void {
|
||||
void profileStore.unbindEmail()
|
||||
}
|
||||
|
||||
function onIdentitySubmit(payload: { contact: string; code: string }): void {
|
||||
void (async () => {
|
||||
await profileStore.verifyIdentity(payload.contact, payload.code)
|
||||
await profileStore.deleteAccount()
|
||||
setTimeout(() => {
|
||||
void router.push('/login')
|
||||
}, 3000)
|
||||
})()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="security-page">
|
||||
<SecurityPanel
|
||||
:profile="profile"
|
||||
@change-password="pwdVisible = true"
|
||||
@bind-phone="onBindPhone"
|
||||
@bind-email="onBindEmail"
|
||||
@unbind-email="unbindVisible = true"
|
||||
@delete-account="deleteVisible = true"
|
||||
/>
|
||||
|
||||
<ConfirmDialog
|
||||
v-model:visible="deleteVisible"
|
||||
title="注销账号"
|
||||
confirm-text="注销账号"
|
||||
cancel-text="暂不注销"
|
||||
danger
|
||||
@cancel="agree = false"
|
||||
@confirm="onDeleteConfirm"
|
||||
>
|
||||
<div class="delete-confirm">
|
||||
<span class="delete-confirm__icon" aria-hidden="true">i</span>
|
||||
<h3 class="delete-confirm__title">
|
||||
确定要注销账号吗?
|
||||
</h3>
|
||||
|
||||
<div class="delete-confirm__block">
|
||||
<h4 class="delete-confirm__block-title delete-confirm__block-title--risk">
|
||||
⚠ 注销风险提示
|
||||
</h4>
|
||||
<ul class="delete-confirm__risks">
|
||||
<li v-for="(item, index) in risks" :key="item">
|
||||
{{ index + 1 }}、{{ item }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="delete-confirm__block">
|
||||
<h4 class="delete-confirm__block-title delete-confirm__block-title--ok">
|
||||
✓ 注销条件
|
||||
</h4>
|
||||
<ul class="delete-confirm__conditions">
|
||||
<li
|
||||
v-for="item in conditions"
|
||||
:key="item.label"
|
||||
class="delete-confirm__condition"
|
||||
>
|
||||
<span>{{ item.label }}</span>
|
||||
<span
|
||||
class="delete-confirm__mark"
|
||||
:class="item.ok ? 'is-ok' : 'is-fail'"
|
||||
>{{ item.ok ? '✓' : '✕' }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<label class="delete-confirm__agree">
|
||||
<input v-model="agree" type="checkbox">
|
||||
<span>已阅读并同意<em>《账号注销协议》</em></span>
|
||||
</label>
|
||||
</div>
|
||||
</ConfirmDialog>
|
||||
|
||||
<ChangePasswordDialog
|
||||
v-model:visible="pwdVisible"
|
||||
:phone="profile?.phone ?? ''"
|
||||
@submit="onChangePasswordSubmit"
|
||||
/>
|
||||
|
||||
<BindContactDialog
|
||||
v-model:visible="bindVisible"
|
||||
:mode="bindMode"
|
||||
:hint-phone="profile?.phone ?? ''"
|
||||
:hint-email="profile?.email ?? ''"
|
||||
@submit="onBindSubmit"
|
||||
/>
|
||||
|
||||
<BindContactDialog
|
||||
v-model:visible="identityVisible"
|
||||
mode="identity"
|
||||
:hint-phone="profile?.phone ?? ''"
|
||||
@submit="onIdentitySubmit"
|
||||
/>
|
||||
|
||||
<ConfirmDialog
|
||||
v-model:visible="unbindVisible"
|
||||
title="取消绑定"
|
||||
message="确定要取消绑定该邮箱吗?取消后将无法通过邮箱接收通知。"
|
||||
confirm-text="取消绑定"
|
||||
cancel-text="暂不取消"
|
||||
danger
|
||||
@confirm="onUnbindConfirm"
|
||||
/>
|
||||
<SecurityPanel :profile="profile" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.security-page {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: @spacing-base;
|
||||
}
|
||||
|
||||
.delete-confirm {
|
||||
.flex(column, flex-start);
|
||||
align-items: center;
|
||||
padding: 8px 0;
|
||||
|
||||
&__icon {
|
||||
.flex(row, center);
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
border-radius: @radius-round;
|
||||
background: fade(@danger-color, 12%);
|
||||
color: @danger-color;
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
&__title {
|
||||
margin-top: 10px;
|
||||
font-size: 19px;
|
||||
font-weight: 700;
|
||||
color: @profile-ink;
|
||||
}
|
||||
|
||||
&__block {
|
||||
width: 100%;
|
||||
margin-top: 32px;
|
||||
}
|
||||
|
||||
&__block-title {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
|
||||
&--risk {
|
||||
color: @danger-color;
|
||||
}
|
||||
|
||||
&--ok {
|
||||
color: @success-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__risks {
|
||||
margin-top: 12px;
|
||||
.flex(column, flex-start);
|
||||
gap: 9px;
|
||||
list-style: none;
|
||||
font-size: 13px;
|
||||
color: @finance-entry-text;
|
||||
}
|
||||
|
||||
&__conditions {
|
||||
margin-top: 12px;
|
||||
.flex(column, flex-start);
|
||||
gap: 10px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
&__condition {
|
||||
.flex(row, space-between, center);
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
padding: 0 16px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
font-size: 13px;
|
||||
color: @finance-entry-text;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__mark {
|
||||
.flex(row, center);
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border-radius: @radius-round;
|
||||
color: @white;
|
||||
font-size: 10px;
|
||||
line-height: 1;
|
||||
|
||||
&.is-ok {
|
||||
background: @success-color;
|
||||
}
|
||||
|
||||
&.is-fail {
|
||||
background: @danger-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__agree {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
margin-top: 22px;
|
||||
font-size: @font-size-sm;
|
||||
color: @finance-muted-text;
|
||||
cursor: pointer;
|
||||
|
||||
input {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
accent-color: @primary-strong;
|
||||
}
|
||||
|
||||
em {
|
||||
font-style: normal;
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -153,13 +153,18 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="container after-sales">
|
||||
<div class="after-sales">
|
||||
<div class="container after-sales__inner">
|
||||
<nav class="after-sales__breadcrumb">
|
||||
<RouterLink to="/project" class="link">
|
||||
项目中心
|
||||
</RouterLink>
|
||||
<span> > </span>
|
||||
<span>项目详情</span>
|
||||
<RouterLink :to="`/project/${projectId}`" class="link">
|
||||
项目详情
|
||||
</RouterLink>
|
||||
<span> > </span>
|
||||
<span>申请售后</span>
|
||||
</nav>
|
||||
|
||||
<header class="after-sales__header">
|
||||
@@ -300,51 +305,55 @@ onMounted(() => {
|
||||
</AppButton>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.after-sales {
|
||||
.flex(column, flex-start, stretch);
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @white;
|
||||
background: @bg-color;
|
||||
|
||||
&__inner {
|
||||
.flex(column, flex-start, stretch);
|
||||
}
|
||||
|
||||
// 设计稿 el40 面包屑 y=116,header 底 72 → padding-top 44px。
|
||||
&__breadcrumb {
|
||||
padding-top: 44px;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
line-height: 27px;
|
||||
padding-top: @spacing-lg;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: @project-breadcrumb;
|
||||
}
|
||||
|
||||
&__header {
|
||||
.flex(column, flex-start, stretch);
|
||||
padding-top: 52px;
|
||||
padding-top: @spacing-base;
|
||||
}
|
||||
|
||||
&__title {
|
||||
margin: 0;
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
line-height: 29px;
|
||||
font-size: @font-size-title;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
color: @project-ink;
|
||||
}
|
||||
|
||||
// 设计稿 #26:副标题文字 x=728~1185,中心 ≈ 957 ≈ 内容区中心 960(居中)。
|
||||
&__subtitle {
|
||||
margin-top: 8px;
|
||||
font-size: 13px;
|
||||
margin-top: @spacing-sm;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
line-height: 1.5;
|
||||
color: @project-label;
|
||||
text-align: center;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
&__card {
|
||||
.flex(column, flex-start, stretch);
|
||||
margin-top: 30px;
|
||||
padding: 22px 0 40px;
|
||||
margin-top: @spacing-base;
|
||||
padding: @spacing-lg;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -237,54 +237,54 @@ function onClearChips(): void {
|
||||
<style lang="less" scoped>
|
||||
.project-filter {
|
||||
flex-shrink: 0;
|
||||
width: 516px;
|
||||
// 字体/尺寸/间距/面板宽度对齐案例库 CasesFilter(老大要求),颜色保持不变。
|
||||
padding: 15px 0 40px;
|
||||
width: @project-filter-width;
|
||||
padding: @spacing-lg 0 @spacing-xl;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
|
||||
&__title,
|
||||
&__group,
|
||||
&__actions {
|
||||
padding: 0 50px 0 35px;
|
||||
padding: 0 @spacing-lg;
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-size: 28px;
|
||||
font-weight: 500;
|
||||
line-height: 41px;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&__group {
|
||||
margin-top: 24px;
|
||||
margin-top: @spacing-lg;
|
||||
}
|
||||
|
||||
&__title + &__group {
|
||||
margin-top: 11px;
|
||||
margin-top: @spacing-base;
|
||||
}
|
||||
|
||||
&__group-title {
|
||||
font-size: 24px;
|
||||
font-size: @font-size-md;
|
||||
font-weight: 500;
|
||||
line-height: 35px;
|
||||
line-height: 1.4;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&__list {
|
||||
margin-top: 19px;
|
||||
margin-top: @spacing-sm;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
&__row {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 12px;
|
||||
gap: @spacing-sm;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
padding: 0;
|
||||
height: 40px;
|
||||
padding: 0 @spacing-sm;
|
||||
border-radius: @radius-sm;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
color: @heading-color;
|
||||
transition: background-color 0.2s, color 0.2s;
|
||||
|
||||
@@ -301,8 +301,8 @@ function onClearChips(): void {
|
||||
&__box {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border: 1px solid @border-color-dark;
|
||||
border-radius: 2px;
|
||||
background: @white;
|
||||
@@ -312,9 +312,9 @@ function onClearChips(): void {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
left: 4px;
|
||||
width: 5px;
|
||||
height: 8px;
|
||||
left: 3px;
|
||||
width: 4px;
|
||||
height: 7px;
|
||||
border: solid @white;
|
||||
border-width: 0 2px 2px 0;
|
||||
transform: rotate(45deg) scale(0);
|
||||
@@ -340,25 +340,25 @@ function onClearChips(): void {
|
||||
&__row-count {
|
||||
flex-shrink: 0;
|
||||
margin-left: @spacing-sm;
|
||||
font-size: 16px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
color: @text-color;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
|
||||
&__grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 24px 33px;
|
||||
margin-top: 21px;
|
||||
gap: @spacing-sm;
|
||||
margin-top: @spacing-sm;
|
||||
}
|
||||
|
||||
&__pill {
|
||||
height: 53px;
|
||||
height: 36px;
|
||||
padding: 0 @spacing-sm;
|
||||
border-radius: @radius-base;
|
||||
background: @pill-bg;
|
||||
background: @project-pill-bg;
|
||||
color: @text-color;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-sm;
|
||||
.ellipsis();
|
||||
transition: background-color 0.2s, color 0.2s;
|
||||
|
||||
@@ -367,8 +367,9 @@ function onClearChips(): void {
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
background: @primary-color;
|
||||
color: @white;
|
||||
background: @filter-selected-bg;
|
||||
color: @primary-color;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
&--wide {
|
||||
@@ -378,20 +379,20 @@ function onClearChips(): void {
|
||||
|
||||
&__range {
|
||||
.flex(row, space-between, center);
|
||||
margin-top: 9px;
|
||||
margin-top: @spacing-sm;
|
||||
gap: @spacing-xs;
|
||||
}
|
||||
|
||||
&__date {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 53px;
|
||||
padding: 0 @spacing-xs;
|
||||
height: 36px;
|
||||
padding: 0 @spacing-sm;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
color: @text-color;
|
||||
font-size: 20px;
|
||||
font-size: @font-size-sm;
|
||||
}
|
||||
|
||||
&__range-sep {
|
||||
@@ -399,8 +400,8 @@ function onClearChips(): void {
|
||||
}
|
||||
|
||||
&__chips {
|
||||
margin: 23px 50px 0 35px;
|
||||
padding: 16px 24px 21px;
|
||||
margin: @spacing-lg @spacing-lg 0;
|
||||
padding: @spacing-base;
|
||||
border-radius: @radius-base;
|
||||
background: @chips-panel-bg;
|
||||
}
|
||||
@@ -410,13 +411,13 @@ function onClearChips(): void {
|
||||
}
|
||||
|
||||
&__chips-title {
|
||||
font-size: 20px;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
&__chips-clear {
|
||||
font-size: 16px;
|
||||
font-size: @font-size-sm;
|
||||
color: @primary-color;
|
||||
|
||||
&:hover {
|
||||
@@ -427,18 +428,18 @@ function onClearChips(): void {
|
||||
&__chips-list {
|
||||
.flex(row, flex-start, center);
|
||||
flex-wrap: wrap;
|
||||
margin-top: 16px;
|
||||
gap: 14px 13px;
|
||||
margin-top: @spacing-sm;
|
||||
gap: @spacing-sm;
|
||||
}
|
||||
|
||||
&__chip {
|
||||
.flex(row, center, center);
|
||||
height: 32px;
|
||||
height: 28px;
|
||||
padding: 0 @spacing-sm;
|
||||
border-radius: @radius-round;
|
||||
background: @white;
|
||||
color: @primary-color;
|
||||
font-size: 14px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 500;
|
||||
|
||||
&:hover {
|
||||
@@ -452,17 +453,17 @@ function onClearChips(): void {
|
||||
|
||||
&__actions {
|
||||
.flex(row, flex-start, center);
|
||||
margin-top: 30px;
|
||||
gap: 13px;
|
||||
margin-top: @spacing-lg;
|
||||
gap: @spacing-sm;
|
||||
}
|
||||
|
||||
&__reset {
|
||||
flex: 0 0 135px;
|
||||
height: 30px;
|
||||
flex: 0 0 88px;
|
||||
height: 32px;
|
||||
border-radius: @radius-round;
|
||||
background: @pill-bg;
|
||||
background: @project-pill-bg;
|
||||
color: @text-color;
|
||||
font-size: 14px;
|
||||
font-size: @font-size-sm;
|
||||
|
||||
&:hover {
|
||||
color: @primary-color;
|
||||
@@ -471,11 +472,11 @@ function onClearChips(): void {
|
||||
|
||||
&__submit {
|
||||
flex: 1;
|
||||
height: 30px;
|
||||
height: 32px;
|
||||
border-radius: @radius-round;
|
||||
background: @primary-color;
|
||||
color: @white;
|
||||
font-size: 14px;
|
||||
font-size: @font-size-sm;
|
||||
|
||||
&:hover {
|
||||
background: @primary-hover;
|
||||
|
||||
@@ -69,19 +69,20 @@ function go(page: number): void {
|
||||
<style lang="less" scoped>
|
||||
.project-pager {
|
||||
.flex(row, flex-end, center);
|
||||
gap: 4px;
|
||||
margin-top: 15px;
|
||||
gap: @spacing-xs;
|
||||
margin-top: @spacing-lg;
|
||||
|
||||
&__btn {
|
||||
.flex(row, center, center);
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border: 1px solid @border-color-dark;
|
||||
border-radius: 2px;
|
||||
min-width: 28px;
|
||||
height: 28px;
|
||||
padding: 0 6px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
color: @heading-color;
|
||||
color: @text-color;
|
||||
font-size: @font-size-sm;
|
||||
transition: border-color 0.2s, color 0.2s;
|
||||
transition: border-color 0.2s, color 0.2s, background-color 0.2s;
|
||||
|
||||
&:hover:not(:disabled):not(.is-ellipsis) {
|
||||
border-color: @primary-color;
|
||||
@@ -90,7 +91,9 @@ function go(page: number): void {
|
||||
|
||||
&.is-active {
|
||||
border-color: @primary-color;
|
||||
background: @primary-light;
|
||||
color: @primary-color;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
&.is-ellipsis {
|
||||
|
||||
@@ -54,7 +54,7 @@ function progressLabel(value: number | null | undefined): string {
|
||||
<th>业务类型</th>
|
||||
<th>进度</th>
|
||||
<th>状态</th>
|
||||
<th />
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -108,7 +108,8 @@ function progressLabel(value: number | null | undefined): string {
|
||||
|
||||
th,
|
||||
td {
|
||||
border: 1px solid @project-table-line;
|
||||
border: none;
|
||||
border-bottom: 1px solid @project-table-line;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
font-size: @font-size-sm;
|
||||
@@ -117,22 +118,27 @@ function progressLabel(value: number | null | undefined): string {
|
||||
th {
|
||||
height: 44px;
|
||||
background: @project-table-head-bg;
|
||||
color: @heading-color;
|
||||
font-weight: 600;
|
||||
color: @text-color-secondary;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
td {
|
||||
height: 76px;
|
||||
height: 64px;
|
||||
color: @heading-color;
|
||||
transition: background-color 0.15s;
|
||||
}
|
||||
|
||||
th:nth-child(1) { width: 6.09%; }
|
||||
th:nth-child(2) { width: 29.34%; }
|
||||
th:nth-child(3) { width: 21.76%; }
|
||||
th:nth-child(4) { width: 10.68%; }
|
||||
th:nth-child(5) { width: 14.37%; }
|
||||
th:nth-child(6) { width: 8.98%; }
|
||||
th:nth-child(7) { width: 8.78%; }
|
||||
tbody tr:hover td {
|
||||
background: @bg-color-light;
|
||||
}
|
||||
|
||||
th:nth-child(1) { width: 6%; }
|
||||
th:nth-child(2) { width: 18%; }
|
||||
th:nth-child(3) { width: 24%; }
|
||||
th:nth-child(4) { width: 14%; }
|
||||
th:nth-child(5) { width: 10%; }
|
||||
th:nth-child(6) { width: 12%; }
|
||||
th:nth-child(7) { width: 16%; }
|
||||
}
|
||||
|
||||
&__name {
|
||||
@@ -142,7 +148,7 @@ function progressLabel(value: number | null | undefined): string {
|
||||
|
||||
&__ops {
|
||||
.flex(row, center, center);
|
||||
gap: 10px;
|
||||
gap: @spacing-base;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,21 +76,28 @@ const keyword = computed({
|
||||
<style lang="less" scoped>
|
||||
.project-toolbar {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 24px;
|
||||
gap: @spacing-base;
|
||||
|
||||
&__field {
|
||||
.flex(row, flex-start, center);
|
||||
position: relative;
|
||||
flex: 0 1 380px;
|
||||
flex: 0 1 360px;
|
||||
min-width: 0;
|
||||
height: 37px;
|
||||
height: 36px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-round;
|
||||
background: @input-bg;
|
||||
background: @project-input-bg;
|
||||
transition: border-color 0.2s, background-color 0.2s;
|
||||
|
||||
&:focus-within {
|
||||
border-color: @primary-color;
|
||||
background: @white;
|
||||
}
|
||||
}
|
||||
|
||||
&__icon {
|
||||
position: absolute;
|
||||
left: 16px;
|
||||
left: @spacing-base;
|
||||
color: @text-color-disabled;
|
||||
pointer-events: none;
|
||||
}
|
||||
@@ -113,10 +120,10 @@ const keyword = computed({
|
||||
|
||||
&__btn {
|
||||
flex-shrink: 0;
|
||||
height: 26px;
|
||||
padding: 0 22px;
|
||||
height: 36px;
|
||||
padding: 0 @spacing-lg;
|
||||
border-radius: @radius-round;
|
||||
background: @pill-bg;
|
||||
background: @project-pill-bg;
|
||||
color: @text-color;
|
||||
font-size: @font-size-base;
|
||||
transition: color 0.2s, background-color 0.2s;
|
||||
|
||||
@@ -92,75 +92,81 @@ onMounted(load)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="container project-detail">
|
||||
<nav class="project-detail__breadcrumb text-secondary">
|
||||
<RouterLink to="/project" class="link">
|
||||
项目中心
|
||||
</RouterLink>
|
||||
<span> > </span>
|
||||
<span>项目详情</span>
|
||||
</nav>
|
||||
<div class="project-detail">
|
||||
<div class="container project-detail__inner">
|
||||
<nav class="project-detail__breadcrumb text-secondary">
|
||||
<RouterLink to="/project" class="link">
|
||||
项目中心
|
||||
</RouterLink>
|
||||
<span> > </span>
|
||||
<span>项目详情</span>
|
||||
</nav>
|
||||
|
||||
<template v-if="current">
|
||||
<div class="project-detail__info">
|
||||
<ProjectInfoCard :project="current" />
|
||||
</div>
|
||||
<template v-if="current">
|
||||
<div class="project-detail__panel">
|
||||
<div class="project-detail__info">
|
||||
<ProjectInfoCard :project="current" />
|
||||
</div>
|
||||
|
||||
<div class="project-detail__tabs">
|
||||
<button
|
||||
v-for="tab in tabs"
|
||||
:key="tab.value"
|
||||
class="project-detail__tab"
|
||||
:class="{
|
||||
'is-active': activeTab === tab.value,
|
||||
'is-loading': loadingTab === tab.value,
|
||||
}"
|
||||
@click="onTabClick(tab.value)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="project-detail__tabs">
|
||||
<button
|
||||
v-for="tab in tabs"
|
||||
:key="tab.value"
|
||||
class="project-detail__tab"
|
||||
:class="{
|
||||
'is-active': activeTab === tab.value,
|
||||
'is-loading': loadingTab === tab.value,
|
||||
}"
|
||||
@click="onTabClick(tab.value)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<template v-if="activeTab === 'progress'">
|
||||
<ProjectProgress
|
||||
:progress="current.progress"
|
||||
:start-time="current.startTime"
|
||||
:end-time="current.endTime"
|
||||
/>
|
||||
<ProjectMilestones :milestones="current.milestones" />
|
||||
<ProjectTeam :team="current.team" />
|
||||
<div class="project-detail__body">
|
||||
<template v-if="activeTab === 'progress'">
|
||||
<ProjectProgress
|
||||
:progress="current.progress"
|
||||
:start-time="current.startTime"
|
||||
:end-time="current.endTime"
|
||||
/>
|
||||
<ProjectMilestones :milestones="current.milestones" />
|
||||
<ProjectTeam :team="current.team" />
|
||||
</template>
|
||||
|
||||
<ProjectFiles
|
||||
v-if="activeTab === 'files'"
|
||||
:files="current.files"
|
||||
@delete="onDeleteFile"
|
||||
@preview="onPreviewFile"
|
||||
@download="onDownloadFile"
|
||||
/>
|
||||
|
||||
<ProjectFinance
|
||||
v-if="activeTab === 'finance'"
|
||||
:payment-plans="current.paymentPlans"
|
||||
:invoice-records="current.invoiceRecords"
|
||||
:contract-file="current.contractFile"
|
||||
@pay="onPay"
|
||||
@preview="onFinancePreview"
|
||||
@download="onFinanceDownload"
|
||||
/>
|
||||
|
||||
<ProjectAfterSales
|
||||
v-if="activeTab === 'afterSales'"
|
||||
:after-sales="current.afterSales"
|
||||
:project-status="current.status"
|
||||
@apply="onApplyAfterSales"
|
||||
@cancel="cancelVisible = true"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<ProjectFiles
|
||||
v-if="activeTab === 'files'"
|
||||
:files="current.files"
|
||||
@delete="onDeleteFile"
|
||||
@preview="onPreviewFile"
|
||||
@download="onDownloadFile"
|
||||
/>
|
||||
|
||||
<ProjectFinance
|
||||
v-if="activeTab === 'finance'"
|
||||
:payment-plans="current.paymentPlans"
|
||||
:invoice-records="current.invoiceRecords"
|
||||
:contract-file="current.contractFile"
|
||||
@pay="onPay"
|
||||
@preview="onFinancePreview"
|
||||
@download="onFinanceDownload"
|
||||
/>
|
||||
|
||||
<ProjectAfterSales
|
||||
v-if="activeTab === 'afterSales'"
|
||||
:after-sales="current.afterSales"
|
||||
:project-status="current.status"
|
||||
@apply="onApplyAfterSales"
|
||||
@cancel="cancelVisible = true"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<p v-else class="project-detail__empty text-secondary">
|
||||
项目不存在或已取消
|
||||
</p>
|
||||
<p v-else class="project-detail__empty text-secondary">
|
||||
项目不存在或已取消
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<ConfirmDialog
|
||||
v-model:visible="cancelVisible"
|
||||
@@ -175,45 +181,52 @@ onMounted(load)
|
||||
|
||||
<style lang="less" scoped>
|
||||
.project-detail {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 0;
|
||||
min-height: 100%;
|
||||
padding-bottom: @spacing-page-bottom;
|
||||
background: @white;
|
||||
background: @bg-color;
|
||||
|
||||
&__inner {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
// 设计稿 el55 面包屑 y=116,header 底 72 → padding-top 44px。
|
||||
&__breadcrumb {
|
||||
padding-top: 44px;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
line-height: 27px;
|
||||
padding-top: @spacing-lg;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: @project-breadcrumb;
|
||||
}
|
||||
|
||||
// 设计稿 el51 logo 盒 y=195(面包屑盒底 = 72+44+27 = 143)→ 间距 52px。
|
||||
&__info {
|
||||
margin-top: 52px;
|
||||
&__panel {
|
||||
margin-top: @spacing-base;
|
||||
padding: @spacing-lg;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
}
|
||||
|
||||
&__info {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
// 设计稿 el42 tab 文字 y=264,meta 文字底 231+15=246。
|
||||
&__tabs {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 16.45px;
|
||||
height: 41px;
|
||||
// 老大要求:信息卡与 tabs 栏之间留 20px 间距(原设计稿 2px 覆盖)。
|
||||
margin-top: 20px;
|
||||
gap: @spacing-lg;
|
||||
height: 40px;
|
||||
margin-top: @spacing-lg;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1px solid @project-divider;
|
||||
border-bottom: 1px solid @border-color;
|
||||
}
|
||||
|
||||
&__tab {
|
||||
position: relative;
|
||||
padding: 0 0 24px;
|
||||
padding: 0 0 @spacing-base;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: @project-cell;
|
||||
font-size: 13px;
|
||||
font-size: @font-size-sm;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
line-height: 1.4;
|
||||
cursor: pointer;
|
||||
transition: color 0.2s;
|
||||
|
||||
@@ -242,6 +255,10 @@ onMounted(load)
|
||||
}
|
||||
}
|
||||
|
||||
&__body {
|
||||
padding-top: @spacing-lg;
|
||||
}
|
||||
|
||||
&__empty {
|
||||
padding: @spacing-xxl 0;
|
||||
text-align: center;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user