Browse Source

页面优化

master
xuhuajiao 3 weeks ago
parent
commit
3fc0f1352d
  1. 539
      src/assets/iconfont/demo.css
  2. 488
      src/assets/iconfont/demo_index.html
  3. 13
      src/assets/styles/index.scss
  4. 5
      src/views/accessToLibrary/index.vue
  5. 82
      src/views/index.vue
  6. 68
      src/views/indexSelfService.vue
  7. 104
      src/views/lengingRanking/index-old.vue
  8. 104
      src/views/lengingRanking/index.vue
  9. 1021
      src/views/newBookRecommend/data.json
  10. 624
      src/views/newBookRecommend/index.vue
  11. 202
      src/views/readStar/index-height.vue
  12. 3
      src/views/video/index.vue

539
src/assets/iconfont/demo.css

@ -1,539 +0,0 @@
/* Logo 字体 */
@font-face {
font-family: "iconfont logo";
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
}
.logo {
font-family: "iconfont logo";
font-size: 160px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* tabs */
.nav-tabs {
position: relative;
}
.nav-tabs .nav-more {
position: absolute;
right: 0;
bottom: 0;
height: 42px;
line-height: 42px;
color: #666;
}
#tabs {
border-bottom: 1px solid #eee;
}
#tabs li {
cursor: pointer;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 16px;
border-bottom: 2px solid transparent;
position: relative;
z-index: 1;
margin-bottom: -1px;
color: #666;
}
#tabs .active {
border-bottom-color: #f00;
color: #222;
}
.tab-container .content {
display: none;
}
/* 页面布局 */
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main .logo {
color: #333;
text-align: left;
margin-bottom: 30px;
line-height: 1;
height: 110px;
margin-top: -50px;
overflow: hidden;
*zoom: 1;
}
.main .logo a {
font-size: 160px;
color: #333;
}
.helps {
margin-top: 40px;
}
.helps pre {
padding: 20px;
margin: 10px 0;
border: solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists {
width: 100% !important;
overflow: hidden;
*zoom: 1;
}
.icon_lists li {
width: 100px;
margin-bottom: 10px;
margin-right: 20px;
text-align: center;
list-style: none !important;
cursor: default;
}
.icon_lists li .code-name {
line-height: 1.2;
}
.icon_lists .icon {
display: block;
height: 100px;
line-height: 100px;
font-size: 42px;
margin: 10px auto;
color: #333;
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition: font-size 0.25s linear, width 0.25s linear;
transition: font-size 0.25s linear, width 0.25s linear;
}
.icon_lists .icon:hover {
font-size: 100px;
}
.icon_lists .svg-icon {
/* 通过设置 font-size 来改变图标大小 */
width: 1em;
/* 图标和文字相邻时,垂直对齐 */
vertical-align: -0.15em;
/* 通过设置 color 来改变 SVG 的颜色/fill */
fill: currentColor;
/* path stroke 溢出 viewBox 部分在 IE 下会显示
normalize.css 中也包含这行 */
overflow: hidden;
}
.icon_lists li .name,
.icon_lists li .code-name {
color: #666;
}
/* markdown 样式 */
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p {
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
width: 80%;
}
.markdown ul>li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown>table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown>table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown>table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown>br,
.markdown>p>br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
/* 代码高亮 */
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

488
src/assets/iconfont/demo_index.html

@ -1,488 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>iconfont Demo</title>
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg" type="image/x-icon"/>
<link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg"/>
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
<link rel="stylesheet" href="demo.css">
<link rel="stylesheet" href="iconfont.css">
<script src="iconfont.js"></script>
<!-- jQuery -->
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
<!-- 代码高亮 -->
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script>
<style>
.main .logo {
margin-top: 0;
height: auto;
}
.main .logo a {
display: flex;
align-items: center;
}
.main .logo .sub-title {
margin-left: 0.5em;
font-size: 22px;
color: #fff;
background: linear-gradient(-45deg, #3967FF, #B500FE);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
</style>
</head>
<body>
<div class="main">
<h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">
<img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01Mn65HV1FfSEzR6DKv_!!6000000000514-55-tps-228-59.svg">
</a></h1>
<div class="nav-tabs">
<ul id="tabs" class="dib-box">
<li class="dib active"><span>Unicode</span></li>
<li class="dib"><span>Font class</span></li>
<li class="dib"><span>Symbol</span></li>
</ul>
<a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=3646564" target="_blank" class="nav-more">查看项目</a>
</div>
<div class="tab-container">
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe636;</span>
<div class="name">no.2</div>
<div class="code-name">&amp;#xe636;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe637;</span>
<div class="name">2</div>
<div class="code-name">&amp;#xe637;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe634;</span>
<div class="name">键盘</div>
<div class="code-name">&amp;#xe634;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe630;</span>
<div class="name">关闭</div>
<div class="code-name">&amp;#xe630;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe631;</span>
<div class="name"></div>
<div class="code-name">&amp;#xe631;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe632;</span>
<div class="name">本架图书</div>
<div class="code-name">&amp;#xe632;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe633;</span>
<div class="name">热门</div>
<div class="code-name">&amp;#xe633;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe62f;</span>
<div class="name"></div>
<div class="code-name">&amp;#xe62f;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe628;</span>
<div class="name">通知</div>
<div class="code-name">&amp;#xe628;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe629;</span>
<div class="name">no.3</div>
<div class="code-name">&amp;#xe629;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe62b;</span>
<div class="name">no.1</div>
<div class="code-name">&amp;#xe62b;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe62d;</span>
<div class="name">3</div>
<div class="code-name">&amp;#xe62d;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe62e;</span>
<div class="name">1</div>
<div class="code-name">&amp;#xe62e;</div>
</li>
</ul>
<div class="article markdown">
<h2 id="unicode-">Unicode 引用</h2>
<hr>
<p>Unicode 是字体在网页端最原始的应用方式,特点是:</p>
<ul>
<li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
<li>默认情况下不支持多色,直接添加多色图标会自动去色。</li>
</ul>
<blockquote>
<p>注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)</p>
</blockquote>
<p>Unicode 使用步骤如下:</p>
<h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3>
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.woff2?t=1663379994606') format('woff2'),
url('iconfont.woff?t=1663379994606') format('woff'),
url('iconfont.ttf?t=1663379994606') format('truetype'),
url('iconfont.svg?t=1663379994606#iconfont') format('svg');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
<pre><code class="language-css"
>.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
</code></pre>
<h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
<pre>
<code class="language-html"
>&lt;span class="iconfont"&gt;&amp;#x33;&lt;/span&gt;
</code></pre>
<blockquote>
<p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
</blockquote>
</div>
</div>
<div class="content font-class">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-a-no21"></span>
<div class="name">
no.2
</div>
<div class="code-name">.icon-a-no21
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-21"></span>
<div class="name">
2
</div>
<div class="code-name">.icon-a-21
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-jianpan"></span>
<div class="name">
键盘
</div>
<div class="code-name">.icon-jianpan
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-guanbi"></span>
<div class="name">
关闭
</div>
<div class="code-name">.icon-guanbi
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-zuo"></span>
<div class="name">
</div>
<div class="code-name">.icon-zuo
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-benjiatushu"></span>
<div class="name">
本架图书
</div>
<div class="code-name">.icon-benjiatushu
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-remen"></span>
<div class="name">
热门
</div>
<div class="code-name">.icon-remen
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-you"></span>
<div class="name">
</div>
<div class="code-name">.icon-you
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-tongzhi"></span>
<div class="name">
通知
</div>
<div class="code-name">.icon-tongzhi
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-no3"></span>
<div class="name">
no.3
</div>
<div class="code-name">.icon-a-no3
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-no1"></span>
<div class="name">
no.1
</div>
<div class="code-name">.icon-a-no1
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-3"></span>
<div class="name">
3
</div>
<div class="code-name">.icon-a-3
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-1"></span>
<div class="name">
1
</div>
<div class="code-name">.icon-a-1
</div>
</li>
</ul>
<div class="article markdown">
<h2 id="font-class-">font-class 引用</h2>
<hr>
<p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p>
<p>与 Unicode 使用方式相比,具有如下特点:</p>
<ul>
<li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li>
<li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li>
</ul>
<p>使用步骤如下:</p>
<h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3>
<pre><code class="language-html">&lt;link rel="stylesheet" href="./iconfont.css"&gt;
</code></pre>
<h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
<pre><code class="language-html">&lt;span class="iconfont icon-xxx"&gt;&lt;/span&gt;
</code></pre>
<blockquote>
<p>"
iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
</blockquote>
</div>
</div>
<div class="content symbol">
<ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-no21"></use>
</svg>
<div class="name">no.2</div>
<div class="code-name">#icon-a-no21</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-21"></use>
</svg>
<div class="name">2</div>
<div class="code-name">#icon-a-21</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-jianpan"></use>
</svg>
<div class="name">键盘</div>
<div class="code-name">#icon-jianpan</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-guanbi"></use>
</svg>
<div class="name">关闭</div>
<div class="code-name">#icon-guanbi</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-zuo"></use>
</svg>
<div class="name"></div>
<div class="code-name">#icon-zuo</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-benjiatushu"></use>
</svg>
<div class="name">本架图书</div>
<div class="code-name">#icon-benjiatushu</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-remen"></use>
</svg>
<div class="name">热门</div>
<div class="code-name">#icon-remen</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-you"></use>
</svg>
<div class="name"></div>
<div class="code-name">#icon-you</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-tongzhi"></use>
</svg>
<div class="name">通知</div>
<div class="code-name">#icon-tongzhi</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-no3"></use>
</svg>
<div class="name">no.3</div>
<div class="code-name">#icon-a-no3</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-no1"></use>
</svg>
<div class="name">no.1</div>
<div class="code-name">#icon-a-no1</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-3"></use>
</svg>
<div class="name">3</div>
<div class="code-name">#icon-a-3</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-1"></use>
</svg>
<div class="name">1</div>
<div class="code-name">#icon-a-1</div>
</li>
</ul>
<div class="article markdown">
<h2 id="symbol-">Symbol 引用</h2>
<hr>
<p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p>
<ul>
<li>支持多色图标了,不再受单色限制。</li>
<li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li>
<li>兼容性较差,支持 IE9+,及现代浏览器。</li>
<li>浏览器渲染 SVG 的性能一般,还不如 png。</li>
</ul>
<p>使用步骤如下:</p>
<h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3>
<pre><code class="language-html">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;
</code></pre>
<h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3>
<pre><code class="language-html">&lt;style&gt;
.icon {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
&lt;/style&gt;
</code></pre>
<h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
<pre><code class="language-html">&lt;svg class="icon" aria-hidden="true"&gt;
&lt;use xlink:href="#icon-xxx"&gt;&lt;/use&gt;
&lt;/svg&gt;
</code></pre>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('.tab-container .content:first').show()
$('#tabs li').click(function (e) {
var tabContent = $('.tab-container .content')
var index = $(this).index()
if ($(this).hasClass('active')) {
return
} else {
$('#tabs li').removeClass('active')
$(this).addClass('active')
tabContent.hide().eq(index).fadeIn()
}
})
})
</script>
</body>
</html>

13
src/assets/styles/index.scss

@ -109,13 +109,16 @@
.screen-main{ .screen-main{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
height: calc(100% - 91px);
height: calc(100% - 1.38rem);
margin: 0.0625rem 0 0.5rem 0; margin: 0.0625rem 0 0.5rem 0;
padding: 0 0.325rem; padding: 0 0.325rem;
overflow: hidden; overflow: hidden;
.screen-left, .screen-left,
.screen-right{ .screen-right{
width: 6.375rem; width: 6.375rem;
display: flex;
flex-direction: column;
justify-content: space-between;
} }
.screen-middle{ .screen-middle{
flex: 1; flex: 1;
@ -146,15 +149,15 @@
height: 3.75rem; height: 3.75rem;
} }
.medium-module{ .medium-module{
height: 4.125rem;
height: 4.25rem;
} }
.big-module{ .big-module{
height: 6.8125rem;
// margin:0.1625rem 0;
// height: 6.8125rem;
} }
//排行榜-推荐 - list //排行榜-推荐 - list
.lending-ranking{ .lending-ranking{
flex: 1;
.module-content{ .module-content{
padding: 0 0.25rem; padding: 0 0.25rem;
overflow: hidden; overflow: hidden;
@ -230,7 +233,7 @@
// 视频 // 视频
.video-box{ .video-box{
width: 100%; width: 100%;
height: 5.2125rem;
height: 5.15rem;
} }
// 阅读之星 // 阅读之星

5
src/views/accessToLibrary/index.vue

@ -64,6 +64,7 @@ export default {
}, },
methods: { methods: {
getInitIntoNum() { getInitIntoNum() {
// http://192.168.99.118:8080/#/?doorCodes=D001&D002&D007&startTime=2023-01-01&endTime=2023-08-31
// this.otherDoorOther = window.location.href.split('?')[1]?.split('=')[1] // this.otherDoorOther = window.location.href.split('?')[1]?.split('=')[1]
const currentURL = window.location.href const currentURL = window.location.href
console.log(currentURL) console.log(currentURL)
@ -96,12 +97,16 @@ export default {
const startTime = this.$route.query.startTime const startTime = this.$route.query.startTime
const endTime = this.$route.query.endTime const endTime = this.$route.query.endTime
console.log('otherDoorOther', this.otherDoorOther)
if (this.otherDoorOther && this.otherDoorOther !== '' && this.otherDoorOther.indexOf('&')) { if (this.otherDoorOther && this.otherDoorOther !== '' && this.otherDoorOther.indexOf('&')) {
this.otherDoorOther = this.otherDoorOther.replace(/\&/g, '、') this.otherDoorOther = this.otherDoorOther.replace(/\&/g, '、')
} else { } else {
this.otherDoorOther = null this.otherDoorOther = null
} }
console.log('otherDoorOther2', this.otherDoorOther)
let params let params
if (!this.isSelfService) { if (!this.isSelfService) {
params = { params = {

82
src/views/index.vue

@ -4,16 +4,24 @@
<div class="screen-main"> <div class="screen-main">
<div class="screen-left"> <div class="screen-left">
<TotalLending /> <TotalLending />
<LengingRanking />
<LengingRanking
ref="rankingRef"
:container-height="rankingHeight"
/>
</div> </div>
<div class="screen-middle"> <div class="screen-middle">
<AccessToLibrary :is-self-service="false" /> <AccessToLibrary :is-self-service="false" />
<Video /> <Video />
<!-- ref="readStarRef"
:container-height="readStarHeight" -->
<ReadStar /> <ReadStar />
</div> </div>
<div class="screen-right"> <div class="screen-right">
<Notice /> <Notice />
<NewBookRecommend />
<NewBookRecommend
ref="newBookRef"
:container-height="newBookHeight"
/>
</div> </div>
</div> </div>
</div> </div>
@ -42,14 +50,82 @@ export default {
}, },
data() { data() {
return { return {
headerTitle: '东西湖区图书馆'
headerTitle: '东西湖区图书馆',
newBookHeight: 0, //
rankingHeight: 0,
readStarHeight: 0
} }
}, },
created() { created() {
}, },
mounted() { mounted() {
this.$nextTick(() => {
this.calcNewBookHeight()
this.calcRankingHeight()
this.calcReadStarHeight() //
})
window.addEventListener('resize', () => {
this.calcNewBookHeight()
this.calcRankingHeight()
this.calcReadStarHeight() //
})
},
beforeDestroy() {
// 使
const resizeHandler = () => {
this.calcNewBookHeight()
this.calcRankingHeight()
this.calcReadStarHeight()
}
window.removeEventListener('resize', resizeHandler)
}, },
methods: { methods: {
calcRankingHeight() {
if (this.$refs.rankingRef) {
const rankingEl = this.$refs.rankingRef.$el
if (rankingEl) {
const totalHeight = rankingEl.clientHeight
const titleEl = rankingEl.querySelector('.common-title')
const titleHeight = titleEl ? titleEl.clientHeight : 0.475 * 16
this.rankingHeight = totalHeight - titleHeight
if (this.$refs.rankingRef.updateHeight) {
this.$refs.rankingRef.updateHeight(this.rankingHeight)
}
}
}
},
calcNewBookHeight() {
if (this.$refs.newBookRef) {
const newBookEl = this.$refs.newBookRef.$el
if (newBookEl) {
const totalHeight = newBookEl.clientHeight
const titleEl = newBookEl.querySelector('.common-title')
const titleHeight = titleEl ? titleEl.clientHeight : 0.475 * 16
this.newBookHeight = totalHeight - titleHeight
if (this.$refs.newBookRef.updateHeight) {
this.$refs.newBookRef.updateHeight(this.newBookHeight)
}
}
}
},
//
calcReadStarHeight() {
if (this.$refs.readStarRef) {
const readStarEl = this.$refs.readStarRef.$el
if (readStarEl) {
// -
const totalHeight = readStarEl.clientHeight
const titleEl = readStarEl.querySelector('.common-title')
const titleHeight = titleEl ? titleEl.clientHeight : 0.475 * 16
this.readStarHeight = totalHeight - titleHeight
//
if (this.$refs.readStarRef.updateHeight) {
this.$refs.readStarRef.updateHeight(this.readStarHeight)
}
}
}
}
} }
} }
</script> </script>

68
src/views/indexSelfService.vue

@ -4,7 +4,10 @@
<div class="screen-main"> <div class="screen-main">
<div class="screen-left"> <div class="screen-left">
<TodayBorrowed /> <TodayBorrowed />
<LengingRanking />
<LengingRanking
ref="rankingRef"
:container-height="rankingHeight"
/>
</div> </div>
<div class="screen-middle"> <div class="screen-middle">
<AccessToLibrary :is-self-service="true" /> <AccessToLibrary :is-self-service="true" />
@ -13,7 +16,10 @@
</div> </div>
<div class="screen-right"> <div class="screen-right">
<Notice /> <Notice />
<NewBookRecommend />
<NewBookRecommend
ref="newBookRef"
:container-height="newBookHeight"
/>
</div> </div>
</div> </div>
</div> </div>
@ -42,14 +48,70 @@ export default {
}, },
data() { data() {
return { return {
headerTitle: '问渠书房'
headerTitle: '问渠书房',
newBookHeight: 0, //
rankingHeight: 0
} }
}, },
created() { created() {
}, },
mounted() { mounted() {
this.$nextTick(() => {
this.calcNewBookHeight()
this.calcRankingHeight() //
})
window.addEventListener('resize', () => {
this.calcNewBookHeight()
this.calcRankingHeight() //
})
},
beforeDestroy() {
window.removeEventListener('resize', () => {
this.calcNewBookHeight()
this.calcRankingHeight()
})
}, },
methods: { methods: {
//
calcRankingHeight() {
if (this.$refs.rankingRef) {
const rankingEl = this.$refs.rankingRef.$el
if (rankingEl) {
// -
const totalHeight = rankingEl.clientHeight
const titleEl = rankingEl.querySelector('.common-title')
const titleHeight = titleEl ? titleEl.clientHeight : 0.475 * 16
this.rankingHeight = totalHeight - titleHeight
//
if (this.$refs.rankingRef.updateHeight) {
this.$refs.rankingRef.updateHeight(this.rankingHeight)
}
}
}
},
//
calcNewBookHeight() {
if (this.$refs.newBookRef) {
const newBookEl = this.$refs.newBookRef.$el
if (newBookEl) {
const totalHeight = newBookEl.clientHeight
const titleEl = newBookEl.querySelector('.common-title')
const titleHeight = titleEl ? titleEl.clientHeight : 0.475 * 16 // 0.475rem
// = -
// rem
this.newBookHeight = totalHeight - titleHeight
console.log('新书推荐模块高度:', this.newBookHeight)
//
if (this.$refs.newBookRef.updateHeight) {
this.$refs.newBookRef.updateHeight(this.newBookHeight)
}
}
}
}
} }
} }
</script> </script>

104
src/views/lengingRanking/index-old.vue

@ -0,0 +1,104 @@
<template>
<!-- 借阅排行榜 -->
<div class="screen-item lending-ranking">
<div class="common-title">借阅排行榜</div>
<vue-seamless-scroll
ref="listData"
:data="rankingList"
:class-option="defaultOption"
class="big-module module-content"
>
<div
v-for="(item, index) in rankingList"
:key="index"
class="book-list-item"
>
<div class="book-img">
<img :src="item.cover" :onerror="defaultImg">
</div>
<div class="book-info">
<h4 class="title-item">{{ item.bookName }}</h4>
<p>{{ item.author }}</p>
</div>
<div class="ranking-num">
<svg v-if="index === 0" class="icon" aria-hidden="true">
<use xlink:href="#icon-a-no1" />
</svg>
<svg v-if="index === 1" class="icon" aria-hidden="true">
<use xlink:href="#icon-a-no21" />
</svg>
<svg v-if="index === 2" class="icon" aria-hidden="true">
<use xlink:href="#icon-a-no3" />
</svg>
<p>NO.{{ index + 1 }}</p>
</div>
</div>
</vue-seamless-scroll>
</div>
</template>
<script>
import { FetchBorrowRank, FetchCoverByISBN } from '@/api/library'
export default {
name: 'LengingRanking',
data() {
return {
defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"',
rankingList: []
}
},
computed: {
defaultOption() {
return {
step: 1.1, //
hoverStop: false, // stop
singleHeight: 102, // (0) direction => 0/1
openWatch: true,
waitTime: 2000 // (1000ms)
}
}
},
created() {
this.getBorrowRank()
},
mounted() {
},
methods: {
getBorrowRank() {
FetchBorrowRank().then((res) => {
if (res.errCode === 0) {
let data = []
data = res.data
data.forEach(item => {
this.getCoverByISBN(item.isbn.replace(/\-/g, ''), item)
})
} else {
this.$message.error('接口错误')
}
})
},
getCoverByISBN(isbn, item) {
const params = {
isbn: isbn
}
FetchCoverByISBN(params).then((res) => {
console.log('RES', res)
if (res) {
// item.cover = window.URL.createObjectURL(res)
item.cover = res
} else {
item.cover = ''
}
console.log(item.cover)
this.rankingList.push(item)
this.$refs.listData.reset()
})
}
}
}
</script>
<style lang="scss">
@import '~@/assets/styles/index.scss';
</style>

104
src/views/lengingRanking/index.vue

@ -7,6 +7,7 @@
:data="rankingList" :data="rankingList"
:class-option="defaultOption" :class-option="defaultOption"
class="big-module module-content" class="big-module module-content"
:style="{ height: containerHeight + 'px' }"
> >
<div <div
v-for="(item, index) in rankingList" v-for="(item, index) in rankingList"
@ -42,6 +43,12 @@ import { FetchBorrowRank, FetchCoverByISBN } from '@/api/library'
export default { export default {
name: 'LengingRanking', name: 'LengingRanking',
props: {
containerHeight: {
type: Number,
default: 0
}
},
data() { data() {
return { return {
defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"', defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"',
@ -55,7 +62,22 @@ export default {
hoverStop: false, // stop hoverStop: false, // stop
singleHeight: 102, // (0) direction => 0/1 singleHeight: 102, // (0) direction => 0/1
openWatch: true, openWatch: true,
waitTime: 2000 // (1000ms)
waitTime: 2000, // (1000ms)
scrollHeight: 0
}
}
},
watch: {
//
containerHeight(newVal) {
if (newVal > 0) {
this.scrollHeight = newVal
this.calcDynamicSize() //
this.$nextTick(() => {
if (this.$refs.listData) {
this.$refs.listData.reset() //
}
})
} }
} }
}, },
@ -63,36 +85,82 @@ export default {
this.getBorrowRank() this.getBorrowRank()
}, },
mounted() { mounted() {
if (this.containerHeight > 0) {
this.scrollHeight = this.containerHeight
this.calcDynamicSize()
}
}, },
methods: { methods: {
updateHeight(height) {
this.scrollHeight = height
this.calcDynamicSize()
this.$nextTick(() => {
if (this.$refs.listData) {
this.$refs.listData.reset()
}
})
},
calcDynamicSize() {
// rem1rem=100px
const containerRem = this.scrollHeight / 100 || 6.8125
// = 15%
this.itemHeight = Math.floor(this.scrollHeight * 0.15) || 102
//
this.imgWidth = containerRem * 0.12 // 12%
this.imgHeight = this.imgWidth * 1.304 // 1.075/0.825 1.304
this.imgMargin = containerRem * 0.05 // 5%
//
this.textFontSize = containerRem * 0.028 // 2.8%
this.titleFontSize = containerRem * 0.035 // 3.5%
this.authorFontSize = containerRem * 0.028 // 2.8%
this.numFontSize = containerRem * 0.028 // 2.8%
//
this.iconSize = containerRem * 0.08 // 8%
},
getBorrowRank() { getBorrowRank() {
FetchBorrowRank().then((res) => { FetchBorrowRank().then((res) => {
if (res.errCode === 0) { if (res.errCode === 0) {
let data = []
data = res.data
data.forEach(item => {
this.getCoverByISBN(item.isbn.replace(/\-/g, ''), item)
const data = res.data || []
//
this.rankingList = []
//
const coverPromises = data.map(item => {
const isbn = item.isbn.replace(/\-/g, '')
return this.getCoverByISBN(isbn, item)
})
//
Promise.all(coverPromises).then(() => {
this.$nextTick(() => {
if (this.$refs.listData) {
this.$refs.listData.reset()
}
})
}) })
} else { } else {
this.$message.error('接口错误') this.$message.error('接口错误')
} }
}).catch(err => {
console.error('获取借阅排行失败', err)
this.$message.error('获取借阅排行失败')
}) })
}, },
// Promise便
getCoverByISBN(isbn, item) { getCoverByISBN(isbn, item) {
const params = {
isbn: isbn
}
FetchCoverByISBN(params).then((res) => {
console.log('RES', res)
if (res) {
// item.cover = window.URL.createObjectURL(res)
item.cover = res
} else {
return new Promise((resolve) => {
const params = { isbn }
FetchCoverByISBN(params).then((res) => {
item.cover = res || ''
this.rankingList.push(item)
resolve()
}).catch(() => {
item.cover = '' item.cover = ''
}
console.log(item.cover)
this.rankingList.push(item)
this.$refs.listData.reset()
this.rankingList.push(item)
resolve()
})
}) })
} }
} }

1021
src/views/newBookRecommend/data.json
File diff suppressed because it is too large
View File

624
src/views/newBookRecommend/index.vue

@ -2,19 +2,26 @@
<!-- 新书推荐 --> <!-- 新书推荐 -->
<div class="screen-item lending-ranking"> <div class="screen-item lending-ranking">
<div class="common-title">图书推荐</div> <div class="common-title">图书推荐</div>
<div ref="newbook" class="big-module module-content">
<div ref="newbook" class="big-module module-content" :style="{'height': swiperHeight+'px'}">
<!-- 按6个一组拆分后渲染每组是一屏3列2行 --> <!-- 按6个一组拆分后渲染每组是一屏3列2行 -->
<swiper v-if="groupedList.length > 0" ref="swiperThumbs" class="swiper gallery-thumbs directive" :options="swiperOptionThumbs"> <swiper v-if="groupedList.length > 0" ref="swiperThumbs" class="swiper gallery-thumbs directive" :options="swiperOptionThumbs">
<swiper-slide v-for="(group, groupIndex) in groupedList" :key="groupIndex" class="screen-group"> <swiper-slide v-for="(group, groupIndex) in groupedList" :key="groupIndex" class="screen-group">
<!-- 每组内部3列2行布局 --> <!-- 每组内部3列2行布局 -->
<div class="book-grid"> <div class="book-grid">
<div v-for="(item) in group" :key="item.nbId" class="newbook-list-item"> <div v-for="(item) in group" :key="item.nbId" class="newbook-list-item">
<div class="book-img">
<div
class="book-img"
:style="{
width: bookSizeRatio.imgWidth,
height: bookSizeRatio.imgHeight,
marginBottom: bookSizeRatio.marginBottom
}"
>
<img :src="item.cover" :onerror="defaultImg" alt="图书封面"> <img :src="item.cover" :onerror="defaultImg" alt="图书封面">
</div> </div>
<div class="book-info"> <div class="book-info">
<h4 class="title-item">{{ item.nbName }}</h4>
<p class="author-item">{{ item.nbAuthor }}</p>
<h4 class="title-item" :style="{ fontSize: bookSizeRatio.titleFontSize }">{{ item.nbName }}</h4>
<p class="author-item" :style="{ fontSize: bookSizeRatio.authorFontSize }">{{ item.nbAuthor }}</p>
</div> </div>
</div> </div>
<!-- 补全空卡片保证每组都是6个布局整齐 --> <!-- 补全空卡片保证每组都是6个布局整齐 -->
@ -38,14 +45,22 @@
import { FetchNewBookRecommend, FetchCoverByISBN } from '@/api/library' import { FetchNewBookRecommend, FetchCoverByISBN } from '@/api/library'
import { swiper, swiperSlide } from 'vue-awesome-swiper' import { swiper, swiperSlide } from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css' import 'swiper/dist/css/swiper.css'
// import result from './data.json'
export default { export default {
name: 'NewBookRecommend', name: 'NewBookRecommend',
components: { swiper, swiperSlide }, components: { swiper, swiperSlide },
props: {
containerHeight: {
type: Number,
default: 0
}
},
data() { data() {
return { return {
defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"', defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"',
rankingList: []
rankingList: [],
swiperHeight: 0 // swiper
} }
}, },
computed: { computed: {
@ -54,43 +69,102 @@ export default {
const list = [...this.rankingList] const list = [...this.rankingList]
const groups = [] const groups = []
// 6 // 6
for (let i = 0; i < list.length; i += 6) {
const group = list.slice(i, i + 6)
groups.push(group)
while (list.length) {
groups.push(list.splice(0, 6))
} }
return groups return groups
}, },
bookSizeRatio() {
// rem1rem=80px
const containerHeightRem = this.swiperHeight / 80 || 6.8125
// = 20%
const imgWidthRem = containerHeightRem * 0.22
// = × 1.34 3:4
const imgHeightRem = imgWidthRem * 1.34
// = 3.5%
const titleFontSize = containerHeightRem * 0.04
const authorFontSize = containerHeightRem * 0.034
return {
imgWidth: `${imgWidthRem}rem`,
imgHeight: `${imgHeightRem}rem`,
titleFontSize: `${titleFontSize}rem`,
authorFontSize: `${authorFontSize}rem`,
marginBottom: `${containerHeightRem * 0.035}rem` //
}
},
// Swiper11 // Swiper11
swiperOptionThumbs() { swiperOptionThumbs() {
return { return {
direction: 'vertical', direction: 'vertical',
slidesPerView: 1, slidesPerView: 1,
slidesPerGroup: 1, slidesPerGroup: 1,
spaceBetween: 0, // 0
height: 540, //
spaceBetween: 0,
height: this.swiperHeight || 540, // 使540
loop: false, loop: false,
autoplay: true, autoplay: true,
observer: true, observer: true,
observeParents: true, observeParents: true,
autoHeight: false, //
roundLengths: true, //
preventClicks: false, //
//
autoHeight: false,
roundLengths: true,
preventClicks: false,
freeMode: false, freeMode: false,
freeModeMomentum: false, freeModeMomentum: false,
//
slidesOffsetBefore: 0, slidesOffsetBefore: 0,
slidesOffsetAfter: 0
slidesOffsetAfter: 0,
//
onReachEnd: () => {
if (this.swiper) {
this.swiper.autoplay.stop()
}
},
onSlideChangeStart: (swiper) => {
const totalSlides = swiper.slides.length
if (swiper.activeIndex >= totalSlides - 1) {
swiper.slideTo(totalSlides - 1, 0, false)
}
}
} }
}, },
swiper() { swiper() {
return this.$refs.swiperThumbs?.swiper return this.$refs.swiperThumbs?.swiper
} }
}, },
watch: {
//
containerHeight(newVal) {
if (newVal > 0) {
this.swiperHeight = newVal
// swiper
this.$nextTick(() => {
if (this.swiper) {
this.swiper.update()
}
})
}
}
},
beforeDestroy() {
//
window.removeEventListener('resize', this.getContainerHeight)
},
mounted() { mounted() {
this.getNewBookRecommend() this.getNewBookRecommend()
//
if (this.containerHeight > 0) {
this.swiperHeight = this.containerHeight
}
}, },
methods: { methods: {
updateHeight(height) {
this.swiperHeight = height
this.$nextTick(() => {
if (this.swiper) {
this.swiper.update()
}
})
},
async getNewBookRecommend() { async getNewBookRecommend() {
try { try {
const params = { const params = {
@ -100,507 +174,7 @@ export default {
} }
console.log('params', params) console.log('params', params)
const res = await FetchNewBookRecommend(params) const res = await FetchNewBookRecommend(params)
// const res = {
// 'errCode': 0,
// 'errMsg': 'ok',
// 'data': {
// 'newbookList': [
// {
// 'nbId': '2c96809799e5c33c019b073b5daf04f4',
// 'libcode': '1201',
// 'nbName': '1',
// 'nbExplain': '\r\n',
// 'createTime': null,
// 'creater': null,
// 'updateTime': '2025-12-10T08:27:33.313+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'B821-49/1793',
// 'isbn': '978-7-5596-7891-1',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b073e896d04f6',
// 'libcode': '1201',
// 'nbName': '',
// 'nbExplain': '西西广西耀\r\n',
// 'createTime': null,
// 'creater': null,
// 'updateTime': '2025-12-10T08:26:54.420+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'J12/13',
// 'isbn': '978-7-5020-9795-0',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b073fa8b404f7',
// 'libcode': '1201',
// 'nbName': '',
// 'nbExplain': '\r\n',
// 'createTime': null,
// 'creater': null,
// 'updateTime': '2025-12-10T08:26:08.467+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'F830.59/232',
// 'isbn': '978-7-5236-0600-1',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b0752c2b70508',
// 'libcode': '1201',
// 'nbName': '',
// 'nbExplain': '1697仿\r\n',
// 'createTime': null,
// 'creater': null,
// 'updateTime': '2025-12-10T08:21:33.923+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '()·(Rudyard Kipling)',
// 'nbBooktype': '',
// 'sortmark': 'I561.84/456',
// 'isbn': '978-7-5327-9277-1',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b075255670507',
// 'libcode': '1201',
// 'nbName': '',
// 'nbExplain': '广\r\n',
// 'createTime': '2025-12-10T08:13:14.983+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T08:13:14.983+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'I287.45/2970',
// 'isbn': '978-7-5702-2851-5',
// 'nbPublisher': '',
// 'nbPublisherdate': '2022',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b0751d1b50506',
// 'libcode': '1201',
// 'nbName': '',
// 'nbExplain': '80\r\n',
// 'createTime': '2025-12-10T08:12:41.270+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T08:12:41.270+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'K928.42-49/7',
// 'isbn': ' 978-7-5417-7604-5',
// 'nbPublisher': '',
// 'nbPublisherdate': '2023',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b0750f3290504',
// 'libcode': '1201',
// 'nbName': '',
// 'nbExplain': '1亿\r\n',
// 'createTime': '2025-12-10T08:11:44.297+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T08:11:44.297+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': ')·(Johan Egerkrans) ',
// 'nbBooktype': '',
// 'sortmark': 'Q915.864-49/89',
// 'isbn': '978-7-02-018036-3',
// 'nbPublisher': '',
// 'nbPublisherdate': '2023',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b074ef9520502',
// 'libcode': '1201',
// 'nbName': '500',
// 'nbExplain': '500穿便\r\n',
// 'createTime': '2025-12-10T08:09:34.803+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T08:09:34.803+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'Z228.1/733:6',
// 'isbn': '978-7-5736-1739-2',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b074c2f140501',
// 'libcode': '1201',
// 'nbName': '',
// 'nbExplain': '1-3\r\n',
// 'createTime': null,
// 'creater': null,
// 'updateTime': '2025-12-10T08:08:36.597+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'I287.45/3092:4',
// 'isbn': '978-7-5337-8997-8',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b074a79540500',
// 'libcode': '1201',
// 'nbName': '100',
// 'nbExplain': '1007-11\r\n',
// 'createTime': null,
// 'creater': null,
// 'updateTime': '2025-12-10T08:05:35.893+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'I287.5/1296:11',
// 'isbn': '978-7-5148-8625-2',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b0748f73104ff',
// 'libcode': '1201',
// 'nbName': '',
// 'nbExplain': '\r\n',
// 'createTime': null,
// 'creater': null,
// 'updateTime': '2025-12-10T08:04:07.553+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'K204.1/22:4',
// 'isbn': '978-7-5139-4167-9',
// 'nbPublisher': '',
// 'nbPublisherdate': '2023',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b0747d96004fe',
// 'libcode': '1201',
// 'nbName': '沿',
// 'nbExplain': '\r\n',
// 'createTime': '2025-12-10T08:01:47.873+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T08:01:47.873+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'G127.2/3',
// 'isbn': '978-7-5474-4916-5',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b07472c3304fd',
// 'libcode': '1201',
// 'nbName': '100+',
// 'nbExplain': '沿24沿沿\r\n',
// 'createTime': '2025-12-10T08:01:03.537+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T08:01:03.537+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'Z271.2/12:1',
// 'isbn': '978-7-5583-3621-8',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b0744957004fc',
// 'libcode': '1201',
// 'nbName': 'everyday health hacks to worry less and live better',
// 'nbExplain': '\r\n',
// 'createTime': '2025-12-10T07:58:13.870+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T07:58:13.870+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '()·(Karan Rajan) , ',
// 'nbBooktype': '',
// 'sortmark': 'R161/239',
// 'isbn': '978-7-5217-6957-9 ',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b0742943604fb',
// 'libcode': '1201',
// 'nbName': '',
// 'nbExplain': '\r\n',
// 'createTime': '2025-12-10T07:56:02.487+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T07:56:02.487+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'C912.6-0/24',
// 'isbn': '978-7-5596-7508-8?',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b0741c9fe04fa',
// 'libcode': '1201',
// 'nbName': '',
// 'nbExplain': ', , , 广, 广\r\n',
// 'createTime': '2025-12-10T07:55:10.717+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T07:55:10.717+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'R212/191',
// 'isbn': '978-7-5551-2386-6',
// 'nbPublisher': '广西',
// 'nbPublisherdate': '2025',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b0741474204f9',
// 'libcode': '1201',
// 'nbName': '22',
// 'nbExplain': '@\r\n',
// 'createTime': '2025-12-10T07:54:37.250+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T07:54:37.250+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'F713.365.2/315',
// 'isbn': '978-7-5521-2482-8',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b074047f604f8',
// 'libcode': '1201',
// 'nbName': '',
// 'nbExplain': '23000\r\n',
// 'createTime': '2025-12-10T07:53:31.893+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T07:53:31.893+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': ' , ',
// 'nbBooktype': '',
// 'sortmark': 'H319.4:I/540',
// 'isbn': '978-7-5702-3295-6',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b073c8e2804f5',
// 'libcode': '1201',
// 'nbName': '',
// 'nbExplain': '\r\n',
// 'createTime': '2025-12-10T07:49:27.720+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T07:49:27.720+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'F0-49/197',
// 'isbn': '978-7-5229-1345-2',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b073ad6bd04f3',
// 'libcode': '1201',
// 'nbName': '111',
// 'nbExplain': '\r\n',
// 'createTime': '2025-12-10T07:47:35.230+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T07:47:35.230+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'I247.57/6741',
// 'isbn': '978-7-5339-7651-4',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b073ad6bd04f3',
// 'libcode': '1201',
// 'nbName': '111',
// 'nbExplain': '\r\n',
// 'createTime': '2025-12-10T07:47:35.230+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T07:47:35.230+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'I247.57/6741',
// 'isbn': '978-7-5339-7651-4',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b073ad6bd04f3',
// 'libcode': '1201',
// 'nbName': '111',
// 'nbExplain': '\r\n',
// 'createTime': '2025-12-10T07:47:35.230+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T07:47:35.230+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'I247.57/6741',
// 'isbn': '978-7-5339-7651-4',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b073ad6bd04f3',
// 'libcode': '1201',
// 'nbName': '111',
// 'nbExplain': '\r\n',
// 'createTime': '2025-12-10T07:47:35.230+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T07:47:35.230+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'I247.57/6741',
// 'isbn': '978-7-5339-7651-4',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b073ad6bd04f3',
// 'libcode': '1201',
// 'nbName': '111',
// 'nbExplain': '\r\n',
// 'createTime': '2025-12-10T07:47:35.230+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T07:47:35.230+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'I247.57/6741',
// 'isbn': '978-7-5339-7651-4',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b073ad6bd04f3',
// 'libcode': '1201',
// 'nbName': '111',
// 'nbExplain': '\r\n',
// 'createTime': '2025-12-10T07:47:35.230+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T07:47:35.230+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'I247.57/6741',
// 'isbn': '978-7-5339-7651-4',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b073ad6bd04f3',
// 'libcode': '1201',
// 'nbName': '111',
// 'nbExplain': '\r\n',
// 'createTime': '2025-12-10T07:47:35.230+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T07:47:35.230+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'I247.57/6741',
// 'isbn': '978-7-5339-7651-4',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// },
// {
// 'nbId': '2c96809799e5c33c019b073ad6bd04f3',
// 'libcode': '1201',
// 'nbName': '111',
// 'nbExplain': '\r\n',
// 'createTime': '2025-12-10T07:47:35.230+0000',
// 'creater': '297edff88354751d018359cd2e120000',
// 'updateTime': '2025-12-10T07:47:35.230+0000',
// 'updater': '297edff88354751d018359cd2e120000',
// 'nbAuthor': '',
// 'nbBooktype': '',
// 'sortmark': 'I247.57/6741',
// 'isbn': '978-7-5339-7651-4',
// 'nbPublisher': '',
// 'nbPublisherdate': '2024',
// 'nbRecno': '',
// 'nbImgPath': ''
// }
// ],
// 'page': {
// 'totalRows': 20,
// 'pageSize': 100,
// 'currentPage': 1,
// 'totalPages': 1,
// 'startRow': 0
// }
// }
// }
// const res = result
if (res.errCode === 0) { if (res.errCode === 0) {
const bookList = res.data.newbookList const bookList = res.data.newbookList
@ -639,7 +213,6 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import "~@/assets/styles/index.scss"; @import "~@/assets/styles/index.scss";
// //
.big-module { .big-module {
box-sizing: border-box; // box-sizing: border-box; //
@ -647,7 +220,6 @@ export default {
position: relative; position: relative;
padding: 0; // padding padding: 0; // padding
margin: 0; // margin margin: 0; // margin
height: 520px;
} }
// Swiper // Swiper
@ -702,14 +274,15 @@ export default {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 0.1rem;
&.empty-card { &.empty-card {
visibility: hidden; visibility: hidden;
} }
.book-img { .book-img {
width: 1.325rem;
height: 1.775rem;
margin: 0 auto 0.25rem;
// width: 1.325rem;
// height: 1.775rem;
margin: 0 auto var(--img-margin-bottom, 0.25rem);
padding: 0; padding: 0;
background: url('~@/assets/images/default-img.png') no-repeat center center; background: url('~@/assets/images/default-img.png') no-repeat center center;
background-size: contain; background-size: contain;
@ -721,13 +294,14 @@ export default {
} }
.book-info { .book-info {
width: 1.82rem;
width: 90%;
max-width: 1.82rem;
padding: 0; padding: 0;
margin: 0 auto; margin: 0 auto;
.title-item { .title-item {
font-size: 0.25rem; font-size: 0.25rem;
line-height: .3rem;
line-height: 1.2;
font-weight: normal; font-weight: normal;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
@ -743,7 +317,7 @@ export default {
-webkit-line-clamp: 1; -webkit-line-clamp: 1;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
line-height: 14px;
line-height: 1.2;
} }
} }
} }

202
src/views/readStar/index-height.vue

@ -0,0 +1,202 @@
<template>
<!-- 新书推荐 -->
<div class="screen-item read-star">
<div class="common-title">阅读之星</div>
<div ref="starList" class="medium-module module-content" :style="{ height: containerHeight + 'px' }">
<div v-for="(item,index) in readstarList" :key="index" :class="['readstart-item', {'star1-bg':index === 0}, {'star2-bg':index === 1}, {'star3-bg':index === 2}]">
<svg v-if="index === 0" class="icon icon-star-1" aria-hidden="true">
<use xlink:href="#icon-a-1" />
</svg>
<svg v-else-if="index === 1" class="icon icon-star-2" aria-hidden="true">
<use xlink:href="#icon-a-21" />
</svg>
<svg v-else-if="index === 2" class="icon icon-star-3" aria-hidden="true">
<use xlink:href="#icon-a-3" />
</svg>
<span v-else class="star-num">{{ index+1 }}</span>
<p class="star-info title-item"> 读者{{ item.RDNAME }}近30天借阅图书{{ item.TOTALNUM }}</p>
<p class="star-date">{{ mondayDate }}</p>
</div>
</div>
</div>
</template>
<script>
import { FetchBorrowStar, FetchReadRanking } from '@/api/library'
// import { parseTime } from '@/utils/index.js'
export default {
name: 'ReadStar',
props: {
containerHeight: {
type: Number,
default: 0
}
},
data() {
return {
readstarList: [],
mondayDate: null
}
},
watch: {
//
containerHeight(newVal) {
if (newVal > 0) {
this.calcDynamicSize(newVal)
}
}
},
created() {
},
mounted() {
this.getReadRanking()
if (this.containerHeight > 0) {
this.calcDynamicSize(this.containerHeight)
}
},
methods: {
updateHeight(height) {
this.calcDynamicSize(height)
},
//
calcDynamicSize(containerHeight) {
// rem1rem=100px
const containerRem = containerHeight / 100 || 6.8125
// = / 3
this.itemHeight = containerRem / 3 || 0.5
// = 2.8%
this.baseFontSize = containerRem * 0.028 || 0.2
this.infoFontSize = containerRem * 0.03 || 0.2
// = 5%
this.iconSize = containerRem * 0.05 || 0.35
this.iconMargin = containerRem * 0.007 || 0.05
// = 3.5%
this.numSize = containerRem * 0.035 || 0.25
this.numFontSize = containerRem * 0.028 || 0.2
this.numMargin = containerRem * 0.035 || 0.25
// = 1.8%
this.paddingSize = containerRem * 0.018 || 0.125
}, formatDateTime(date, type) {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
let timePart = '00:00:00'
if (type === 'end') {
timePart = '23:59:59'
}
return `${year}-${month}-${day} ${timePart}`
},
getReadRanking() {
// const currentDate = new Date() //
// currentDate.setDate(currentDate.getDate() - 30) // 30
// const year = currentDate.getFullYear() //
// const month = currentDate.getMonth() + 1 // 01
// const day = currentDate.getDate() //
// const formattedDate = `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`
// const params = {
// 'libcode': this.libcode,
// 'starttime': formattedDate,
// 'endtime': this.getFormattedDate(new Date()),
// 'rownum': 6,
// 'nordtype': 'JXTSG_E'
// }
//
const currentDate = new Date()
currentDate.setDate(currentDate.getDate() - 30) // 30
// YYYY-MM-DD 00:00:00
const startDate = encodeURIComponent(this.formatDateTime(currentDate, 'start'))
// YYYY-MM-DD 23:59:59
const endDate = encodeURIComponent(this.formatDateTime(new Date(), 'end'))
const params = {
'libcode': this.libcode,
'starttime': startDate,
'endtime': endDate,
'rownum': 6,
'nordtype': 'JXTSG_E'
}
FetchReadRanking(params).then(res => {
const result = JSON.parse(res.data)
if (result.success && result.resultlist.length > 0) {
this.readstarList = result.resultlist.sort((a, b) => b.TOTALNUM - a.TOTALNUM).slice(0, 10)
// this.rankingDataComputed()
// this.rankInterval = setInterval(() => {
// this.currentHover = (this.currentHover + 1) % this.rankingData.length
// }, 1000)
console.log('this.readstarList', this.readstarList)
this.getMondayDate()
} else {
throw new Error('Failed' + this.libcode)
}
}).catch(error => {
console.error('Error', error)
return null
})
},
// list
getBorrowStar() {
FetchBorrowStar().then(res => {
if (res.errCode === 0) {
console.log(res)
this.readstarList = res.data
this.getMondayDate()
} else {
this.$message.error('接口错误')
}
})
},
//
// getMondayTime() {
// const today = new Date()
// const year = today.getFullYear()
// const month = today.getMonth() // 0
// const day = today.getDate()
// const newDate = new Date(year, month, day)
// const nowTime = newDate.getTime()
// const weekDay = newDate.getDay() // getDay() 06
// const oneDayTime = 24 * 60 * 60 * 1000
// //
// const daysToMonday = weekDay === 0 ? -6 : 1 - weekDay
// //
// const mondayTime = nowTime - daysToMonday * oneDayTime
// //
// this.mondayDate = this.parseTime(mondayTime, '{y}-{m}-{d}')
// console.log('this.mondayDate', this.mondayDate)
// },
getMondayDate() {
const today = new Date()
const day = today.getDay()
//
// 65
const diff = day === 0 ? -6 : 1 - day
//
today.setDate(today.getDate() + diff)
// --
this.mondayDate = today.toISOString().split('T')[0]
}
}
}
</script>
<style lang="scss">
@import "~@/assets/styles/index.scss";
</style>

3
src/views/video/index.vue

@ -38,11 +38,12 @@ export default {
FetchShowFileList(params).then(res => { FetchShowFileList(params).then(res => {
if (res.errCode === 0) { if (res.errCode === 0) {
// this.src = res.data[0].filePath.replace('D://', 'http://172.16.0.23:8888/') // this.src = res.data[0].filePath.replace('D://', 'http://172.16.0.23:8888/')
this.srcList = res.data.map(x => x.filePath.replace('D://', 'http://172.22.0.23:8888/'))
// this.srcList = res.data.map(x => x.filePath.replace('D://', 'http://172.22.0.23:8888/'))
// this.srcList = res.data.map(x => x.filePath.replace('D://uploadFile', 'http://localhost:8080/static/')) // this.srcList = res.data.map(x => x.filePath.replace('D://uploadFile', 'http://localhost:8080/static/'))
// console.log(22222, this.srcList) // console.log(22222, this.srcList)
// this.src = 'D://uploadFile/11503339-b829-4357-8379-d2b49106431f.mp4'.replace('D://', 'http://127.0.0.1:8888/') // this.src = 'D://uploadFile/11503339-b829-4357-8379-d2b49106431f.mp4'.replace('D://', 'http://127.0.0.1:8888/')
// this.src = 'http://127.0.0.1:8888/uploadFile/9f904de6-0f5e-498e-8e5d-b7e14ea15496.mp4' // this.src = 'http://127.0.0.1:8888/uploadFile/9f904de6-0f5e-498e-8e5d-b7e14ea15496.mp4'
this.srcList = ['http://127.0.0.1:8888/uploadFile/9f904de6-0f5e-498e-8e5d-b7e14ea15496.mp4']
} else { } else {
this.$message.error('接口错误') this.$message.error('接口错误')
} }

Loading…
Cancel
Save