diff --git a/yudao-vue-ui/App.vue b/yudao-vue-ui/App.vue
index 0827cc9c7..a26228403 100644
--- a/yudao-vue-ui/App.vue
+++ b/yudao-vue-ui/App.vue
@@ -73,34 +73,7 @@
diff --git a/yudao-vue-ui/pages/auth/login.vue b/yudao-vue-ui/pages/auth/login.vue
index df5f8e7a3..56ca14c6f 100644
--- a/yudao-vue-ui/pages/auth/login.vue
+++ b/yudao-vue-ui/pages/auth/login.vue
@@ -19,30 +19,23 @@
手机登录/注册
-
- 手机号码
-
-
-
-
-
-
- 验证码
-
-
-
-
-
-
- 密码
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
账号密码登录
免密登录
@@ -71,9 +64,6 @@
-
-
-
@@ -85,52 +75,59 @@
export default{
mixins: [loginMpWx, loginAppWx],
- data(){
+ data() {
return {
- loginType: 'code', // 登录方式,code 验证码;password 密码
- mobile: '',
- code: '',
- password: '',
agreement: true,
+ loginType: 'password', // 登录方式,code 验证码;password 密码
+ loading: false, // 表单提交
+ rules: {
+ mobile: [{
+ required: true,
+ message: '请输入手机号'
+ }, {
+ validator: (rule, value, callback) => {
+ return uni.$u.test.mobile(value);
+ },
+ message: '手机号码不正确'
+ }],
+ code: [],
+ password: []
+ },
+ form: {
+ mobile: '',
+ code: '',
+ password: '',
+ },
+ disabled1: false,
+ tips: '',
}
},
onLoad() {
+ this.setLoginType(this.loginType);
},
methods: {
// 手机号登录
- async mobileLogin() {
- // 参数校验 TODO 芋艿:表单校验的支持
+ mobileLogin() {
if (!this.agreement) {
this.$util.msg('请阅读并同意用户服务及隐私协议');
- this.$refs.confirmBtn.stop();
return;
}
- const {mobile, code, password} = this;
- if (!checkStr(mobile, 'mobile')){
- this.$util.msg('请输入正确的手机号码');
- this.$refs.confirmBtn.stop();
- return;
- }
- if (this.loginType === 'code' && !checkStr(code, 'mobileCode')) {
- this.$util.msg('验证码格式错误');
- this.$refs.confirmBtn.stop();
- return;
- }
- if (this.loginType === 'password' && !checkStr(password, 'pwd')) {
- this.$util.msg('密码格式错误');
- this.$refs.confirmBtn.stop();
- return;
- }
-
- // 执行登陆
- try {
- const data = this.loginType === 'code' ? await smsLogin(mobile, code)
- : await login(mobile, password);
- // 登陆成功
- this.loginSuccessCallBack(data);
- } finally {
- this.$refs.confirmBtn.stop();
- }
+ this.$refs.form.validate().then(() => {
+ this.loading = true;
+ // 执行登陆
+ const { mobile, code, password} = this.form;
+ const loginPromise = this.loginType == 'password' ? login(mobile, password) :
+ smsLogin(mobile, code);
+ loginPromise.then(data => {
+ // 登陆成功
+ this.loginSuccessCallBack(data);
+ }).catch(errors => {
+ }).finally(() => {
+ this.loading = false;
+ })
+ }).catch(errors => {
+ debugger;
+ });
},
// 登陆成功的处理逻辑
loginSuccessCallBack(data){
@@ -146,6 +143,28 @@
},
setLoginType(loginType) {
this.loginType = loginType;
+ // 修改校验规则
+ this.rules.code = [];
+ this.rules.password = [];
+ if (loginType == 'code') {
+ this.rules.code = [{
+ required: true,
+ message: '请输入验证码'
+ }, {
+ min: 1000,
+ max: 999999,
+ message: '验证码不正确'
+ }];
+ } else {
+ this.rules.password = [{
+ required: true,
+ message: '请输入密码'
+ }, {
+ min: 4,
+ max: 16,
+ message: '密码不正确'
+ }]
+ }
},
//同意协议
checkAgreement(){
@@ -161,12 +180,32 @@
}
}))
},
+ codeChange(text) {
+ this.tips = text;
+ },
+ getCode() {
+ if (this.$refs.uCode.canGetCode) {
+ // 模拟向后端请求验证码
+ uni.showLoading({
+ title: '正在获取验证码'
+ })
+ setTimeout(() => {
+ uni.hideLoading();
+ // 这里此提示会被this.start()方法中的提示覆盖
+ uni.$u.toast('验证码已发送');
+ // 通知验证码组件内部开始倒计时
+ this.$refs.uCode.start();
+ }, 2000);
+ } else {
+ uni.$u.toast('倒计时结束后再发送');
+ }
+ },
}
}
@@ -243,35 +282,8 @@
/** 手机登录部分 */
.input-content {
padding: 0 60rpx;
- .input-item {
- display:flex;
- flex-direction: column;
- align-items:flex-start;
- justify-content: center;
- padding: 0 30rpx;
- background: #f8f6fc;
- height: 120rpx;
- border-radius: 4px;
- margin-bottom: 50rpx;
- &:last-child{
- margin-bottom: 0;
- }
- .row{
- width: 100%;
- }
- .title{
- height: 50rpx;
- line-height: 56rpx;
- font-size: 26rpx;
- color: #606266;
- }
- input {
- flex: 1;
- height: 60rpx;
- font-size: 30rpx;
- color: #303133;
- width: 100%;
- }
+ .login-button {
+ margin-top: 30rpx;
}
.login-type {
display: flex;
diff --git a/yudao-vue-ui/uni.scss b/yudao-vue-ui/uni.scss
index cf9767858..8daa39f8c 100644
--- a/yudao-vue-ui/uni.scss
+++ b/yudao-vue-ui/uni.scss
@@ -1,42 +1,13 @@
-$base-color: #ff536f;
-
-
-$main:#07c160; //主背景色
-$lightMain: rgba($main,0.1); //淡主色
-$mainInverse:#fff; //与主色搭配的反色
-$mainGradual:linear-gradient(to top right,$main,rgba($main,0.2));//渐变主色
-$mainGradualInverse:#fff;//与渐变主色搭配的反色
-
-/* 配色 */
-$red:#e1251b; //红色
-$lightRed:rgba(225, 37, 27, 0.08);//淡淡的红色
-
-$black: #000;
-$lightBlack:#e6e6e6;
-
-$yellow:#f69c00;
-$lightYellow:#fef3d1;
-
-$green:#07c160;
-$lightGreen:#dff5e2;
-
-$orange: #F74F0E;
-$lightOrange: #fedfd3;
-
-$blue:#0081ff;
-$lightBlue:#e6f2ff;
-
-$brown: #8B4513;
-$lightBrown:#ffdbc1;
-
-$purple:#6739b6;
-$lightPurple:#e7dff5;
-
-$white : #fff ;
-$black : #000 ;
-$gray : #777 ;
-$grey : #82939c ;
-
-$borderColor:#e0e0e0;
-
@import '@/uni_modules/uview-ui/theme.scss';
+
+.u-button--success {
+ background-color: #5ac725 !important; // TODO 芋艿:莫名不行
+}
+.u-button--primary {
+ background-color: #3c9cff !important; // TODO 芋艿:莫名不行
+}
+.u-button--error {
+ background-color: #f56c6c !important; // TODO 芋艿:莫名不行
+}
+
+$base-color: #ff536f;
diff --git a/yudao-vue-ui/uni_modules/uview-ui/LICENSE b/yudao-vue-ui/uni_modules/uview-ui/LICENSE
new file mode 100644
index 000000000..8e39eada8
--- /dev/null
+++ b/yudao-vue-ui/uni_modules/uview-ui/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2020 www.uviewui.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/yudao-vue-ui/uni_modules/uview-ui/README.md b/yudao-vue-ui/uni_modules/uview-ui/README.md
new file mode 100644
index 000000000..1dca4a8f6
--- /dev/null
+++ b/yudao-vue-ui/uni_modules/uview-ui/README.md
@@ -0,0 +1,105 @@
+
+
+
+uView
+多平台快速开发的UI框架
+
+
+## 说明
+
+uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水
+
+## 特性
+
+- 兼容安卓,iOS,微信小程序,H5,QQ小程序,百度小程序,支付宝小程序,头条小程序
+- 60+精选组件,功能丰富,多端兼容,让您快速集成,开箱即用
+- 众多贴心的JS利器,让您飞镖在手,召之即来,百步穿杨
+- 众多的常用页面和布局,让您专注逻辑,事半功倍
+- 详尽的文档支持,现代化的演示效果
+- 按需引入,精简打包体积
+
+
+## 安装
+
+```bash
+# npm方式安装
+npm i uview-ui
+```
+
+## 快速上手
+
+1. `main.js`引入uView库
+```js
+// main.js
+import uView from 'uview-ui';
+Vue.use(uView);
+```
+
+2. `App.vue`引入基础样式(注意style标签需声明scss属性支持)
+```css
+/* App.vue */
+
+```
+
+3. `uni.scss`引入全局scss变量文件
+```css
+/* uni.scss */
+@import "uview-ui/theme.scss";
+```
+
+4. `pages.json`配置easycom规则(按需引入)
+
+```js
+// pages.json
+{
+ "easycom": {
+ // npm安装的方式不需要前面的"@/",下载安装的方式需要"@/"
+ // npm安装方式
+ "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
+ // 下载安装方式
+ // "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
+ },
+ // 此为本身已有的内容
+ "pages": [
+ // ......
+ ]
+}
+```
+
+请通过[快速上手](https://www.uviewui.com/components/quickstart.html)了解更详细的内容
+
+## 使用方法
+配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。
+
+```html
+
+
+
+```
+
+请通过[快速上手](https://www.uviewui.com/components/quickstart.html)了解更详细的内容
+
+## 链接
+
+- [官方文档](https://www.uviewui.com/)
+- [更新日志](https://www.www.uviewui.com/components/changelog.html)
+- [升级指南](https://www.uviewui.com/components/changelog.html)
+- [关于我们](https://www.uviewui.com/cooperation/about.html)
+
+## 预览
+
+您可以通过**微信**扫码,查看最佳的演示效果。
+
+
+
+
+## 捐赠uView的研发
+
+uView文档和源码全部开源免费,如果您认为uView帮到了您的开发工作,您可以捐赠uView的研发工作,捐赠无门槛,哪怕是一杯可乐也好(相信这比打赏主播更有意义)。
+
+
+
+## 版权信息
+uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。
diff --git a/yudao-vue-ui/uni_modules/uview-ui/changelog.md b/yudao-vue-ui/uni_modules/uview-ui/changelog.md
new file mode 100644
index 000000000..bfc76e4b4
--- /dev/null
+++ b/yudao-vue-ui/uni_modules/uview-ui/changelog.md
@@ -0,0 +1,55 @@
+## 2.0.5(2021-11-25)
+## [点击加群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU)
+
+# uView2.0重磅发布,利剑出鞘,一统江湖
+
+1. calendar在vue下显示异常问题。
+2. form组件labelPosition和errorType参数无效的问题
+3. input组件inputAlign无效的问题
+4. 其他一些修复
+## 2.0.4(2021-11-23)
+## [点击加群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU)
+
+# uView2.0重磅发布,利剑出鞘,一统江湖
+
+0. input组件缺失@confirm事件,以及subfix和prefix无效问题
+1. component.scss文件样式在vue下干扰全局布局问题
+2. 修复subsection在vue环境下表现异常的问题
+3. tag组件的bgColor等参数无效的问题
+4. upload组件不换行的问题
+5. 其他的一些修复处理
+## 2.0.3(2021-11-16)
+## [点击加群交流反馈:1129077272](https://jq.qq.com/?_wv=1027&k=KnbeceDU)
+
+# uView2.0重磅发布,利剑出鞘,一统江湖
+
+1. uView2.0已实现全面兼容nvue
+2. uView2.0对1.x进行了架构重构,细节和性能都有极大提升
+3. 目前uView2.0为公测阶段,相关细节可能会有变动
+4. 我们写了一份与1.x的对比指南,详见[对比1.x](https://www.uviewui.com/components/diff1.x.html)
+5. 处理modal的confirm回调事件拼写错误问题
+6. 处理input组件@input事件参数错误问题
+7. 其他一些修复
+## 2.0.2(2021-11-16)
+## [点击加群交流反馈:1129077272](https://jq.qq.com/?_wv=1027&k=KnbeceDU)
+
+# uView2.0重磅发布,利剑出鞘,一统江湖
+
+1. uView2.0已实现全面兼容nvue
+2. uView2.0对1.x进行了架构重构,细节和性能都有极大提升
+3. 目前uView2.0为公测阶段,相关细节可能会有变动
+4. 我们写了一份与1.x的对比指南,详见[对比1.x](https://www.uviewui.com/components/diff1.x.html)
+5. 修复input组件formatter参数缺失问题
+6. 优化loading-icon组件的scss写法问题,防止不兼容新版本scss
+## 2.0.0(2020-11-15)
+## [点击加群交流反馈:1129077272](https://jq.qq.com/?_wv=1027&k=KnbeceDU)
+
+# uView2.0重磅发布,利剑出鞘,一统江湖
+
+1. uView2.0已实现全面兼容nvue
+2. uView2.0对1.x进行了架构重构,细节和性能都有极大提升
+3. 目前uView2.0为公测阶段,相关细节可能会有变动
+4. 我们写了一份与1.x的对比指南,详见[对比1.x](https://www.uviewui.com/components/diff1.x.html)
+5. 修复input组件formatter参数缺失问题
+
+
diff --git a/yudao-vue-ui/uni_modules/uview-ui/components/u--form/u--form.vue b/yudao-vue-ui/uni_modules/uview-ui/components/u--form/u--form.vue
new file mode 100644
index 000000000..fc6856c68
--- /dev/null
+++ b/yudao-vue-ui/uni_modules/uview-ui/components/u--form/u--form.vue
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
diff --git a/yudao-vue-ui/uni_modules/uview-ui/components/u--image/u--image.vue b/yudao-vue-ui/uni_modules/uview-ui/components/u--image/u--image.vue
new file mode 100644
index 000000000..50c4d57f9
--- /dev/null
+++ b/yudao-vue-ui/uni_modules/uview-ui/components/u--image/u--image.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/yudao-vue-ui/uni_modules/uview-ui/components/u--input/u--input.vue b/yudao-vue-ui/uni_modules/uview-ui/components/u--input/u--input.vue
new file mode 100644
index 000000000..f1ab9b25d
--- /dev/null
+++ b/yudao-vue-ui/uni_modules/uview-ui/components/u--input/u--input.vue
@@ -0,0 +1,67 @@
+
+ $emit('change', e)"
+ @input="e => $emit('input', e)"
+ @confirm="e => $emit('confirm', e)"
+ @clear="$emit('clear')"
+ @click="$emit('click')"
+ >
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yudao-vue-ui/uni_modules/uview-ui/components/u--text/u--text.vue b/yudao-vue-ui/uni_modules/uview-ui/components/u--text/u--text.vue
new file mode 100644
index 000000000..3aa326275
--- /dev/null
+++ b/yudao-vue-ui/uni_modules/uview-ui/components/u--text/u--text.vue
@@ -0,0 +1,46 @@
+
+
+
+
+
diff --git a/yudao-vue-ui/uni_modules/uview-ui/components/u--textarea/u--textarea.vue b/yudao-vue-ui/uni_modules/uview-ui/components/u--textarea/u--textarea.vue
new file mode 100644
index 000000000..c56baf699
--- /dev/null
+++ b/yudao-vue-ui/uni_modules/uview-ui/components/u--textarea/u--textarea.vue
@@ -0,0 +1,47 @@
+
+ $emit('input', e)"
+ @keyboardheightchange="$emit('keyboardheightchange')"
+ >
+
+
+
diff --git a/yudao-vue-ui/uni_modules/uview-ui/components/u-action-sheet/props.js b/yudao-vue-ui/uni_modules/uview-ui/components/u-action-sheet/props.js
new file mode 100644
index 000000000..a8ae4c9db
--- /dev/null
+++ b/yudao-vue-ui/uni_modules/uview-ui/components/u-action-sheet/props.js
@@ -0,0 +1,54 @@
+export default {
+ props: {
+ // 操作菜单是否展示 (默认false)
+ show: {
+ type: Boolean,
+ default: uni.$u.props.actionSheet.show
+ },
+ // 标题
+ title: {
+ type: String,
+ default: uni.$u.props.actionSheet.title
+ },
+ // 选项上方的描述信息
+ description: {
+ type: String,
+ default: uni.$u.props.actionSheet.description
+ },
+ // 数据
+ actions: {
+ type: Array,
+ default: uni.$u.props.actionSheet.actions
+ },
+ // 取消按钮的文字,不为空时显示按钮
+ cancelText: {
+ type: String,
+ default: uni.$u.props.actionSheet.cancelText
+ },
+ // 点击某个菜单项时是否关闭弹窗
+ closeOnClickAction: {
+ type: Boolean,
+ default: uni.$u.props.actionSheet.closeOnClickAction
+ },
+ // 处理底部安全区(默认true)
+ safeAreaInsetBottom: {
+ type: Boolean,
+ default: uni.$u.props.actionSheet.safeAreaInsetBottom
+ },
+ // 小程序的打开方式
+ openType: {
+ type: String,
+ default: uni.$u.props.actionSheet.openType
+ },
+ // 点击遮罩是否允许关闭 (默认true)
+ closeOnClickOverlay: {
+ type: Boolean,
+ default: uni.$u.props.actionSheet.closeOnClickOverlay
+ },
+ // 是否显示圆角 (默认false)
+ round: {
+ type: Boolean,
+ default: uni.$u.props.actionSheet.round
+ }
+ }
+}
diff --git a/yudao-vue-ui/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue b/yudao-vue-ui/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue
new file mode 100644
index 000000000..a8c6ea74d
--- /dev/null
+++ b/yudao-vue-ui/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue
@@ -0,0 +1,275 @@
+
+
+
+
+
+ {{description}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{cancelText}}
+
+
+
+
+
+
+
+
diff --git a/yudao-vue-ui/uni_modules/uview-ui/components/u-album/props.js b/yudao-vue-ui/uni_modules/uview-ui/components/u-album/props.js
new file mode 100644
index 000000000..75cdb37d5
--- /dev/null
+++ b/yudao-vue-ui/uni_modules/uview-ui/components/u-album/props.js
@@ -0,0 +1,59 @@
+export default {
+ props: {
+ // 图片地址,Array|Array