Compare commits

...

3 Commits
develop ... del

  1. 249
      CHANGELOG.md
  2. 4
      src/common/styles/app.scss
  3. 253
      src/mixins/mixin.js
  4. 29
      src/pages.json
  5. 138
      src/pages/user/accountLogin.vue
  6. 30
      src/pages/user/agreement.vue
  7. 154
      src/pages/user/login.vue
  8. 179
      src/pages/user/rigister.vue
  9. BIN
      src/static/weixinIcon.png

249
CHANGELOG.md

@ -1,8 +1,56 @@
# 0.1.0 (2021-09-09) # 0.1.0 (2021-09-10)
### 🌟 新功能 ### 🌟 新功能
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | 绑定手机号 | 52e0352
- | 标题栏变化 | 3898cfe
- | 标题栏变化 | c0fcd9d
- | 标题栏角色栏全局任务组件新建 | 0500cb4
- | 插件参数处理调整 | a3e68d3
- | 插件数据获取 | 5b91bdc
- | 存token | b8a178d
- | 导入项目,更新项目 | 5e06adf
- | 导入项目后提示并打开项目详情页 | 410f527
- | 导入wbs | 1224fcb
- | 登录、注册、用户协议 | 0735f41
- | 点击日历日期查询项目列表 | c458385
- | 定期任务面板骨架屏添加 | b2698c0
富文本插件 | 富文本插件demo测试 | ed3d644
- | 缓存修改 | 63e1f0d
- | 获取用户收取那,提交用户信息 | a3c54f1
- | 角色栏实现 | 94cd671
- | 距调整pc端 | 5069aa1
- | 面变化首页变化 | 5e860f1
- | 模拟接口测试 | 69e7931
- | 配置默认插件接口 | f0c177d
- | 全局插件及默认插件位置修改 | 6c80d08
- | 任务进行中状态数字 | 27b7326
- | 任务状态时间显示 | 56f5183
- | 日常任务插件调整 | c1881f9
- | 日历定位;合并 | ea3f937
- | 删除项目 | 00b886c
- | 上传逻辑变化 | 3ff1dc2
- | 设置小红点 | 9316bcb
- | 升级版本v3.1.0;tailwindcss添加class | 9ef05e1
- | 时间基准线,默认插件 | a33ba1e
- | 时间轴界面 | 33927e9
- | 时间轴修改状态时提示框增加 | e841392
- | 适配小程序;小程序登录 | cefc0eb
- | 首页项目样式改变 | 8514c85
- | 提交到本地 | 9cbe411
- | 添加 环境变量,动态控制webview project的path | 8a40481
- | 添加时间轴上下滚动 | 2b81bbc
- | 添加项目排序 | a0b491b
- | 添加子任务插件 子项目插件 | 7bda7e2
- | 细节调整,添加project-webview | 4d9050b
- | 向右箭头图标变化 | 8e9ca55
- | 项目列表, 项目url | 32e005b
- | 项目列表排序 | 224c58b
- | 项目api url设置 | 6cd5245
- | 修改小程序id | 4206bf2
- | 引入dayjs | 29b8b93
- | 字体大小更改 | 82cfdd4
- | api封装 | 7d4edfc - | api封装 | 7d4edfc
bind phone | 图形验证码;短信验证码;绑定手机号 | 93ffea2 bind phone | 图形验证码;短信验证码;绑定手机号 | 93ffea2
- | cache indexedDB处理 | 3388967 - | cache indexedDB处理 | 3388967
@ -20,138 +68,93 @@
- | tall插件封装 | 1bcb920 - | tall插件封装 | 1bcb920
task status | 任务状态切换未完 | 7ffd135 task status | 任务状态切换未完 | 7ffd135
- | ws storage | 21b3a06 - | ws storage | 21b3a06
- | 上传逻辑变化 | 3ff1dc2
- | 任务状态时间显示 | 56f5183
- | 任务进行中状态数字 | 27b7326
- | 全局插件及默认插件位置修改 | 6c80d08
- | 删除项目 | 00b886c
- | 升级版本v3.1.0;tailwindcss添加class | 9ef05e1
- | 向右箭头图标变化 | 8e9ca55
- | 字体大小更改 | 82cfdd4
- | 存token | b8a178d
- | 定期任务面板骨架屏添加 | b2698c0
富文本插件 | 富文本插件demo测试 | ed3d644
- | 导入wbs | 1224fcb
- | 导入项目,更新项目 | 5e06adf
- | 导入项目后提示并打开项目详情页 | 410f527
- | 引入dayjs | 29b8b93
- | 提交到本地 | 9cbe411
- | 插件参数处理调整 | a3e68d3
- | 插件数据获取 | 5b91bdc
- | 日历定位;合并 | ea3f937
- | 日常任务插件调整 | c1881f9
- | 时间基准线,默认插件 | a33ba1e
- | 时间轴修改状态时提示框增加 | e841392
- | 时间轴界面 | 33927e9
- | 标题栏变化 | 3898cfe
- | 标题栏变化 | c0fcd9d
- | 标题栏角色栏全局任务组件新建 | 0500cb4
- | 模拟接口测试 | 69e7931
- | 添加 环境变量,动态控制webview project的path | 8a40481
- | 添加子任务插件 子项目插件 | 7bda7e2
- | 添加时间轴上下滚动 | 2b81bbc
- | 添加项目排序 | a0b491b
- | 点击日历日期查询项目列表 | c458385
- | 细节调整,添加project-webview | 4d9050b
- | 绑定手机号 | 52e0352
- | 缓存修改 | 63e1f0d
- | 角色栏实现 | 94cd671
- | 设置小红点 | 9316bcb
- | 距调整pc端 | 5069aa1
- | 适配小程序;小程序登录 | cefc0eb
- | 配置默认插件接口 | f0c177d
- | 面变化首页变化 | 5e860f1
- | 项目api url设置 | 6cd5245
- | 项目列表, 项目url | 32e005b
- | 项目列表排序 | 224c58b
- | 首页项目样式改变 | 8514c85
### 🎨 代码样式 ### 🎨 代码样式
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | calendar注释 | a2ec112
- | indexedDB.js格式整理 | b0d3a36
- | 代码审查 | d75134c
- | 代码格式细节调整 | cb2532b - | 代码格式细节调整 | cb2532b
- | 代码审查 | d75134c
- | 格式细节调整 | b907a03
- | 更新代码 | 8c27e68
- | 更新代码 | 1f40a76
- | 任务快捷方式图标增加 | 4aba872 - | 任务快捷方式图标增加 | 4aba872
- | 修改角色样式 | 73e268e - | 日常任务修改 | dfa7ee2
- | 删除插件携带的多余文件 | 0f392bb
- | 删除多余字段 | 5ae3973
- | 删除没用代码 | 34b20e1
- | 删除calendar中多余的console | e339eec - | 删除calendar中多余的console | e339eec
- | 删除console.log | 5064a38 - | 删除console.log | 5064a38
- | 删除index中没用的alert代码 | 9c9eec7 - | 删除index中没用的alert代码 | 9c9eec7
- | 删除mock,console;upload添加loading | 99d42e2 - | 删除mock,console;upload添加loading | 99d42e2
- | 删除多余字段 | 5ae3973 - | 添加插件数据 | 2f11b42
- | 删除插件携带的多余文件 | 0f392bb
- | 删除没用代码 | 34b20e1
- | 图标修改 | 54bca09 - | 图标修改 | 54bca09
- | 无基本变化 | 21ac4bb - | 无基本变化 | 21ac4bb
- | 日常任务修改 | dfa7ee2
- | 更新代码 | 8c27e68
- | 更新代码 | 1f40a76
- | 格式细节调整 | b907a03
- | 添加插件数据 | 2f11b42
- | 组件新建 | 89c0035
- | 细节调整 | 2cfc09a - | 细节调整 | 2cfc09a
- | 修改角色样式 | 73e268e
- | 组件新建 | 89c0035
- | calendar注释 | a2ec112
- | indexedDB.js格式整理 | b0d3a36
### 🐛 Bug 修复 ### 🐛 Bug 修复
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | 1.时间轴数据渲染 2.时间基准线 | d643af2 - | 1.时间轴数据渲染 2.时间基准线 | d643af2
- | api 存storage | 81032ba - | 插件bug解决 | 41257eb
ID1000343 | 解决向下预加载查询参数时间没+1颗粒度;以及滚动加载颗粒度写死的问题 | 940603a, closes #ID1000343
plugin | 插件解析机制完善 | 0f5a27d
project title | 项目标题修改; 切换角色移除script | 5c20017
roles | 修复默认显示不是我的角色的问题 | b69f94f
role | 切换角色的逻辑修正完善 | 4ae534f
task任务逻辑完善 | 减少初始global及regular的不必要请求 | bd4bd38
- | title.vue根据页面栈显示返回按钮;标题文本超出显示... | 0cbacf4
- | 上下滑动加载定期任务 | 4090d89
- | 上下滚动时间轴 | d533a01
- | 下拉加载定期任务传参,时间格式化修改 | 0b95a0e
- | 任务开始时间延迟插件 | 992a313
- | 修改main | 749ae9a
- | 修改定期任务状态0和4时不加载圆圈 | 30e352f
- | 修改小红点传参 | 87b20fd
- | 修改报错 | 531c14d
- | 修改接口路径 | df6acf2
- | 修改样式 | f0ddc90
- | 修改角色栏组件 | a54c601
- | 切换到默认项目角色没有激活状态的bug | 438d448
- | 切换日历时查询小红点 | 7091789
- | 初始展示角色修改 | 2ac4053 - | 初始展示角色修改 | 2ac4053
- | 定期任务key值修改 | c6688db
- | 定期任务接口 | aa4981c
- | 定期任务插件 | 92b3254
- | 定期任务未加载时,显示空的时间轴并能上下滑动 | ce38093
- | 定期任务本地缓存和api赋值,未完成 | 5a10856 - | 定期任务本地缓存和api赋值,未完成 | 5a10856
定期任务本地缓存和api赋值,未完成 | 定期任务本地缓存和api赋值,未完成 | b22a366 定期任务本地缓存和api赋值,未完成 | 定期任务本地缓存和api赋值,未完成 | b22a366
- | 定期任务插件 | 92b3254
- | 定期任务骨架屏修改 | 8ff72dd - | 定期任务骨架屏修改 | 8ff72dd
- | 定期任务接口 | aa4981c
- | 定期任务未加载时,显示空的时间轴并能上下滑动 | ce38093
- | 定期任务key值修改 | c6688db
- | 骨架屏替换 | e9fdd71
- | 监听时间基本点 | 033fca0
- | 角色栏修改 | 19228d6
- | 角色显示状态修改 | 7d3b906
- | 解决时间轴报错 | da1eece
- | 平车演示临时去掉项目快捷方式的toast提示 | e0b2c23 - | 平车演示临时去掉项目快捷方式的toast提示 | e0b2c23
- | 手动展开日常任务 | 0a4a622 - | 切换到默认项目角色没有激活状态的bug | 438d448
- | 提示信息显示bug及日常任务收缩问题 | f2f06c5 - | 切换日历时查询小红点 | 7091789
- | 插件bug解决 | 41257eb - | 任务开始时间延迟插件 | 992a313
- | 收到消息修改任务状态 | c378063
- | 日历无任务时添加小绿点,时间轴刻度无任务不显示时分 | 0f90868
- | 日常任务html数据查验 | 880ce5c
- | 日常任务插件遍历时的key值修改 | cd26285 - | 日常任务插件遍历时的key值修改 | cd26285
- | 日常任务插件面板高度修改 | 249f9e4 - | 日常任务插件面板高度修改 | 249f9e4
- | 时间轴上下滑动 | 4d0ae46 - | 日常任务html数据查验 | 880ce5c
- | 时间轴上下滚动数据加载bug修改 | e82ede4 - | 日历无任务时添加小绿点,时间轴刻度无任务不显示时分 | 0f90868
- | 上下滚动时间轴 | d533a01
- | 上下滑动加载定期任务 | 4090d89
- | 设置时间轴自动滚动到当前位置 | a3474f8
- | 时间轴插件 | 225d3cc - | 时间轴插件 | 225d3cc
- | 时间轴无任务时时间刻度加载修改 | 4921672
- | 时间轴滚动位置修改 | 551da63
- | 时间轴骨架屏修改 | ca78d02 - | 时间轴骨架屏修改 | ca78d02
- | 监听时间基本点 | 033fca0 - | 时间轴滚动位置修改 | 551da63
- | 角色显示状态修改 | 7d3b906 - | 时间轴上下滚动数据加载bug修改 | e82ede4
- | 角色栏修改 | 19228d6 - | 时间轴上下滑动 | 4d0ae46
- | 解决时间轴报错 | da1eece - | 时间轴无任务时时间刻度加载修改 | 4921672
- | 设置时间轴自动滚动到当前位置 | a3474f8 - | 收到消息修改任务状态 | c378063
- | 手动展开日常任务 | 0a4a622
- | 提示信息显示bug及日常任务收缩问题 | f2f06c5
- | 跳转详情页返回路径修改 | c5e17c0 - | 跳转详情页返回路径修改 | c5e17c0
- | 下拉加载定期任务传参,时间格式化修改 | 0b95a0e
项目列表排序 | 项目列表排序 | 402c563
- | 项目列表排序修改 | fd3c3ac - | 项目列表排序修改 | fd3c3ac
- | 项目列表排序修改 | 59f4c21 - | 项目列表排序修改 | 59f4c21
项目列表排序 | 项目列表排序 | 402c563 - | 修改报错 | 531c14d
- | 骨架屏替换 | e9fdd71 - | 修改定期任务状态0和4时不加载圆圈 | 30e352f
- | 修改角色栏组件 | a54c601
- | 修改接口路径 | df6acf2
- | 修改小红点传参 | 87b20fd
- | 修改样式 | f0ddc90
- | 修改main | 749ae9a
- | api 存storage | 81032ba
ID1000343 | 解决向下预加载查询参数时间没+1颗粒度;以及滚动加载颗粒度写死的问题 | 940603a, closes #ID1000343
plugin | 插件解析机制完善 | 0f5a27d
project title | 项目标题修改; 切换角色移除script | 5c20017
role | 切换角色的逻辑修正完善 | 4ae534f
roles | 修复默认显示不是我的角色的问题 | b69f94f
task任务逻辑完善 | 减少初始global及regular的不必要请求 | bd4bd38
- | title.vue根据页面栈显示返回按钮;标题文本超出显示... | 0cbacf4
### 📝 文档 ### 📝 文档
@ -163,53 +166,59 @@
### 🔧 测试 ### 🔧 测试
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | 暂时移除了jest浏览器配置 | 5088d01
- | 添加测试,测试utils/time.js的computeDurationText | e758010
- | 禁用任务开始操作 | b5425db - | 禁用任务开始操作 | b5425db
- | 添加测试,测试utils/time.js的computeDurationText | e758010
- | 暂时移除了jest浏览器配置 | 5088d01
### 🔨 代码重构 ### 🔨 代码重构
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | 界面样式调整 | 4367249
- | 去掉tailwindcss | 4bed47e
- | 任务状态重构 | 4693655
- | 删除多余的技术验证界面 | 542ae5b
- | 删除多余的weekmode store里的东西 | 0841fe0
- | 下滑时间轴添加备注 | 4fd20e3
- | 修改utils/upload 兼容小程序选择客户端文件上传WBS | 8f49129
- | 重构store分层 | 5f6fff8
calendar | 日历细节调整 | 1a8d6bf calendar | 日历细节调整 | 1a8d6bf
- | project 代码健壮性完善 | a3202c5 - | project 代码健壮性完善 | a3202c5
store/home | 删除store/home | db8a3b4 store/home | 删除store/home | db8a3b4
task beginTime | 格式化任务开始时间 | fbc0301 task beginTime | 格式化任务开始时间 | fbc0301
template | eslint prettier sass uview tailwindcss | 9c966a1 template | eslint prettier sass uview tailwindcss | 9c966a1
tips | 修改任务状态方法重构 | b57d3ac
tip | 任务状态显示及tip组件数据的重构 | 78a5750 tip | 任务状态显示及tip组件数据的重构 | 78a5750
tips | 修改任务状态方法重构 | b57d3ac
title.vue | 移除测试的repeat; 样式细节调整 | c32d2bd title.vue | 移除测试的repeat; 样式细节调整 | c32d2bd
- | 下滑时间轴添加备注 | 4fd20e3
- | 任务状态重构 | 4693655
- | 删除多余的weekmode store里的东西 | 0841fe0
- | 删除多余的技术验证界面 | 542ae5b
- | 去掉tailwindcss | 4bed47e
- | 界面样式调整 | 4367249
- | 重构store分层 | 5f6fff8
### 🚀 性能优化 ### 🚀 性能优化
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | 1.时间轴筛选相同的时间替换数据 2.整理代码 | e082ccb - | 1.时间轴筛选相同的时间替换数据 2.整理代码 | e082ccb
- | 修改代码格式 | 14123d7 - | 测试接口 | 215e074
- | 修改定期任务骨架屏高度 | 909a734
- | 小红点api缓存修改 | e992343
- | 插件查询及展示 | 4dba770 - | 插件查询及展示 | 4dba770
- | 角色栏文字颜色修改 | 215c6b3
- | 解决警告 | c932b09
- | 日历的更改 | 7353ac8
- | 数据存储,避免重复调用接口 | d22308a - | 数据存储,避免重复调用接口 | d22308a
- | 提交本地代码 | e0cf2ed
- | 小红点api缓存修改 | e992343
- | 修改代码格式 | 14123d7
- | 修改定期任务骨架屏高度 | 909a734
- | 整理代码 | 7a55315 - | 整理代码 | 7a55315
- | 日历的更改 | 7353ac8
- | 测试接口 | 215e074
- | 组件文件夹新建 | 22bfe7b - | 组件文件夹新建 | 22bfe7b
- | 组件文件夹新建 | 17bb8c9 - | 组件文件夹新建 | 17bb8c9
- | 组件文件夹新建 | 1421504 - | 组件文件夹新建 | 1421504
- | 角色栏文字颜色修改 | 215c6b3
- | 解决警告 | c932b09
### chore ### chore
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | 删除多余的构建的命令 | 3f4eb2f
- | 添加mp-weixin的构建命令 | 3776a67
信息配置 | 配置eslint等配置 | 7421443
- | 修复不能build的问题 | 0b7b91e
- | api 封装 | 8dcb8a2 - | api 封装 | 8dcb8a2
- | dart-sass替换node-sass;删除多余的uni平台包 | 519f28b - | dart-sass替换node-sass;删除多余的uni平台包 | 519f28b
- | env host修改 | a79a4a5 - | env host修改 | a79a4a5
@ -220,10 +229,6 @@
pwa 小程序 | 移除了pwa,alloyFinger添加平台判断 | 875fab4 pwa 小程序 | 移除了pwa,alloyFinger添加平台判断 | 875fab4
- | uview-ui | a9ea34b - | uview-ui | a9ea34b
v3.0.1 | tall api 地址从1.0改成了3.0 | db5afd5 v3.0.1 | tall api 地址从1.0改成了3.0 | db5afd5
信息配置 | 配置eslint等配置 | 7421443
- | 修复不能build的问题 | 0b7b91e
- | 删除多余的构建的命令 | 3f4eb2f
- | 添加mp-weixin的构建命令 | 3776a67
范围|描述|commitId 范围|描述|commitId

4
src/common/styles/app.scss

@ -1,7 +1,3 @@
.min-0 { .min-0 {
min-width: 0; min-width: 0;
} }
.flex-shrink-0 {
flex-shrink: 0;
}

253
src/mixins/mixin.js

@ -0,0 +1,253 @@
import { mapState, mapActions } from 'vuex';
// import { getImageCode } from 'api/user';
// import clipboard from "../../common/script/dc-clipboard/clipboard.js"
const mixin = {
data() {
return {
rules: {
phone: [
{
required: true,
message: '请输入手机号',
trigger: ['change', 'blur'],
},
{
validator: (rule, value) => {
// 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
return this.$u.test.mobile(value);
},
message: '手机号码不正确',
// 触发器可以同时用blur和change,二者之间用英文逗号隔开
trigger: ['change', 'blur'],
},
],
verificationCodeValue: [
{
required: true,
message: '请输入图形验证码',
trigger: ['change', 'blur'],
},
{
type: 'number',
message: '图形验证码只能为数字',
trigger: ['change', 'blur'],
},
],
smsCode: [
{
required: true,
message: '请输入验证码',
trigger: ['change', 'blur'],
},
{
type: 'number',
message: '验证码只能为数字',
trigger: ['change', 'blur'],
},
],
account: [
{
required: true,
message: '请输入用户名',
trigger: ['change', 'blur'],
},
{
min: 2,
max: 20,
message: '用户名长度在2到20个字符',
trigger: ['change', 'blur'],
},
{
pattern: /^[a-zA-Z0-9._-]{2,20}$/,
message: '请输入2-20位字母、数字、汉字或字符"_ - ."',
trigger: ['change', 'blur'],
},
],
password: [
{
required: true,
message: '请输入密码',
trigger: ['change', 'blur'],
},
{
min: 6,
max: 20,
message: '密码长度在6到20个字符',
trigger: ['change', 'blur'],
},
{
// 正则不能含有两边的引号
pattern: /^[a-zA-Z0-9._-]{6,20}$/,
message: '请输入6-20位字母、数字、汉字或字符"_ - ."',
trigger: ['change', 'blur'],
},
],
},
errorType: ['message'],
labelPosition: 'left',
border: false,
smsCode: '', // 短信验证码
showInterval: false,
interval: 120,
codeTimer: null,
showPaste: false,
};
},
computed: mapState('user', ['user']),
onReady() {
this.$refs.uForm.setRules(this.rules);
},
methods: {
...mapActions('user', ['sendCode']),
// 获取图形验证码
async getImageCode() {
// this.$util.showLoading();
// try {
// const data = await getImageCode();
// const { imageBase64, verificationCodeId } = data;
// this.imageBase64 = imageBase64 || '';
// this.verificationCodeId = verificationCodeId || '';
// uni.hideLoading();
// } catch (error) {
// uni.hideLoading();
// this.$t.ui.showToast(error);
// }
},
//有图片验证码的值
hasvalue() {
if (this.model.smsCode || this.model.showPaste) return;
if (!this.verifyPhone(this.model.phone)) {
this.$t.ui.showToast('请输入正确的手机号');
return;
}
if (!this.model.verificationCodeValue) {
this.$t.ui.showToast('请输入图形验证码');
return;
}
this.getCode();
},
// 获取验证码
async getCode() {
// try {
// const { phone, verificationCodeValue } = this.model;
// const { verificationCodeId } = this;
// if (!verificationCodeId || !verificationCodeValue) {
// this.$t.ui.showToast('缺少图形验证码参数');
// return;
// }
// const params = {
// phone,
// verificationCodeId,
// verificationCodeValue,
// };
// const date = await this.sendCode(params);
// this.getCodeInterval();
// this.showPaste = true;
// } catch (err) {
// throw err;
// }
},
// 获取验证码倒计时
getCodeInterval() {
this.showInterval = true;
this.codeTimer = setInterval(() => {
if (this.interval === 0) {
clearInterval(this.codeTimer);
this.codeTimer = null;
this.showInterval = false;
this.interval = 120;
return;
}
this.interval = this.interval - 1;
}, 1000);
},
// 验证信息
checkRules() {
const { smsCode, phone, user } = this;
if (!this.verifyPhone(phone)) {
this.$t.ui.showToast('请输入正确的手机号');
return false;
}
if (!smsCode) {
this.$t.ui.showToast('验证码无效');
return false;
}
if (phone === user.phone) {
this.$t.ui.showToast('新手机号不能与旧手机号相同');
return;
}
return true;
},
// 粘贴
// setCode() {
// // 获取粘贴板内容
// // 小程序平台
// //#ifdef MP-WEIXIN
// var _this = this
// uni.getClipboardData({
// success (res) {
// _this.smsCode = res.data;
// }
// });
// //#endif
// // 非小程序平台
// //#ifndef MP-WEIXIN
// this.getClipboardContents()
// //#endif
// },
// 非小程序平台粘贴
// async getClipboardContents() {
// try {
// const text = await navigator.clipboard.readText();
// this.smsCode = text;
// } catch (err) {
// console.error('Failed to read clipboard contents: ', err);
// }
// },
/**
* 验证手机号格式
* @param {string} phone 手机号
*/
verifyPhone(phone) {
const phoneExg = /^1\d{10}$/;
return phoneExg.test(phone);
},
/**
* 验证账号/密码 格式
* @param {string} account 账号
*/
verifyLoginname(account) {
const accountExg = /^[a-zA-Z0-9._-]{2,20}$/;
return accountExg.test(account);
},
// 微信登录
handleWxLogin() {
// const origin = 'https://test.tall.wiki/pt-mui'; // 测试
// const appid = 'wxd1842e073e0e6d91';
// const state = 'wx_web';
// const href = 'https://open.weixin.qq.com/connect/qrconnect';
// // eslint-disable-next-line
// window.location.href =
// `${href}?appid=${appid}&redirect_uri=${origin}&response_type=code&scope=snsapi_login&state=${state}#wechat_redirect`;
},
},
};
export default mixin;

29
src/pages.json

@ -17,6 +17,35 @@
"style": { "style": {
"navigationBarTitleText": "项目详情页" "navigationBarTitleText": "项目详情页"
} }
},
{
"path": "pages/user/login",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "手机号登录"
}
},
{
"path": "pages/user/rigister",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "注册"
}
},
{
"path": "pages/user/accountLogin",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "用户名登录"
}
},
{
"path": "pages/user/agreement",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "用户协议",
"enablePullDownRefresh": false
}
} }
], ],
"globalStyle": { "globalStyle": {

138
src/pages/user/accountLogin.vue

@ -0,0 +1,138 @@
<template>
<view>
<!-- #ifdef H5 -->
<view class="top-nav relative text-center">
<u-icon class="icon absolute" name="arrow-left" size="32" @click="toBack"></u-icon>
<text>用户名登录</text>
</view>
<!-- #endif -->
<view class="u-p-l-50 u-p-r-50 u-p-t-30">
<u-form :model="model" :rules="rules" ref="uForm" :error-type="errorType">
<u-form-item :label-position="labelPosition" label="用户名" prop="account" label-width="150">
<u-input :border="border" placeholder="请输入用户名" v-model="model.account" type="text"></u-input>
</u-form-item>
<u-form-item :label-position="labelPosition" label="密码" prop="password" label-width="150">
<u-input :password-icon="true" :border="border" type="password" v-model="model.password" placeholder="请输入密码"></u-input>
</u-form-item>
<view class="flex flex-nowrap flex-row-reverse">
<view class="flex-sub"></view>
<view class="u-m-t-30 u-font-12 text-grey" @click="openPage('/pages/user/forgetPassword')">忘记密码</view>
</view>
</u-form>
<view class="u-m-t-50">
<u-button @click="submit" type="primary">立即登录</u-button>
</view>
<view class="flex justify-between">
<view class="u-m-t-30" style="color: #2885ed" @click="openPage('/pages/user/rigister')"> 新用户注册</view>
<view class="u-m-t-30" style="color: #2885ed" @click="openPage('/pages/user/login')">手机号登录 </view>
</view>
<view style="margin-top: 200rpx; text-align: center; color: #999999; font-size: 35rpx">快速登录</view>
<view style="text-align: center; margin-top: 20rpx" @click="handleWxLogin">
<image src="/static/weixinIcon.png" mode="" style="width: 85rpx; height: 85rpx"></image>
</view>
<!-- <view class="bottom-side-otherLogin" @click="getWeChatCode" v-if="isWeixin">
<text>其他社交账号登录</text>
<image src="/static/weixinIcon.png"></image>
</view> -->
</view>
</view>
</template>
<script>
import mixin from '@/mixins/mixin';
export default {
mixins: [mixin],
data() {
return {
model: {
account: '',
password: '',
},
};
},
methods: {
submit() {
this.$refs.uForm.validate(valid => {
if (valid) {
this.login();
} else {
console.log('验证失败');
}
});
},
/**
* 登录
* @param {number} client 登录客户端
* @param {string} identifier 手机号
* @param {string} credential 验证码
* @param {number} type 登录类型
*/
async login() {
this.$t.ui.showLoading();
// try {
// const { account, password } = this.model;
// const params = {
// client: 1,
// data: {
// identifier: account,
// credential: password,
// },
// type: 3,
// };
// await this.signIn(params);
// this.$t.ui.showToast('');
// uni.switchTab({ url: '/pages/index/index' });
// this.$t.ui.hideLoading();
// } catch (error) {
// this.$t.ui.hideLoading();
// this.$t.ui.showToast(error);
// }
},
/**
* 页面跳转
*/
openPage(url) {
uni.navigateTo({ url: url });
},
/**
* 返回上一页
*/
toBack() {
uni.navigateBack({ delta: 1 });
},
},
};
</script>
<style scoped lang="scss">
page {
background-color: #fff;
}
.top-nav {
height: 80rpx;
line-height: 80rpx;
font-size: 32rpx;
.icon {
height: 80rpx;
line-height: 80rpx;
left: 30rpx;
}
}
.text-grey {
color: $u-type-info;
}
</style>

30
src/pages/user/agreement.vue

@ -0,0 +1,30 @@
<template>
<view>
<web-view class="webview" src="https://www.yuque.com/docs/share/2de362e1-33fb-460a-92ca-5e8ef57f6d59?# 《时物链条用户协议》"></web-view>
<!-- <u-modal title="时物链条用户协议" v-model="showAgreement" show-cancel-button @confirm="$emit('confirm')" @cancel="$emit('cancel')">
<iframe
src="https://www.yuque.com/docs/share/2de362e1-33fb-460a-92ca-5e8ef57f6d59?# 《时物链条用户协议》"
frameborder="0"
scrolling="no"
style="width: 100%;height: 100%"
></iframe>
</u-modal> -->
</view>
</template>
<script>
export default {
props: {
showAgreement: {
type: Boolean,
default: false,
},
},
data() {
return {};
},
methods: {},
};
</script>
<style></style>

154
src/pages/user/login.vue

@ -0,0 +1,154 @@
<template>
<view>
<!-- #ifdef H5 -->
<view class="top-nav relative text-center">
<u-icon class="icon absolute" name="arrow-left" size="32" @click="toBack"></u-icon>
<text>手机号登录</text>
</view>
<!-- #endif -->
<view class="u-p-l-50 u-p-r-50 u-p-t-30">
<u-form :model="model" :rules="rules" ref="uForm" :error-type="errorType">
<u-form-item :label-position="labelPosition" label="手机号码" prop="phone" label-width="150">
<u-input :border="border" placeholder="请输入手机号" v-model="model.phone" type="number"></u-input>
</u-form-item>
<u-form-item :label-position="labelPosition" label="图形验证码" prop="verificationCodeValue" label-width="150">
<u-input :border="border" placeholder="请输入计算结果" v-model="model.verificationCodeValue" type="number"> </u-input>
<image slot="right" :src="imageBase64" mode="aspectFit" class="code-image" @click="getImageCode"> </image>
</u-form-item>
<u-form-item :label-position="labelPosition" label="验证码" prop="smsCode" label-width="150">
<u-input @focus="hasvalue" :border="border" placeholder="请输入验证码" v-model="model.smsCode" type="text"> </u-input>
<u-button slot="right" type="primary" size="mini" v-show="showPaste" @click="setCode" class="u-m-r-20"> 粘贴</u-button>
<u-button slot="right" size="mini" v-if="showInterval">{{ interval }}</u-button>
</u-form-item>
</u-form>
<view class="u-m-t-50">
<u-button @click="submit" type="primary">立即登录</u-button>
</view>
<view class="flex justify-between">
<view class="u-m-t-30" style="color: #2885ed" @click="openPage('/pages/user/rigister')"> 新用户注册</view>
<view class="u-m-t-30" style="color: #2885ed" @click="openPage('/pages/user/accountLogin')">用户名登录 </view>
</view>
<view class="text-center" style="margin-top: 200rpx; text-align: center; color: #999999; font-size: 35rpx"> 快速登录 </view>
<view style="text-align: center; margin-top: 20rpx" @click="handleWxLogin">
<image src="../../static/weixinIcon.png" mode="" style="width: 85rpx; height: 85rpx"></image>
</view>
</view>
</view>
</template>
<script>
// import { mapMutations } from 'vuex';
import mixin from '@/mixins/mixin';
let timer = null;
export default {
mixins: [mixin],
data() {
return {
model: {
phone: '',
verificationCodeValue: '',
smsCode: '',
},
imageBase64: '', //
verificationCodeId: '', // id
data: {},
treeId: '',
};
},
// onLoad(options) {
// this.getImageCode();
// },
methods: {
// ...mapMutations('user', ['setToken', 'setUser']),
submit() {
this.$refs.uForm.validate(valid => {
if (valid) {
this.login();
console.log('验证通过');
} else {
console.log('验证失败');
}
});
},
/**
* 登录
* @param {number} client 登录客户端
* @param {string} identifier 手机号
* @param {string} credential 验证码
* @param {number} type 登录类型
*/
async login() {
this.$t.ui.showLoading();
// try {
// const { phone, smsCode } = this.model;
// const params = {
// client: 1,
// data: {
// identifier: phone,
// credential: smsCode,
// },
// type: 1,
// };
// await this.signIn(params);
// uni.switchTab({ url: '/pages/index/index' });
// this.$t.ui.hideLoading();
// } catch (error) {
// this.$t.ui.hideLoading();
// this.$t.ui.showToast(error);
// }
},
/**
* 页面跳转
*/
openPage(url) {
uni.navigateTo({ url: url });
},
/**
* 返回上一页
*/
toBack() {
uni.navigateBack({ delta: 1 });
},
},
//
onUnload() {
timer && clearInterval(timer);
timer = null;
},
};
</script>
<style scoped lang="scss">
page {
background-color: #fff;
}
.top-nav {
height: 80rpx;
line-height: 80rpx;
font-size: 32rpx;
.icon {
height: 80rpx;
line-height: 80rpx;
left: 30rpx;
}
}
.code-image {
width: 200rpx;
height: 70rpx;
}
</style>

179
src/pages/user/rigister.vue

@ -0,0 +1,179 @@
<template>
<view>
<!-- #ifdef H5 -->
<view class="top-nav relative text-center">
<u-icon class="icon absolute" name="arrow-left" size="32" @click="toBack"></u-icon>
<text>注册</text>
</view>
<!-- #endif -->
<view class="u-p-l-50 u-p-r-50 u-p-t-30">
<u-form :model="model" :rules="rules" ref="uForm" :error-type="errorType">
<u-form-item :label-position="labelPosition" label="手机号码" prop="phone" label-width="150">
<u-input :border="border" placeholder="请输入手机号" v-model="model.phone" type="number"></u-input>
</u-form-item>
<u-form-item :label-position="labelPosition" label="图形验证码" prop="verificationCodeValue" label-width="150">
<u-input :border="border" placeholder="请输入计算结果" v-model="model.verificationCodeValue" type="number"> </u-input>
<image slot="right" :src="imageBase64" mode="aspectFit" class="code-image" @click="getImageCode"> </image>
</u-form-item>
<u-form-item :label-position="labelPosition" label="验证码" prop="smsCode" label-width="150">
<u-input @focus="hasvalue" :border="border" placeholder="请输入验证码" v-model="model.smsCode" type="text"> </u-input>
<u-button slot="right" type="primary" size="mini" v-show="showPaste" @click="setCode" class="u-m-r-20"> 粘贴</u-button>
<u-button slot="right" size="mini" v-if="showInterval">{{ interval }}</u-button>
</u-form-item>
<u-form-item :label-position="labelPosition" label="用户名" prop="account" label-width="150">
<u-input :border="border" placeholder="请输入用户名" v-model="model.account" type="text"></u-input>
</u-form-item>
<u-form-item :label-position="labelPosition" label="密码" prop="password" label-width="150">
<u-input :password-icon="true" :border="border" type="password" v-model="model.password" placeholder="请输入密码"></u-input>
</u-form-item>
</u-form>
<view class="u-m-t-50">
<u-button @click="submit" type="primary">立即注册</u-button>
</view>
<view class="flex-direction u-m-t-30">
<view class="flex flex-nowrap u-m-b-20">
<u-checkbox v-model="checked" @change="changeChecked"></u-checkbox>
<view class="agreement-text">
已阅读并同意使用
<span class="text-blue" @click="openPage('/pages/user/agreement')">时物链条用户协议</span>
</view>
</view>
<p class="text-blue u-m-l-70">没有套路真实需求</p>
</view>
<view class="flex flex-nowrap flex-row-reverse">
<view class="flex-sub"></view>
<view class="u-m-t-60 text-blue" @click="openPage('/pages/user/accountLogin')">已有账号去登录</view>
</view>
</view>
</view>
</template>
<script>
import mixin from '@/mixins/mixin';
let timer = null;
export default {
mixins: [mixin],
data() {
return {
model: {
phone: '',
verificationCodeValue: '',
smsCode: '',
account: '',
password: '',
},
imageBase64: '', //
verificationCodeId: '', // id
data: {},
treeId: '',
checked: false,
};
},
// onLoad(options) {
// this.getImageCode();
// },
methods: {
submit() {
this.$refs.uForm.validate(valid => {
if (valid) {
this.signUp();
} else {
console.log('验证失败');
}
});
},
changeChecked() {
this.checked = !this.checked;
},
/**
* 注册
* @param {number} client 登录客户端
* @param {string} identifier 手机号
* @param {string} credential 验证码
* @param {number} type 登录类型
*/
async signUp() {
this.$t.ui.showLoading();
// todo:
try {
// const { phone, smsCode, account, password } = this.model;
const { checked } = this;
if (!checked) {
this.$t.ui.showToast('请阅读并同意使用用户协议');
return;
}
// const params = {
// account: account,
// password: password,
// phone: phone,
// smsCode: smsCode,
// };
// await signup(params);
// this.$t.ui.showToast('');
// this.openPage('/pages/user/accountLogin');
this.$t.ui.hideLoading();
} catch (error) {
this.$t.ui.hideLoading();
this.$t.ui.showToast(error.msg);
}
},
/**
* 页面跳转
*/
openPage(url) {
uni.navigateTo({ url: url });
},
/**
* 返回上一页
*/
toBack() {
uni.navigateBack({ delta: 1 });
},
},
//
onUnload() {
timer && clearInterval(timer);
timer = null;
},
};
</script>
<style scoped lang="scss">
page {
background-color: #fff;
}
.top-nav {
height: 80rpx;
line-height: 80rpx;
font-size: 32rpx;
.icon {
height: 80rpx;
line-height: 80rpx;
left: 30rpx;
}
}
.code-image {
width: 200rpx;
height: 70rpx;
}
.text-blue {
color: #0081ff;
}
</style>

BIN
src/static/weixinIcon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Loading…
Cancel
Save