Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
zhangzhonghua
/
BoneHouse_Business_APP
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ff1d5203
authored
May 28, 2020
by
Denglingling
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加手动填写域名,接口获取当前【动态域名】
parent
577d3f4b
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
457 additions
and
78 deletions
app/action/EquipAction.js
app/action/LoginAction.js
app/action/QuickAction.js
app/action/SelfAction.js
app/base/ActionTypes.js
app/containers/equipConsu/EquipConsuPage.js
app/containers/equipConsu/module/ConsumDetailsPage.js
app/containers/home/HomePage.js
app/containers/login/LoginPage.js
app/containers/login/module/FillDomainModel.js
app/containers/quickOrder/QuickOrderPage.js
app/network/RequestUtils.js
app/reducers/module/login.js
app/action/EquipAction.js
View file @
ff1d5203
...
...
@@ -15,10 +15,11 @@ import {
// 获取组织 params={access_token:''}
export
function
requestEquipOrganizations
(
params
)
{
return
dispatch
=>
{
return
(
dispatch
,
getState
)
=>
{
console
.
log
(
'----requestEquipOrganizations===================='
)
dispatch
(
requestListDataing
());
GetRequest
(
getUrlParams
(
'/authorized_inventory/search'
,
params
))
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/authorized_inventory/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'res====='
,
Object
.
keys
(
res
),
res
);
if
(
res
.
error_code
==
0
)
{
...
...
@@ -42,10 +43,11 @@ export function requestEquipOrganizations(params) {
// 获取手术医院 params={access_token:'', org_code:'', seller_code:''}
export
function
requestEquipSurgeryHospital
(
params
)
{
return
dispatch
=>
{
return
(
dispatch
,
getState
)
=>
{
console
.
log
(
'----requestEquipSurgeryHospital===================='
,
params
)
dispatch
(
requestListDataing
());
GetRequest
(
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
...
...
@@ -70,10 +72,11 @@ export function requestEquipSurgeryHospital(params) {
// api/latest/surgery/collect_order/search?access_token=${access_token}&org_code=A02&seller_code=shi.ming&customer_code=CU00000017&collect_header_status=RETURNED,COLLECTED
// 获取订单信息 params={access_token:'', org_code:'', seller_code:'', customer_code:'', collect_header_status: ''}
export
function
requestEquipOrderInfo
(
params
)
{
return
dispatch
=>
{
return
(
dispatch
,
getState
)
=>
{
console
.
log
(
'----requestEquipOrderInfo===================='
,
params
)
dispatch
(
requestListDataing
());
GetRequest
(
getUrlParams
(
'/surgery/collect_order/search'
,
params
))
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/collect_order/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
...
...
@@ -123,24 +126,25 @@ export function getSubdetailOption(data) {
}
// 获取消耗明细 params={access_token:'', surgery_collect_number:''}
export
const
requestEquipDetails
=
async
(
params
)
=>
{
export
const
requestEquipDetails
=
async
(
global_domain_config
,
params
)
=>
{
console
.
log
(
'----requestEquipDetails----'
,
params
)
return
await
GetRequest
(
getUrlParams
(
'/surgery/collected_order_line/search'
,
params
))
return
await
GetRequest
(
g
lobal_domain_config
,
g
etUrlParams
(
'/surgery/collected_order_line/search'
,
params
))
}
// 图片上传
export
const
uploadEquipImg
=
async
(
params
)
=>
{
export
const
uploadEquipImg
=
async
(
global_domain_config
,
params
)
=>
{
let
{
access_token
,
formData
}
=
params
console
.
log
(
'--------'
,
access_token
,
formData
)
return
await
UploadRequest
(
getUrlParams
(
'/dingding/upload_media'
,
{
access_token
}),
formData
)
return
await
UploadRequest
(
g
lobal_domain_config
,
g
etUrlParams
(
'/dingding/upload_media'
,
{
access_token
}),
formData
)
}
// 提交数据
export
function
requestEquipSumbit
({
access_token
,
...
params
})
{
return
dispatch
=>
{
return
(
dispatch
,
getState
)
=>
{
console
.
warn
(
'----requestEquipSumbit===================='
,
access_token
,
params
)
dispatch
(
requestSubmiting
());
PostRequest
(
getUrlParams
(
'/surgery/consume_order/create'
,
{
access_token
:
access_token
}),
params
)
let
{
global_domain_config
}
=
getState
().
login
PostRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/consume_order/create'
,
{
access_token
:
access_token
}),
params
)
.
then
(
res
=>
{
console
.
warn
(
'res====='
,
Object
.
keys
(
res
),
res
);
if
(
res
.
error_code
==
0
)
{
...
...
app/action/LoginAction.js
View file @
ff1d5203
import
{
LOGIN_DOING
,
LOGIN_SUCCESS
,
LOGIN_FAILURE
,
EXIT_LOGIN
,
AUTO_LOGIN_SUCCESS
,
AUTO_LOGIN_FAILURE
}
from
'../base/ActionTypes'
;
import
{
LOGIN_DOING
,
LOGIN_SUCCESS
,
LOGIN_FAILURE
,
EXIT_LOGIN
,
AUTO_LOGIN_SUCCESS
,
AUTO_LOGIN_FAILURE
,
SET_DOMAIN_CONFIGURATE
}
from
'../base/ActionTypes'
;
import
{
PostRequest
,
GetRequest
}
from
'../network/RequestUtils'
;
import
{
show
}
from
'../utils/Utils'
;
import
{
show
}
from
'../utils/Utils'
;
export
function
requestLogin
(
params
)
{
return
dispatch
=>
{
return
(
dispatch
,
getState
)
=>
{
console
.
log
(
'-------store--!!=========================---'
,
getState
())
dispatch
(
logining
());
PostRequest
(
'/access_token/password/search?app_code=PDA'
,
params
).
then
((
res
)
=>
{
let
{
global_domain_config
}
=
getState
().
login
PostRequest
(
global_domain_config
,
'/access_token/password/search?app_code=MOBILE'
,
params
).
then
((
res
)
=>
{
if
(
res
.
error_code
===
0
){
// console.warn('res---', res)
// if(res.functions && res.functions.length) {
// show('登录成功');
// dispatch(loginSuccess(res, params.data.user_name, params.data.user_password));
// } else {
// show(`当前用户没有菜单权限,\n请联系管理员配置!`)
// dispatch(loginFailure())
// }
show
(
'登录成功'
);
console
.
warn
(
'res---'
,
res
)
dispatch
(
loginSuccess
(
res
,
params
.
data
.
user_name
,
params
.
data
.
user_password
));
}
else
{
show
(
res
.
error_msg
);
let
{
error_msg
}
=
res
if
(
error_code
==
-
3
)
{
error_msg
+=
'\n尝试修改域名'
}
show
(
error_msg
);
dispatch
(
loginFailure
())
}
}).
catch
((
err
)
=>
{
...
...
@@ -60,10 +83,17 @@ function autoLoginFailure() {
}
export
function
autoLogin
(
params
)
{
return
dispatch
=>
{
PostRequest
(
'/access_token/password/search?app_code=PDA'
,
params
).
then
((
res
)
=>
{
return
(
dispatch
,
getState
)
=>
{
let
{
global_domain_config
}
=
getState
().
login
PostRequest
(
global_domain_config
,
'/access_token/password/search?app_code=MOBILE'
,
params
).
then
((
res
)
=>
{
if
(
res
.
error_code
===
0
){
console
.
warn
(
'auto------'
,
res
);
// if(res.functions && res.functions.length) {
// dispatch(autoLoginSuccess(res));
// } else {
// show(`当前用户没有菜单权限,\n请联系管理员配置!`)
// dispatch(autoLoginFailure())
// }
dispatch
(
autoLoginSuccess
(
res
))
}
else
{
console
.
warn
(
res
.
error_msg
);
...
...
@@ -75,3 +105,10 @@ export function autoLogin(params) {
})
}
}
export
function
setDomainConfigurate
(
domainVal
)
{
return
{
type
:
SET_DOMAIN_CONFIGURATE
,
global_domain_config
:
domainVal
}
}
\ No newline at end of file
app/action/QuickAction.js
View file @
ff1d5203
...
...
@@ -13,11 +13,12 @@ import {
// 获取组织 params={access_token:''}
export
function
requestQuickOrganizations
(
params
)
{
return
dispatch
=>
{
return
(
dispatch
,
getState
)
=>
{
console
.
log
(
'----requestQuickOrganizations===================='
)
dispatch
(
requestListDataing
());
let
{
global_domain_config
}
=
getState
().
login
// GetRequest(`/authorized_inventory/search?access_token=${access_token}`)
GetRequest
(
getUrlParams
(
'/authorized_inventory/search'
,
params
))
GetRequest
(
g
lobal_domain_config
,
g
etUrlParams
(
'/authorized_inventory/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'res====='
,
Object
.
keys
(
res
),
res
);
if
(
res
.
error_code
==
0
)
{
...
...
@@ -41,10 +42,11 @@ export function requestQuickOrganizations(params) {
// 获取手术医院 params={access_token:'', org_code:'', seller_code:''}
export
function
requestQuickSurgeryHospital
(
params
)
{
return
dispatch
=>
{
return
(
dispatch
,
getState
)
=>
{
console
.
log
(
'----requestQuickSurgeryHospital===================='
,
params
)
dispatch
(
requestListDataing
());
GetRequest
(
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
...
...
@@ -68,10 +70,11 @@ export function requestQuickSurgeryHospital(params) {
// 获取订单类型 params={access_token:'', value_set_code:'SUR_ORDER_TYPE'}
export
function
requestQuickOrderType
(
params
)
{
return
dispatch
=>
{
return
(
dispatch
,
getState
)
=>
{
console
.
log
(
'----requestQuickOrderType===================='
,
params
)
dispatch
(
requestListDataing
());
GetRequest
(
getUrlParams
(
'/system/value_set/search'
,
params
))
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/system/value_set/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
...
...
@@ -95,10 +98,11 @@ export function requestQuickOrderType(params) {
// 获取配台模版 params={access_token:'', org_code:'', seller_code: 'shi.ming', customer_code: '', surgery_type: '', doctor_name: ''}
export
function
requestQuickTemplateCollect
(
params
)
{
return
dispatch
=>
{
return
(
dispatch
,
getState
)
=>
{
console
.
log
(
'----requestQuickTemplateCollect===================='
,
params
)
dispatch
(
requestListDataing
());
GetRequest
(
getUrlParams
(
'/surgery/template_header/search'
,
params
))
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/template_header/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
...
...
@@ -140,7 +144,7 @@ function requestListDataFail() {
}
// 上传语音
export
const
requestQuickAudio
=
async
(
params
)
=>
{
export
const
requestQuickAudio
=
async
(
global_domain_config
,
params
)
=>
{
let
{
access_token
,
path
}
=
params
let
formData
=
new
FormData
()
let
soundPath
=
`file://
${
path
}
`
...
...
@@ -148,15 +152,16 @@ export const requestQuickAudio = async (params) => {
let
file
=
{
uri
:
soundPath
,
type
:
"multipart/form-data"
,
name
:
fileName
}
formData
.
append
(
'file'
,
file
)
console
.
log
(
'--------'
,
file
,
formData
)
return
await
UploadRequest
(
getUrlParams
(
'/dingding/upload_media'
,
{
access_token
}),
formData
)
return
await
UploadRequest
(
g
lobal_domain_config
,
g
etUrlParams
(
'/dingding/upload_media'
,
{
access_token
}),
formData
)
}
// 提交数据
export
function
requestQuickSumbit
({
access_token
,
...
params
})
{
return
dispatch
=>
{
return
(
dispatch
,
getState
)
=>
{
console
.
warn
(
'----requestQuickSumbit===================='
,
access_token
,
params
)
dispatch
(
requestSubmiting
());
PostRequest
(
getUrlParams
(
'/surgery/collect_order/via_data/create'
,
{
access_token
:
access_token
}),
params
)
let
{
global_domain_config
}
=
getState
().
login
PostRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/collect_order/via_data/create'
,
{
access_token
:
access_token
}),
params
)
.
then
(
res
=>
{
console
.
warn
(
'res====='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
...
...
app/action/SelfAction.js
View file @
ff1d5203
...
...
@@ -13,10 +13,11 @@ import {
// return await GetRequest(`/api/latest/authorized_inventory/search?access_token=${params.access_token}`)
// }
export
function
requestOrganizations
(
access_token
)
{
return
dispatch
=>
{
return
(
dispatch
,
getState
)
=>
{
// console.warn('----requestOrganizations')
dispatch
(
requestOrganizationsing
());
GetRequest
(
`/authorized_inventory/search?access_token=
${
access_token
}
`
)
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
`/authorized_inventory/search?access_token=
${
access_token
}
`
)
.
then
(
res
=>
{
// console.warn('res=====', Object.keys(res));
if
(
res
.
error_code
==
0
)
{
...
...
app/base/ActionTypes.js
View file @
ff1d5203
...
...
@@ -6,6 +6,7 @@ export const LOGIN_FAILURE = "LOGIN_FAILURE"
export
const
EXIT_LOGIN
=
"EXIT_LOGIN"
export
const
AUTO_LOGIN_SUCCESS
=
"AUTO_LOGIN_SUCCESS"
export
const
AUTO_LOGIN_FAILURE
=
"AUTO_LOGIN_FAILURE"
export
const
SET_DOMAIN_CONFIGURATE
=
"SET_DOMAIN_CONFIGURATE"
//-----------self order---------------------
export
const
SELF_ORDER_LIST_NO
=
"SELF_ORDER_LIST_NO"
export
const
SELF_ORDER_LIST_DOING
=
"SELF_ORDER_LIST_DOING"
...
...
@@ -37,3 +38,8 @@ export const EQUIP_SUBMIT_SUCCESS = "EQUIP_SUBMIT_SUCCESS"
export
const
EQUIP_SUBMIT_FAILURE
=
"EQUIP_SUBMIT_FAILURE"
export
const
EQUIP_INIT_DATA
=
"EQUIP_INIT_DATA"
export
const
GET_SUB_DETAIL_OPTION
=
"GET_SUB_DETAIL_OPTION"
//-----------historical order search---------------------
export
const
HISTOR_ORDER_SEARCH_NO
=
"HISTOR_ORDER_SEARCH_NO"
export
const
HISTOR_ORDER_SEARCH_DOING
=
"HISTOR_ORDER_SEARCH_DOING"
export
const
HISTOR_ORDER_SEARCH_SUCCESS
=
"HISTOR_ORDER_SEARCH_SUCCESS"
export
const
HISTOR_ORDER_SEARCH_FAILURE
=
"HISTOR_ORDER_SEARCH_FAILURE"
\ No newline at end of file
app/containers/equipConsu/EquipConsuPage.js
View file @
ff1d5203
...
...
@@ -913,9 +913,10 @@ class EquipConsuPage extends Component {
access_token
:
props
.
token
,
formData
}
let
{
global_domain_config
}
=
props
//上传图片接口
// console.log('---handleSubmit--',params)
let
imgResult
=
await
uploadEquipImg
(
params
);
let
imgResult
=
await
uploadEquipImg
(
global_domain_config
,
params
);
// console.log('返回---imgResult======',imgResult)
if
(
imgResult
.
error_code
==
0
)
{
that
.
changeSubLoding
(
false
)
...
...
@@ -1585,7 +1586,8 @@ const mapStateToProps = (state) => {
equip_list_status
:
state
.
equip
.
equip_list_status
,
submit_equip_order_status
:
state
.
equip
.
submit_equip_order_status
,
equipOrderOption
:
state
.
equip
.
equipOrderOption
,
subDetOption
:
state
.
equip
.
subDetOption
subDetOption
:
state
.
equip
.
subDetOption
,
global_domain_config
:
state
.
login
.
global_domain_config
}
}
...
...
app/containers/equipConsu/module/ConsumDetailsPage.js
View file @
ff1d5203
...
...
@@ -114,11 +114,12 @@ class ConsumDetailsPage extends Component {
// 获取当前订单的消耗明细
async
getCurOrderDetail
()
{
let
{
orderId
}
=
this
.
props
.
navigation
.
state
.
params
let
{
global_domain_config
}
=
this
.
props
let
params
=
{
access_token
:
this
.
props
.
token
,
surgery_collect_number
:
orderId
}
let
detailResult
=
await
requestEquipDetails
(
params
)
let
detailResult
=
await
requestEquipDetails
(
global_domain_config
,
params
)
if
(
detailResult
.
error_code
===
0
)
{
let
{
lines
}
=
detailResult
.
data
let
{
subDetOption
}
=
this
.
props
// 【器械消耗】已存在的明细
...
...
@@ -464,7 +465,8 @@ const mapStateToProps = (state) => {
userInfo
:
state
.
login
.
userInfo
,
token
:
state
.
login
.
token
,
loginState
:
state
.
login
.
loginState
,
subDetOption
:
state
.
equip
.
subDetOption
subDetOption
:
state
.
equip
.
subDetOption
,
global_domain_config
:
state
.
login
.
global_domain_config
}
}
...
...
app/containers/home/HomePage.js
View file @
ff1d5203
...
...
@@ -32,7 +32,7 @@ class HomePage extends Component {
showList
:
[
{
icon
:
require
(
'../../images/quick_order.png'
),
title
:
'
快速下单'
,
title
:
'
借货订单'
,
// 原快速下单、手术报台
page
:
'QuickOrderPage'
,
},
// {
...
...
@@ -42,12 +42,12 @@ class HomePage extends Component {
// },
// {
// icon: require('../../images/trans_order.png'),
// title: '转单
',
// title: '转单
申请', // 原转单
// page: 'TransOrderPage',
// },
{
icon
:
require
(
'../../images/equip_consu.png'
),
title
:
'
器械消耗'
,
title
:
'
消耗确认'
,
// 原器械消耗
page
:
'EquipConsuPage'
,
},
// {
...
...
app/containers/login/LoginPage.js
View file @
ff1d5203
...
...
@@ -23,28 +23,33 @@ import {
pxSize
,
placehold_text_color
,
font_family_regular
,
safe_view
safe_view
,
font_family_medium
}
from
'../../base/BaseStyle'
;
import
{
requestLogin
,
autoLogin
}
from
'../../action/LoginAction'
;
import
{
show
,
isEmpty
}
from
'../../utils/Utils'
;
import
{
LOGIN_DOING
,
LOGIN_SUCCESS
,
LOGIN_FAILURE
,
LOGIN_NO
}
from
'../../base/ActionTypes'
;
import
{
requestLogin
,
autoLogin
,
setDomainConfigurate
}
from
'../../action/LoginAction'
;
import
{
show
,
isEmpty
}
from
'../../utils/Utils'
;
import
{
LOGIN_DOING
,
LOGIN_SUCCESS
,
LOGIN_FAILURE
,
LOGIN_NO
}
from
'../../base/ActionTypes'
;
import
StatusBarView
from
'../common/StatusBarView'
;
import
LodingModel
from
'../common/LodingModel'
;
import
FillDomainModel
from
'./module/FillDomainModel'
;
import
SplashScreen
from
'react-native-splash-screen'
;
class
LoginPage
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
username
:
''
,
// shi.ming
username
:
''
,
// shi.ming
gao.xiaoming
password
:
''
,
// sfrx2019
subTit
:
'登录'
,
subTitList
:
[
'登录'
,
'登录中...'
],
isSubLoding
:
false
isSubLoding
:
false
,
isShowDomain
:
false
,
// 域名填写
}
}
componentDidMount
()
{
// this.subAutoLogin()
SplashScreen
.
hide
()
//关闭启动屏幕
}
componentWillReceiveProps
(
nextProps
)
{
...
...
@@ -103,11 +108,11 @@ class LoginPage extends Component{
let
{
username
,
password
,
isSubLoding
}
=
this
.
state
if
(
!
isSubLoding
)
{
if
(
isEmpty
(
username
))
{
show
(
'请输入用户名'
)
show
(
'请输入用户名'
,
'warn'
)
return
}
if
(
isEmpty
(
password
))
{
show
(
'请输入密码'
)
show
(
'请输入密码'
,
'warn'
)
return
}
let
params
=
{
...
...
@@ -163,8 +168,34 @@ class LoginPage extends Component{
this
.
props
.
navigation
.
navigate
(
'HomePage'
)
}
// 打开域名弹窗
handleOpenDomain
()
{
this
.
setState
({
isShowDomain
:
true
})
}
// 关闭域名 回调
handleCloseDomain
()
{
this
.
setState
({
isShowDomain
:
false
})
}
// 域名弹窗 回调
fillDomainCallBack
(
domainVal
)
{
// 存储值到 store
console
.
log
(
'login-----'
,
domainVal
)
let
{
props
}
=
this
props
.
setDomainConfigurate
(
domainVal
)
}
render
()
{
let
{
username
,
password
,
isSubLoding
,
subTit
}
=
this
.
state
let
{
username
,
password
,
isSubLoding
,
subTit
,
isShowDomain
}
=
this
.
state
let
{
global_domain_config
}
=
this
.
props
console
.
log
(
'login-----'
,
global_domain_config
)
let
tempInd
=
global_domain_config
.
indexOf
(
'/'
)
+
2
let
tempGlobalDomain
=
global_domain_config
.
slice
(
tempInd
)
return
(
<
View
style
=
{
styles
.
login_container
}
>
<
StatusBarView
...
...
@@ -216,6 +247,13 @@ class LoginPage extends Component{
activeOpacity
=
{
isSubLoding
?
1
:
.
8
}
>
<
Text
style
=
{
styles
.
btn_text
}
>
{
subTit
}
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
style
=
{
styles
.
fo_domain_box
}
onPress
=
{()
=>
this
.
handleOpenDomain
()}
>
<
Text
style
=
{
styles
.
domain_txt
}
>
修改域名
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
login_footer
}
>
...
...
@@ -226,8 +264,16 @@ class LoginPage extends Component{
<
LodingModel
title
=
{
subTit
}
show
=
{
isSubLoding
}
/
>
<
FillDomainModel
show
=
{
isShowDomain
}
closeModal
=
{()
=>
this
.
handleCloseDomain
()}
callback
=
{(
domainVal
)
=>
this
.
fillDomainCallBack
(
domainVal
)}
domainValue
=
{
tempGlobalDomain
}
/
>
<
/View
>
<
/ImageBackground
>
<
/SafeAreaView
>
<
/View
>
)
...
...
@@ -288,7 +334,6 @@ const styles = StyleSheet.create({
paddingHorizontal
:
'8%'
,
paddingVertical
:
'12%'
,
paddingBottom
:
0
},
cont_head
:
{
marginBottom
:
'12%'
...
...
@@ -320,7 +365,8 @@ const styles = StyleSheet.create({
},
cont_footer
:
{
// borderRadius: 50
justifyContent
:
'center'
,
// justifyContent: 'center',
justifyContent
:
'flex-end'
,
flex
:
1
},
btn_footer
:
{
...
...
@@ -346,7 +392,17 @@ const styles = StyleSheet.create({
},
btn_text
:
{
color
:
title_text_color
,
fontSize
:
second_text_size
fontSize
:
second_text_size
,
fontFamily
:
font_family_medium
},
fo_domain_box
:
{
alignItems
:
'flex-end'
,
marginTop
:
14
},
domain_txt
:
{
color
:
'#919191'
,
fontSize
:
14
,
fontFamily
:
font_family_regular
},
login_footer
:
{
// height: '20%',
...
...
@@ -367,7 +423,7 @@ const styles = StyleSheet.create({
resizeMode
:
'contain'
,
width
:
'100%'
,
height
:
'100%'
}
}
,
})
const
mapStateToProps
=
(
state
)
=>
({
...
...
@@ -375,7 +431,8 @@ const mapStateToProps = (state) => ({
userInfo
:
state
.
login
.
userInfo
,
loginState
:
state
.
login
.
loginState
,
username
:
state
.
login
.
username
,
password
:
state
.
login
.
password
password
:
state
.
login
.
password
,
global_domain_config
:
state
.
login
.
global_domain_config
})
const
mapDispatchToProps
=
(
dispatch
)
=>
({
...
...
@@ -384,6 +441,9 @@ const mapDispatchToProps = (dispatch) => ({
},
autoLogin
:
(
data
)
=>
{
dispatch
(
autoLogin
(
data
))
},
setDomainConfigurate
:
(
domainVal
)
=>
{
dispatch
(
setDomainConfigurate
(
domainVal
))
}
})
...
...
app/containers/login/module/FillDomainModel.js
0 → 100644
View file @
ff1d5203
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
Modal
,
SafeAreaView
,
TextInput
,
StyleSheet
,
TouchableOpacity
}
from
'react-native'
;
import
{
safe_view
,
placehold_text_color
,
Width
,
pxHeight
,
foundation_color
,
promary_text_color
,
font_family_semibold
,
font_family_regular
,
first_text_color
,
btn_sub_color
,
second_text_size
,
title_text_color
}
from
'../../../base/BaseStyle'
;
import
{
show
}
from
'../../../utils/Utils'
;
class
FillDomainModel
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
isVisible
:
false
,
defaDomainHead
:
'https://'
,
domainValue
:
''
,
isNull
:
false
}
}
componentWillReceiveProps
(
nextProps
)
{
console
.
log
(
'nextProps.show----'
,
nextProps
.
show
,
nextProps
.
domainValue
)
if
(
this
.
state
.
isVisible
!=
nextProps
.
show
)
{
this
.
setState
({
isVisible
:
nextProps
.
show
});
}
if
(
this
.
state
.
domainValue
!=
nextProps
.
domainValue
)
{
let
tempDomain
=
nextProps
.
domainValue
let
{
isVisible
}
=
this
.
state
if
(
tempDomain
.
includes
(
"obs.uat.guke.tech"
))
{
tempDomain
=
''
isVisible
=
true
}
this
.
setState
({
domainValue
:
tempDomain
,
isVisible
})
}
}
closeModal
()
{
this
.
setState
({
isVisible
:
false
})
this
.
props
.
closeModal
(
false
)
}
// 域名 输入
handleDomainInput
(
text
)
{
console
.
log
(
'text----'
,
text
)
let
isNull
=
false
if
(
!
text
)
{
isNull
=
true
}
this
.
setState
({
domainValue
:
text
,
isNull
})
}
// 确定
handleSubClick
()
{
let
{
defaDomainHead
,
domainValue
,
isNull
}
=
this
.
state
console
.
log
(
'确定-----'
,
defaDomainHead
,
domainValue
)
if
(
!
domainValue
)
{
console
.
log
(
'请输入域名!'
,
isNull
,
domainValue
)
this
.
setState
({
isNull
:
true
})
return
}
// 存储值 !!!
let
tempDomain
=
defaDomainHead
+
domainValue
this
.
closeModal
()
this
.
props
.
callback
(
tempDomain
)
}
renderDialog
()
{
let
{
domainValue
,
defaDomainHead
,
isNull
}
=
this
.
state
return
(
<
View
style
=
{
styles
.
cont_mian
}
>
<
View
style
=
{
styles
.
cont_inner
}
>
<
View
style
=
{
styles
.
cont_tit_box
}
>
<
Text
style
=
{
styles
.
cont_tit
}
>
配置域名
<
/Text
>
<
/View
>
<
View
style
=
{
styles
.
cont_cell
}
>
<
Text
style
=
{
styles
.
input_head
}
>
{
defaDomainHead
}
<
/Text
>
<
TextInput
autoCapitalize
=
'none'
style
=
{
styles
.
cell_inp_txt
}
placeholderTextColor
=
{
placehold_text_color
}
returnKeyType
=
"done"
defaultValue
=
{
domainValue
}
placeholder
=
{
'请输入域名'
}
keyboardType
=
"email-address"
onChangeText
=
{(
text
)
=>
this
.
handleDomainInput
(
text
)}
/
>
<
/View
>
{
isNull
?
<
View
style
=
{
styles
.
err_input_box
}
>
<
Text
style
=
{
styles
.
err_input
}
>
请输入域名
<
/Text
>
<
/View> : nul
l
}
<
View
style
=
{
styles
.
cont_footer
}
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
style
=
{
styles
.
sub_btn_box
}
onPress
=
{()
=>
this
.
handleSubClick
()}
>
<
Text
style
=
{
styles
.
sub_tit
}
>
确定
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
)
}
render
()
{
return
(
<
View
style
=
{
styles
.
dia_container
}
>
<
Modal
transparent
=
{
true
}
visible
=
{
this
.
state
.
isVisible
}
animationType
=
{
'fade'
}
// onRequestClose={() => this.closeModal()}
>
<
SafeAreaView
style
=
{
safe_view
}
>
{
/* <TouchableOpacity style={styles.container} activeOpacity={1}
// onPress={() => this.closeModal()}
>
{this.renderDialog()}
</TouchableOpacity> */
}
<
View
style
=
{
styles
.
container
}
>
{
/* <Text>hhh</Text> */
}
{
this
.
renderDialog
()}
<
/View
>
<
/SafeAreaView
>
<
/Modal
>
<
/View
>
);
}
}
const
styles
=
StyleSheet
.
create
({
dia_container
:
{
flex
:
1
},
container
:
{
flex
:
1
,
backgroundColor
:
'rgba(0, 0, 0, 0.8)'
,
// paddingTop: '55%',
// alignItems: 'center'
},
cont_mian
:
{
flex
:
1
,
justifyContent
:
'center'
,
position
:
'relative'
},
cont_inner
:
{
position
:
'absolute'
,
left
:
0
,
top
:
pxHeight
(
196
),
width
:
Width
()
-
60
,
flex
:
1
,
flexDirection
:
'column'
,
backgroundColor
:
foundation_color
,
height
:
pxHeight
(
400
),
borderRadius
:
10
,
marginHorizontal
:
30
,
marginVertical
:
20
,
paddingTop
:
30
,
paddingBottom
:
60
,
paddingHorizontal
:
20
},
cont_tit_box
:
{
height
:
20
},
cont_tit
:
{
color
:
promary_text_color
,
fontSize
:
20
,
fontFamily
:
font_family_semibold
},
cont_cell
:
{
height
:
45
,
// borderWidth: 1,
// borderColor: '#FF0000',
flexDirection
:
'row'
,
alignItems
:
'center'
,
borderRadius
:
100
,
paddingHorizontal
:
12
,
backgroundColor
:
'#EFEFEF'
,
marginTop
:
30
},
input_head
:
{
fontSize
:
14
,
fontFamily
:
font_family_semibold
,
color
:
promary_text_color
},
cell_inp_txt
:
{
paddingLeft
:
4
,
fontFamily
:
font_family_regular
,
fontSize
:
14
,
color
:
first_text_color
,
width
:
'80%'
},
err_input_box
:
{
paddingLeft
:
10
,
paddingTop
:
4
},
err_input
:{
fontSize
:
14
,
fontFamily
:
font_family_regular
,
color
:
'#FF0000'
},
cont_footer
:
{
flex
:
1
,
justifyContent
:
'flex-end'
},
sub_btn_box
:
{
width
:
'100%'
,
height
:
38
,
backgroundColor
:
btn_sub_color
,
borderRadius
:
20
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
shadowColor
:
btn_sub_color
,
shadowOffset
:
{
width
:
1
,
height
:
2
},
shadowOpacity
:
1
,
elevation
:
2
,
borderWidth
:
0
},
sub_tit
:
{
color
:
title_text_color
,
fontSize
:
second_text_size
}
})
export
default
FillDomainModel
;
\ No newline at end of file
app/containers/quickOrder/QuickOrderPage.js
View file @
ff1d5203
...
...
@@ -1020,8 +1020,9 @@ class EquipConsuPage extends Component {
access_token
:
props
.
token
,
path
:
state
.
audioPath
}
let
{
global_domain_config
}
=
props
console
.
log
(
'---handleSubmit--'
,
params
)
let
audioResult
=
await
requestQuickAudio
(
params
);
let
audioResult
=
await
requestQuickAudio
(
global_domain_config
,
params
);
console
.
log
(
'返回---audioResult======'
,
audioResult
)
that
.
changeSubLoding
(
true
,
'上传中'
)
if
(
audioResult
.
error_code
==
0
)
{
...
...
@@ -1540,7 +1541,8 @@ const mapStateToProps = (state) => {
loginState
:
state
.
login
.
loginState
,
quick_list_status
:
state
.
quick
.
quick_list_status
,
submit_quick_order_status
:
state
.
quick
.
submit_quick_order_status
,
quickOrderOption
:
state
.
quick
.
quickOrderOption
quickOrderOption
:
state
.
quick
.
quickOrderOption
,
global_domain_config
:
state
.
login
.
global_domain_config
}
}
...
...
@@ -1558,9 +1560,9 @@ const mapDispatchToProps = (dispatch) => {
requestQuickTemplateCollect
:
(
params
)
=>
{
dispatch
(
requestQuickTemplateCollect
(
params
))
},
requestQuickAudio
:
(
params
)
=>
{
dispatch
(
requestQuickAudio
(
params
))
},
//
requestQuickAudio: (params) => {
//
dispatch(requestQuickAudio(params))
//
},
requestQuickSumbit
:
(
params
)
=>
{
dispatch
(
requestQuickSumbit
(
params
))
},
...
...
app/network/RequestUtils.js
View file @
ff1d5203
import
{
BaseUrl
,
BaseUrlOther
,
VERSION
}
from
'../base/BaseConstants'
;
// const fetch = require("node-fetch")
;
//
import {BaseUrl, BaseUrlOther, VERSION} from '../base/BaseConstants';
import
{
VERSION
}
from
'../base/BaseConstants'
;
//post方式请求
export
const
PostRequest
=
(
url
,
paramsObject
)
=>
{
export
const
PostRequest
=
(
BaseUrl
,
url
,
paramsObject
)
=>
{
const
opts
=
{
method
:
'POST'
,
headers
:
{
...
...
@@ -24,7 +24,7 @@ export const PostRequest = (url, paramsObject) => {
//get方式请求
export
const
GetRequest
=
(
url
)
=>
{
export
const
GetRequest
=
(
BaseUrl
,
url
)
=>
{
const
opts
=
{
method
:
'GET'
,
headers
:
{
...
...
@@ -32,16 +32,7 @@ export const GetRequest = (url) => {
},
timeout
:
20000
//20s超时
};
let
endBashUrl
=
BaseUrl
if
(
!
url
.
includes
(
'/authorized_inventory/search'
))
{
endBashUrl
=
BaseUrlOther
}
let
allUrl
=
endBashUrl
+
VERSION
+
url
// console.warn('---allUrl--=================--', allUrl)
// return fetch(BaseUrl + VERSION + url, opts)
return
fetch
(
allUrl
,
opts
)
return
fetch
(
BaseUrl
+
VERSION
+
url
,
opts
)
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
data
)
.
catch
(
error
=>
{
...
...
@@ -50,7 +41,7 @@ export const GetRequest = (url) => {
};
//上传
export
const
UploadRequest
=
(
url
,
datas
)
=>
{
export
const
UploadRequest
=
(
BaseUrl
,
url
,
datas
)
=>
{
const
opts
=
{
method
:
'POST'
,
body
:
datas
,
...
...
@@ -64,7 +55,6 @@ export const UploadRequest = (url,datas) => {
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
data
)
.
catch
(
error
=>
{
console
.
log
(
'error--------------------'
,
error
,
Object
.
keys
(
error
))
return
{
error_code
:
-
3
,
error_msg
:
'请求异常,请重试'
}
})
};
\ No newline at end of file
app/reducers/module/login.js
View file @
ff1d5203
...
...
@@ -5,7 +5,8 @@ import {
LOGIN_FAILURE
,
EXIT_LOGIN
,
AUTO_LOGIN_SUCCESS
,
AUTO_LOGIN_FAILURE
AUTO_LOGIN_FAILURE
,
SET_DOMAIN_CONFIGURATE
}
from
'../../base/ActionTypes'
;
// 登录状态
...
...
@@ -14,7 +15,8 @@ const defaultState = {
userInfo
:{},
// 保存用户信息
token
:
null
,
username
:
''
,
password
:
''
password
:
''
,
global_domain_config
:
'https://obs.uat.guke.tech'
,
// 默认【深圳仓】;【十方】https://obs.uat.sfrx.guke.tech
}
export
default
login
=
(
state
=
defaultState
,
action
)
=>
{
...
...
@@ -52,6 +54,10 @@ export default login = (state = defaultState, action) => {
return
Object
.
assign
({},
state
,
{
loginState
:
LOGIN_FAILURE
});
case
SET_DOMAIN_CONFIGURATE
:
return
Object
.
assign
({},
state
,
{
global_domain_config
:
action
.
global_domain_config
})
default
:
// need this for default case
return
state
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment