|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="Advertisement">
|
|
|
+ <div v-if="orgin.html" class="Advertisement">
|
|
|
<div class="item">
|
|
|
<section class="title">
|
|
|
<section>电视广告投放简析</section>
|
|
@@ -10,30 +10,7 @@
|
|
|
/>
|
|
|
</section>
|
|
|
<br />
|
|
|
- <div class="article">
|
|
|
- <section
|
|
|
- style="
|
|
|
- line-height: 1.75em;
|
|
|
- margin-bottom: 8px;
|
|
|
- margin-left: 8px;
|
|
|
- margin-right: 8px;
|
|
|
- visibility: visible;
|
|
|
- text-indent: 2em;
|
|
|
- "
|
|
|
- >
|
|
|
- <span
|
|
|
- style="color: rgb(84, 84, 84); font-size: 15px; visibility: visible"
|
|
|
- >根据CTR媒介智讯的数据显示,
|
|
|
- </span>
|
|
|
- <span
|
|
|
- style="font-size: 15px; color: rgb(255, 88, 0); visibility: visible"
|
|
|
- >
|
|
|
- <strong style="visibility: visible">
|
|
|
- 2022年上半年电视广告刊例花费同比下跌14.7%。电视广告自3月份开始环比持续提升,至6月环比上涨2.2%。
|
|
|
- </strong>
|
|
|
- </span>
|
|
|
- </section>
|
|
|
- </div>
|
|
|
+ <div class="article" v-html="orgin.html"></div>
|
|
|
</div>
|
|
|
<div class="item">
|
|
|
<section class="title">
|
|
@@ -49,38 +26,69 @@
|
|
|
<div class="right"></div>
|
|
|
<div class="left">
|
|
|
电视:
|
|
|
- <span> 广告花费品牌榜单 </span>
|
|
|
+ <span> 2022年8月广告花费环比 </span>
|
|
|
+ 上涨 2.2%
|
|
|
</div>
|
|
|
</h4>
|
|
|
<br />
|
|
|
- <h4 style="text-align: center">2022年8月电视广告花费TOP10</h4>
|
|
|
- <br />
|
|
|
- <van-row class="tableHead">
|
|
|
- <van-col span="3">排名</van-col>
|
|
|
- <van-col span="7">品牌</van-col>
|
|
|
- <van-col span="7">费用(万元)</van-col>
|
|
|
- <van-col span="7">同比增量</van-col>
|
|
|
- </van-row>
|
|
|
- <van-row class="tableBody">
|
|
|
- <van-col span="3">1</van-col>
|
|
|
- <van-col span="7">陈李济</van-col>
|
|
|
- <van-col span="7">76246.93</van-col>
|
|
|
- <van-col span="7">12.5%</van-col>
|
|
|
- </van-row>
|
|
|
+ <div ref="adRingRatioCanvas"></div>
|
|
|
</div>
|
|
|
<div class="card">
|
|
|
<h4 class="xifenxinxiTitle">
|
|
|
<div class="right"></div>
|
|
|
<div class="left">
|
|
|
电视:
|
|
|
- <span> 行业(大类)广告花费变化 </span>
|
|
|
+ <span> 广告花费品牌榜单 </span>
|
|
|
</div>
|
|
|
</h4>
|
|
|
- <br />
|
|
|
- <h4 style="text-align: center">2022年8月电视广告TOP10行业(大类)</h4>
|
|
|
- <br />
|
|
|
- <div ref="adTop10" class="">
|
|
|
- <canvas ref="adTop10Canvas"></canvas>
|
|
|
+ <h4
|
|
|
+ v-if="orgin.brand_top"
|
|
|
+ style="text-align: center; margin: 1em 0"
|
|
|
+ v-text="orgin.brand_top.name"
|
|
|
+ ></h4>
|
|
|
+ <van-row v-if="orgin.brand_top" class="tableHead">
|
|
|
+ <van-col span="3">排名</van-col>
|
|
|
+ <van-col span="7">品牌</van-col>
|
|
|
+ <van-col span="7">费用(万元)</van-col>
|
|
|
+ <van-col span="7">环比</van-col>
|
|
|
+ </van-row>
|
|
|
+ <div v-if="orgin.brand_top">
|
|
|
+ <van-row
|
|
|
+ class="tableBody"
|
|
|
+ v-for="(item, i) in orgin.brand_top.list || []"
|
|
|
+ :key="item.name + i"
|
|
|
+ >
|
|
|
+ <van-col span="3" v-text="i + 1"></van-col>
|
|
|
+ <van-col span="7" v-text="item.name"></van-col>
|
|
|
+ <van-col span="7">
|
|
|
+ <counto
|
|
|
+ :startVal="0"
|
|
|
+ :endVal="item.fee.N || 0"
|
|
|
+ :duration="1000"
|
|
|
+ ></counto>
|
|
|
+ <span v-if="item.fee.P">.</span>
|
|
|
+ <counto
|
|
|
+ :startVal="0"
|
|
|
+ :endVal="item.fee.P || 0"
|
|
|
+ :duration="1000"
|
|
|
+ ></counto
|
|
|
+ >{{ item.fee.wei }}
|
|
|
+ </van-col>
|
|
|
+ <van-col span="7">
|
|
|
+ <counto
|
|
|
+ :startVal="0"
|
|
|
+ :endVal="item.huanbi.N || 0"
|
|
|
+ :duration="1000"
|
|
|
+ ></counto>
|
|
|
+ <span v-if="item.huanbi.P">.</span>
|
|
|
+ <counto
|
|
|
+ :startVal="0"
|
|
|
+ :endVal="item.huanbi.P || 0"
|
|
|
+ :duration="1000"
|
|
|
+ ></counto
|
|
|
+ >{{ item.huanbi.wei }}%
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="card">
|
|
@@ -88,57 +96,157 @@
|
|
|
<div class="right"></div>
|
|
|
<div class="left">
|
|
|
电视:
|
|
|
- <span> 2022年8月广告花费环比 </span>
|
|
|
- 上涨 2.2%
|
|
|
+ <span> 行业(大类)广告花费变化 </span>
|
|
|
</div>
|
|
|
</h4>
|
|
|
<br />
|
|
|
- <h4 style="text-align: center">
|
|
|
- 2022年1月-2022年6月电视广告月度花费变化
|
|
|
- </h4>
|
|
|
- <br />
|
|
|
- <canvas ref="adRingRatioCanvas"></canvas>
|
|
|
+ <div ref="adTop10" class="">
|
|
|
+ <div ref="adTop10Canvas"></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div style="text-align: center; height: 1.5em;font-size: 16px ; line-height: 1.5em">
|
|
|
+ 技术支持 汪朝涵:17302954998
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
// @ is an alias to /src
|
|
|
+import counto from "@/components/counto/vue-countTo.vue";
|
|
|
+import watermark from "watermark-package";
|
|
|
import { Col as vanCol, Row as vanRow } from "vant";
|
|
|
import "vant/lib/col/style/index";
|
|
|
import "vant/lib/row/style/index";
|
|
|
|
|
|
-import { advertisementSpendInit, advertisementRingRatioInit } from "./jsx/F2";
|
|
|
+import dayJs from "dayjs";
|
|
|
+
|
|
|
+import { advertisementSpendInit, advertisementRingRatioInit } from "./Charts";
|
|
|
+import { jsonAdvertisement } from "@/api/index";
|
|
|
|
|
|
export default {
|
|
|
name: "Advertisement",
|
|
|
data() {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ orgin: {},
|
|
|
+ };
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.createChart();
|
|
|
+ if (!this.$route.query.auto) return;
|
|
|
+ const time = new dayJs(this.$route.query.date);
|
|
|
+ watermark.setWaterMark({
|
|
|
+ w_texts: ["数据来自大数据平台"],
|
|
|
+ w_options: {
|
|
|
+ w_opacity: "0.3",
|
|
|
+ },
|
|
|
+ });
|
|
|
+ jsonAdvertisement({
|
|
|
+ date: time.format("YYYY-MM"),
|
|
|
+ }).then(r => {
|
|
|
+ const Res = r || {};
|
|
|
+ const brand_top = Res.brand_top || { list: [] };
|
|
|
+ for (let i = 0; i < brand_top.list.length; i++) {
|
|
|
+ brand_top.list[i].fee = this.formatType(brand_top.list[i].fee, 2);
|
|
|
+ brand_top.list[i].huanbi = this.formatType(
|
|
|
+ brand_top.list[i].huanbi * 100,
|
|
|
+ 2
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Res.brand_top = brand_top;
|
|
|
+ this.orgin = Res;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.createChart();
|
|
|
+ window.onresize = () => {
|
|
|
+ watermark.setWaterMark({
|
|
|
+ w_texts: ["数据来自大数据平台"],
|
|
|
+ w_options: {
|
|
|
+ w_opacity: "0.3",
|
|
|
+ },
|
|
|
+ });
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
+ formatNum(num, w) {
|
|
|
+ if (isNaN(num)) return 0;
|
|
|
+ return Number(num).toFixed(w || 4) - 0;
|
|
|
+ },
|
|
|
+ formatType(num, W) {
|
|
|
+ let N = this.formatNum(num, 2);
|
|
|
+ let wei = "";
|
|
|
+ if (N >= 100000000) {
|
|
|
+ N = (N / 100000000).toFixed(W || 2);
|
|
|
+ wei = "亿";
|
|
|
+ } else if (N >= 10000) {
|
|
|
+ N = (N / 10000).toFixed(W || 2);
|
|
|
+ wei = "万";
|
|
|
+ }
|
|
|
+ N = N.toString().split(".");
|
|
|
+ return {
|
|
|
+ N: (N[0] || 0) * 1,
|
|
|
+ P: (N[1] || 0) * 1,
|
|
|
+ wei,
|
|
|
+ };
|
|
|
+ },
|
|
|
createChart() {
|
|
|
let width = this.$refs.adTop10.offsetWidth,
|
|
|
- height = (width / 16) * 9,
|
|
|
- devicePixelRatio = window.devicePixelRatio;
|
|
|
- this.$refs.adTop10Canvas.width = width;
|
|
|
- this.$refs.adTop10Canvas.height = height;
|
|
|
- this.$refs.adRingRatioCanvas.width = width;
|
|
|
- this.$refs.adRingRatioCanvas.height = height;
|
|
|
+ height = (width / 16) * 9;
|
|
|
+ this.$refs.adTop10Canvas.style = `width:${width}px;height:${height}px`;
|
|
|
+ this.$refs.adRingRatioCanvas.style = `width:${width}px;height:${height}px`;
|
|
|
|
|
|
- advertisementSpendInit(this.$refs.adTop10Canvas, devicePixelRatio);
|
|
|
- advertisementRingRatioInit(
|
|
|
- this.$refs.adRingRatioCanvas,
|
|
|
- devicePixelRatio
|
|
|
- );
|
|
|
+ const ringRatioF = [];
|
|
|
+ const ringRatioL = [];
|
|
|
+ const day_hb = this.orgin.day_hb ? this.orgin.day_hb.list : [];
|
|
|
+ for (let i = 0; i < day_hb.length; i++) {
|
|
|
+ const v = day_hb[i];
|
|
|
+ const type = (v.pdt || "").split("-");
|
|
|
+ const type1 = (v.dt || "").split("-");
|
|
|
+ ringRatioF.push({
|
|
|
+ date: v.pdt || "",
|
|
|
+ type: [type[0], type[1]].join("-"),
|
|
|
+ value: v.pfee * 1,
|
|
|
+ });
|
|
|
+ ringRatioL.push({
|
|
|
+ date: v.dt || "",
|
|
|
+ type: [type1[0], type1[1]].join("-"),
|
|
|
+ value: v.fee * 1,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ const lineF = [];
|
|
|
+ const lineL = [];
|
|
|
+ const brand_hb = this.orgin.brand_hb ? this.orgin.brand_hb.list : [];
|
|
|
+ for (let i = 0; i < brand_hb.length; i++) {
|
|
|
+ const v = brand_hb[i];
|
|
|
+ // lineF.push({
|
|
|
+ // date: v.industry_name || "",
|
|
|
+ // type: v.pstart_time,
|
|
|
+ // value: v.pfee * 1,
|
|
|
+ // });
|
|
|
+ lineL.push({
|
|
|
+ date: v.industry_name || "",
|
|
|
+ type: "环比" + v.start_time + " vs " + v.pstart_time,
|
|
|
+ value: v.huanbi * 100,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ lineL.length &&
|
|
|
+ advertisementSpendInit(this.$refs.adTop10Canvas, {
|
|
|
+ L: lineL,
|
|
|
+ F: lineF,
|
|
|
+ name: this.orgin.brand_hb.name,
|
|
|
+ });
|
|
|
+ ringRatioF.length &&
|
|
|
+ ringRatioL.length &&
|
|
|
+ advertisementRingRatioInit(this.$refs.adRingRatioCanvas, {
|
|
|
+ L: ringRatioL,
|
|
|
+ F: ringRatioF,
|
|
|
+ name: this.orgin.day_hb.name,
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
beforeUnmount: function () {},
|
|
|
- components: { vanCol, vanRow },
|
|
|
+ components: { vanCol, vanRow, counto },
|
|
|
};
|
|
|
</script>
|
|
|
|