cf-wx-app/src/pages/index/index.js

64 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-11-29 17:35:49 +08:00
import Taro, { Component } from '@tarojs/taro'
2018-12-11 17:34:06 +08:00
import { View } from '@tarojs/components'
2018-11-29 17:35:49 +08:00
import { connect } from '@tarojs/redux'
import { add, minus, asyncAdd } from '../../actions/counter'
import './index.scss'
@connect(({ counter }) => ({
counter
}), (dispatch) => ({
2019-01-08 13:51:26 +08:00
add() {
2018-11-29 17:35:49 +08:00
dispatch(add())
},
2019-01-08 13:51:26 +08:00
dec() {
2018-11-29 17:35:49 +08:00
dispatch(minus())
},
2019-01-08 13:51:26 +08:00
asyncAdd() {
2018-11-29 17:35:49 +08:00
dispatch(asyncAdd())
}
}))
2018-11-29 17:35:49 +08:00
class Index extends Component {
2019-01-08 13:51:26 +08:00
config = {
2018-11-29 17:35:49 +08:00
navigationBarTitleText: '首页'
}
2019-01-08 13:51:26 +08:00
//http://ihome6.com/Shop-supplyShops
componentDidMount() {
2018-11-29 17:35:49 +08:00
Taro.navigateTo({
2019-01-08 13:51:26 +08:00
// url: '/pages/myGoodList/myGoodList'
// url: '/pages/myDemandSupplyEdit/myDemandSupplyEdit'
2019-01-08 13:51:26 +08:00
// url: '/pages/mySupplyDemand/mySupplyDemand'
// url:'/pages/grabOrderPage/grabOrderPage'
2019-01-08 17:33:52 +08:00
url:'/pages/home/home'
// url:'/pages/myNeeds/myNeeds',
//url:'/pages/myNeedsPublish/myNeedsPublish'
2019-01-08 13:51:26 +08:00
// url:'/pages/goodsPublish/goodsPublish'
2018-11-29 17:35:49 +08:00
})
}
2019-01-08 13:51:26 +08:00
componentWillReceiveProps(nextProps) {
2018-11-29 17:35:49 +08:00
console.log(this.props, nextProps)
}
2019-01-08 13:51:26 +08:00
componentWillUnmount() { }
2018-11-29 17:35:49 +08:00
2019-01-08 13:51:26 +08:00
componentDidShow() { }
2018-11-29 17:35:49 +08:00
2019-01-08 13:51:26 +08:00
componentDidHide() { }
2018-11-29 17:35:49 +08:00
2019-01-08 13:51:26 +08:00
render() {
2018-11-29 17:35:49 +08:00
return (
<View className='index'>
2019-01-08 13:51:26 +08:00
2018-11-29 17:35:49 +08:00
</View>
)
}
}
export default Index