|
@@ -5,7 +5,7 @@
|
|
|
:sdkAppID="sdkAppID" :secretKey="secretKey" :userId="userId" :roomId="roomId"
|
|
|
:isAuthor="isAuthor" :linkMic="linkMic"
|
|
|
:avatar="avatar" :subtitle="subtitle" :title="title"
|
|
|
- :showFav="true" :isFav="isLiveFav" @onLiveFav=""
|
|
|
+ :showFav="showFav" :isFav="isLiveFav" @onLiveFav="onLiveFav"
|
|
|
:btns="btns" @onBtnClick="onBtnClick"
|
|
|
:showIm="true" :imStatus="imStatus" :imMsgs="imMsgs" @onImSend="onImSend" />
|
|
|
<uni-popup ref="popup" animation type="bottom">
|
|
@@ -81,6 +81,12 @@
|
|
|
isLiveFav: false,
|
|
|
imStatus: '',
|
|
|
imMsgs: [],
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ showFav: true, // 是否展示收藏,app中不展示,小程序中 展示
|
|
|
+ // #endif
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ showFav: false,
|
|
|
+ // #endif
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
@@ -93,6 +99,7 @@
|
|
|
let info = uni.getSystemInfoSync();
|
|
|
this.windowWidth = info.windowWidth;
|
|
|
this.windowHeight = info.windowHeight;
|
|
|
+ console.log('宽高',this.windowWidth,this.windowHeight)
|
|
|
},
|
|
|
onReady() {
|
|
|
// this.isAuthor = false;
|
|
@@ -130,6 +137,16 @@
|
|
|
this.avatar = uni.getStorageSync("liveImgUrl");
|
|
|
this.title = uni.getStorageSync("liveName");
|
|
|
this.$nextTick(() => this.enterRoom());
|
|
|
+ // 查询是否关注
|
|
|
+ NET.request(API.isSubscribed + this.liveId, {}, 'GET').then(res => {
|
|
|
+ if(res.data==false){
|
|
|
+ this.isLiveFav=false
|
|
|
+ }else{
|
|
|
+ this.isLiveFav=true
|
|
|
+ }
|
|
|
+ }).catch(res => {
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
},
|
|
|
enterRoom() {
|
|
|
this.jhim = Jhim.getInstance(this.userId, this.sdkAppID, this.secretKey);
|
|
@@ -173,8 +190,14 @@
|
|
|
this.$refs.jhlive && this.$refs.jhlive.cleanImInput();
|
|
|
});
|
|
|
},
|
|
|
- onLiveFav(isFav) {
|
|
|
-
|
|
|
+ onLiveFav() {
|
|
|
+ let data = {liveId: this.liveId}
|
|
|
+ data.isDelete = this.isLiveFav ? 1 : 0
|
|
|
+ NET.request(API.subscribeLive, data, 'POST').then(res => {
|
|
|
+ this.isLiveFav = !this.isLiveFav
|
|
|
+ }).catch(res => {
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
},
|
|
|
exitRoom() {
|
|
|
this.jhimgroup.off(this.onImText);
|