123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <template>
- <view class="jj-wrap">
- <view class="jj" v-for="cp in list" @click="navto('/pages/index/artDetail?id=' + cp.id)">
- <image :src="cp.image_input[0]" mode="" class="jj-img"></image>
- <view class="jj-info">
- <view class="jj-tit-tit clamp2">
- {{cp.title}}
- </view>
- <view class="jj-val clamp">
- 更新时间{{cp.add_time}}
- </view>
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- </view>
- </template>
- <script>
- import { article,articleList } from '@/api/user.js';
- import {
- loadIndexs,
- getArticleList
- } from '@/api/index.js';
- export default {
- data() {
- return {
- list: [],
- page: 1,
- limit: 10,
- loadingType: 'more',
- cid: 0,
- }
- },
- onLoad(opt) {
- this.cid = opt.cid
- this.tit = decodeURI(opt.tit)
- uni.setNavigationBarTitle({
- title: this.tit
- })
- this.getArticleList()
- },
- methods: {
- navto(url) {
- uni.navigateTo({
- url: url
- })
- },
- getArticleList() {
- let obj = this
- if(obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
- return
- }
- obj.loadingType = 'loading'
- article({
- page: obj.page,
- limit: obj.limit
- },obj.cid).then(({data}) => {
- obj.list = obj.list.concat(data)
- obj.page++
- if(data.length == obj.limit) {
- obj.loadingType = 'more'
- }else {
- obj.loadingType = 'noMore'
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- background-color: #fff;
- min-height: 100%;
- }
- .jj-wrap {
- background-color: #fff;
- // margin: 20rpx 0;
- .jj {
- margin: auto;
- width: 689rpx;
- height: 202rpx;
- border-bottom: 1px solid #e5e5e5;
- padding: 20rpx;
- padding-left: 0;
- display: flex;
- &:last-of-type {
- border-bottom: none;
- }
- .jj-img {
- flex-shrink: 0;
- width: 222rpx;
- height: 158rpx;
- background-color: #bfa;
- border-radius: 10rpx;
- }
- .jj-info {
- width: 450rpx;
- // flex-shrink: 0;
- padding: 10rpx;
- padding-left: 15rpx;
- font-size: 32rpx;
- font-weight: bold;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .jj-tit-tit {
-
- }
- .jj-val {
- padding-top: 20rpx;
- font-size: 28rpx;
- font-weight: 500;
- }
- }
- }
- }
- </style>
|