报名工具小程序初始代码

This commit is contained in:
liupopo
2024-02-06 09:36:25 +08:00
commit d7420944ba
202 changed files with 41300 additions and 0 deletions

View File

@@ -0,0 +1,225 @@
<template>
<view>
<RefreshView ref="mescrollRef" :hasBack="true" text="密码设置" :useDownScroll="false" :useUpScroll="false">
<view style="margin-top: 40rpx;display: flex;flex-direction: row;align-items: center;margin-left: 30rpx;">
<text>新密码</text>
<view class="inputRow">
<input type="text" :password="page.password1" maxlength="16" @input="psdText" placeholder="请输入密码"
class="input" />
<image :src="page.show1" mode="aspectFit" style="width: 40rpx;height: 40rpx;" @click="show(1)">
</image>
</view>
</view>
<view style="margin-top: 10rpx;display: flex;flex-direction: row;align-items: center;margin-left: 30rpx;">
<text>确认密码</text>
<view class="inputRow">
<input type="text" :password="page.password2" maxlength="16" @input="rePsdText"
placeholder="请再次输入密码" class="input" />
<image :src="page.show2" mode="aspectFit" style="width: 40rpx;height: 40rpx;" @click="show(2)">
</image>
</view>
</view>
<view class="condition">
<image class="condition_img" :src="page.img1" mode="aspectFit"></image>
<text class="condition_text" :class="{'alldata':index1===1}">密码长度为8-20个字符</text>
</view>
<view class="condition">
<image class="condition_img" :src="page.img2" mode="aspectFit"></image>
<text class="condition_text" :class="{'alldata':index2===1}">密码要包含大小写字母和数字</text>
</view>
<view class=" btn" @click="save">
<text class="btnText">保存</text>
</view>
</RefreshView>
</view>
</template>
<script>
export default {
data() {
return {
index1: 0,
index2: 0,
page: {
"psd": "", //密码
"rePsd": "", //确认密码,
password1: true,
password2: true,
show1: "../../static/hide-password.png",
show2: "../../static/hide-password.png",
"img1": "../../static/login/unfinished.png",
"img2": "../../static/login/unfinished.png",
}
}
},
methods: {
psdText(e) {
this.page.psd = e.detail.value
var psdLength = this.page.psd.length;
if (8 <= psdLength) {
this.index1 = 1;
this.page.img1 = "../../static/login/finished.png"
} else {
this.index1 = 0;
this.page.img1 = "../../static/login/unfinished.png"
}
var aaa = /[a-z]/.test(e.detail.value);
var bbb = /\d/.test(e.detail.value);
var ccc = /[A-Z]/.test(e.detail.value);
if (aaa == true && bbb == true && ccc == true) {
this.index2 = 1;
this.page.img2 = "../../static/login/finished.png"
} else {
this.index2 = 0;
this.page.img2 = "../../static/login/unfinished.png"
}
},
rePsdText(e) {
this.page.rePsd = e.detail.value
},
show(id) {
let _this = this
switch (id) {
case 1:
this.page.password1 = !this.page.password1
if (this.page.password1) {
this.page.show1 = "../../static/hide-password.png"
} else {
this.page.show1 = "../../static/show-password.png"
}
break;
case 2:
this.page.password2 = !this.page.password2
if (this.page.password2) {
this.page.show2 = "../../static/hide-password.png"
} else {
this.page.show2 = "../../static/show-password.png"
}
break;
}
},
save() {
var psdLength = this.page.psd.length;
var rePsdLength = this.page.rePsd.length;
if (psdLength == 0) {
this.Toast("请输入新的密码");
return;
}
if (rePsdLength == 0) {
this.Toast("请输入确认新密码")
return;
}
if (!this.index1 || !this.index2) {
this.Toast("密码不符合条件")
return;
}
if (rePsdLength == 0) {
this.Toast("请输入确认密码");
return;
}
if (this.page.psd != this.page.rePsd) {
this.Toast("两次输入的密码不一致");
return;
}
this.HTTP({
url: 'aos/v1/aosUserManagement/setLoginPassWord',
method: 'PUT',
paramsType: "FORM",
data: {
sysUserSid: getApp().globalData.memberSid,
loginPassWord: this.page.psd,// 新密码
},
loading: true
}).then((res) => {
uni.navigateBack({
delta: 2
})
this.Toast("密码修改成功")
});
}
}
}
</script>
<style lang="scss">
.inputRow {
flex: 1;
display: flex;
margin-left: 30rpx;
margin-right: 50rpx;
margin-bottom: 10rpx;
margin-top: 10rpx;
padding-bottom: 10rpx;
border-bottom: 0.1px #F1F1F1 solid;
align-items: center;
.input {
margin-left: 20rpx;
height: 70rpx;
flex: 1;
font-size: 32rpx;
}
}
.condition {
display: flex;
align-items: center;
margin-left: 80rpx;
margin-top: 50rpx;
.condition_img {
width: 35rpx;
height: 35rpx;
}
.condition_text {
margin-left: 20rpx;
}
.alldata {
margin-left: 20rpx;
color: #2fa1f0;
}
}
.btn {
display: flex;
width: 90%;
height: 80rpx;
flex-direction: column;
background-color: $uni-base-color;
margin-top: 80rpx;
margin-left: auto;
margin-right: auto;
align-items: center;
justify-content: center;
border-radius: 10rpx;
.btnText {
color: #ffffff;
font-size: 33rpx;
}
}
</style>

