Commit dc08e48f by Denglingling

新增 APP 根据服务器版本号,自动更新下载(安卓可下载,IOS跳转到应用商店)

parent c1bff884
......@@ -33,33 +33,7 @@ class HomePage extends Component {
constructor(props) {
super(props)
this.state = {
showList: [
// {
// icon: require('../../images/quick_order.png'),
// title: '借货订单', // 原快速下单、手术报台
// page: 'QuickOrderPage',
// },
// {
// icon: require('../../images/self_order.png'),
// title: '自助下单',
// page: 'SelfOrderPage',
// },
// {
// icon: require('../../images/trans_order.png'),
// title: '转单申请', // 原转单
// page: 'TransOrderPage',
// },
// {
// icon: require('../../images/equip_consu.png'),
// title: '消耗确认', // 原器械消耗
// page: 'EquipConsuPage',
// },
// {
// icon: require('../../images/return_login.png'),
// title: '返回登录页',
// page: 'LoginPage',
// }
],
showList: [],
backLoginInfo: { // 不需要了
icon: require('../../images/return_login.png'),
title: '返回登录页',
......@@ -132,7 +106,7 @@ class HomePage extends Component {
hisDefauIcon, hisSeleIcon,
borrowInfo, consumpInfo,
transInfo, deviceInfo,
selfOrderInfo,backLoginInfo } = this.state
selfOrderInfo } = this.state
functions = referenceArrSort(functions, 'child_list', 'function_order')
let tempTabNames = []
let tempTabCodes = []
......@@ -166,7 +140,6 @@ class HomePage extends Component {
}
})
}
// tempModuleList.push(backLoginInfo) // 不用了
} else if(item.function_code == 'MOBILE_HISTORICAL_ORDER') {
tempTabIconNames.push(hisDefauIcon)
......@@ -225,7 +198,6 @@ class HomePage extends Component {
/>
<SafeAreaView style={safe_view}>
<HeadBackItem title={'骨科智慧仓'} navigation={navigation} isRightExit={isRightExit} />
<ScrollableTabView
style={styles.bom_tab_box}
initialPage={initialPage}
......@@ -317,7 +289,7 @@ const styles = StyleSheet.create({
fontFamily: font_family_regular
},
bom_tab_box: {
flex: 1
},
})
......
......@@ -27,13 +27,14 @@ import {
safe_view,
font_family_medium
} from '../../base/BaseStyle';
import { requestLogin, autoLogin, setDomainConfigurate } from '../../action/LoginAction';
import { requestLogin, autoLogin, setDomainConfigurate, setVersionApk } 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';
import UpgradeView from './module/UpgradeView';
class LoginPage extends Component{
constructor(props) {
......@@ -45,7 +46,8 @@ class LoginPage extends Component{
subTitList: ['登录', '登录中...'],
isSubLoding: false,
isShowDomain: false, // 域名填写
version_apk: 'V1.2.2'
version_apk: '',
isEnterHomeFlag: false
}
}
......@@ -53,6 +55,7 @@ class LoginPage extends Component{
SplashScreen.hide() //关闭启动屏幕
this.timer = setTimeout(() => {
this.getLocalUserName()
this.setVersion()
}, 300)
}
......@@ -100,7 +103,12 @@ class LoginPage extends Component{
// 设置版本号
setVersion() {
// NativeModules
NativeModules.RNToolsManager.getAppVersion((event)=>{
this.props.setVersionApk(event)
this.setState({
version_apk: event
})
})
}
// 判断是否打开域名弹窗
......@@ -197,6 +205,9 @@ class LoginPage extends Component{
// 进入首页
enterHomePage() {
this.setState({
isEnterHomeFlag: true
})
this.props.navigation.navigate('HomePage')
}
......@@ -222,7 +233,7 @@ class LoginPage extends Component{
}
render() {
let {username, password, isSubLoding, subTit, isShowDomain, version_apk} = this.state
let {username, password, isSubLoding, subTit, isShowDomain, version_apk, isEnterHomeFlag} = this.state
let {global_domain_config} = this.props
let tempInd = global_domain_config.indexOf('/') + 2
let tempGlobalDomain = global_domain_config.slice(tempInd)
......@@ -300,6 +311,7 @@ class LoginPage extends Component{
callback={(domainVal) => this.fillDomainCallBack(domainVal)}
domainValue={tempGlobalDomain}
/>
{ isEnterHomeFlag ? <UpgradeView version_apk={version_apk}/> : null}
</View>
</ImageBackground>
</SafeAreaView>
......@@ -462,7 +474,10 @@ const mapDispatchToProps = (dispatch) => ({
},
setDomainConfigurate: (domainVal) => {
dispatch(setDomainConfigurate(domainVal))
}
},
setVersionApk: (versionApk) => {
dispatch(setVersionApk(versionApk))
},
})
export default connect(mapStateToProps, mapDispatchToProps)(LoginPage)
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