|
@@ -16,6 +16,7 @@
|
|
|
<text class="top_left_box_text2" >{{num}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
<view class="top-right-box">
|
|
|
<view class="top-right-box-btn" v-if="isAuthor" @click="btnBeautify">
|
|
|
<text class="top-right-box-btn-text">美颜</text>
|
|
@@ -25,28 +26,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="bottom-left-box" v-if="!imReady">
|
|
|
- <view class="bottom-left-box-login"><text>登录中...</text></view>
|
|
|
- </view>
|
|
|
- <view class="bottom-left-box" v-if="imReady">
|
|
|
- <view class="bottom-left-box-messages" v-for="(item, index) in imMsgs" :key="index">
|
|
|
- <view class="bottom-left-box-message">
|
|
|
- <image :src="item.avatar" />
|
|
|
- <text>{{item.name}}:{{item.text}}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="bottom-left-box-input-box">
|
|
|
- <input
|
|
|
- class="bottom-left-box-input"
|
|
|
- placeholder="说点什么..." placeholder-style="color:#fff"
|
|
|
- v-model="imMsgInput"
|
|
|
- confirm-type="send" @confirm="btnImSend" />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
<view class="bottom-right-box">
|
|
|
- <view class="bottom-right-box-btn" @click="btnShop">
|
|
|
- <text class="bottom-right-box-btn-text">商品</text>
|
|
|
- </view>
|
|
|
<view class="bottom-right-box-btn" @click="btnLike">
|
|
|
<text class="bottom-right-box-btn-text">点赞</text>
|
|
|
</view>
|
|
@@ -62,12 +42,13 @@ import LibGenerateTestUserSig from "./lib-generate-test-usersig-es.min";
|
|
|
import liveView from './live-wechat';
|
|
|
//#endif
|
|
|
// #ifdef H5
|
|
|
-import liveView from './live-wechat';
|
|
|
+import liveView from './live-app';
|
|
|
//#endif
|
|
|
// #ifdef APP-PLUS
|
|
|
import liveView from './live-app';
|
|
|
//#endif
|
|
|
|
|
|
+const LOGTAG = '--JHLIVE--:';
|
|
|
const EXPIRETIME = 604800;
|
|
|
|
|
|
export default {
|
|
@@ -77,7 +58,6 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
userSig: '',
|
|
|
- imMsgInput: '',
|
|
|
beautifyLevel: false,
|
|
|
};
|
|
|
},
|
|
@@ -92,14 +72,11 @@ export default {
|
|
|
name: String,
|
|
|
avatar: String,
|
|
|
num: Number,
|
|
|
- likes: Number,
|
|
|
- imReady: Boolean,
|
|
|
- imMsgs: Array,
|
|
|
},
|
|
|
- mounted: function() {
|
|
|
+ onLoad() {
|
|
|
this.init();
|
|
|
},
|
|
|
- destroyed: function() {
|
|
|
+ onUnload() {
|
|
|
this.destroy();
|
|
|
},
|
|
|
methods: {
|
|
@@ -115,20 +92,21 @@ export default {
|
|
|
this.exitRoom()
|
|
|
},
|
|
|
enterRoom() {
|
|
|
+ console.log(LOGTAG+'enterRoom', this.isAuthor, this.linkMic, this.sdkAppID, this.secretKey, this.userId, this.roomId);
|
|
|
const generator = new LibGenerateTestUserSig(this.sdkAppID, this.secretKey, EXPIRETIME);
|
|
|
- this.userSig = generator.genTestUserSig(this.userId);
|
|
|
-
|
|
|
- setTimeout(()=>{
|
|
|
- this.$refs.liveView.enterRoom();
|
|
|
- }, 1000)
|
|
|
+ this.userSig = generator.genTestUserSig(String(this.userId));
|
|
|
+ this.$nextTick(() => this.$refs.liveView.enterRoom());
|
|
|
},
|
|
|
exitRoom() {
|
|
|
+ console.log(LOGTAG+'exitRoom');
|
|
|
this.$refs.liveView.exitRoom();
|
|
|
},
|
|
|
btnChangeCamera() {
|
|
|
+ console.log(LOGTAG+'btnChangeCamera');
|
|
|
this.$refs.liveView.switchCarema();
|
|
|
},
|
|
|
btnBeautify() {
|
|
|
+ console.log(LOGTAG+'btnBeautify', this.beautifyLevel);
|
|
|
// blv - 美颜级别取值范围0 - 9; 0表示关闭,1 - 9值越大
|
|
|
// wlv - 亮度级别取值范围0 - 9; 0表示关闭,1 - 9值越大
|
|
|
// beautyStyle 美颜风格.三种美颜风格:0 :光滑 1:自然 2:朦胧
|
|
@@ -138,16 +116,6 @@ export default {
|
|
|
this.beautifyLevel?9:0,
|
|
|
this.beautifyLevel?0:0,
|
|
|
);
|
|
|
- },
|
|
|
- btnImSend() {
|
|
|
- this.$emit('imSend', this.imMsgInput);
|
|
|
- this.imMsgInput = '';
|
|
|
- },
|
|
|
- btnLike() {
|
|
|
- this.$emit('like');
|
|
|
- },
|
|
|
- btnShop() {
|
|
|
- this.$emit('shop');
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -261,7 +229,7 @@ export default {
|
|
|
color: white;
|
|
|
margin-left: 5px;
|
|
|
}
|
|
|
-.bottom-right-box-btn-color {
|
|
|
+.bottom-right-box-btn-text {
|
|
|
color: white;
|
|
|
}
|
|
|
|