Commit affe98d9 by 前端

检查更新

1 parent f767293e
......@@ -7,55 +7,53 @@
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script>
var wv;
import checkUpdate from "@/uni_modules/uni-upgrade-center-app/utils/check-update-nvue.js";
import { mapState } from "vuex";
var wv
import { mapState } from 'vuex'
export default {
computed: {
...mapState("audio", ["isEnd", "isStart"]),
},
onLoad() {
...mapState('audio', ['isEnd', 'isStart'])
},
onLoad() {},
onLaunch: async function () {
this.setAPPVersion()
setTimeout(() => {
plus.screen.unlockOrientation(); //解除锁定屏幕方向
plus.screen.lockOrientation("landscape-primary");
}, 300);
plus.screen.unlockOrientation() //解除锁定屏幕方向
plus.screen.lockOrientation('landscape-primary')
}, 300)
uni.setKeepScreenOn({
keepScreenOn: true,
});
keepScreenOn: true
})
},
methods: {
setAPPVersion() {
let version = plus.runtime.version;
let storageVersion = uni.$storage.get("storageVersion")
console.log(storageVersion,version)
if(storageVersion != version) {
uni.$storage.rm('userInfo');
uni.$storage.rm('noSignInUuid');
let version = plus.runtime.version
let storageVersion = uni.$storage.get('storageVersion')
console.log(storageVersion, version)
if (storageVersion != version) {
uni.$storage.rm('userInfo')
uni.$storage.rm('noSignInUuid')
}
uni.$storage.set("storageVersion",version)
},
uni.$storage.set('storageVersion', version)
}
},
onShow: async function () {
const systemInfo = await uni.$api.systemApi.getMockData();
if (systemInfo.isCheckedUpdate) {
checkUpdate();
}
let version = plus.runtime.version;
uni.$api.commonApi.getAPPVersion().then((res) => {
if (res != version && !systemInfo.isCheckedUpdate)
this.$store.dispatch("openUpdateModal");
});
// const systemInfo = await uni.$api.systemApi.getMockData();
// if (systemInfo.isCheckedUpdate) {
// checkUpdate();
// }
// let version = plus.runtime.version;
// uni.$api.commonApi.getAPPVersion().then((res) => {
// if (res != version && !systemInfo.isCheckedUpdate)
// this.$store.dispatch("openUpdateModal");
// });
},
onHide: function () {},
onError: function (e) {
this.$sendSentry(e);
},
};
this.$sendSentry(e)
}
}
</script>
<style lang="scss">
......
......@@ -8,7 +8,7 @@
<view class="sprite-icon icon-logo"></view>
展业助手
<view class="version">版本号:V{{ version }}</view>
<view class="check-box">检查更新</view>
<view class="check-box" @click="handleCheck">检查更新</view>
</view>
<view class="btn-box">
<view class="btn flex" @click="changeAccount">切换账号</view>
......@@ -28,6 +28,7 @@
</template>
<script type="text/ecmascript-6">
import checkUpdate from "@/uni_modules/uni-upgrade-center-app/utils/check-update-nvue.js";
export default {
name: 'SettingBox',
data () {
......@@ -43,16 +44,19 @@ export default {
},
methods: {
copyText() {
uni.setClipboardData({
data: this.deviceId,
success: function() {
uni.showToast({
title: '复制成功',
icon: 'success'
});
}
});
},
uni.setClipboardData({
data: this.deviceId,
success: function() {
uni.showToast({
title: '复制成功',
icon: 'success'
});
}
});
},
handleCheck() {
checkUpdate()
},
open () {
this.$refs.popup.open("center");
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!