@@ -20,6 +20,8 @@ import DeviceInfo from "react-native-device-info"; | |||
import * as Animatable from 'react-native-animatable'; | |||
import Swiper from 'react-native-swiper'; | |||
import Carousel from 'react-native-snap-carousel'; | |||
import {BoxShadow} from 'react-native-shadow'; | |||
var testMac = 'FF:FF:FF:FF:FF:FF' | |||
var curAdIndex = 0; | |||
var errorMsg = { | |||
@@ -55,6 +57,17 @@ var animationThemes = [ | |||
third:"bounceInRight" | |||
} | |||
] | |||
const shadowOpt = { | |||
width: 700/PixelRatio.get(), | |||
height: 240/PixelRatio.get(), | |||
color:"#000", | |||
border:2, | |||
radius:3, | |||
opacity:0.5, | |||
x:0, | |||
y:3, | |||
style:{marginVertical:5} | |||
} | |||
var curTimer = null; | |||
@@ -135,7 +148,6 @@ export default class MyPage extends Component { | |||
} | |||
componentDidUpdate() { | |||
console.log(PixelRatio.get()) | |||
/* console.log(this.refs.scrollView) | |||
if (this.refs.scrollView != undefined) { | |||
var ScrollView = this.refs.scrollView; | |||
@@ -203,7 +215,6 @@ codePushStatusDidChange(syncStatus) { | |||
// 列表滚动 | |||
updateContent() { | |||
console.log(curAdIndex) | |||
if (adDataList.length <=0) | |||
return false; | |||
@@ -382,7 +393,7 @@ async routine() { | |||
if (this.state.adType == 2) { | |||
if (pageChangeCount<=0) { | |||
let curNum = this.state.curAdType02Index + 1; | |||
if (curNum >= adDataList.length) { | |||
if (curNum >= adDataBgList.length) { | |||
curNum = 0; | |||
} | |||
this.setState({ | |||
@@ -392,6 +403,7 @@ async routine() { | |||
pageChangeCount = heartConfig.pageChangeInterval | |||
} | |||
} else if (this.state.adType == 0) { | |||
if (pageChangeCount <= 0) { //页面切换间隔 | |||
if (this.state.contentDisplayStatus && this.state.baseInfo) { | |||
@@ -545,7 +557,9 @@ setSwiperItemDom(item) { | |||
actionText = '扫码领取'; | |||
} | |||
return ( | |||
<ImageBackground style={styles.contentItemTopForAd} resizeMode="stretch" key={index} source={require('./image/item-background.png')}> | |||
<BoxShadow setting={shadowOpt}> | |||
<View style={styles.contentItemTopForAd} key={index}> | |||
{/* <ImageBackground style={styles.adTypeSwiper02} resizeMode="stretch" source={require('./image/item-background.png')}></ImageBackground> */} | |||
<Image source={{uri: contentItem.coverImg}} resizeMode='cover' style={styles.adTypeItemImg} /> | |||
<View style={styles.contentItemTopDetail}> | |||
@@ -570,7 +584,8 @@ setSwiperItemDom(item) { | |||
</View> | |||
</ImageBackground> | |||
</View> | |||
</BoxShadow> | |||
) | |||
} | |||
renderAdTypeSwiper() { | |||
@@ -641,7 +656,7 @@ getAdView(){ | |||
</ImageBackground> | |||
); | |||
} else if (this.state.adType == 2) { | |||
let curWidthNum = 1080/(PixelRatio.get()) | |||
let curWidthNum = 700/(PixelRatio.get()) | |||
return ( | |||
// <ImageBackground style={styles.adTypeBg} source={require('./image/ad1.jpg')}> | |||
<ImageBackground style={styles.adTypeBg} resizeMode="stretch" source={{ uri: this.state.curCoverImgUrl}}> | |||
@@ -1056,7 +1071,7 @@ MyPage = CodePush(codePushOptions)(MyPage); | |||
textAlign :'left', | |||
color:"black", | |||
textAlignVertical:'center', | |||
fontSize: 53/PixelRatio.get(), | |||
fontSize: 42/PixelRatio.get(), | |||
}, | |||
/* | |||
contentItemTopDetailRemark:{ | |||
@@ -1101,7 +1116,7 @@ MyPage = CodePush(codePushOptions)(MyPage); | |||
contentItemTopDetailCurPriceStr02:{ | |||
backgroundColor:'transparent', | |||
fontSize:96/PixelRatio.get(), | |||
fontSize:72/PixelRatio.get(), | |||
fontFamily:"PingFangSC-Bold", | |||
fontWeight: "bold", | |||
textAlign :'left', | |||
@@ -1167,6 +1182,7 @@ MyPage = CodePush(codePushOptions)(MyPage); | |||
textAlign :'left', | |||
fontSize: 27/PixelRatio.get(), | |||
textDecorationLine: 'line-through', | |||
marginTop: 14/PixelRatio.get(), | |||
color : 'gray' | |||
}, | |||
@@ -1178,6 +1194,8 @@ MyPage = CodePush(codePushOptions)(MyPage); | |||
}, | |||
adTypeSwiper02:{ | |||
flex: 1, | |||
alignItems: 'center', | |||
position: 'absolute', | |||
left: 0, | |||
bottom: 165/PixelRatio.get(), | |||
@@ -1194,10 +1212,10 @@ MyPage = CodePush(codePushOptions)(MyPage); | |||
}, | |||
adTypeItemImg:{ | |||
width: 275/PixelRatio.get(), | |||
height: 275/PixelRatio.get(), | |||
marginLeft: 50/PixelRatio.get(), | |||
marginTop: 30/PixelRatio.get(), | |||
width: 200/PixelRatio.get(), | |||
height: 200/PixelRatio.get(), | |||
marginLeft: 8/PixelRatio.get(), | |||
marginTop: 20/PixelRatio.get(), | |||
borderRadius:27/PixelRatio.get(), | |||
backgroundColor:'transparent' | |||
}, | |||
@@ -1215,15 +1233,15 @@ MyPage = CodePush(codePushOptions)(MyPage); | |||
contentItemTopForAd:{ | |||
flex: 1, | |||
width: 1080/PixelRatio.get(), | |||
width: 700/PixelRatio.get(), | |||
// width: '100%', | |||
height:'100%', | |||
paddingLeft: 22/PixelRatio.get(), | |||
paddingLeft: 12/PixelRatio.get(), | |||
paddingRight: 26/PixelRatio.get(), | |||
flexDirection: 'row', | |||
alignItems: 'flex-start', | |||
borderRadius: 6, | |||
backgroundColor:'transparent', | |||
backgroundColor:'#fff', | |||
}, | |||
onlyAdSwiperItem:{ | |||
@@ -0,0 +1,17 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<projectDescription> | |||
<name>screenAd</name> | |||
<comment>Project android created by Buildship.</comment> | |||
<projects> | |||
</projects> | |||
<buildSpec> | |||
<buildCommand> | |||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name> | |||
<arguments> | |||
</arguments> | |||
</buildCommand> | |||
</buildSpec> | |||
<natures> | |||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature> | |||
</natures> | |||
</projectDescription> |
@@ -0,0 +1,2 @@ | |||
connection.project.dir= | |||
eclipse.preferences.version=1 |
@@ -0,0 +1,6 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<classpath> | |||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/> | |||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/> | |||
<classpathentry kind="output" path="bin/default"/> | |||
</classpath> |
@@ -0,0 +1,23 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<projectDescription> | |||
<name>app</name> | |||
<comment>Project app created by Buildship.</comment> | |||
<projects> | |||
</projects> | |||
<buildSpec> | |||
<buildCommand> | |||
<name>org.eclipse.jdt.core.javabuilder</name> | |||
<arguments> | |||
</arguments> | |||
</buildCommand> | |||
<buildCommand> | |||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name> | |||
<arguments> | |||
</arguments> | |||
</buildCommand> | |||
</buildSpec> | |||
<natures> | |||
<nature>org.eclipse.jdt.core.javanature</nature> | |||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature> | |||
</natures> | |||
</projectDescription> |
@@ -0,0 +1,2 @@ | |||
connection.project.dir=.. | |||
eclipse.preferences.version=1 |
@@ -181,12 +181,14 @@ android { | |||
} | |||
dependencies { | |||
implementation project(':react-native-svg') | |||
implementation project(':react-native-camera') | |||
implementation project(':react-native-device-info') | |||
implementation project(':react-native-code-push') | |||
implementation fileTree(dir: "libs", include: ["*.jar"]) | |||
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" | |||
implementation "com.facebook.react:react-native:+" // From node_modules | |||
implementation project(':react-native-svg') | |||
} | |||
// Run this once to be able to run the application with BUCK | |||
@@ -3,6 +3,7 @@ package com.screenad; | |||
import android.app.Application; | |||
import com.facebook.react.ReactApplication; | |||
import com.horcrux.svg.SvgPackage; | |||
import org.reactnative.camera.RNCameraPackage; | |||
import com.facebook.react.bridge.ReactApplicationContext; | |||
@@ -37,6 +38,7 @@ public class MainApplication extends Application implements ReactApplication { | |||
protected List<ReactPackage> getPackages() { | |||
return Arrays.<ReactPackage>asList( | |||
new MainReactPackage(), | |||
new SvgPackage(), | |||
new RNCameraPackage(), | |||
new RNBuildConfigPackage(), | |||
new RNDeviceInfo(), | |||
@@ -1,4 +1,6 @@ | |||
rootProject.name = 'screenAd' | |||
include ':react-native-svg' | |||
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android') | |||
include ':react-native-camera' | |||
project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android') | |||
include ':react-native-device-info' | |||
@@ -7,3 +9,5 @@ include ':react-native-code-push' | |||
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app') | |||
include ':app' | |||
include ':react-native-svg' | |||
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android') |
@@ -45,6 +45,8 @@ | |||
59D20E8E9CD64A01B87A3AC0 /* libRNDeviceInfo-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22D705AD40EF415A95C31652 /* libRNDeviceInfo-tvOS.a */; }; | |||
D240C4819F1E4B80BB6D7BEE /* libRNCamera.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F8C0E0ED2BA401B9075C9F3 /* libRNCamera.a */; }; | |||
BA9EAC9D8E144D058AC73DD2 /* libRNFetchBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 99C586CF88164E08936AF0C0 /* libRNFetchBlob.a */; }; | |||
B4144D9AB571435787D52BFB /* libRNSVG.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C56D91B66FA473E89F6B165 /* libRNSVG.a */; }; | |||
C109232BD2434156AC1DB82B /* libRNSVG-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA6B0CF8B7494E2E82C54C57 /* libRNSVG-tvOS.a */; }; | |||
/* End PBXBuildFile section */ | |||
/* Begin PBXContainerItemProxy section */ | |||
@@ -362,6 +364,9 @@ | |||
4F8C0E0ED2BA401B9075C9F3 /* libRNCamera.a */ = {isa = PBXFileReference; name = "libRNCamera.a"; path = "libRNCamera.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; | |||
BE5C3F5DA65B4EFC83BEC512 /* RNFetchBlob.xcodeproj */ = {isa = PBXFileReference; name = "RNFetchBlob.xcodeproj"; path = "../node_modules/react-native-fetch-blob/ios/RNFetchBlob.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; | |||
99C586CF88164E08936AF0C0 /* libRNFetchBlob.a */ = {isa = PBXFileReference; name = "libRNFetchBlob.a"; path = "libRNFetchBlob.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; | |||
D6E9CCF6747C429FACC9C9EE /* RNSVG.xcodeproj */ = {isa = PBXFileReference; name = "RNSVG.xcodeproj"; path = "../node_modules/react-native-svg/ios/RNSVG.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; | |||
9C56D91B66FA473E89F6B165 /* libRNSVG.a */ = {isa = PBXFileReference; name = "libRNSVG.a"; path = "libRNSVG.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; | |||
DA6B0CF8B7494E2E82C54C57 /* libRNSVG-tvOS.a */ = {isa = PBXFileReference; name = "libRNSVG-tvOS.a"; path = "libRNSVG-tvOS.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; | |||
/* End PBXFileReference section */ | |||
/* Begin PBXFrameworksBuildPhase section */ | |||
@@ -395,6 +400,7 @@ | |||
FEBB7F68D5534228A6A832AD /* libRNDeviceInfo.a in Frameworks */, | |||
D240C4819F1E4B80BB6D7BEE /* libRNCamera.a in Frameworks */, | |||
BA9EAC9D8E144D058AC73DD2 /* libRNFetchBlob.a in Frameworks */, | |||
B4144D9AB571435787D52BFB /* libRNSVG.a in Frameworks */, | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
@@ -412,6 +418,7 @@ | |||
2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */, | |||
2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */, | |||
59D20E8E9CD64A01B87A3AC0 /* libRNDeviceInfo-tvOS.a in Frameworks */, | |||
C109232BD2434156AC1DB82B /* libRNSVG-tvOS.a in Frameworks */, | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
@@ -590,6 +597,7 @@ | |||
C6058A0BC9054E0394045AC4 /* RNDeviceInfo.xcodeproj */, | |||
0F57B32024664223A7D6E682 /* RNCamera.xcodeproj */, | |||
BE5C3F5DA65B4EFC83BEC512 /* RNFetchBlob.xcodeproj */, | |||
D6E9CCF6747C429FACC9C9EE /* RNSVG.xcodeproj */, | |||
); | |||
name = Libraries; | |||
sourceTree = "<group>"; | |||
@@ -1219,6 +1227,8 @@ | |||
"$(inherited)", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
); | |||
HEADER_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
@@ -1226,6 +1236,7 @@ | |||
"$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", | |||
"$(SRCROOT)\..\node_modules\react-native-camera\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-fetch-blob\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-svg\ios/**", | |||
); | |||
}; | |||
name = Debug; | |||
@@ -1249,6 +1260,8 @@ | |||
"$(inherited)", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
); | |||
HEADER_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
@@ -1256,6 +1269,7 @@ | |||
"$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", | |||
"$(SRCROOT)\..\node_modules\react-native-camera\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-fetch-blob\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-svg\ios/**", | |||
); | |||
}; | |||
name = Release; | |||
@@ -1282,6 +1296,7 @@ | |||
"$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", | |||
"$(SRCROOT)\..\node_modules\react-native-camera\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-fetch-blob\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-svg\ios/**", | |||
); | |||
}; | |||
name = Debug; | |||
@@ -1307,6 +1322,7 @@ | |||
"$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", | |||
"$(SRCROOT)\..\node_modules\react-native-camera\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-fetch-blob\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-svg\ios/**", | |||
); | |||
}; | |||
name = Release; | |||
@@ -1338,6 +1354,8 @@ | |||
"$(inherited)", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
); | |||
HEADER_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
@@ -1345,6 +1363,7 @@ | |||
"$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", | |||
"$(SRCROOT)\..\node_modules\react-native-camera\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-fetch-blob\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-svg\ios/**", | |||
); | |||
}; | |||
name = Debug; | |||
@@ -1376,6 +1395,8 @@ | |||
"$(inherited)", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
); | |||
HEADER_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
@@ -1383,6 +1404,7 @@ | |||
"$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", | |||
"$(SRCROOT)\..\node_modules\react-native-camera\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-fetch-blob\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-svg\ios/**", | |||
); | |||
}; | |||
name = Release; | |||
@@ -1413,6 +1435,8 @@ | |||
"$(inherited)", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
); | |||
HEADER_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
@@ -1420,6 +1444,7 @@ | |||
"$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", | |||
"$(SRCROOT)\..\node_modules\react-native-camera\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-fetch-blob\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-svg\ios/**", | |||
); | |||
}; | |||
name = Debug; | |||
@@ -1450,6 +1475,8 @@ | |||
"$(inherited)", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
"\"$(SRCROOT)/$(TARGET_NAME)\"", | |||
); | |||
HEADER_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
@@ -1457,6 +1484,7 @@ | |||
"$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", | |||
"$(SRCROOT)\..\node_modules\react-native-camera\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-fetch-blob\ios/**", | |||
"$(SRCROOT)\..\node_modules\react-native-svg\ios/**", | |||
); | |||
}; | |||
name = Release; | |||
@@ -13,7 +13,9 @@ | |||
"react-native-camera": "^1.12.0", | |||
"react-native-code-push": "^5.6.0", | |||
"react-native-device-info": "^2.1.2", | |||
"react-native-shadow": "^1.2.2", | |||
"react-native-snap-carousel": "^3.8.0", | |||
"react-native-svg": "^9.6.2", | |||
"react-native-swiper": "^1.5.14", | |||
"rn-fetch-blob": "^0.10.15" | |||
}, | |||