diff --git a/App.vue b/App.vue index 64ed1b8..e0f5f5b 100644 --- a/App.vue +++ b/App.vue @@ -6,28 +6,41 @@ export default { return {} }, async onLaunch(options) { - // const updateManager = uni.getUpdateManager() - // updateManager.onCheckForUpdate(function (res) { - // // 请求完新版本信息的回调 - // console.log(res.hasUpdate) - // }) - // updateManager.onUpdateReady(function (res) { - // uni.showModal({ - // title: '更新提示', - // content: '新版本已发布,重新启动应用', - // showCancel: false, - // confirmText: '立即更新', - // confirmColor: '#1890FF', - // success(res) { - // if (res.confirm) { - // // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 - // updateManager.applyUpdate() - // } - // } - // }) - // }) await this.initApp() }, + onShow() { + const updateManager = uni.getUpdateManager() + + updateManager.onCheckForUpdate(function (res) { + // 请求完新版本信息的回调 + // console.log(res.hasUpdate) + }) + + updateManager.onUpdateReady(function (res) { + uni.showModal({ + title: '更新提示', + content: '新版本已经准备好,是否重启应用?', + showCancel: false, + success(res) { + if (res.confirm) { + // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + updateManager.applyUpdate() + } + } + }) + }) + + updateManager.onUpdateFailed(function (res) { + // 新的版本下载失败 + console.log('download error') + uni.showModal({ + title: '提示', + content: + '新版小程序下载失败\n请自行退出程序,手动卸载本程序,再运行', + confirmText: '知道了' + }) + }) + }, methods: { // 初始化应用 initApp() { @@ -55,4 +68,4 @@ export default { \ No newline at end of file + diff --git a/api/system/dict.js b/api/system/dict.js index bbd33a0..6f21827 100644 --- a/api/system/dict.js +++ b/api/system/dict.js @@ -34,4 +34,14 @@ export function getTagData(params) { codeList: params } }) +} + +/** + * 获取区域 + */ +export function getArea() { + return request({ + url: `/system/home/getUserArea`, + method: 'GET', + }) } \ No newline at end of file diff --git a/api/task/index.js b/api/task/index.js index 28139ae..4661eee 100644 --- a/api/task/index.js +++ b/api/task/index.js @@ -31,5 +31,14 @@ export const TaskApi = { method: 'POST', data }) + }, + /** + * 查询部门树 + */ + getDept: () => { + return request({ + url: `/system/task-info/appSelectCreateDept`, + method: 'GET', + }) } } \ No newline at end of file diff --git a/pages/enterprise.vue b/pages/enterprise.vue index 44c5a0a..50f3923 100644 --- a/pages/enterprise.vue +++ b/pages/enterprise.vue @@ -29,7 +29,7 @@ } " /> - + /> --> @@ -126,6 +126,7 @@ marginBottom="12" v-if="load !== 'nomore' && list.length > 0" /> + @@ -233,10 +234,8 @@ export default { getDropdownOption(key) { if (!this.dictMap[key]) return [] const keyMap = { - enterprises_area: '按区域', - hy: '按行业', - st: '按生态', - wr: '按污染' + enterprises_area: '执法区域', + hy: '行业类别' } if (['enterprises_area'].includes(key)) { return [ diff --git a/pages/index.vue b/pages/index.vue index 240face..3b5113d 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -4,12 +4,12 @@ @@ -196,7 +196,11 @@