连云港陪玩陪聊
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
2.7 KiB

3 months ago
<template>
<view class="qingshaonian">
<view class="title">设置接触青少年模式的密码</view>
<view class="bd">
<view class="item">
<image src="@/static/qingshaonian-lock.png"></image>
1 month ago
<input v-model="teenagePsw" type="password" placeholder="输入密码" />
3 months ago
</view>
<view class="item">
<image src="@/static/qingshaonian-lock.png"></image>
1 month ago
<input v-model="teenagePsw1" type="password" placeholder="确认密码" />
3 months ago
</view>
</view>
<view class="fd">
1 month ago
<view class="btn" @click="openTeenageMode()">确定开启</view>
3 months ago
</view>
</view>
</template>
<script>
export default {
data() {
return {
1 month ago
teenagePsw: "",
teenagePsw1: ""
3 months ago
}
},
methods: {
1 month ago
//提交
async openTeenageMode() {
if(!this.teenagePsw){
uni.showToast({
title: "密码不能为空!",
position: "bottom",
icon: "none",
})
return ;
}
if(this.teenagePsw != this.teenagePsw1){
uni.showToast({
title: "密码不一致!",
position: "bottom",
icon: "none",
})
return ;
}
const { code, data , msg } = await this.$api.openTeenageMode({teenagePsw: this.teenagePsw,userId: uni.getStorageSync("userInfo").id});
if(code == 200){
uni.showToast({
title: "提交成功",
})
setTimeout(()=>{
uni.navigateBack({
delta: 2
})
},2000)
}else{
uni.showToast({
1 month ago
title: msg,
1 month ago
position: "bottom",
icon: "none",
})
}
},
3 months ago
}
}
</script>
<style scoped lang="scss">
.qingshaonian{
padding: 0 25rpx;
overflow: hidden;
.fd{
width: 100%;
position: fixed;
left: 0;
bottom: 0;
padding: 25rpx;
overflow: hidden;
z-index: 22;
box-sizing: border-box;
.btn{
width: 100%;
line-height: 98rpx;
background: linear-gradient(0deg, #000000, #3D3B38);
box-shadow: 0px 4rpx 18rpx 0px rgba(42,41,39,0.34);
border-radius: 98rpx;
font-weight: 400;
font-size: 30rpx;
color: #FFFFFF;
text-align: center;
}
}
.title{
font-weight: 500;
font-size: 30rpx;
color: #222222;
margin-top: 30rpx;
}
.bd{
background: #FFFFFF;
border-radius: 20rpx;
margin-top: 30rpx;
padding: 0 20rpx;
.item{
display: flex;
align-items: center;
box-sizing: border-box;
width: 100%;
border-top: 1px solid #EAEAEA;
font-weight: 500;
font-size: 30rpx;
color: #222222;
padding: 30rpx 0;
&:first-child{
border-top-color: #FFFFFF;
}
input{
font-weight: 400;
font-size: 30rpx;
color: #212121;
height: 60rpx;
line-height: 60rpx;
}
image{
width: 27rpx;
height: 27rpx;
margin-right: 20rpx;
}
}
}
}
</style>