jiuyiUniapp/jiuyi2/pages/login/lock.vue

94 lines
1.7 KiB
Vue

<script setup>
// 锁住app
// 工具库
import util from '@/common/js/util.js'
//
import {
computed,
reactive,
} from 'vue'
import {
useStore
} from 'vuex'
// api
import api from '@/api/index.js'
// 加密
import CryptoJS from 'crypto-js';
const store = useStore()
//
const form = reactive({})
// 用户信息
const userinfo = computed(() => {
let result = store.state.userinfo
return result
})
// 提交
function handleSubmit() {
const data = {
...form
}
//
if (!data.userPassword) {
util.alert('验证密码不能为空')
return
}
// 手机号
data.userPhone = userinfo.value.userPhone
// md5加密
data.userPassword = CryptoJS.MD5(data.userPassword).toString();
// 解除青少年模式
api.mine.adolescentClose({
path: [data.userPassword],
}).then(rs => {
if (rs.code == 200) {
uni.switchTab({
url: '/pages/index/index'
})
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
</script>
<template>
<view class="container pr fmid fdc">
<view class="title f40 b">输入二级密码解锁未成年模式</view>
<view class="account mtb20 c666 f32">当前账号: {{userinfo.phoneNumber}}</view>
<view class="password mtb30 br20">
<input class="input" type="text" v-model="form.userPassword" placeholder="二级密码" />
</view>
<view class="button btn lg bar black mt60" @click="handleSubmit">解锁</view>
</view>
</template>
<style lang="scss" scoped>
//
.container {
width: 100vw;
height: 100vh;
// 密码
.password {
width: 80%;
background-color: #eee;
//
.input {
padding: 20rpx 20rpx;
}
}
.button {
width: 80%;
}
}
</style>