|
@@ -0,0 +1,320 @@
|
|
|
+<template>
|
|
|
+ <van-swipe
|
|
|
+ :style="{ fontSize: fontSize + 'px' }"
|
|
|
+ class="mainBuilding"
|
|
|
+ indicator-color="white"
|
|
|
+ autoplay="10000"
|
|
|
+ >
|
|
|
+ <van-swipe-item v-for="(item, index) in list" :key="index">
|
|
|
+ <div>
|
|
|
+ <van-image
|
|
|
+ :width="fontSize * 4"
|
|
|
+ :height="fontSize * 1.5"
|
|
|
+ :src="logo1"
|
|
|
+ style="vertical-align: middle"
|
|
|
+ />
|
|
|
+ <span style="vertical-align: middle">
|
|
|
+ 陕西广电融媒体集团新媒体数据周报
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="date" v-text="item.dt"></div>
|
|
|
+ <div
|
|
|
+ class="line"
|
|
|
+ :style="{ width: fontSize * 11 + 'px', height: fontSize * 0.06 + 'px' }"
|
|
|
+ ></div>
|
|
|
+ <div class="row">
|
|
|
+ <div class="col col1">
|
|
|
+ <p style="color: red; fontsize: 0.9em; font-weight: bold">
|
|
|
+ 集团旗舰账号
|
|
|
+ </p>
|
|
|
+ <div
|
|
|
+ :style="{
|
|
|
+ borderRight: '1px solid #222',
|
|
|
+ padding: '10px 0',
|
|
|
+ height: fontSize * 3.7 + 20 + 'px',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <van-image
|
|
|
+ :width="fontSize * 3.7"
|
|
|
+ :height="fontSize * 3.7"
|
|
|
+ :src="item.logo"
|
|
|
+ v-if="item.logo"
|
|
|
+ style="vertical-align: middle"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <p style="font-size: 0.8em" v-text="item.matrix_name"></p>
|
|
|
+ </div>
|
|
|
+ <div class="col col2">
|
|
|
+ <van-row class="data">
|
|
|
+ <van-col span="12">
|
|
|
+ 周发稿量
|
|
|
+ <span style="font-size: 2em">{{
|
|
|
+ formatType(item.publish_count['总计'])
|
|
|
+ }}</span>
|
|
|
+ 篇
|
|
|
+ <van-icon
|
|
|
+ name="down"
|
|
|
+ :class="{
|
|
|
+ ro: item.publish_count['总计'] > item.qoq_read_count['总计'],
|
|
|
+ }"
|
|
|
+ :color="
|
|
|
+ item.publish_count['总计'] <= item.qoq_read_count['总计']
|
|
|
+ ? '#00B050'
|
|
|
+ : 'red'
|
|
|
+ "
|
|
|
+ />
|
|
|
+ </van-col>
|
|
|
+ <van-col span="12">
|
|
|
+ 周传播量
|
|
|
+ <span style="font-size: 2em">{{
|
|
|
+ formatType(item.read_count['总计'], 1, true)
|
|
|
+ }}</span>
|
|
|
+ <van-icon
|
|
|
+ name="down"
|
|
|
+ :class="{
|
|
|
+ ro: item.read_count['总计'] > item.qoq_read_count['总计'],
|
|
|
+ }"
|
|
|
+ :color="
|
|
|
+ item.read_count['总计'] <= item.qoq_read_count['总计']
|
|
|
+ ? '#00B050'
|
|
|
+ : 'red'
|
|
|
+ "
|
|
|
+ />
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row class="icon">
|
|
|
+ <van-col offset="6" span="3">
|
|
|
+ <span v-html="rep(icon.weixin)"></span>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="3">
|
|
|
+ <span v-html="rep(icon.weibo)"></span>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="3">
|
|
|
+ <span v-html="rep(icon.douyin)"></span>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="3">
|
|
|
+ <span v-html="rep(icon.kuaishou)"></span>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="3">
|
|
|
+ <span v-html="rep(icon.toutiao)"></span>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="3">
|
|
|
+ <span v-html="rep(icon.bilibili)"></span>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row class="data">
|
|
|
+ <van-col span="6"> 发稿量/篇 </van-col>
|
|
|
+ <div v-for="(v, i) in item.publish_count" :key="i">
|
|
|
+ <van-col span="3" v-if="i !== '总计'">
|
|
|
+ {{ formatType(v) }}
|
|
|
+ <van-icon
|
|
|
+ v-if="v"
|
|
|
+ name="down"
|
|
|
+ :class="{ ro: v > item.qoq_read_count[i] }"
|
|
|
+ :color="v <= item.qoq_read_count[i] ? '#00B050' : 'red'"
|
|
|
+ />
|
|
|
+ <span v-if="!v">/</span>
|
|
|
+ </van-col>
|
|
|
+ </div>
|
|
|
+ </van-row>
|
|
|
+ <van-row class="data">
|
|
|
+ <van-col span="6"> 发稿/阅读量 </van-col>
|
|
|
+ <div v-for="(v, i) in item.read_count" :key="i">
|
|
|
+ <van-col span="3" v-if="i !== '总计'">
|
|
|
+ {{ formatType(v) }}
|
|
|
+ <van-icon
|
|
|
+ v-if="v"
|
|
|
+ name="down"
|
|
|
+ :class="{ ro: v > item.qoq_read_count[i] }"
|
|
|
+ :color="v <= item.qoq_read_count[i] ? '#00B050' : 'red'"
|
|
|
+ />
|
|
|
+ <span v-if="!v">/</span>
|
|
|
+ </van-col>
|
|
|
+ </div>
|
|
|
+ </van-row>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <p style="font-size: 0.5em; text-align: right">
|
|
|
+ <van-icon
|
|
|
+ style="
|
|
|
+ margin-top: -0.1em;
|
|
|
+ transform: rotate(180deg);
|
|
|
+ vertical-align: middle;
|
|
|
+ "
|
|
|
+ name="down"
|
|
|
+ color="red"
|
|
|
+ />
|
|
|
+ 周环比增长
|
|
|
+ <van-icon name="down" color="#00B050" />
|
|
|
+ 周环比下降
|
|
|
+ </p>
|
|
|
+ <div>
|
|
|
+ <div
|
|
|
+ class="top"
|
|
|
+ :style="{
|
|
|
+ height: fontSize * 1.6 + 'px',
|
|
|
+ lineHeight: fontSize * 1.6 + 'px',
|
|
|
+ width: fontSize * 10.13 + 'px',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ 周单片阅读量TOP3
|
|
|
+ </div>
|
|
|
+ <van-list style="font-size: 0.5em; padding-left: 5em">
|
|
|
+ <div
|
|
|
+ v-for="(v, i) in item.articles"
|
|
|
+ :key="i"
|
|
|
+ class="topItem"
|
|
|
+ :style="{ fontSize: fontSize * 0.5 + 'px' }"
|
|
|
+ v-text="i + 1 + '. ' + v.title"
|
|
|
+ ></div>
|
|
|
+ </van-list>
|
|
|
+ </div>
|
|
|
+ </van-swipe-item>
|
|
|
+ </van-swipe>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {
|
|
|
+ Swipe as VanSwipe,
|
|
|
+ SwipeItem as VanSwipeItem,
|
|
|
+ Image as VanImage,
|
|
|
+ Col as VanCol,
|
|
|
+ Row as VanRow,
|
|
|
+ Icon as VanIcon,
|
|
|
+ List as VanList,
|
|
|
+} from 'vant';
|
|
|
+import { getZhoubao } from '@/api/index';
|
|
|
+import logo1 from '@/assets/image/logo1.png';
|
|
|
+import icon from './icon';
|
|
|
+import Dayjs from 'dayjs';
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'MainBuilding',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ logo1,
|
|
|
+ icon,
|
|
|
+ list: [],
|
|
|
+ fontSize: document.body.offsetWidth * 0.03,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ window.onresize = () => {
|
|
|
+ this.fontSize = document.body.offsetWidth * 0.03;
|
|
|
+ };
|
|
|
+
|
|
|
+ const d = new Dayjs();
|
|
|
+
|
|
|
+ getZhoubao(d.format('YYYY-MM-DD')).then(r => {
|
|
|
+ console.log(r);
|
|
|
+ this.list = r || [];
|
|
|
+ });
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+ methods: {
|
|
|
+ rep(html) {
|
|
|
+ return html.replace(/---/g, this.fontSize * 2);
|
|
|
+ },
|
|
|
+ formatNum(num, w) {
|
|
|
+ if (isNaN(num)) return 0;
|
|
|
+ return Number(num).toFixed(w || 2) - 0;
|
|
|
+ },
|
|
|
+ formatType(num, W) {
|
|
|
+ let N = this.formatNum(num, 1);
|
|
|
+ if (N >= 100000000) {
|
|
|
+ N = (N / 100000000).toFixed(W || 1) + '亿';
|
|
|
+ } else if (N >= 10000) {
|
|
|
+ N = (N / 10000).toFixed(W || 1) + '万';
|
|
|
+ }
|
|
|
+ return N || ''
|
|
|
+ },
|
|
|
+ },
|
|
|
+ beforeUnmount: function () {},
|
|
|
+ components: {
|
|
|
+ VanSwipe,
|
|
|
+ VanSwipeItem,
|
|
|
+ VanImage,
|
|
|
+ VanIcon,
|
|
|
+ VanCol,
|
|
|
+ VanRow,
|
|
|
+ VanList,
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+.mainBuilding {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
|
|
|
+ Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'miui',
|
|
|
+ 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
|
|
|
+}
|
|
|
+
|
|
|
+.mainBuilding * {
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+.mainBuilding .van-swipe-item {
|
|
|
+ color: #000;
|
|
|
+ height: 100%;
|
|
|
+ padding: 20px;
|
|
|
+ background-color: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.mainBuilding .line {
|
|
|
+ background-color: #dc781d;
|
|
|
+}
|
|
|
+.mainBuilding .date {
|
|
|
+ font-size: 0.4em;
|
|
|
+ text-align: right;
|
|
|
+ padding: 0.5em 0 0.1em 0;
|
|
|
+}
|
|
|
+.mainBuilding .col {
|
|
|
+ display: inline-block;
|
|
|
+ padding: 15px 0;
|
|
|
+ vertical-align: top;
|
|
|
+ white-space: nowrap;
|
|
|
+}
|
|
|
+.mainBuilding .col1 {
|
|
|
+ width: 30%;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.mainBuilding .col2 {
|
|
|
+ width: 70%;
|
|
|
+ font-size: 0.6em;
|
|
|
+}
|
|
|
+.mainBuilding .van-image {
|
|
|
+ display: inline-block;
|
|
|
+}
|
|
|
+.mainBuilding .data .van-col {
|
|
|
+ height: 2.5em;
|
|
|
+ line-height: 2.5em;
|
|
|
+}
|
|
|
+.mainBuilding .data {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.mainBuilding .icon {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.mainBuilding .ro {
|
|
|
+ margin-top: -0.3em;
|
|
|
+ transform: rotate(180deg);
|
|
|
+ vertical-align: middle;
|
|
|
+}
|
|
|
+.mainBuilding .top {
|
|
|
+ background-color: #5a80a7;
|
|
|
+ font-size: 0.5em;
|
|
|
+ color: #fff;
|
|
|
+ border-radius: 0.3em;
|
|
|
+ text-align: center;
|
|
|
+ margin-bottom: 0.5em;
|
|
|
+}
|
|
|
+.mainBuilding .topItem {
|
|
|
+ height: 2.5em;
|
|
|
+ line-height: 2.5em;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+}
|
|
|
+</style>
|