|
@@ -10,32 +10,34 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="flex justify-center align-center padding-bottom">
|
|
<view class="flex justify-center align-center padding-bottom">
|
|
|
<view class="search">
|
|
<view class="search">
|
|
|
- <u-search search-icon="/static/rank/search.png" :show-action="false" bg-color="#fff"
|
|
|
|
|
|
|
+ <u-search @search="searchWorks" search-icon="/static/rank/search.png" :show-action="false" bg-color="#fff"
|
|
|
style="width: 100%;" placeholder-color="#CCCCCC"></u-search>
|
|
style="width: 100%;" placeholder-color="#CCCCCC"></u-search>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <block v-for="(item, index) in 20" :key="index">
|
|
|
|
|
|
|
+ <block v-for="(item, index) in rankList" :key="item.id">
|
|
|
<block v-if="index == 0 || index == 1 || index == 2">
|
|
<block v-if="index == 0 || index == 1 || index == 2">
|
|
|
<view class=" flex align-center"
|
|
<view class=" flex align-center"
|
|
|
style="height: 230rpx;position: relative;margin: 10rpx 20rpx 20rpx 20rpx;"
|
|
style="height: 230rpx;position: relative;margin: 10rpx 20rpx 20rpx 20rpx;"
|
|
|
:class="index == 0 ? 'first' : index == 1 ? 'second' : index == 2 ? 'third' : '' ">
|
|
:class="index == 0 ? 'first' : index == 1 ? 'second' : index == 2 ? 'third' : '' ">
|
|
|
- <u-image width="220" height="220" border-radius="10" src="/static/test/test.png"></u-image>
|
|
|
|
|
|
|
+ <u-image width="220" height="220" border-radius="10" :src="item.imgUrl"></u-image>
|
|
|
<view class="flex justify-between container" style="width: 100%;">
|
|
<view class="flex justify-between container" style="width: 100%;">
|
|
|
<view class="left" style="width: 95%;">
|
|
<view class="left" style="width: 95%;">
|
|
|
- <view class="name text-cut">小学生法律小知识</view>
|
|
|
|
|
|
|
+ <view class="name text-cut">{{item.title}}</view>
|
|
|
<view class="padding-tb-sm text-sm center"
|
|
<view class="padding-tb-sm text-sm center"
|
|
|
style="color: #888888;justify-content: flex-start">
|
|
style="color: #888888;justify-content: flex-start">
|
|
|
- <u-avatar src="/static/test/avatar.png" size="56"></u-avatar>
|
|
|
|
|
- <text class="margin-left-10">一只可乐喵</text>
|
|
|
|
|
|
|
+ <u-avatar :src="item.userImg" size="56"></u-avatar>
|
|
|
|
|
+ <text class="margin-left-10">{{item.username}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="flex justify-between">
|
|
<view class="flex justify-between">
|
|
|
<view class="hot-value center" style="justify-content: flex-start;">
|
|
<view class="hot-value center" style="justify-content: flex-start;">
|
|
|
<image src="../../static/rank/hot.png" style="width: 36rpx;height: 36rpx;"
|
|
<image src="../../static/rank/hot.png" style="width: 36rpx;height: 36rpx;"
|
|
|
mode=""></image>
|
|
mode=""></image>
|
|
|
- <text>3085</text>
|
|
|
|
|
|
|
+ <text>{{item.voteCount}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <button class="cu-btn round bg-base sm text-white"
|
|
|
|
|
|
|
+ <button
|
|
|
|
|
+ @click.stop="$jump('/pages/activity/activityDetail?id='+item.id)"
|
|
|
|
|
+ class="cu-btn round bg-base sm text-white"
|
|
|
style="padding: 20rpx 38rpx;margin-bottom: 30rpx;">
|
|
style="padding: 20rpx 38rpx;margin-bottom: 30rpx;">
|
|
|
<text>去投票</text>
|
|
<text>去投票</text>
|
|
|
</button>
|
|
</button>
|
|
@@ -59,23 +61,25 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class=" flex align-center "
|
|
<view class=" flex align-center "
|
|
|
style="background-color: #FFFFFF;border-radius: 20rpx;height: 200rpx;width: 95%;">
|
|
style="background-color: #FFFFFF;border-radius: 20rpx;height: 200rpx;width: 95%;">
|
|
|
- <u-image width="190" height="190" border-radius="10" src="/static/test/test.png"></u-image>
|
|
|
|
|
|
|
+ <u-image width="190" height="190" border-radius="10" :src="item.imgUrl"></u-image>
|
|
|
<view class="flex justify-between container" style="width: 100%;">
|
|
<view class="flex justify-between container" style="width: 100%;">
|
|
|
<view class="left" style="width: 95%;">
|
|
<view class="left" style="width: 95%;">
|
|
|
<view class="name text-cut"
|
|
<view class="name text-cut"
|
|
|
- style="font-size: 28rpx;font-weight: 600;padding-top: 20rpx;">小学生法律小知识</view>
|
|
|
|
|
|
|
+ style="font-size: 28rpx;font-weight: 600;padding-top: 20rpx;">{{item.title}}</view>
|
|
|
<view class="padding-top-20 text-sm center"
|
|
<view class="padding-top-20 text-sm center"
|
|
|
style="color: #888888;justify-content: flex-start">
|
|
style="color: #888888;justify-content: flex-start">
|
|
|
- <u-avatar src="/static/test/avatar.png" size="56"></u-avatar>
|
|
|
|
|
- <text class="margin-left-10">一只可乐喵</text>
|
|
|
|
|
|
|
+ <u-avatar :src="item.userImg" size="56"></u-avatar>
|
|
|
|
|
+ <text class="margin-left-10">{{item.username}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="flex justify-between">
|
|
<view class="flex justify-between">
|
|
|
<view class="hot-value center" style="justify-content: flex-start;">
|
|
<view class="hot-value center" style="justify-content: flex-start;">
|
|
|
<image src="../../static/rank/hot.png" style="width: 36rpx;height: 36rpx;"
|
|
<image src="../../static/rank/hot.png" style="width: 36rpx;height: 36rpx;"
|
|
|
mode=""></image>
|
|
mode=""></image>
|
|
|
- <text>3085</text>
|
|
|
|
|
|
|
+ <text>{{item.voteCount}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <button class="cu-btn round bg-base sm text-white"
|
|
|
|
|
|
|
+ <button
|
|
|
|
|
+ @click.stop="$jump('/pages/activity/activityDetail?id='+item.id)"
|
|
|
|
|
+ class="cu-btn round bg-base sm text-white"
|
|
|
style="padding: 20rpx 38rpx;margin-bottom: 30rpx;">
|
|
style="padding: 20rpx 38rpx;margin-bottom: 30rpx;">
|
|
|
<text>去投票</text>
|
|
<text>去投票</text>
|
|
|
</button>
|
|
</button>
|
|
@@ -133,9 +137,20 @@
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
this.$refs.loading.hide()
|
|
this.$refs.loading.hide()
|
|
|
}, 500)
|
|
}, 500)
|
|
|
|
|
+ this.getList(0);
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
-
|
|
|
|
|
|
|
+ getList(page){
|
|
|
|
|
+ const { defaultActiveId:activeId ,rankTotal }= this.$store.state['vuex_active_setting'];
|
|
|
|
|
+ this.$api.activity.getWorksList({ activeId , start: page,end: page+rankTotal }).then(res => {
|
|
|
|
|
+ this.rankList.push(...res.data.data);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ searchWorks(value){
|
|
|
|
|
+ this.$api.activity.searchWork(value).then(res => {
|
|
|
|
|
+ this.rankList = res.data.data;
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|