You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.6 KiB
Vue

6 months ago
<template>
<view class="setting-page">
<ch-nav-bar :height="66" title="设置"></ch-nav-bar>
<uni-list>
<uni-list-item title="版本更新" show-arrow="true" clickable @click="checkAppUpdate">
<template v-slot:footer>
<uni-tag v-if="hadUpdate" text="新版本" type="primary"></uni-tag>
<text v-else>{{ appInfo.appWgtVersion }}</text>
</template>
</uni-list-item>
<uni-list-item title="家长二维码" show-arrow="true" clickable @click="checkQrcode">
</uni-list-item>
6 months ago
</uni-list>
<uni-popup ref="qrcodePopupRef" type="dialog">
<image :src="userInfo.qrcode" mode="aspectFit"></image>
</uni-popup>
6 months ago
</view>
</template>
<script setup>
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
import { reactive, ref, toRefs } from 'vue';
import { useSystemStore } from '@/store/system.js';
import { useUserStore } from '@/store/user.js';
6 months ago
const sysStore = useSystemStore();
const userStore = useUserStore();
const qrcodePopupRef = ref(null)
6 months ago
const data = reactive({
hadUpdate: false,
appInfo: sysStore.appInfo,
userInfo: userStore.userInfo
6 months ago
})
const { hadUpdate, appInfo, userInfo } = toRefs(data);
6 months ago
// 检查更新
function checkAppUpdate () {
// #ifdef APP
uni.showLoading({
title: '检查更新...'
})
checkUpdate().then(res => {
console.log('检查更新结果:', res)
if (res.code === 0) {
uni.showToast({
icon: 'none',
title: '暂无更新'
})
}
}).catch(error => {
6 months ago
console.log("检查更新错误:", error)
}).finally(() => {
uni.hideLoading()
})
// #endif
}
function checkQrcode () {
qrcodePopupRef.value.open('center')
}
6 months ago
</script>
<style lang="scss">
</style>