|
@@ -1,38 +1,43 @@
|
|
|
<template>
|
|
|
- <view class="container">
|
|
|
- <view class="box">
|
|
|
- <view class="imgBox" v-for="(item, index) in dataList" :key="index">
|
|
|
- <image class="imgs" mode="scaleToFill" :src="filesUrl + item.blogPic"></image>
|
|
|
- <text class="name">张曦汐</text>
|
|
|
+ <view class="container" :style="{ backgroundImage: `url(${hgjbj})` }">
|
|
|
+ <uni-section v-for="item in dataList" titleFontSize="16px" class="sectionBox" :title="item.name" type="line">
|
|
|
+ <view class="box">
|
|
|
+ <view class="imgBox" v-for="(i, index) in item.data" :key="index" @click="btn(i)">
|
|
|
+ <image class="imgs" mode="scaleToFill" :src="filesUrl + i.blogPic"></image>
|
|
|
+ <text class="name">{{ i.title }}</text>
|
|
|
+ <text class="name">{{ i.blogDesc }}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </uni-section>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import request from '../../api/cms.js';
|
|
|
import { BASE_URL } from '../../env.js';
|
|
|
+ import requestLogin from '../../api/login.js';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
filesUrl: BASE_URL.fileUrl,
|
|
|
- dataList: []
|
|
|
+ dataList: [],
|
|
|
+ hgjbj: ''
|
|
|
}
|
|
|
},
|
|
|
onShow: function() {},
|
|
|
async mounted() {
|
|
|
- this.getPolicyList({ typeName: 'policy' });
|
|
|
+ const config = await requestLogin.getJson();
|
|
|
+ const { hgjbj } = config.data;
|
|
|
+ this.hgjbj = hgjbj;
|
|
|
+ const res = await request.getsublist({ alias: 'hgjfc' });
|
|
|
+ this.dataList = await Promise.all(res.data.map(async e => {
|
|
|
+ const aliasData = await request.getArticleList({ pageNum: 1, pageSize: 100, typeName: e.alias });
|
|
|
+ return { name: e.typeName, alias: e.alias, data: aliasData.rows };
|
|
|
+ }))
|
|
|
},
|
|
|
methods: {
|
|
|
- // 列表点击函数
|
|
|
- listItemBtn(e) {
|
|
|
- return;
|
|
|
- uni.navigateTo({ url: `/pages/details/index?id=${e.id}` })
|
|
|
- },
|
|
|
- // 搜索函数
|
|
|
- async getPolicyList(e) {
|
|
|
- const res = await request.getArticleList({ pageNum: 1, pageSize: 100, typeName: 'hgjfc' });
|
|
|
- this.dataList = res.rows;
|
|
|
+ btn(e) {
|
|
|
+ // uni.navigateTo({ url: `/pages/details/index?id=${e.id}` })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -43,7 +48,7 @@
|
|
|
width: 100%;
|
|
|
height: 100vh;
|
|
|
overflow-y: auto;
|
|
|
- background-color: darkred;
|
|
|
+ background-size: 100% 100%;
|
|
|
}
|
|
|
.box {
|
|
|
display: flex;
|
|
@@ -53,12 +58,13 @@
|
|
|
width: 30%;
|
|
|
height: 36vw;
|
|
|
margin-left: 2.5%;
|
|
|
- margin-top: 20px;
|
|
|
+ margin-top: 5px;
|
|
|
}
|
|
|
.imgs {
|
|
|
display: block;
|
|
|
width: 100%;
|
|
|
height: 90%;
|
|
|
+ border: 2px solid #CD7F32;
|
|
|
}
|
|
|
.name {
|
|
|
width: 100%;
|
|
@@ -66,4 +72,14 @@
|
|
|
text-align: center;
|
|
|
color: #fff;
|
|
|
}
|
|
|
+ .uni-section {
|
|
|
+ background-color: transparent !important;
|
|
|
+ margin-top: 20px;
|
|
|
+ }
|
|
|
+ .uni-section-header {
|
|
|
+ padding: 0 10px !important;
|
|
|
+ }
|
|
|
+ .uni-section__content-title {
|
|
|
+ color: #fff !important;
|
|
|
+ }
|
|
|
</style>
|