diff --git a/src/pages/order/order/components/Tabs/README.md b/src/pages/order/order/components/Tabs/README.md deleted file mode 100644 index 54f8c81..0000000 --- a/src/pages/order/order/components/Tabs/README.md +++ /dev/null @@ -1,250 +0,0 @@ -# Tab 切换组件 - -一个功能完整的 Tab 切换组件,支持动画过渡、自定义内容和响应式设计。 - -## 功能特性 - -- ✅ **多标签切换**:支持任意数量的标签页切换 -- ✅ **动画指示器**:选中状态下划线,支持平滑滑动动画 -- ✅ **自定义内容**:支持插槽自定义标签内容 -- ✅ **响应式设计**:适配不同屏幕尺寸 -- ✅ **动态宽度**:下划线宽度根据文字宽度动态调整 -- ✅ **事件支持**:完整的切换事件和双向绑定 -- ✅ **主题定制**:支持自定义指示器颜色 -- ✅ **uniapp 兼容**:使用 uniapp 内置组件开发 - -## 基础用法 - -```vue - - - -``` - -## 自定义标签内容 - -使用 `tab-item` 插槽可以完全自定义标签的显示内容: - -```vue - - - -``` - -## 双向绑定 - -支持 `v-model` 双向绑定当前选中的索引: - -```vue - - - -``` - -## 动态标签 - -支持动态添加和删除标签: - -```vue - - - -``` - -## Props - -| 参数 | 类型 | 默认值 | 说明 | -| -------------- | ------ | --------------------------------------------------------------------- | ---------------------------- | -| tabs | Array | `[{label:'全部订单',value:'all'},{label:'服务工单',value:'service'}]` | 标签数据数组 | -| defaultActive | Number | `0` | 默认选中的标签索引 | -| indicatorColor | String | `#007AFF` | 指示器颜色 | -| modelValue | Number | - | 当前选中索引(用于 v-model) | - -### tabs 数组项结构 - -```typescript -interface TabItem { - label: string; // 标签显示文本 - value: string; // 标签值 - [key: string]: any; // 其他自定义属性 -} -``` - -## Events - -| 事件名 | 说明 | 参数 | -| ----------------- | --------------------- | ---------------------------------- | -| change | 标签切换时触发 | `{ index: number, item: TabItem }` | -| update:modelValue | 用于 v-model 双向绑定 | `index: number` | - -## Slots - -| 插槽名 | 说明 | 作用域参数 | -| -------- | -------------- | ----------------------------------------------------- | -| tab-item | 自定义标签内容 | `{ item: TabItem, index: number, isActive: boolean }` | - -## 方法 - -通过 `ref` 可以调用组件的方法: - -```vue - - - -``` - -| 方法名 | 说明 | 参数 | 返回值 | -| -------------- | ---------------------- | --------------- | --------- | -| setActiveIndex | 设置当前选中的标签 | `index: number` | - | -| getActiveIndex | 获取当前选中的标签索引 | - | `number` | -| getActiveItem | 获取当前选中的标签项 | - | `TabItem` | - -## 样式定制 - -### CSS 变量 - -组件支持通过 CSS 变量进行样式定制: - -```scss -.tab-container { - --tab-bg-color: #fff; // 背景色 - --tab-text-color: #666; // 文字颜色 - --tab-active-color: #333; // 选中文字颜色 - --tab-indicator-color: #007aff; // 指示器颜色 - --tab-border-color: #f0f0f0; // 边框颜色 -} -``` - -### 自定义主题 - -```vue - - - -``` - -## 技术实现 - -- **框架**:Vue 3 组合式 API -- **平台**:uniapp 跨平台开发 -- **动画**:CSS3 transition + transform -- **响应式**:CSS media queries -- **兼容性**:微信小程序、H5、App - -## 设计规范 - -- 遵循微信小程序设计规范 -- 支持无障碍访问 -- 响应式设计,适配不同设备 -- 流畅的动画过渡效果 -- 一致的视觉风格 - -## 兼容性 - -| 平台 | 支持情况 | -| ------------ | ----------- | -| 微信小程序 | ✅ 完全支持 | -| H5 | ✅ 完全支持 | -| App | ✅ 完全支持 | -| 支付宝小程序 | ✅ 完全支持 | -| 百度小程序 | ✅ 完全支持 | - -## 更新日志 - -### v1.0.0 - -- ✨ 初始版本发布 -- ✨ 支持基础标签切换功能 -- ✨ 支持动画指示器 -- ✨ 支持自定义标签内容 -- ✨ 支持响应式设计 -- ✨ 支持事件和双向绑定 - -## 备注 - -仅供学习、交流使用,请勿用于商业用途。 diff --git a/src/pages/order/order/components/Tabs/index.vue b/src/pages/order/order/components/Tabs/index.vue index b844635..fd4bfe7 100644 --- a/src/pages/order/order/components/Tabs/index.vue +++ b/src/pages/order/order/components/Tabs/index.vue @@ -1,21 +1,11 @@ @@ -271,5 +258,15 @@ defineExpose({ diff --git a/src/pages/order/order/components/Tabs/propmt.md b/src/pages/order/order/components/Tabs/propmt.md deleted file mode 100644 index e69de29..0000000 diff --git a/src/pages/order/order/components/Tabs/styles/index.scss b/src/pages/order/order/components/Tabs/styles/index.scss deleted file mode 100644 index 2f1f06a..0000000 --- a/src/pages/order/order/components/Tabs/styles/index.scss +++ /dev/null @@ -1,101 +0,0 @@ -.tab-container { - position: relative; -} - -.tab-wrapper { - display: flex; - align-items: center; - justify-content: center; - height: 30px; -} - -.tab-item { - flex: 1; - display: flex; - align-items: center; - justify-content: center; - height: 100%; - position: relative; - transition: all 0.3s ease; - padding: 0 8px; -} - -.tab-text { - font-size: 14px; - color: #666; - font-weight: 400; - transition: all 0.3s ease; - white-space: nowrap; -} - -.tab-text-active { - color: #333; - font-size: 16px; - font-weight: 600; -} - -.tab-item-active { - .tab-text { - color: #333; - font-weight: 600; - } -} - -.tab-indicator { - position: absolute; - bottom: 0; - height: 3px; - min-height: 3px; /* 确保最小高度 */ - background-color: #007aff; - border-radius: 10px; - transition: - left 0.3s cubic-bezier(0.4, 0, 0.2, 1), - width 0.3s cubic-bezier(0.4, 0, 0.2, 1); - z-index: 1; - transform: translateZ(0); /* 启用硬件加速 */ - will-change: left, width; /* 优化动画性能 */ - - /* 初始状态:未初始化时隐藏 */ - opacity: 0; - width: 15px; /* 默认宽度15px */ - left: 0; -} - -/* 已初始化状态 */ -.tab-indicator.initialized { - opacity: 1; -} - -/* 点击效果 */ -.tab-item:active { - opacity: 0.7; -} - -/* 自定义主题色支持 */ -.tab-container[data-indicator-color="red"] .tab-indicator { - background-color: #ff4d4f; -} - -.tab-container[data-indicator-color="green"] .tab-indicator { - background-color: #52c41a; -} - -.tab-container[data-indicator-color="orange"] .tab-indicator { - background-color: #fa8c16; -} - -/* 动画增强 */ -@keyframes tabSwitch { - 0% { - transform: translateZ(0) scaleX(0.8); - opacity: 0.6; - } - 100% { - transform: translateZ(0) scaleX(1); - opacity: 1; - } -} - -.tab-indicator.animating { - animation: tabSwitch 0.3s ease-out; -} diff --git a/src/pages/order/order/components/Tabs/test.vue b/src/pages/order/order/components/Tabs/test.vue deleted file mode 100644 index a2638f5..0000000 --- a/src/pages/order/order/components/Tabs/test.vue +++ /dev/null @@ -1,308 +0,0 @@ - - - - - diff --git a/src/pages/quick/components/Card/index.vue b/src/pages/quick/components/Card/index.vue index 6e67487..67904cc 100644 --- a/src/pages/quick/components/Card/index.vue +++ b/src/pages/quick/components/Card/index.vue @@ -67,6 +67,7 @@ const navigateToPage = (commodityId, path) => { router.push({ path, query: { commodityId } }) }; -const handleClick = ({ commodityId }) => - navigateToPage(commodityId, "/pages/goods/index"); +const handleClick = ({ commodityId }) => { + router.push({ name: "goods", query: { commodityId } }) +}