diff --git a/App.js b/App.js
index 1b4bdc8..b577e4c 100644
--- a/App.js
+++ b/App.js
@@ -8,11 +8,11 @@ import React, { Component } from 'react';
Image,
Dimensions,
TouchableOpacity,
+ ImageBackground,
} from 'react-native';
//引用插件
import Package from './package.json'
-import Swiper from 'react-native-swiper';
import HttpUtils from './HttpUtils.js';
import CodePush from "react-native-code-push";
import DeviceInfo from "react-native-device-info";
@@ -25,11 +25,10 @@ export default class MyPage extends Component {
constructor(props) {
super(props);
this.state = {
- swiperShow: false,
text:'',
qrcode:[],
restartAllowed: true ,
- syncMessage: "我是小更新" ,
+ syncMessage: "syncMessage" ,
progress: false,
macAddress: "NULL"
};
@@ -109,39 +108,8 @@ codePushStatusDidChange(syncStatus) {
);
}
- // 轮播图
-renderBanner() {
- if (this.state.swiperShow) {
- console.log ('返回值' + this.state.swiperShow);
- return (
-
-
-
-
-
-
- );
-} else {
- return (
-
-
- {this.state.text}
-
- );
- }
-}
-
-get() {
+getBaseInfo() {
HttpUtils.get('https://mall.youlane.cn/api/wxDeviceScreenAd/list?deviceId=11%3AAA%3A33%3ABB%3A44&pageNum=1&pageSize=5')
.then(result => {
this.setState({
@@ -153,13 +121,7 @@ get() {
componentDidMount() {
-
- this.get()
- setTimeout(() => {
- this.setState({
- swiperShow: true,
- });
- }, 10000)
+ this.getBaseInfo()
}
@@ -168,101 +130,94 @@ render() {
if (this.state.progress) {
progressView = (
- {this.state.progress.receivedBytes} of {this.state.progress.totalBytes} bytes received
+ {this.state.progress.receivedBytes} of {this.state.progress.totalBytes} bytes received
);
}
return (
-
-
-
- 当前版本是:{Package.version}
-
-
-
- Mac:{this.state.macAddress}
-
-
- Name:{DeviceInfo.getApplicationName()}
-
-
-
- Press for background sync
-
-
-
- Press for dialog-driven sync
-
-
- {progressView}
-
-
- Restart { this.state.restartAllowed ? "allowed" : "forbidden"}
-
-
-
- Press for Update Metadata
-
-
-
- {this.state.syncMessage || ""}
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
);
-/*
-return (
-
- {this.renderBanner()}
-
-
- );
-*/
}
}
const styles = StyleSheet.create({
- container: {
- width:width,
- height:height,
- flex:1
+ container:{
+ flex: 1,
+ paddingLeft: 16,
+ paddingRight: 16
+ },
+ title:{
+ flex: 6,
+ flexDirection: 'row',
+ alignItems: 'center',
+ backgroundColor:'transparent'
+ },
+ content:{
+ flex: 18,
+ flexDirection: 'column',
+ alignItems: 'center',
+ backgroundColor:'transparent'
+ },
+ bottom:{
+ flex: 2,
+ flexDirection: 'row',
+ alignItems: 'center',
+ backgroundColor:'transparent'
+ },
+ titleImagePlace: {
+ flex: 2,
+ alignItems: 'center',
+ backgroundColor:'transparent'
},
- wrapper: {
- width:width,
- height:height,
- flex:1
+ titleImage: {
+ flex: 1,
+ alignItems:'center',
+ backgroundColor:'transparent'
},
- bannerImg: {
- width:width,
- height:height,
- flex:1
+ titleQrcode: {
+ flex: 1,
+ backgroundColor:'transparent'
},
- container: {
- flex: 1,
- alignItems: "center",
- backgroundColor: "#F5FCFF",
- paddingTop: 50
- },
- image: {
- margin: 30,
- width: Dimensions.get("window").width - 100,
- height: 365 * (Dimensions.get("window").width - 100) / 651,
- },
- messages: {
- marginTop: 30,
- textAlign: "center",
- },
- restartToggleButton: {
- color: "blue",
- fontSize: 17
- },
- syncButton: {
- color: "green",
- fontSize: 17
- },
- welcome: {
- fontSize: 20,
- textAlign: "center",
- margin: 20
- },
+ bottomLogo: {
+ flex: 2,
+ alignItems: 'center',
+ backgroundColor:'transparent'
+ },
+ bottomQrcode1: {
+ flex: 1,
+ alignItems: 'center',
+ backgroundColor:'transparent'
+ },
+ bottomQrcode2: {
+ flex: 1,
+ alignItems: 'center',
+ backgroundColor:'transparent'
+ },
+ bottomPlacehold: {
+ flex: 6,
+ alignItems: 'center',
+ backgroundColor:'transparent'
+ }
+
});
diff --git a/android/app/src/main/java/com/screenad/MainActivity.java b/android/app/src/main/java/com/screenad/MainActivity.java
index 7cbb030..4fadcf0 100644
--- a/android/app/src/main/java/com/screenad/MainActivity.java
+++ b/android/app/src/main/java/com/screenad/MainActivity.java
@@ -1,5 +1,10 @@
package com.screenad;
+import android.graphics.Color;
+import android.os.Build;
+import android.os.Bundle;
+import android.view.View;
+
import com.facebook.react.ReactActivity;
public class MainActivity extends ReactActivity {
@@ -8,6 +13,22 @@ public class MainActivity extends ReactActivity {
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
+
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ View decorView = getWindow().getDecorView();
+ int option = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ | View.SYSTEM_UI_FLAG_FULLSCREEN;
+ decorView.setSystemUiVisibility(option);
+ getWindow().setNavigationBarColor(Color.TRANSPARENT);
+ getWindow().setStatusBarColor(Color.TRANSPARENT);
+
+ }
+
@Override
protected String getMainComponentName() {
return "screenAd";
diff --git a/android/app/src/main/java/com/screenad/MainApplication.java b/android/app/src/main/java/com/screenad/MainApplication.java
index 10f04eb..9dcc76c 100644
--- a/android/app/src/main/java/com/screenad/MainApplication.java
+++ b/android/app/src/main/java/com/screenad/MainApplication.java
@@ -18,10 +18,10 @@ public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
- @Override
- protected String getJSBundleFile() {
- return CodePush.getJSBundleFile();
- }
+ @Override
+ protected String getJSBundleFile() {
+ return CodePush.getJSBundleFile();
+ }
@Override
public boolean getUseDeveloperSupport() {
@@ -33,8 +33,7 @@ public class MainApplication extends Application implements ReactApplication {
return Arrays.asList(
new MainReactPackage(),
new RNCameraPackage(),
- new RNDeviceInfo(),
- new CodePush(
+ new RNDeviceInfo(), new CodePush(
BuildConfig.CODEPUSH_KEY,
getApplicationContext(),
BuildConfig.DEBUG,
diff --git a/image/background.png b/image/background.png
new file mode 100644
index 0000000..178d87f
Binary files /dev/null and b/image/background.png differ
diff --git a/image/item-background.png b/image/item-background.png
new file mode 100644
index 0000000..f8c0944
Binary files /dev/null and b/image/item-background.png differ
diff --git a/image/logo.png b/image/logo.png
new file mode 100644
index 0000000..d703fc0
Binary files /dev/null and b/image/logo.png differ
diff --git a/image/page1.jpg b/image/page1.jpg
deleted file mode 100644
index 3211bd8..0000000
Binary files a/image/page1.jpg and /dev/null differ
diff --git a/image/page2.jpg b/image/page2.jpg
deleted file mode 100644
index 3211bd8..0000000
Binary files a/image/page2.jpg and /dev/null differ
diff --git a/image/page3.jpg b/image/page3.jpg
deleted file mode 100644
index 3211bd8..0000000
Binary files a/image/page3.jpg and /dev/null differ
diff --git a/image/page4.jpg b/image/page4.jpg
deleted file mode 100644
index 3211bd8..0000000
Binary files a/image/page4.jpg and /dev/null differ
diff --git a/image/test-l.png b/image/test-l.png
new file mode 100644
index 0000000..b0523f4
Binary files /dev/null and b/image/test-l.png differ
diff --git a/image/title-qrcode.png b/image/title-qrcode.png
new file mode 100644
index 0000000..b441a18
Binary files /dev/null and b/image/title-qrcode.png differ
diff --git a/image/title.png b/image/title.png
new file mode 100644
index 0000000..96134ec
Binary files /dev/null and b/image/title.png differ