|
@@ -5,10 +5,11 @@ import { View, Image, Video,Button,OpenData } from '@tarojs/components'
|
|
|
import {add, minus, asyncAdd, set} from '../../actions/counter'
|
|
|
import { Swiper, SwiperItem } from '@tarojs/components'
|
|
|
import { AtTabs, AtTabsPane } from 'taro-ui'
|
|
|
-import { login,pay,payClose } from '../../utils/servers/servers'
|
|
|
import './index.less'
|
|
|
import IconFont from '../../components/iconfont';
|
|
|
import API from '../../utils/API';
|
|
|
+import { login,getProjecList } from '../../utils/servers/servers'
|
|
|
+import background from "../../assets/images/background.png";
|
|
|
|
|
|
@connect(({ counter }) => ({
|
|
|
counter
|
|
@@ -33,7 +34,8 @@ class Index extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.state={
|
|
|
-
|
|
|
+ pageNo:1,
|
|
|
+ list: [],
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -128,10 +130,73 @@ class Index extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ getProjecList (pageNo = 1){
|
|
|
+ getProjecList({
|
|
|
+ pageNo: pageNo,
|
|
|
+ pageSize: 5,
|
|
|
+ }).then(v=>{
|
|
|
+ if(v.error.length === 0){
|
|
|
+ this.setState({
|
|
|
+ list:pageNo === 1 ? v.data.list : this.state.list.concat(v.data.list),
|
|
|
+ pageNo: v.data.pageNo
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ Taro.showToast({title:v.error[0].message,icon:'none'})
|
|
|
+ }
|
|
|
+ Taro.stopPullDownRefresh();
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ async componentDidMount() {
|
|
|
+ this.login();
|
|
|
+ await this.getProjecList();
|
|
|
+ }
|
|
|
+
|
|
|
+ onPullDownRefresh(){
|
|
|
+ this.getProjecList();
|
|
|
+ }
|
|
|
+
|
|
|
+ onReachBottom(){
|
|
|
+ this.getProjecList(this.state.pageNo+1);
|
|
|
+ }
|
|
|
+
|
|
|
render () {
|
|
|
return (
|
|
|
<View className='userPage'>
|
|
|
- 1111
|
|
|
+ <Image src={background} className='background'/>
|
|
|
+ <View className='userInfor'>
|
|
|
+ <View className='avatar'>
|
|
|
+ <OpenData type='userAvatarUrl'/>
|
|
|
+ </View>
|
|
|
+ <View className='nickName'>
|
|
|
+ <OpenData type='userNickName'/>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ <View className='list'>
|
|
|
+ {this.state.list.map((v,k)=>(
|
|
|
+ <View className='item' key={k} onClick={()=>{
|
|
|
+ Taro.navigateTo({
|
|
|
+ url:'/pages/details/index?id='+v.id
|
|
|
+ })
|
|
|
+ }}>
|
|
|
+ <View className='block'>
|
|
|
+ <View className='top'/>
|
|
|
+ <View className='bottom'>
|
|
|
+ <View className='left'/>
|
|
|
+ <View className='right'/>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ <View className='infor'>
|
|
|
+ <View className='title'>高新培育课程</View>
|
|
|
+ <View className='content'>快速提高 项目奖励 </View>
|
|
|
+ </View>
|
|
|
+ <View className='moneyInfor'>
|
|
|
+ <View className='money'>¥269</View>
|
|
|
+ <View className='time'>2021-05-01</View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ ))}
|
|
|
+ </View>
|
|
|
</View>
|
|
|
)
|
|
|
}
|