Browse Source

feat: 新增NutUI-Cat工程 (#463)

Co-authored-by: zhangyu1344 <zhangyu1344@jd.com>
Jerry 4 years ago
parent
commit
2b392272c5
2 changed files with 16 additions and 6 deletions
  1. 0 5
      src/sites/doc/components/Footer.vue
  2. 16 1
      src/sites/doc/views/Resource.vue

+ 0 - 5
src/sites/doc/components/Footer.vue

@@ -46,11 +46,6 @@
             >羚珑</a
           >
         </div>
-        <div class="doc-footer-item"
-          ><a class="sub-link" href="javascript:void(0);" @click="tips" v-hover
-            >NutUI-Cat</a
-          >
-        </div>
       </div>
       <div class="doc-footer-list">
         <h4 class="doc-footer-title">社区</h4>

+ 16 - 1
src/sites/doc/views/Resource.vue

@@ -8,6 +8,14 @@
   </div>
   <!-- 设计资源 -->
   <div class="resource-content">
+    <div class="resource-block" v-if="showNutuiCat">
+      <h4 class="sub-title">模板资源</h4>
+      <p class="sub-desc">
+        目前已提供京东大促模板工程
+        <a target="_blank" href="http://mtw.so/6tgTiw">NutUI-Cat</a
+        >,含有开发京东大促项目过程中使用到的通用模块、组件、模板,可以在未来的大促项目中复用,达到提效降本的效果。
+      </p>
+    </div>
     <div class="resource-block" v-if="articleList.length === 0">
       <h4 class="sub-title">设计资源</h4>
       <p class="sub-desc"
@@ -85,6 +93,7 @@ import Header from '@/sites/doc/components/Header.vue';
 import Footer from '@/sites/doc/components/Footer.vue';
 import { RefData } from '@/sites/assets/util/ref';
 import { ApiService } from '@/sites/service/ApiService';
+import axios from 'axios';
 export default defineComponent({
   name: 'doc',
   components: {
@@ -108,7 +117,8 @@ export default defineComponent({
         //   title: '性能体验'
         // }
       ],
-      activeIndex: 0
+      activeIndex: 0,
+      showNutuiCat: false
     });
     const watchDemoUrl = (router: RouteLocationNormalized) => {
       RefData.getInstance().currentRoute.value = router.name as string;
@@ -120,6 +130,11 @@ export default defineComponent({
 
       // 文章列表接口
       const apiService = new ApiService();
+      axios('https://relayapi.jd.com/').then(res => {
+        if (res) {
+          data.showNutuiCat = true;
+        }
+      });
       apiService.getArticle().then(res => {
         if (res?.state == 0) {
           (res.value.data.arrays as any[]).forEach(element => {