153 lines
2.8 KiB
Vue
153 lines
2.8 KiB
Vue
<template>
|
|
<view class="content">
|
|
<view class="container">
|
|
<headers :titles="titles"><uni-icons @click="goExit()" type="arrow-left" color="#000000"
|
|
size="22px"></uni-icons></headers>
|
|
<u-loadmore :status="status" v-if="show == true" />
|
|
</view>
|
|
|
|
<view v-for="item in textList" class="text-info">
|
|
<view @click="goTextContent(item.id, item.content)" class="text-info-list">
|
|
<view class="info-list">
|
|
<image class="info-list-img" :src="baseUrl+item.cover" mode=""></image>
|
|
</view>
|
|
<view class="info-right">
|
|
<view class="info-right-name">
|
|
{{item.title}}
|
|
</view>
|
|
<view class="info-right-time">
|
|
{{item.updateTime}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import headers from '../../components/header/headers.vue'
|
|
import tabbar from '../../components/tabbar/tabbar.vue'
|
|
import request from '@/utils/request.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
titles: "平台公告",
|
|
baseUrl: this.$baseUrl,
|
|
msg: "1",
|
|
List: [],
|
|
show: false,
|
|
status: 'loading',
|
|
textList: [],
|
|
}
|
|
},
|
|
onShow() {
|
|
// this.actList = ["1", "1", "1", "1", "1", ]
|
|
// this.status = "nomore" 底部刷新结束
|
|
this.getTextList()
|
|
},
|
|
onPullDownRefresh() {
|
|
console.log("刷新");
|
|
uni.stopPullDownRefresh()
|
|
},
|
|
onReachBottom() {
|
|
// this.show = true
|
|
setTimeout(() => {
|
|
console.log("加载执行");
|
|
}, 2000)
|
|
},
|
|
// 发送好友
|
|
onShareAppMessage(res) {
|
|
return {
|
|
title: this.titles,
|
|
path: '/pages/index/index',
|
|
}
|
|
},
|
|
// 分享朋友圈
|
|
onShareTimeline(res) {
|
|
return {
|
|
title: this.titles,
|
|
path: '/pages/index/index',
|
|
}
|
|
},
|
|
components: {
|
|
headers,
|
|
tabbar
|
|
},
|
|
methods: {
|
|
goExit() {
|
|
uni.navigateBack()
|
|
},
|
|
goback() {
|
|
uni.navigateBack()
|
|
},
|
|
async getTextList() {
|
|
let res = await request({
|
|
url: '/drivingSchool/text/list',
|
|
method: 'get'
|
|
})
|
|
this.textList = res.rows
|
|
},
|
|
goTextContent(id, content) {
|
|
uni.navigateTo({
|
|
url: `/pages/index/TextContrnt?id=${id}`
|
|
})
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.text-info {
|
|
padding: 20rpx;
|
|
|
|
.text-info-list {
|
|
|
|
padding: 20rpx;
|
|
background-color: #fff;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
height: 180rpx;
|
|
border-bottom: 1px solid #aaa;
|
|
|
|
|
|
.info-list {
|
|
flex: 1.8;
|
|
|
|
.info-list-img {
|
|
height: 100%;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
.info-right {
|
|
flex: 3;
|
|
margin-left: 80rpx;
|
|
display: flex;
|
|
flex-direction: column;
|
|
|
|
justify-content: space-between;
|
|
|
|
.info-right-name {}
|
|
|
|
.info-right-time {
|
|
text-align: end;
|
|
font-size: 24rpx;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
.content {
|
|
|
|
|
|
height: 100vh;
|
|
}
|
|
|
|
.container {
|
|
width: 100%;
|
|
background: #f4f5f6;
|
|
box-sizing: border-box;
|
|
padding-top: 88px;
|
|
}
|
|
</style> |