diff --git a/TUIKit/components/TUIChat/index.vue b/TUIKit/components/TUIChat/index.vue
index 69076cf..ac63c1f 100644
--- a/TUIKit/components/TUIChat/index.vue
+++ b/TUIKit/components/TUIChat/index.vue
@@ -84,6 +84,9 @@
diff --git a/TUIKit/components/TUIChat/message-input-toolbar/call-view/index.vue b/TUIKit/components/TUIChat/message-input-toolbar/call-view/index.vue
index f3a6dae..3379516 100644
--- a/TUIKit/components/TUIChat/message-input-toolbar/call-view/index.vue
+++ b/TUIKit/components/TUIChat/message-input-toolbar/call-view/index.vue
@@ -1,108 +1,98 @@
+
-
+
diff --git a/composables/useAuthUser.js b/composables/useAuthUser.js
index 12a492d..38f7cfb 100644
--- a/composables/useAuthUser.js
+++ b/composables/useAuthUser.js
@@ -10,10 +10,11 @@ export const useAuthUser = () => {
const tokenStore = useTokenStore()
// 响应式状态(state & getters)
- const { userInfo, tencentUserSig, fontSizeData, integralData } = storeToRefs(userStore)
+ const { imEngine, userInfo, tencentUserSig, fontSizeData, integralData } = storeToRefs(userStore)
const { token } = storeToRefs(tokenStore)
return {
+ imEngine,
integralData,
userInfo,
tencentUserSig,
diff --git a/pages.json b/pages.json
index 926a115..e259bfc 100644
--- a/pages.json
+++ b/pages.json
@@ -39,14 +39,14 @@
{
"path": "TUIKit/components/TUIChat/video-play",
"style": {
- "navigationBarTitleText": "腾讯云 IM",
+ "navigationBarTitleText": "",
"navigationBarBackgroundColor": "#EBF0F6"
}
},
{
"path": "TUIKit/components/TUIChat/web-view",
"style": {
- "navigationBarTitleText": "腾讯云 IM",
+ "navigationBarTitleText": "",
"navigationBarBackgroundColor": "#EBF0F6"
}
},
@@ -340,7 +340,7 @@
{
"path": "pages/shop-together/index",
"style": {
- "navigationBarTitleText": "拼团"
+ "navigationBarTitleText": "购买记录"
}
},
{
@@ -441,16 +441,20 @@
}
}
},
- {
- "path" : "pages/room/room",
- "style" :
- {
- "navigationBarTitleText": "Room",
- "enablePullDownRefresh": false,
- "navigationStyle":"custom",
- "gestureBack":"NO"
- }
- },
+ {
+ "path": "pages/room/room",
+ "style": {
+ "navigationBarTitleText": "拨打电话",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/room/incom",
+ "style": {
+ "navigationBarTitleText": "拨打视频",
+ "navigationStyle": "custom"
+ }
+ },
// #endif
// #ifdef H5
{
@@ -468,13 +472,6 @@
}
},
// #endif
- {
- "path": "pages/room/incom",
- "style": {
- "navigationBarTitleText": "来电",
- "navigationStyle": "custom"
- }
- },
{
"path": "pages/adduser/index",
"style": {
diff --git a/pages/audience/index.nvue b/pages/audience/index.nvue
index 1a2d498..df1f527 100644
--- a/pages/audience/index.nvue
+++ b/pages/audience/index.nvue
@@ -1,25 +1,43 @@
-
-
-
-
-
+
+
+
+
-
-
-
-
- {{ liveDurationText }}
-
+
+
+ {{ liveDurationText }}
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
+ .live-timer {
+ color: #fff;
+ font-size: 24rpx;
+ margin-left: 12rpx;
+ }
+
diff --git a/pages/discover/discover.vue b/pages/discover/discover.vue
index 938263c..ead6b02 100644
--- a/pages/discover/discover.vue
+++ b/pages/discover/discover.vue
@@ -11,7 +11,7 @@
{ name: '公司介绍', icon: 'company' },
{ name: '朋友圈', icon: 'circle' },
{ name: '线上商城', icon: 'mall' },
- { name: '我的拼团伙伴', icon: 'team' },
+ { name: '购买记录', icon: 'team' },
{ name: '项目入口', icon: 'project' },
{ name: '直播列表', icon: 'liveStream' }
]
diff --git a/pages/mall/confirm-order.vue b/pages/mall/confirm-order.vue
index 830654b..ccd9c2f 100644
--- a/pages/mall/confirm-order.vue
+++ b/pages/mall/confirm-order.vue
@@ -160,7 +160,10 @@
})
onLoad(async e => {
+ // groupId
groupId.value = e?.groupId || ''
+ console.log(e?.groupId, '===')
+ formData.startGroup = !!e?.groupId
await getData(e.productId)
})
@@ -267,6 +270,7 @@
diff --git a/pages/mall/detail.vue b/pages/mall/detail.vue
index 74101b4..00ea219 100644
--- a/pages/mall/detail.vue
+++ b/pages/mall/detail.vue
@@ -184,7 +184,7 @@
"
/>
-
+ -->
diff --git a/pages/my-index/withdraw.vue b/pages/my-index/withdraw.vue
index c553fae..80e2757 100644
--- a/pages/my-index/withdraw.vue
+++ b/pages/my-index/withdraw.vue
@@ -12,9 +12,11 @@
} from '@/api/my-index'
import { useUI } from '@/utils/use-ui'
import { useAuthUser } from '@/composables/useAuthUser'
+ import { useUserStore } from '../../stores/user'
const { showToast, showDialog } = useUI()
const { integralData } = useAuthUser()
+ const { getIntegral } = useUserStore()
const tixian = ref(null)
const popup = ref(null)
@@ -120,6 +122,7 @@
}
tixian.value.close()
await addUserWithdraw(data)
+ await getIntegral()
await showToast(`提现成功`, 'success')
navigateBack()
} catch (error) {
diff --git a/pages/room/incom.vue b/pages/room/incom.vue
index de92acb..deb0da0 100644
--- a/pages/room/incom.vue
+++ b/pages/room/incom.vue
@@ -1,353 +1,395 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
- {{callerName}}
- {{ localSession.mediaType === 0 ? '语音通话' : "视频通话" }}
- {{callStatus}}
-
+
+
+
+
+
+
+
+
+
+ {{ callerInfo?.nick || callerInfo?.userID }}
+
+
+ {{ callState === 'call' ? '呼叫中,等待对方接受邀请...' : '对话中...' }}
+
+ {{ mediaType === 'audio' ? "语音通话" : "视频通话" }}
+
-
-
-
-
-
-
- 拒绝
-
+
+
+
+
+
+
+ {{ callState === 'call' || callState == 'dialogue' ? "挂断" : "拒绝" }}
+
-
-
-
-
- 接听
-
-
-
+
+
+
+
+ 接听
+
+
+
-
\ No newline at end of file
+ .action-bar {
+ bottom: 40rpx !important;
+ }
+}
+
diff --git a/pages/room/room.nvue b/pages/room/room.nvue
index 7b79b4f..f010f5e 100644
--- a/pages/room/room.nvue
+++ b/pages/room/room.nvue
@@ -1,13 +1,20 @@
-
-
-
-
-
+
+
+
@@ -15,69 +22,69 @@
-
+
- {{isMicrophone?'关闭':'开启'}}麦克风
+ {{ isMicrophone ? '关闭' : '开启' }}麦克风
-
+
- {{curCamera?'关闭':'开启'}}摄像头
+ {{ curCamera ? '关闭' : '开启' }}摄像头
-
+
- {{isEnableSpeaker?'关闭':'开启'}}扬声器
+ {{ isEnableSpeaker ? '关闭' : '开启' }}扬声器
+
+
+
+
+ 翻转
+
-
-
-
-
-
-
- {{mediaTypeCur === 'video' ? '切换语音' : '切换视频'}}
-
-
+
挂断
-
-
-
-
-
- 翻转
-
-
@@ -400,7 +488,7 @@
flex-direction: column;
align-items: center;
gap: 8rpx;
- margin: 10rpx;
+ margin: 10rpx 20rpx;
}
.control-icon {
@@ -463,14 +551,13 @@
background: rgba(0, 0, 0, 0.5);
justify-content: center;
align-items: center;
-
}
.box-mark {
position: fixed;
left: 0;
top: 0;
- background: rgba(0, 0, 0, .5);
+ background: rgba(0, 0, 0, 0.5);
z-index: 9999;
justify-content: center;
align-items: center;
@@ -576,7 +663,6 @@
background: #ccc;
padding-left: 30upx;
padding-right: 30upx;
-
}
.beauty-tab {
@@ -590,7 +676,8 @@
padding-top: 40upx;
}
- .filte-view {}
+ .filte-view {
+ }
.tab-item {
width: 100upx;
@@ -605,5 +692,6 @@
background: yellow;
}
- .white-view {}
-
\ No newline at end of file
+ .white-view {
+ }
+
diff --git a/static/images/administrator.png b/static/images/administrator.png
new file mode 100644
index 0000000..273f91f
Binary files /dev/null and b/static/images/administrator.png differ
diff --git a/stores/user.js b/stores/user.js
index b07eb13..2d4296b 100644
--- a/stores/user.js
+++ b/stores/user.js
@@ -1,382 +1,326 @@
+import { defineStore } from 'pinia'
import {
- defineStore
-} from 'pinia'
-import {
- getToken,
- getUserInfoData,
- setUserInfoData,
- removeUserInfoData,
- getSig,
- setSig,
- removeSig,
- getFontSize,
- setFontSize,
- removeFontSize
+ getToken,
+ getUserInfoData,
+ setUserInfoData,
+ removeUserInfoData,
+ getSig,
+ setSig,
+ removeSig,
+ getFontSize,
+ setFontSize,
+ removeFontSize
} from '@/utils/storage'
// #ifdef APP-PLUS
-import {
- useLoginState
-} from '@/uni_modules/tuikit-atomic-x/state/LoginState'
-import * as CallLib from "@/uni_modules/RongCloud-CallWrapper/lib/index"
+import { useLoginState } from '@/uni_modules/tuikit-atomic-x/state/LoginState'
+import * as CallLib from '@/uni_modules/RongCloud-CallWrapper/lib/index'
import RCIMIWEngine from '@/uni_modules/RongCloud-IMWrapper-V2/js_sdk/RCIMEngine'
-import permision from "@/js_sdk/wa-permission/permission.js"
-import {
- reasonDeal,
- errorDeal,
- imCode
-} from '@/utils/code.js'
+import { reasonDeal, errorDeal, imCode } from '@/utils/code.js'
// #endif
// #ifdef H5
-import {
- useLoginState
-} from 'tuikit-atomicx-vue3'
+import { useLoginState } from 'tuikit-atomicx-vue3'
// #endif
-import {
- useTokenStore
-} from './token'
-import {
- getUserData,
- userLogout,
- updateUserData
-} from '@/api'
-import {
- ref
-} from 'vue'
-import {
- useUI
-} from '@/utils/use-ui'
-import {
- reLaunch
-} from '@/utils/router'
-import {
- getTencentUserSig
-} from '@/api'
-import {
- TUILogin
-} from '@tencentcloud/tui-core-lite'
-import {
- TUIChatEngine
-} from '@tencentcloud/chat-uikit-engine-lite'
-import {
- getUserIntegral
-} from '@/api/my-index'
-import {
- removeFriendList,
- removeGroupList
-} from '../utils/storage'
-import {
- getRongYunLoginInfo
-} from '../api'
+import { useTokenStore } from './token'
+import { getUserData, userLogout, updateUserData } from '@/api'
+import { ref } from 'vue'
+import { useUI } from '@/utils/use-ui'
+import { reLaunch } from '@/utils/router'
+import { getTencentUserSig } from '@/api'
+import { TUILogin } from '@tencentcloud/tui-core-lite'
+import { TUIChatEngine } from '@tencentcloud/chat-uikit-engine-lite'
+import { getUserIntegral } from '@/api/my-index'
+import { removeFriendList, removeGroupList } from '../utils/storage'
+import { getRongYunLoginInfo } from '../api'
export const useUserStore = defineStore('user', () => {
- const {
- clearToken
- } = useTokenStore()
- const {
- showDialog,
- showToast
- } = useUI()
+ const { clearToken } = useTokenStore()
+ const { showDialog, showToast } = useUI()
- const userInfo = ref(
- getUserInfoData() ? JSON?.parse(getUserInfoData()) : {}
- )
- /** 用户字体大小 */
- const fontSizeData = ref(getFontSize())
+ const userInfo = ref(
+ getUserInfoData() ? JSON?.parse(getUserInfoData()) : {}
+ )
+ /** 用户字体大小 */
+ const fontSizeData = ref(getFontSize())
- /** 腾讯 IM 存储数据 */
- const tencentUserSig = ref(getSig() ? JSON?.parse(getSig()) : {})
+ /** 腾讯 IM 存储数据 */
+ const tencentUserSig = ref(getSig() ? JSON?.parse(getSig()) : {})
- /** 用户积分数 */
- const integralData = ref(0)
- // 融云
- const imEngine = ref(null)
+ /** 用户积分数 */
+ const integralData = ref(0)
+ /** 融云 IM 引擎 */
+ const imEngine = ref(null)
- /**
- * 获取用户信息(可从缓存或接口)
- */
- const fetchUserInfo = async () => {
- // 尝试从本地缓存读取
- const cachedToken = getToken()
- const cachedUserInfo = getUserInfoData()
- const cachedSig = getSig()
+ /**
+ * 获取用户信息(可从缓存或接口)
+ */
+ const fetchUserInfo = async () => {
+ // 尝试从本地缓存读取
+ const cachedToken = getToken()
+ const cachedUserInfo = getUserInfoData()
+ const cachedSig = getSig()
- if (cachedToken && cachedUserInfo) {
- userInfo.value = JSON.parse(cachedUserInfo)
- tencentUserSig.value = JSON.parse(cachedSig)
- loginTencentIM()
- return
- }
- await getIntegral()
- const res = await getUserData()
- await setUserInfo(res.data)
- loginTencentIM()
- return
- }
+ if (cachedToken && cachedUserInfo) {
+ userInfo.value = JSON.parse(cachedUserInfo)
+ tencentUserSig.value = JSON.parse(cachedSig)
+ loginTencentIM()
+ return
+ }
+ await getIntegral()
+ const res = await getUserData()
+ await setUserInfo(res.data)
+ loginTencentIM()
+ return
+ }
- /**
- * 设置用户信息
- */
- const setUserInfo = async data => {
- const res = await getTencentUserSig()
- const ryData = await getRongYunLoginInfo()
- const IM_DATA = {
- ...res.data,
- ...ryData.data
- }
- tencentUserSig.value = IM_DATA
- userInfo.value = data
- setUserInfoData(data)
- setSig(IM_DATA)
- }
+ /**
+ * 设置用户信息
+ */
+ const setUserInfo = async data => {
+ const res = await getTencentUserSig()
+ const ryData = await getRongYunLoginInfo()
+ const IM_DATA = {
+ ...res.data,
+ ...ryData.data
+ }
+ tencentUserSig.value = IM_DATA
+ userInfo.value = data
+ setUserInfoData(data)
+ setSig(IM_DATA)
+ }
- /** 获取用户积分 */
- const getIntegral = async () => {
- const res = await getUserIntegral()
- integralData.value = res.data.availablePoints
- }
+ /** 获取用户积分 */
+ const getIntegral = async () => {
+ const res = await getUserIntegral()
+ integralData.value = res.data.availablePoints
+ }
- /**
- * 登录腾讯 IM
- */
- const loginTencentIM = async () => {
- await refreshUserInfo()
- await TUILogin.login({
- SDKAppID: tencentUserSig.value.sdkappID,
- userID: tencentUserSig.value.userId,
- userSig: tencentUserSig.value.userSig,
- framework: `vue3`
- })
+ /**
+ * 登录腾讯 IM
+ */
+ const loginTencentIM = async () => {
+ await refreshUserInfo()
+ await TUILogin.login({
+ SDKAppID: tencentUserSig.value.sdkappID,
+ userID: tencentUserSig.value.userId,
+ userSig: tencentUserSig.value.userSig,
+ framework: `vue3`
+ })
- await TUIChatEngine.login({
- SDKAppID: tencentUserSig.value.sdkappID,
- userID: tencentUserSig.value.userId,
- userSig: tencentUserSig.value.userSig,
- useUploadPlugin: true // 使用文件上传插件
- })
- // #ifdef H5
- await useLoginState().login({
- SDKAppID: tencentUserSig.value.sdkappID,
- userID: tencentUserSig.value.userId,
- userSig: tencentUserSig.value.userSig
- })
- // #endif
+ await TUIChatEngine.login({
+ SDKAppID: tencentUserSig.value.sdkappID,
+ userID: tencentUserSig.value.userId,
+ userSig: tencentUserSig.value.userSig,
+ useUploadPlugin: true // 使用文件上传插件
+ })
+ // #ifdef H5
+ await useLoginState().login({
+ SDKAppID: tencentUserSig.value.sdkappID,
+ userID: tencentUserSig.value.userId,
+ userSig: tencentUserSig.value.userSig
+ })
+ // #endif
- // #ifdef APP-PLUS
- await useLoginState().login({
- sdkAppID: tencentUserSig.value.sdkappID,
- userID: tencentUserSig.value.userId,
- userSig: tencentUserSig.value.userSig
- })
- console.log(tencentUserSig.value.appKey, '====')
- connectIM()
- // #endif
- }
-
- //连接融云IM
- async function connectIM() {
- const options = {
- naviServer: ''
- }
- if(!imEngine.value){
- imEngine.value = await RCIMIWEngine.create(tencentUserSig.value.appKey, options)
- }
- imEngine.value.setOnConnectedListener((res) => {
- if (res.code != 0) {
- uni.hideLoading();
- uni.showToast({
- title: 'OnCon:' + res.code,
- icon: 'error'
- })
- return
- }
- //连接成功
- CallLib.init({});
- onAllListeners()
- console.log('call.init')
- uni.hideLoading();
- console.log('登录成功')
- if (uni.getSystemInfoSync().platform === 'android') {
- permision.requestAndroidPermission('android.permission.CAMERA');
- permision.requestAndroidPermission('android.permission.RECORD_AUDIO');
- }
- });
- let code = await imEngine.value.connect(tencentUserSig.value.ryToken, 10)
- if (code != 0) {
- uni.hideLoading();
- uni.showToast({
- title: 'connect:' + code,
- icon: 'error'
- })
- }
- }
-
- function onAllListeners() {
- CallLib.onCallReceived(res => {
- console.log(res)
- console.log(
- 'Engine:OnCallReceived=>' + '监听通话呼入, 目标id=>',
- res.data.targetId
- )
- let session = res.data
- // //呼入
+ // #ifdef APP-PLUS
+ await useLoginState().login({
+ sdkAppID: tencentUserSig.value.sdkappID,
+ userID: tencentUserSig.value.userId,
+ userSig: tencentUserSig.value.userSig
+ })
+ console.log(tencentUserSig.value.appKey, '====')
+ await connectIM()
+ // #endif
+ // #ifdef APP-PLUS
+ // CallLib.init({})
+ CallLib.onCallReceived(res => {
+ console.log(
+ 'Engine:OnCallReceived=>' + '监听通话呼入, 目标id=>',
+ res.data
+ )
+ console.log('res: ',res.data);
+ if (res.data.targetId) {
+ // let url = res.data.mediaType == 0 ? "" : "/pages/room/room"
uni.setStorageSync('room-parameters', {
callType: 'in',
- mediaType: session.mediaType === 0 ? 'audio' : 'video',
- callId: res.data.callId,
- mine: res.data.mine.userId
+ mediaType: res.data.mediaType === 0 ? 'audio' : 'video'
});
- //跳转.nvue
- uni.navigateTo({
- url:'/pages/room/incom'
- });
- })
-
- CallLib.onCallConnected(res => {
- console.log(res)
- console.log(
- 'Engine:OnCallConnected=>' +
- '已建立通话通话接通时,通过回调 onCallConnected 通知当前 call 的详细信息',
- res
- )
- })
- CallLib.onRemoteUserInvited((res)=>{
- console.log("Engine:OnRemoteUserInvited=>"+"通话中的某一个参与者,邀请好友加入通话 ,远端Id为=>", res.data.userId);
- uni.$emit('OnCallConnected');
- })
-
- CallLib.onRemoteUserJoined(res => {
- console.log(
- 'Engine:OnRemoteUserJoined=>' +
- '主叫端拨出电话,被叫端收到请求后,加入通话,被叫端Id为=>',
- res.data.userId
- )
- uni.$emit('OnCallConnected');
- })
-
- CallLib.onCallDisconnected(res => {
- console.log(
- 'Engine:OnCallDisconnected=>' + '挂断成功, 挂断原因=>',
- res.data.reason
- )
- uni.$emit('OnCallDisconnected');
- uni.navigateBack()
- })
- }
-
- /**
- * 清除用户信息(退出登录)
- */
- const clearUserInfo = async () => {
- const show = await showDialog('提示', '确定要退出登录吗?')
- if (show) {
- await logout()
- }
- }
-
- /**
- * 退出登录(不带提示)
- */
- const logout = async () => {
- if (!userInfo.value) return
- try {
- userInfo.value = null
-
- await userLogout()
- await TUILogin.logout()
- await TUIChatEngine.logout()
- // #ifdef APP-PLUS
- removeFriendList()
- removeGroupList()
- removeAllListeners()
- await useLoginState().logout()
- // #endif
- // #ifdef H5
- await useLoginState().logout()
- // #endif
- clearAllUserInfo()
- await showToast('退出登录成功', 'success')
- reLaunch('/pages/login/login')
- } catch (error) {
- clearAllUserInfo()
- await showToast('退出登录成功', 'success')
- reLaunch('/pages/login/login')
- }
- }
+ uni.navigateTo("/pages/room/incom", {
+ type: res.data.extra,
+ callType: 'in',
+ mediaType: res.data.mediaType == 0 ? "audio" : "video",
+ userID: res.data.mine.userId // 对方的用户id
+ })
+ }
+ })
+
+ /** 挂断电话 */
+ CallLib.onCallDisconnected(res => {
+ console.log(
+ 'Engine:OnCallDisconnected=>' + '挂断成功, 挂断原因=>',
+ res.data.reason
+ )
+ uni.navigateBack()
+ })
+
+ CallLib.onError(res => {
+ console.log('通话过程中,发生异常,异常原因=>', res.data.reason)
+ uni.navigateBack()
+ })
+
- function removeAllListeners(){
- CallLib.unInit();
- //移除监听-接收到通话呼入
- CallLib.removeCallReceivedListener();
- // 移除监听-开始呼叫通话的回调
- CallLib.removeCallOutgoingListener();
- // 移除监听-通话已接通
- CallLib.removeCallReceivedListener();
- // 移除监听-通话已结束
- CallLib.removeCallDisconnectedListener();
- // 移除监听-对端用户正在振铃
- CallLib.removeRemoteUserRingingListener();
- // 移除监听-对端用户加入了通话
- CallLib.removeRemoteUserJoinedListener();
- // 移除监听-有用户被邀请加入通话
- CallLib.removeRemoteUserInvited();
- // 移除监听-对端用户挂断
- CallLib.removeRemoteUserLeftListener();
- // 移除监听-对端用户切换了媒体类型
- CallLib.removeRemoteUserMediaTypeChangedListener();
- // 移除监听-通话出现错误的回调
- CallLib.removeErrorListener();
+ // #endif
+ }
+
+ //连接融云IM
+ const connectIM = async () => {
+ const options = {
+ naviServer: ''
+ }
+ imEngine.value = await RCIMIWEngine.create(
+ tencentUserSig.value.appKey,
+ options
+ )
+ imEngine.value.setOnConnectedListener(res => {
+ if (res.code != 0) {
+ uni.hideLoading()
+ uni.showToast({
+ title: 'OnCon:' + res.code,
+ icon: 'error'
+ })
+ return
+ }
+ //连接成功
+ CallLib.init({})
+ console.log('call.init')
+ // this.libPage = true;
+ // this.loginUserId = res.userId;
+ uni.hideLoading()
+ console.log('登录成功')
+ })
+ const callback = {
+ onDatabaseOpened: res => {
+ console.log('数据库打开')
+ },
+ onConnected: res => {
+ console.log(res)
+ if (res.code === 0) {
+ // uni.showToast({
+ // title: '连接成功',
+ // icon: 'none'
+ // })
+ console.log('连接成功')
+ } else if (res.code === 34001) {
+ // uni.showToast({
+ // title: '连接已存在,不需要再连接',
+ // icon: 'none'
+ // })
+ console.log('连接已存在,不需要再连接')
+ }
- }
+ }
+ }
+ let code = await imEngine.value.connect(
+ tencentUserSig.value.ryToken,
+ 10,
+ callback
+ )
+ if (code != 0) {
+ uni.hideLoading()
+ uni.showToast({
+ title: 'connect:' + code,
+ icon: 'error'
+ })
+ }
+ }
- /** 清空所有用户缓存 */
- const clearAllUserInfo = async () => {
- userInfo.value = null
- tencentUserSig.value = null
- fontSizeData.value = 26
- clearToken()
- removeUserInfoData()
- removeSig()
- removeFontSize()
- }
+ /**
+ * 清除用户信息(退出登录)
+ */
+ const clearUserInfo = async () => {
+ const show = await showDialog('提示', '确定要退出登录吗?')
+ if (show) {
+ await logout()
+ }
+ }
- /** 刷新用户信息(如用户信息被修改) */
- const refreshUserInfo = async () => {
- const res = await getUserData()
- await getIntegral()
- await setUserInfoData(res.data)
- userInfo.value = res.data
- }
+ /**
+ * 退出登录(不带提示)
+ */
+ const logout = async () => {
+ if (!userInfo.value) return
+ try {
+ userInfo.value = null
- /**
- * 更新部分用户信息(例如昵称、头像)
- */
- const updateUserInfo = async partialData => {
- if (!userInfo.value) return
- await updateUserData(partialData)
- await refreshUserInfo()
- }
+ await userLogout()
+ await TUILogin.logout()
+ await TUIChatEngine.logout()
+ // #ifdef APP-PLUS
+ removeFriendList()
+ removeGroupList()
+ await useLoginState().logout()
+ // #endif
+ // #ifdef H5
+ await useLoginState().logout()
+ // #endif
+ clearAllUserInfo()
+ await showToast('退出登录成功', 'success')
+ reLaunch('/pages/login/login')
+ } catch (error) {
+ clearAllUserInfo()
+ await showToast('退出登录成功', 'success')
+ reLaunch('/pages/login/login')
+ }
+ }
- /** 更新字体大小 */
- const updateFontSize = async fontSize => {
- fontSizeData.value = fontSize
- setFontSize(fontSize)
- }
+ /** 清空所有用户缓存 */
+ const clearAllUserInfo = async () => {
+ userInfo.value = null
+ tencentUserSig.value = null
+ fontSizeData.value = 26
+ clearToken()
+ removeUserInfoData()
+ removeSig()
+ removeFontSize()
+ }
- return {
- userInfo,
- integralData,
- tencentUserSig,
- fontSizeData,
- getIntegral,
- clearAllUserInfo,
- updateFontSize,
- logout,
- refreshUserInfo,
- fetchUserInfo,
- loginTencentIM,
- setUserInfo,
- clearUserInfo,
- updateUserInfo
- }
-})
\ No newline at end of file
+ /** 刷新用户信息(如用户信息被修改) */
+ const refreshUserInfo = async () => {
+ const res = await getUserData()
+ await getIntegral()
+ await setUserInfoData(res.data)
+ userInfo.value = res.data
+ }
+
+ /**
+ * 更新部分用户信息(例如昵称、头像)
+ */
+ const updateUserInfo = async partialData => {
+ if (!userInfo.value) return
+ await updateUserData(partialData)
+ await refreshUserInfo()
+ }
+
+ /** 更新字体大小 */
+ const updateFontSize = async fontSize => {
+ fontSizeData.value = fontSize
+ setFontSize(fontSize)
+ }
+
+ return {
+ imEngine,
+ userInfo,
+ integralData,
+ tencentUserSig,
+ fontSizeData,
+ getIntegral,
+ clearAllUserInfo,
+ updateFontSize,
+ logout,
+ refreshUserInfo,
+ fetchUserInfo,
+ loginTencentIM,
+ setUserInfo,
+ clearUserInfo,
+ updateUserInfo
+ }
+})
diff --git a/uni_modules/tuikit-atomic-x/components/BarrageInput.vue b/uni_modules/tuikit-atomic-x/components/BarrageInput.vue
index 649848c..eca588f 100644
--- a/uni_modules/tuikit-atomic-x/components/BarrageInput.vue
+++ b/uni_modules/tuikit-atomic-x/components/BarrageInput.vue
@@ -33,6 +33,13 @@
},
fail: (code, msg) => {
console.error(`sendTextMessage failed, code: ${code}, msg: ${msg}`);
+ if (code == 10017) {
+ uni.showModal({
+ title: '提示',
+ content: '你被禁止发言',
+ showCancel: false
+ })
+ }
},
})
inputValue.value = ""
diff --git a/uni_modules/tuikit-atomic-x/components/LiveAudienceList/AudienceActionPanel.nvue b/uni_modules/tuikit-atomic-x/components/LiveAudienceList/AudienceActionPanel.nvue
index 5c9785a..09be220 100644
--- a/uni_modules/tuikit-atomic-x/components/LiveAudienceList/AudienceActionPanel.nvue
+++ b/uni_modules/tuikit-atomic-x/components/LiveAudienceList/AudienceActionPanel.nvue
@@ -1,313 +1,396 @@
-
-
-
-
-
+
-
-
-
-
-
-
-
- 踢出房间
-
-
-
-
-
-
+
+
+
\ No newline at end of file
+ .divider-line {
+ width: 268rpx;
+ height: 10rpx;
+ border-radius: 200rpx;
+ background-color: #ffffff;
+ position: absolute;
+ bottom: 16rpx;
+ }
+