jiuyiUniapp/jiuyi2/pages/mine/setting/teen.vue

70 lines
1.6 KiB
Vue
Raw Normal View History

2024-12-29 19:06:34 +08:00
<script setup>
// 工具库
import util from '@/common/js/util.js'
//
import api from '@/api/index.js'
import {
useStore
} from 'vuex'
import {
computed
} from 'vue';
// vuex
const store = useStore()
// 用户信息
const userinfo = computed(() => {
let result = store.state.userinfo
return result
})
// 开启青少年模式
function handleUpdate() {
2025-01-07 14:56:03 +08:00
api.mine.adolescentOpen({}).then(rs => {
2024-12-29 19:06:34 +08:00
if (rs.code == 200) {
2025-01-07 14:56:03 +08:00
// 更新用户信息
util.getUserinfo()
2024-12-29 19:06:34 +08:00
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
</script>
<template>
<view class="app">
<view class="container pr">
<image class="background" src="/static/teen.png" mode="widthFix" />
<!-- <view class="">青少年模式说明</view> -->
<view class="notice pa c333 f28">
<view class="mtb30">开启青少年模式后将自动为您开启时间锁单日使用时间不超过40分钟晚上10点至早上6点无法使用九亿</view>
<view class="mtb30">青少年模式开启后如果到了使用时间需要输入密码解锁关闭青少年模式</view>
</view>
</view>
<view class="btn pro black mtb30 mlr60" v-if="userinfo.youth == 1">已开启青少年模式</view>
<view class="btn pro black mtb30 mlr60" v-else @click="handleUpdate">开启青少年模式</view>
<view class="fill" style="height: 30rpx;"></view>
</view>
</template>
<style lang="scss">
.app {
background-color: #eaceb9;
}
//
.background {
width: 100%;
}
// 提示
.notice {
margin: 0 120rpx;
bottom: 120rpx;
}
</style>