Commit 6c2cefb8 authored by zhangkaixuan11's avatar zhangkaixuan11

提交下现有学生端代码

parent 7ed0a26f
......@@ -2,7 +2,7 @@ import Constants from './Constants';
export default {
getUserInfo: (params) => {
return {
host: Constants.apiPath + '/flplat/api/v1/app/user/userInfo',
host: Constants.apiPath + '/user/getStudentInfo',
params: params
};
},
......@@ -18,35 +18,35 @@ export default {
};
},
login: (params) => {
return {
host: Constants.apiPath + '/flplat/api/v1/app/user/captchaLogin',
return {
host: Constants.apiPath + '/portal/index/userStuLogin',
params: params
};
},
loginWithPassword: (params) => {
return {
host: Constants.apiPath + '/flplat/api/v1/app/user/login',
host: Constants.apiPath + '/portal/index/stuLogin',
params: params
}
},
getAgoraConfig: {
host: Constants.apiPath + '/flplat/api/v1/app/agora/config',
host: Constants.apiPath + '/clazz/agora/config',
params: {}
},
getCurrentLessons: {
host: Constants.apiPath + '/flplat/api/v1/app/studentLessonSchedules/current',
host: Constants.apiPath + '/clazz/student/schedule/current',
params: {
}
},
getRTCToken: (params) => {
return {
host: Constants.apiPath + '/flplat/api/v1/app/agora/RTCToken',
host: Constants.apiPath + '/clazz/agora/rtctoken',
params: params
}
},
getRTMToken: (params) => {
return {
host: Constants.apiPath + '/flplat/api/v1/app/agora/RTMToken',
host: Constants.apiPath + '/clazz/agora/rtmtoken',
params: params
}
},
......@@ -64,7 +64,7 @@ export default {
},
getNetlessToken: (params) => {
return {
host: Constants.apiPath + '/flplat/api/v1/app/agora/roomToken',
host: Constants.apiPath + '/clazz/agora/roomtoken',
params: params
}
},
......@@ -128,7 +128,7 @@ export default {
},
uploadFile: (params) => {
return {
host: Constants.apiPath + '/flplat/api/v1/app/files?folder=cloud',
host: Constants.apiPath + '/file/support/cloud/files?folder=' + params.folder ,
params: params
}
},
......@@ -155,4 +155,28 @@ export default {
host: Constants.apiPath + '/flplat/api/v1/app/studentLessonSchedules/reportStat',
params: {}
},
sendLessonActivityInOut:(params)=> {// 进出教室
return {
host: Constants.apiPath + '/clazz/record/sendLessonActivityInOut',
params: params
}
},
studentListHomework:(params)=> {// 作业列表
return {
host: Constants.apiPath + '/eval/student/listHomework',
params: params
}
},
submitMediaHomework:(params)=> {// 提交图文作业
return {
host: Constants.apiPath + '/eval/student/submitMediaHomework',
params: params
}
},
stuGetMediaHomeworkDetail:(id)=> {// 图文作业详情
return {
host: Constants.apiPath + '/eval/student/stuGetMediaHomeworkDetail/'+ id,
params: {}
}
},
}
......@@ -10,6 +10,9 @@ import SplashScreen from 'react-native-splash-screen';
import IdleTimerManager from 'react-native-idle-timer';
// 公共组件
import Constants from './Constants';
import {navigationRefCon} from './Constants';
console.log(navigationRefCon,'navigationRefCon')
import Api from './Api';
import Tabbar from './src/components/Tabbar';
import MainNavHeader from './src/components/MainNavHeader';
......@@ -32,6 +35,12 @@ import Reset from './src/components/Reset';
import HomeIndex from './src/home202201/Index';
import WebView from './src/webview/Index';
//作业
import woekList from './src/homework/woekList/index';
import doHomeworkWithImg from './src/homework/doHomeworkWithImg/index';
// 业务逻辑组件 [直播]
import LiveIndex from './src/live/Index';
import Check from './src/live/Check';
......@@ -279,9 +288,12 @@ export default class App extends Component {
return (
<SafeAreaProvider>
<StatusBar backgroundColor='rgba(0,0,0,0)' translucent={true} hidden={true}/>
<NavigationContainer theme={customTheme} ref={(navigationRef) => {
this.navigationRef = navigationRef;
}}>
<NavigationContainer theme={customTheme} ref={navigationRefCon
// (navigationRef) => {
// this.navigationRef = navigationRef;
// console.log(navigationRef,navigationRefCon,'navigationRefCon')
// }
}>
<Root.Navigator mode="modal" initialRouteName="Main">
{/* <Root.Screen
name="Main"
......@@ -313,6 +325,16 @@ export default class App extends Component {
component={WebView}
options={{ headerShown: true,title:'学习中心' }}
/>
<Root.Screen
name="woekList"
component={woekList}
options={{ headerShown: true,title:'作业/列表' }}
/>
<Root.Screen
name="doHomeworkWithImg"
component={doHomeworkWithImg}
options={{ headerShown: true,title:'写作业(图文)' }}
/>
</Root.Navigator>
</NavigationContainer>
</SafeAreaProvider>
......
import AsyncStorage from '@react-native-async-storage/async-storage';
import {Dimensions, StatusBar, Platform} from 'react-native';
import {
blobToFile,
dataURLtoBlob
} from "./src/netless/fileTypeChange.js"
const designWidth = 1024;
const screenWidth = Dimensions.get('window').height;
......@@ -17,10 +21,41 @@ const StyleSheet = {
return RnStyleSheet.create(styles);
},
};
import * as React from 'react';
export const navigationRefCon = React.createRef();
// debugger
// let _navigator;
// let setTopLevelNavigator = (navigatorRef)=> {
// _navigator = navigatorRef;
// }
let navigate = (name, params) => {
navigationRefCon.current?.navigate(name, params);
}
setTimeout(e=>{
console.log(navigationRefCon,'navigationRefCon')
},2000)
// add other navigation functions that you need and export them
console.log(screenWidth, screenHeight, unitWidth, 'unitWidth');
let fetchCom = async (url,obj)=>{
let res = await fetch(url,obj)
// console.log (res,'fetchCom')
// let body = res.json()
// if(body.respCode == 'E0004'){
// navigate('Login')
// }
// console.log (res,body,'fetchCom')
return res
}
export default {
// apiPath: 'http://121.36.221.250:3001/mock/11',
apiPath: 'http://education-tst.sinocanada.cn',
apiPath: 'https://gateway.chamning.com',
// apiPath: 'http://121.36.221.250:8060',
imgPath: '',
StyleSheet,
token: '',
......@@ -31,7 +66,7 @@ export default {
unitWidth: unitWidth,
statusBarHeight: getStatusBarHeight(),
safeAreaBottomHeight: isIphoneX() ? 34 : 0,
homeCates: [
{
title: '推荐',
......@@ -49,7 +84,8 @@ export default {
title: '专题',
},
],
navigate,
// setTopLevelNavigator,
storeData: async (key, value) => {
try {
return await AsyncStorage.setItem(key, value);
......@@ -90,11 +126,12 @@ export default {
});
url += '?' + params.join('&');
// console.log(url, request);
return fetch(url, {
return fetchCom(url, {
mode: 'cors',
credentials: 'include',
headers: {
token: this.token,
tenant:'szVdW4usayB486MYV8U'
},
});
},
......@@ -107,24 +144,26 @@ export default {
});
url += '?' + params.join('&');
// console.log(url, request);
return fetch(url, {
return fetchCom(url, {
mode: 'cors',
credentials: 'include',
method: 'GET',
headers: {
token: this.token,
tenant:'szVdW4usayB486MYV8U'
},
});
},
post: function (request) {
let url = request.host;
let data = request.params;
return fetch(url, {
return fetchCom(url, {
method: 'POST',
mode: 'cors',
credentials: 'include',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
tenant:'szVdW4usayB486MYV8U'
},
body: this.getParam(data),
});
......@@ -132,13 +171,15 @@ export default {
postJSON: function (request) {
let url = request.host;
let data = request.params;
return fetch(url, {
console.log(data)
return fetchCom(url, {
method: 'POST',
mode: 'cors',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
apptype: 'ipad',
tenant:'szVdW4usayB486MYV8U'
},
body: JSON.stringify(data),
});
......@@ -146,13 +187,14 @@ export default {
putJSON: function (request) {
let url = request.host;
let data = request.params;
return fetch(url, {
return fetchCom(url, {
method: 'PUT',
mode: 'cors',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
apptype: 'ipad',
tenant:'szVdW4usayB486MYV8U'
},
body: JSON.stringify(data),
});
......@@ -161,12 +203,13 @@ export default {
let url = request.host;
let data = request.params;
// console.log(url, this.token, data);
return fetch(url, {
return fetchCom(url, {
method: 'POST',
mode: 'cors',
credentials: 'include',
headers: {
token: this.token,
tenant:'szVdW4usayB486MYV8U'
},
body: this.getParam(data),
});
......@@ -174,13 +217,14 @@ export default {
postJSONWithToken: function (request) {
let url = request.host;
let data = request.params;
return fetch(url, {
return fetchCom(url, {
method: 'POST',
mode: 'cors',
credentials: 'include',
headers: {
token: this.token,
'Content-Type': 'application/json',
tenant:'szVdW4usayB486MYV8U'
},
body: JSON.stringify(data),
});
......@@ -189,13 +233,14 @@ export default {
let url = request.host;
let data = request.params;
console.log(url, this.token, data);
return fetch(url, {
return fetchCom(url, {
method: 'PUT',
mode: 'cors',
credentials: 'include',
headers: {
token: this.token,
'Content-Type': 'application/json',
tenant:'szVdW4usayB486MYV8U'
},
body: JSON.stringify(data),
});
......@@ -204,13 +249,14 @@ export default {
let url = request.host;
let data = request.params;
console.log(url, this.token, data, JSON.stringify(data));
return fetch(url, {
return fetchCom(url, {
method: 'PATCH',
mode: 'cors',
credentials: 'include',
headers: {
token: this.token,
'Content-Type': 'application/json',
tenant:'szVdW4usayB486MYV8U'
},
body: JSON.stringify(data),
});
......@@ -218,37 +264,77 @@ export default {
deleteJSONWithToken: function (request) {
let url = request.host;
let data = request.params;
return fetch(url, {
return fetchCom(url, {
method: 'delete',
mode: 'cors',
credentials: 'include',
headers: {
token: this.token,
'Content-Type': 'application/json',
tenant:'szVdW4usayB486MYV8U'
},
body: JSON.stringify(data),
});
},
uploadbase64File: function (request) {
let url = request.host;
// console.log(formData,file);
// return RNFetchBlob.fetchCom('POST',url, {
// token: this.token,
// 'Content-Type': 'multipart/form-data',
// tenant:'szVdW4usayB486MYV8U'
// },{name: 'file', filename: 'file.png',data: request.params.file}
// );
let formData = new FormData();
let blob = dataURLtoBlob( request.params.file)
let file = blobToFile(blob)
// let file = {
// uri: request.params.file,
// type: 'multipart/form-data',
// name: 'jpg',
// };
formData.append('file', file);
formData.append('folder', 'lesson');
// if (request.params.params) {
// formData.append('params', request.params.params);
// }
console.log(formData,file);
return fetchCom(url, {
method: 'POST',
mode: 'cors',
credentials: 'include',
headers: {
token: this.token,
// 'Content-Type': 'multipart/form-data',
tenant:'szVdW4usayB486MYV8U'
},
body: formData,
});
},
uploadFile: function (request) {
let url = request.host;
let formData = new FormData();
let file = {
uri: request.params.file,
type: 'multipart/form-data',
name: 'jpg',
name: request.params.name || 'jpg',
};
formData.append('files', file);
formData.append('file', file);
if (request.params.params) {
formData.append('params', request.params.params);
}
// console.log(formData);
return fetch(url, {
console.log(formData,file);
return fetchCom(url, {
method: 'POST',
mode: 'cors',
credentials: 'include',
headers: {
token: this.token,
'Content-Type': 'multipart/form-data',
tenant:'szVdW4usayB486MYV8U'
},
body: formData,
});
......
.tool{padding:10px;cursor:pointer}.active,.tool:not(.active):hover{background:#e6e9f0;border-radius:5px}.toolSettings{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;position:absolute;background:#fff;padding:10px 5px;border-radius:5px;right:65px;top:0;-webkit-box-shadow:0 10px 30px 8px rgba(0,0,0,.2);box-shadow:0 10px 30px 8px rgba(0,0,0,.2)}.toolSettings,.toolSettings .settingsActions{display:-webkit-box;display:-ms-flexbox;display:flex}.toolSettings .settingsActions .tool:not(:last-child){margin-right:5px}.toolSettings .settingsSlider{margin-top:10px;padding:5px!important}.toolSettings .settingsColorPicker{margin-top:10px}.colorPicker{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.colorPicker .color{width:30px;height:30px;margin:5px;border-radius:15px;-webkit-transition:opacity .2s;transition:opacity .2s;border:1px solid rgba(0,0,0,.1)}.colorPicker .color:not(.active):hover{cursor:pointer;border:1px solid rgba(0,0,0,.5)}.mainPanel{position:fixed;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;top:120px;right:15px;padding:6px;background:#fff;border-radius:5px;-webkit-box-shadow:0 10px 30px 8px rgba(0,0,0,.4);box-shadow:0 10px 30px 8px rgba(0,0,0,.4);z-index:99}.mainPanel .actionsPanel .tool:not(:last-child){margin-bottom:5px;text-align:center}.historyPanel{position:fixed;display:-webkit-box;display:-ms-flexbox;display:flex;z-index:99;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;top:370px;right:15px;padding:6px;background:#fff;border-radius:5px;-webkit-box-shadow:0 10px 30px 8px rgba(0,0,0,.4);box-shadow:0 10px 30px 8px rgba(0,0,0,.4)}body,html{width:100%;height:100%}body{margin:0;padding:0;height:100%}#wrapperBox{position:relative;height:100%;overflow:scroll;-webkit-overflow-scrolling:touch}#cover{left:0;right:0;z-index:-1}#cover,canvas{position:absolute;height:300vh}canvas{width:100%;background:#005141}.btn{position:fixed;width:80px;height:30px;bottom:10px;right:10px;z-index:999;background:#e6e9f0;border:none;line-height:30px;border-radius:5px}
\ No newline at end of file
.vue-slider-disabled{opacity:.5;cursor:not-allowed}.vue-slider-rail{background-color:#ccc;border-radius:15px}.vue-slider-process{background-color:#3498db;border-radius:15px}.vue-slider-mark{z-index:4}.vue-slider-mark:first-child .vue-slider-mark-step,.vue-slider-mark:last-child .vue-slider-mark-step{display:none}.vue-slider-mark-step{width:100%;height:100%;border-radius:50%;background-color:rgba(0,0,0,.16)}.vue-slider-mark-label{font-size:14px;white-space:nowrap}.vue-slider-dot-handle{cursor:pointer;width:100%;height:100%;border-radius:50%;background-color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:.5px .5px 2px 1px rgba(0,0,0,.32);box-shadow:.5px .5px 2px 1px rgba(0,0,0,.32)}.vue-slider-dot-handle-focus{-webkit-box-shadow:0 0 1px 2px rgba(52,152,219,.36);box-shadow:0 0 1px 2px rgba(52,152,219,.36)}.vue-slider-dot-handle-disabled{cursor:not-allowed;background-color:#ccc}.vue-slider-dot-tooltip-inner{font-size:14px;white-space:nowrap;padding:2px 5px;min-width:20px;text-align:center;color:#fff;border-radius:5px;border-color:#3498db;background-color:#3498db;-webkit-box-sizing:content-box;box-sizing:content-box}.vue-slider-dot-tooltip-inner:after{content:"";position:absolute}.vue-slider-dot-tooltip-inner-top:after{top:100%;border-color:transparent;border-style:solid;border-width:5px;border-top-color:inherit}.vue-slider-dot-tooltip-inner-bottom:after,.vue-slider-dot-tooltip-inner-top:after{left:50%;-webkit-transform:translate(-50%);transform:translate(-50%);height:0;width:0}.vue-slider-dot-tooltip-inner-bottom:after{bottom:100%;border-color:transparent;border-style:solid;border-width:5px;border-bottom-color:inherit}.vue-slider-dot-tooltip-inner-left:after{left:100%;border-color:transparent;border-style:solid;border-width:5px;border-left-color:inherit}.vue-slider-dot-tooltip-inner-left:after,.vue-slider-dot-tooltip-inner-right:after{top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);height:0;width:0}.vue-slider-dot-tooltip-inner-right:after{right:100%;border-color:transparent;border-style:solid;border-width:5px;border-right-color:inherit}.vue-slider-dot-tooltip-wrapper{opacity:0;-webkit-transition:all .3s;transition:all .3s}.vue-slider-dot-tooltip-wrapper-show{opacity:1}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>sd</title>
</head>
<body>
sdsdsdsd
</body>
</html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon.ico><title>Whiteboard</title><link href=css/app.6d43a2f3.css rel=preload as=style><link href=css/chunk-vendors.a7bbc042.css rel=preload as=style><link href=js/app.8fe45ebf.js rel=preload as=script><link href=js/chunk-vendors.9912874f.js rel=preload as=script><link href=css/chunk-vendors.a7bbc042.css rel=stylesheet><link href=css/app.6d43a2f3.css rel=stylesheet></head><body><noscript><strong>We're sorry but Whiteboard doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.9912874f.js></script><script src=js/app.8fe45ebf.js></script></body></html>
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
......@@ -189,12 +189,17 @@ android {
}
}
sourceSets {
main {
assets.srcDirs = ['src/main/assets', '../../Static.bundle']
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
// 数字请根据最新版自行添加
implementation 'com.github.netless-io:whiteboard-android:2.13.18'
implementation 'com.github.netless-io:whiteboard-android:2.15.6'
//noinspection GradleDynamicVersion
......@@ -232,5 +237,5 @@ task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
{
"version": 2,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.fenghua_student_client",
"variantName": "processReleaseResources",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-release.apk"
}
]
}
\ No newline at end of file
......@@ -5,6 +5,7 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
tools:replace="android:allowBackup"
android:name=".MainApplication"
......@@ -12,7 +13,8 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
......@@ -23,7 +25,14 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="fhstudents" android:host="fhstudents"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity android:name="com.ahmedadeltito.photoeditor.PhotoEditorActivity" />
......
.tool{padding:10px;cursor:pointer}.active,.tool:not(.active):hover{background:#e6e9f0;border-radius:5px}.toolSettings{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;position:absolute;background:#fff;padding:10px 5px;border-radius:5px;right:65px;top:0;-webkit-box-shadow:0 10px 30px 8px rgba(0,0,0,.2);box-shadow:0 10px 30px 8px rgba(0,0,0,.2)}.toolSettings,.toolSettings .settingsActions{display:-webkit-box;display:-ms-flexbox;display:flex}.toolSettings .settingsActions .tool:not(:last-child){margin-right:5px}.toolSettings .settingsSlider{margin-top:10px;padding:5px!important}.toolSettings .settingsColorPicker{margin-top:10px}.colorPicker{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.colorPicker .color{width:30px;height:30px;margin:5px;border-radius:15px;-webkit-transition:opacity .2s;transition:opacity .2s;border:1px solid rgba(0,0,0,.1)}.colorPicker .color:not(.active):hover{cursor:pointer;border:1px solid rgba(0,0,0,.5)}.mainPanel{position:fixed;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;top:120px;right:15px;padding:6px;background:#fff;border-radius:5px;-webkit-box-shadow:0 10px 30px 8px rgba(0,0,0,.4);box-shadow:0 10px 30px 8px rgba(0,0,0,.4);z-index:99}.mainPanel .actionsPanel .tool:not(:last-child){margin-bottom:5px;text-align:center}.historyPanel{position:fixed;display:-webkit-box;display:-ms-flexbox;display:flex;z-index:99;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;top:370px;right:15px;padding:6px;background:#fff;border-radius:5px;-webkit-box-shadow:0 10px 30px 8px rgba(0,0,0,.4);box-shadow:0 10px 30px 8px rgba(0,0,0,.4)}body,html{width:100%;height:100%}body{margin:0;padding:0;height:100%}#wrapperBox{position:relative;height:100%;overflow:scroll;-webkit-overflow-scrolling:touch}#cover{left:0;right:0;z-index:-1}#cover,canvas{position:absolute;height:300vh}canvas{width:100%;background:#005141}.btn{position:fixed;width:80px;height:30px;bottom:10px;right:10px;z-index:999;background:#e6e9f0;border:none;line-height:30px;border-radius:5px}
\ No newline at end of file
.vue-slider-disabled{opacity:.5;cursor:not-allowed}.vue-slider-rail{background-color:#ccc;border-radius:15px}.vue-slider-process{background-color:#3498db;border-radius:15px}.vue-slider-mark{z-index:4}.vue-slider-mark:first-child .vue-slider-mark-step,.vue-slider-mark:last-child .vue-slider-mark-step{display:none}.vue-slider-mark-step{width:100%;height:100%;border-radius:50%;background-color:rgba(0,0,0,.16)}.vue-slider-mark-label{font-size:14px;white-space:nowrap}.vue-slider-dot-handle{cursor:pointer;width:100%;height:100%;border-radius:50%;background-color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:.5px .5px 2px 1px rgba(0,0,0,.32);box-shadow:.5px .5px 2px 1px rgba(0,0,0,.32)}.vue-slider-dot-handle-focus{-webkit-box-shadow:0 0 1px 2px rgba(52,152,219,.36);box-shadow:0 0 1px 2px rgba(52,152,219,.36)}.vue-slider-dot-handle-disabled{cursor:not-allowed;background-color:#ccc}.vue-slider-dot-tooltip-inner{font-size:14px;white-space:nowrap;padding:2px 5px;min-width:20px;text-align:center;color:#fff;border-radius:5px;border-color:#3498db;background-color:#3498db;-webkit-box-sizing:content-box;box-sizing:content-box}.vue-slider-dot-tooltip-inner:after{content:"";position:absolute}.vue-slider-dot-tooltip-inner-top:after{top:100%;border-color:transparent;border-style:solid;border-width:5px;border-top-color:inherit}.vue-slider-dot-tooltip-inner-bottom:after,.vue-slider-dot-tooltip-inner-top:after{left:50%;-webkit-transform:translate(-50%);transform:translate(-50%);height:0;width:0}.vue-slider-dot-tooltip-inner-bottom:after{bottom:100%;border-color:transparent;border-style:solid;border-width:5px;border-bottom-color:inherit}.vue-slider-dot-tooltip-inner-left:after{left:100%;border-color:transparent;border-style:solid;border-width:5px;border-left-color:inherit}.vue-slider-dot-tooltip-inner-left:after,.vue-slider-dot-tooltip-inner-right:after{top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);height:0;width:0}.vue-slider-dot-tooltip-inner-right:after{right:100%;border-color:transparent;border-style:solid;border-width:5px;border-right-color:inherit}.vue-slider-dot-tooltip-wrapper{opacity:0;-webkit-transition:all .3s;transition:all .3s}.vue-slider-dot-tooltip-wrapper-show{opacity:1}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>sd</title>
</head>
<body>
sdsdsdsd
</body>
</html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon.ico><title>Whiteboard</title><link href=css/app.6d43a2f3.css rel=preload as=style><link href=css/chunk-vendors.a7bbc042.css rel=preload as=style><link href=js/app.8fe45ebf.js rel=preload as=script><link href=js/chunk-vendors.9912874f.js rel=preload as=script><link href=css/chunk-vendors.a7bbc042.css rel=stylesheet><link href=css/app.6d43a2f3.css rel=stylesheet></head><body><noscript><strong>We're sorry but Whiteboard doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.9912874f.js></script><script src=js/app.8fe45ebf.js></script></body></html>
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -46,8 +46,9 @@ public class WhiteboardUI extends SimpleViewManager<View> {
LinearLayout ll_Layout = (LinearLayout) LayoutInflater.from(reactContext).inflate(R.layout.activity_main, null);
whiteboardView = ll_Layout.findViewById(R.id.white);
// int mycolor = getResources().getColor(R.color.mycolor);
// whiteboardView.setBackgroundColor(2d3036");
whiteboardView.setBackgroundColor(Color.argb(0xff, 0x2d, 0x30, 0x36));
// whiteboardView.setBackgroundColor(2d3036"); 0E5C4A
// whiteboardView.setBackgroundColor(Color.argb(0xff, 0x2d, 0x30, 0x36));
whiteboardView.setBackgroundColor(Color.argb(0xff, 0x0E, 0x5C, 0x4A));
// 初始化
WhiteboardAPI.getInstance().initContext(whiteboardView);
......
......@@ -63,6 +63,7 @@ public class WhiteboardAPI {
*/
public void initSdk(String appIdentifier, Context context) {
WhiteSdkConfiguration sdkConfiguration = new WhiteSdkConfiguration(appIdentifier, true);
sdkConfiguration.setRenderEngine(WhiteSdkConfiguration.RenderEngineType.valueOf("svg"));
whiteSdk = new WhiteSdk(whiteboardView, context, sdkConfiguration,
new CommonCallbacks() {
@Override
......@@ -109,15 +110,19 @@ public class WhiteboardAPI {
*/
public void joinRoom(String uuid,
String roomToken,com.facebook.react.bridge.Promise promises) {
whiteSdk.joinRoom(new RoomParams(uuid,roomToken), new AbstractRoomCallbacks() {
@Override
public void onPhaseChanged(RoomPhase phase) {
}
@Override
public void onRoomStateChanged(RoomState modifyState) {
}
}, new Promise<Room>() {
RoomParams roomConfig = new RoomParams(uuid, roomToken, uuid);
// roomConfig.setDisableNewPencil(false);
whiteSdk.joinRoom(roomConfig,
// new AbstractRoomCallbacks() {
// @Override
// public void onPhaseChanged(RoomPhase phase) {
// }
//
// @Override
// public void onRoomStateChanged(RoomState modifyState) {
// }
// },
new Promise<Room>() {
@Override
public void then(Room wRoom) {
Log.i("ROOM_JOIN_SUCCESS", "白板加入成功");
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
\ No newline at end of file
......@@ -11,7 +11,7 @@ let ComponentCSS = StyleSheet.create({
top: Constants.statusBarHeight + Constants.unitWidth * 128,
width: Constants.unitWidth * 312,
height: Constants.unitWidth * 200,
backgroundColor: '#252627'
backgroundColor: '#008A6A'
},
alarmSeperator: {
width: Constants.unitWidth * 312,
......@@ -150,7 +150,7 @@ let ComponentCSS = StyleSheet.create({
},
randBg: {
width: Constants.unitWidth * 252,
height: Constants.unitWidth * 96,
height: Constants.unitWidth * 156,
marginTop: Constants.unitWidth * 25,
overflow: 'hidden'
},
......
......@@ -219,7 +219,7 @@ let LiveCSS = StyleSheet.create({
},
headerRow: {
height: Constants.unitWidth * 40,
backgroundColor: '#2E2E35',
backgroundColor: '#0E5C4A',
flexDirection: 'row',
alignItems: 'center',
},
......@@ -281,7 +281,7 @@ let LiveCSS = StyleSheet.create({
flexDirection: 'row'
},
wbWrapper: {
backgroundColor: '#2d3036',
backgroundColor: '#0E5C4A',
// background:'black',
width: Constants.height,
height: Constants.width - Constants.statusBarHeight - Constants.unitWidth * 40,
......@@ -415,7 +415,7 @@ let LiveCSS = StyleSheet.create({
top: Constants.unitWidth * 8,
},
toolbar: {
backgroundColor: '#21232A',
backgroundColor: '#0E5C4A',
flex: 1,
flexDirection: 'row',
alignItems: 'center',
......
import { constants } from 'buffer';
import {
StyleSheet, Dimensions
} from 'react-native';
import Constants from '../Constants';
let homeWork = StyleSheet.create({
pageTitle: {
width: '100%', height: Constants.unitWidth * 50, overflow: 'hidden', backgroundColor: '#fff',
display: 'flex',
justifyContent: 'space-between',
flexDirection: 'row',
alignItems: 'center',
fontSize: 16 * Constants.unitWidth,
color: '#333',
paddingLeft: Constants.unitWidth * 35,
paddingRight: Constants.unitWidth * 35
},
displayRow: {
display: 'flex',
justifyContent: 'space-between',
flexDirection: 'row',
alignItems: 'center',
},
itemWorp: {
paddingLeft: Constants.unitWidth * 18,
paddingRight: Constants.unitWidth * 18,
paddingTop: Constants.unitWidth * 10,
backgroundColor: '#F5F6F9',
paddingBottom:Constants.unitWidth * 108,
},
taskList: {
backgroundColor: '#ffffff',
height: Constants.unitWidth * 230,
width: '100%',
paddingLeft: Constants.unitWidth * 26,
position: 'relative',
marginBottom: Constants.unitWidth * 12,
},
taskListBtn: {
position: 'absolute',
right: Constants.unitWidth * 30,
bottom: Constants.unitWidth * 24,
},
downTime: {
height: Constants.unitWidth * 40,
backgroundColor: '#fff',
borderWidth: 1,
borderColor: '#EEEEEE',
},
taskMainWarp: {
paddingLeft: Constants.unitWidth * 16,
paddingRight: Constants.unitWidth * 16,
paddingTop: Constants.unitWidth * 14,
},
taskMain: {
height: (Constants.width - 130),
backgroundColor: '#fff',
display: 'flex',
justifyContent: 'flex-start',
alignItems: 'flex-start',
paddingLeft: Constants.unitWidth * 22,
paddingRight: Constants.unitWidth * 22,
paddingTop: Constants.unitWidth * 24,
},
taskmain: {
height: (Constants.width - 210),
backgroundColor: '#eee',
width: '100%',
},
taskEleWarp: {
width: Constants.unitWidth * 240,
height: Constants.unitWidth * 48,
backgroundColor: '#fff',
shadowColor: "rgba(203, 199, 199, 0.5))",
shadowOffset: {
width: 10,
height: Constants.unitWidth * 10,
},
// shadowOpacity: 0.25,
shadowRadius: Constants.unitWidth * 4,
position:'relative',
},
taskImgWarp:{
width: Constants.unitWidth * 120,
height: Constants.unitWidth * 120,
backgroundColor: '#FFE2AF',
shadowColor: "rgba(203, 199, 199, 0.5))",
shadowOffset: {
width: 10,
height: Constants.unitWidth * 10,
},
// shadowOpacity: 0.25,
shadowRadius: Constants.unitWidth * 4,
position:'relative',
},
taskEleWarpDel:{
position:'absolute',
height: Constants.unitWidth * 24,
width: Constants.unitWidth * 24,
right:Constants.unitWidth * -8,
top:Constants.unitWidth * -8,
zIndex:2,
backgroundColor:'#D8D8D8',
borderRadius:Constants.unitWidth * 12,
},
LookMoreStyle: {
// height: 32,
textAlign: 'center',
fontSize: Constants.unitWidth * 12,
paddingTop: 20,
paddingBottom: 20,
},
});
module.exports = homeWork;
/**
* @format
*/
global.Buffer = require('buffer').Buffer;
if (typeof atob === 'undefined') {
global.atob = function (b64Encoded) {
return new Buffer(b64Encoded, 'base64').toString('binary');
};
}
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
......
This diff is collapsed.
......@@ -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 --entry-file index.js --bundle-output ./android/app/src/main/assets/index.android.bundle --platform android --assets-dest ./android/app/src/main/res/ --dev false"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^1.13.4",
......@@ -20,17 +20,22 @@
"@react-navigation/native": "^5.9.2",
"@react-navigation/stack": "^5.14.2",
"@types/react-native": "^0.66.11",
"agora-react-native-rtm": "1.4.8",
"agora-react-native-rtm": "^1.4.8",
"buffer": "^6.0.3",
"events": "^3.2.0",
"js-md5": "^0.7.3",
"react": "16.13.1",
"react-native": "0.64.0",
"react-native-agora": "^3.5.1",
"react-native-anchor-point": "^1.0.3",
"react-native-audio": "^4.3.0",
"react-native-awesome-alerts": "^1.5.1",
"react-native-button": "^3.0.1",
"react-native-calendars": "^1.1248.0",
"react-native-document-picker": "^8.1.0",
"react-native-draggable": "^3.3.0",
"react-native-fast-image": "^8.3.4",
"react-native-fetch-blob": "^0.10.8",
"react-native-fs": "^2.16.6",
"react-native-gesture-handler": "^1.10.1",
"react-native-idle-timer": "^2.1.6",
......@@ -46,7 +51,7 @@
"react-native-orientation": "^3.1.3",
"react-native-photo-editor": "^1.0.12",
"react-native-picker": "^4.3.7",
"react-native-progress": "^4.1.2",
"react-native-progress": "^5.0.0",
"react-native-reanimated": "^1.13.2",
"react-native-safe-area-context": "^3.1.9",
"react-native-screens": "^2.17.1",
......
......@@ -150,7 +150,7 @@ export default class Alarm extends Component {
sec22: sec2,
showSec22: false
})
}, 500);
}, 800);
}
if (sec1 !== this.state.sec12) {
this.setState({
......@@ -172,7 +172,7 @@ export default class Alarm extends Component {
sec12: sec1,
showSec12: false
})
}, 500);
}, 800);
}
if (min2 !== this.state.min22) {
......@@ -195,7 +195,7 @@ export default class Alarm extends Component {
min22: min2,
showMin22: false
})
}, 500);
}, 800);
}
if (min1 !== this.state.min12) {
......@@ -218,7 +218,7 @@ export default class Alarm extends Component {
min12: min1,
showMin12: false
})
}, 500);
}, 800);
}
// Animated.parallel(actions);
}
......
import React, {Component} from 'react';
import {Text, View, Animated, Image, Modal, Keyboard, StatusBar, TextInput, TouchableHighlight,TouchableOpacity, findNodeHandle, DeviceEventEmitter} from 'react-native';
import {Linking,AppState,
NativeModules,Text, View, Animated, Image, Modal, Keyboard, StatusBar, TextInput, TouchableHighlight,TouchableOpacity, findNodeHandle, DeviceEventEmitter} from 'react-native';
import Constants from '../../Constants';
// import LinearGradient from 'react-native-linear-gradient';
import Button from 'react-native-button';
......@@ -9,6 +10,7 @@ import Api from '../../Api';
import Toast from './Toast';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import Reset from './Reset';
import md5 from 'js-md5'
export default class Login extends Component {
......@@ -16,7 +18,7 @@ export default class Login extends Component {
super(props);
this.state = {
show: props.show || false,
// mobile: '18502198580',
// mobile: '18502198580 19800001001 96e79218965eb72c92a549dd5a330112',
mobile: '',
code: '',
// password: 'fenglue123',
......@@ -36,6 +38,25 @@ export default class Login extends Component {
};
}
componentDidMount = () => {
// alert(1)
// AppState.addEventListener('change',(appState)=>{
// alert(appState)
// if(appState=='active'){
// Linking.getInitialURL().then(url=>{
// NativeModules.LinkingCustom.resetURL().then(()=>{
// alert('stateChange'+url)
// });
// })
// }
// })
// Linking.getInitialURL().then(url=>{
// alert(3)
// NativeModules.LinkingCustom.resetURL().then(()=>{
// alert('didmount'+url)
// });
// })
Constants.readData('rememberPwd').then((data) => {
console.log(1111)
if (data !== null) {
......@@ -65,7 +86,8 @@ export default class Login extends Component {
canSubmmit = true;
}
} else {
if (/^\d{11}$/.test(mobile) && password.length > 0) {
// if (/^\d{11}$/.test(mobile) && password.length > 0) {
if ( mobile.length > 0 && password.length > 0) {
canSubmmit = true;
}
}
......@@ -152,22 +174,24 @@ export default class Login extends Component {
loginWithPassword = () => {
if (this.state.canSubmit) {
if (this.state.rememberPwd) {
Constants.storeData('loginInfo', JSON.stringify({
mobile: this.state.mobile,
password: this.state.password
}));
} else {
Constants.storeData('loginInfo', JSON.stringify({
mobile: '',
password: ''
}));
}
// alert(1)
// if (this.state.rememberPwd) {
// Constants.storeData('loginInfo', JSON.stringify({
// mobile: this.state.mobile,
// password: this.state.password
// }));
// } else {
// Constants.storeData('loginInfo', JSON.stringify({
// mobile: '',
// password: ''
// }));
// }
Constants.postJSON(Api.loginWithPassword({
username: this.state.mobile,
password: this.state.password,
userName: this.state.mobile,
password: md5(this.state.password),
roleName: 'student'
})).then((response) => {
console.log(response)
return response.json()
})
.then(data => {
......@@ -199,6 +223,8 @@ export default class Login extends Component {
console.log('login', data);
})
.catch(error => {
// alert(2)
console.log('error', error)
});
}
......@@ -263,7 +289,7 @@ export default class Login extends Component {
<View style={LoginCSS.wrapper}>
<Image style={LoginCSS.logo} source={require('../../images/common/logo.png')}/>
<View style={LoginCSS.tabWrapper}>
<Button onPress={() => {
{/* <Button onPress={() => {
this.setState({
loginType: 'password'
})
......@@ -290,15 +316,18 @@ export default class Login extends Component {
backgroundColor: this.state.loginType === 'code' ? '#F9AE2B' : '#ffffff'
}]}></View>
</View>
</Button>
</Button> */}
</View>
<View style={[LoginCSS.mobileWrapper, {
borderWidth: this.state.mobileFocus ? Constants.unitWidth * 1 : 0,
}]}>
<View style={[LoginCSS.areaNoWrapper, PublicCSS.centerAll]}>
<Text allowFontScaling={false} style={LoginCSS.areaNo}>+86</Text>
<View style={[LoginCSS.areaNoWrapper, PublicCSS.centerAll, {
width: Constants.unitWidth * 74
}]}>
{/* <Text allowFontScaling={false} style={LoginCSS.areaNo}>+86</Text> */}
<Text allowFontScaling={false} style={LoginCSS.areaNo}>学号</Text>
</View>
<Image source={require('../../images/common/jiantouba.png')} style={LoginCSS.jiantou}/>
{/* <Image source={require('../../images/common/jiantouba.png')} style={LoginCSS.jiantou}/> */}
<TextInput maxLength={11} allowFontScaling={false} keyboardType="phone-pad"
placeholderTextColor="#919191" placeholder="请输入手机号"
style={LoginCSS.mobile} onChangeText={(text) => {
......
This diff is collapsed.
This diff is collapsed.
......@@ -118,7 +118,7 @@ export default class Rush extends Component {
size={Constants.unitWidth * 114}
>
</Progress.Circle>}
{(this.state.rushing === 3 && !this.state.answerStu.hasOwnProperty('id')) && <Text style={{
{(this.state.rushing === 3 && !this.state.answerStu.hasOwnProperty('uid')) && <Text style={{
fontFamily: 'PingFang SC',
fontSize: Constants.baseFontSize * 1.333,
color: '#ffffff',
......@@ -127,7 +127,7 @@ export default class Rush extends Component {
}} allowFontScaling={false}>
无人抢答
</Text>}
{(this.state.rushing === 3 && this.state.answerStu.hasOwnProperty('id')) && <View style={{
{(this.state.rushing === 3 && this.state.answerStu.hasOwnProperty('uid')) && <View style={{
// backgroundColor: '#eee000',
width: '100%',
alignItems: 'center'
......
......@@ -22,7 +22,7 @@ export default class Toast extends Component {
show: false
});
this.props.onHide();
}, 1200 * 1)
}, 2000 * 1)
}
}
......@@ -53,7 +53,7 @@ export default class Toast extends Component {
top: 0,
zIndex: 5000,
backgroundColor: 'rgba(0, 0, 0, 0.2)',
display: this.props.show ? 'flex' : 'none'
// display: this.props.show ? 'flex' : 'none'
}}>
<View style={{
backgroundColor: 'rgba(0, 0, 0, 0.6)',
......
......@@ -13,7 +13,9 @@ export default class RtmAdapter extends EventEmitter {
constructor() {
super();
this.uid = null;
this.channelId = null;
this.client = new RtmEngine();
console.log(this)
}
listenersAll(){
const events = [
......@@ -47,10 +49,12 @@ export default class RtmAdapter extends EventEmitter {
console.log('ChannelAttributesUpdated', evt);
this.emit('attributesUpdated', evt);
});
// this.client.addListener('ChannelMemberJoined', (evt: any) => {
// console.log('channelMemberJoined', evt);
// this.emit('channelMemberJoined', evt);
// });
this.client.addListener('MemberCountUpdated', async (evt: any) => {
console.log('MemberCountUpdated', evt);
let memberCountList = await this.client.getMembers(this.channelId)
console.log(memberCountList,'memberCountListmemberCountList')
this.emit('MemberCountUpdated', memberCountList);
});
}
async login(uid: string): Promise<any> {
......@@ -96,6 +100,7 @@ export default class RtmAdapter extends EventEmitter {
}
async join(cid: string): Promise<any> {
this.channelId = cid
return this.client.joinChannel(cid);
}
......
......@@ -112,7 +112,7 @@ export default class Index extends Component {
componentWillShow = () => {
// StatusBar.setBarStyle('dark-content');
this.getCurrentLessons();
// this.getCurrentLessons();
// this.getLessonsByDate();
// this.setMarkDates();
// this.getLessonStat();
......@@ -407,21 +407,30 @@ export default class Index extends Component {
});
}
golive = () => {
if (this.state.classList && this.state.classList.length) {
let item = this.state.classList[0]
if (this.state.classList && this.state.classList.lessonInfo && !this.state.classList.sClose) {
let item ={
...this.state.classList.stuSchedule,
...this.state.classList.lessonInfo,
stuScheduleId:this.state.classList.stuSchedule.stuId,
clazzStudentList:this.state.classList.stuSchedules,
tchSchedule:[this.state.classList.tchSchedule]
}
console.log(item)
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,
teachers: item.tchSchedule,
courseName: item.lessonName,
studentName: item.stuName,
classId: item.classId,
classScheduleId: item.classScheduleId,
startTime: item.startTime,
endTime: item.endTime,
lessonDate: item.lessonDate,
lessonId:item.lessonId,
stuScheduleId:item.stuScheduleId,
// classScheduleId: item.classScheduleId,
// startTime: item.startTime,
// endTime: item.endTime,
// lessonDate: item.lessonDate,
});
return
if (item.status === '20') {
......@@ -436,7 +445,7 @@ export default class Index extends Component {
} else {
this.setState({
showToast: true,
msg: '此账户当前无课程',
msg: '当前老师未开课',
tipsIcon: require('../../images/common/info.png')
});
}
......@@ -449,18 +458,19 @@ export default class Index extends Component {
})
.then(data => {
console.log('getCurrentLessons', data.data);
if (data.success) {
let classList = [];
data.data.map((item) => {
item = this.setDate(item);
// item.startDate = new Date('2021-05-25 00:10');
item = this.setButton(item);
classList.push(item);
});
if (data.success && data.data) {
// let classList = [];
// data.data.map((item) => {
// item = this.setDate(item);
// // item.startDate = new Date('2021-05-25 00:10');
// item = this.setButton(item);
// classList.push(item);
// });
this.setState({
classList: classList
classList:data.data
})
}
this.golive()
})
.catch(error => {
console.log('error', error)
......@@ -769,7 +779,7 @@ export default class Index extends Component {
<Text style={{ fontSize: Constants.unitWidth * 16, color: '#444444' }}>数据实证 智能互动 即时反馈</Text>
</View>
<TouchableOpacity onPress={this.golive} style={{ width: Constants.unitWidth * 160, flex: 48, }}>
<TouchableOpacity onPress={this.getCurrentLessons} style={{ width: Constants.unitWidth * 160, flex: 48, }}>
<Image resizeMode='contain' style={{ maxWidth: '100%', maxHeight: '100%' }} source={require('../../images/common2201/btn.png')} />
</TouchableOpacity>
</View>
......@@ -777,39 +787,50 @@ export default class Index extends Component {
<Image resizeMode='contain' style={{ width: '75%', }} source={require('../../images/common2201/ban.png')} />
</View>
</View>
<View style={HomeStyle.mainViewTopBtmListView}>
<Image style={HomeStyle.ListViewImg} source={require('../../images/common2201/icon1.png')} />
<Text style={HomeStyle.ListViewText}>课后作业</Text>
</View>
<TouchableOpacity style={HomeStyle.mainViewTopBtmListView} onPress={() => {
this.props.navigation.navigate('woekList')
}} >
<View >
<Image style={HomeStyle.ListViewImg} source={require('../../images/common2201/icon1.png')} />
<Text style={HomeStyle.ListViewText}>课后作业</Text>
</View>
</TouchableOpacity>
</View>
}
</View>
<View style={HomeStyle.mainViewBtm}>
<View style={[HomeStyle.mainViewTopBtmView, { height: this.state.mainHeight }]}>
<TouchableOpacity style={HomeStyle.mainViewTopBtmListView} onPress={() => {
this.props.navigation.navigate('webview')
this.props.navigation.navigate('webview', { type: 'other' })
}} >
<View >
<Image style={HomeStyle.ListViewImg} source={require('../../images/common2201/icon2.png')} />
<Text style={HomeStyle.ListViewText}>在线测试</Text>
</View>
</TouchableOpacity>
<View style={HomeStyle.mainViewTopBtmListView}>
<Image style={HomeStyle.ListViewImg} source={require('../../images/common2201/icon3.png')} />
<Text style={HomeStyle.ListViewText}>学情分析</Text>
</View>
<View style={HomeStyle.mainViewTopBtmListView}>
<Image style={HomeStyle.ListViewImg} source={require('../../images/common2201/icon4.png')} />
<Text style={HomeStyle.ListViewText}>错题攻坚</Text>
</View>
<TouchableOpacity style={HomeStyle.mainViewTopBtmListView} onPress={() => {
this.props.navigation.navigate('webview', { type: 'other' })
}} >
<View style={HomeStyle.mainViewTopBtmListView}>
<Image style={HomeStyle.ListViewImg} source={require('../../images/common2201/icon3.png')} />
<Text style={HomeStyle.ListViewText}>学情分析</Text>
</View>
</TouchableOpacity>
<TouchableOpacity style={HomeStyle.mainViewTopBtmListView} onPress={() => {
this.props.navigation.navigate('webview', { type: 'other' })
}} >
<View style={HomeStyle.mainViewTopBtmListView}>
<Image style={HomeStyle.ListViewImg} source={require('../../images/common2201/icon4.png')} />
<Text style={HomeStyle.ListViewText}>错题攻坚</Text>
</View>
</TouchableOpacity>
</View>
</View>
</View>
<View></View>
</View>
</View>
)
}
......
This diff is collapsed.
import React, { Component } from 'react';
import { View, FlatList, Text, Image, StyleSheet } from 'react-native';
import Button from 'react-native-button';
import Constants from '../../../Constants';
// import Picker from 'react-native-picker';
import homeWork from '../../../css/homework.css';
// import Api from '../../../Api';
import Sound from 'react-native-sound';
import Slider from "react-native-slider";
import Icon from 'react-native-vector-icons/AntDesign';
Sound.setCategory('Playback');
/* <Icon name="rocket" size={30} color="#900" /> */
export default class SoundScreen extends Component {
constructor(props) {
super(props);
this.state = {
whoosh: null, //音频对象
volume: 0.5,
seconds: 0, //秒数
totalMin: '', //总分钟
totalSec: '', //总分钟秒数
nowMin: 0, //当前分钟
nowSec: 0, //当前秒钟
maximumValue: 0, //滑块最大值
playIng:false,
}
}
componentDidMount() {
// this.getListHomework()
this.build()
}
componentWillUnmount() {
// this.setState({
// uri:false,
// })
this.time && clearTimeout(this.time);
if(this.state.whoosh._playing) {
this._stop()
};
}
build = () => {
let audioSrc = this.props.audioSrc; //这个音频放在android\app\src\main\res\raw
let whoosh = new Sound(audioSrc, Sound.MAIN_BUNDLE, (error) => {
if (error) {
alert('加载声音失败');
return;
}
this.setState({ whoosh: whoosh });
this.getTime();
if(this.props.autoPlay){
this._play()
}
});
}
getTime = () => {
let totalTime = this.state.whoosh.getDuration();
totalTime = Math.ceil(totalTime);
let totalMin = parseInt(totalTime / 60); //总分钟数
let totalSec = totalTime - totalMin * 60; //秒钟数并判断前缀是否 + '0'
totalSec = totalSec > 9 ? totalSec : '0' + totalSec;
this.setState({
totalMin,
totalSec,
maximumValue: totalTime,
})
}
playAudio = () => {
this.state.whoosh.play((success) => {
if (success) {//播放完成后的逻辑在这里处理
} else {
console.log('playback failed due to audio decoding errors');
}
});
}
// 播放
_play = () => {
let whoosh = this.state.whoosh
if(whoosh._playing) return;
whoosh.play((success) => {
if (success) {//播放完成后的逻辑在这里处理
this._stop()
} else {
console.log('playback failed due to audio decoding errors');
}
});
console.log(whoosh)
clearInterval(this.time);
this.setState({
playIng:true,
})
this.time = setInterval(() => {
whoosh.getCurrentTime(seconds => {
seconds = Math.ceil(seconds);
this._getNowTime(seconds)
})
}, 1000)
}
// 暂停
_pause = () => {
let whoosh = this.state.whoosh
clearInterval(this.time);
whoosh.pause();
this.setState({
playIng:false,
})
console.log(whoosh)
}
// 停止
_stop = () => {
let whoosh = this.state.whoosh
clearInterval(this.time);
this.setState({
nowMin: 0,
nowSec: 0,
seconds: 0,
playIng:false,
})
whoosh.stop();
console.log(whoosh)
}
_getNowTime = (seconds) => {
let nowMin = this.state.nowMin,
nowSec = this.state.nowSec;
if (seconds >= 60) {
nowMin = parseInt(seconds / 60); //当前分钟数
nowSec = seconds - nowMin * 60;
nowSec = nowSec < 10 ? '0' + nowSec : nowSec;
} else {
nowSec = seconds < 10 ? '0' + seconds : seconds;
}
this.setState({
nowMin,
nowSec,
seconds
})
}
render() {
let time = this.state;
return (
<View >
<View style={{ flexDirection: 'row', alignItems: 'center',paddingLeft: Constants.unitWidth * 12,paddingRight: Constants.unitWidth * 12, justifyContent: 'space-between',width:'100%',height:'100%' }}>
{ this.state.playIng &&
<Icon onPress={this._pause} name="pausecircleo" size={30} color="#F9AE2B" />
}
{ !this.state.playIng &&
<Icon onPress={this._play} name="playcircleo" size={30} color="#F9AE2B" />
}
<View style={{ width: Constants.unitWidth * 150, }}>
<Slider
// disabled //禁止滑动
maximumTrackTintColor={'#ccc'} //右侧轨道的颜色
minimumTrackTintColor={'#F9AE2B'} //左侧轨道的颜色
thumbTintColor={'#F9AE2B'}
maximumValue={this.state.maximumValue} //滑块最大值
minimumValue={0} //滑块最小值
value={this.state.seconds}
onSlidingComplete={(value) => { //用户完成更改值时调用的回调(例如,当滑块被释放时)
value = parseInt(value);
this._getNowTime(value)
// 设置播放时间
this.state.whoosh.setCurrentTime(value);
this._play()
}}
/>
</View>
<Text>{time.nowMin}:{time.nowSec}/{time.totalMin}:{time.totalSec}</Text>
</View>
{/* <Text>当前音量: {this.state.volume}</Text> */}
{/* <Text onPress={this._addVolume}>声音+</Text>
<Text onPress={this._reduceVolume}>声音-</Text> */}
{/* <Text onPress={this._play}>播放</Text>
<Text onPress={this._pause}>暂停</Text>
<Text onPress={this._stop}>停止</Text> */}
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#F5FCFF',
width: '100%'
},
});
\ No newline at end of file
import React, {Component} from 'react';
import {
View,
} from 'react-native';
import ImageViewer from 'react-native-image-zoom-viewer';
// import stylesCommon from '../../../assets/css/common';
// import aaa from '../../../assets/img/nodata.png';
class ImageShow extends Component {
constructor(props) {
super(props);
this.state = {
images: [],
imageIndex: 1,
};
}
componentWillMount() {
// 上个界面传来的照片集合
// const params = this.props.router.getCurrentRoute().params;
// const images = params.image;
// const pageNum = params.num;
this.setState({
images: this.props.images,
imageIndex:this.props.pageNum,
});
}
render() {
return (
// style={stylesCommon.container}
<View style={{width:'100%',height:'100%',backgroundColor:'#000000'}} >
<ImageViewer
imageUrls={this.state.images} // 照片路径
enableImageZoom={true} // 是否开启手势缩放
index={this.state.imageIndex} // 初始显示第几张
// failImageSource={aaa} // 加载失败图片
onChange={(index) => {}} // 图片切换时触发
onClick={() => { // 图片单击事件
this.props.closeImgView();
// this.props.navigator.pop();
}}
/>
</View>
);
}
}
export default ImageShow;
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
import DocumentPicker from 'react-native-document-picker';
const FileTypes = {
All: DocumentPicker.types.allFiles,// All document types, on Android this is */*, on iOS is public.content (note that some binary and archive types do not inherit from public.content)
Image: DocumentPicker.types.images, // All image types (image/* or public.image)
Text: DocumentPicker.types.plainText, // Plain text files ie: .txt (text/plain or public.plain-text)
Audio: DocumentPicker.types.audio, // All audio types (audio/* or public.audio)
PDF: DocumentPicker.types.pdf, // PDF documents (application/pdf or com.adobe.pdf)
Zip: DocumentPicker.types.zip, // Zip files (application/zip or public.zip-archive)
Csv: DocumentPicker.types.csv, //Csv files (text/csv or public.comma-separated-values-text)
};
let Manager = {
// Pick a single file
pickerSingleFile: (fileType, callback, errorCallback) => {
try {
DocumentPicker.pick({
type: [FileTypes[fileType]],
}).then(res => {
console.log(
res.uri,
res.type, // mime type
res.name,
res.size
);
if (callback) {
callback(res);
}
}).catch(error => {
console.log(error);
if (errorCallback) {
errorCallback(error);
}
});
} catch (err) {
if (errorCallback) {
errorCallback(err);
}
if (DocumentPicker.isCancel(err)) {
// User cancelled the picker, exit any dialogs or menus and move on
} else {
throw err;
}
}
},
PickMultipleFiles: (fileType, callback, errorCallback) => {
// Pick multiple files
try {
DocumentPicker.pickMultiple({
type: [FileTypes[fileType]],
}).then(results => {
for (const res of results) {
console.log(
res.uri,
res.type, // mime type
res.name,
res.size
);
}
if (callback) {
callback(results);
}
});
} catch (err) {
if (errorCallback) {
errorCallback(err);
}
if (DocumentPicker.isCancel(err)) {
// User cancelled the picker, exit any dialogs or menus and move on
} else {
throw err;
}
}
},
};
module.exports = Manager;
\ No newline at end of file
function CustomBtoa(input) {
let keyStr =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
let output = "";
let chr1, chr2, chr3, enc1, enc2, enc3, enc4;
let i = 0;
while (i < input.length) {
chr1 = input[i++];
chr2 = i < input.length ? input[i++] : Number.NaN; // Not sure if the index
chr3 = i < input.length ? input[i++] : Number.NaN; // checks are needed here
enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;
if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}
output +=
keyStr.charAt(enc1) +
keyStr.charAt(enc2) +
keyStr.charAt(enc3) +
keyStr.charAt(enc4);
}
return output;
}
function dataURLtoBlob(dataurl) {
var arr = dataurl.split(','),
mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]),
n = bstr.length,
u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new Blob([u8arr], {
type: mime
});
}
//将blob转换为file
function blobToFile(theBlob, fileName) {
return new File([theBlob], new Date().getTime() + theBlob.type.replace('image/','.'));
}
export {
CustomBtoa,
blobToFile,
dataURLtoBlob
}
\ No newline at end of file
......@@ -10,7 +10,7 @@ export default class MyWeb extends Component {
headerTitle: '2222'
});
static navigationOptions = ({ navigation }) => {
staticOptions = ({ navigation }) => {
return {
header: null,
headerBackTitle: ' '
......@@ -25,33 +25,81 @@ export default class MyWeb extends Component {
}
componentDidMount() {
// console.log(this.props.navigation)
// console.log(this.props.route)
let type = this.props.route.params && this.props.route.params.type;
if(type){
this.setState({
uri:'https://changning.gankao.com/p-account/statistics/group?noGroupSwitch=1&gankaoUID=11347855&studygroupId=28634',
})
return
}
Constants.readData('userInfo').then((userInfo) => {
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}"
let url = `http://10.51.0.147:8082/evaluation/teacher/#/loading?type=1&&token=${userInfo.token}`
url = `http://121.36.221.250:8018/evaluation/teacher/#/?type=1&token=${userInfo.token}`
// url = 'http://www.cnblogs.com/jingguorui/p/11727947.html'
this.setState({
uri: `http://121.36.221.250:8018/evaluation/teacher/#/?type=1&token=${userInfo.token}`,
uri:url,
})
console.log(this.state.uri)
}
})
}
componentWillUnmount() {
this.setState({
uri:false,
})
}
onLoadEnd = (e)=>{
console.log(e,'onLoadEnd')
}
onError = (e)=>{
console.log(e,'onError')
}
onLoad = (e)=>{
console.log(e,'onLoad')
}
renderError = (e)=>{
console.log(e,'renderError')
}
onNavigationStateChange = (e)=>{
console.log(e,'onNavigationStateChange')
}
render() {
return (
<View style={{ width: '100%', height: '100%' }}>
<View style={{ width: '100%', height: '100%',overflow:'hidden' }}>
{
this.state.uri &&
<WebView
source={{ uri: this.state.uri }}
style={{ width: '100%', height: '100%' }}
mixedContentMode='compatibility'
/>
<View style={{ width:'100%', height: '100%',overflow:'hidden'}}>
<WebView
source={{ uri: this.state.uri, method: 'GET', headers: { 'Cache-Control':'no-cache'}}}
style={{ width: '100%', height: '100%' }}
mixedContentMode='compatibility'
onLoadEnd = {this.onLoadEnd}
onError = {this.onError}
onLoad = {this.onLoad}
renderError={ (e) => {
if (e === 'WebKitErrorDomain') {
return
}
}}
onNavigationStateChange = {this.onNavigationStateChange}
originWhitelist={['*']}
renderError = {this.renderError}
// allowsInlineMediaPlayback={true}
javaScriptEnabled={true}
domStorageEnabled={true}
/>
</View>
}
</View>
......
......@@ -1218,7 +1218,7 @@
dependencies:
deep-assign "^3.0.0"
"@react-native-community/art@^1.1.2", "@react-native-community/art@^1.2.0":
"@react-native-community/art@^1.2.0":
version "1.2.0"
resolved "https://registry.npm.taobao.org/@react-native-community/art/download/@react-native-community/art-1.2.0.tgz#386d95393f6042d9006f9d4bc6063fb898794460"
integrity sha1-OG2VOT9gQtkAb51LxgY/uJh5RGA=
......@@ -1708,10 +1708,10 @@ acorn@^7.1.0, acorn@^7.1.1:
resolved "https://registry.npm.taobao.org/acorn/download/acorn-7.4.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Facorn%2Fdownload%2Facorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa"
integrity sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=
agora-react-native-rtm@1.4.8:
agora-react-native-rtm@^1.4.8:
version "1.4.8"
resolved "https://registry.npmmirror.com/agora-react-native-rtm/download/agora-react-native-rtm-1.4.8.tgz#b738818c7e57cba0754521cfe869d4ffe46a9271"
integrity sha1-tziBjH5Xy6B1RSHP6GnU/+RqknE=
resolved "https://registry.npmmirror.com/agora-react-native-rtm/-/agora-react-native-rtm-1.4.8.tgz#b738818c7e57cba0754521cfe869d4ffe46a9271"
integrity sha512-UaWAvQ8EQMIodY4+RuqQB9DPsKJoB/SwSDcqTa0DHShatrsvUv3JMPg7TzO1ZHrpnkWHira6EL5C/VgVXu3YYw==
ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3:
version "6.12.6"
......@@ -4607,6 +4607,11 @@ joi@^17.2.1:
"@sideway/formula" "^3.0.0"
"@sideway/pinpoint" "^2.0.0"
js-md5@^0.7.3:
version "0.7.3"
resolved "https://registry.npmmirror.com/js-md5/-/js-md5-0.7.3.tgz#b4f2fbb0b327455f598d6727e38ec272cd09c3f2"
integrity sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
......@@ -6273,12 +6278,11 @@ react-native-picker@^4.3.7:
resolved "https://registry.npm.taobao.org/react-native-picker/download/react-native-picker-4.3.7.tgz#9842e8c62ff0d8b676e9514d9f9172413c0518a8"
integrity sha1-mELoxi/w2LZ26VFNn5FyQTwFGKg=
react-native-progress@^4.1.2:
version "4.1.2"
resolved "https://registry.npm.taobao.org/react-native-progress/download/react-native-progress-4.1.2.tgz#ffb2264ddfeba409c730e36a9791bb7bbe07a00d"
integrity sha1-/7ImTd/rpAnHMONql5G7e74HoA0=
react-native-progress@^5.0.0:
version "5.0.0"
resolved "https://registry.npmmirror.com/react-native-progress/-/react-native-progress-5.0.0.tgz#f5ac6ceaeee27f184c660b00f29419e82a9d0ab0"
integrity sha512-KjnGIt3r9i5Kn2biOD9fXLJocf0bwxPRxOyAgXEnZTJQU2O+HyzgGFRCbM5h3izm9kKIkSc1txh8aGmMafCD9A==
dependencies:
"@react-native-community/art" "^1.1.2"
prop-types "^15.7.2"
react-native-reanimated@^1.13.2:
......
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