123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <template>
- <view class="activity">
- <zs-list mt="0" @load="loadMore" :status="status">
- <view class="item" v-for="item in list" :key="item.id" @click="goDetail(item.id)">
- <zs-img :src="item.activityCover" width="710rpx" height="320rpx"></zs-img>
- <view class="info">
- <view class="title">
- {{item.activityName}}
- </view>
- <view class="desc">
- 活动时间: {{ item.activityStartTime }} 至 {{ item.activityEndTime }}
- </view>
- </view>
- </view>
-
- </zs-list>
- </view>
- </template>
- <script>
- import {activityList} from '@/api/activity'
- export default {
- data() {
- return {
- status: 'more',
- list:[],
- query:{
- currentPage:1,
- pageSize:10,
- shopId:0,
- state:2
- }
-
- }
- },
- methods: {
- loadMore(){
- this.activityList()
- },
- goDetail(id){
- uni.navigateTo({
- url:'/signUp/index?scene='+id
- })
- },
- activityList(){
- this.status = 'loading'
- activityList(this.query).then(res=>{
- if(res.state == 'Success'){
- this.list = this.list.concat(res.content.records)
- if (this.list.length >= res.content.total) {
- this.status = 'noMore'
- } else {
- this.status = 'more'
- this.query.pageCurrent++
- }
- }
- })
- }
- },
- onLoad() {
- // this.activityList()
- },
- onShareTimeline() {
- return {
- title: "慧研学惠生活",
- query: "id=1",
- };
- },
- onShareAppMessage() {
- return {
- title: "慧研学惠生活",
- path: "/pages/activity/index",
- };
- },
- }
- </script>
- <style lang="scss" scoped>
- .activity {
- padding: 20rpx;
- background: #F9F9F9;
- min-height: 100vh;
- .zs-list {
- .item{
- margin-bottom: 20rpx;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- .info{
- background: #fff;
- padding: 20rpx 24rpx;
- .title{
- font-size: 28rpx;
- color: #222222;
- width: 640rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .desc{
- font-size: 24rpx;
- color: #AAAAAA;
- overflow: hidden;
- text-overflow: ellipsis;
- /* 弹性伸缩盒子模型显示 */
- display: -webkit-box;
- /* 限制在一个块元素显示的文本的行数 */
- -webkit-line-clamp: 2;
- /* 设置或检索伸缩盒对象的子元素的排列方式 */
- -webkit-box-orient: vertical;
- margin-top: 20rpx;
- }
- }
- }
- }
- }
- </style>
|