소스 검색

【大屏】【添加】【商户排行】

tags/jenkins-front-end-screenad-299-v155^0
caserKing 5 년 전
부모
커밋
cd40e4bedc
7개의 변경된 파일168개의 추가작업 그리고 16개의 파일을 삭제
  1. +126
    -15
      App.js
  2. BIN
      image/hot_gold.png
  3. BIN
      image/hot_gray.png
  4. BIN
      image/star_gold.png
  5. BIN
      image/star_gray.png
  6. +40
    -0
      package-lock.json
  7. +2
    -1
      package.json

+ 126
- 15
App.js 파일 보기

@@ -22,6 +22,7 @@ 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';
import StarRatingBar from 'react-native-star-rating-view/StarRatingBar';

var testMac = 'FF:FF:FF:FF:FF:FF'
var curAdIndex = 0;
@@ -299,7 +300,7 @@ codePushStatusDidChange(syncStatus) {
adDataBgList = dataList.filter((item) => {
return item.type == 2;
})
//aaa
//
let num = 0;
if (adDataList.length > 0 && adDataBgList.length > 0) {
num = 2;
@@ -309,7 +310,18 @@ codePushStatusDidChange(syncStatus) {
} else if (!adDataList.length && adDataBgList.length > 0) {
num = 1;
}
this.setState({adType: num })
//aaa
// this.setState({adType: num })
this.setState({adType: 0 })
adDataList.map(item => {
item.starNum = 3.4;
item.logoUrl = item.coverImg;
item.merchantName = '小米之家';
})
adDataList = [...adDataList,...adDataList];
adDataList = adDataList.slice(0,5);
}

getAdDataList(first) {
@@ -321,7 +333,7 @@ codePushStatusDidChange(syncStatus) {
if (result.code != 200) {
this.showErrMsg(result.message+'\n'+this.state.macAddress);
} else if (result.data.list) {
//aaa
//
//type==0的是券 1是? 2是广告大图
let curData = result.data.list;
this.dealLoopType(curData);
@@ -475,7 +487,56 @@ getContentViewItemMerchantName(contentItem) {
return contentItem.target.merchantVoList[0].merchantName;
}
}
//排名 rank dom
renderRankDom() {
let rankDomStack = [];
adDataList.map((item) => {
rankDomStack.push(this.rankItemDom(item));
})
return rankDomStack;
}
//每一条 rank
rankItemDom(item) {
return (
<View style={styles.rankItemBox}>
{/* <ImageBackground source={require('./image/item-background.png')} resizeMode="stretch" style={styles.rankItemBg}> */}
<Image style={styles.RankLogo} resizeMode="stretch" source={{uri:item.logoUrl}}></Image>
<View style={styles.rankContent}>
<Text style={{fontWeight : 'bold'}}>{item.merchantName}</Text>
<View style={styles.rankRun}>
<Text>经营指数: {item.starNum} 分</Text>
<StarRatingBar
score={item.starNum}
allowsHalfStars={true}
accurateHalfStars={true}
emptyStarImage={<Image style={{width:16, height: 16}} source={require('./image/star_gray.png')} />}
filledStarImage={<Image style={{width:16, height: 16}} source={require('./image/star_gold.png')} />}
scoreTextStyle={{color:'#fff'}}
/>
</View>

<View style={styles.rankRun}>
<Text>人气指数: {item.starNum} 分</Text>
<StarRatingBar
score={item.starNum}
allowsHalfStars={true}
accurateHalfStars={true}
emptyStarImage={<Image style={{width:16, height: 16}} source={require('./image/hot_gray.png')} />}
filledStarImage={<Image style={{width:16, height: 16}} source={require('./image/hot_gold.png')} />}
scoreTextStyle={{color:'#fff'}}
/>
</View>
</View>
<Image source={{uri:item.target.qrCode}} resizeMode="stretch" style={styles.rankQrcodeImg}></Image>
{/* </ImageBackground> */}
</View>
)
}
//券列表content部分
getContentViewItem(contentItem, annomation) {
if (!contentItem)
return (
@@ -485,7 +546,7 @@ getContentViewItem(contentItem, annomation) {

actionText = this.getContentViewItemActionStr(contentItem);
merchantName = this.getContentViewItemMerchantName(contentItem);
//aaa
//
// contentItem.target.salePriceStr = 234005.8;
// console.warn(annomation)
let curNumStr = contentItem.target.salePriceStr+'';
@@ -536,17 +597,25 @@ getContentViewItem(contentItem, annomation) {

getContentView() {
if (this.state.contentDisplayStatus) {
return (<View style={styles.content}>
{this.getContentViewItem(this.state.contentItem0,this.state.animationTheme.first)}
{this.getContentViewItem(this.state.contentItem1,this.state.animationTheme.second)}
{this.getContentViewItem(this.state.contentItem2,this.state.animationTheme.third)}
</View>)
}else{
return (
<View style={styles.content}>
<Text style={styles.updatePage}>{this.state.errorMessage}</Text>
</View>)
//aaa
if (true) {
return (<View style={styles.content}>
{this.renderRankDom()}
</View>)
} else {
return (<View style={styles.content}>
{this.getContentViewItem(this.state.contentItem0,this.state.animationTheme.first)}
{this.getContentViewItem(this.state.contentItem1,this.state.animationTheme.second)}
{this.getContentViewItem(this.state.contentItem2,this.state.animationTheme.third)}
</View>)
}
}else{
return (
<View style={styles.content}>
<Text style={styles.updatePage}>{this.state.errorMessage}</Text>
</View>)
}
}
setAdSwiperItemDom(item) {
let contentItem = item.item;
@@ -568,7 +637,7 @@ setSwiperItemDom(item) {
if (contentItem.subType == 7)
curLogo = require('./image/groupbuy.png');
}
//aaa
//
// contentItem.target.salePriceStr = 24502228;
let curNumStr = contentItem.target.salePriceStr+'';
let curStyleObj = {};
@@ -1335,6 +1404,48 @@ MyPage = CodePush(codePushOptions)(MyPage);
backgroundColor: 'transparent',
alignItems: 'center',
},
//排名的列表样式
rankItemBox: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
width: '92%',
height: 260/PixelRatio.get(),
backgroundColor: '#fff',
borderRadius: 26/PixelRatio.get(),
marginTop: 20/PixelRatio.get(),
borderWidth: 1,
borderColor: 'green',
},

rankContent: {
marginLeft: 30/PixelRatio.get(),
},

rankItemBg: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
width: '100%',
height: 260/PixelRatio.get(),
borderWidth: 1,
borderColor: 'blue',
},

RankLogo: {
width: 220/PixelRatio.get(),
height: 220/PixelRatio.get(),
marginLeft: 30/PixelRatio.get(),
borderWidth: 1,
borderColor: 'yellow',
},

rankQrcodeImg: {
width: 220/PixelRatio.get(),
height: 220/PixelRatio.get(),
marginLeft: 10/PixelRatio.get(),
}

});

BIN
image/hot_gold.png 파일 보기

Before After
Width: 200  |  Height: 200  |  Size: 4.9 KiB

BIN
image/hot_gray.png 파일 보기

Before After
Width: 200  |  Height: 200  |  Size: 5.4 KiB

BIN
image/star_gold.png 파일 보기

Before After
Width: 200  |  Height: 200  |  Size: 5.2 KiB

BIN
image/star_gray.png 파일 보기

Before After
Width: 200  |  Height: 200  |  Size: 5.0 KiB

+ 40
- 0
package-lock.json 파일 보기

@@ -10108,6 +10108,14 @@
"react-addons-shallow-compare": "15.6.2"
}
},
"react-native-star-rating-view": {
"version": "0.0.12",
"resolved": "https://registry.npm.taobao.org/react-native-star-rating-view/download/react-native-star-rating-view-0.0.12.tgz",
"integrity": "sha1-heW8pPARabHPkVD4LdMnvUGT6r4=",
"requires": {
"react-native-vector-icons": "^4.0.0"
}
},
"react-native-svg": {
"version": "9.6.2",
"resolved": "https://registry.npm.taobao.org/react-native-svg/download/react-native-svg-9.6.2.tgz",
@@ -10121,6 +10129,38 @@
"prop-types": "^15.5.10"
}
},
"react-native-vector-icons": {
"version": "4.6.0",
"resolved": "https://registry.npm.taobao.org/react-native-vector-icons/download/react-native-vector-icons-4.6.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freact-native-vector-icons%2Fdownload%2Freact-native-vector-icons-4.6.0.tgz",
"integrity": "sha1-5AFDEf+m3jl9kU/8MbcJeodMyNU=",
"requires": {
"lodash": "^4.0.0",
"prop-types": "^15.5.10",
"yargs": "^8.0.2"
},
"dependencies": {
"yargs": {
"version": "8.0.2",
"resolved": "https://registry.npm.taobao.org/yargs/download/yargs-8.0.2.tgz?cache=0&sync_timestamp=1567812322754&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs%2Fdownload%2Fyargs-8.0.2.tgz",
"integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=",
"requires": {
"camelcase": "^4.1.0",
"cliui": "^3.2.0",
"decamelize": "^1.1.1",
"get-caller-file": "^1.0.1",
"os-locale": "^2.0.0",
"read-pkg-up": "^2.0.0",
"require-directory": "^2.1.1",
"require-main-filename": "^1.0.1",
"set-blocking": "^2.0.0",
"string-width": "^2.0.0",
"which-module": "^2.0.0",
"y18n": "^3.2.1",
"yargs-parser": "^7.0.0"
}
}
}
},
"react-proxy": {
"version": "1.1.8",
"resolved": "https://registry.npm.taobao.org/react-proxy/download/react-proxy-1.1.8.tgz",


+ 2
- 1
package.json 파일 보기

@@ -7,15 +7,16 @@
"test": "jest"
},
"dependencies": {
"code-push": "2.0.7",
"react": "16.8.3",
"react-native": "0.59.9",
"react-native-animatable": "^1.3.2",
"react-native-camera": "^1.12.0",
"code-push": "2.0.7",
"react-native-code-push": "5.6.1",
"react-native-device-info": "^2.1.2",
"react-native-shadow": "^1.2.2",
"react-native-snap-carousel": "^3.8.0",
"react-native-star-rating-view": "0.0.12",
"react-native-svg": "^9.6.2",
"react-native-swiper": "^1.5.14",
"rn-fetch-blob": "^0.10.15"


불러오는 중...
취소
저장