1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <template>
- <view class="container">
- <view v-if="list.length > 0" class="list-box flex_item" v-for="(ls,index) in list" :key='index' @click="nav(index)">
- <image :src="ls.image_input[0]"></image>
- <view class="list-item">
- <view class="title ellipsis">{{ls.title}}</view>
- <!-- <view class="time">{{ls.add_time}}</view> -->
- </view>
- </view>
- <view class="empty-box" v-show="list.length === 0"><empty></empty></view>
- </view>
- </template>
- <script>
- import { article } from '@/api/index.js';
- import empty from '@/components/empty';
- export default {
- components: {
- empty
- },
- data() {
- return {
- list:''
- };
- },
- onLoad(option){
- this.loadData();
- },
- onShow() {
-
- },
- methods: {
- // 请求载入数据
- async loadData() {
- let obj = this;
- article({
- page:1,
- limit:10000
- },3).then(({ data }) => {
- console.log(data)
- obj.list = data;
- });
- },
- nav(index){
- uni.navigateTo({
- url: '/pages/index/informationDetails?id=' + this.list[index].id
- })
- },
- }
- };
- </script>
- <style lang="scss">
- page {
- min-height: 100%;
- background-color: #ffffff;
- .container {
- width: 100%;
- padding: 25rpx 27rpx;
-
- }
- }
- .empty-box{
- margin-top: 100rpx;
- width: 100%;
- height: 500rpx;
- }
- .list-box{
- border-bottom: 1rpx solid #E3E3E3;
- margin-bottom: 25rpx;
- padding-bottom: 25rpx;
- image{
- width: 200rpx;
- height: 160rpx;
- border-radius: 15rpx;
- }
- .list-item{
- padding-left: 16rpx;
- width: 80%;
- .title{
- height: 80rpx;
- color: #333333;
- font-size: 30rpx;
- font-weight: 500;
- }
- .time{
- padding-top: 40rpx;
- color: #999999;
- font-size: 24rpx;
- }
- }
- }
- </style>
|