123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346 |
- <template>
- <view class="content">
- <view class="status_bar"></view>
- <view class="logo">
- <image src="~@/static/logo.png" mode="aspectFit"></image>
- </view>
- <view class="title">
- <text v-if="mine_code == 'ningdongyunying'">E信管理</text>
- <text v-if="mine_code == 'zaoquan'">枣泉煤矿</text>
- <text v-if="mine_code == 'qingshuiying'">清水营煤矿</text>
- <text v-if="mine_code == 'wuyegongsi'">智慧物业</text>
- <text v-if="mine_code == 'jinjiaqu'">金家渠煤矿</text>
- <text v-if="mine_code == 'yangchangwan'">羊场湾煤矿</text>
- </view>
- <view class="change_box">
- <view class="item">
- <view class="name">手机号</view>
- <view class="input">
- <input type="text" value="" v-model="mobile"/>
- </view>
- </view>
- <view class="send_box">
- <view class="send_code">
- <view class="name">验证码</view>
- <view class="input">
- <input type="text" value="" v-model="vcode"/>
- </view>
- </view>
-
- <view class="send_btn" @click="send_vcode()">
- <text>{{send_text}}</text>
- </view>
- </view>
- <view class="item">
- <view class="name">修改密码</view>
- <view class="input">
- <input type="password" value="" v-model="password"/>
- </view>
- </view>
- <view class="item">
- <view class="name">确认密码</view>
- <view class="input">
- <input type="password" value="" v-model="copypassword"/>
- </view>
- </view>
- </view>
- <view class="tips">
- <text @click="back()">记起来了?请点击这里登陆</text>
- </view>
- <view class="change_btn" @click="changeBtn()">
- <text>确认修改</text>
- </view>
- </view>
- </template>
- <script>
- var testPassword =/^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{8,15}$/
-
- export default {
- data() {
- return {
- mine_code:"",
- mobile:'',
- vcode:'',
- password:'',
- copypassword:'',
- send_text:'发送验证码'
- };
- },
- onLoad() {
- this.mine_code = uni.getStorageSync('mine_code')
- },
- methods: {
- back(){
- uni.navigateTo({
- url:"../login/login"
- })
- },
-
-
- send_vcode(){
- if(this.mobile.length < 11){
- uni.showToast({
- icon:'none',
- title:'请填写正确的手机号'
- })
- return
- }
-
- if(this.send_text == "发送验证码"){
- this.$api.sms_send_v_code({
- mobile:this.mobile
- }).then((res)=>{
-
- console.log(res.data)
-
- if(res.data.code == 3001){
- uni.showToast({
- icon:"none",
- title:"电话号码错误"
- })
- this.send_text = "发送验证码"
- }else if(res.data.code == 3002){
- uni.showToast({
- icon:"none",
- title:"发送失败"
- })
- this.send_text = "发送验证码"
- }else if(res.data.code == 3003){
- uni.showToast({
- icon:"none",
- title:res.data.message
- })
- this.send_text = "发送验证码"
- }else if(res.data.code == 0){
- uni.showToast({
- icon:"none",
- title:"验证码发送成功"
- })
- }
- })
- }
-
- this.send_text = "已发送"
- if(this.send_text = "已发送"){
- uni.showToast({
- icon:"none",
- title:"请勿重复发送"
- })
- }
-
- },
-
- changeBtn(){
- if(this.vcode == ''){
- uni.showToast({
- icon:'none',
- title:'请填写验证码'
- })
- return
- }
-
- if(this.password == '' || this.copypassword == ''){
- uni.showToast({
- icon:'none',
- title:'请填写完整信息'
- })
- return
- }
-
- if(this.password !== this.copypassword){
- uni.showToast({
- icon:'none',
- title:'两次密码输入不一致'
- })
- return
- }
-
- if( !testPassword.test(this.password) ){
- uni.showToast({
- icon:'none',
- title:'密码必须包含大写字母、小写字母、数字和特殊符号且长度在8位至16位之间'
- })
- return
- }
-
- this.$api.user_forget_password({
- mobile:this.mobile,
- vcode:this.vcode,
- password:this.password
- }).then((res)=>{
- console.log(res)
-
- if(res.data.code == 4002){
- uni.showToast({
- icon:'none',
- title:"验证码超时或者错误"
- })
- return
- }else{
- uni.setStorageSync('login_password',this.password)
-
- uni.showToast({
- icon:'none',
- title:'密码修改成功、返回登陆'
- })
- this.send_text = "发送验证码"
- }
-
-
-
- setTimeout(function(){
- uni.navigateTo({
- url:"../login/login"
- })
- },1000)
- })
-
- }
- }
- }
- </script>
- <style lang="scss">
- page {}
- .content {
- width: 750rpx;
- min-height: 100vh;
- height: 100%;
- background-image: url(~@/static/login.png);
- background-size: cover;
- background-position: center center;
- background-repeat: no-repeat;
-
- .logo {
- width: 344rpx;
- height: 350rpx;
- margin: 0 auto;
- padding-top: 100rpx;
-
- image {
- width: 100%;
- height: 100%;
- }
- }
-
- .title {
- margin: 0 auto;
- margin-top: 32rpx;
- width: 288rpx;
- height: 47rpx;
- font-size: 36rpx;
- color: #FFFFFF;
- line-height: 47rpx;
- text-align: center;
- }
-
- .change_box {
- padding-top: 40px;
- .item {
- margin: 0 auto;
- margin-bottom: 20px;
- width: 600rpx;
- height: 45px;
- background: #FFFFFF;
- border-radius: 25px;
- box-sizing: border-box;
- padding: 0 20px;
- display: flex;
- align-items: center;
- .name {
- width: 150rpx;
- font-size: 16px;
- color: #009FE8;
- line-height: 45px;
- }
- .input {
- input {
- height: 45px;
- color: #666;
- }
- }
- }
-
- .send_box{
- margin: 0 auto;
- margin-bottom: 20px;
- width: 600rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .send_code{
- background: #FFFFFF;
- border-radius: 25px;
- box-sizing: border-box;
- padding: 0 20px;
- height: 45px;
-
- display: flex;
- justify-content: space-between;
- align-items: center;
- .name{
- width: 120rpx;
- font-size: 16px;
- font-family: MicrosoftYaHei;
- color: #009FE8;
- line-height: 45px;
- }
- .input{
- width: 140rpx;
- }
- }
- .send_btn{
- width: 220rpx;
- height: 50px;
- background: rgba(100, 220, 255, 0.8);
- border-radius: 25px;
- text-align: center;
- line-height: 50px;
-
- text {
- font-size: 34rpx;
- color: #FFFFFF;
- }
- }
- }
- }
- .tips {
- margin: 0 auto;
- margin-top: 25px;
- text-align: center;
- font-size: 14px;
- color: #ECF0F1;
- line-height: 40px;
- text-align: center;
- }
- .change_btn {
- margin: 40px auto;
- width: 200px;
- height: 50px;
- background: rgba(100, 220, 255, 0.8);
- border-radius: 25px;
- text-align: center;
- line-height: 50px;
- text {
- font-size: 18px;
- color: #FFFFFF;
- letter-spacing: 4px;
- }
- }
- }
- </style>
|