Commit 63d43744 by peii

Merge branch 'develop' into product

parents 59a41458 82014a56
Showing with 397 additions and 23 deletions
...@@ -9,10 +9,9 @@ import React, { Component } from 'react' ...@@ -9,10 +9,9 @@ import React, { Component } from 'react'
import { Text, TextInput } from 'react-native' import { Text, TextInput } from 'react-native'
import { Provider } from 'react-redux' import { Provider } from 'react-redux'
import CodePush from 'react-native-code-push' import CodePush from 'react-native-code-push'
import configureStore from './app/store/configureStore' import store from './app/store/configureStore'
import Router from './app/Router' import Router from './app/Router'
import { show } from './app/utils/Utils' import { show } from './app/utils/Utils'
const store = configureStore()
// 字体不随系统字体变化 首字母不大写 // 字体不随系统字体变化 首字母不大写
Text.defaultProps = Object.assign({}, Text.defaultProps, { allowFontScaling: false }) Text.defaultProps = Object.assign({}, Text.defaultProps, { allowFontScaling: false })
......
...@@ -167,12 +167,26 @@ android { ...@@ -167,12 +167,26 @@ android {
bjzr { bjzr {
resValue "string", "baseUrl", '"https://hos.dev.bjhh.guke.tech"' resValue "string", "baseUrl", '"https://hos.dev.bjhh.guke.tech"'
} }
// 国药器械
gyxj { gyxj {
resValue "string", "baseUrl", '"https://obs-pro.xtmy.com:14500"' resValue "string", "baseUrl", '"https://obs-pro.xtmy.com:14500"'
} }
hzngz { // 贵州恒之诺
hzn {
resValue "string", "baseUrl", '"https://obs.hzn.orth.tech"' resValue "string", "baseUrl", '"https://obs.hzn.orth.tech"'
} }
// 嘉事国润
jsgr {
resValue "string", "baseUrl", '"https://obs.dev.jsgr.guke.tech"'
}
// 国控河南
gkhn {
resValue "string", "baseUrl", '"https://obs.gkhnqx.orth.tech:21443"'
}
// 国控湖北
gkhb {
resValue "string", "baseUrl", '"https://obs-pro.gykghb.com:18433"'
}
} }
// applicationVariants are e.g. debug, release // applicationVariants are e.g. debug, release
......
...@@ -26,6 +26,25 @@ import LineOrderPage from './containers/historicalOrder/module/LineOrderPage'; ...@@ -26,6 +26,25 @@ import LineOrderPage from './containers/historicalOrder/module/LineOrderPage';
import SubSuccPage from './containers/common/SubSuccPage'; import SubSuccPage from './containers/common/SubSuccPage';
import BarCodePage from './containers/common/BarCodePage'; import BarCodePage from './containers/common/BarCodePage';
// 结算
import Settlement from '../src/pages/settlement/index';
import SettlementCollection from '../src/pages/settlement/collection';
import SettlementDetail from '../src/pages/settlement/detail';
import SettlementSaleDetail from '../src/pages/settlement/saleDetail';
import SettlementReject from '../src/pages/settlement/reject';
// 分销开票
import DistributeInvoice from '../src/pages/invoice/distribution';
import DistributeInvoiceApplyDetail from '../src/pages/invoice/distribution/detail';
import DistributeInvoiceCollections from '../src/pages/invoice/distribution/collection';
import DistributeInvoiceCollectionDetail from '../src/pages/invoice/distribution/collection_detail';
// 直销开票
import DirectionInvoice from '../src/pages/invoice/direct';
import DirectionInvoiceCollections from '../src/pages/invoice/direct/collections';
import DirectionInvoiceApplyDetail from '../src/pages/invoice/direct/detail';
const Router = createAppContainer(createStackNavigator({ const Router = createAppContainer(createStackNavigator({
LoginPage: { screen: LoginPage }, LoginPage: { screen: LoginPage },
HomePage: {screen: HomePage}, HomePage: {screen: HomePage},
...@@ -48,6 +67,18 @@ const Router = createAppContainer(createStackNavigator({ ...@@ -48,6 +67,18 @@ const Router = createAppContainer(createStackNavigator({
LineOrderPage: {screen: LineOrderPage}, LineOrderPage: {screen: LineOrderPage},
SubSuccPage: {screen: SubSuccPage}, SubSuccPage: {screen: SubSuccPage},
BarCodePage: {screen: BarCodePage}, BarCodePage: {screen: BarCodePage},
Settlement: {screen: Settlement},
SettlementCollection: {screen: SettlementCollection},
SettlementReject: {screen: SettlementReject},
SettlementDetail: {screen: SettlementDetail},
SettlementSaleDetail: {screen: SettlementSaleDetail},
DistributeInvoice: {screen: DistributeInvoice},
DistributeInvoiceApplyDetail: {screen: DistributeInvoiceApplyDetail},
DistributeInvoiceCollections: {screen: DistributeInvoiceCollections},
DistributeInvoiceCollectionDetail: {screen: DistributeInvoiceCollectionDetail},
DirectionInvoice: {screen: DirectionInvoice},
DirectionInvoiceCollections: {screen: DirectionInvoiceCollections},
DirectionInvoiceApplyDetail: {screen: DirectionInvoiceApplyDetail},
}, { }, {
navigationOptions: { navigationOptions: {
gesturesEnabled: true gesturesEnabled: true
......
...@@ -9,7 +9,9 @@ import { ...@@ -9,7 +9,9 @@ import {
SET_DOMAIN_CONFIGURATE, SET_DOMAIN_CONFIGURATE,
SET_VERSION_APK, SET_VERSION_APK,
SET_DOMAIN_FROM_ORIGIN, SET_DOMAIN_FROM_ORIGIN,
SET_SYSPROFILE SET_SYSPROFILE,
SET_NAVIGATION,
SET_ORGANIZATION
} from '../base/ActionTypes'; } from '../base/ActionTypes';
import { GetRequest, PostRequest } from '../network/RequestUtils'; import { GetRequest, PostRequest } from '../network/RequestUtils';
import { getUrlParams, show, showWarnErrorMessage, showErrorMessage, isNotBlank } from '../utils/Utils'; import { getUrlParams, show, showWarnErrorMessage, showErrorMessage, isNotBlank } from '../utils/Utils';
...@@ -200,4 +202,40 @@ export function setSysProfiles(code, value) { ...@@ -200,4 +202,40 @@ export function setSysProfiles(code, value) {
code, code,
value value
} }
}
/**
* @description: 设置路由
* @param {*} navigation
* @return {*}
*/
export function setNavigation(navigation) {
return {
type: SET_NAVIGATION,
navigation
}
}
/**
* @description: 请求授权组织
* @param {*}
* @return {*}
*/
export function getOrganizationData() {
return (dispatch, getState) => {
let {global_domain_config, token } = getState().login
const params = {access_token:token}
GetRequest(global_domain_config, getUrlParams('/authorized_inventory/search', params)).then(res => {
dispatch(setOrganization(R.pathOr([], ['data', 'organizations'])(res)))
})
}
}
export function setOrganization(organizations) {
return {
type: SET_ORGANIZATION,
organizations
}
} }
\ No newline at end of file
...@@ -9,7 +9,8 @@ import { ...@@ -9,7 +9,8 @@ import {
SELF_SUBMIT_SUCCESS, SELF_SUBMIT_SUCCESS,
SELF_SUBMIT_FAILURE, SELF_SUBMIT_FAILURE,
SELF_INIT_DATA, SELF_INIT_DATA,
SET_SELECT_PRODUCT_OPTS SET_SELECT_PRODUCT_OPTS,
SET_LEND_ORDER_VALUES
} from '../base/ActionTypes'; } from '../base/ActionTypes';
import local_inter_mock from '../containers/selfOrder/module/mock/inter_mock' import local_inter_mock from '../containers/selfOrder/module/mock/inter_mock'
import * as R from 'ramda' import * as R from 'ramda'
...@@ -415,4 +416,30 @@ export function setSelectProductOpts(data) { ...@@ -415,4 +416,30 @@ export function setSelectProductOpts(data) {
*/ */
export async function requestSurgeryType(global_domain_config, params) { export async function requestSurgeryType(global_domain_config, params) {
return await GetRequest(global_domain_config, getUrlParams(`/inventory/category/search`, params)) return await GetRequest(global_domain_config, getUrlParams(`/inventory/category/search`, params))
} }
\ No newline at end of file
/**
* @description: 请求临调订单各种显示
* @param {*}
* @return {*}
*/
export function getLendOrderCodeValues() {
return (dispatch, getState) => {
let {global_domain_config, token} = getState().login
const params = {
access_token: token,
value_set_code: 'OBS_MOBILE_LEND_ORDER'
}
GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params)).then(res => {
const values = R.pathOr([], ['data', 'sys_values'])(res)
dispatch(setLendOrderCodeValues(values))
})
}
}
export function setLendOrderCodeValues(values) {
return {
type: SET_LEND_ORDER_VALUES,
values
}
}
/*
* @FilePath: /BoneHouse_Business_APP/app/action/SettlementAction.js
* @Author: peii
* @Date: 2021-12-21 16:30:41
* @LastEditTime: 2022-01-07 16:52:23
* @LastEditors: peii
* @Vision: 1.0
* @Description: 结算模块 action
*/
import { SET_SETTLEMENT_STATUS, SET_INVOICE_STATUS, SET_AR_INVOICE_STATUS } from '../base/ActionTypes'
import * as R from 'ramda'
import { GetRequest } from '../network/RequestUtils'
import { getUrlParams } from '../utils/Utils'
const settlementStatus = [
{ value_code: 'APPROVED', value_name: '已审批' },
{ value_code: 'CANCELED', value_name: '已取消' },
{ value_code: 'ENTERED', value_name: '已创建' },
{ value_code: 'INVOICED', value_name: '已开票' },
{ value_code: 'RECEIVED', value_name: '已收款' },
{ value_code: 'REJECTED', value_name: '已拒绝' },
{ value_code: 'SETTLED', value_name: '已结算' },
{ value_code: 'SUBMITTED', value_name: '已提交' },
]
const invoiceStatus = [
{ value_code: 'ENTERED', value_name: '未申请' },
{ value_code: 'INVOICING', value_name: '开票中' },
{ value_code: 'INVOICED', value_name: '已开票' },
]
const arInvoiceStatus = [
{ value_code: 'ENTERED', value_name: '已创建' },
{ value_code: 'SUBMITTED', value_name: '已提交' },
{ value_code: 'INVOICED', value_name: '已开票' },
{ value_code: 'INVALID', value_name: '已作废' },
{ value_code: 'CANCELED', value_name: '已取消' },
]
/**
* @description: 请求结算状态
* @param {*}
* @return {*}
*/
export const getSettlementStatus = () => {
return (dispatch, getState) => {
let { global_domain_config, token } = getState().login
const params = {
access_token: token,
value_set_code: 'SAL_SETTLEMENT_HEADER_STATUS',
}
GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params)).then(res => {
const values = R.pathOr(settlementStatus, ['data', 'sys_values'])(res)
return dispatch(setSettlementStatus(values))
})
}
}
export function setSettlementStatus(valueSets) {
return {
type: SET_SETTLEMENT_STATUS,
values: valueSets,
}
}
export const getInvoiceStatus = () => {
return (dispatch, getState) => {
let { global_domain_config, token } = getState().login
const params = {
access_token: token,
value_set_code: 'SUR_CONSUME_INVOICE_HEADER_STATUS',
}
GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params)).then(res => {
const values = R.pathOr(invoiceStatus, ['data', 'sys_values'])(res)
return dispatch(setInvoiceStatus(values))
})
}
}
export function setInvoiceStatus(values) {
return {
type: SET_INVOICE_STATUS,
values,
}
}
export const getArInvoiceStatus = () => {
return (dispatch, getState) => {
let { global_domain_config, token } = getState().login
const params = {
access_token: token,
value_set_code: 'AR_INVOICE_HEADER_STATUS',
}
GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params)).then(res => {
const values = R.pathOr(arInvoiceStatus, ['data', 'sys_values'])(res)
return dispatch(setArInvoiceStatus(values))
})
}
}
export function setArInvoiceStatus(values) {
return {
type: SET_AR_INVOICE_STATUS,
values,
}
}
/*
* @FilePath: /BoneHouse_Business_APP/app/base/ActionTypes.js
* @Author: peii
* @Date: 2022-01-04 10:18:02
* @LastEditTime: 2022-01-11 21:06:24
* @LastEditors: PEII
* @Vision: 1.0
* @Description:
*/
//-----------user--------------------------- //-----------user---------------------------
export const LOGIN_NO = "LOGIN_NO" export const LOGIN_NO = "LOGIN_NO"
export const LOGIN_DOING = "LOGIN_DOING" export const LOGIN_DOING = "LOGIN_DOING"
...@@ -11,6 +20,8 @@ export const SET_DOMAIN_FROM_ORIGIN = 'SET_DOMAIN_FROM_ORIGIN' ...@@ -11,6 +20,8 @@ export const SET_DOMAIN_FROM_ORIGIN = 'SET_DOMAIN_FROM_ORIGIN'
export const SET_VERSION_APK="SET_VERSION_APK" export const SET_VERSION_APK="SET_VERSION_APK"
export const GET_SYSPROFILE = "GET_SYSPROFILE" export const GET_SYSPROFILE = "GET_SYSPROFILE"
export const SET_SYSPROFILE = "SET_SYSPROFILE" export const SET_SYSPROFILE = "SET_SYSPROFILE"
export const SET_NAVIGATION = "SET_NAVIGATION"
export const SET_ORGANIZATION = "SET_ORGANIZATION"
//-----------self order--------------------- //-----------self order---------------------
export const SELF_ORDER_LIST_NO = "SELF_ORDER_LIST_NO" export const SELF_ORDER_LIST_NO = "SELF_ORDER_LIST_NO"
export const SELF_ORDER_LIST_DOING = "SELF_ORDER_LIST_DOING" export const SELF_ORDER_LIST_DOING = "SELF_ORDER_LIST_DOING"
...@@ -22,6 +33,7 @@ export const SELF_SUBMIT_SUCCESS = "SELF_SUBMIT_SUCCESS" ...@@ -22,6 +33,7 @@ export const SELF_SUBMIT_SUCCESS = "SELF_SUBMIT_SUCCESS"
export const SELF_SUBMIT_FAILURE = "SELF_SUBMIT_FAILURE" export const SELF_SUBMIT_FAILURE = "SELF_SUBMIT_FAILURE"
export const SELF_INIT_DATA = "SELF_INIT_DATA" export const SELF_INIT_DATA = "SELF_INIT_DATA"
export const SET_SELECT_PRODUCT_OPTS = "SET_SELECT_PRODUCT_OPTS" export const SET_SELECT_PRODUCT_OPTS = "SET_SELECT_PRODUCT_OPTS"
export const SET_LEND_ORDER_VALUES = "SET_LEND_ORDER_VALUES"
//-----------quick order--------------------- //-----------quick order---------------------
export const QUICK_ORDER_LIST_NO = "QUICK_ORDER_LIST_NO" export const QUICK_ORDER_LIST_NO = "QUICK_ORDER_LIST_NO"
export const QUICK_ORDER_LIST_DOING = "QUICK_ORDER_LIST_DOING" export const QUICK_ORDER_LIST_DOING = "QUICK_ORDER_LIST_DOING"
...@@ -66,3 +78,8 @@ export const DEVICE_INFORMATION_UPDATE_NO = "DEVICE_INFORMATION_UPDATE_NO" ...@@ -66,3 +78,8 @@ export const DEVICE_INFORMATION_UPDATE_NO = "DEVICE_INFORMATION_UPDATE_NO"
export const DEVICE_INFORMATION_UPDATE_DOING = "DEVICE_INFORMATION_UPDATE_DOING" export const DEVICE_INFORMATION_UPDATE_DOING = "DEVICE_INFORMATION_UPDATE_DOING"
export const DEVICE_INFORMATION_UPDATE_SUCCESS = "DEVICE_INFORMATION_UPDATE_SUCCESS" export const DEVICE_INFORMATION_UPDATE_SUCCESS = "DEVICE_INFORMATION_UPDATE_SUCCESS"
export const DEVICE_INFORMATION_UPDATE_FAILURE = "DEVICE_INFORMATION_UPDATE_FAILURE" export const DEVICE_INFORMATION_UPDATE_FAILURE = "DEVICE_INFORMATION_UPDATE_FAILURE"
//-----------settlement information---------------------
export const SET_SETTLEMENT_STATUS = 'SET_SETTLEMENT_STATUS'
export const SET_INVOICE_STATUS = 'SET_INVOICE_STATUS'
export const SET_AR_INVOICE_STATUS = 'SET_AR_INVOICE_STATUS'
\ No newline at end of file
/*
* @FilePath: /BoneHouse_Business_APP/app/reducers/index.js
* @Author: peii
* @Date: 2021-02-03 20:59:10
* @LastEditTime: 2021-12-21 16:57:13
* @LastEditors: peii
* @Vision: 1.0
* @Description:
*/
import storage from 'redux-persist/es/storage'; import storage from 'redux-persist/es/storage';
import {persistReducer} from 'redux-persist'; import {persistReducer} from 'redux-persist';
import login from './module/login'; import login from './module/login';
...@@ -7,6 +16,7 @@ import equip from './module/equip'; ...@@ -7,6 +16,7 @@ import equip from './module/equip';
import histor from './module/histor'; import histor from './module/histor';
import trans from './module/trans'; import trans from './module/trans';
import deviceInfo from './module/deviceInfo'; import deviceInfo from './module/deviceInfo';
import settlement from './module/settlement';
const loginConfig = { const loginConfig = {
key: 'login', key: 'login',
...@@ -57,6 +67,13 @@ const deviceConfig = { ...@@ -57,6 +67,13 @@ const deviceConfig = {
blackList: [] blackList: []
} }
const settlementConfig = {
key: 'settlement',
storage,
debug: false,
blackList: []
}
const rootReducer = { const rootReducer = {
login: persistReducer(loginConfig,login), login: persistReducer(loginConfig,login),
selfOrder: persistReducer(selfConfig,selfOrder), selfOrder: persistReducer(selfConfig,selfOrder),
...@@ -65,6 +82,7 @@ const rootReducer = { ...@@ -65,6 +82,7 @@ const rootReducer = {
histor: persistReducer(historConfig, histor), histor: persistReducer(historConfig, histor),
trans: persistReducer(transConfig, trans), trans: persistReducer(transConfig, trans),
deviceInfo: persistReducer(deviceConfig, deviceInfo), deviceInfo: persistReducer(deviceConfig, deviceInfo),
settlement: persistReducer(settlementConfig, settlement),
} }
export default rootReducer; export default rootReducer;
\ No newline at end of file
...@@ -9,7 +9,9 @@ import { ...@@ -9,7 +9,9 @@ import {
SET_DOMAIN_CONFIGURATE, SET_DOMAIN_CONFIGURATE,
SET_VERSION_APK, SET_VERSION_APK,
SET_DOMAIN_FROM_ORIGIN, SET_DOMAIN_FROM_ORIGIN,
SET_SYSPROFILE SET_SYSPROFILE,
SET_NAVIGATION,
SET_ORGANIZATION
} from '../../base/ActionTypes'; } from '../../base/ActionTypes';
// 登录状态 // 登录状态
...@@ -22,12 +24,14 @@ const defaultState = { ...@@ -22,12 +24,14 @@ const defaultState = {
global_domain_config: 'https://obs.uat.guke.tech', global_domain_config: 'https://obs.uat.guke.tech',
hasSetDomainFromOrigin: false, hasSetDomainFromOrigin: false,
local_version_apk: '', local_version_apk: '',
navigation: null,
sysProfiles: { sysProfiles: {
OBS_SHOW_ORG_FLAG: 'Y', OBS_SHOW_ORG_FLAG: 'Y',
SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG: 'Y', SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG: 'Y',
SUR_MOBILE_INV_PRODUCT_LINE_CATEGORY_FLAG: 0, SUR_MOBILE_INV_PRODUCT_LINE_CATEGORY_FLAG: 0,
OBS_MOBILE_APP_TITLE: '骨科智慧仓' OBS_MOBILE_APP_TITLE: '骨科智慧仓'
} },
organizations: []
} }
// 默认sysProfile,放state里时,会被持久化影响后面更新不了 // 默认sysProfile,放state里时,会被持久化影响后面更新不了
...@@ -92,6 +96,16 @@ export default login = (state = defaultState, action) => { ...@@ -92,6 +96,16 @@ export default login = (state = defaultState, action) => {
[action.code]: action.value [action.code]: action.value
} }
}) })
case SET_NAVIGATION:
return Object.assign({}, state, {
navigation: action.navigation
})
case SET_ORGANIZATION:
return Object.assign({}, state, {
organizations: action.organizations
})
default: // need this for default case default: // need this for default case
return state return state
} }
......
/*
* @FilePath: /BoneHouse_Business_APP/app/reducers/module/selfOrder.js
* @Author: peii
* @Date: 2021-02-03 20:59:10
* @LastEditTime: 2022-01-06 10:43:33
* @LastEditors: peii
* @Vision: 1.0
* @Description:
*/
import { import {
SELF_ORDER_LIST_NO, SELF_ORDER_LIST_NO,
SELF_ORDER_LIST_DOING, SELF_ORDER_LIST_DOING,
...@@ -8,7 +17,8 @@ import { ...@@ -8,7 +17,8 @@ import {
SELF_SUBMIT_SUCCESS, SELF_SUBMIT_SUCCESS,
SELF_SUBMIT_FAILURE, SELF_SUBMIT_FAILURE,
SELF_INIT_DATA, SELF_INIT_DATA,
SET_SELECT_PRODUCT_OPTS SET_SELECT_PRODUCT_OPTS,
SET_LEND_ORDER_VALUES
} from '../../base/ActionTypes'; } from '../../base/ActionTypes';
// 自助下单状态 // 自助下单状态
...@@ -17,6 +27,7 @@ const defaultState = { ...@@ -17,6 +27,7 @@ const defaultState = {
submit_self_order_status: SELF_SUBMIT_NO, // 提交订单状态 submit_self_order_status: SELF_SUBMIT_NO, // 提交订单状态
selfOrderOption: {}, // 当前临时存储数据 selfOrderOption: {}, // 当前临时存储数据
local_sele_pro_options: {}, // 选择产品临时存储 local_sele_pro_options: {}, // 选择产品临时存储
lend_order_value_profiles: []
} }
export default selfOrder = (state = defaultState, action) => { export default selfOrder = (state = defaultState, action) => {
...@@ -59,6 +70,10 @@ export default selfOrder = (state = defaultState, action) => { ...@@ -59,6 +70,10 @@ export default selfOrder = (state = defaultState, action) => {
return Object.assign({}, state, { return Object.assign({}, state, {
local_sele_pro_options: action.rawData local_sele_pro_options: action.rawData
}) })
case SET_LEND_ORDER_VALUES:
return Object.assign({}, state, {
lend_order_value_profiles: action.values
})
default: default:
return state; return state;
} }
......
/*
* @FilePath: /BoneHouse_Business_APP/app/reducers/module/settlement.js
* @Author: peii
* @Date: 2021-12-21 16:52:11
* @LastEditTime: 2022-01-07 16:43:26
* @LastEditors: peii
* @Vision: 1.0
* @Description: 结算
*/
import { SET_SETTLEMENT_STATUS, SET_INVOICE_STATUS, SET_AR_INVOICE_STATUS } from '../../base/ActionTypes'
const defaultState = {
headerStatus: [],
invoiceHeaderStatus: [],
arInvoiceHeaderStatus: []
}
export default (state = defaultState, action) => {
switch (action.type) {
case SET_SETTLEMENT_STATUS:
return Object.assign({}, state, {
headerStatus: action.values,
})
case SET_INVOICE_STATUS:
return Object.assign({}, state, {
invoiceHeaderStatus: action.values,
})
case SET_AR_INVOICE_STATUS:
return Object.assign({}, state, {
arInvoiceHeaderStatus: action.values,
})
default:
return state
}
}
...@@ -21,9 +21,12 @@ const reducers = persistCombineReducers(config,rootReducer); ...@@ -21,9 +21,12 @@ const reducers = persistCombineReducers(config,rootReducer);
const enhances = [applyMiddleware(...middleWares)]; const enhances = [applyMiddleware(...middleWares)];
export default function configureStore(initialState) { function configureStore(initialState) {
const store = createStore(reducers,initialState,compose(...enhances)); const store = createStore(reducers,initialState,compose(...enhances));
persistStore(store); //暂时磁盘保存数据 persistStore(store); //暂时磁盘保存数据
return store return store
} }
const store = configureStore()
export default store
\ No newline at end of file
...@@ -63,7 +63,7 @@ const screenH = Dimensions.get('window').height; ...@@ -63,7 +63,7 @@ const screenH = Dimensions.get('window').height;
export const isIphoneX = () => { export const isIphoneX = () => {
return ( return (
Platform.OS === 'ios' && Platform.OS === 'ios' &&
screenH >= 728 screenH > 736
) )
}; };
...@@ -325,3 +325,27 @@ export const showErrorMessage = (dispatch, err, errorCallback, logTit) => { ...@@ -325,3 +325,27 @@ export const showErrorMessage = (dispatch, err, errorCallback, logTit) => {
export const isBlank = R.anyPass([R.isNil, R.isEmpty]) export const isBlank = R.anyPass([R.isNil, R.isEmpty])
export const isNotBlank = R.complement(isBlank) export const isNotBlank = R.complement(isBlank)
/**
* @description: 解释显示及必填
* @param {*}
* @return {object} {show: boolean, required: boolean}
*/
export const decodeDisplayProfiles = R.curry((codeValues, code) => {
if (isBlank(codeValues)) return { show: false }
const values = R.find(R.propEq('value_code', code))(codeValues);
if (isBlank(values)) return {show: false}
return {
show: R.includes(R.prop('value_tag')(values), ['2', '3']),
required: R.includes(R.prop('value_tag')(values), ['3']),
}
})
export const getCodeValue = R.curry((codeValues, code) => {
if (isBlank(codeValues)) return
const values = R.find(R.propEq('value_code', code))(codeValues);
if (isBlank(values)) return
return {value: values.value_tag, label: values.value_desc}
})
\ No newline at end of file
...@@ -5,13 +5,24 @@ ...@@ -5,13 +5,24 @@
* @format * @format
*/ */
module.exports = { const { getDefaultConfig } = require('metro-config')
transformer: {
getTransformOptions: async () => ({ module.exports = (async () => {
transform: { const {
experimentalImportSupport: false, resolver: { sourceExts },
inlineRequires: false, } = await getDefaultConfig()
}, return {
}), transformer: {
}, babelTransformerPath: require.resolve('react-native-stylus-transformer'),
}; getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
resolver: {
sourceExts: [...sourceExts, 'styl'],
},
}
})()
...@@ -13,8 +13,10 @@ ...@@ -13,8 +13,10 @@
"@react-native-community/segmented-control": "^2.2.2", "@react-native-community/segmented-control": "^2.2.2",
"@react-native-community/slider": "^3.0.3", "@react-native-community/slider": "^3.0.3",
"@types/ramda": "^0.27.39", "@types/ramda": "^0.27.39",
"dayjs": "^1.10.7",
"lodash.debounce": "^4.0.8", "lodash.debounce": "^4.0.8",
"moment": "2.29.1", "moment": "2.29.1",
"querystring": "^0.2.1",
"ramda": "^0.27.1", "ramda": "^0.27.1",
"react": "16.8.3", "react": "16.8.3",
"react-native": "0.59.9", "react-native": "0.59.9",
...@@ -39,13 +41,25 @@ ...@@ -39,13 +41,25 @@
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.4.5", "@babel/core": "^7.4.5",
"@babel/plugin-transform-runtime": "^7.13.10",
"@babel/runtime": "^7.4.5", "@babel/runtime": "^7.4.5",
"@types/jest": "^26.0.22",
"@types/ramda": "^0.27.39",
"@types/react": "^17.0.3",
"@types/react-native": "^0.64.2",
"@types/react-test-renderer": "^17.0.1",
"babel-jest": "^24.8.0", "babel-jest": "^24.8.0",
"babel-plugin-module-resolver": "^4.1.0",
"jest": "^24.8.0", "jest": "^24.8.0",
"jetifier": "^1.6.6", "jetifier": "^1.6.6",
"metro-react-native-babel-preset": "^0.54.1", "metro-react-native-babel-preset": "^0.54.1",
"react-native-gesture-handler": "1.0.5", "react-native-gesture-handler": "1.0.5",
"react-test-renderer": "16.8.3" "react-native-postcss-transformer": "^1.2.4",
"react-native-stylus-transformer": "^1.2.0",
"react-test-renderer": "16.8.3",
"reflect-metadata": "^0.1.13",
"stylus": "^0.54.8",
"typescript": "^4.2.4"
}, },
"jest": { "jest": {
"preset": "react-native" "preset": "react-native"
......
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 sign in to comment