uu
This commit is contained in:
parent
f908645a56
commit
8c59a8bdcd
@ -59,4 +59,11 @@ export const getStaffQRCodePng = (data = {})=> {
|
|||||||
return coreRequest(url.getStaffQRCodePng, data, {}, "GET")
|
return coreRequest(url.getStaffQRCodePng, data, {}, "GET")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取app最新版本
|
||||||
|
export const getLastAppVersion = (data = {})=> {
|
||||||
|
return coreRequest(url.getLastAppVersion, data, {})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import { curEnvConf } from "../env"
|
|||||||
export const host = curEnvConf.apiHost
|
export const host = curEnvConf.apiHost
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
getLastAppVersion: `/emis/common/getLastAppVersion`, // 获取app最新版本
|
||||||
uploadFile: '/common/ossUpload',
|
uploadFile: '/common/ossUpload',
|
||||||
loginByApp: `/loginByApp`, // 登录
|
loginByApp: `/loginByApp`, // 登录
|
||||||
getInfoByApp: `/getInfoByApp`,// 获取用户基本信息
|
getInfoByApp: `/getInfoByApp`,// 获取用户基本信息
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { confirmModal, showLoading, hideLoading, showToast } from "@/common/untool"
|
import { confirmModal, showLoading, hideLoading, showToast } from "@/common/untool"
|
||||||
|
import * as apiService from "@/common/api"
|
||||||
|
|
||||||
export const getSystemInfo = ()=> {
|
export const getSystemInfo = ()=> {
|
||||||
let info = uni.getSystemInfoSync()
|
let info = uni.getSystemInfoSync()
|
||||||
@ -63,14 +64,19 @@ const installNewApk = (url)=> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getLastAppInfo = async (curAppInfo)=> {
|
const getLastAppInfo = async (curAppInfo)=> {
|
||||||
return {
|
let { version, versionCode } = curAppInfo
|
||||||
version: '1.0.1',
|
let { deviceId } = getSystemInfo()
|
||||||
versionCode: 101,
|
let res = await apiService.getLastAppVersion({ version, versionCode, deviceId })
|
||||||
apkUrl: 'http://192.168.1.7:5173/static/t.apk',
|
console.log("getLastAppInfo res====", res)
|
||||||
// apkUrl: 'http://oss-emis.tanex56.com/sapp/sdg/hdbg.png',
|
// res.data = {
|
||||||
wgtUrl: 'http://192.168.1.7:5173/static/t.wgt?t.wgt',
|
// version: '1.0.0',
|
||||||
|
// versionCode: 100,
|
||||||
|
// apkUrl: 'http://192.168.1.7:5173/static/t.apk',
|
||||||
|
// wgtUrl: 'http://192.168.1.7:5173/static/t.wgt',
|
||||||
// whiteDeviceIds: ['F9E778C90D0E9A8DA9D95AA97B00A3FB'],
|
// whiteDeviceIds: ['F9E778C90D0E9A8DA9D95AA97B00A3FB'],
|
||||||
}
|
// remark: '',
|
||||||
|
// }
|
||||||
|
return res.data
|
||||||
}
|
}
|
||||||
|
|
||||||
const compareInfo = (curAppInfo, lastAppInfo)=> {
|
const compareInfo = (curAppInfo, lastAppInfo)=> {
|
||||||
@ -110,4 +116,5 @@ export const checkUpdate = async ()=> {
|
|||||||
await installNewApk(cmpRes.url)
|
await installNewApk(cmpRes.url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return cmpRes
|
||||||
}
|
}
|
||||||
@ -75,7 +75,9 @@
|
|||||||
<u-text margin="0 0 0 30rpx" text="设备Id" size="28" color="#333"></u-text>
|
<u-text margin="0 0 0 30rpx" text="设备Id" size="28" color="#333"></u-text>
|
||||||
</u-row>
|
</u-row>
|
||||||
<u-row custom-style="flex: 1;">
|
<u-row custom-style="flex: 1;">
|
||||||
<view class="font-28 mr-10">{{curDeviceId}}</view>
|
<view style="text-align: right;flex: 1;">
|
||||||
|
<tpx-text-dic :value="curDeviceId"></tpx-text-dic>
|
||||||
|
</view>
|
||||||
<u-icon name="arrow-right" size="32" color="#333"></u-icon>
|
<u-icon name="arrow-right" size="32" color="#333"></u-icon>
|
||||||
</u-row>
|
</u-row>
|
||||||
</u-row>
|
</u-row>
|
||||||
@ -128,7 +130,7 @@
|
|||||||
import { dealBtnMap } from "@/common/enum"
|
import { dealBtnMap } from "@/common/enum"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import { getAuthList, authCodeEnum } from "@/common/authCode"
|
import { getAuthList, authCodeEnum } from "@/common/authCode"
|
||||||
import { getCurrentAppInfo, getSystemInfo } from "@/common/appUpdate"
|
import { getCurrentAppInfo, getSystemInfo, checkUpdate } from "@/common/appUpdate"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
@ -183,9 +185,9 @@
|
|||||||
methods: {
|
methods: {
|
||||||
async initData(){
|
async initData(){
|
||||||
this.getAppHomeStatData()
|
this.getAppHomeStatData()
|
||||||
|
this.curDeviceId = getSystemInfo()?.deviceId
|
||||||
let appRes = await getCurrentAppInfo()
|
let appRes = await getCurrentAppInfo()
|
||||||
this.curAppVersion = appRes._appVersion
|
this.curAppVersion = appRes._appVersion
|
||||||
this.curDeviceId = getSystemInfo()?.deviceId
|
|
||||||
},
|
},
|
||||||
async getAppHomeStatData(){
|
async getAppHomeStatData(){
|
||||||
let res = await apiService.getAppHomeStatData()
|
let res = await apiService.getAppHomeStatData()
|
||||||
@ -195,8 +197,9 @@
|
|||||||
await this.$store.dispatch(USERKEY.LOGOUT)
|
await this.$store.dispatch(USERKEY.LOGOUT)
|
||||||
this.goto(`login/login`, 2)
|
this.goto(`login/login`, 2)
|
||||||
},
|
},
|
||||||
handleCheckAppVersion() {
|
async handleCheckAppVersion() {
|
||||||
// TODO
|
let res = await checkUpdate()
|
||||||
|
this.showToast('已经是最新版本,无需更新')
|
||||||
},
|
},
|
||||||
handleClearCache() {
|
handleClearCache() {
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user