This commit is contained in:
2022-06-11 13:59:23 +08:00
12 changed files with 113 additions and 36 deletions

View File

@@ -3,7 +3,6 @@
export default { export default {
onLaunch: function() { onLaunch: function() {
// return
//#ifdef APP-PLUS //#ifdef APP-PLUS
// 获取系统版本号 // 获取系统版本号
getVersions({ getVersions({

View File

@@ -91,10 +91,11 @@
}).then((res) => { }).then((res) => {
this.$store.commit('setToken', res.token_type + ' ' + res.access_token); this.$store.commit('setToken', res.token_type + ' ' + res.access_token);
if(res.is_new){ if(res.is_new){
uni.setStorageSync('isnew', res.is_new ? 0 : 1) uni.setStorageSync('isnew', 0)
this.$Router.replace({name: 'AuthRole'}) this.$Router.replace({name: 'AuthRole'})
return return
} }
uni.setStorageSync('isnew', 1)
this.$Router.pushTab({name: 'Life'}) this.$Router.pushTab({name: 'Life'})
uni.hideLoading() uni.hideLoading()
}).catch((err) => { }).catch((err) => {

View File

@@ -71,7 +71,7 @@
sex : this.sex, sex : this.sex,
storage_id : this.storageId storage_id : this.storageId
}).then(res => { }).then(res => {
this.$store.commit('setIsNew', 1) uni.setStorageSync('isnew', 1)
this.$Router.pushTab({name: 'Life'}) this.$Router.pushTab({name: 'Life'})
}).catch(err => { }).catch(err => {
this.disabled = false this.disabled = false

View File

@@ -175,9 +175,6 @@
}, },
// 签到 // 签到
onSign(){ onSign(){
console.log(this.isSign)
if(this.isSign){ if(this.isSign){
this.$Router.push({name: 'Capacity'}) this.$Router.push({name: 'Capacity'})
return return

View File

@@ -91,7 +91,7 @@
意见反馈 意见反馈
<uni-icons class="forward" type="forward" color="#999" /> <uni-icons class="forward" type="forward" color="#999" />
</view> </view>
<view class="btns-box-item"> <view class="btns-box-item" @click="updateApp">
<image class="icon" src="@/static/user/userIcon_03.png" mode="widthFix" /> <image class="icon" src="@/static/user/userIcon_03.png" mode="widthFix" />
版本更新 版本更新
<uni-icons class="forward" type="forward" color="#999" /> <uni-icons class="forward" type="forward" color="#999" />
@@ -125,7 +125,9 @@
info, info,
chainSeed chainSeed
} from '@/apis/interfaces/user'; } from '@/apis/interfaces/user';
import {
getVersions
} from '@/apis/interfaces/versions.js'
export default { export default {
data() { data() {
return { return {
@@ -234,6 +236,71 @@
} }
}); });
}, },
updateApp(){
uni.showLoading({
title: '检查更新'
})
//#ifdef APP-PLUS
// 获取系统版本号
getVersions({
platform: plus.os.name,
version : plus.runtime.version
}).then(res => {
uni.hideLoading()
if (res.update) {
uni.showModal({
title: "更新提示",
content: res.note || '版本更新信息',
confirmText: "更新",
success: modalRes => {
if (modalRes.confirm) {
if (plus.os.name == "Android") {
uni.showToast({
title: '新版本下载中,将在下载完成后自动为您安装更新包',
icon: 'none'
})
uni.downloadFile({
url: res.info.download,
success: apkPick => {
plus.runtime.install(apkPick
.tempFilePath, '',
installRES => {
// 安装完成用于提示新版本引导,暂时无用
}, installERR => {
// 安装失败
})
},
fail(err) {
uni.showToast({
title: '安装包下载失败,请检查您的网络或稍后重试',
icon: 'none'
})
}
})
} else {
uni.showToast({
title: 'IOS应用暂未上架请打开测试(TestFlight)工具点击更新',
icon: 'none'
})
}
}
}
})
return
}
uni.showModal({
title : "提示",
content : "当前已是最新版本",
showCancel : false,
})
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
//#endif
}
} }
}; };
</script> </script>

View File

@@ -11,7 +11,8 @@ const router = createRouter({
//全局路由前置守卫 //全局路由前置守卫
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if(to.name === 'Auth' && store.getters.getToken != '' && uni.getStorageSync('token') != ''){ if(to.name === 'Auth'){
if(store.getters.getToken != '' || uni.getStorageSync('token') != ''){
if(uni.getStorageSync('isnew') === 0){ if(uni.getStorageSync('isnew') === 0){
next({ next({
name: 'AuthRole', name: 'AuthRole',
@@ -26,6 +27,9 @@ router.beforeEach((to, from, next) => {
return return
} }
next(); next();
return
}
next();
}); });
// 全局路由后置守卫 // 全局路由后置守卫

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -2190,7 +2190,7 @@ if(false) {}
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/runtime/api.js */ 10); var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/runtime/api.js */ 10);
exports = ___CSS_LOADER_API_IMPORT___(false); exports = ___CSS_LOADER_API_IMPORT___(false);
// Module // Module
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* 气泡漂浮 */\n.number-float[data-v-5c2ab254]{\n\t-webkit-animation: 4s octfloat-data-v-5c2ab254 infinite;\n\t animation: 4s octfloat-data-v-5c2ab254 infinite;\n}\n@-webkit-keyframes octfloat-data-v-5c2ab254{\n0%{\n\t\tmargin-top: 0;\n}\n50%{\n\t\tmargin-top: 15rpx;\n}\n100%{\n\t\tmargin-top: 0;\n}\n}\n@keyframes octfloat-data-v-5c2ab254{\n0%{\n\t\tmargin-top: 0;\n}\n50%{\n\t\tmargin-top: 15rpx;\n}\n100%{\n\t\tmargin-top: 0;\n}\n}\n", ""]); exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* 气泡漂浮 */\n.number-float[data-v-5c2ab254]{\n\t-webkit-animation: 4s octfloat-data-v-5c2ab254 infinite;\n\t animation: 4s octfloat-data-v-5c2ab254 infinite;\n}\n@-webkit-keyframes octfloat-data-v-5c2ab254{\n0%{\n\t\tmargin-top: 0;\n}\n50%{\n\t\tmargin-top: 15rpx;\n}\n100%{\n\t\tmargin-top: 0;\n}\n}\n@keyframes octfloat-data-v-5c2ab254{\n0%{\n\t\tmargin-top: 0;\n}\n50%{\n\t\tmargin-top: 15rpx;\n}\n100%{\n\t\tmargin-top: 0;\n}\n}\n", ""]);
// Exports // Exports
module.exports = exports; module.exports = exports;
@@ -3926,7 +3926,15 @@ var render = function() {
), ),
_c( _c(
"v-uni-view", "v-uni-view",
{ staticClass: _vm._$g(55, "sc"), attrs: { _i: 55 } }, {
staticClass: _vm._$g(55, "sc"),
attrs: { _i: 55 },
on: {
click: function($event) {
return _vm.$handleViewEvent($event)
}
}
},
[ [
_c("v-uni-image", { _c("v-uni-image", {
staticClass: _vm._$g(56, "sc"), staticClass: _vm._$g(56, "sc"),

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long