Parcourir la source

[动画][修改]:[修改动画]

tags/jenkins-front-end-screenad-90-v64^0
meo il y a 6 ans
Parent
révision
7f3641bf1d
1 fichiers modifiés avec 22 ajouts et 36 suppressions
  1. +22
    -36
      App.js

+ 22
- 36
App.js Voir le fichier

@@ -56,9 +56,9 @@ var animationThemes = [
third:"slideInRight" third:"slideInRight"
}, },
{ {
first:"fadeInDownBig",
second:"fadeInLeftBig",
third:"fadeInRightBig"
first:"fadeIn",
second:"fadeIn",
third:"fadeIn"
}, },
{ {
first:"zoomInDown", first:"zoomInDown",
@@ -83,7 +83,7 @@ export default class MyPage extends Component {
contentItem2:null, contentItem2:null,
animationTheme:{}, animationTheme:{},
heartConfig:{ heartConfig:{
heartbeatInterval:1000*60*5,
heartbeatInterval:1000 * 5,
dataRefreshInterval:1000*60*60, dataRefreshInterval:1000*60*60,
pageChangeInterval:1000*10, pageChangeInterval:1000*10,
}, },
@@ -160,37 +160,38 @@ codePushStatusDidChange(syncStatus) {
+encodeURIComponent(this.state.macAddress), +encodeURIComponent(this.state.macAddress),
{version:this.state.versionInfo}) {version:this.state.versionInfo})
.then(result => { .then(result => {
let config = JSON.parse(result.data.config);
this.setState({ this.setState({
heartConfig:{ heartConfig:{
heartbeatInterval:JSON.parse(result.data.config).heartbeatInterval,
dataRefreshInterval:JSON.parse(result.data.config).dataRefreshInterval,
pageChangeInterval:JSON.parse(result.data.config).pageChangeInterval
heartbeatInterval:config.heartbeatInterval,
dataRefreshInterval:config.dataRefreshInterval,
pageChangeInterval:config.pageChangeInterval
} }
}) })
// 动画 // 动画
// this.setState({
// animationTheme:animationThemes[2]
// })
if(JSON.parse(result.data.config).animationThem == 0){
if(config.animationTheme == 0){
this.setState({ this.setState({
animationTheme:animationThemes[0] animationTheme:animationThemes[0]
}) })
}else if(JSON.parse(result.data.config).animationThem == 1){
}else if(config.animationTheme == 1){
this.setState({ this.setState({
animationTheme:animationThemes[1] animationTheme:animationThemes[1]
}) })
}else if(JSON.parse(result.data.config).animationThem == 2){
}else if(config.animationTheme == 2){
this.setState({ this.setState({
animationTheme:animationThemes[2] animationTheme:animationThemes[2]
}) })
}else if(JSON.parse(result.data.config).animationThem == 3){
}else if(config.animationTheme == 3){
this.setState({ this.setState({
animationTheme:animationThemes[3] animationTheme:animationThemes[3]
}) })
} }
}) })
.catch(error => { .catch(error => {
this.setState({ errorMessage : ERR_HEARTBEAT});
console.warn(error)
this.setState({ errorMessage : error});
}) })
} }


@@ -271,8 +272,7 @@ componentDidMount() {
startAd() { startAd() {
this.getBaseInfo() this.getBaseInfo()
this.hbRequest() this.hbRequest()
setInterval(
()=>{
setInterval(()=>{
if (this.state.contentDisplayStatus) { if (this.state.contentDisplayStatus) {
this.setState({ contentDisplayStatus: false}) this.setState({ contentDisplayStatus: false})
if (this.updateContent()) { if (this.updateContent()) {
@@ -285,26 +285,20 @@ startAd() {
}, },
//页面切换间隔 //页面切换间隔
this.state.heartConfig.pageChangeInterval this.state.heartConfig.pageChangeInterval
// 1000*10, //10秒更新一下页面
); );
setInterval(
()=>{
setInterval(()=>{
this.getAdDataList() this.getAdDataList()
}, },
// 数据获取间隔 // 数据获取间隔
this.state.heartConfig.dataRefreshInterval this.state.heartConfig.dataRefreshInterval
// 1000*60*60, //1小时一次
); );
setInterval(
()=>{
setInterval(()=>{
this.hbRequest() this.hbRequest()
}, },
// 心跳间隔 // 心跳间隔
this.state.heartConfig.heartbeatInterval this.state.heartConfig.heartbeatInterval
// 1000*60*5, //5分钟一次
); );
this.getAdDataList() this.getAdDataList()

} }


getContentViewItemUplayer(contentItem) { getContentViewItemUplayer(contentItem) {
@@ -350,17 +344,9 @@ getContentViewItem(contentItem, annomation) {
</View> </View>
) )


actionText = '扫码领取';
if (contentItem.target.type == 8)
actionText = '扫码砍价';
else if (contentItem.target.type == 9)
actionText = '扫码拼团';
merchantName = "";
if (contentItem.target.merchantVoList.length > 1)
merchantName = '多商户通用';
else
merchantName = contentItem.target.merchantVoList[0].merchantName;

actionText = this.getContentViewItemActionStr(contentItem);
merchantName = this.getContentViewItemMerchantName(contentItem);
// console.warn(annomation)
return ( return (
<Animatable.View animation={annomation} easing="ease-out" duration={1500} delay={500} useNativeDriver ={true} style={styles.contentItem}> <Animatable.View animation={annomation} easing="ease-out" duration={1500} delay={500} useNativeDriver ={true} style={styles.contentItem}>




Chargement…
Annuler
Enregistrer