Ver Fonte

采美百科页面接口调试

yuwenjun1997 há 2 anos atrás
pai
commit
46a5e45df9

+ 4 - 3
src/main/resources/static/css/encyclopedia/detail.css

@@ -12,6 +12,7 @@
     .bk-detail-left .bk-information .bk-row{display:table-row}
     .bk-detail-left .bk-information .bk-row .bk-label{display:table-cell;font-weight:bold;color:#9AA5B5;border-bottom:1px dashed #BEBEBE;padding:18px 0 10px}
     .bk-detail-left .bk-information .bk-row .bk-content{font-size:14px;display:table-cell;border-bottom:1px dashed #BEBEBE;padding:18px 0 10px}
+    .bk-detail-left .bk-section .bk-section-content{line-height: 1.8}
     .bk-detail-left .bk-section .bk-title{position:relative;margin-top:40px;margin-bottom:24px}
     .bk-detail-left .bk-section .bk-title h2{background:#fff;font-size:22px;display:inline-block;font-weight:normal;position:relative;z-index:20;padding-right:16px}
     .bk-detail-left .bk-section .bk-title::before{position:absolute;content:"";display:block;width:12px;height:24px;left:-32px;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);background:#FF9D63}
@@ -62,10 +63,10 @@
     .bk-detail-left .bk-information .bk-row{display:table-row}
     .bk-detail-left .bk-information .bk-row .bk-label{color:#9AA5B5;display:table-cell;padding:0.16rem 0.4rem 0.16rem 0}
     .bk-detail-left .bk-information .bk-row .bk-content{display:table-cell;padding:0.16rem 0}
-    .bk-detail-left .bk-section{position:relative;padding:0.48rem 0.32rem;background:#fff;margin-bottom:0.16rem}
+    .bk-detail-left .bk-section{position:relative;padding:0.48rem 0.32rem;background:#fff;margin-bottom:0.16rem;}
     .bk-detail-left .bk-section .bk-title{position:relative;margin-bottom:0.32rem}
     .bk-detail-left .bk-section .bk-title h2{font-size:0.36rem;position:relative;z-index:20}
-    .bk-detail-left .bk-section p{text-align:justify}
+    .bk-detail-left .bk-section .bk-section-content{line-height: 1.8;text-align:justify;}
     .bk-detail-left .bk-section h3{font-size:0.32rem;margin-bottom:0.32rem;margin-top:0.4rem;font-weight:normal}
     .bk-literature{padding:0.4rem 0.32rem;background:#fff}
     .bk-literature .bk-title{font-size:0.36rem;font-weight:bold;margin-bottom:0.32rem}
@@ -97,4 +98,4 @@
     .bk-relevant .bk-directory .bk-directory-list li:last-child{margin-right:0.32rem}
     .bk-literature .bk-literature-list li em{font-style: normal;}
     .bk-literature .bk-literature-list li a.link{color: #F57C40; text-decoration: underline}
-}
+}

+ 6 - 0
src/main/resources/static/js/encyclopedia/common.js

@@ -127,5 +127,11 @@ $(function () {
         }
         return false
     })
+    $('.bk-nav .bk-navbar a').each(function(index, item){
+        $(item).parents('li').removeClass('active')
+        if(location.href.indexOf($(item).attr('href')) > -1){
+            $(item).parents('li').addClass('active')
+        }
+    })
 })
 

+ 8 - 6
src/main/resources/static/js/encyclopedia/detail.js

@@ -1,23 +1,25 @@
 function directory(container, flag = true) {
     let h2Index = 0
     $('.bk-section').each(function (index, el) {
+        let hId = 'heading', li
         if ($(el).find('h2').length > 0) {
-            h2Index+=1
-            const hId = 'heading-' + h2Index;
+            h2Index = h2Index + 1
+            hId = 'heading-' + h2Index;
             $(el).find('h2').attr('id', hId);
             const name = flag ? h2Index + '、' + $(el).find('h2').text() : $(el).find('h2').text();
-            const li = $('<li><a href="javascript:void(0)" data-id="' + hId + '">' + name + '</a></li>');
+            li = $('<li><a href="javascript:void(0)" data-id="' + hId + '">' + name + '</a></li>');
             $(container).append(li);
         }
-        if (flag && $(el).find('h3').length > 0) {
+        if(!flag) return
+        if ($(el).find('h3').length > 0) {
             const sUl = $(`<ul></ul>`)
-            $(li).append(sUl);
             $(el).find('h3').each(function (i, h) {
                 const sId = hId + '-' + i
                 $(h).attr('id', sId)
                 const li = $('<li><a href="javascript:void(0)" data-id="' + sId + '">' + $(h).text() + '</a></li>');
                 $(sUl).append(li)
             });
+            $(li).append(sUl);
         }
     })
 }
@@ -40,4 +42,4 @@ $(function () {
             scrollTop: $('#'+ id).offset().top
         }, {duration: 500, easing: "swing"});
     })
-})
+})

