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

61 lines
1.0 KiB
JavaScript
Raw Normal View History

2018-11-29 17:35:49 +08:00
import Taro, { Component } from '@tarojs/taro'
import { View, Button, Text } from '@tarojs/components'
import { connect } from '@tarojs/redux'
import { add, minus, asyncAdd } from '../../actions/counter'
import './index.scss'
@connect(({ counter }) => ({
counter
}), (dispatch) => ({
add () {
dispatch(add())
},
dec () {
dispatch(minus())
},
asyncAdd () {
dispatch(asyncAdd())
}
}))
class Index extends Component {
config = {
navigationBarTitleText: '首页'
}
//http://ihome6.com/Shop-supplyShops
componentDidMount(){
Taro.navigateTo({
url: '/pages/home/home'
})
// Taro.request({
// url:'http://192.168.1.230/Shop-wxStore',
// })
// .then(res => console.log(res.data))
}
componentWillReceiveProps (nextProps) {
console.log(this.props, nextProps)
}
componentWillUnmount () { }
componentDidShow () { }
componentDidHide () { }
render () {
return (
<View className='index'>
</View>
)
}
}
export default Index