123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <template>
- <view class="content">
- <view class="main">
- <view v-for="(item, index) in list">
- <view class="item flex" @click="navToList(item.id)">
- <view class="item-left"><image :src="item.image" mode=""></image></view>
- <!-- <view class="item-left"><image :src="item.image_input[0]" mode=""></image></view> -->
- <view class="item-right">
- <view class="item-font clamp">{{item.title}}</view>
- <!-- <view class="item-time">更新时间:{{item.add_time}}</view> -->
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { article,articleList } from '@/api/user.js';
- import { getTime } from '@/utils/rocessor.js';
- export default {
- data() {
- return {
- list: []
- };
- },
- onLoad() {
- this.loadData();
- },
- methods: {
- // 载入数据
- async loadData() {
- let obj = this;
- // article({page:1,limit:1000}).then(({data}) =>{
- articleList({page:1,limit:1000}).then(({data}) =>{
- this.list = data.filter(e => {
- console.log(e.id,'123456789')
- return (e.id !== 0)
- })
- })
- },
- navToList(id) {
- uni.navigateTo({
- // url:'/pages/category/detail?id=' + id
- url: '/pages/category/flList?id=' + id
- });
- }
- }
- };
- </script>
- <style lang="scss">
- page,
- .content {
- height: auto;
- min-height: 100%;
- background: #f5f5f5;
- }
- .main {
- margin-top: 20rpx;
- background: #ffffff;
- .first {
- padding: 50rpx 0 18rpx;
- margin: 0 22rpx;
- border-bottom: 1px solid #e0e0e0;
- .title {
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .image {
- width: 710rpx;
- height: 400rpx;
- background: #4cd964;
- margin-top: 20rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .time {
- margin-top: 20rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- }
- }
- .item {
- padding: 26rpx 0 18rpx;
- margin: 0 22rpx;
- justify-content: flex-start;
- align-items: flex-start;
- border-bottom: 1px solid #e0e0e0;
- .item-left {
- width: 224rpx;
- height: 160rpx;
- background: #DC4D46;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .item-right {
- width: 458rpx;
- height: 160rpx;
- margin-left: 24rpx;
- padding: 18rpx 0;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .item-font {
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .item-time {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- }
- }
- }
- }
- </style>
|