Commit 7ca74f13 authored by zhangkaixuan11's avatar zhangkaixuan11

提交下代码

parent 11238cf1
......@@ -300,7 +300,7 @@ export default class App extends Component {
/>
<Root.Screen
name="LiveIndex"
component={HomeIndex}
component={LiveIndex}
options={{ headerShown: false }}
/>
<Root.Screen
......
......@@ -143,7 +143,7 @@ public class WhiteboardAPI {
}
private void disableOperations(ReadableMap obj, com.facebook.react.bridge.Promise promise) {
Map map1 = obj.toHashMap();
room.disableOperations((Boolean) map1.get("readonly"));
room.disableCameraTransform((Boolean) map1.get("readonly"));
promise.resolve(map1.get("readonly"));
}
private void setToolType(ReadableMap obj, com.facebook.react.bridge.Promise promise) {
......
......@@ -356,6 +356,8 @@ let LiveCSS = StyleSheet.create({
chatBtnWrapper: {
backgroundColor: '#272727',
padding: Constants.unitWidth * 10,
paddingTop:0,
paddingBottom:0,
height: Constants.unitWidth * 40,
position: 'relative'
},
......
......@@ -7,4 +7,5 @@ import App from './App';
import {name as appName} from './app.json';
console.ignoredYellowBox = ['Warning: Each child','renamed'];
console.disableYellowBox = true;
// global.FormData = global.originalFormData ? global.originalFormData : global.FormData;
AppRegistry.registerComponent(appName, () => App);
......@@ -8,7 +8,7 @@
"start": "react-native start",
"test": "jest",
"lint": "eslint .",
"a-build":"react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/"
"a-build": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^1.13.4",
......@@ -20,7 +20,7 @@
"@react-navigation/native": "^5.9.2",
"@react-navigation/stack": "^5.14.2",
"@types/react-native": "^0.66.11",
"agora-react-native-rtm": "1.2.2-alpha.3",
"agora-react-native-rtm": "1.4.8",
"events": "^3.2.0",
"react": "16.13.1",
"react-native": "0.64.0",
......@@ -41,6 +41,7 @@
"react-native-keyboard-aware-scroll-view": "^0.9.3",
"react-native-keyboard-tracking-view": "^5.7.0",
"react-native-linear-gradient": "^2.5.6",
"react-native-lock-screen": "^1.0.2",
"react-native-modal": "^11.7.0",
"react-native-orientation": "^3.1.3",
"react-native-photo-editor": "^1.0.12",
......@@ -52,7 +53,9 @@
"react-native-slider": "^0.11.0",
"react-native-sound": "^0.11.0",
"react-native-splash-screen": "^3.2.0",
"react-native-svg": "^12.1.1",
"react-native-switch-pro": "^1.0.5",
"react-native-vector-icons": "^9.0.0",
"react-native-video": "^5.1.1",
"react-native-video-controls": "^2.8.1",
"react-native-view-shot": "^3.1.2",
......
......@@ -14,6 +14,8 @@ export default class RtmAdapter extends EventEmitter {
super();
this.uid = null;
this.client = new RtmEngine();
}
listenersAll(){
const events = [
'tokenExpired',
'remoteInvitationRefused',
......@@ -32,7 +34,7 @@ export default class RtmAdapter extends EventEmitter {
'channelMemberLeft',
'channelMemberJoined',
'remoteInvitationReceived',
'attributesUpdated'
// 'attributesUpdated'
];
events.forEach((event: string) => {
// @ts-ignore
......@@ -41,8 +43,11 @@ export default class RtmAdapter extends EventEmitter {
this.emit(event, evt);
});
});
this.client.addListener('ChannelAttributesUpdated', (evt: any) => {
console.log('ChannelAttributesUpdated', evt);
this.emit('attributesUpdated', evt);
});
}
async login(uid: string): Promise<any> {
await this.client.createClient(config.appId);
this.uid = uid;
......@@ -57,10 +62,12 @@ export default class RtmAdapter extends EventEmitter {
}
async loginWidthToken(uid: string, appId, token): Promise<any> {
if (!this.uid) {
this.listenersAll()
// if (!this.uid) {
await this.client.createClient(appId);
this.uid = uid;
}
// }
console.log('rtm login nidaye', appId, token, uid, this.uid);
......@@ -69,9 +76,17 @@ export default class RtmAdapter extends EventEmitter {
token: token,
});
}
async getChannelAttributes(cid: string){
let arr = await this.client.getChannelAttributes(cid)
if(arr && arr.length){
this.emit('attributesUpdated', arr);
}
console.log(arr,'arr')
}
async logout(): Promise<any> {
// await this.client.removeAllListeners();
await this.client.logout();
await this.client.destroyClient();
console.log('logout success 22');
}
......
......@@ -34,6 +34,7 @@ import CameraRoll from "@react-native-community/cameraroll";
import AddNote from '../../src/components/AddNote';
import Confirm from "../components/Confirm";
import Toast from '../components/Toast';
export default class Index extends Component {
constructor(props) {
......@@ -405,32 +406,34 @@ export default class Index extends Component {
});
}
golive =()=>{
if(this.state.classList && this.state.classList.length){
golive = () => {
if (this.state.classList && this.state.classList.length) {
let item = this.state.classList[0]
this.props.navigation.navigate('LiveIndex', {
liveRoomUid: item.liveRoomUid,
channelId: item.channelId,
netlessUuid: item.netlessUuid,
students: item.clazzStudentList,
teachers: item.clazzTeacherList,
courseName: item.courseScheduleName,
studentName: item.studentName,
classId: item.classId,
classScheduleId: item.classScheduleId,
startTime: item.startTime,
endTime: item.endTime,
lessonDate: item.lessonDate,
});
return
if (item.status === '20') {
this.props.navigation.navigate('LiveIndex', {
liveRoomUid: item.liveRoomUid,
channelId: item.channelId,
netlessUuid: item.netlessUuid,
students: item.clazzStudentList,
teachers: item.clazzTeacherList,
courseName: item.courseScheduleName,
studentName: item.studentName,
classId: item.classId,
classScheduleId: item.classScheduleId,
startTime: item.startTime,
endTime: item.endTime,
lessonDate: item.lessonDate,
});
}else{
} else {
this.setState({
showToast: true,
msg: '当前课程非可上课状态',
tipsIcon: require('../../images/common/info.png')
});
}
}else{
} else {
this.setState({
showToast: true,
msg: '此账户当前无课程',
......@@ -706,23 +709,26 @@ export default class Index extends Component {
render() {
return (
<View style={HomeStyle.warp}>
<Toast onHide={() => {
<Toast onHide={() => {
this.setState({
showToast: false
})
}} show={this.state.showToast} msg={this.state.msg} icon={this.state.tipsIcon}/>
}} show={this.state.showToast} msg={this.state.msg} icon={this.state.tipsIcon} />
<Image resizeMode='cover' source={require('../../images/common2201/homBag.png')} style={HomeStyle.containerImg} />
<View style={HomeStyle.container}>
<View style={HomeStyle.top}>
<View style={HomeStyle.topLeft}>
<View style={HomeStyle.topLeftIcon}>
{
this.state.userInfo &&
<Image resizeMode='cover' style={{ 'width': '100%', 'height': '100%', borderRadius: 50 }} source={{ uri: this.state.userInfo.headImgUrl }} />
}
{
!this.state.userInfo &&
<View style={{ 'width': '100%', 'height': '100%', backgroundColor: '#999', borderRadius: 50 }}></View>
this.state.userInfo && this.state.userInfo.headImgUrl ?
(
<Image resizeMode='cover' style={{ 'width': '100%', 'height': '100%', borderRadius: 50 }} source={{ uri: this.state.userInfo.headImgUrl }} />
) :
(
<View style={{ 'width': '100%', 'height': '100%', backgroundColor: '#999', borderRadius: 50 }}></View>
)
}
</View>
......@@ -803,6 +809,7 @@ export default class Index extends Component {
<View></View>
</View>
</View>
)
}
......
......@@ -12,13 +12,13 @@ let HomeCSS = Constants.StyleSheet.create({
},
containerImg: {
position: 'absolute',
left: 0,
left: -1,
right: 0,
top: 0,
bottom: 0,
height: null,
width: null,
zIndex: -1
zIndex: -100
},
container: {
"width": '100%',
......@@ -49,7 +49,7 @@ let HomeCSS = Constants.StyleSheet.create({
'height':Constants.unitWidth * 48,
},
topLeftName:{
'width':Constants.unitWidth * 140,
'minWidth':Constants.unitWidth * 140,
'height':Constants.unitWidth * 52,
"paddingLeft": Constants.unitWidth * 18,
"paddingRight": Constants.unitWidth * 18,
......
This diff is collapsed.
......@@ -208,7 +208,7 @@ class WhiteBoardEngine {
* 禁用启用所有手势
* @param {bool} readonly
*/
async disableOperations(readonly) {
async disableCameraTransform(readonly) {
return await TICBridgeManager.callMethod('disableOperations', { readonly });
}
}
......
......@@ -29,8 +29,10 @@ export default class MyWeb extends Component {
if (userInfo) {
console.log(userInfo)
userInfo = JSON.parse(userInfo);
// content: "{"id":null,"userName":"19000000005","nickName":null,"headImgUrl":null,"realName":"19000000005","mobile":"19000000005","email":null,"isAdmin":0,"memberType":"01","province":null,"city":null,"district":null,"lastLoginTime":"2022-01-17T09:16:52.000+0000","createTime":"2022-01-17T05:17:32.000+0000","updateTime":"2022-01-17T05:17:32.000+0000","token":"IPAD_CREDIT_TOKEN:639a964a3b4f4af2b8526f7e51deffb0","validTime":43200}"
this.setState({
uri: `http://121.36.221.250:8018/evaluation/teacher/#/?type=1&token=${'PC_CREDIT_TOKEN:e89f941968e5474fae00d3148d061d1b'}`,
uri: `http://121.36.221.250:8018/evaluation/teacher/#/?type=1&token=${userInfo.token}`,
})
console.log(this.state.uri)
}
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment