Authored by QC-L

fix conflicts

... ... @@ -39,7 +39,7 @@ export default class ActivityOrderDetail extends Component {
<Text style={styles.contentText} numberOfLines={2}>{this.props.orderDetail.timeStr}</Text>
</View>
<View style={{flexDirection: 'row'}}>
<Text style={styles.contentText}>收益金额:</Text>
<Text style={styles.contentText}>佣金金额:</Text>
<Text style={[styles.contentText, {fontWeight: 'bold', color: '#D0021B'}]}>{this.props.orderDetail.amountStr}</Text>
</View>
<View style={{flexDirection: 'row'}}>
... ...
... ... @@ -91,9 +91,9 @@ export default class Data extends Component {
</TouchableOpacity>
<View style={{height: 10, backgroundColor: '#f0f0f0'}}/>
<TouchableOpacity activeOpacity={1} style={styles.withdrawView} onPress={() => {
this.props.jumpWithUrl && this.props.jumpWithUrl('订单收益', 'orderIncome');
this.props.jumpWithUrl && this.props.jumpWithUrl('全部佣金', 'orderIncome');
}}>
<Text style={styles.hasWithDrawText}>全部收入数据</Text>
<Text style={styles.hasWithDrawText}>全部佣金数据</Text>
<View style={[styles.textView, {flexDirection: 'row', paddingRight: 15}]}>
<Image style={styles.arrowImage} source={require('../images/arrow.png')}/>
</View>
... ...
... ... @@ -4,6 +4,7 @@ import React, {Component} from 'react';
import {DeviceEventEmitter, Dimensions, Image, ListView, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {Immutable} from "immutable";
import SingleImage from './floor/SingleImage';
import MineCell from './cell/MineCell';
import YH_Image from '../../common/components/YH_Image';
... ... @@ -55,15 +56,17 @@ export default class Mine extends Component {
<Image style={styles.arrowImage} source={require('../images/arrow.png')}/>
</View>
</TouchableOpacity>
<View style={{height: 10, backgroundColor: '#f0f0f0'}}/>
</View>
);
}
_renderRow(rowData, sectionID, rowID) {
return (
<SingleImage
data={rowData.get('data')}
<MineCell
resource={rowData.get('data')}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
styles={styles}
/>
);
}
... ... @@ -94,6 +97,7 @@ let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f0f0f0'
},
headerBackground: {
width: width,
... ...
... ... @@ -30,7 +30,7 @@ export default class OrderDetail extends Component {
<Text style={styles.contentText}>下单时间:{this.props.orderDetail.orderTimeStr}</Text>
<Text style={styles.contentText}>商品金额:{this.props.orderDetail.lastOrderAmountStr}</Text>
<View style={{flexDirection: 'row'}}>
<Text style={styles.contentText}>收益金额:</Text>
<Text style={styles.contentText}>佣金金额:</Text>
<Text style={[styles.contentText, {fontWeight: 'bold', color: '#D0021B'}]}>{this.props.orderDetail.amountStr}</Text>
<Text style={styles.contentText}>{status}</Text>
</View>
... ...
... ... @@ -37,7 +37,7 @@ export default class OrderIncome extends Component {
this.props.onPressTab && this.props.onPressTab(1, 0);
}}>
<View style={styles.headerContainer}>
<Text style={this.state.orderType === 1 ? styles.headerText : styles.headerText_unselect}>订单收入</Text>
<Text style={this.state.orderType === 1 ? styles.headerText : styles.headerText_unselect}>订单佣金</Text>
</View>
{this.state.orderType !== 1 ? null :
<View style={{alignItems: 'center'}}>
... ... @@ -50,7 +50,7 @@ export default class OrderIncome extends Component {
this.props.onPressTab && this.props.onPressTab(2, 0);
}}>
<View style={styles.headerContainer}>
<Text style={this.state.orderType === 2 ? styles.headerText : styles.headerText_unselect}>活动收入</Text>
<Text style={this.state.orderType === 2 ? styles.headerText : styles.headerText_unselect}>活动佣金</Text>
</View>
{this.state.orderType !== 2 ? null :
<View style={{alignItems: 'center'}}>
... ...
... ... @@ -43,12 +43,12 @@ class RankItem extends PureComponent {
return (
<View style={styles.itemContainer}>
<View style={styles.row}>
<Text style={styles.rank}>{rankNum}</Text>
<Text style={styles.rank} numberOfLines={1}>{rankNum}</Text>
{this._renderImage(image)}
<Text style={styles.name} numberOfLines={1}>{nickname}</Text>
<View style={styles.rightContainer}>
<Text style={styles.amount} numberOfLines={1}>{amountStr}</Text>
<Text style={styles.amountName}>{`${monthRank ? '本月' : '总'}预估收入`}</Text>
<Text style={styles.amountName}>{`${monthRank ? '本月' : '总'}预估佣金`}</Text>
</View>
</View>
</View>
... ... @@ -80,6 +80,7 @@ const styles = StyleSheet.create({
rank: {
fontSize: 18,
color: '#444444',
width: 23,
marginLeft: 18 * DEVICE_WIDTH_RATIO,
},
avatar: {
... ...
... ... @@ -168,7 +168,7 @@ const styles = StyleSheet.create({
borderColor: '#5d5d5d'
},
infoContainer: {
height: 97 * DEVICE_WIDTH_RATIO,
height: 122 * DEVICE_WIDTH_RATIO,
paddingTop: 15 * DEVICE_WIDTH_RATIO,
paddingHorizontal: 15 * DEVICE_WIDTH_RATIO,
},
... ... @@ -251,8 +251,8 @@ const styles = StyleSheet.create({
marginHorizontal: 8 * DEVICE_WIDTH_RATIO,
},
favorite: {
width: 18 * DEVICE_WIDTH_RATIO,
height: 18 * DEVICE_WIDTH_RATIO,
width: 21 * DEVICE_WIDTH_RATIO,
height: 21 * DEVICE_WIDTH_RATIO,
},
favText: {
fontSize: 9* DEVICE_WIDTH_RATIO,
... ...
... ... @@ -25,12 +25,12 @@ export default class Statistics extends Component {
<View style={styles.statisticsView}>
<View style={{width: width / 2, paddingLeft: 30}}>
<Text style={styles.numberText}>¥{statisticsInfo.orderAmountSum}</Text>
<Text style={styles.tipsText}>预估订单收入</Text>
<Text style={styles.tipsText}>预估订单佣金</Text>
</View>
<View style={styles.spaceView}/>
<View style={{width: width / 2, paddingLeft: 30}}>
<Text style={styles.numberText}>¥{statisticsInfo.extraAmountSum}</Text>
<Text style={styles.tipsText}>预估其他收入</Text>
<Text style={styles.tipsText}>预估其他佣金</Text>
</View>
</View>
<View style={styles.lineView}/>
... ...
... ... @@ -44,7 +44,7 @@ class TalentRank extends Component {
</View>
<View style={styles.myRankContainer}>
<View style={[styles.container, styles.leftContainer]}>
<Text style={styles.amountName}>{`${monthRank ? '本月' : '总'}预估收入`}</Text>
<Text style={styles.amountName}>{`${monthRank ? '本月' : '总'}预估佣金`}</Text>
<View style={styles.amountContainer}>
<Text style={[styles.amountUnit,styles.textLeft]}>¥</Text>
<Text style={[styles.amount,styles.textLeft]}>{amount}</Text>
... ...
... ... @@ -30,7 +30,7 @@ export default class WithdrawModal extends React.Component {
<View style={styles.modalView}>
<View style={styles.confirmTitleContainer}>
<Text style={styles.confirmTitle}>申请提现成功</Text>
<Text style={styles.confirmContent}>提现金额到帐时间为提现申请日期后3-5个工作日,节假日顺延。</Text>
<Text style={styles.confirmContent}>每月15日统一打款,节假日顺延</Text>
</View>
<View style={{width: '100%', height: 0.5, backgroundColor: '#e0e0e0'}}/>
<View style={styles.confirmBtnContainer}>
... ...
'use strict';
import React from 'react';
import ReactNative from 'react-native';
import Immutable from 'immutable';
const {TouchableOpacity,View, Text, Image} = ReactNative;
export default class MineCell extends React.Component {
constructor(props) {
super(props);
}
shouldComponentUpdate(nextProps) {
if (Immutable.is(nextProps.data, this.props.data)) {
return false;
} else {
return true;
}
}
render() {
let {resource} = this.props;
if (!resource || resource.size === 0) {
return null;
}
let list = this.props.resource.toJS();
if (!list || list.length === 0) {
return null;
}
let item = list[0];
if (!item) {
return null;
}
return (
<View>
<TouchableOpacity
style={this.props.styles.withdrawView}
onPress={() => {
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(item.url);
}}
>
<Text style={this.props.styles.hasWithDrawText}>{item.name}</Text>
<View style={[this.props.styles.textView, {flexDirection: 'row', paddingRight: 15}]}>
<Image style={this.props.styles.arrowImage} source={require('../../images/arrow.png')}/>
</View>
{/*<View style={{height: 10, backgroundColor: '#f0f0f0'}}/>*/}
</TouchableOpacity>
<View style={{height: 10, backgroundColor: '#f0f0f0'}}/>
</View>
);
}
}
\ No newline at end of file
... ...
... ... @@ -18,6 +18,7 @@ export default keyMirror({
SET_SRC: null,
SET_JUMP_URL: null,
SET_PRODUCT_POOL:null,
SET_SKNS: null,
SHOW_WITHDRAW_DIALOG: null,
DISMISS_WITHDRAW_DIALOG: null,
... ...
... ... @@ -80,7 +80,8 @@ class HomeContainer extends Component {
json && json.forEach(item => {
if (item.template_name === 'recommendGoodsGroup' && item.data) {
let productPool = item.data.recommendLogic;
self.props.actions.getProductList(productPool);
let skns = item.data.skns;
self.props.actions.getProductList(productPool, skns);
let params = {
TAB_ID: '0',
TAB_NAME: '热门推荐'
... ... @@ -150,9 +151,10 @@ class HomeContainer extends Component {
onPressCategory(data, index) {
let {
productPool,
skns,
} = this.props.app;
console.log(data.get('sort_id'));
this.props.actions.setAppSelectedCategory(productPool, data.get('sort_id'), data.get('sort_name'), index);
this.props.actions.setAppSelectedCategory(productPool, skns, data.get('sort_id'), data.get('sort_name'), index);
let params = {
TAB_ID: data.get('sort_id'),
... ... @@ -165,8 +167,9 @@ class HomeContainer extends Component {
let {
productPool,
skns,
} = this.props.app;
productPool !=0 && this.props.actions.getProductList(productPool);
productPool !=0 && this.props.actions.getProductList(productPool,skns);
}
render() {
... ...
... ... @@ -49,8 +49,9 @@ class RecommendContainer extends Component {
componentDidMount() {
let {
productPool,
skns,
} = this.props.app;
this.props.actions.getProductList(productPool);
this.props.actions.getProductList(productPool, skns);
}
_resourceJumpWithUrl(url) {
... ... @@ -65,17 +66,25 @@ class RecommendContainer extends Component {
// console.log(data);
let {
productPool,
skns,
} = this.props.app;
this.props.actions.setAppSelectedCategory(productPool, data.get('sort_id'), index);
this.props.actions.setAppSelectedCategory(productPool, skns, data.get('sort_id'), index);
}
onPressProduct(data) {
let productSkn = data ? data.get('product_skn', 0): null;
onPressProduct(product) {
let productSkn = product && product.get('product_skn', 0);
let product_id = product && product.get('product_id', 0);
if (!productSkn) {
return;
}
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${productSkn}","from_page_name":"${Platform.OS === 'ios' ? 'iFP_MineBrowseHistory' : 'aFP_MineBrowseHistory'}"}}`;
let pageName = 'iFP_Alliance';
if (Platform.OS === 'android') {
pageName = 'aFP_Alliance';
}
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.minealliance","params":{"type":"shareDetail", "product_skn":"${productSkn}", "product_id": "${product_id}" ,"from_page_name":"${pageName}"}}`;
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
}
... ...
... ... @@ -83,9 +83,10 @@ class ShareDetailContainer extends Component {
}else {
qrCode = host + '/wechat/miniapp/img-check.jpg?param=' + productSkn + '&miniQrType=7';
}
let shareParam = {
title: productInfo.productName ? productInfo.productName : '',
content: productInfo.phrase ? productInfo.phrase : '',
content: productInfo.productName ? productInfo.productName : '',
image: goodsInfo.colorImage,
url: '',
miniProgramPath: 'pages/goodsDetail/goodsDetail?productSkn=' + productSkn,
... ...
... ... @@ -2,7 +2,7 @@
import ReactNative from 'react-native';
import AllianceService from '../../services/AllianceService';
import {setproductPool} from "../app/appActions";
import {setproductPool, setSkns} from "../app/appActions";
const Platform = require('Platform');
... ... @@ -576,7 +576,9 @@ export function getResourceInfo(callback) {
json && json.forEach(item => {
if (item.template_name === 'recommendGoodsGroup' && item.data) {
let productPool = item.data.recommendLogic;
let skns = item.data.skns;
dispatch(setproductPool(productPool));
dispatch(setSkns(skns));
}
})
})
... ...
... ... @@ -14,6 +14,7 @@ const {
SET_HOST,
SET_SERVICE_HOST,
SET_PRODUCT_POOL,
SET_SKNS,
PRODUCT_LIST_REQUEST,
PRODUCT_LIST_SUCCESS,
... ... @@ -72,6 +73,13 @@ export function setproductPool(productPool) {
}
}
export function setSkns(skns) {
return {
type: SET_SKNS,
payload: skns
}
}
export function productListRequest() {
return {
type: PRODUCT_LIST_REQUEST,
... ... @@ -226,7 +234,7 @@ function exposeHtmlContent(json, callbackFun) {
}
export function getProductList(product_pool = 0,msort = 0) {
export function getProductList(product_pool = 0, skns = 0,msort = 0) {
return (dispatch, getState) => {
let {app} = getState();
let list = app.productList;
... ... @@ -247,7 +255,7 @@ export function getProductList(product_pool = 0,msort = 0) {
console.log(pageSize);
let fetchProductList = (uid) => {
dispatch(productListRequest());
return new AppService(app.host).fetchProductList(uid, page, pageSize, msort, product_pool)
return new AppService(app.host).fetchProductList(uid, page, pageSize, msort, product_pool, skns)
.then(json => {
let payload = json;
try {
... ...
... ... @@ -8,6 +8,7 @@ let InitialState = Record({
host: 'http://api.yoho.cn',
serviceHost: 'http://api.yoho.cn',
productPool: 0,
skns: 0,
productList: new (Record({
isFetching: false,
... ...
... ... @@ -73,7 +73,7 @@ export function addFavorite(params) {
return async (dispatch, getState) => {
let { app: { host }, shareDetail } = getState();
let uid, data;
let isCollect = shareDetail.getIn(['productInfo', 'isCollect']);
let isCollect = shareDetail.get('isCollect');
isCollect === 'Y' && (params.fav_id = params.id)
let service = new Service(host);
dispatch(addFavoriteRequest());
... ...
... ... @@ -12,7 +12,7 @@ export default class AppService {
this.api = new Request(baseURL);
}
async fetchProductList(uid, page, limit = 20, msort = 0, product_pool = 680) {
async fetchProductList(uid, page, limit = 20, msort = 0, product_pool = 680, firstProductSkn = 0) {
return await this.api.get({
url: '',
body: {
... ... @@ -22,7 +22,7 @@ export default class AppService {
limit,
msort: msort === 0 ? undefined : msort,
product_pool,
debug: 'XYZ'
firstProductSkn: firstProductSkn === 0 ? undefined : firstProductSkn,
}
})
.then((json) => {
... ...