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

61 lines
1.5 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) => ({
add () {
dispatch(add())
},
dec () {
dispatch(minus())
},
asyncAdd () {
dispatch(asyncAdd())
}
}))
class Index extends Component {
config = {
navigationBarTitleText: '首页'
}
//http://ihome6.com/Shop-supplyShops
componentDidMount(){
2018-12-18 17:37:23 +08:00
Taro.setStorageSync('PFWSSS','hq0erouhm4mea8b0mg34gdj0q7')
Taro.setStorageSync('X-Token','eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.IntcInVzZXJfaWRcIjpcIjI3XCIsXCJsb2dpbl9uYW1lXCI6XCJ5YW5neGJcIixcImF0XCI6XCIyMDE4LTEyLTE4IDEzOjM1OjUxXCJ9Ig.gXvZxXgU5asfwUJAG-z7k5g2p3dbts2e1X9L902KksE')
Taro.setStorageSync('PLU','%2Fm-more')
Taro.setStorageSync('localCity','think%3A%7B%2214%22%3A%22%25E7%25A6%258F%25E5%25BB%25BA%25E7%259C%2581%22%2C%2214001%22%3A%22%25E7%25A6%258F%25E5%25B7%259E%25E5%25B8%2582%22%7D')
2018-11-29 17:35:49 +08:00
Taro.navigateTo({
2018-12-14 17:10:23 +08:00
url: '/pages/home/home'
2018-12-18 17:37:23 +08:00
// url: '/pages/goodsPublish/goodsPublish'
// url:'/pages/supplyDemandPublish/supplyDemandPublish'
2018-11-29 17:35:49 +08:00
})
}
componentWillReceiveProps (nextProps) {
console.log(this.props, nextProps)
}
componentWillUnmount () { }
componentDidShow () { }
componentDidHide () { }
render () {
return (
<View className='index'>
2018-12-06 17:24:34 +08:00
2018-11-29 17:35:49 +08:00
</View>
)
}
}
export default Index