Commit 216735c5 by peii

iosp demo

parent d4f47d88
Showing with 538 additions and 33 deletions
......@@ -77,7 +77,7 @@ project.ext.react = [
entryFile: "index.js"
]
//apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
......@@ -194,6 +194,7 @@ static def releaseTime() {
dependencies {
implementation project(':rn-fetch-blob')
implementation project(':react-native-fs')
implementation project(':react-native-webview')
implementation project(':react-native-date-picker')
implementation project(':react-native-image-picker')
implementation project(':react-native-camera')
......
......@@ -13,6 +13,7 @@ import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.zmxv.RNSound.RNSoundPackage;
import com.rnim.rn.audio.ReactNativeAudioPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
......@@ -42,6 +43,7 @@ public class MainApplication extends Application implements ReactApplication {
new CodePush(getResources().getString(R.string.CodePushDeploymentKey), getApplicationContext(), BuildConfig.DEBUG),
new RNFetchBlobPackage(),
new RNFSPackage(),
new RNCWebViewPackage(),
new DatePickerPackage(),
new ImagePickerPackage(),
new RNCameraPackage(),
......
......@@ -17,4 +17,4 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.useAndroidX = true
android.enableJetifier = true
\ No newline at end of file
android.enableJetifier = true
......@@ -19,5 +19,7 @@ include ':react-native-audio'
project(':react-native-audio').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-audio/android')
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
include ':react-native-webview'
project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android')
include ':app'
// TODO: 不能提交或提交前改回BoneHouse_Business_APP
{
"name": "BoneHouse_Business_APP",
"displayName": "BoneHouse_Business_APP"
......
......@@ -39,11 +39,11 @@
984643DE248120A5000A6140 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 984643DD248120A5000A6140 /* Launch Screen.storyboard */; };
98EFB98B25BE775600D1817E /* RNToolsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 98EFB98A25BE775600D1817E /* RNToolsManager.m */; };
A32499D5AE884F6F872774E4 /* libRNGestureHandler-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A3D4AB90D45046B6BFE7C6D9 /* libRNGestureHandler-tvOS.a */; };
AB42783627158C0A0029943C /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
AB5CF7B125F35664008DF3C6 /* libSplashScreen.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 98464320248115E6000A6140 /* libSplashScreen.a */; };
AB5CF7B225F3568D008DF3C6 /* libRNAudio.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ECD74ED82474DDFC005B4208 /* libRNAudio.a */; };
ABC09E612715988900707A18 /* libRNCWebView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AB427835271580C70029943C /* libRNCWebView.a */; };
ABDDF166261577F5009E84C3 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
ABE237BE2719893C0066B54E /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
ABFEE38D25F36AC400727C35 /* libCodePush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ABB463F125F0C45400F9E705 /* libCodePush.a */; };
ABFEE38E25F36AE800727C35 /* libRNFetchBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9867E22025BED25B00C29E9D /* libRNFetchBlob.a */; };
ABFEE44225F37BE200727C35 /* libRNGestureHandler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ECD74ECB2474DDFC005B4208 /* libRNGestureHandler.a */; };
......@@ -511,7 +511,7 @@
files = (
ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */,
ABDDF166261577F5009E84C3 /* libReact.a in Frameworks */,
AB42783627158C0A0029943C /* libRCTBlob.a in Frameworks */,
ABE237BE2719893C0066B54E /* libRCTBlob.a in Frameworks */,
11D1A2F320CAFA9E000508D9 /* libRCTAnimation.a in Frameworks */,
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,
......@@ -1722,7 +1722,7 @@
CODEPUSH_KEY = "";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1.2.13;
CURRENT_PROJECT_VERSION = 1.3.1;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 2BWXWUS2NV;
FRAMEWORK_SEARCH_PATHS = "";
......@@ -1756,7 +1756,7 @@
"$(SRCROOT)/../node_modules/react-native-splash-screen/ios/build/**",
"$(SRCROOT)/../node_modules/react-native/**",
);
MARKETING_VERSION = 1.2.11;
MARKETING_VERSION = 1.3.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
......@@ -1778,7 +1778,7 @@
CODEPUSH_KEY = "PanMvkUOw_lNr2S5F-LG0nzMjj0Mo49v-wxeWm";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1.2.13;
CURRENT_PROJECT_VERSION = 1.3.1;
DEVELOPMENT_TEAM = 2BWXWUS2NV;
FRAMEWORK_SEARCH_PATHS = "";
HEADER_SEARCH_PATHS = (
......@@ -1811,7 +1811,7 @@
"$(SRCROOT)/../node_modules/react-native-splash-screen/ios/build/**",
"$(SRCROOT)/../node_modules/react-native/**",
);
MARKETING_VERSION = 1.2.11;
MARKETING_VERSION = 1.3.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
......@@ -2163,7 +2163,7 @@
CODEPUSH_KEY = "0Jf6O1u52LayZPBbWMss7v-AZStc-LBdjjw9j";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1.2.13;
CURRENT_PROJECT_VERSION = 1.3.1;
DEVELOPMENT_TEAM = 2BWXWUS2NV;
HEADER_SEARCH_PATHS = (
"$(inherited)/**",
......@@ -2195,7 +2195,7 @@
"$(SRCROOT)/../node_modules/react-native-splash-screen/ios/build/**",
"$(SRCROOT)/../node_modules/react-native/**",
);
MARKETING_VERSION = 1.2.11;
MARKETING_VERSION = 1.3.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
......
......@@ -78,7 +78,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......
{
"name": "BoneHouse_Business_APP",
"version": "1.2.6",
"version": "1.3.0",
"private": true,
"scripts": {
"postinstall": "npx jetify",
......
......@@ -5,7 +5,8 @@
background primary_color
&-bar
height header_height
// height header_height
height 0
padding 0 20px
@extend .row
@extend .center
......
......@@ -9,7 +9,7 @@ import styles from './header.styl'
const store = container.get(TYPES.SysStore)
function header({ title, backgroundColor = primary_color, back = true, backCallback = () => {} }) {
function header({ title, backgroundColor = '#ffffff', back = true, backCallback = () => {} }) {
const [statusHeight, setStatusHeight] = useState(20)
useEffect(() => {
......
/*
* @FilePath: /BoneHouse_Business_APP/src/pages/iosp/analyse.tsx
* @Author: peii
* @Date: 2021-10-15 15:35:32
* @LastEditTime: 2021-10-15 17:20:57
* @LastEditors: peii
* @Vision: 1.0
* @Description: 首页
*/
// @ts-nocheck
import React, { Component } from 'react'
import { View, Text, TouchableOpacity, Image, ScrollView, RefreshControl } from 'react-native'
import { WebView } from 'react-native-webview'
import { observer, inject } from 'mobx-react'
import Header from '../../components/header/header'
import { g } from '../../utils/utils'
import Control from './control'
import styles from './index.styl'
type IProps = {
url: string
navigation: INavigation
}
const uri = 'https://qingflow.com/dashboard/4bf76bb4/view'
class IOSPAnalyse extends Component<IProps> {
state = {
canGoBack: false,
canGoForward: false,
loading: false,
target: 27,
title: 'Order',
}
goBack() {
this.web.goBack()
}
goForward() {
this.web.goForward()
}
render() {
return (
<View style={g(styles, 'container')}>
<Header
title=""
backCallback={() => {
this.props.navigation.goBack()
}}
/>
<WebView
source={{ uri }}
style={g(styles, 'webview')}
onNavigationStateChange={state => {
this.setState({ ...state })
}}
ref={ref => (this.web = ref)}
/>
<Control goBack={this.goBack.bind(this)} goForward={this.goForward.bind(this)} {...this.state} />
</View>
)
}
}
export default inject('store', 'userStore')(observer(IOSPAnalyse))
/*
* @FilePath: /BoneHouse_Business_APP/src/pages/iosp/apply.tsx
* @Author: peii
* @Date: 2021-10-15 15:35:32
* @LastEditTime: 2021-10-15 17:19:01
* @LastEditors: peii
* @Vision: 1.0
* @Description: 首页
*/
// @ts-nocheck
import React, { Component } from 'react'
import { View, Text, TouchableOpacity, Image, ScrollView, RefreshControl } from 'react-native'
import { WebView } from 'react-native-webview'
import { observer, inject } from 'mobx-react'
import Header from '../../components/header/header'
import { g } from '../../utils/utils'
import Control from './control'
import styles from './index.styl'
type IProps = {
url: string
navigation: INavigation
}
const uri = 'https://qingflow.com/f/3dccd04e'
class IOSPOrderApply extends Component<IProps> {
state = {
canGoBack: false,
canGoForward: false,
loading: false,
target: 27,
title: 'Order',
}
goBack() {
this.web.goBack()
}
goForward() {
this.web.goForward()
}
render() {
return (
<View style={g(styles, 'container')}>
<Header
title=""
backCallback={() => {
this.props.navigation.goBack()
}}
/>
<WebView
source={{ uri }}
style={g(styles, 'webview')}
onNavigationStateChange={state => {
this.setState({ ...state })
}}
ref={ref => (this.web = ref)}
/>
<Control goBack={this.goBack.bind(this)} goForward={this.goForward.bind(this)} {...this.state} />
</View>
)
}
}
export default inject('store', 'userStore')(observer(IOSPOrderApply))
/*
* @FilePath: /BoneHouse_Business_APP/src/pages/iosp/bill.tsx
* @Author: peii
* @Date: 2021-10-15 15:35:32
* @LastEditTime: 2021-10-15 17:32:46
* @LastEditors: peii
* @Vision: 1.0
* @Description: 首页
*/
// @ts-nocheck
import React, { Component } from 'react'
import { View } from 'react-native'
import { WebView } from 'react-native-webview'
import { observer, inject } from 'mobx-react'
import Header from '../../components/header/header'
import { g } from '../../utils/utils'
import Control from './control'
import styles from './index.styl'
type IProps = {
url: string
navigation: INavigation
}
const uri = 'https://qingflow.com/f/2047d6e1/result;type=8'
class IOSPBill extends Component<IProps> {
state = {
canGoBack: false,
canGoForward: false,
}
componentDidMount() {}
componentDidUpdate(nextProps: IProps) {
console.log(nextProps)
}
goBack() {
this.web.goBack()
}
goForward() {
this.web.goForward()
}
render() {
return (
<View style={g(styles, 'container')}>
<Header
title=""
backCallback={() => {
this.props.navigation.goBack()
}}
/>
<WebView
source={{ uri }}
style={g(styles, 'webview')}
onNavigationStateChange={state => {
this.setState({ ...state })
}}
ref={ref => (this.web = ref)}
/>
<Control goBack={this.goBack.bind(this)} goForward={this.goForward.bind(this)} {...this.state} />
</View>
)
}
}
export default inject('store', 'userStore')(observer(IOSPBill))
@import '../../assets/styles/base.styl'
@import '../../assets/styles/variable.styl'
.ctrl
&-bar
@extend .row
height 50px
border-top-color #ccc
border-top-width 1px
align-items center
justify-content space-around
&-img
width 20px
height @width
\ No newline at end of file
/*
* @FilePath: /BoneHouse_Business_APP/src/pages/iosp/control.tsx
* @Author: peii
* @Date: 2021-10-15 16:42:08
* @LastEditTime: 2021-10-15 23:53:35
* @LastEditors: peii
* @Vision: 1.0
* @Description: 控制条
*/
// @ts-nocheck
import React, { Component } from 'react'
import { View, Image, TouchableOpacity, Platform, PlatformColor } from 'react-native'
import * as R from 'ramda'
import { g } from '../../utils/utils'
import styles from './control.styl'
type IProps = {
canGoBack: boolean
canGoForward: boolean
goBack: Function
goForward: Function
}
class Control extends Component<IProps> {
render() {
const { canGoForward, canGoBack } = this.props
return (
<View style={g(styles, 'ctrl')}>
{((Platform.OS === 'ios' && R.or(canGoForward, canGoBack)) || Platform.OS === 'android') && (
<View style={g(styles, 'ctrl-bar')}>
<TouchableOpacity
onPress={() => {
if (Platform.OS === 'ios') {
canGoBack && this.props.goBack()
} else {
this.props.goBack()
}
}}
>
<Image
source={canGoBack ? require('../../assets/iosp/back.png') : require('../../assets/iosp/back_def.png')}
style={g(styles, 'ctrl-img')}
/>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
if (Platform.OS === 'ios') {
canGoForward && this.props.goForward()
} else {
this.props.goForward()
}
}}
>
<Image
source={
canGoForward ? require('../../assets/iosp/forward.png') : require('../../assets/iosp/forward_def.png')
}
style={g(styles, 'ctrl-img')}
/>
</TouchableOpacity>
</View>
)}
</View>
)
}
}
export default Control
@import '../../assets/styles/base.styl'
@import '../../assets/styles/variable.styl'
/*
* @FilePath: /BoneHouse_Business_APP/src/pages/iosp/index.tsx
* @Author: peii
* @Date: 2021-10-15 15:35:32
* @LastEditTime: 2021-10-15 23:47:38
* @LastEditors: peii
* @Vision: 1.0
* @Description: 首页
*/
// @ts-nocheck
import React, { Component } from 'react'
import { View, Text, TouchableOpacity, Image, ScrollView, RefreshControl } from 'react-native'
import { WebView } from 'react-native-webview'
import { observer, inject } from 'mobx-react'
import slashScreen from 'react-native-splash-screen'
import Control from './control'
import Header from '../../components/header/header'
import { g } from '../../utils/utils'
import styles from './index.styl'
type IProps = {
url: string
navigation: INavigation
}
const uri = 'https://qingflow.com/f/3dccd04e/result;type=1'
class IOSPIndex extends Component<IProps> {
state = {
canGoBack: false,
canGoForward: false,
loading: false,
target: 27,
title: 'Order',
}
componentDidMount() {
slashScreen.hide()
}
goBack() {
this.web.goBack()
}
goForward() {
this.web.goForward()
}
render() {
return (
<View style={g(styles, 'container')}>
<Header
title=""
backCallback={() => {
this.props.navigation.goBack()
}}
/>
<WebView
source={{ uri }}
style={g(styles, 'webview')}
onNavigationStateChange={state => {
this.setState({ ...state })
}}
ref={ref => (this.web = ref)}
/>
<Control goBack={this.goBack.bind(this)} goForward={this.goForward.bind(this)} {...this.state} />
</View>
)
}
}
export default inject('store', 'userStore')(observer(IOSPIndex))
/*
* @FilePath: /BoneHouse_Business_APP/src/pages/iosp/order.tsx
* @Author: peii
* @Date: 2021-10-15 15:35:32
* @LastEditTime: 2021-10-15 17:19:30
* @LastEditors: peii
* @Vision: 1.0
* @Description: 首页
*/
// @ts-nocheck
import React, { Component } from 'react'
import { View, Text, TouchableOpacity, Image, ScrollView, RefreshControl } from 'react-native'
import { WebView } from 'react-native-webview'
import { observer, inject } from 'mobx-react'
import Header from '../../components/header/header'
import { g } from '../../utils/utils'
import Control from './control'
import styles from './index.styl'
type IProps = {
url: string
navigation: INavigation
}
const uri = 'https://qingflow.com/tag/864818/app/3dccd04e/list/7'
class IOSPOrder extends Component<IProps> {
state = {
canGoBack: false,
canGoForward: false,
loading: false,
target: 27,
title: 'Order',
}
goBack() {
this.web.goBack()
}
goForward() {
this.web.goForward()
}
render() {
return (
<View style={g(styles, 'container')}>
<Header
title=""
backCallback={() => {
this.props.navigation.goBack()
}}
/>
<WebView
source={{ uri }}
style={g(styles, 'webview')}
onNavigationStateChange={state => {
this.setState({ ...state })
}}
ref={ref => (this.web = ref)}
/>
<Control goBack={this.goBack.bind(this)} goForward={this.goForward.bind(this)} {...this.state} />
</View>
)
}
}
export default inject('store', 'userStore')(observer(IOSPOrder))
......@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/webview/webview.tsx
* @Author: peii
* @Date: 2021-10-12 14:19:38
* @LastEditTime: 2021-10-12 18:46:44
* @LastEditTime: 2021-10-15 16:19:02
* @LastEditors: peii
* @Vision: 1.0
* @Description: webview 页面
......@@ -24,8 +24,6 @@ type IProps = {
class Webview extends Component<IProps> {
render() {
const url = this.props.url
return (
<View style={g(styles, 'container')}>
<Header
......@@ -34,7 +32,7 @@ class Webview extends Component<IProps> {
this.props.navigation.goBack()
}}
/>
<WebView source={{ uri: 'https://qingflow.com/f/4659bdc7' }} style={g(styles, 'webview')} />
<WebView source={{ uri: 'https://qingflow.com/f/3dccd04e/result;type=1' }} style={g(styles, 'webview')} />
</View>
)
}
......
......@@ -24,6 +24,12 @@ import PackageDetail from './pages/order/productions/details/package'
import Success from './pages/success/success'
import WebView from './pages/webview/webview'
import IOSPIndex from './pages/iosp/index'
import IOSPOrder from './pages/iosp/order'
import IOSPOrderApply from './pages/iosp/apply'
import IOSPAnalyse from './pages/iosp/analyse'
import IOSPBill from './pages/iosp/bill'
function createNavigator() {
const options = {
navigationOptions: {
......@@ -57,27 +63,88 @@ function createNavigator() {
const TabNavigator = createMaterialTopTabNavigator(
{
Home: {
screen: Home,
// Home: {
// screen: Home,
// navigationOptions: {
// tabBarLabel: '业务',
// tabBarIcon: ({ focused }) => (
// <Image
// source={focused ? require('../app/images/tab_mod_sel.png') : require('../app/images/tab_mod_def.png')}
// />
// ),
// },
// },
// Mine: {
// screen: Mine,
// navigationOptions: {
// tabBarLabel: '我',
// tabBarIcon: ({ focused }) => (
// <Image
// style={{ width: 20, height: 20 }}
// source={
// focused ? require('./assets/images/tab_mine_sel.png') : require('./assets/images/tab_mine_def.png')
// }
// />
// ),
// },
// },
My: {
screen: IOSPIndex,
navigationOptions: {
tabBarLabel: '我的',
tabBarIcon: ({ focused }) => (
<Image
style={{ width: 26, height: 26 }}
source={focused ? require('./assets/iosp/my_sel.png') : require('./assets/iosp/my_def.png')}
/>
),
},
},
Order: {
screen: IOSPOrder,
navigationOptions: {
tabBarLabel: '订单',
tabBarIcon: ({ focused }) => (
<Image
style={{ width: 26, height: 26 }}
source={focused ? require('./assets/iosp/order_sel.png') : require('./assets/iosp/order_def.png')}
/>
),
},
},
Apply: {
screen: IOSPOrderApply,
navigationOptions: {
tabBarLabel: '下单',
tabBarIcon: ({ focused }) => (
<Image
style={{ width: 26, height: 26 }}
source={focused ? require('./assets/iosp/apply_sel.png') : require('./assets/iosp/apply_def.png')}
/>
),
},
},
Analyse: {
screen: IOSPAnalyse,
navigationOptions: {
tabBarLabel: '业务',
tabBarLabel: '分析',
tabBarIcon: ({ focused }) => (
<Image
source={focused ? require('../app/images/tab_mod_sel.png') : require('../app/images/tab_mod_def.png')}
style={{ width: 26, height: 26 }}
source={focused ? require('./assets/iosp/analyse_sel.png') : require('./assets/iosp/analyse_def.png')}
/>
),
},
},
Mine: {
screen: Mine,
Bill: {
screen: IOSPBill,
navigationOptions: {
tabBarLabel: '',
tabBarLabel: '账单',
tabBarIcon: ({ focused }) => (
<Image
style={{ width: 20, height: 20 }}
source={
focused ? require('./assets/images/tab_mine_sel.png') : require('./assets/images/tab_mine_def.png')
}
style={{ width: 26, height: 26 }}
source={focused ? require('./assets/iosp/bill_sel.png') : require('./assets/iosp/bill_def.png')}
/>
),
},
......@@ -85,8 +152,9 @@ function createNavigator() {
},
{
tabBarPosition: 'bottom',
swipeEnabled: true,
swipeEnabled: false,
animationEnabled: true,
lazy: true,
tabBarOptions: {
style: {
height: isIphoneX() ? 90 : 65,
......
......@@ -5952,7 +5952,7 @@ react-native-splash-screen@3.2.0:
react-native-stylus-transformer@^1.2.0:
version "1.2.0"
resolved "https://registry.npm.taobao.org/react-native-stylus-transformer/download/react-native-stylus-transformer-1.2.0.tgz#5e12a7dba5fc75fb2cafc300793fc2a43232a7af"
resolved "https://r.cnpmjs.org/react-native-stylus-transformer/download/react-native-stylus-transformer-1.2.0.tgz#5e12a7dba5fc75fb2cafc300793fc2a43232a7af"
integrity sha1-XhKn26X8dfssr8MAeT/CpDIyp68=
dependencies:
css-to-react-native-transform "^1.8.1"
......
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