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 { ...@@ -4,20 +4,15 @@ export default {
globalData: { globalData: {
// 开发环境 // 开发环境
uniEnv: process.uniEnv, uniEnv: process.uniEnv,
questionList: [], questionList: []
orgId: -1
}, },
onLaunch: function(options) { onLaunch: function(options) {
this.globalData.id = options?.query?.orgId || -1
// 版本更新 // 版本更新
this.updateApp() this.updateApp()
}, },
onShow: function() { onShow: function(options) {
const orgId = this.globalData.id console.log("options", options)
if (orgId !== this.orgId) { this.updateOrgId(options)
this.logout()
}
this.$u.vuex('orgId', orgId)
}, },
onHide: function() { onHide: function() {
console.log('App Hide') console.log('App Hide')
...@@ -81,10 +76,30 @@ export default { ...@@ -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() { logout() {
this.$u.vuex('vuex_token', '') this.$u.vuex('vuex_token', '')
this.$u.vuex('orgId', '')
this.$u.vuex('openId', '') this.$u.vuex('openId', '')
this.$u.vuex('userInfo', {}) this.$u.vuex('userInfo', {})
this.$u.vuex('questionList', {})
this.$u.vuex('lastIndex', {})
this.$u.vuex('answerCount', {})
} }
}, },
} }
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<view class="u-flex default" v-if="total === 0 && [3, 4].includes(type)"> <view class="u-flex default" v-if="total === 0 && [3, 4].includes(type)">
<view> <view>
<image :src="defaultImg" /> <u-image :src="defaultImg" width="374" height="322" :fade="false" />
</view> </view>
<view class="no-result"> <view class="no-result">
{{ type === 4 ? '当前暂无错题记录' : '当前暂无收藏题目' }} {{ type === 4 ? '当前暂无错题记录' : '当前暂无收藏题目' }}
...@@ -278,6 +278,8 @@ export default { ...@@ -278,6 +278,8 @@ export default {
this.$u.vuex(`answerCount.${this.questionWarehouseId}`, 0) this.$u.vuex(`answerCount.${this.questionWarehouseId}`, 0)
this.$u.vuex(`questionList.${this.questionWarehouseId}`, []) this.$u.vuex(`questionList.${this.questionWarehouseId}`, [])
} }
} else if (this.source === 3) {
this.title = '考试'
} else if (this.source === 4) { } else if (this.source === 4) {
this.title = '收藏的题' this.title = '收藏的题'
} else if (this.source === 5) { } else if (this.source === 5) {
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<view class="u-flex default" v-if="lists.length === 0"> <view class="u-flex default" v-if="lists.length === 0">
<view> <view>
<image :src="defaultImg" /> <u-image :src="defaultImg" width="374" height="256" :fade="false" />
</view> </view>
<view class="no-result"> <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