登录,设置密码,修改密码,我的,首页,会议列表(接口逻辑已写,差加密文件的完善,代联调)
@@ -0,0 +1,5 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/income_payments_applet.iml" filepath="$PROJECT_DIR$/.idea/income_payments_applet.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -5,7 +5,22 @@ App({
|
||||
const logs = wx.getStorageSync('logs') || []
|
||||
logs.unshift(Date.now())
|
||||
wx.setStorageSync('logs', logs)
|
||||
|
||||
wx.setStorage({
|
||||
key:"key",
|
||||
data:"登录过,存到了缓存flag,跳转首页"
|
||||
})
|
||||
wx.getStorage({
|
||||
key: 'key',
|
||||
success (res) {// 缓存中登录过,直接进小程序
|
||||
console.log(res.data)
|
||||
wx.switchTab({
|
||||
url: 'pages/home/home',
|
||||
})
|
||||
},
|
||||
fail: function(){
|
||||
// 缓存中没有登录过默认app.json的登录页
|
||||
}
|
||||
})
|
||||
// 登录
|
||||
wx.login({
|
||||
success: res => {
|
||||
|
||||
@@ -1,40 +1,29 @@
|
||||
{
|
||||
"pages":[
|
||||
"pages/notice/notice",
|
||||
"pages/project/project",
|
||||
"pages/meeting/meeting",
|
||||
"pages/login/login",
|
||||
"pages/home/home",
|
||||
"pages/mine/mine",
|
||||
"pages/index/index",
|
||||
"pages/logs/logs"
|
||||
"pages/logs/logs",
|
||||
"pages/setPassword/setPassword"
|
||||
],
|
||||
"window":{
|
||||
"backgroundTextStyle":"light",
|
||||
"navigationBarBackgroundColor": "#fff",
|
||||
"navigationBarTitleText": "Weixin",
|
||||
"navigationBarTitleText": "",
|
||||
"navigationBarTextStyle":"black"
|
||||
},
|
||||
"tabBar": {
|
||||
"selectedColor": "#08A09A",
|
||||
"color": "#999",
|
||||
"backgroundColor": "#fff",
|
||||
"list": [
|
||||
"borderStyle": "white",
|
||||
"list": [
|
||||
{
|
||||
"text": "消息",
|
||||
"pagePath": "pages/notice/notice",
|
||||
"iconPath": "./assets/images/notice.png",
|
||||
"selectedIconPath": "./assets/images/notice-active.png"
|
||||
},
|
||||
{
|
||||
"text": "项目",
|
||||
"pagePath": "pages/project/project",
|
||||
"iconPath": "./assets/images/project.png",
|
||||
"selectedIconPath": "./assets/images/project-active.png"
|
||||
},
|
||||
{
|
||||
"text": "会议",
|
||||
"pagePath": "pages/meeting/meeting",
|
||||
"iconPath": "./assets/images/meeting.png",
|
||||
"selectedIconPath": "./assets/images/meeting-active.png"
|
||||
"text": "首页",
|
||||
"pagePath": "pages/home/home",
|
||||
"iconPath": "./assets/images/home.png",
|
||||
"selectedIconPath": "./assets/images/home-active.png"
|
||||
},
|
||||
{
|
||||
"text": "我的",
|
||||
|
||||
@@ -767,4 +767,75 @@ color: #2A2A2A;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
border-top: 10rpx solid #f6f8fc;
|
||||
}
|
||||
/*
|
||||
* author: yaoyanan
|
||||
* remark: 表单的基本样式
|
||||
*/
|
||||
|
||||
.form-box{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.form-item{
|
||||
display: flex;
|
||||
width: 300px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 30px;
|
||||
}
|
||||
.form-item:not(:first-child){
|
||||
margin-top: 20px;
|
||||
}
|
||||
.form-item .text-label{
|
||||
width: 65px;
|
||||
flex-shrink: 0;
|
||||
text-align: right;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
margin-right: 15px;
|
||||
}
|
||||
.form-item .text-value{
|
||||
flex: 1;
|
||||
}
|
||||
.form-item .text-value .flex-center{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.form-item .text-value input{
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
border: 0.5px solid #eee;
|
||||
height: 30px;
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.form-box .btn-area button{
|
||||
margin: auto;
|
||||
width: 100%;
|
||||
margin-top: 50px;
|
||||
}
|
||||
.form-item .captcha{
|
||||
width: 70px;
|
||||
margin-left: 10px;
|
||||
height: 30px;
|
||||
background-color: #07c160;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.form-item .count{
|
||||
background-color: #aaa;
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 224 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 156 KiB |
|
After Width: | Height: | Size: 354 B |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 327 B |
|
After Width: | Height: | Size: 434 B |
|
After Width: | Height: | Size: 4.0 KiB |
@@ -2,7 +2,7 @@ import http from './http.js'
|
||||
|
||||
// let baseUrl = 'https://share.hzwlsoft.com'
|
||||
// let baseUrl = 'http://localhost:8080'
|
||||
let baseUrl = 'http://10.0.1.63:8080'
|
||||
let baseUrl = 'http://192.168.18.133:8080'
|
||||
// let baseUrl = 'http://192.168.1.110:8080'
|
||||
/* 配置路径 */
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ let headerDefault1 = {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
let TokenKey = 'X-Access-Token'
|
||||
let baseUrl = 'http://10.0.1.63:8080'
|
||||
let baseUrl = 'http://192.168.18.133:8080'
|
||||
// let baseUrl = 'http://localhost:8080'
|
||||
const http = (method, url, data, header= headerDefault) => {
|
||||
let Authorization = wx.getStorageSync(TokenKey) ? wx.getStorageSync(TokenKey) : '';
|
||||
@@ -23,6 +23,7 @@ const http = (method, url, data, header= headerDefault) => {
|
||||
data: data,
|
||||
success: res => {
|
||||
console.log(res)
|
||||
wx.hideLoading();
|
||||
if (res.statusCode === 200) {
|
||||
// 接口请求错误的时候提示
|
||||
if((res.data.code !== 200 && res.data.code !== 0) && (res.data.message)) {
|
||||
@@ -35,7 +36,6 @@ const http = (method, url, data, header= headerDefault) => {
|
||||
}
|
||||
// 200: 服务端业务处理正常结束
|
||||
resolve(res.data)
|
||||
wx.hideLoading();
|
||||
} else {
|
||||
console.error(res.data);
|
||||
reject(res.data);
|
||||
|
||||
@@ -1,17 +1,33 @@
|
||||
import http from './http.js'
|
||||
let URL_CONFIG = '/api/'
|
||||
let URL_CONFIG = '/jero-boot/'
|
||||
const UserApi = {
|
||||
// 登录
|
||||
login: (params) => http.post(`${URL_CONFIG}sys/login`, params),
|
||||
// // 登录
|
||||
// login: (params) => http.post(`${URL_CONFIG}sys/login`, params),
|
||||
// // 获得公钥
|
||||
// getRSAPublicKey: (params) => http.get(`${URL_CONFIG}sys/getRSAPublicKey`, params),
|
||||
// // 图片的验证码
|
||||
// getImgCode: (params, urlParam) => http.get(`${URL_CONFIG}sys/randomImage/${urlParam}`, params),
|
||||
// // 退出
|
||||
// logout: (params) => http.post(`${URL_CONFIG}sys/logout`, params),
|
||||
// //修改密码
|
||||
// upDatePass:(params) => http.put(`${URL_CONFIG}sys/user/updatePassword`, params),
|
||||
/**
|
||||
* author: yaoyanan
|
||||
* **/
|
||||
// 获得公钥
|
||||
getRSAPublicKey: (params) => http.get(`${URL_CONFIG}sys/getRSAPublicKey`, params),
|
||||
// 图片的验证码
|
||||
getImgCode: (params, urlParam) => http.get(`${URL_CONFIG}sys/randomImage/${urlParam}`, params),
|
||||
// 退出
|
||||
logout: (params) => http.post(`${URL_CONFIG}sys/logout`, params),
|
||||
//修改密码
|
||||
upDatePass:(params) => http.put(`${URL_CONFIG}sys/user/updatePassword`, params),
|
||||
|
||||
// 发送短信验证码
|
||||
sendCode: (params) => http.get(`${URL_CONFIG}company/sendVerificationCode`, params),
|
||||
// 短信登录
|
||||
codeLogin: (params) => http.post(`${URL_CONFIG}company/smsLogin`, params),
|
||||
// 设置密码
|
||||
setPassword: (params) => http.post(`${URL_CONFIG}company/changePassword`, params),
|
||||
// 短信验证码修改密码
|
||||
updatePassword: (params) => http.post(`${URL_CONFIG}company/verificationChangePassword`, params),
|
||||
// 个人信息
|
||||
mineInfo: (params) => http.get(`${URL_CONFIG}company/payContactsManagement/queryByIdMeeting`, params),
|
||||
// 编辑个人信息提交
|
||||
editMineInfo: (params) => http.get(`${URL_CONFIG}company/payContactsManagement/companyEdit`, params),
|
||||
}
|
||||
|
||||
export default UserApi
|
||||
@@ -1,11 +1,11 @@
|
||||
// pages/notice/notice.js
|
||||
// pages/meeting/meeting.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -0,0 +1,4 @@
|
||||
<!--pages/meeting/meeting.wxml-->
|
||||
<view>
|
||||
<text>分标委</text>
|
||||
</view>
|
||||
@@ -0,0 +1,20 @@
|
||||
/* pages/meeting/meeting.wxss */
|
||||
.select-list {
|
||||
height: 92rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.select-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.select-item image {
|
||||
width: 21rpx;
|
||||
height: 12rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
// pages/meeting/meeting.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<!--pages/meeting/meeting.wxml-->
|
||||
<view>
|
||||
<text>资料网员</text>
|
||||
</view>
|
||||
@@ -0,0 +1,20 @@
|
||||
/* pages/meeting/meeting.wxss */
|
||||
.select-list {
|
||||
height: 92rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.select-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.select-item image {
|
||||
width: 21rpx;
|
||||
height: 12rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
// pages/home/home.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
selectArr: [
|
||||
{ path: '../../assets/images/laikuan.png', text: '来款项目' },
|
||||
{ path: '../../assets/images/gongzuozu.png', text: '工作组' },
|
||||
{ path: '../../assets/images/fenbiaowei.png', text: '分标委' },
|
||||
{ path: '../../assets/images/huiyi.png', text: '会议活动' },
|
||||
{ path: '../../assets/images/ziliao.png', text: '资料网员' },
|
||||
]
|
||||
},
|
||||
// 点击首页的五个选项跳转页面
|
||||
clickSelect(e){
|
||||
let index = e.currentTarget.dataset.index
|
||||
let url = ''
|
||||
if(index === 0) { // 来款项目
|
||||
url = '../project/project'
|
||||
} else if(index === 1) { // 工作组
|
||||
url = '../work/work'
|
||||
} else if(index === 2) { // 分标委
|
||||
url = '../committee/committee'
|
||||
} else if(index === 3) { // 会议活动
|
||||
url = '../meeting/meeting'
|
||||
} else{ // 资料网员
|
||||
url = '../data/data'
|
||||
}
|
||||
wx.navigateTo({
|
||||
url,
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<view>
|
||||
<view class="home-bg">
|
||||
<!-- 顶部背景图 mode="scaleToFill" 按照宽高填充,忽略图片原比例-->
|
||||
<image mode="scaleToFill" src="../../assets/images/home-bg.png"></image>
|
||||
<!-- 顶部选项栏 -->
|
||||
<view class="select-box">
|
||||
<view class="select">
|
||||
<view class="select-item" wx:for="{{selectArr}}" wx:for-item="item" wx:key="path" bindtap="clickSelect" data-item="{{item}}" data-index="{{index}}">
|
||||
<view class="image-box">
|
||||
<image mode="scaleToFill" src="{{item.path}}"></image>
|
||||
</view>
|
||||
<text>{{item.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,35 @@
|
||||
page{
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
.home-bg{
|
||||
height: 200pt;
|
||||
}
|
||||
.select-box{
|
||||
transform: translateY(-40pt);
|
||||
padding: 0 15pt;
|
||||
}
|
||||
.select-box .select{
|
||||
height: 115pt;
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
}
|
||||
.select-item{
|
||||
flex: 1;
|
||||
font-size: 10pt;
|
||||
color: #666666;
|
||||
flex-direction: column;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.image-box{
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.image-box image{
|
||||
max-height: 100%;
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
// pages/mine/mine.js
|
||||
import UserApi from '../../assets/js/http/userApi'
|
||||
import {JSEncrypt} from '../../assets/js/jsencrypt/jsencrypt'
|
||||
var countdown = 60; // 倒计时秒数
|
||||
Page({
|
||||
data: {
|
||||
phone: '',
|
||||
captcha: '',
|
||||
count: 60,
|
||||
rsaPublicKey: '',
|
||||
showGetCaptcha: true
|
||||
},
|
||||
|
||||
bindInputPhone(e) {
|
||||
this.setData({
|
||||
phone: e.detail.value
|
||||
})
|
||||
},
|
||||
// 获取验证码
|
||||
getVerCode() {
|
||||
if (/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(this.data.phone)) {
|
||||
UserApi.sendCode({
|
||||
phone: this.data.phone
|
||||
}).then(res => {
|
||||
// 获取成功,倒计时 start
|
||||
if (res.success) {
|
||||
this.countDown()
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '获取验证码失败',
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '请输入正确的手机号',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
},
|
||||
// 倒计时
|
||||
countDown(){
|
||||
if (countdown === 0) {
|
||||
this.setData({
|
||||
showGetCaptcha: true
|
||||
})
|
||||
countdown = 60;
|
||||
return;
|
||||
} else {
|
||||
this.setData({
|
||||
showGetCaptcha: false
|
||||
})
|
||||
countdown--;
|
||||
this.setData({
|
||||
count: countdown
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.countDown()
|
||||
}, 1000)
|
||||
// 倒计时 end
|
||||
},
|
||||
// 登录
|
||||
formSubmit(e) {
|
||||
console.log('form发生了submit事件,携带数据为:', e.detail.value)
|
||||
if (e.detail.value.phone && e.detail.value.captcha) {
|
||||
wx.showLoading({
|
||||
title: '正在登录...',
|
||||
icon: 'loading'
|
||||
})
|
||||
// 新建JSEncrypt对象
|
||||
let encrypt = new JSEncrypt()
|
||||
encrypt.setPublicKey(this.data.rsaPublicKey) // 公钥加密
|
||||
let params = {
|
||||
username: encrypt.encrypt(e.detail.value.phone), // 手机号加密
|
||||
captcha: e.detail.value.captcha,
|
||||
rsaPublicKey: this.data.rsaPublicKey
|
||||
}
|
||||
// 请求短信登录start
|
||||
UserApi.codeLogin(params).then(res => {
|
||||
if (res.success) {
|
||||
wx.hideLoading()
|
||||
} else {
|
||||
wx.hideLoading()
|
||||
wx.showToast({
|
||||
title: '登录失败',
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
// 登录失败
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '请输入正确的验证码',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
wx.navigateTo({
|
||||
url: '../setPassword/setPassword',
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
UserApi.getRSAPublicKey().then(res => {
|
||||
if (res.success) {
|
||||
this.setData({
|
||||
rsaPublicKey: res.result
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<view class="container-box">
|
||||
<form bindsubmit="formSubmit" class="form-box">
|
||||
<view class="form-item">
|
||||
<view class="text-label">手机号</view>
|
||||
<view class="text-value">
|
||||
<input name="phone" bindinput="bindInputPhone" value="{{phone}}" placeholder="请输入手机号" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="text-label">验证码</view>
|
||||
<view class="text-value">
|
||||
<input name="captcha" placeholder="请输入验证码" />
|
||||
</view>
|
||||
<view wx:if="{{showGetCaptcha}}" class="captcha" bindtap="getVerCode">获取验证码</view>
|
||||
<view wx:else="{{showGetCaptcha}}" class="captcha count">{{count}}</view>
|
||||
</view>
|
||||
<view class="btn-area">
|
||||
<button type="primary" formType="submit">登录</button>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
@@ -0,0 +1,8 @@
|
||||
page {
|
||||
overflow-x: hidden;
|
||||
width: 100%;
|
||||
color: #333;
|
||||
}
|
||||
.form-box{
|
||||
transform: translateY(100%);
|
||||
}
|
||||
@@ -5,7 +5,23 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
selects: [ // 自定义选择框参数
|
||||
{
|
||||
select: '状态',
|
||||
active: false,
|
||||
tabIndex: 1
|
||||
},
|
||||
{
|
||||
select: '会议类型',
|
||||
active: false,
|
||||
tabIndex: 2
|
||||
},
|
||||
{
|
||||
select: '时间',
|
||||
active: false,
|
||||
tabIndex: 3
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,2 +1,24 @@
|
||||
<!--pages/meeting/meeting.wxml-->
|
||||
<text>pages/meeting/meeting.wxml</text>
|
||||
<view class="select-list">
|
||||
<view class="select-item" bindtap="changeTab(select)" wx:for="{{selects}}" wx:for-item="select" wx:key="tabIndex">
|
||||
<text>{{select.select}}</text>
|
||||
<image wx:if="{{!select.active}}" src="../../assets/images/toTop.png"></image>
|
||||
<image wx:if="{{select.active}}" src="../../assets/images/toBottom.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="list-item" wx:for="{{[1,1,1,1]}}">
|
||||
<view class="title">
|
||||
<text>项目名称文字占位符项目名称文字占位符项目名称文字占位符</text>
|
||||
<text>2021-12-12</text>
|
||||
</view>
|
||||
<view class="content-text">
|
||||
<image mode="aspectFill" src="../../assets/images/personnel.png"></image>
|
||||
<text>标协会议</text>
|
||||
</view>
|
||||
<view class="content-text">
|
||||
<image mode="aspectFill" src="../../assets/images/location.png"></image>
|
||||
<text>天津市河西区华鼎大厦502会议室</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -1 +1,75 @@
|
||||
/* pages/meeting/meeting.wxss */
|
||||
/* pages/meeting/meeting.wxss */
|
||||
page {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
/* 头部筛选 start */
|
||||
.select-list {
|
||||
border-top: 0.5px solid #F5F5F5;
|
||||
height: 40px;
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.select-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.select-item image {
|
||||
width: 11px;
|
||||
height: 6px;
|
||||
margin-left: 9px;
|
||||
}
|
||||
/* 头部筛选end */
|
||||
/* 列表start */
|
||||
.list{
|
||||
padding: 15px;
|
||||
}
|
||||
.list-item{
|
||||
height: 90px;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
padding: 10px 15px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
.list-item:not(:first-child) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.list-item .title{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.list-item .title text:nth-child(1){
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.list-item .title text:nth-child(2){
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
width: 70px;
|
||||
text-align: right;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.content-text{
|
||||
width: 100%;
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
}
|
||||
.content-text image{
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
@@ -5,9 +5,30 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
|
||||
},
|
||||
// 修改密码
|
||||
upDateInfo(){
|
||||
wx.navigateTo({
|
||||
url: '../upDateInfo/upDateInfo',
|
||||
})
|
||||
},
|
||||
// 个人信息
|
||||
mineInfo(){
|
||||
wx.navigateTo({
|
||||
url: '../mineInfo/mineInfo',
|
||||
})
|
||||
},
|
||||
// 扫码签到
|
||||
scanCode(){
|
||||
wx.scanCode({
|
||||
onlyFromCamera: false,
|
||||
scanType: [],
|
||||
success: (result) => {},
|
||||
fail: (res) => {},
|
||||
complete: (res) => {},
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
"usingComponents": {},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
@@ -1,2 +1,77 @@
|
||||
<!--pages/mine/mine.wxml-->
|
||||
<text>pages/mine/mine.wxml</text>
|
||||
<view class="mine-bg">
|
||||
<!-- 顶部背景图 mode="scaleToFill" 按照宽高填充,忽略图片原比例-->
|
||||
<image mode="scaleToFill" src="../../assets/images/mine-bg.png"></image>
|
||||
<!-- 顶部选项栏 -->
|
||||
<view class="select-box">
|
||||
<view class="avator">
|
||||
<image src="../../assets/images/mine.png"></image>
|
||||
<view class="info">
|
||||
<text>昵称</text>
|
||||
<text>185-2207-4910</text>
|
||||
</view>
|
||||
<image src="../../assets/images/to-right.png"></image>
|
||||
</view>
|
||||
<view class="select">
|
||||
<view class="select-item">
|
||||
<text>412</text>
|
||||
<text>我的项目</text>
|
||||
</view>
|
||||
<view class="select-item">
|
||||
<text>2</text>
|
||||
<text>我的会议</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 列表信息栏 -->
|
||||
<view class="list-info">
|
||||
<view class="info-content">
|
||||
<view class="title list-item">我的服务</view>
|
||||
<view class="list-item" bindtap="mineInfo">
|
||||
<view class="item-title">
|
||||
<image src="../../assets/images/follow.png"></image>
|
||||
<text>个人信息</text>
|
||||
</view>
|
||||
<image src="../../assets/images/more.png"></image>
|
||||
</view>
|
||||
<view class="list-item" bindtap="upDateInfo">
|
||||
<view class="item-title">
|
||||
<image src="../../assets/images/follow.png"></image>
|
||||
<text>修改密码</text>
|
||||
</view>
|
||||
<image src="../../assets/images/more.png"></image>
|
||||
</view>
|
||||
<view class="list-item" bindtap="scanCode">
|
||||
<view class="item-title">
|
||||
<image src="../../assets/images/sign.png"></image>
|
||||
<text>扫码签到</text>
|
||||
</view>
|
||||
<image src="../../assets/images/more.png"></image>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<view class="item-title">
|
||||
<image src="../../assets/images/data.png"></image>
|
||||
<text>我的资料</text>
|
||||
</view>
|
||||
<image src="../../assets/images/more.png"></image>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<view class="item-title">
|
||||
<image src="../../assets/images/contract.png"></image>
|
||||
<text>我的合同</text>
|
||||
</view>
|
||||
<image src="../../assets/images/more.png"></image>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<view class="item-title">
|
||||
<image src="../../assets/images/setting.png"></image>
|
||||
<text>设置</text>
|
||||
</view>
|
||||
<image src="../../assets/images/more.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="logout">
|
||||
<text>退出登录</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -1 +1,125 @@
|
||||
/* pages/mine/mine.wxss */
|
||||
/* pages/mine/mine.wxss */
|
||||
page{
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
.mine-bg{
|
||||
height: 200pt;
|
||||
}
|
||||
.select-box{
|
||||
transform: translateY(-100pt);
|
||||
padding: 0 15pt;
|
||||
}
|
||||
.select-box .avator{
|
||||
height: 68px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.select-box .avator image:nth-child(1){
|
||||
width: 68px;
|
||||
height: 68px;
|
||||
background-color: #333;
|
||||
border-radius: 50%;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.select-box .avator .info{
|
||||
flex: 1;
|
||||
display: flex;
|
||||
height: 68px;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.avator .info text:nth-child(1){
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
}
|
||||
.avator .info text:nth-child(2){
|
||||
color: #fff;
|
||||
font-size: 11px;
|
||||
width: 100px;
|
||||
height: 18px;
|
||||
background-color: rgba(255,255,255,0.3);
|
||||
line-height: 18px;
|
||||
text-align: center;
|
||||
border-radius: 9px;
|
||||
}
|
||||
.select-box .avator image:nth-child(3){
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
.select-box .select{
|
||||
height: 90pt;
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
}
|
||||
.select-item{
|
||||
flex: 1;
|
||||
height: 60pt;
|
||||
font-size: 10pt;
|
||||
color: #666666;
|
||||
flex-direction: column;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
}
|
||||
.select-item text:nth-child(1){
|
||||
color: #333;
|
||||
font-size: 24px;
|
||||
}
|
||||
.select-item text:nth-child(2){
|
||||
color: #333;
|
||||
font-size: 12px;
|
||||
}
|
||||
/* 个人信息选项栏 */
|
||||
.list-info{
|
||||
margin-top: -100pt;
|
||||
padding: 15pt;
|
||||
}
|
||||
.list-info .title{
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.list-info .info-content{
|
||||
padding: 0 15pt 0 15pt;
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.info-content .list-item{
|
||||
height: 45px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.list-item .item-title{
|
||||
color: #333;
|
||||
font-size: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.info-content .list-item image:nth-child(1){
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.info-content .list-item image:nth-child(2){
|
||||
width: 6px;
|
||||
height: 10px;
|
||||
}
|
||||
.logout{
|
||||
padding: 0 15px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.logout text{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 45px;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
font-size: 13px;
|
||||
color: #069F99;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
<!--pages/notice/notice.wxml-->
|
||||
<view class="container"></view>
|
||||
@@ -1 +0,0 @@
|
||||
/* pages/notice/notice.wxss */
|
||||
@@ -1,11 +1,11 @@
|
||||
// pages/project/project.js
|
||||
// pages/meeting/meeting.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<!--pages/project/project.wxml-->
|
||||
<text>pages/project/project.wxml</text>
|
||||
<!--pages/meeting/meeting.wxml-->
|
||||
<view>
|
||||
<text>来款项目</text>
|
||||
</view>
|
||||
|
||||
@@ -1 +1,20 @@
|
||||
/* pages/project/project.wxss */
|
||||
/* pages/meeting/meeting.wxss */
|
||||
.select-list {
|
||||
height: 92rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.select-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.select-item image {
|
||||
width: 21rpx;
|
||||
height: 12rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
// pages/meeting/meeting.js
|
||||
import UserApi from '../../assets/js/http/userApi'
|
||||
import {JSEncrypt} from '../../assets/js/jsencrypt/jsencrypt'
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
newPassword: '',
|
||||
verifyPassword: '',
|
||||
rsaPublicKey: '',
|
||||
flag: false
|
||||
},
|
||||
bindBlurInput(e){
|
||||
|
||||
},
|
||||
// 登录
|
||||
formSubmit(e) {
|
||||
if(!e.detail.value.newPassword){
|
||||
this.data.flag = false
|
||||
wx.showToast({
|
||||
title: '请输入密码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
} else {
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.newPassword)){
|
||||
wx.showToast({
|
||||
title: '密码由8位数字、大小写字母和特殊符号组成!!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
return
|
||||
} else {
|
||||
this.data.flag = true
|
||||
}
|
||||
}
|
||||
if(!e.detail.value.verifyPassword){
|
||||
this.data.flag = false
|
||||
wx.showToast({
|
||||
title: '请输入确认密码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
} else {
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.verifyPassword)){
|
||||
wx.showToast({
|
||||
title: '密码由8位数字、大小写字母和特殊符号组成!!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
return
|
||||
} else {
|
||||
this.data.flag = true
|
||||
}
|
||||
}
|
||||
if(e.detail.value.newPassword === e.detail.value.verifyPassword) {
|
||||
this.data.flag = true
|
||||
} else {
|
||||
this.data.flag = false
|
||||
wx.showToast({
|
||||
title: '密码不一致',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.data.flag) {
|
||||
wx.showLoading({
|
||||
title: '正在登录...',
|
||||
icon: 'loading'
|
||||
})
|
||||
// 新建JSEncrypt对象
|
||||
let encrypt = new JSEncrypt()
|
||||
encrypt.setPublicKey(this.data.rsaPublicKey) // 公钥加密
|
||||
let params = {
|
||||
newPassword: encrypt.encrypt(e.detail.value.newPassword),
|
||||
verifyPassword: encrypt.encrypt(e.detail.value.verifyPassword),
|
||||
rsaPublicKey: this.data.rsaPublicKey
|
||||
}
|
||||
console.log('form发生了submit事件,携带数据为:', e.detail.value)
|
||||
// 请求短信登录start
|
||||
UserApi.setPassword(params).then(res => {
|
||||
console.log(res)
|
||||
if (res.success) {
|
||||
wx.hideLoading()
|
||||
} else {
|
||||
wx.hideLoading()
|
||||
wx.showToast({
|
||||
title: '登录失败',
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
// 登录失败
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
UserApi.getRSAPublicKey().then(res => {
|
||||
if (res.success) {
|
||||
this.setData({
|
||||
rsaPublicKey: res.result
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "设置密码",
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<!--pages/meeting/meeting.wxml-->
|
||||
<view class="container-box">
|
||||
<text class="set-password">初次登录请设置密码</text>
|
||||
<form bindsubmit="formSubmit" class="form-box">
|
||||
<view class="form-item">
|
||||
<view class="text-label">密码</view>
|
||||
<view class="text-value">
|
||||
<input name="newPassword" bindblur="bindBlurInput" value="{{newPassword}}" placeholder="请输入密码" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="text-label">确认密码</view>
|
||||
<view class="text-value">
|
||||
<input name="verifyPassword" bindblur="bindBlurInput" value="{{verifyPassword}}" placeholder="请确认密码" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn-area">
|
||||
<button type="primary" formType="submit">登录</button>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
@@ -0,0 +1,18 @@
|
||||
/* pages/meeting/meeting.wxss */
|
||||
page {
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
color: #333;
|
||||
}
|
||||
.form-box{
|
||||
transform: translateY(100%);
|
||||
}
|
||||
.set-password{
|
||||
display: block;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
// pages/meeting/meeting.js
|
||||
import UserApi from '../../assets/js/http/userApi'
|
||||
import {
|
||||
JSEncrypt
|
||||
} from '../../assets/js/jsencrypt/jsencrypt'
|
||||
var countdown = 60; // 倒计时秒数
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
form: {
|
||||
phone: '', // 手机号
|
||||
verifyCode: '', // 验证码
|
||||
newPassword: '', // 新密码
|
||||
verifyPassword: '', // 确认密码
|
||||
count: 60, // 倒计时秒
|
||||
rsaPublicKey: '', // 公钥
|
||||
},
|
||||
showGetCaptcha: true
|
||||
},
|
||||
// 获取验证码
|
||||
getVerCode() {
|
||||
if (/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(this.data.phone)) {
|
||||
UserApi.sendCode({
|
||||
phone: this.data.phone
|
||||
}).then(res => {
|
||||
// 获取成功,倒计时 start
|
||||
if (res.success) {
|
||||
this.countDown()
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '获取验证码失败',
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '请输入正确的手机号',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
},
|
||||
// 倒计时
|
||||
countDown() {
|
||||
if (countdown === 0) {
|
||||
this.setData({
|
||||
showGetCaptcha: true
|
||||
})
|
||||
countdown = 60;
|
||||
return;
|
||||
} else {
|
||||
this.setData({
|
||||
showGetCaptcha: false
|
||||
})
|
||||
countdown--;
|
||||
this.setData({
|
||||
count: countdown
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.countDown()
|
||||
}, 1000)
|
||||
// 倒计时 end
|
||||
},
|
||||
// 提交
|
||||
formSubmit(e) {
|
||||
if(!e.detail.value.newPassword){
|
||||
this.data.flag = false
|
||||
wx.showToast({
|
||||
title: '请输入密码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
} else {
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.newPassword)){
|
||||
wx.showToast({
|
||||
title: '密码由8位数字、大小写字母和特殊符号组成!!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
return
|
||||
} else {
|
||||
this.data.flag = true
|
||||
}
|
||||
}
|
||||
if(!e.detail.value.verifyPassword){
|
||||
this.data.flag = false
|
||||
wx.showToast({
|
||||
title: '请输入确认密码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
} else {
|
||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||
if(!pattern.test(e.detail.value.verifyPassword)){
|
||||
wx.showToast({
|
||||
title: '密码由8位数字、大小写字母和特殊符号组成!!',
|
||||
icon: 'none'
|
||||
})
|
||||
this.data.flag = false
|
||||
return
|
||||
} else {
|
||||
this.data.flag = true
|
||||
}
|
||||
}
|
||||
if(e.detail.value.newPassword === e.detail.value.verifyPassword) {
|
||||
this.data.flag = true
|
||||
} else {
|
||||
this.data.flag = false
|
||||
wx.showToast({
|
||||
title: '密码不一致',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
console.log('form发生了submit事件,携带数据为:', e.detail.value)
|
||||
// 新建JSEncrypt对象
|
||||
let encrypt = new JSEncrypt()
|
||||
encrypt.setPublicKey(this.data.rsaPublicKey) // 公钥加密
|
||||
let params = {
|
||||
phone: encrypt.encrypt(e.detail.value.phone),
|
||||
verifyCode: e.detail.value.verifyCode,
|
||||
newPassword: encrypt.encrypt(e.detail.value.newPassword),
|
||||
verifyPassword: encrypt.encrypt(e.detail.value.verifyPassword)
|
||||
}
|
||||
UserApi.updatePassword(params).then(res => {
|
||||
console.log(res)
|
||||
wx.hideToast()
|
||||
}).catch(err => {
|
||||
wx.hideToast()
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
// 性别处理
|
||||
if (this.data.form.gender === '1') {
|
||||
this.data.sexArr[0].checked = "true"
|
||||
this.setData({
|
||||
sexArr: this.data.sexArr,
|
||||
})
|
||||
console.log(this.data.sexArr)
|
||||
}
|
||||
if (this.data.form.gender === '2') {
|
||||
this.data.sexArr[1].checked = "true"
|
||||
this.setData({
|
||||
sexArr: this.data.sexArr,
|
||||
})
|
||||
console.log(2)
|
||||
}
|
||||
let params = {
|
||||
id: wx.getStorage('id') // 用户id
|
||||
}
|
||||
UserApi.mineInfo(params).then(res => {
|
||||
console.log(res)
|
||||
wx.hideToast()
|
||||
}).catch(err => {
|
||||
wx.hideToast()
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "修改密码",
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<!--pages/meeting/meeting.wxml-->
|
||||
<view>
|
||||
<form bindsubmit="formSubmit" class="form-box">
|
||||
<view class="form-item">
|
||||
<view class="text-label">手机号</view>
|
||||
<view class="text-value">
|
||||
<input name="phone" value="{{phone}}" placeholder="请输入手机号" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="text-label">验证码</view>
|
||||
<view class="text-value">
|
||||
<input name="verifyCode" value="{{verifyCode}}" placeholder="请输入验证码" />
|
||||
</view>
|
||||
<view wx:if="{{showGetCaptcha}}" class="captcha" bindtap="getVerCode">获取验证码</view>
|
||||
<view wx:else="{{showGetCaptcha}}" class="captcha count">{{count}}</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="text-label">密码</view>
|
||||
<view class="text-value">
|
||||
<input name="newPassword" value="{{newPassword}}" placeholder="请输入密码" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="text-label">确认密码</view>
|
||||
<view class="text-value">
|
||||
<input name="verifyPassword" value="{{verifyPassword}}" placeholder="请确认密码" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn-area">
|
||||
<button type="primary" formType="submit">登录</button>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
@@ -0,0 +1,4 @@
|
||||
/* pages/meeting/meeting.wxss */
|
||||
.form-box{
|
||||
transform: translateY(110pt);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
// pages/meeting/meeting.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<!--pages/meeting/meeting.wxml-->
|
||||
<view>
|
||||
<text>工作组</text>
|
||||
</view>
|
||||
@@ -0,0 +1,20 @@
|
||||
/* pages/meeting/meeting.wxss */
|
||||
.select-list {
|
||||
height: 92rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.select-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.select-item image {
|
||||
width: 21rpx;
|
||||
height: 12rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
"ignore": []
|
||||
},
|
||||
"setting": {
|
||||
"urlCheck": true,
|
||||
"urlCheck": false,
|
||||
"es6": true,
|
||||
"enhance": true,
|
||||
"postcss": true,
|
||||
@@ -24,7 +24,7 @@
|
||||
"lazyloadPlaceholderEnable": false,
|
||||
"useMultiFrameRuntime": true,
|
||||
"useApiHook": true,
|
||||
"useApiHostProcess": false,
|
||||
"useApiHostProcess": true,
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
@@ -36,12 +36,13 @@
|
||||
"packNpmManually": false,
|
||||
"packNpmRelationList": [],
|
||||
"minifyWXSS": true,
|
||||
"disableUseStrict": false,
|
||||
"showES6CompileOption": false,
|
||||
"bundle": false
|
||||
"useCompilerPlugins": false
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "2.19.0",
|
||||
"appid": "wx62b116308b97d953",
|
||||
"appid": "wx24914e866df035fb",
|
||||
"projectname": "income_payments_applet",
|
||||
"debugOptions": {
|
||||
"hidedInDevtools": []
|
||||
|
||||