支付宝 店铺页面 分类修改

This commit is contained in:
郑茂强 2019-03-27 09:41:35 +08:00
parent ff5c1c1389
commit 7a0c7af702
4 changed files with 232 additions and 199 deletions

View File

@ -20,7 +20,7 @@ class ShopTypeInteractionComp extends Component {
initailMultiArray: [[{}], [{ name: '选择店铺分类', id: '' }]], initailMultiArray: [[{}], [{ name: '选择店铺分类', id: '' }]],
multiIndex: [0, 0], multiIndex: [0, 0],
interactionMultiArray: [],// 联动数据 interactionMultiArray: [],// 联动数据
AliIsShowPicker:false, AliIsShowPicker: false,
} }
} }
@ -160,22 +160,35 @@ class ShopTypeInteractionComp extends Component {
} }
aliCancelButton() { aliCancelButton() {
// 只有店铺页面才有onAliCurtainValueFromChild
if (this.props.hasOwnProperty('onAliCurtainValueFromChild')) {
this.props.onAliCurtainValueFromChild(false)
} else {
this.setState({ this.setState({
AliIsShowPicker:false AliIsShowPicker: false
}) })
} }
}
aliConfirmButton() { aliConfirmButton() {
// 只有店铺页面才有onAliCurtainValueFromChild
if (this.props.hasOwnProperty('onAliCurtainValueFromChild')) {
this.props.onAliCurtainValueFromChild(false)
} else {
this.setState({ this.setState({
AliIsShowPicker:false AliIsShowPicker: false
}) })
}
let result = this.state.interactionMultiArray[this.state.multiIndex[0]].children[this.state.multiIndex[1]] let result = this.state.interactionMultiArray[this.state.multiIndex[0]].children[this.state.multiIndex[1]]
this.passDataToParent(result) this.passDataToParent(result)
} }
invokeAliPicker() { invokeAliPicker() {
console.log('clicked')
this.setState({ this.setState({
AliIsShowPicker:true AliIsShowPicker: true
}) })
} }
@ -185,7 +198,13 @@ class ShopTypeInteractionComp extends Component {
// 当然父组件有新的props的 会从新渲染组件 // 当然父组件有新的props的 会从新渲染组件
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
// 只有店铺页面才有isShowCurtain
if (nextProps.hasOwnProperty('isShowCurtain')) {
this.setState({
AliIsShowPicker: nextProps.isShowCurtain
})
}
} }
componentWillUnmount() { } componentWillUnmount() { }

View File

@ -76,6 +76,7 @@ class Shop extends Component {
// 地图的经度和维度 // 地图的经度和维度
longitude: '', longitude: '',
latitude: '', latitude: '',
aliShowCurtain:false
} }
@ -573,6 +574,18 @@ class Shop extends Component {
}) })
} }
// 这个函数只针对店铺页面
aliCurtainHandler(){
this.setState({
aliShowCurtain:!this.state.aliShowCurtain
})
}
// 这个函数只针对店铺页面
getAliCurtainValueFromChild(value){
this.setState({
aliShowCurtain:value
})
}
componentDidMount() { componentDidMount() {
showLoading({ title: '加载中' }) showLoading({ title: '加载中' })
//页面加载之后 得到指定店铺的商品 和 筛选标签 //页面加载之后 得到指定店铺的商品 和 筛选标签
@ -816,13 +829,13 @@ class Shop extends Component {
></ShopTypeInteractionComp> : <AliShopTypeInteraction url={URL.GetShopCategoryList} ></ShopTypeInteractionComp> : <AliShopTypeInteraction url={URL.GetShopCategoryList}
shopId={getGlobalStorage('shopInfo') ? getGlobalStorage('shopInfo').shop_id : ''} shopId={getGlobalStorage('shopInfo') ? getGlobalStorage('shopInfo').shop_id : ''}
// selectedValue={this.state.shopTypeSelected} // selectedValue={this.state.shopTypeSelected}
isShowCurtain={this.state.aliShowCurtain}
onPassDataToChild={this.getDataFromShopChild.bind(this)} onPassDataToChild={this.getDataFromShopChild.bind(this)}
onAliCurtainValueFromChild={this.getAliCurtainValueFromChild.bind(this)}
></AliShopTypeInteraction>} ></AliShopTypeInteraction>}
</View> </View>
<View > <View onClick={this.aliCurtainHandler.bind(this)} >
<Text className='text'> <Text className='text'>
店铺全部分类 店铺全部分类
</Text> </Text>

View File

@ -59,7 +59,8 @@ $themeColor:#FF7142;
position: relative; position: relative;
.interaction{ .interaction{
position: absolute; position: absolute;
opacity: 0; // opacity: 0;
top:-100px;
} }
} }