Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
manager-app-sz
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
ReactNative
manager-app-sz
Commits
06aa4d7b
提交
06aa4d7b
authored
11月 27, 2017
作者:
吴强
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge branch 'master' of
ssh://192.168.1.116:29418/bolan-root/frontend/manager-app-sz
into wq
# Conflicts: # android/app/src/main/java/com/bolanmanagerapp/MainApplication.java # src/utils/config.js
上级
65b5e517
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
115 行增加
和
36 行删除
+115
-36
MainApplication.java
...pp/src/main/java/com/bolanmanagerapp/MainApplication.java
+1
-2
cameraComponent.js
src/components/cameraComponent.js
+59
-8
pickerComponent.js
src/components/pickerComponent.js
+1
-1
domain.js
src/models/domain.js
+12
-2
index.js
src/models/index.js
+2
-2
userinfo.js
src/models/userinfo/userinfo.js
+3
-9
welcome.js
src/models/welcome.js
+5
-2
DSRInfoDetailScreen.js
src/routes/main/dangshireninfo/DSRInfoDetailScreen.js
+5
-5
UserInfoHomeScreen.js
src/routes/main/userinfo/UserInfoHomeScreen.js
+4
-3
welcome.js
src/routes/welcome.js
+1
-0
update.js
src/services/update.js
+1
-1
config.js
src/utils/config.js
+1
-1
polyfill.js
src/utils/polyfill.js
+20
-0
没有找到文件。
android/app/src/main/java/com/bolanmanagerapp/MainApplication.java
浏览文件 @
06aa4d7b
...
...
@@ -43,8 +43,7 @@ public class MainApplication extends Application implements ReactApplication {
new
CodePush
(
BuildConfig
.
CODEPUSH_KEY
,
getApplicationContext
(),
BuildConfig
.
DEBUG
,
"http://192.168.1.2:3000"
),
new
RNDeviceInfo
(),
new
IDCardReactPackage
(),
new
UpdaterReactPackage
()
new
IDCardReactPackage
(),
//new UpdaterReactPackage(),
new
VectorIconsPackage
(),
new
SplashScreenReactPackage
()
);
...
...
src/components/cameraComponent.js
浏览文件 @
06aa4d7b
...
...
@@ -8,6 +8,11 @@ import {
}
from
'react-native'
;
import
Icon
from
'react-native-vector-icons/MaterialIcons'
;
import
Camera
from
'react-native-camera'
;
import
{
getToken
}
from
'../utils/auth'
;
import
{
errors
}
from
'../utils/error'
;
import
{
encrypt
}
from
'../utils/helper'
;
import
config
from
'../utils/config'
;
import
{
futch
}
from
'../utils/polyfill'
;
const
styles
=
StyleSheet
.
create
({
container
:
{
...
...
@@ -51,7 +56,6 @@ const styles = StyleSheet.create({
padding
:
5
,
},
});
class
CameraComponent
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
...
...
@@ -69,6 +73,8 @@ class CameraComponent extends React.Component {
this
.
switchCam
=
this
.
switchCam
.
bind
(
this
);
this
.
recording
=
this
.
recording
.
bind
(
this
);
this
.
takePicture
=
this
.
takePicture
.
bind
(
this
);
this
.
uploadImage
=
this
.
uploadImage
.
bind
(
this
);
this
.
clear
=
this
.
clear
.
bind
(
this
);
}
typeIcon
=
()
=>
{
const
{
back
,
front
}
=
Camera
.
constants
.
Type
;
...
...
@@ -78,7 +84,7 @@ class CameraComponent extends React.Component {
}
else
if
(
this
.
state
.
camera
.
type
===
front
)
{
return
'camera-rear'
;
}
}
}
;
camButton
=
()
=>
{
if
(
!
this
.
state
.
isRecording
)
{
...
...
@@ -86,7 +92,7 @@ class CameraComponent extends React.Component {
}
else
{
return
'stop'
;
}
}
}
;
switchCam
()
{
let
newType
;
const
{
back
,
front
}
=
Camera
.
constants
.
Type
;
...
...
@@ -129,6 +135,46 @@ class CameraComponent extends React.Component {
.
then
((
data
)
=>
{
console
.
log
(
data
);
this
.
setState
({
imageURI
:
data
.
path
});
})
.
catch
(
err
=>
console
.
error
(
err
));
}
uploadImage
()
{
let
token
;
getToken
().
then
((
Apptoken
)
=>
{
if
(
!
Apptoken
)
{
return
Promise
.
reject
(
errors
.
tokenMissing
());
}
token
=
encrypt
(
Apptoken
);
const
uri
=
`
${
config
.
apiContextPath
}
/resource/
${
token
}
`
;
const
formData
=
new
global
.
FormData
();
const
file
=
{
uri
:
this
.
state
.
imageURI
,
type
:
'image/jpg'
,
name
:
'tupian.jpg'
};
formData
.
append
(
'file'
,
file
);
console
.
info
(
formData
);
futch
(
uri
,
{
method
:
'POST'
,
headers
:
{
'Content-Type'
:
'multipart/form-data'
,
},
body
:
formData
,
},
(
progressEvent
)
=>
{
const
progress
=
progressEvent
.
loaded
/
progressEvent
.
total
;
})
.
then
(
request
=>
request
.
responseText
)
// response.text())
.
then
((
responseData
)
=>
{
const
response
=
JSON
.
parse
(
responseData
);
if
(
response
.
errorCode
===
0
)
{
// 这里需要调用接口,对图片数据进行绑定,等待完善
// 页面跳转,跳转到前面的详情的页面
console
.
info
(
'跳转'
);
this
.
props
.
navigation
.
navigate
(
'DSRInfoDetail'
,
this
.
props
.
navigation
.
state
.
params
.
pID
);
}
})
.
catch
((
error
)
=>
{
console
.
info
(
error
);
});
});
}
clear
()
{
this
.
setState
({
imageURI
:
''
});
}
render
()
{
if
(
this
.
state
.
imageURI
===
''
)
{
...
...
@@ -148,7 +194,6 @@ class CameraComponent extends React.Component {
/
>
<
View
style
=
{[
styles
.
overlay
,
styles
.
topOverlay
]}
>
<
Icon
.
Button
name
=
{
this
.
typeIcon
()}
size
=
{
36
}
backgroundColor
=
"transparent"
onPress
=
{
this
.
switchCam
}
/
>
<
Icon
.
Button
name
=
{
this
.
typeIcon
()}
size
=
{
36
}
backgroundColor
=
"transparent"
onPress
=
{
this
.
switchCam
}
/
>
<
/View
>
<
View
style
=
{[
styles
.
overlay
,
styles
.
bottomOverlay
]}
>
<
Icon
.
Button
name
=
"photo-camera"
size
=
{
48
}
backgroundColor
=
"transparent"
onPress
=
{
this
.
takePicture
}
/
>
...
...
@@ -158,10 +203,16 @@ class CameraComponent extends React.Component {
);
}
else
{
return
(
<
Image
style
=
{{
height
:
Dimensions
.
get
(
'window'
).
height
,
width
:
Dimensions
.
get
(
'window'
).
width
}}
source
=
{{
uri
:
this
.
state
.
imageURI
,
isStatic
:
true
}}
/
>
<
View
style
=
{
styles
.
container
}
>
<
Image
style
=
{{
height
:
Dimensions
.
get
(
'window'
).
height
,
width
:
Dimensions
.
get
(
'window'
).
width
}}
source
=
{{
uri
:
this
.
state
.
imageURI
,
isStatic
:
true
}}
/
>
<
View
style
=
{[
styles
.
overlay
,
styles
.
bottomOverlay
]}
>
<
Icon
.
Button
name
=
"clear"
size
=
{
48
}
backgroundColor
=
"transparent"
onPress
=
{
this
.
clear
}
/
>
<
Icon
.
Button
name
=
"done"
size
=
{
48
}
backgroundColor
=
"transparent"
onPress
=
{
this
.
uploadImage
}
/
>
<
/View
>
<
/View
>
);
}
}
...
...
src/components/pickerComponent.js
浏览文件 @
06aa4d7b
...
...
@@ -25,7 +25,7 @@ class PickerComponent extends PureComponent {
onPickerChange
=
{
this
.
onPickerChange
}
onOk
=
{
this
.
onOkButton
}
>
<
List
.
Item
arrow
=
"horizontal"
onClick
=
{
this
.
onClick
}
>
当前基地
<
/List.Item
>
<
List
.
Item
arrow
=
"horizontal"
onClick
=
{
this
.
onClick
}
>
{
this
.
props
.
title
}
<
/List.Item
>
<
/Picker
>
<
/List
>
<
/View
>
...
...
src/models/domain.js
浏览文件 @
06aa4d7b
...
...
@@ -70,6 +70,7 @@ export default {
arrayPath
:
[],
cols
:
1
,
userInfo
:
''
,
currentJiDiName
:
undefined
,
},
subscriptions
:
{
...
...
@@ -87,6 +88,7 @@ export default {
datas
.
push
({
label
:
name
,
value
:
path
,
children
:
[]
});
return
datas
;
});
yield
put
({
type
:
'setCols'
,
payload
:
1
});
yield
put
({
type
:
'queryInit'
,
payload
:
init
});
yield
put
({
type
:
'queryArryPath'
,
payload
:
[
'/'
]
});
yield
put
({
type
:
'queryList'
,
payload
:
datas
});
...
...
@@ -113,6 +115,8 @@ export default {
const
{
path
,
name
}
=
yield
call
(
currentDomain
);
yield
call
(
setDomain
,
name
,
path
);
yield
put
({
type
:
'queryInit'
,
payload
:
path
});
const
currentJiDiName
=
name
;
yield
put
({
type
:
'setCurrentJiDiName'
,
payload
:
currentJiDiName
});
},
*
logout
(
ignored
,
{
put
,
call
})
{
yield
call
(
logout
);
...
...
@@ -126,9 +130,9 @@ export default {
*
getUserInfo
(
ignored
,
{
put
,
call
})
{
const
userInfo
=
yield
call
(
getUser
);
const
domain
=
yield
call
(
getDomain
);
console
.
info
(
domain
.
path
);
const
list
=
yield
call
(
fetchDomains
,
domain
.
path
,
true
);
console
.
info
(
list
[
0
].
name
);
const
currentJiDiName
=
list
[
0
].
name
;
yield
put
({
type
:
'setCurrentJiDiName'
,
payload
:
currentJiDiName
});
yield
put
({
type
:
'queryUserInfo'
,
payload
:
userInfo
});
},
},
...
...
@@ -170,6 +174,12 @@ export default {
cols
,
};
},
setCurrentJiDiName
(
state
,
{
payload
:
currentJiDiName
})
{
return
{
...
state
,
currentJiDiName
,
};
},
},
};
src/models/index.js
浏览文件 @
06aa4d7b
...
...
@@ -7,7 +7,7 @@ import DSRInfo from './dangshireninfo/dsrinfo';
import
DSRInfoDetail
from
'./dangshireninfo/dsrinfodetail'
;
import
peopleInfo
from
'./peopleInfo/peopleInfo'
;
import
domain
from
'./domain'
;
import
userInfo
from
'./userinfo/userinfo'
;
import
userInfo
mation
from
'./userinfo/userinfo'
;
import
QSInfo
from
'./quanshuInfo/qsinfo'
;
import
QSInfoDetail
from
'./quanshuInfo/qsinfodetail'
;
import
FWQuanShu
from
'./houseinfo/fwquanshuDetail'
;
...
...
@@ -22,7 +22,7 @@ export default [
DSRInfo
,
DSRInfoDetail
,
peopleInfo
,
userInfo
,
userInfo
mation
,
QSInfo
,
QSInfoDetail
,
FWQuanShu
,
...
...
src/models/userinfo/userinfo.js
浏览文件 @
06aa4d7b
export
default
{
namespace
:
'userInfo'
,
namespace
:
'userInfo
mation
'
,
state
:
{
userName
:
undefined
,
currentJiDiName
:
undefined
,
jidiList
:
[]
,
currentJiDiPath
:
undefined
,
},
subscriptions
:
{
setup
({
dispatch
})
{
// eslint-disable-line
...
...
@@ -18,13 +18,7 @@ export default {
userName
,
};
},
setJiDiList
(
state
,
{
payload
:
jidiList
})
{
return
{
...
state
,
jidiList
,
};
},
setCurrentJiDi
(
state
,
{
payload
:
currentJiDiName
})
{
setCurrentJiDiName
(
state
,
{
payload
:
currentJiDiName
})
{
return
{
...
state
,
currentJiDiName
,
...
...
src/models/welcome.js
浏览文件 @
06aa4d7b
import
{
AsyncStorage
}
from
'react-native'
;
import
{
NavigationActions
}
from
'react-navigation'
;
import
codePush
from
'react-native-code-push'
;
// import codePush from 'react-native-code-push';
import
{
checkUpdate
}
from
'../services/update'
;
export
default
{
namespace
:
'welcome'
,
...
...
@@ -9,7 +10,9 @@ export default {
effects
:
{
*
init
(
ignored
,
{
put
,
call
})
{
try
{
yield
call
(
codePush
.
sync
);
// yield call(codePush.sync);
// const promise = yield call(checkUpdate);
// console.info(promise);
}
catch
(
e
)
{
console
.
log
(
e
);
// eslint-disable-line no-console
}
...
...
src/routes/main/dangshireninfo/DSRInfoDetailScreen.js
浏览文件 @
06aa4d7b
...
...
@@ -4,7 +4,7 @@
import
React
from
'react'
;
import
{
createForm
}
from
'rc-form'
;
import
{
View
,
ScrollView
}
from
'react-native'
;
import
{
List
,
InputItem
,
Toast
,
WhiteSpace
,
WingBlank
,
TextareaItem
}
from
'antd-mobile'
;
import
{
List
,
InputItem
,
Toast
,
WhiteSpace
,
WingBlank
}
from
'antd-mobile'
;
import
Icon
from
'react-native-vector-icons/FontAwesome'
;
import
{
connect
}
from
'react-redux'
;
import
{
createAction
}
from
'../../../utils'
;
...
...
@@ -17,7 +17,7 @@ class DSRInfoDetailScreen extends React.Component {
}
onEdit
=
()
=>
{
// this.props.dispatch(createAction('DSRInfoDetail/setEnable')(true));
this
.
props
.
navigation
.
navigate
(
'CameraPhoto'
);
this
.
props
.
navigation
.
navigate
(
'CameraPhoto'
,
{
pID
:
this
.
props
.
navigation
.
state
.
params
}
);
};
onSubmit
=
()
=>
{
this
.
props
.
form
.
validateFields
({
force
:
true
},
(
error
,
value
)
=>
{
...
...
@@ -121,13 +121,13 @@ class DSRInfoDetailScreen extends React.Component {
<
WhiteSpace
/>
<
WingBlank
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
{
/*
<Icon.Button
<
Icon
.
Button
name
=
"edit"
backgroundColor
=
"#08BBF9"
onPress
=
{
this
.
onEdit
}
>
编辑
</Icon.Button> */
}
资料上传
<
/Icon.Button
>
<
/View
>
<
WhiteSpace
/>
<
List
>
...
...
src/routes/main/userinfo/UserInfoHomeScreen.js
浏览文件 @
06aa4d7b
...
...
@@ -8,7 +8,7 @@ import PickerComponent from '../../../components/pickerComponent';
import
{
createAction
}
from
'../../../utils/index'
;
// create a component
@
connect
(({
userInfo
,
domain
})
=>
({
userInfo
,
domain
}))
@
connect
(({
userInfo
mation
,
domain
})
=>
({
userInfomation
,
domain
}))
class
UserInfoHomeScreen
extends
PureComponent
{
componentDidMount
()
{
this
.
props
.
dispatch
(
createAction
(
'domain/getUserInfo'
)());
...
...
@@ -31,7 +31,7 @@ class UserInfoHomeScreen extends PureComponent {
Toast
.
offline
(
'功能正在完善中...'
,
2
);
};
render
()
{
const
{
list
,
listChildren
,
arrayPath
,
cols
,
userInfo
}
=
this
.
props
.
domain
;
const
{
list
,
listChildren
,
arrayPath
,
cols
,
userInfo
,
currentJiDiName
}
=
this
.
props
.
domain
;
let
datas
=
[];
if
(
listChildren
.
length
===
0
)
{
datas
=
list
;
...
...
@@ -70,7 +70,8 @@ class UserInfoHomeScreen extends PureComponent {
<
/View
>
<
WingBlank
>
<
View
style
=
{
styles
.
pickerCom
}
>
<
PickerComponent
onClick
=
{
this
.
onClick
}
onPickerChange
=
{
this
.
onPickerChange
}
onOkButton
=
{
this
.
onOkButton
}
data
=
{
datas
}
pathVal
=
{
arrayPath
}
cols
=
{
cols
}
/
>
<
List
.
Item
extra
=
{
currentJiDiName
}
wrap
>
当前基地
<
/List.Item
>
<
PickerComponent
onClick
=
{
this
.
onClick
}
onPickerChange
=
{
this
.
onPickerChange
}
onOkButton
=
{
this
.
onOkButton
}
data
=
{
datas
}
pathVal
=
{
arrayPath
}
cols
=
{
cols
}
title
=
"切换基地"
/>
<
/View
>
<
/WingBlank
>
<
/View
>
...
...
src/routes/welcome.js
浏览文件 @
06aa4d7b
...
...
@@ -9,6 +9,7 @@ class WelcomeScreen extends Component {
componentDidMount
()
{
const
{
dispatch
}
=
this
.
props
;
dispatch
(
createAction
(
'welcome/init'
)());
SplashScreen
.
hide
();
// 隐藏启动平
}
// 待改进,改成启动页,目前因为时间和技术的问题,搁置。wq write
...
...
src/services/update.js
浏览文件 @
06aa4d7b
...
...
@@ -21,7 +21,7 @@ import config from '../utils/config';
/**
* 升级检查
* @returns {Promise.<
RestResponse<VersionCheck>
>}
* @returns {Promise.<
VersionCheck
>}
*/
export
const
checkUpdate
=
async
()
=>
{
return
post
(
`
${
config
.
updateContextPath
}
/api/app/user/apps/check`
,
{
name
:
config
.
productId
,
version
:
DeviceInfo
.
getVersion
()
});
...
...
src/utils/config.js
浏览文件 @
06aa4d7b
...
...
@@ -30,7 +30,7 @@ const config = {
productId
:
'manager-app-sz'
,
footerText
:
'上海铂蓝信息科技有限公司'
,
contextPath
:
''
,
updateContextPath
:
'http://192.168.1.22/app'
,
updateContextPath
:
'http://192.168.1.22
:8080
/app'
,
// apiContextPath: 'http://14.21.68.149:9089/test',
apiContextPath
:
'http://192.168.1.22:8080/bm'
,
defaultDateFormat
,
...
...
src/utils/polyfill.js
浏览文件 @
06aa4d7b
// eslint-disable-next-line global-require
export
const
fetch
=
require
(
'react-native-fetch-polyfill'
).
default
;
export
const
futch
=
(
url
,
opts
=
{},
onProgress
)
=>
{
return
new
Promise
((
res
,
rej
)
=>
{
const
xhr
=
new
global
.
XMLHttpRequest
();
xhr
.
open
(
opts
.
method
||
'get'
,
url
);
Object
.
keys
(
opts
.
headers
).
forEach
((
k
)
=>
{
xhr
.
setRequestHeader
(
k
,
opts
.
headers
[
k
]);
});
// for (var k in opts.headers || {}) {
// console.info('*');
// xhr.setRequestHeader(k, opts.headers[k]);
// }
xhr
.
onload
=
e
=>
res
(
e
.
target
);
xhr
.
onerror
=
rej
;
if
(
xhr
.
upload
&&
onProgress
)
{
xhr
.
upload
.
onprogress
=
onProgress
;
// event.loaded / event.total * 100 ; //event.lengthComputable
}
xhr
.
send
(
opts
.
body
);
});
};
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论