oa_app仓库初始化
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<fy-header title="修改密码" />
|
||||
<view class="body">
|
||||
<text class="hint">首次登录或管理员要求改密,请设置新密码后继续。</text>
|
||||
<view class="field">
|
||||
<text class="lab">新密码</text>
|
||||
<view class="box"><input v-model="next" password placeholder="至少 6 位" /></view>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text class="lab">确认新密码</text>
|
||||
<view class="box"><input v-model="confirm" password placeholder="再输入一次" /></view>
|
||||
</view>
|
||||
<view class="btn-primary" @click="ok">确认修改</view>
|
||||
<text v-if="error" class="err">{{ error }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FyHeader from '../../components/fy-header.vue'
|
||||
import { store } from '../../utils/store.js'
|
||||
import { toast } from '../../utils/format.js'
|
||||
|
||||
export default {
|
||||
components: { FyHeader },
|
||||
data() {
|
||||
return { next: '', confirm: '', error: '', off: null, left: false }
|
||||
},
|
||||
onShow() {
|
||||
if (this.off) this.off()
|
||||
this.off = store.on(() => {
|
||||
this.error = store.error
|
||||
if (this.left || store.phase !== 'app') return
|
||||
this.left = true
|
||||
uni.switchTab({ url: '/pages/tabs/messages' })
|
||||
})
|
||||
},
|
||||
onHide() {
|
||||
if (this.off) this.off()
|
||||
this.off = null
|
||||
},
|
||||
methods: {
|
||||
async ok() {
|
||||
if (!this.next || this.next.length < 6) return toast('密码至少 6 位')
|
||||
if (this.next !== this.confirm) return toast('两次密码不一致')
|
||||
await store.changePassword(this.next, this.confirm)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.body { padding: 40rpx; }
|
||||
.hint { font-size: 26rpx; color: #737686; display: block; margin-bottom: 32rpx; }
|
||||
.field { margin-bottom: 24rpx; }
|
||||
.lab { font-size: 24rpx; color: #434655; display: block; margin-bottom: 8rpx; }
|
||||
.box { height: 96rpx; background: #fff; border-radius: 16rpx; padding: 0 24rpx; display: flex; align-items: center; }
|
||||
.box input { flex: 1; }
|
||||
.err { color: #ba1a1a; font-size: 24rpx; margin-top: 16rpx; display: block; }
|
||||
</style>
|
||||
Reference in New Issue
Block a user