Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
zhangzhonghua
/
BoneHouse_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
ce8571b3
authored
May 13, 2020
by
Denglingling
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
完善【自助下单】模块的 配台模版、订单类型、录音、提交接口,录音上传还需要修改
parent
1798ebee
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
197 additions
and
19 deletions
android/app/src/main/AndroidManifest.xml
app/action/QuickAction.js
app/base/BaseConstants.js
app/containers/common/CellTextStyle.js
app/containers/quickOrder/QuickOrderPage.js
app/containers/selfOrder/SelfOrderPage.js
app/network/RequestUtils.js
app/reducers/module/quick.js
android/app/src/main/AndroidManifest.xml
View file @
ce8571b3
...
...
@@ -3,10 +3,21 @@
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<!-- add -->
<
uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/
>
<
uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/
>
<
!-- <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"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_WIFI_STATE"
/>
<uses-permission
android:name=
"android.permission.CHANGE_WIFI_STATE"
/>
<uses-permission
android:name=
"android.permission.READ_PHONE_STATE"
/>
<uses-permission
android:name=
"android.permission.SYSTEM_ALERT_WINDOW"
/>
<uses-permission
android:name=
"android.permission.CAMERA"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_COARSE_LOCATION"
/>
<uses-permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<application
android:name=
".MainApplication"
android:label=
"@string/app_name"
...
...
app/action/QuickAction.js
View file @
ce8571b3
import
{
PostRequest
,
GetRequest
}
from
'../network/RequestUtils'
;
import
{
PostRequest
,
GetRequest
,
UploadRequest
}
from
'../network/RequestUtils'
;
import
{
show
,
getUrlParams
}
from
'../utils/Utils'
;
import
{
exitLoginStatus
}
from
'./LoginAction'
;
import
{
QUICK_ORDER_LIST_DOING
,
QUICK_ORDER_LIST_SUCCESS
,
QUICK_ORDER_LIST_FAILURE
}
from
'../base/ActionTypes'
;
import
{
QUICK_ORDER_LIST_DOING
,
QUICK_ORDER_LIST_SUCCESS
,
QUICK_ORDER_LIST_FAILURE
,
QUICK_SUBMIT_DOING
,
QUICK_SUBMIT_SUCCESS
,
QUICK_SUBMIT_FAILURE
}
from
'../base/ActionTypes'
;
import
RNFetchBlob
from
'react-native-fetch-blob'
// 获取组织 params={access_token:''}
// export const requestQuickOrganizations = async (params) => {
...
...
@@ -9,14 +17,14 @@ import { QUICK_ORDER_LIST_DOING, QUICK_ORDER_LIST_SUCCESS, QUICK_ORDER_LIST_FAIL
// }
export
function
requestQuickOrganizations
(
params
)
{
return
dispatch
=>
{
console
.
warn
(
'----requestQuickOrganizations===================='
)
//
console.warn('----requestQuickOrganizations====================')
dispatch
(
requestOrganizationsing
());
// GetRequest(`/authorized_inventory/search?access_token=${access_token}`)
GetRequest
(
getUrlParams
(
'/authorized_inventory/search'
,
params
))
.
then
(
res
=>
{
console
.
warn
(
'res====='
,
Object
.
keys
(
res
),
res
.
error
,
res
.
message
);
//
console.warn('res=====', Object.keys(res), res.error, res.message);
if
(
res
.
error_code
==
0
)
{
console
.
warn
(
'res====organizations=========='
,
res
.
data
.
organizations
);
//
console.warn('res====organizations==========', res.data.organizations);
let
{
data
:
{
organizations
}
}
=
res
dispatch
(
requestOrganizationsSuccess
(
organizations
));
}
else
if
(
res
.
error_code
===
41006
)
{
...
...
@@ -29,7 +37,7 @@ export function requestQuickOrganizations(params) {
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====organizations----'
,
Object
.
keys
(
err
),
err
.
error
,
err
.
message
)
//
console.log('------err--====organizations----', Object.keys(err), err.error, err.message)
show
(
err
.
error
);
})
}
...
...
@@ -42,11 +50,9 @@ export function requestQuickSurgeryHospital(params) {
dispatch
(
requestOrganizationsing
());
GetRequest
(
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
// GetRequest('/sale/seller_customer/search?access_token=20200512140017932dcdff2129a5f4201900f116c819e74865T473Ma2PGh16ek&org_code=A02&seller_code=shi.ming')
.
then
(
res
=>
{
console
.
warn
(
'res===!!=='
,
Object
.
keys
(
res
),
res
.
error
,
res
.
message
);
// console.warn('res===!!==', Object.keys(res)
);
if
(
res
.
error_code
==
0
)
{
console
.
warn
(
'res====requestQuickSurgeryHospital=========='
,
res
.
data
.
organizations
);
let
{
data
:
{
customers
}
}
=
res
dispatch
(
requestOrganizationsSuccess
(
customers
));
}
else
if
(
res
.
error_code
===
41006
)
{
...
...
@@ -59,12 +65,65 @@ export function requestQuickSurgeryHospital(params) {
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====requestQuickSurgeryHospital----'
,
Object
.
keys
(
err
))
//
console.log('------err--====requestQuickSurgeryHospital----', Object.keys(err))
show
(
err
.
error
);
})
}
}
// 获取订单类型 params={access_token:'', value_set_code:'SUR_ORDER_TYPE'}
export
function
requestQuickOrderType
(
params
)
{
return
dispatch
=>
{
console
.
warn
(
'----requestQuickOrderType===================='
,
params
)
dispatch
(
requestOrganizationsing
());
GetRequest
(
getUrlParams
(
'/system/value_set/search'
,
params
))
.
then
(
res
=>
{
console
.
warn
(
'res===!!=='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
sys_values
}
}
=
res
dispatch
(
requestOrganizationsSuccess
(
sys_values
));
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
dispatch
(
requestOrganizationsFail
());
}
})
.
catch
(
err
=>
{
// console.log('------err--====requestQuickSurgeryHospital----', Object.keys(err))
show
(
err
.
error
);
})
}
}
// 获取配台模版 params={access_token:'', org_code:'', seller_code: 'shi.ming', customer_code: '', surgery_type: '', doctor_name: ''}
export
function
requestQuickTemplateCollect
(
params
)
{
return
dispatch
=>
{
console
.
warn
(
'----requestQuickTemplateCollect===================='
,
params
)
dispatch
(
requestOrganizationsing
());
GetRequest
(
getUrlParams
(
'/surgery/template_header/search'
,
params
))
.
then
(
res
=>
{
console
.
warn
(
'res===!!=='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
surgery_template_headers
}
}
=
res
dispatch
(
requestOrganizationsSuccess
(
surgery_template_headers
));
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
dispatch
(
requestOrganizationsFail
());
}
})
.
catch
(
err
=>
{
// console.log('------err--====requestQuickTemplateCollect----', Object.keys(err))
show
(
err
.
error
);
})
}
}
function
requestOrganizationsing
()
{
return
{
...
...
@@ -83,4 +142,100 @@ function requestOrganizationsFail() {
return
{
type
:
QUICK_ORDER_LIST_FAILURE
}
}
// 上传语音 params={ access_token:'', path='录音地址' }
export
function
requestQuickAudio
(
params
)
{
return
dispatch
=>
{
let
{
access_token
,
path
}
=
params
// 临时
// access_token = "201904091445193616b5e3d3a777848dda1de1a8123d0fdf9xw7t566c1S92U88"
let
formData
=
new
FormData
()
let
soundPath
=
`file://
${
path
}
`
let
fileName
=
path
.
substring
(
path
.
lastIndexOf
(
'/'
)
+
1
,
path
.
length
)
// let file = { uri: soundPath, type: 'ogg', name: fileName } // 类型和名字固定???
let
file
=
{
uri
:
soundPath
,
type
:
'multipart/form-data'
,
name
:
fileName
}
// 类型和名字固定???
formData
.
append
(
'file'
,
file
)
console
.
log
(
'----file===================='
,
file
,
soundPath
,
formData
)
// /system/attachment/create
// /dingding/upload_media
dispatch
(
requestSubmitOrganizationsing
());
UploadRequest
(
getUrlParams
(
'/dingding/upload_media'
,
{
access_token
}),
formData
)
.
then
(
res
=>
{
console
.
log
(
'res===!!=='
,
Object
.
keys
(
res
),
res
);
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
url
}
}
=
res
dispatch
(
requestSubmitOrganizationsSuccess
(
url
));
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
dispatch
(
requestSubmitOrganizationsFail
());
}
})
.
catch
(
err
=>
{
// console.log('------err--====requestQuickAudio----', Object.keys(err))
show
(
err
.
error
);
})
}
}
//上传头像
export
const
uploadAttachment
=
async
(
token
,
datas
)
=>
{
return
await
UploadRequest
(
'/system/attachment/create'
+
'?access_token='
+
token
,
datas
)
};
// 提交数据
export
function
requestQuickSumbit
({
access_token
,
...
params
})
{
return
dispatch
=>
{
console
.
warn
(
'----requestQuickSumbit===================='
,
access_token
,
params
)
dispatch
(
requestSubmitOrganizationsing
());
PostRequest
(
getUrlParams
(
'/surgery/consume_order/create'
,
{
access_token
:
access_token
}),
params
)
.
then
(
res
=>
{
console
.
warn
(
'res====='
,
Object
.
keys
(
res
));
if
(
res
.
error_code
==
0
)
{
console
.
warn
(
'res====requestQuickSumbit=========='
,
res
.
data
);
let
{
data
:
{
data
}
}
=
res
dispatch
(
requestSubmitOrganizationsSuccess
(
data
));
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
dispatch
(
requestSubmitOrganizationsFail
());
}
})
.
catch
(
err
=>
{
// console.log('------err--====requestQuickSumbit----', Object.keys(err), err.error, err.message)
show
(
err
.
error
);
})
}
}
function
requestSubmitOrganizationsing
()
{
return
{
type
:
QUICK_SUBMIT_DOING
}
}
function
requestSubmitOrganizationsSuccess
(
data
)
{
return
{
type
:
QUICK_SUBMIT_SUCCESS
,
rawData
:
data
}
}
function
requestSubmitOrganizationsFail
()
{
return
{
type
:
QUICK_SUBMIT_FAILURE
}
}
\ No newline at end of file
app/base/BaseConstants.js
View file @
ce8571b3
export
const
BaseUrl
=
"http
s://obs.uat.sfrx.guke.tech"
;
export
const
BaseUrlOther
=
"http
s://sob-os.uat.sfrx.guke.tech"
;
export
const
VERSION
=
'/
api/latest'
;
export
const
BaseUrl
=
"http
://192.168.10.188:8200"
;
// https://obs.uat.sfrx.guke.tech https://sob-os.uat.sfrx.guke.tech
export
const
BaseUrlOther
=
"http
://192.168.10.188:8200"
;
//http://192.168.10.188:8200/v1/dingding/upload_media
export
const
VERSION
=
'/
v1'
;
// /api/latest
export
const
ACCESS_TOKEN
=
'201904091445193616b5e3d3a777848dda1de1a8123d0fdf9xw7t566c1S92U88'
;
//未获取到access_token时使用
app/containers/common/CellTextStyle.js
View file @
ce8571b3
...
...
@@ -78,7 +78,7 @@ const styles = StyleSheet.create({
paddingLeft
:
20
},
text_input
:
{
height
:
38
,
//
height: 38,
paddingRight
:
20
},
image_box
:
{
...
...
app/containers/quickOrder/QuickOrderPage.js
View file @
ce8571b3
This diff is collapsed.
Click to expand it.
app/containers/selfOrder/SelfOrderPage.js
View file @
ce8571b3
...
...
@@ -772,6 +772,7 @@ class SelfOrderPage extends Component {
this
.
setState
({
listOptionData
:
listOptionData
.
map
((
item
,
index
)
=>
{
if
(
item
.
title
===
'手术类时间'
)
{
item
.
name
=
date
item
.
value
=
date
item
.
dateValue
=
formatStrForDate
(
date
)
}
...
...
app/network/RequestUtils.js
View file @
ce8571b3
...
...
@@ -55,13 +55,21 @@ export const UploadRequest = (url,datas) => {
const
opts
=
{
method
:
'POST'
,
body
:
datas
,
// headers: {
// // 'Accept': 'application/json',
// // 'Content-Type': 'application/json'
// 'Content-Type': 'multipart/form-data'
// // 'Content-Type': 'multipart/form-data;charset=utf-8'
// },
timeout
:
20000
//20s超时
};
return
fetch
(
`
${
BaseUrl
}${
VERSION
}${
url
}
`
,
opts
)
// return fetch(`${BaseUrl}${VERSION}${url}`, opts)
return
fetch
(
`
${
BaseUrlOther
}${
VERSION
}${
url
}
`
,
opts
)
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
data
)
.
catch
(
error
=>
{
return
{
flag
:
-
3
,
error_msg
:
'请求异常,请重试'
}
console
.
log
(
'error--------------------'
,
error
,
Object
.
keys
(
error
))
return
{
error_code
:
-
3
,
error_msg
:
'请求异常,请重试'
}
})
};
\ No newline at end of file
app/reducers/module/quick.js
View file @
ce8571b3
...
...
@@ -39,7 +39,8 @@ export default self = (state = defaultState, action) => {
case
QUICK_SUBMIT_SUCCESS
:
return
Object
.
assign
({},
state
,
{
submit_quick_order_status
:
QUICK_SUBMIT_SUCCESS
,
quickOrderOption
:
{}
// 清空当前临时数据
quickOrderOption
:
action
.
rawData
// quickOrderOption: {} // 清空当前临时数据
})
case
QUICK_SUBMIT_FAILURE
:
return
Object
.
assign
({},
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