...
|
...
|
@@ -4,7 +4,8 @@ import {productDetail as productDetailModel} from '../../models'; |
|
|
import {getImgUrl} from '../../utils';
|
|
|
import {ProductList, SelectSize} from '../../components';
|
|
|
import { connect } from '@tarojs/redux';
|
|
|
import { showSizeBox } from '../../actions/productDetail'
|
|
|
import { showSizeBox, showSharesheet } from '../../actions/productDetail'
|
|
|
|
|
|
|
|
|
import share from '../../static/images/share.png';
|
|
|
import collect from '../../static/images/collect.png';
|
...
|
...
|
@@ -17,6 +18,9 @@ import event from '../../utils/event' |
|
|
}), (dispatch) => ({
|
|
|
showSizeBox (isShow) {
|
|
|
dispatch(showSizeBox(isShow))
|
|
|
},
|
|
|
showSharesheet (isShow) {
|
|
|
dispatch(showSharesheet(isShow))
|
|
|
}
|
|
|
}))
|
|
|
|
...
|
...
|
@@ -30,6 +34,7 @@ export default class ProductDetail extends Component { |
|
|
recommendList: [],
|
|
|
collectTitle: '收藏',
|
|
|
isFavorite: false,
|
|
|
isShare: false,
|
|
|
productDec: {
|
|
|
color: {
|
|
|
text: '颜色',
|
...
|
...
|
@@ -55,6 +60,11 @@ export default class ProductDetail extends Component { |
|
|
};
|
|
|
}
|
|
|
|
|
|
config = {
|
|
|
usingComponents: {
|
|
|
'share-sheet' : '../../components/shareSheet/shareSheet'
|
|
|
}
|
|
|
}
|
|
|
componentDidMount() {
|
|
|
let id = this.$router.params.id;
|
|
|
|
...
|
...
|
@@ -164,6 +174,16 @@ export default class ProductDetail extends Component { |
|
|
}
|
|
|
}
|
|
|
|
|
|
onClickShare(id, e) {
|
|
|
let {showSharesheet} = this.props;
|
|
|
showSharesheet(true);
|
|
|
}
|
|
|
|
|
|
onCancel() {
|
|
|
let {showSharesheet} = this.props;
|
|
|
showSharesheet(false);
|
|
|
}
|
|
|
|
|
|
onClickBuy() {
|
|
|
let {showSizeBox} = this.props;
|
|
|
|
...
|
...
|
@@ -198,7 +218,7 @@ export default class ProductDetail extends Component { |
|
|
<Image src={isFavorite ? collect : collectOff} className="collect-icon"/>
|
|
|
<Text className="text">{collectTitle}</Text>
|
|
|
</View>
|
|
|
<View className="share">
|
|
|
<View className="share" onClick={this.onClickShare.bind(this, id)}>
|
|
|
<Image src={share} className="share-icon"/>
|
|
|
<Text className="text">分享</Text>
|
|
|
</View>
|
...
|
...
|
@@ -234,6 +254,11 @@ export default class ProductDetail extends Component { |
|
|
</View>
|
|
|
|
|
|
{
|
|
|
this.props.productDetail.showSharesheet &&
|
|
|
<share-sheet></share-sheet>
|
|
|
}
|
|
|
|
|
|
{
|
|
|
this.props.productDetail.showSizeBox &&
|
|
|
<SelectSize sizeList={goodsList.size_list} product_id={id}></SelectSize>
|
|
|
}
|
...
|
...
|
|