Commit f7ecf540 authored by Facius's avatar Facius

Merge branch 'dev-v1.0.0' of https://git.banshouhui.com/wuzhenzhe/study into dev-v1.0.0

parents 904b564d c7a5238b
......@@ -4,20 +4,15 @@ export default {
globalData: {
// 开发环境
uniEnv: process.uniEnv,
questionList: [],
orgId: -1
questionList: []
},
onLaunch: function(options) {
this.globalData.id = options?.query?.orgId || -1
// 版本更新
this.updateApp()
},
onShow: function() {
const orgId = this.globalData.id
if (orgId !== this.orgId) {
this.logout()
}
this.$u.vuex('orgId', orgId)
onShow: function(options) {
console.log("options", options)
this.updateOrgId(options)
},
onHide: function() {
console.log('App Hide')
......@@ -81,10 +76,30 @@ export default {
})
}
},
// 更新机构ID
updateOrgId(options) {
const orgId = options?.query?.orgId || -1
// 需要更新机构ID的场景,详细可参考 https://developers.weixin.qq.com/miniprogram/dev/reference/scene-list.html
const scene = [1005, 1006, 1011, 1012, 1013, 1026, 1035, 1047, 1048, 1049, 1053, 1058, 1067, 1091, 1145, 1135, 1183]
if (!this.orgId) {
this.$u.vuex('orgId', orgId)
} else {
if (scene.includes(options.scene)) {
if (orgId !== this.orgId) this.logout()
this.$u.vuex('orgId', orgId)
}
}
},
logout() {
this.$u.vuex('vuex_token', '')
this.$u.vuex('orgId', '')
this.$u.vuex('openId', '')
this.$u.vuex('userInfo', {})
this.$u.vuex('questionList', {})
this.$u.vuex('lastIndex', {})
this.$u.vuex('answerCount', {})
}
},
}
......
......@@ -91,7 +91,7 @@
<view class="u-flex default" v-if="total === 0 && [3, 4].includes(type)">
<view>
<image :src="defaultImg" />
<u-image :src="defaultImg" width="374" height="322" :fade="false" />
</view>
<view class="no-result">
{{ type === 4 ? '当前暂无错题记录' : '当前暂无收藏题目' }}
......@@ -278,6 +278,8 @@ export default {
this.$u.vuex(`answerCount.${this.questionWarehouseId}`, 0)
this.$u.vuex(`questionList.${this.questionWarehouseId}`, [])
}
} else if (this.source === 3) {
this.title = '考试'
} else if (this.source === 4) {
this.title = '收藏的题'
} else if (this.source === 5) {
......
......@@ -41,7 +41,7 @@
<view class="u-flex default" v-if="lists.length === 0">
<view>
<image :src="defaultImg" />
<u-image :src="defaultImg" width="374" height="256" :fade="false" />
</view>
<view class="no-result">
当前暂无搜索结果
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment