Commit 4aab5d4d by 前端

更新

1 parent d63727d8
......@@ -2,14 +2,15 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-07 17:09:53
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-08-30 17:28:05
* @LastEditTime: 2024-09-24 11:01:24
* @FilePath: \gl_tape\App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script>
const PATH = ['/pages/common/caseDetail']
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update-nvue.js'
import { mapState } from 'vuex'
import utils from '@/utils/utils'
export default {
computed: {
...mapState('audio', ['isEnd', 'isStart'])
......@@ -26,6 +27,26 @@ export default {
})
},
methods: {
async handleCheck() {
const { textList, tempFileURL, version } = uni.$storage.get('mock_data')
const res = utils.compareVersions(plus?.runtime?.version, version)
if (res > -1) {
return
}
const e = {
result: {
is_silently: false,
is_mandatory: true,
name: '',
title: '',
contents: textList.join('\n'),
version: version,
url: tempFileURL,
stable_publish: true
}
}
checkUpdate(e)
},
init() {
uni.addInterceptor('navigateTo', {
//监听跳转
......@@ -79,6 +100,7 @@ export default {
},
onShow: async function () {
this.handleCheck()
// const systemInfo = await uni.$api.systemApi.getMockData();
// if (systemInfo.isCheckedUpdate) {
// checkUpdate();
......
......@@ -29,6 +29,7 @@
<script type="text/ecmascript-6">
import checkUpdate from "@/uni_modules/uni-upgrade-center-app/utils/check-update-nvue.js";
import utils from '@/utils/utils'
export default {
name: 'SettingBox',
data() {
......@@ -56,24 +57,6 @@ export default {
}
});
},
/** 比较版本号的大小
**/
compareVersions(version1, version2) {
const v1 = version1.split('.').map(v => +v) // 转化成数字数组
const v2 = version2.split('.').map(v => +v)
const b1 = v1.every(v => !isNaN(v)) // 判断数组的每一项是否是数字
const b2 = v2.every(v => !isNaN(v)) // 如果不是则返回错误信息
if (!b1 || !b2) return '版本号错误,只能包含数字、.'
const len = Math.max(v1.length, v2.length)
for (let i = 0; i < len; i++) {
const num1 = v1[i] || 0
const num2 = v2[i] || 0
if (num1 > num2) return 1 // 如果版本号1大于版本号2,则输出1
if (num1 < num2) return -1 // 反之则输出 -1
}
// 如果版本号1 等于版本号2,则输出0
return 0
},
async handleCheck() {
const {
......@@ -81,7 +64,7 @@ export default {
tempFileURL,
version
} = uni.$storage.get('mock_data')
const res = this.compareVersions(this.version,version)
const res = utils.compareVersions(this.version,version)
if(res > -1) {
uni.showToast({
title: '目前已是最新版本',
......
......@@ -2,7 +2,7 @@
"name" : "展业助手",
"appid" : "__UNI__D3BD3DF",
"description" : "",
"versionName" : "1.6.0",
"versionName" : "1.9.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App特有相关 */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!