修改bug

This commit is contained in:
yj 2025-02-28 14:07:10 +08:00
parent fc73b4dd29
commit 043fbf1846
1 changed files with 19 additions and 13 deletions

View File

@ -271,19 +271,9 @@ Page({
} }
}) })
}, },
async onReady() { onReady() {
wx.onNetworkStatusChange(this.listener) wx.onNetworkStatusChange(this.listener)
const setting: any = await getStorage('setting') this.setStorageData()
if (setting) {
this.setData({
setting
})
} else {
wx.setStorage({
key: "setting",
data: this.data.setting
})
}
}, },
async onShow() { async onShow() {
wx.setKeepScreenOn({ wx.setKeepScreenOn({
@ -313,7 +303,7 @@ Page({
const isShare = this.data.roomUserList.find(item => item.shareSrc) const isShare = this.data.roomUserList.find(item => item.shareSrc)
const item = getMaxObject(this.data.audioList) const item = getMaxObject(this.data.audioList)
const user = this.data.roomUserList.find(row => item.uid === row.uid) const user = this.data.roomUserList.find(row => item.uid === row.uid)
if (this.data.currentUid !== item.uid && !isShare && (user && user.isRoom) && item.volumeNumber > 0 && item.uid !== this.data.user.uid) { if (item && (this.data.currentUid !== item.uid && !isShare && (user && user.isRoom) && item.volumeNumber > 0 && item.uid !== this.data.user.uid)) {
this.setData({ this.setData({
currentUid: item.uid currentUid: item.uid
}) })
@ -333,6 +323,21 @@ Page({
wx.offNetworkStatusChange(this.listener) wx.offNetworkStatusChange(this.listener)
this.clearTimer() this.clearTimer()
}, },
// 设置缓存
async setStorageData() {
const setting: any = await getStorage('setting')
if (setting) {
this.setData({
setting
})
} else {
wx.setStorage({
key: "setting",
data: this.data.setting
})
}
},
// 重连
async reconnecFun() { async reconnecFun() {
wx.hideLoading() wx.hideLoading()
wx.showLoading({ wx.showLoading({
@ -744,6 +749,7 @@ Page({
this.setData({ this.setData({
tabBarIndex: Number(e.currentTarget.dataset.tabbarindex) tabBarIndex: Number(e.currentTarget.dataset.tabbarindex)
}) })
this.setStorageData()
}, },
// 修改缓存设置 // 修改缓存设置
changeSetting(e) { changeSetting(e) {