| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <template>
- <!-- <page-meta :root-font-size="getRootFontSize(1)"></page-meta> -->
- <view id="wrap">
- <view class="fontContent" :style="{ fontSize: selectValue + 'rem' }">字体大小设置</view>
- <view class="changeFont">
- <view class="changeFont_left" >字号:</view>
- <uni-data-select
- v-model="selectValue"
- :localdata="range"
- @change="change"
- ></uni-data-select>
- </view>
- <view class="btnClass">
- <wButton class="wbutton" text="保存设置" :rotate="isRotate" @click="saveFont"></wButton>
- </view>
-
- </view>
- </template>
- <script>
- import wButton from '@/components/watch-login/watch-button.vue' //button
- export default {
- data() {
- return {
- selectValue: 1,
- isRotate: false, //是否加载旋转
- range: [
- { value: 1, text: "小" },
- { value: 1.2, text: "中" },
- { value: 1.4, text: "大" },
- ],
- };
- },
- components: {
- wButton,
- },
- onLoad() {
- this.selectValue = uni.getStorageSync('fontSizeValue')
- },
- methods: {
- change(e) {
- console.log("e:", e);
- },
- saveFont(){
- uni.setStorageSync('fontSizeValue', '')
- uni.setStorageSync('fontSizeValue', this.selectValue)
- uni.showModal({
- title: '退出',
- content: '是否确认退出',
- success: function (res) {
- if (res.confirm) {
- uni.reLaunch({
- url:'/pages/login/login'
- })
- } else if (res.cancel) {
- this.$mHelper.toast("你需要重新登录才生效");
- }
- }
- });
- },
- }
- }
- </script>
- <style scoped>
- #wrap{
- background: #fff;
- padding: 15px;
- }
- .btnClass{
- margin-top: 30px;
- }
- .fontContent{
- margin-top: 30px;
- }
- .changeFont_left{
- width: 20%;
- }
- .changeFont{
- margin-top: 30px;
- display: flex;
- background: #fff;
- line-height: 36px;
-
- }
- </style>
|