Commit c8cb8124 authored by youjie's avatar youjie

no message

parent 5c25a3c0
...@@ -280,6 +280,7 @@ ...@@ -280,6 +280,7 @@
onMounted, onMounted,
} from "vue"; } from "vue";
import { GetBankTypeList,GetAppQuestionStatic,GetAppBankStatic } from "../../api/exam"; import { GetBankTypeList,GetAppQuestionStatic,GetAppBankStatic } from "../../api/exam";
import { VersionUpdate } from '../../utils/index.js'
export default { export default {
props: {}, props: {},
setup(props, ctx) { setup(props, ctx) {
...@@ -296,6 +297,7 @@ ...@@ -296,6 +297,7 @@
JoinArr:[] //测评数据 JoinArr:[] //测评数据
}); });
let methods = { let methods = {
VersionUpdate,
//获取等级 //获取等级
async getLevels(){ async getLevels(){
let res = await GetBankTypeList({}); let res = await GetBankTypeList({});
...@@ -379,6 +381,7 @@ ...@@ -379,6 +381,7 @@
}; };
let that = methods; let that = methods;
onMounted(() => { onMounted(() => {
that.VersionUpdate()
}); });
return { return {
...toRefs(data), ...toRefs(data),
......
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
getSweepCode getSweepCode
} from '../../api/index.js' } from '../../api/index.js'
import { import {
getImageColor getImageColor,VersionUpdate
} from '../../utils/index.js' } from '../../utils/index.js'
import indexassembly from './components/indexassembly.vue' import indexassembly from './components/indexassembly.vue'
import navbar from '../../components/navbar.vue' import navbar from '../../components/navbar.vue'
...@@ -205,6 +205,7 @@ ...@@ -205,6 +205,7 @@
}); });
let methods = { let methods = {
VersionUpdate,
goTongji() { goTongji() {
//console.log("SurveyObj",data.SurveyObj); //console.log("SurveyObj",data.SurveyObj);
this.jumpPage('/pages/study/questionNaire?ActivitySurveyId='+data.SurveyObj.ActivitySurveyId+"&ActivitySurveyGuestId="+data.SurveyObj.ActivitySurveyGuestId); this.jumpPage('/pages/study/questionNaire?ActivitySurveyId='+data.SurveyObj.ActivitySurveyId+"&ActivitySurveyGuestId="+data.SurveyObj.ActivitySurveyGuestId);
...@@ -382,9 +383,9 @@ ...@@ -382,9 +383,9 @@
} }
}; };
let that = methods;
onMounted(() => { onMounted(() => {
that.VersionUpdate()
}); });
return { return {
...toRefs(data), ...toRefs(data),
......
...@@ -175,6 +175,7 @@ ...@@ -175,6 +175,7 @@
inject, inject,
} from "vue"; } from "vue";
import bottom from "../../components/bottom"; import bottom from "../../components/bottom";
import { VersionUpdate } from '../../utils/index.js'
export default { export default {
components: { components: {
bottom, bottom,
...@@ -191,6 +192,7 @@ ...@@ -191,6 +192,7 @@
}); });
const methods = { const methods = {
VersionUpdate,
jumpPage(url) { jumpPage(url) {
uni.navigateTo({ uni.navigateTo({
...@@ -225,6 +227,9 @@ ...@@ -225,6 +227,9 @@
}, },
}; };
let that = methods; let that = methods;
onMounted(() => {
that.VersionUpdate()
});
return { return {
...toRefs(data), ...toRefs(data),
...methods ...methods
......
...@@ -515,6 +515,7 @@ ...@@ -515,6 +515,7 @@
import indexNo from './components/indexNo.vue' import indexNo from './components/indexNo.vue'
import carousel from './components/vear-carousel/vear-carousel.vue' import carousel from './components/vear-carousel/vear-carousel.vue'
import bottom from '../../components/bottom.vue' import bottom from '../../components/bottom.vue'
import { VersionUpdate } from '../../utils/index.js'
import { import {
ref, ref,
reactive, reactive,
...@@ -555,6 +556,7 @@ ...@@ -555,6 +556,7 @@
checkIndex: 0 checkIndex: 0
}) })
let methods = { let methods = {
VersionUpdate,
enlarge(id) { enlarge(id) {
// 全屏 // 全屏
data.videoContext = uni.createVideoContext(id); data.videoContext = uni.createVideoContext(id);
...@@ -747,6 +749,7 @@ ...@@ -747,6 +749,7 @@
} }
} }
onMounted(() => { onMounted(() => {
that.VersionUpdate()
data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight; data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
}) })
let that = methods; let that = methods;
......
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
<script> <script>
import Item from "./timeTable-item.vue"; import Item from "./timeTable-item.vue";
import { import {
ref, ref,
reactive, reactive,
...@@ -96,6 +97,7 @@ ...@@ -96,6 +97,7 @@
import { import {
getStundentPlanStatistical getStundentPlanStatistical
} from "../../api/index"; } from "../../api/index";
import { VersionUpdate } from '../../utils/index.js'
export default { export default {
name: "", name: "",
props: {}, props: {},
...@@ -226,6 +228,7 @@ ...@@ -226,6 +228,7 @@
timer: null, //防抖 timer: null, //防抖
}); });
let methods = { let methods = {
VersionUpdate,
// 获取当天数据 // 获取当天数据
async getData() { async getData() {
if(data.msg.ClassId<=0) return if(data.msg.ClassId<=0) return
...@@ -415,6 +418,7 @@ ...@@ -415,6 +418,7 @@
} }
}; };
onMounted(() => { onMounted(() => {
that.VersionUpdate()
getcalendar(new Date().getFullYear(), new Date().getMonth() + 1); getcalendar(new Date().getFullYear(), new Date().getMonth() + 1);
let today = calendar.value.find((e) => { let today = calendar.value.find((e) => {
return e.isToday === 1; return e.isToday === 1;
......
//定义更新方法
export let VersionUpdate = () =>{
// 判断应用的 getUpdateManager 是否在当前版本可用
if (uni.canIUse('getUpdateManager')) {
const updateManager = uni.getUpdateManager()
// 向小程序后台请求完新版本信息
updateManager.onCheckForUpdate(function(res) {
console.log(res.hasUpdate);
if (res.hasUpdate) {
//小程序有新版本,静默下载新版本,新版本下载完成
updateManager.onUpdateReady(function() {
//模态弹窗(确认、取消)
uni.showModal({
title: '更新提示',
content: '小程序已发布新版本,是否重启?',
success: function(res) {
//用户点击确定
if (res.confirm) {
//当新版本下载完成,调用该方法会强制当前小程序应用上新版本并重启
updateManager.applyUpdate()
} //用户点击取消
else if (res.cancel) {
//强制用户更新,弹出第二次弹窗
uni.showModal({
title: '提示',
content: '小程序已发布新版本,是否重启',
showCancel: false, //隐藏取消按钮
success: function(res) {
//第二次提示后,强制更新
if (res.confirm) {
// 当新版本下载完成,调用该方法会强制当前小程序应用上新版本并重启
updateManager.applyUpdate()
}
}
})
}
}
})
})
// 当新版本下载失败
updateManager.onUpdateFailed(function() {
uni.showModal({
title: '提示',
content: '请您删除当前小程序,重新打开小程序',
})
})
}
})
} else {
// 提示用户在最新版本的客户端上体验
uni.showModal({
title: '温馨提示',
content: '当前微信版本过低,可能无法使用该功能,请升级到最新版本后重试。'
})
}
}
//脱敏 //脱敏
export let desensitization = (str, beginLen, endLen) => { export let desensitization = (str, beginLen, endLen) => {
let len = str.length; let len = str.length;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment