增加 弹窗显示
This commit is contained in:
@@ -257,7 +257,7 @@ const submitForm = () => {
|
||||
param.runEnv = networkEnv.value;
|
||||
|
||||
// #ifdef H5
|
||||
param.uniqCode = 'e5687e80-526f-4522-ba7d-41d5db197a15';//h5测试用 内网-sn123456 外网-e5687e80-526f-4522-ba7d-41d5db197a15
|
||||
param.uniqCode = '7666ac20-827a-4c23-8e2e-fbbf24564fc0';//h5测试用 内网-sn123456 外网-7666ac20-827a-4c23-8e2e-fbbf24564fc0
|
||||
let res = await login(param);
|
||||
userStore.login(res);
|
||||
uni.switchTab({ url: '/pages/home/home' })
|
||||
|
||||
@@ -87,17 +87,27 @@
|
||||
</view>
|
||||
|
||||
<!-- 退出登录 -->
|
||||
<button type="primary" plain="true" size="small" class="logout-btn" @click="handleLoginOut">退出登录</button>
|
||||
<button type="primary" plain="true" size="small" class="logout-btn" @click="showModel">退出登录</button>
|
||||
|
||||
<!-- 底部加高度来避免tabbar遮挡 -->
|
||||
<!-- <view class="bottom-height"></view> -->
|
||||
</mescroll-uni>
|
||||
</view>
|
||||
|
||||
<!-- 弹窗模板 -->
|
||||
<customShowModal
|
||||
:title="title"
|
||||
:content="content"
|
||||
:visible="visible"
|
||||
@close="handleClose"
|
||||
@confirm="handleLoginOut"
|
||||
ref="showModel"
|
||||
></customShowModal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { ref, onMounted,getCurrentInstance } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
||||
import { getNavBarPaddingTop } from '@/utils/system.js'
|
||||
@@ -106,6 +116,7 @@ import { formatIOS } from '@/utils/status.js'
|
||||
import { showAlert } from '@/utils/message.js'
|
||||
import { useUserStore } from '@/stores/user';
|
||||
const userStore = useUserStore()
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
// 1.头部导航栏
|
||||
const navBarPaddingTop = ref(0);
|
||||
@@ -179,6 +190,7 @@ const downCallback = async (mescroll) => {
|
||||
|
||||
// 3.查询是否有更新的版本显示点
|
||||
const getVersion = async ()=>{
|
||||
let networkEnv = proxy.$NETWORK_ENV;//1-内网 2-外网
|
||||
let param = {
|
||||
// #ifdef APP-PLUS
|
||||
verNumber:systemInfo.appWgtVersion,//当前版本号
|
||||
@@ -187,20 +199,35 @@ const getVersion = async ()=>{
|
||||
verNumber : systemInfo.appVersion,
|
||||
// #endif
|
||||
os: formatIOS(systemInfo.osName),//操作系统 Android IOS
|
||||
runEnv:networkEnv
|
||||
}
|
||||
let data = await versionCheck(param);
|
||||
isCurrent.value = data.isCurrent;
|
||||
}
|
||||
|
||||
// 自定义弹窗
|
||||
let title = ref('');
|
||||
let content = ref('');
|
||||
let visible = ref(false);
|
||||
const showModel=()=>{
|
||||
title.value = '提示'
|
||||
content.value = '是否确认退出?';
|
||||
visible.value = true;
|
||||
}
|
||||
//关闭
|
||||
const handleClose=()=>{
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
// 3.退出登录
|
||||
const handleLoginOut = async ()=>{
|
||||
|
||||
showAlert('是否确认退出?','提示',true,()=>{
|
||||
// showAlert('是否确认退出?','提示',true,()=>{
|
||||
userStore.logout();
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login',
|
||||
});
|
||||
})
|
||||
// })
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -26,12 +26,13 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted,getCurrentInstance } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { ref, onMounted } from 'vue'
|
||||
import customHeader from '@/components/customHeader.vue'
|
||||
import { versionCheck } from '@/api/auth.js';
|
||||
import { getNavBarPaddingTop } from '@/utils/system.js'
|
||||
import { formatIOS } from '@/utils/status.js'
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
// 初始load页面
|
||||
onLoad(async(opt) => {
|
||||
@@ -49,6 +50,7 @@ onMounted(() => {
|
||||
navBarPaddingTop.value = getNavBarPaddingTop() * 2;
|
||||
})
|
||||
let getOSVesion = async()=>{
|
||||
let networkEnv = proxy.$NETWORK_ENV;//1-内网 2-外网
|
||||
let systemInfo = uni.getSystemInfoSync();
|
||||
let param = {
|
||||
// #ifdef APP-PLUS
|
||||
@@ -58,15 +60,16 @@ let getOSVesion = async()=>{
|
||||
verNumber : systemInfo.appVersion,
|
||||
// #endif
|
||||
os: formatIOS(systemInfo.osName),//操作系统 Android IOS
|
||||
runEnv:networkEnv
|
||||
}
|
||||
// 当前手机版本
|
||||
appVersion.value = param.appVersion;
|
||||
console.log("appVersion=>",appVersion)
|
||||
console.log("appVersion=>",appVersion.value)
|
||||
let data = await versionCheck(param);
|
||||
newVersion.value = data.verNumber;
|
||||
downloadURL.value = data.downloadUrl || '';
|
||||
isCurrent.value = data.isCurrent;
|
||||
remark.value = data.remark //|| '全新的UI界面 优化了签到/打卡功能,整体流程更加简洁清晰 搜索功能全面升级 修复了已知BUG'
|
||||
remark.value = data.remark; //|| '全新的UI界面 优化了签到/打卡功能,整体流程更加简洁清晰 搜索功能全面升级 修复了已知BUG'
|
||||
}
|
||||
|
||||
// 下载最新版本
|
||||
|
||||
Reference in New Issue
Block a user