View File

@@ -0,0 +1,127 @@
<template>
<view>
<RefreshView ref="mescrollRef" :hasBack="true" text="密码设置" :useDownScroll="false" :useUpScroll="false">
<view style="margin-top: 30rpx;">
<view class="inputRow">
<image src="../../static/login/username.png" mode="aspectFill" class="drawableLeft"></image>
<input type="number" maxlength="11" @input="phoneText" placeholder="请输入手机号" class="input" />
<SendCodeItem :phoneNum="page.phone" url="aos/v1/aosUserManagement/sendCodeFromModifyLoginPassWord"
@click="send" ref="codeItem"></SendCodeItem>
</view>
</view>
<view class="inputRow">
<image src="../../static/login/code.png" mode="aspectFill" class="drawableLeft"></image>
<input type="number" @input="codeText" maxlength="4" placeholder="请输入验证码" class="input" />
</view>
<view class="btn" @click="next">
<text class="btnText">下一步</text>
</view>
</RefreshView>
</view>
</template>
<script>
export default {
data() {
return {
page: {
phone: '',
code: ''
}
};
},
methods: {
next() {
var phoneLength = this.page.phone.length;
var codeLength = this.page.code.length;
if (phoneLength == 0) {
this.Toast("请输入手机号")
return;
}
if (codeLength == 0) {
this.Toast("验证码不能为空")
return;
}
this.HTTP({
url: 'aos/v1/aosUserManagement/verifyCodeFromModifyLoginPassWord?mobile=' + this.page.phone +
'&code=' + this.page.code,
method: 'GET',
paramsType: "FORM",
loading: true
}).then((res) => {
console.log('=======', res)
uni.navigateTo({
url: 'NewPasswordActivity'
});
});
},
phoneText(e) {
//手机号
this.page.phone = e.detail.value;
},
send(e) { //发送验证码
console.log(e);
},
codeText(e) {
//验证码
this.page.code = e.detail.value;
}
}
};
</script>
<style lang="scss">
.inputRow {
display: flex;
margin-left: 30rpx;
margin-right: 30rpx;
margin-bottom: 10rpx;
margin-top: 10rpx;
padding-bottom: 10rpx;
border-bottom: 0.1px #F1F1F1 solid;
align-items: center;
.input {
margin-left: 20rpx;
height: 70rpx;
flex: 1;
font-size: 32rpx;
}
.drawableLeft {
width: 40rpx;
height: 40rpx;
margin: 20rpx;
}
}
.btn {
display: flex;
width: 90%;
height: 80rpx;
flex-direction: column;
background-color: $uni-base-color;
margin-top: 80rpx;
margin-left: auto;
margin-right: auto;
align-items: center;
justify-content: center;
border-radius: 10rpx;
.btnText {
color: #ffffff;
font-size: 33rpx;
}
}
</style>

117
pages/setup/upMobile.vue Normal file
View File

