Commit b7b08af8 by 李伟康

Merge branch 'v3.2.0_1210' of http://192.168.3.233:8090/glsx/scrm-wx-merchant-ac…

…tivity into v3.2.0_1210
2 parents 54b2ec54 c1662c6b
...@@ -138,7 +138,7 @@ export default { ...@@ -138,7 +138,7 @@ export default {
// console.log('====', { result }); // console.log('====', { result });
this.player.ready(() => { // 设置播放器初始化完成后的回调 this.player.ready(() => { // 设置播放器初始化完成后的回调
this.fixHls() this.fixHls()
const src = this.LiveProps[this.liveDetail.status].isLive ? this.liveDetail.playPath : (this.liveDetail.liveBroadcastRecordingFileList || [])[0]?.videoUrl const src = this.LiveProps[this.liveDetail.status].isLive ? this.liveDetail.pullWebRtcUrl : (this.liveDetail.liveBroadcastRecordingFileList || [])[0]?.videoUrl
this.player.src(src) this.player.src(src)
this.player.poster() this.player.poster()
this.player.play() // 播放视频 this.player.play() // 播放视频
......
...@@ -90,9 +90,10 @@ export default { ...@@ -90,9 +90,10 @@ export default {
}, },
getUserSig() { getUserSig() {
const userInfo = util.getUserInfo() const userInfo = util.getUserInfo()
// userId = this.userInfo.openid || this.userInfo.uuid const userId = userInfo.openid || userInfo.uuid
const userId = userInfo.nickName || userInfo.userName // const userId = userInfo.nickName || userInfo.userName
shopmallApi.getLiveSig({ userId: userId }).then(res => { const params = this.getLocalStorage('wx_scrm_link_params') || {}
shopmallApi.getLiveSig({ userId: userId, sourceShopId: params.merchantId || '', visitSource: 'H5-众筹' }).then(res => {
this.userSig = res.userSig this.userSig = res.userSig
this.initTim() this.initTim()
}) })
...@@ -100,7 +101,7 @@ export default { ...@@ -100,7 +101,7 @@ export default {
initTim() { initTim() {
const userInfo = util.getUserInfo() const userInfo = util.getUserInfo()
const imOptions = { const imOptions = {
userID: userInfo.nickName || userInfo.userName, userID: userInfo.openid || userInfo.uuid,
userSig: this.userSig, userSig: this.userSig,
groupID: this.liveDetail.imGroupId, groupID: this.liveDetail.imGroupId,
SDKAppID: this.liveDetail.imSdkAppId, SDKAppID: this.liveDetail.imSdkAppId,
...@@ -110,6 +111,7 @@ export default { ...@@ -110,6 +111,7 @@ export default {
timObj = new IM(imOptions) timObj = new IM(imOptions)
timObj.join(imOptions).then(res => { timObj.join(imOptions).then(res => {
// console.log('login-------') // console.log('login-------')
timObj.updateMyProfile({ nick: userInfo.nickName })
}) })
}, },
// 收到消息触发 // 收到消息触发
...@@ -126,7 +128,7 @@ export default { ...@@ -126,7 +128,7 @@ export default {
// 群成员发送消息 // 群成员发送消息
// let eleData = JSON.parse() // let eleData = JSON.parse()
let eleData = { let eleData = {
userName: item.from, userName: item.nick,
content: item.payload.text content: item.payload.text
} }
// 获取群聊消息,消息上屏 // 获取群聊消息,消息上屏
......
...@@ -67,6 +67,19 @@ export default class IM { ...@@ -67,6 +67,19 @@ export default class IM {
.catch(reject) .catch(reject)
}) })
} }
/** 更新用户标配信息
* nick,avatar,gender,selfSignature,allowType
*/
updateMyProfile(obj) {
let promise = this.tim.updateMyProfile(obj)
promise
.then(function (imResponse) {
console.log(imResponse.data) // 更新资料成功
})
.catch(function (imError) {
console.warn('updateMyProfile error:', imError) // 更新资料失败的相关信息
})
}
/** /**
* 加入群聊 * 加入群聊
* @returns Promise * @returns Promise
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!