...
 
Commits (3)
......@@ -126,6 +126,10 @@ RCT_EXPORT_METHOD(
liveVC.liveType = [@"ppt" isEqualToString:liveType] ? PLVLiveViewControllerTypeCloudClass : PLVLiveViewControllerTypeLive;
liveVC.playAD = !liveing;
liveVC.channelMenuInfo = channelMenuInfo;
// // 抽奖功能必须固定唯一的 nickName 和 userId,如果忘了填写上次的中奖信息,有固定的 userId 还会再次弹出相关填写页面
// liveVC.nickName = @"iOS user"; // 设置登录聊天室的用户名
// liveVC.avatarUrl = @"https://"; // 设置自定义聊天室用户头像地址
[viewController presentViewController:liveVC animated:YES completion:nil];
resolve(@[@(PolyvCloudClassError_Success)]);
......@@ -140,6 +144,10 @@ RCT_EXPORT_METHOD(
PLVLiveViewController *liveVC = [PLVLiveViewController new];
liveVC.liveType = [@"ppt" isEqualToString:liveType] ? PLVLiveViewControllerTypeCloudClass : PLVLiveViewControllerTypeLive;
liveVC.playAD = !liveing;
// // 抽奖功能必须固定唯一的 nickName 和 userId,如果忘了填写上次的中奖信息,有固定的 userId 还会再次弹出相关填写页面
// liveVC.nickName = @"iOS user"; // 设置登录聊天室的用户名
// liveVC.avatarUrl = @"https://"; // 设置自定义聊天室用户头像地址
[viewController presentViewController:liveVC animated:YES completion:nil];
NSLog(@"频道菜单获取失败!%@",error);
......
......@@ -42,6 +42,7 @@ export default class PolyvLogin extends Component {
constructor(props) {
super(props);
this.state = {
pressed:false,
showTitleText: false,
loginInfo: {},
tabIndex: 0
......@@ -120,6 +121,12 @@ export default class PolyvLogin extends Component {
<View style={styles.center}>
<Text style={styles.text}
onPress={() => {
if (this.state.pressed == true) {
console.log("处理中,请稍后")
return
}
this.state.pressed = true
if (this.state.tabIndex == 1) {//回放
this.state.loginInfo = PolyvViewManager.refCollection['PlayBackLogin'].state.playbackInfo
} else {
......@@ -128,6 +135,7 @@ export default class PolyvLogin extends Component {
var loginInfo = this.state.loginInfo
if (!loginInfo) {
alert("input login info")
this.state.pressed = false
return
}
......@@ -136,6 +144,7 @@ export default class PolyvLogin extends Component {
PolyvCloudClassModule.liveLogin(findNodeHandle(this), loginInfo.userId,
loginInfo.channelId, loginInfo.appId, loginInfo.appScrect)
.then(ret => {
this.state.pressed = false
if (ret.code != 0) {
var str = "登录失败 errCode=" + ret.code + " errMsg=" + ret.message;
console.log(str);
......@@ -148,6 +157,7 @@ export default class PolyvLogin extends Component {
PolyvCloudClassModule.playbackLogin(findNodeHandle(this), loginInfo.userId,
loginInfo.channelId, loginInfo.vid, loginInfo.appId, loginInfo.appScrect)
.then(ret => {
this.state.pressed = false
if (ret.code != 0) {
var str = "登录失败 errCode=" + ret.code + " errMsg=" + ret.message;
console.log(str);
......@@ -159,6 +169,8 @@ export default class PolyvLogin extends Component {
}
} else {
this.state.pressed = false
}
}}>登录</Text>
</View>
......@@ -174,11 +186,11 @@ class LiveLogin extends Component {
super(props)
this.state = {
liveInfo: {
channelId: "225034",
appId: "f2qnckdai9",
appScrect: "415aec6f97fd4a71917a0ededc7d6751",
userId: "80bb012ea8",
},
channelId: PolyvUserConfig.User.inputChannelId,
appId: PolyvUserConfig.User.inputAppId,
appScrect: PolyvUserConfig.User.inputAppSecret,
userId: PolyvUserConfig.User.inputUserId,
},
}
PolyvViewManager.refCollection['LiveLogin'] = this
}
......@@ -240,12 +252,12 @@ class PlayBackLogin extends Component {
super(props)
this.state = {
playbackInfo: {
appId: "f2qnckdai9",
channelId: "225034",
appScrect: "415aec6f97fd4a71917a0ededc7d6751",
userId: "80bb012ea8",
vid: "80bb012ea89e07ba6e506831d95fc6f8_8",
}
appId: PolyvUserConfig.User.inputAppId,
channelId: PolyvUserConfig.User.inputChannelId,
appScrect: PolyvUserConfig.User.inputAppSecret,
userId: PolyvUserConfig.User.inputUserId,
vid: PolyvUserConfig.User.inputVid,
},
}
PolyvViewManager.refCollection['PlayBackLogin'] = this
}
......