123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <template>
- <view class="dy">
- <statusBar :item="navBarData"></statusBar>
- <view class="bigBox" v-for=" i in applyUserlist">
- <view class="imgblk">
- <image class="img" :src="i.avatar" mode="aspectFill"></image>
- </view>
- <view class="info">
- <view class="uname">
- <view class="nameTxt">
- {{i.username}}
- </view>
- <view class="sch">{{i.create_at}}</view>
- </view>
- <view class="sch1">{{i.schoolName}}</view>
- </view>
- </view>
- <view class="loading">
- <view v-if="newsLoading==1">数据加载中...</view>
- <view v-if="newsLoading==2">没有更多了~~</view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- navBarData: {
- title: '新增订阅',
- btn: 1
- },
- // 报名列表
- applyUserlist: [],
- // 活动id
- acId: '',
- // 触底加载动画提示
- newsLoading: 0, //0默认值 1加载中 2没有更多了
- currentPage: 1,
- };
- },
- methods: {
- // 获取报名用户
- getUsers() {
- let data = {
- oid: this.$store.state.user.openid, //用户id
- aid: this.acId,
- type: 2,
- page: this.currentPage, //下拉获取更多的备用字段
- }
- this.$request('/selectEnrollUser', 'get', data).then(res => {
- console.log(res);
- // this.applyUserlist = res[0]
- console.log('获取报名用户列表', res[0]);
- if (!res[0].length) {
- this.newsLoading = 2
- } else {
- this.newsLoading = 0
- }
- this.applyUserlist = [...this.applyUserlist, ...res[0]]
- })
- }
- },
- // 触底加载更多
- onReachBottom() {
- if (this.newsLoading == 2) {
- return
- }
- this.newsLoading = 1
- this.currentPage++
- setTimeout(() => {
- this.getUsers()
- }, 1500)
- },
- onLoad(e) {
- // console.log('接受参数',e);
- this.acId = e.acId
- this.getUsers()
- }
- };
- </script>
- <style lang="scss" scoped>
- .dy {}
- .bigBox {
- background-color: white;
- width: 750rpx;
- height: 136rpx;
- padding: 0rpx 30rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .imgblk {
- height: 80rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- // background-color: #888;
- .img {
- width: 72rpx;
- height: 72rpx;
- border-radius: 50%;
- }
- }
- .info {
- flex: 1;
- display: flex;
- flex-direction: column;
- height: 80rpx;
- justify-content: space-between;
- margin-left: 20rpx;
- // background-color: rebeccapurple;
- .uname {
- display: flex;
- justify-content: space-between;
- .nameTxt {
- font-size: 28rpx;
- color: rgba(0, 0, 0, 0.8);
- // line-height: 50%;
- }
- .sch {
- font-size: 24rpx;
- color: rgba(0, 0, 0, 0.6);
- }
- }
- .sch1 {
- // flex: 1;
- font-size: 24rpx;
- color: rgba(0, 0, 0, 0.6);
- }
- }
- }
- .loading {
- height: 50rpx;
- text-align: center;
- padding-top: 20rpx;
- padding-bottom: 100rpx;
- font-size: 26rpx;
- color: #888;
- line-height: 2em;
- }
- </style>
|