diff --git a/app.json b/app.json index 50a56d4..75e9f5f 100644 --- a/app.json +++ b/app.json @@ -13,7 +13,8 @@ "t-avatar": "tdesign-miniprogram/avatar/avatar", "t-message": "tdesign-miniprogram/message/message", "t-dialog": "tdesign-miniprogram/dialog/dialog", - "t-popup": "tdesign-miniprogram/popup/popup" + "t-popup": "tdesign-miniprogram/popup/popup", + "t-cell": "tdesign-miniprogram/cell/cell" }, "entryPagePath": "pages/form/index", "window": { diff --git a/components/header-tab/index.scss b/components/header-tab/index.scss index 8a11a7a..ce0f90e 100644 --- a/components/header-tab/index.scss +++ b/components/header-tab/index.scss @@ -6,6 +6,7 @@ text-align: center; width: 100%; padding: 24rpx 0; + font-size: 32rpx; &-back { position: absolute; diff --git a/pages/form/index.scss b/pages/form/index.scss index d1e6580..5deed16 100644 --- a/pages/form/index.scss +++ b/pages/form/index.scss @@ -7,7 +7,18 @@ &-content { padding: 20rpx 0 0 0; - flex-grow: 1; - overflow-y: auto; + + } + + .historical-records { + &-title { + color: #666; + font-size: 32rpx; + padding-left: 20rpx; + } + + &-view { + padding-top: 20rpx; + } } } \ No newline at end of file diff --git a/pages/form/index.ts b/pages/form/index.ts index 9fc0c05..ffee288 100644 --- a/pages/form/index.ts +++ b/pages/form/index.ts @@ -6,14 +6,30 @@ import { agora } from '../../utils/agora' Page({ data: { meetingForm: { - roomNum: '34351300', - roomName: '杨杨', + roomNum: '', + roomName: '', }, isRecord: false, isCamera: false, + historicalList: [], }, onShow() { onStop() + const that = this; + wx.getStorage({ + key: 'historicalList', + success(res: any) { + that.setData({ + historicalList: res.data + }) + that.setData({ + meetingForm: { + roomNum: res.data[res.data.length - 1].roomNum, + roomName: res.data[res.data.length - 1].nickName + }, + }) + }, + }) }, onLoad() { wx.authorize({ @@ -77,7 +93,7 @@ Page({ screenShareId: res.data.screenShareId, }) wx.navigateTo({ - url: `/pages/meeting/index?roomNum=${this.data.meetingForm.roomNum}` + url: `/pages/meeting/index?roomNum=${this.data.meetingForm.roomNum}&nickName=${this.data.meetingForm.roomName}` }) }) }) @@ -159,5 +175,15 @@ Page({ }) break; } + }, + setForm(e) { + const { item } = e.currentTarget.dataset; + this.setData({ + meetingForm: { + roomNum: item.roomNum, + roomName: item.nickName + }, + }) + this.joinMeeting() } }) \ No newline at end of file diff --git a/pages/form/index.wxml b/pages/form/index.wxml index 77430c7..fa6cf6e 100644 --- a/pages/form/index.wxml +++ b/pages/form/index.wxml @@ -1,6 +1,6 @@ - + @@ -11,5 +11,11 @@ + + 历史记录 + + + + \ No newline at end of file diff --git a/pages/meeting/index.scss b/pages/meeting/index.scss index 7e1acf2..d94f867 100644 --- a/pages/meeting/index.scss +++ b/pages/meeting/index.scss @@ -88,7 +88,7 @@ &-fullscreen { position: absolute; - right: 2%; + left: 2%; top: 2%; color: white; z-index: 2; diff --git a/pages/meeting/index.ts b/pages/meeting/index.ts index 71cc1d3..44fdad0 100644 --- a/pages/meeting/index.ts +++ b/pages/meeting/index.ts @@ -121,14 +121,41 @@ Page({ channelId: option.roomNum, user: await getStorage('user') }) - }, - async onReady() { await this.joinChannel() await this.getRoomUser() await this.getShowUser() this.startClientEvent() this.startSignalr() await this.getRoomInfo() + const that = this; + wx.getStorage({ + key: 'historicalList', + success(res: any) { + const list = [...res.data] + if (list.length >= 3) { + list.splice(0, 1) + } + list.push({ + nickName: option.nickName, + roomNum: option.roomNum, + roomName: that.data.roomInfo.roomName + }) + wx.setStorage({ + key: "historicalList", + data: list + }) + }, + fail() { + wx.setStorage({ + key: "historicalList", + data: [{ + nickName: option.nickName, + roomNum: option.roomNum, + roomName: that.data.roomInfo.roomName + }] + }) + } + }) }, startSignalr() { onSignalr(async (item) => { @@ -447,11 +474,7 @@ Page({ switch (title) { case '关闭听筒': case '开启听筒': - item.active = !item.active - this.setData({ - muted: !this.data.muted, - footerList: footerListTemplate - }) + break; case '解除静音': case '静音': diff --git a/pages/meeting/index.wxml b/pages/meeting/index.wxml index ece14ef..969fefc 100644 --- a/pages/meeting/index.wxml +++ b/pages/meeting/index.wxml @@ -1,6 +1,8 @@ - + + + @@ -14,10 +16,10 @@ - + - - + + @@ -36,8 +38,8 @@ - - + + @@ -75,7 +77,7 @@ - 聊天 + 成员 diff --git a/utils/singlr.ts b/utils/singlr.ts index 8e29a18..ebe6ef0 100644 --- a/utils/singlr.ts +++ b/utils/singlr.ts @@ -13,6 +13,10 @@ export const startSignalr = async (callBack: Function) => { }) .build(); connection.start().then(() => { + wx.setStorage({ + key: "reconnect", + data: true + }) callBack() }) connection.onclose(() => {