123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <template>
- <view class="index">
- <view class="top">
- <image src="../../static/image/login-bg.png" mode="widthFix" class="bg">
- <view class="top-text">
- <view class="">
- 实验中心
- </view>
- <view class="">
- 开放预约平台
- </view>
- </view>
- </image>
- <!-- <image src="../../static/image/logo.png" mode="widthFix" class="logo"></image> -->
- </view>
- <view class="login-form">
- <view class="input">
- <u-input v-model="password" type="password" :password-icon="true" height="102" placeholder="请填写新密码" />
- </view>
- <view class="input">
- <u-input v-model="passwordCon" type="password" :password-icon="true" height="102"
- placeholder="请确认新密码" />
- </view>
- <view class="button" @click="doLogin()">
- 确定
- </view>
- </view>
- </view>
- </template>
- <script>
- import Base64 from 'base-64';
- export default {
- data() {
- return {
- password: '',
- passwordCon: '',
- }
- },
- onShow() {
- },
- onHide() {
- },
- methods: {
- doLogin() {
- if (!this.password) {
- this.$u.toast('密码不能为空')
- return
- }
- if (!this.passwordCon) {
- this.$u.toast('确认密码不能为空')
- return
- }
- var patrn = new RegExp(
- "([\u4E00-\u9FFF]|[\u3002\uff1b\uff0c\uff1a\u201c\u201d\uff08\uff09\u3001\uff1f\u300a\u300b\uff01\u3010\u3011\uffe5])+",
- "g");
- if (patrn.exec(this.password)) {
- uni.showToast({
- title: '您输入的密码中含有中文字符请重新输入!',
- icon: 'none'
- })
- return
- }
- // let base64 = new Base64()
- let data = {
- id: this.$store.state.vuex_user.id,
- password: this.password,
- password_confirmation: this.passwordCon
- }
- this.$u.post('/auth/reset-password', data).then(res => {
- this.$u.toast('修改成功')
- setTimeout(() => {
- uni.navigateBack()
- }, 1500)
- // this.$u.vuex('vuex_token', 'bearer ' + res.data.token);
- // this.$u.vuex('vuex_user', res.data.user);
- // this.$u.vuex('vuex_islogin', true);
- // this.$u.vuex('vuex_token_time', new Date().getTime())
- // if (this.is_rember) {
- // let account = {
- // username: this.username,
- // password: this.password,
- // }
- // this.$u.vuex('vuex_account', account)
- // } else {
- // this.$u.vuex('vuex_account', '')
- // }
- // uni.switchTab({
- // url: '../index/index'
- // })
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .index {
- height: 100vh;
- // background-color: #fdfdfd;
- overflow: hidden;
- }
- .top {
- position: relative;
- text-align: center;
- font-size: 30px;
- font-weight: bold;
- height: 30vh;
- background-color: #3665FF;
- color: #fff;
- display: flex;
- align-items: center;
- justify-content: center;
- .bg {
- width: 100%;
- position: absolute;
- bottom: 0;
- left: 0;
- height: 30vh;
- opacity: 0.2;
- }
- .logo {
- text-align: center;
- margin: 0 auto;
- height: 53px;
- overflow: hidden;
- }
- }
- .login-form {
- padding: 20px 15px;
- width: 90%;
- margin: 0 auto;
- margin-top: 40px;
- .input {
- margin-bottom: 15px;
- background-color: #F7F8FA;
- border-radius: 26px;
- // height: 52px;
- // line-height: 52px;
- border: none !important;
- .view {
- width: 100px;
- height: 30px;
- background: #3665FF;
- color: white;
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 4px;
- }
- }
- ::v-deep {
- .u-input {
- padding: 0 15px !important;
- }
- }
- .button {
- width: 90%;
- text-align: center;
- background-color: #3665FF;
- height: 52px;
- line-height: 52px;
- border-radius: 26px;
- color: #fff;
- margin: 0 auto;
- margin-top: 40px;
- font-size: 16px;
- font-weight: 550;
- }
- }
- </style>
|