@@ -0,0 +1,117 @@
<template>
<RefreshView ref="mescrollRef" :hasBack="true" text="更换手机号" :useDownScroll="false" :useUpScroll="false">
<view class="top">
<text class="top_text">更换手机号后下次登录可使用新手机号登录</text>
<text class="top_text">当前手机号{{phoneNumber}}</text>
</view>
<view class="inputLay">
<text class="inputText">新手机号</text>
<input class="input" type="number" maxlength="11" @input="nameText" placeholder="请输入新手机号"
:value="mobile"></input>
</view>
<view style="height: 5rpx;width: 100%;background-color: #eee;margin-top: 28rpx;"></view>
<text class="btn" @click="next()">下一步</text>
</RefreshView>
</template>
<script>
export default {
data() {
return {
mobile: "",
phoneNumber: ""
}
},
onLoad(options) {
console.log('=======', options)
console.log('=======', options.phoneNumber)
this.phoneNumber = options.phoneNumber
},
methods: {
nameText(e) {
this.mobile = e.detail.value
console.log(this.mobile)
},
next() {
var phoneLength = this.mobile.length;
if (phoneLength == 0) {
this.Toast("请输入手机号")
return;
}
if (phoneLength != 11 || !this.mobile.startsWith("1")) {
this.Toast("请输入正确的手机号")
return;
}
let _this = this
_this.HTTP({
url: 'aos/v1/aosUserManagement/verifyMobileIsExist/' + _this.mobile,
method: 'GET',
paramsType: "FORM",
toast: true,
loading: true
}).then((res) => {
console.log('=======', res)
if (200 == res.code) {
uni.navigateTo({
url: 'upMobile2?phoneNumber=' + this.mobile
})
} else {
this.Toast("手机号重复")
}
});
}
}
}
</script>
<style lang="scss">
.top {
display: flex;
flex-direction: column;
margin-top: 32rpx;
margin-left: 36rpx;
.top_text {
margin-top: 10rpx;
font-size: 30rpx;
color: #BBBBBB;
}
}
.inputLay {
display: flex;
flex-direction: row;
margin-left: 40rpx;
margin-right: 40rpx;
margin-top: 32rpx;
margin-bottom: 32rpx;
.input {
margin-left: 40rpx;
flex: 1;
}
}
.btn {
justify-content: center;
width: 100%;
display: flex;
margin-top: 100rpx;
padding: 30rpx;
font-size: 28rpx;
color: #FFFFFF;
background: #007AFF;
text-align: center;
}
</style>

115
pages/setup/upMobile2.vue Normal file
View File

@@ -0,0 +1,115 @@
<template>
<RefreshView ref="mescrollRef" :hasBack="true" text="更换手机号" :useDownScroll="false" :useUpScroll="false">
<view class="top">
<text class="top_text">更换的手机号{{phoneNumber}}</text>
</view>
<view class="inputLay">
<text class="inputText">验证码</text>
<input type="number" maxlength="6" @input="codeText" placeholder="请输入验证码" class="input" />
<SendCodeItem :phoneNum="phoneNumber" url="aos/v1/aosUserManagement/sendCodeFromWxBindMobile" @click="send"
ref="wxCodeItem"></SendCodeItem>
</view>
<view style="height: 5rpx;width: 100%;background-color: #eee;margin-top: 28rpx;"></view>
<text class="btn" @click="save()">完成</text>
</RefreshView>
</template>
<script>
export default {
data() {
return {
phoneNumber: "",
code: ""
}
},
onLoad(options) {
console.log('=======', options)
console.log('=======', options.phoneNumber)
this.phoneNumber = options.phoneNumber
},
methods: {
codeText(e) {
this.code = e.detail.value
console.log(this.code)
},
save() {
var codeLength = this.code.length;
if (codeLength == 0) {
this.Toast("请输入验证码")
return;
}
let _this = this
_this.HTTP({
url: 'aos/v1/aosUserManagement/modifyMobile',
method: 'PUT',
paramsType: "FORM",
data: {
sysUserSid: getApp().globalData.memberSid,
mobile: _this.phoneNumber,
code: _this.code,
},
toast: true,
loading: true
}).then((res) => {
console.log('=======', res)
// 保存
uni.navigateBack({
delta: 2
})
});
}
}
}
</script>
<style lang="scss">
.top {
display: flex;
flex-direction: column;
margin-top: 32rpx;
margin-left: 36rpx;
.top_text {
margin-top: 10rpx;
font-size: 30rpx;
color: #BBBBBB;
}
}
.inputLay {
display: flex;
flex-direction: row;
margin-left: 40rpx;
margin-right: 40rpx;
margin-top: 32rpx;
margin-bottom: 32rpx;
align-items: center;
.input {
margin-left: 40rpx;
flex: 1;
}
}
.btn {
justify-content: center;
width: 100%;
display: flex;
margin-top: 100rpx;
padding: 30rpx;
font-size: 28rpx;
color: #FFFFFF;
background: #007AFF;
text-align: center;
}
</style>