From e368285be3157083e3cfc00bf9de2ff4e7679cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=87?= <2020377497@qq.com> Date: Fri, 26 Jan 2024 18:01:37 +0800 Subject: [PATCH] upda --- mall/function/index.vue | 167 +++++++++--------- mall/index/index.vue | 3 - pages/index/index.vue | 2 +- pages/login/index.vue | 10 +- uni_modules/wot-design-uni/changelog.md | 41 ++++- .../components/wd-form/wd-form.vue | 27 ++- .../wd-input-number/wd-input-number.vue | 22 ++- .../components/wd-tab/wd-tab.vue | 4 +- uni_modules/wot-design-uni/package.json | 2 +- 9 files changed, 167 insertions(+), 111 deletions(-) diff --git a/mall/function/index.vue b/mall/function/index.vue index 92ac2f4..7a6b4e3 100644 --- a/mall/function/index.vue +++ b/mall/function/index.vue @@ -2,109 +2,114 @@ - -
- -
-
- - 基础功能 + + +
+ +
+
+ + 基础功能 +
-
- - -
- 商品分类 -
+ -
- 商品管理 -
+
+ 商品分类 +
-
+
+ 商品管理 +
-
- + - -
- -
-
- - 订单管理 -
- - -
- 普通订单 -
- -
- 自提订单 + + + + + +
+ +
+
+ + 订单管理 +
-
- 当面付订单 -
- + +
+ 普通订单 +
+
+ 自提订单 +
-
-
+
+ 当面付订单 +
+ - -
-
-
- - 折扣管理 -
- - -
- 限时折扣 + + + + + +
+ +
+
+ + 折扣管理 +
-
- 梯度折扣 -
- -
- 满额立减 -
- - - + -
-
- +
+
+ diff --git a/mall/index/index.vue b/mall/index/index.vue index 43321de..38a149c 100644 --- a/mall/index/index.vue +++ b/mall/index/index.vue @@ -9,10 +9,7 @@ - - - 分类管理 diff --git a/pages/index/index.vue b/pages/index/index.vue index 7499ec8..8c5f3df 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -14,7 +14,7 @@ if (token) { } else if (user_info.type == 3) { utils.toUrl("/mall/index/index", "redirectTo") } else { - + uni.clearStorage(); // 预防本地数据错误 } } else { utils.toUrl("/pages/login/index", "redirectTo") diff --git a/pages/login/index.vue b/pages/login/index.vue index 70b72cb..4bb0e91 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -3,13 +3,13 @@
- + - + {{ webInfo.name }} @@ -22,12 +22,12 @@ - + - + @@ -36,7 +36,7 @@ - + 登录 diff --git a/uni_modules/wot-design-uni/changelog.md b/uni_modules/wot-design-uni/changelog.md index ce11637..9648045 100644 --- a/uni_modules/wot-design-uni/changelog.md +++ b/uni_modules/wot-design-uni/changelog.md @@ -1,14 +1,47 @@ -## 0.2.13(2024-01-12) -### [0.2.13](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.12...v0.2.13) (2024-01-12) +## 0.2.17(2024-01-23) +### [0.2.17](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.16...v0.2.17) (2024-01-23) -### Bug Fixes | Bug 修复 +### ✨ Features | 新功能 -* 修复演示文档刷新后指向localhost的问题 ([4cd8b16](https://github.com/Moonofweisheng/wot-design-uni/commit/4cd8b16bdf5ea8e93cff85396025844e9ebd031c)) +* ✨ Form 表单组件提供开关控制是否model变化时重置提示信息 ([b9f46ba](https://github.com/Moonofweisheng/wot-design-uni/commit/b9f46ba0da85acd7312753a34dd0ad3f2f7379a2)), closes [#166](https://github.com/Moonofweisheng/wot-design-uni/issues/166) # 更新日志 +### [0.2.17](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.16...v0.2.17) (2024-01-23) + + +### ✨ Features | 新功能 + +* ✨ Form 表单组件提供开关控制是否model变化时重置提示信息 ([b9f46ba](https://github.com/Moonofweisheng/wot-design-uni/commit/b9f46ba0da85acd7312753a34dd0ad3f2f7379a2)), closes [#166](https://github.com/Moonofweisheng/wot-design-uni/issues/166) + +### [0.2.16](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.15...v0.2.16) (2024-01-21) + + +### ✏️ Documentation | 文档 + +* ✏️ 修复文档中关于日期选择器最大日期描述错误的问题 ([bb76ce3](https://github.com/Moonofweisheng/wot-design-uni/commit/bb76ce332c6977cbae981790aa356bc27c0d9efa)) + +### [0.2.15](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.14...v0.2.15) (2024-01-15) + + +### 🐛 Bug Fixes | Bug 修复 + +* 🐛 修复 Tab class类名属性错误的问题 ([dc87df7](https://github.com/Moonofweisheng/wot-design-uni/commit/dc87df70c7920d7cfabc571ace8beb2ce0dc2a7c)) + + +### ✏️ Documentation | 文档 + +* ✏️ 修复 Upload 文档中before-upload钩子参数描述错误的问题 ([3ec7299](https://github.com/Moonofweisheng/wot-design-uni/commit/3ec7299ce724fce771b782f6110ba6ec29376291)) + +### [0.2.14](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.13...v0.2.14) (2024-01-14) + + +### ✨ Features | 新功能 + +* ✨ InputNumber步进器支持禁用输入框 ([933bce3](https://github.com/Moonofweisheng/wot-design-uni/commit/933bce314618956ff922daacef5b3594f36baf9b)) + ### [0.2.13](https://github.com/Moonofweisheng/wot-design-uni/compare/v0.2.12...v0.2.13) (2024-01-12) diff --git a/uni_modules/wot-design-uni/components/wd-form/wd-form.vue b/uni_modules/wot-design-uni/components/wd-form/wd-form.vue index 3d2faeb..bb491cf 100644 --- a/uni_modules/wot-design-uni/components/wd-form/wd-form.vue +++ b/uni_modules/wot-design-uni/components/wd-form/wd-form.vue @@ -26,12 +26,15 @@ interface Props { model: Record // 表单验证规则 rules?: FormRules + // 是否在输入时重置表单校验信息 + resetOnChange?: boolean customClass?: string customStyle?: string } const props = withDefaults(defineProps(), { rules: () => ({}), + resetOnChange: true, customClass: '', customStyle: '' }) @@ -44,7 +47,9 @@ linkChildren({ props, errorMessages: errorMessages }) watch( () => props.model, () => { - clearMessage() + if (props.resetOnChange) { + clearMessage() + } }, { immediate: true, deep: true } ) @@ -129,6 +134,14 @@ async function validate(prop?: string): Promise<{ valid: boolean; errors: ErrorM showMessage(error) }) + if (valid) { + if (prop) { + clearMessage(prop) + } else { + clearMessage() + } + } + return { valid, errors @@ -156,10 +169,14 @@ function showMessage(errorMsg: ErrorMessage) { } } -function clearMessage() { - Object.keys(errorMessages).forEach((key) => { - errorMessages[key] = '' - }) +function clearMessage(prop?: string) { + if (prop) { + errorMessages[prop] = '' + } else { + Object.keys(errorMessages).forEach((key) => { + errorMessages[key] = '' + }) + } } function reset() { diff --git a/uni_modules/wot-design-uni/components/wd-input-number/wd-input-number.vue b/uni_modules/wot-design-uni/components/wd-input-number/wd-input-number.vue index 961b07a..d59ba30 100644 --- a/uni_modules/wot-design-uni/components/wd-input-number/wd-input-number.vue +++ b/uni_modules/wot-design-uni/components/wd-input-number/wd-input-number.vue @@ -1,14 +1,14 @@