+ 2 - 2
src/main/resources/templates/encyclopedia/detail.html

@@ -71,7 +71,7 @@
                     <div class="line"></div>
                 </div>
                 <h3 th:if="${item.dictionaryType == 2}" th:utext="${item.dictionaryContent}"></h3>
-                <p th:if="${item.dictionaryType == 3}" th:utext="${item.dictionaryContent}"></p>
+                <div class="bk-section-content" th:if="${item.dictionaryType == 3}" th:utext="${item.dictionaryContent}"></div>
             </div>
             <div class="bk-literature">
                 <div class="bk-title">
@@ -124,7 +124,7 @@
                 <div class="bk-title"><span th:text="*{name}"></span>的概述图册</div>
             </div>
             <div class="bk-company" th>
-                <img th:src="*{shopLogo}">
+                <img th:src="*{shopLogo} ? *{shopLogo} : '/img/base/placeholder.png'">
                 <div class="bk-title" th:text="*{shopName}">上海品辉医疗科技有限公司</div>
             </div>
             <div class="bk-directory">

+ 4 - 4
src/main/resources/templates/encyclopedia/list.html

@@ -21,13 +21,13 @@
     <!-- banner区域 -->
     <a th:href="${Typedata.bannerLink}" th:if="Typedata.bannerLink">
         <div class="bk-banner">
-            <img th:src="${Typedata.pcBanner}" alt="采美百科" class="only-pc">
-            <img th:src="${Typedata.appBanner}" alt="采美百科" class="only-mobile">
+            <img th:src="${Typedata.pcBanner} ? ${Typedata.pcBanner} : '/img/encyclopedia/assets/pc-banner.png'" alt="采美百科" class="only-pc">
+            <img th:src="${Typedata.appBanner} ? ${Typedata.appBanner} : '/img/encyclopedia/assets/h5-banner.png'" alt="采美百科" class="only-mobile">
         </div>
     </a>
     <div class="bk-banner" th:if="!Typedata.bannerLink">
-        <img th:src="${Typedata.pcBanner}" alt="采美百科" class="only-pc">
-        <img th:src="${Typedata.appBanner}" alt="采美百科" class="only-mobile">
+        <img th:src="${Typedata.pcBanner} ? ${Typedata.pcBanner} : '/img/encyclopedia/assets/pc-banner.png'" alt="采美百科" class="only-pc">
+        <img th:src="${Typedata.appBanner} ? ${Typedata.appBanner} : '/img/encyclopedia/assets/h5-banner.png'" alt="采美百科" class="only-mobile">
     </div>
     <!-- banner区域 end -->
     <!-- 百科列表区域 -->

+ 2 - 2
src/main/resources/templates/supplier-center/encyclopedia/edit.html

@@ -164,7 +164,7 @@
                 <div class="bk-tab-item" :class="{active: referenceType === 2}" @click="handleTabChange(2)">引用已有资料</div>
             </div>
             <div class="bk-dialog-content">
-                <template v-if="referenceType === 1">
+                <template v-show="referenceType === 1">
                     <el-form label-width="110px" ref="referenceForm" :model="referenceData" :rules="referenceRule">
                         <el-form-item label="参考资料类型">
                             <el-select class="max-width" v-model="referenceData.referenceType" @change="handleReferenceTypeChange">
@@ -227,7 +227,7 @@
                         </template>
                     </el-form>
                 </template>
-                <template v-if="referenceType === 2">
+                <template v-show="referenceType === 2">
                     <ul class="bk-literature-list">
                         <template v-for="(item, index) in formData.referenceList">
                             <li :key="item.ctrlId" @click="handleSelectReference(item, index)"><span>[{{index+1}}]</span><span>{{item | reference}}</span></li>