|
@@ -7,7 +7,8 @@
|
|
|
<h5>最新文档</h5>
|
|
|
</div>
|
|
|
<div class="list-group flex-c-c">
|
|
|
- <div class="list-item flex-r-c" v-for="item in pageData.new" :key="item.id" @click="goContent(item)">
|
|
|
+ <van-skeleton class="van-loading-skeleton line-style" :row="5" :loading="showLoading.new">
|
|
|
+ <div class="list-item flex-r-c" v-for="item in pageData.new" :key="item.id" @click="goContent(item)">
|
|
|
<div class="flex flex-r-c center left">
|
|
|
<van-icon :name="'diy-' + item.type" />
|
|
|
<div class="flex">
|
|
@@ -19,6 +20,7 @@
|
|
|
<span>{{item.money}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </van-skeleton>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="hot-group base-group">
|
|
@@ -27,7 +29,8 @@
|
|
|
<h5>热门下载</h5>
|
|
|
</div>
|
|
|
<div class="list-group flex-c-c">
|
|
|
- <div class="list-item flex-r-c" v-for="item in pageData.new" :key="item.id" @click="goContent(item)">
|
|
|
+ <van-skeleton class="van-loading-skeleton line-style" :row="5" :loading="showLoading.hot">
|
|
|
+ <div class="list-item flex-r-c" v-for="item in pageData.hot" :key="item.id" @click="goContent(item)">
|
|
|
<div class="flex flex-r-c center left">
|
|
|
<van-icon :name="'diy-' + item.type" />
|
|
|
<div class="flex">
|
|
@@ -39,6 +42,7 @@
|
|
|
<span>{{item.money}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </van-skeleton>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="keep-group base-group">
|
|
@@ -47,7 +51,11 @@
|
|
|
<h5>精选推荐</h5>
|
|
|
</div>
|
|
|
<div class="list-group card-group flex-c-c">
|
|
|
- <div class="card-item flex-r-c" v-for="item in pageData.new" :key="item.id" @click="goContent(item)">
|
|
|
+ <van-skeleton avatar avatar-shape="square" class="van-loading-skeleton card-style"
|
|
|
+ :row="4"
|
|
|
+ :row-width="rowWidth"
|
|
|
+ :loading="showLoading.keep">
|
|
|
+ <div class="card-item flex-r-c" v-for="item in pageData.keep" :key="item.id" @click="goContent(item)">
|
|
|
<div class="mini-img-group">
|
|
|
<img :src="item.img" alt="">
|
|
|
<van-icon :name="'diy-' + item.type" />
|
|
@@ -57,8 +65,12 @@
|
|
|
<div class="title-text van-multi-ellipsis--l2">{{item.title}}</div>
|
|
|
</div>
|
|
|
<div class="flex-c-c info-text">
|
|
|
- <span>贡献者: dshasjhd</span>
|
|
|
- <span>贡献者: dshasjhd | dshasjhd | 200k</span>
|
|
|
+ <span v-if="item.contribution">贡献者: {{item.contribution}}</span>
|
|
|
+ <div class="info-text-group flex-r-c center left">
|
|
|
+ <span v-if="item.down">{{item.down}}次下载</span>
|
|
|
+ <span v-if="item.page">共{{item.page}}页</span>
|
|
|
+ <span v-if="item.size">{{item.size | sizeFormatter}}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="money-group flex-r-c center left">
|
|
|
<van-icon class="s20" name="diy-iconJianYu" />
|
|
@@ -66,6 +78,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </van-skeleton>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -74,19 +87,20 @@
|
|
|
<script lang="ts">
|
|
|
import { Component, Vue } from 'vue-property-decorator'
|
|
|
import Search from '@/components/Search.vue'
|
|
|
-// import { Cell, CellGroup, Icon, Dialog, Toast } from 'vant'
|
|
|
-import { Icon } from 'vant'
|
|
|
-import { mapActions } from 'vuex'
|
|
|
- // import { MixinTop } from '@/utils/mixin-top'
|
|
|
+import { Icon, Skeleton } from 'vant'
|
|
|
+import { mapActions, mapState } from 'vuex'
|
|
|
@Component({
|
|
|
name: 'home',
|
|
|
- // mixins: [MixinTop],
|
|
|
components: {
|
|
|
- // [Cell.name]: Cell,
|
|
|
- // [CellGroup.name]: CellGroup,
|
|
|
[Icon.name]: Icon,
|
|
|
+ [Skeleton.name]: Skeleton,
|
|
|
Search
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ...mapState('main', {
|
|
|
+ pageData: (state: any) => state.homePageData
|
|
|
+ })
|
|
|
+ },
|
|
|
methods: {
|
|
|
...mapActions({
|
|
|
ajaxData: 'main/getHome'
|
|
@@ -95,52 +109,20 @@ import { mapActions } from 'vuex'
|
|
|
})
|
|
|
|
|
|
export default class extends Vue {
|
|
|
- pageData: any = {}
|
|
|
ajaxData: any
|
|
|
+ pageData: any
|
|
|
+ rowWidth = ['100%', '20%', '40%', '15%']
|
|
|
|
|
|
created () {
|
|
|
- console.log('111')
|
|
|
- this.ajaxData().then((res: any) => {
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
- this.pageData = {
|
|
|
- new: [
|
|
|
- {
|
|
|
- img: require('@/assets/images/bgApp.png'),
|
|
|
- type: 'pdf',
|
|
|
- id: '1',
|
|
|
- title: '优化招投标市场营商环境与国企优化招投标市场营商环境与国企...',
|
|
|
- money: 200000
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'excel',
|
|
|
- img: require('@/assets/images/bgApp.png'),
|
|
|
- id: '2',
|
|
|
- title: '优化招投标市场营商环境与国企优化招投标市场营商环境与国企...',
|
|
|
- money: 200
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'word',
|
|
|
- img: require('@/assets/images/bgApp.png'),
|
|
|
- id: '3',
|
|
|
- title: '优化招投标市场营商环境与国企优化招投标市场营商环境与国企...',
|
|
|
- money: 200
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'ppt',
|
|
|
- img: require('@/assets/images/bgApp.png'),
|
|
|
- id: '4',
|
|
|
- title: '优化招投标市场营商环境与国企优化招投标市场营商环境与国企...',
|
|
|
- money: 200
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'other',
|
|
|
- img: require('@/assets/images/bgApp.png'),
|
|
|
- id: '5',
|
|
|
- title: '优化招投标市场营商环境与国企优化招投标市场营商环境与国企...',
|
|
|
- money: 200
|
|
|
- }
|
|
|
- ]
|
|
|
+ this.ajaxData()
|
|
|
+ }
|
|
|
+
|
|
|
+ get showLoading () {
|
|
|
+ const s = this.pageData
|
|
|
+ return {
|
|
|
+ new: !s?.new,
|
|
|
+ hot: !s?.hot,
|
|
|
+ keep: !s?.keep
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -161,6 +143,21 @@ export default class extends Vue {
|
|
|
padding-bottom: 40px;
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
+ ::v-deep .van-loading-skeleton {
|
|
|
+ &.line-style {
|
|
|
+ .van-skeleton__row {
|
|
|
+ width: 100% !important;
|
|
|
+ height: 28px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &.card-style {
|
|
|
+ .van-skeleton__avatar {
|
|
|
+ width: 100px !important;
|
|
|
+ height: 124px !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@include diy-icon('iconJianYu', 16, 16);
|
|
|
|
|
|
.van-icon-diy-iconJianYu.s20 {
|
|
@@ -176,11 +173,6 @@ export default class extends Vue {
|
|
|
.base-group {
|
|
|
padding: 4px 19px 4px 16px;
|
|
|
box-sizing: border-box;
|
|
|
-
|
|
|
- &.new-group {
|
|
|
- margin-top: $topSearchHeight;
|
|
|
- }
|
|
|
-
|
|
|
.list-group {
|
|
|
border-radius: 8px;
|
|
|
background: #FFFFFF;
|
|
@@ -205,6 +197,7 @@ export default class extends Vue {
|
|
|
}
|
|
|
}
|
|
|
.card-item {
|
|
|
+ justify-content: flex-start;
|
|
|
padding: 8px 16px 12px 0;
|
|
|
box-sizing: border-box;
|
|
|
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
|
@@ -234,6 +227,20 @@ export default class extends Vue {
|
|
|
bottom: 0;
|
|
|
}
|
|
|
}
|
|
|
+ .info-text-group {
|
|
|
+ span {
|
|
|
+ display: inline-block;
|
|
|
+ &:last-child {
|
|
|
+ &::after {
|
|
|
+ content: unset;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &::after {
|
|
|
+ content: "|";
|
|
|
+ padding: 0 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
.info-text {
|
|
|
color: #9B9CA3;
|
|
|
font-family: PingFang SC;
|