hn_ldlz/ldlz-H5/pages/mine/setting/index.vue

131 lines
2.8 KiB
Vue

<template>
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<view class="setting-container" :style="{height: `${windowHeight}px`}">
<view class="content">
<view>
<view class="fontchange">文字大小</view>
</view>
<view style="width:100%;padding: 0 10px;">
<slider :min="16" :max="28" :value="fontValue" @change="sliderChange" :step="3" />
<view class="change-fontsize-box">
<text style="font-size: 16px;width: 20%;text-align: left;">
最小
</text>
<text style="font-size: 19px;width: 16%;text-align: center;">
标准
</text>
<text style="font-size: 22px;width: 28%;text-align: center;">
</text>
<text style="font-size: 25px;width: 16%;text-align: center;">
加大
</text>
<text style="font-size: 28px;width: 20%;text-align: right;">
最大
</text>
</view>
</view>
<view style="padding: 20px 10px;width: 100%;">
<u-button type="primary" @click="submit">保存设置</u-button>
</view>
</view>
<view class="cu-list menu">
<view class="cu-item item-box">
<view class="content text-center" @click="handleLogout">
<text class="text-black">退出登录</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
fontValue: 19,
windowHeight: uni.getSystemInfoSync().windowHeight
}
},
onShow() {
this.fontValue = this.$store.state.vuex_fontsize;
},
methods: {
sliderChange(e) {
console.log(e);
this.fontValue = e.detail.value;
},
submit() {
this.$store.state.vuex_fontsize=this.fontValue
uni.setStorageSync("fontSize", this.fontValue);
uni.showToast({
title: '设置成功',
icon: 'none',
duration: 1500
});
},
handleLogout() {
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
this.$store.dispatch('LogOut').then(() => {
this.$tab.reLaunch('/pages/index')
})
})
}
}
}
</script>
<style lang="scss" scoped>
.page {
background-color: #f8f8f8;
}
.item-box {
background-color: #FFFFFF;
margin: 30rpx;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 10rpx;
border-radius: 8rpx;
color: #303133;
font-size: 32rpx;
}
.fontchange {
font-size: 0.8rem;
margin: 20px 0;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
padding: 5px;
box-sizing: border-box;
}
.change-fontsize-box {
margin: 20rpx 0rpx;
display: flex;
align-items: flex-end;
justify-content: space-between;
}
.text-black{
font-size:14px !important;
}
.cu-list{
position: fixed;
bottom: 8%;
width: 100vw;
}
::v-deep .u-button__text{
font-size:14px !important;
}
</style>