jsy-app/pages/mine/setting/index.vue

115 lines
2.8 KiB
Vue
Raw Normal View History

2024-09-18 10:30:10 +08:00
<template>
2025-01-20 18:46:38 +08:00
<!-- 顶部导航栏 -->
<custom-nav-bar :left="true" leftText="" @leftClick="" title="应用设置">
</custom-nav-bar>
2025-02-07 16:16:29 +08:00
<view class="setting-container" :style="{height: `${windowHeight}px`}">
<view class="menu-list">
<view class="list-cell list-cell-arrow" @click="handleToPwd">
<view class="menu-item-box">
<view class="iconfont icon-password menu-icon"></view>
<view>修改密码</view>
</view>
</view>
2025-02-10 17:27:31 +08:00
<view class="list-cell list-cell-arrow" @click="handleToUpgrade">
<view class="menu-item-box">
<view class="iconfont icon-refresh menu-icon"></view>
<view>检查更新</view>
<view style="position: absolute;color: darkgray;right: 30px;" v-if="version.newV">
发现新版本
</view>
<view style="position: absolute;color: darkgray;right: 30px;" v-else>
{{version.oldV.versionName}}
</view>
</view>
</view>
2025-02-07 16:16:29 +08:00
</view>
<view class="cu-list menu">
<view class="item-box">
<u-button class="bg-red" type="success" size="large" text="退出登录" @click="handleLogout" />
</view>
</view>
2025-02-10 17:27:31 +08:00
<view style="position: absolute;bottom: 5px;width: 100vw;text-align: center;color: darkgray;">
版本 {{version.oldV.versionName}}
</view>
2025-02-07 16:16:29 +08:00
</view>
<view>
<uni-popup ref="popup" type="dialog">
<uni-popup-dialog type="info" cancelText="关闭" confirmText="退出" title="通知" content="确定注销并退出系统吗"
@confirm="dialogConfirm" @close="dialogClose">
</uni-popup-dialog>
</uni-popup>
</view>
2025-02-10 17:27:31 +08:00
<custom-app-update ref="appUpdate" />
2024-09-18 10:30:10 +08:00
</template>
<script setup>
2025-02-07 16:16:29 +08:00
import {
ref
} from "vue";
import store from '@/store'
2025-02-10 17:41:14 +08:00
import plugin from "@/plugins"
2025-02-10 17:27:31 +08:00
import {
getNewAppVersion
} from '@/api/index.js'
2025-02-07 16:16:29 +08:00
const windowHeight = ref(uni.getSystemInfoSync().windowHeight);
2025-02-10 17:27:31 +08:00
const version = ref(getApp().version);
2025-02-07 16:16:29 +08:00
const popup = ref(null);
2025-02-10 17:27:31 +08:00
const appUpdate = ref(null)
2025-02-07 16:16:29 +08:00
function handleToPwd() {
uni.navigateTo({
url: '/pages/mine/pwd/index'
});
};
function handleToUpgrade() {
2025-02-10 17:27:31 +08:00
getNewAppVersion().then(res => {
getApp().setUpdateVersion(res.data);
version.value = getApp().version;
2025-02-10 17:41:14 +08:00
if (version.value.newV) {
2025-02-10 17:27:31 +08:00
appUpdate.value.show();
2025-02-10 17:41:14 +08:00
}else{
plugin.modal.showToast("已是最新版本!");
2025-02-10 17:27:31 +08:00
}
})
2025-02-07 16:16:29 +08:00
};
function handleLogout() {
popup.value.open();
};
function dialogConfirm() {
//console.log('----------------点击确认------------')
store.dispatch('LogOut').then(() => {
uni.reLaunch({
// url: '/pages/login'
url: '/pages/agreement'
});
})
};
function dialogClose() {
//console.log('点击关闭')
};
2024-09-18 10:30:10 +08:00
</script>
<style lang="scss" scoped>
2025-02-07 16:16:29 +08:00
.page {
background-color: #f8f8f8;
}
.item-box {
2024-09-18 10:30:10 +08:00
2025-02-07 16:16:29 +08:00
margin: 30rpx;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 10rpx;
border-radius: 8rpx;
color: #303133;
font-size: 32rpx;
}
</style>