首页加入会议逻辑优化
This commit is contained in:
parent
23f6ea5ba8
commit
739b6161ec
|
|
@ -12,7 +12,8 @@ Page({
|
||||||
isCamera: false,
|
isCamera: false,
|
||||||
netWorkErrorDialog: false,
|
netWorkErrorDialog: false,
|
||||||
historicalList: [],
|
historicalList: [],
|
||||||
isJoin: false
|
isJoin: false,
|
||||||
|
code: ''
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
const that = this;
|
const that = this;
|
||||||
|
|
@ -55,6 +56,9 @@ Page({
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
if (!this.data.code) {
|
||||||
|
this.getCode()
|
||||||
|
}
|
||||||
if (option.scene) {
|
if (option.scene) {
|
||||||
const scene = decodeURIComponent(option.scene)
|
const scene = decodeURIComponent(option.scene)
|
||||||
const room = scene.split('r=')[1];
|
const room = scene.split('r=')[1];
|
||||||
|
|
@ -103,6 +107,24 @@ Page({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getCode(callBack?) {
|
||||||
|
wx.login({
|
||||||
|
success: (res) => {
|
||||||
|
const { code } = res
|
||||||
|
GetOpenId(code).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.setData({
|
||||||
|
code: res.data,
|
||||||
|
})
|
||||||
|
callBack?.(true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
callBack?.(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
closeDialog() {
|
closeDialog() {
|
||||||
wx.setStorage({
|
wx.setStorage({
|
||||||
key: "isConnected",
|
key: "isConnected",
|
||||||
|
|
@ -194,33 +216,28 @@ Page({
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const that = this;
|
GetCheckoutRoomNum(this.data.meetingForm.roomNum).then(async res => {
|
||||||
GetCheckoutRoomNum(this.data.meetingForm.roomNum).then(res => {
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
wx.login({
|
if (this.data.code) {
|
||||||
success: (res) => {
|
navigateToMeeting(this.data.code)
|
||||||
const { code } = res
|
|
||||||
GetOpenId(code).then(res => {
|
|
||||||
if (res.code === 200) {
|
|
||||||
navigateToMeeting(res.data)
|
|
||||||
} else {
|
} else {
|
||||||
that.setData({
|
this.getCode((bool) => {
|
||||||
isJoin: false
|
if (bool) {
|
||||||
})
|
navigateToMeeting(this.data.code)
|
||||||
}
|
} else {
|
||||||
}).catch(() => {
|
Message.error({
|
||||||
that.setData({
|
context: this,
|
||||||
isJoin: false
|
offset: [90, 32],
|
||||||
})
|
duration: 3000,
|
||||||
})
|
content: '登录失败,请重试。',
|
||||||
},
|
});
|
||||||
fail: () => {
|
this.setData({
|
||||||
that.setData({
|
|
||||||
isJoin: false
|
isJoin: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.setData({
|
this.setData({
|
||||||
isJoin: false
|
isJoin: false
|
||||||
|
|
|
||||||
|
|
@ -252,6 +252,9 @@ Page({
|
||||||
wx.onNetworkStatusChange(this.listener)
|
wx.onNetworkStatusChange(this.listener)
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
wx.setKeepScreenOn({
|
||||||
|
keepScreenOn: true,
|
||||||
|
});
|
||||||
this.setData({
|
this.setData({
|
||||||
isCurrePage: false
|
isCurrePage: false
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue