Browse Source

Merge remote-tracking branch 'origin/master'

wangkaiyue 4 years ago
parent
commit
fee92c228f

+ 3 - 3
jydocs-mobile/.env.development

@@ -1,6 +1,6 @@
 NODE_ENV=development
-VUE_APP_MOCK=true
-VUE_APP_BASE_API = '/dev/api'
+VUE_APP_MOCK=false
+VUE_APP_BASE_API = '/jydocs'
 BASE_URL = '/dev/docs/'
 VUE_APP_BASE_URL = '/dev/docs/'
-VUE_APP_LOG_URL='https://web2-jytest.jianyu360.cn/jyintegral/pointsLogs?logAction='
+VUE_APP_LOG_URL='https://web2-jytest.jianyu360.cn/jyintegral/actionInfo?logAction='

+ 2 - 2
jydocs-mobile/.env.production

@@ -1,5 +1,5 @@
 NODE_ENV=production
-VUE_APP_BASE_API='/jydocs/'
+VUE_APP_BASE_API='/jydocs'
 BASE_URL = '/page_docs_app/'
 VUE_APP_BASE_URL = '/page_docs_app/'
-VUE_APP_LOG_URL='https://web2-jytest.jydev.jianyu360.com/jyLogs/pointsLogs?logAction='
+VUE_APP_LOG_URL='https://web2-jytest.jydev.jianyu360.com/jyLogs/actionInfo?logAction='

+ 127 - 41
jydocs-mobile/src/views/details/details.vue

@@ -1,20 +1,25 @@
 <template>
     <div class="details-p">
         <div class="tops">
-            <h3>
-                <van-icon class="word01" :name="'diy-' + fileType(detailData.docFileType)" />
-                {{detailData.docName}}
-            </h3>
+          <div class="word">
+            <van-icon class="word01" :name="'diy-' + fileType(detailData.docFileType)" />
+          </div>
+          <div class="title">{{detailData.docName}}</div>
         </div>
         <div class="middles">
             <h3>摘要</h3>
             <p>{{detailData.docSummary}}</p>
             <div class="continue" v-show="buyed == 0">全文共{{detailData.docPageSize}}页,<span @click="continued">继续阅读<van-icon name="arrow-down" size="18" /></span></div>
         </div>
+        <div class="head-tip" id="fixedTop" :class="{'is-fixed':fixed}" v-show="buyed == 1">
+            <h3 v-show="fixed">
+              <van-icon class="word01" :name="'diy-' + fileType(detailData.docFileType)" />
+              <span>{{detailData.docName}}</span>
+            </h3>
+            <span class="pages"><i id="page_num"></i> / <i id="page_count"></i></span>
+        </div>
         <div class="botts" v-show="buyed == 1">
-            <div class="cont-page" id="pdfPage" style="width: 375px">
-                <!-- <iframe :src="conts" width="100%" height="100%"></iframe> -->
-            </div>
+            <div class="cont-page" id="pdfPage"></div>
         </div>
         <van-goods-action>
             <van-goods-action-icon class="no-icon">
@@ -24,7 +29,7 @@
                 </template>
             </van-goods-action-icon>
             <van-goods-action-icon icon="diy-jubao" text="投诉举报" @click="jubaod" />
-            <van-goods-action-icon :icon="collectd==1?'diy-guanzhu':'diy-weiguanzhu'" text="收藏" @click="canged" />
+            <van-goods-action-icon :icon="collectd==1?'diy-guanzhu':'diy-weiguanzhu'" :text="collectd==1?'已收藏':'收藏'" @click="canged" />
             <van-goods-action-button text="下载文档" @click="uploaded" />
         </van-goods-action>
         <!-- 充值 -->
@@ -76,8 +81,10 @@ export default class extends Vue {
   getShare: any
   links: any = []
   docIds = ''
+  fixed = false
   coins: any = []
   conts: any = []
+  offsets: any = 0
   getAdd: any
   getRemove: any
   detailData: any = []
@@ -87,7 +94,7 @@ export default class extends Vue {
   pdfDocument: any
   config: any = {
     PAGE_TO_VIEW: 0,
-    SCALE: 0.9,
+    SCALE: 0,
     CMAP_URL: 'https://cdn.jsdelivr.net/npm/pdfjs-dist@2.6.347/cmaps/',
     CMAP_PACKED: true,
     workerSrc: 'https://cdn.jsdelivr.net/npm/pdfjs-dist@2.6.347/es5/build/pdf.worker.min.js'
@@ -98,7 +105,7 @@ export default class extends Vue {
   }
 
   TopConfig: any = {
-    actionRightText: '<div style="display:flex;flex-direction: column;align-items: center;"><i class="j-icon icon-iconJianYu"></i><p style="color: #171826;font-size: 10px;line-height: 12px;margin-top:3px;">分享赚积分</p></div>',
+    actionRightText: '<div style="display:flex;flex-direction: column;align-items: center;"><i class="j-icon icon-iconJianYu"></i><p style="color: #171826;font-size: 10px;line-height: 12px;margin-top:3px;">分享赚剑鱼币</p></div>',
     actionRightCallback: this.shared,
     actionRightStyle: {
       color: '#5F5E64',
@@ -110,15 +117,42 @@ export default class extends Vue {
   created () {
     this.docIds = this.$route.params.id
     this.onList()
+    this.setTop()
+    console.log(window.screen.width)
   }
 
   mounted () {
     // 监听滚轮
-    window.addEventListener('scroll', this.watchPage)
+    window.addEventListener('scroll', this.initHeight)
   }
 
   destroyed () { // 移除监听
-    window.removeEventListener('scroll', this.watchPage)
+    window.removeEventListener('scroll', this.initHeight)
+  }
+
+  setTop () {
+    this.$nextTick(() => {
+      // 获取到达页面顶端的值
+      const heights = document.getElementById('fixedTop')
+      this.offsets = heights.offsetTop
+      // this.offsets = heights.getBoundingClientRect().top
+      console.log(this.offsets)
+    })
+  }
+
+  initHeight () {
+    // 获取页面滚动距离
+    const scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
+    this.fixed = !!(scrollTop > this.offsets && this.buyed)
+    const top = window.scrollY
+    let base = 0
+    for (let i = 0; i < this.pData.heightList.length; i++) {
+      base += this.pData.heightList[i]
+      if (top <= base) {
+        this.updateText({ type: 'num', value: i + 1 })
+        break
+      }
+    }
   }
 
   async getShareUrl () {
@@ -138,21 +172,24 @@ export default class extends Vue {
     ;(this.$refs.shares as any).show = true
   }
 
-  // updateText (type: any, value = '') {
-  //   switch (type) {
-  //     case 'count': {
-  //       document.querySelector('#page_count').textContent = value
-  //       break
-  //     }
-  //     case 'num': {
-  //       document.querySelector('#page_num').textContent = value
-  //       break
-  //     }
-  //   }
-  // }
+  updateText (data: any) {
+    console.log(data)
+    switch (data.type) {
+      case 'count': {
+        document.getElementById('page_count').textContent = data.value
+        break
+      }
+      case 'num': {
+        document.getElementById('page_num').textContent = data.value
+        break
+      }
+    }
+  }
 
   renders () {
     const container = document.getElementById('pdfPage')
+    // let notes = document.getElementById('pdfPage')
+    // document.getElementById('pdfPage').style.width = '100vw'
     return this.pdfDocument.getPage(this.config.PAGE_TO_VIEW).then((pdfPage: any) => {
       const pdfPageView = new pdfjsViewer.PDFPageView({
         container: container,
@@ -179,8 +216,8 @@ export default class extends Vue {
     loadingTask.promise.then((pdfDocument: any) => {
       this.pdfDocument = pdfDocument
       console.log(this.pdfDocument.numPages)
-      // this.updateText({type: 'count', value: this.pdfDocument.numPages})
-      // this.updateText({type: 'num', value: 1})
+      this.updateText({ type: 'count', value: this.pdfDocument.numPages })
+      this.updateText({ type: 'num', value: 1 })
       for (let i = 0; i < this.pdfDocument.numPages; i++) {
         this.config.PAGE_TO_VIEW++
         this.renders()
@@ -194,7 +231,7 @@ export default class extends Vue {
     for (let i = 0; i < this.pData.heightList.length; i++) {
       base += this.pData.heightList[i]
       if (top <= base) {
-        // this.updateText({type: 'num', value: i + 1})
+        this.updateText({ type: 'num', value: i + 1 })
         break
       }
     }
@@ -268,7 +305,7 @@ export default class extends Vue {
       if (this.coins.balance < this.detailData.price) {
         ;(this.$refs.charge as any).show = true
       } else {
-        this.$router.push('/purchase/' + this.detailData.docId)
+        this.$router.replace('/purchase/' + this.detailData.docId)
       }
     }
   }
@@ -306,22 +343,23 @@ export default class extends Vue {
     padding-bottom: 80px;
     .tops {
         display: flex;
+        flex-direction: initial;
         background: #fff;
         padding: 24px 16px;
-        h3 {
+        .word {
+          display: flex;
+        }
+        .word01 {
             display: flex;
-            flex-direction: initial;
-            width: 100%;
-            color: #171826;
-            font-weight: 500;
-            font-size: 20px;
-            line-height: 30px;
-            .word01 {
-                display: inline-table;
-                width: 26px;
-                height: 24px;
-                margin-right: 8px;
-            }
+            width: 24px;
+            height: 24px;
+            margin-right: 8px;
+        }
+        .title {
+          color: #171826;
+          font-weight: 500;
+          font-size: 20px;
+          line-height: 30px;
         }
     }
     .middles {
@@ -357,12 +395,60 @@ export default class extends Vue {
             }
         }
     }
+    .head-tip {
+        width: auto;
+        height: 60px;
+        background: #fcfcfc;
+        display: flex;
+        justify-content: flex-end;
+        align-items: center;
+        padding: 0 16px;
+        border-bottom: 1px solid #F2F2F4;
+        h3 {
+            display: flex;
+            align-items: center;
+            span {
+                width: 260px;
+                color: #686868;
+                font-weight: 500;
+                font-size: 14px;
+                line-height: 24px;
+                overflow: hidden;
+                text-overflow:ellipsis;
+                white-space: nowrap;
+            }
+            i {
+                margin-right: 8px;
+            }
+        }
+        .pages {
+            color: #686868;
+            font-size: 14px;
+            i:first-child {
+                display: inline-block;
+                font-style: normal;
+                width: 16px;
+                height: 16px;
+                line-height: 18px;
+                text-align: center;
+                border-radius: 2px;
+                background: #FFFFFF;
+                border: 1px solid #ECECEC;
+            }
+        }
+    }
+    .is-fixed {
+        position: fixed;
+        top: 0;
+        justify-content: space-between;
+    }
     .botts {
         // padding: 16px 24px;
         // width: 375px;
         background: #fff;
         .cont-page {
           // width: 375px;
+          overflow-y: scroll;
           background: #fff;
         }
     }

+ 13 - 15
jydocs-mobile/src/views/purchase/purchase.vue

@@ -59,7 +59,7 @@
         </div>
       </div>
       <div class="readly">
-        <van-checkbox v-model="checked" checked-color="#2ABED1" @click="checkBtn()">我已阅读并同意<a href="javascript:;" class="clause" @click="clause()">《剑鱼文库线上购买及服务条款》</a><a href="javascript:;" class="clause" @click="clause2()">《剑鱼标讯产品与服务线上购买服务条款》</a></van-checkbox>
+        <van-checkbox v-model="checked" checked-color="#2ABED1" @click="checkBtn()">我已阅读并同意<a href="javascript:;" class="clause" @click.stop="clause()">《剑鱼文库线上购买及服务条款》</a><a href="javascript:;" class="clause" @click.stop="clause2()">《剑鱼标讯产品与服务线上购买服务条款》</a></van-checkbox>
       </div>
       <div class="apply_footer">
         <button class="apply_button" :disabled="!this.btnChecked" @click="exchange()">确定兑换</button>
@@ -72,7 +72,7 @@
 import { Component, Vue } from 'vue-property-decorator'
 import { Checkbox, CheckboxGroup, Field, CellGroup, Form } from 'vant'
 import { mapActions } from 'vuex'
-import { isWeiXinBrowser, formatSize } from '../../utils/globalFunctions'
+import { formatSize } from '../../utils/globalFunctions'
 @Component({
   name: 'purchase-page',
   components: {
@@ -102,6 +102,7 @@ export default class extends Vue {
   regPhoneExg = /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57]|19[0-9])[0-9]{8}$/
   query: any
   $router: any
+  $env: any
   response = {
     docName: '',
     price: '',
@@ -115,7 +116,6 @@ export default class extends Vue {
   created () {
     this.query = location.href.split('/')[location.href.split('/').length - 1] // 获取id
     this.getWordInfor()
-    this.getBindPhone()
   }
 
   validator (val: any) {
@@ -148,14 +148,6 @@ export default class extends Vue {
     }
   }
 
-  // 获取绑定的手机号
-  getBindPhone () {
-    this.getAccountInfo().then((res: any) => {
-      console.log(res)
-      this.tel = res.data.phone
-    })
-  }
-
   // 文档信息
   async getWordInfor () {
     this.getDetails({ docId: this.query }).then((res: any) => {
@@ -178,6 +170,12 @@ export default class extends Vue {
         this.response.balance = res.data.points.balance
       }
     })
+
+    // 获取绑定的手机号
+    this.getAccountInfo().then((res: any) => {
+      console.log(res)
+      this.tel = res.data.phone
+    })
   }
 
   // 确定兑换
@@ -186,7 +184,7 @@ export default class extends Vue {
       console.log(res)
       if (res.error_code === 0) {
         sessionStorage.setItem('paydata', JSON.stringify(res.data))
-        this.$router.push('/purchasesuccess/' + this.response.price)
+        this.$router.replace('/purchasesuccess/' + this.response.price)
       }
     })
   }
@@ -198,10 +196,10 @@ export default class extends Vue {
 
   // 剑鱼标讯产品与服务线上购买服务条款
   clause2 () {
-    if (!isWeiXinBrowser) {
-      location.href = '/front/staticPage/wx-serviceterms.html'
-    } else {
+    if (this.$env.platform === 'app') {
       location.href = '/jyapp/front/staticPage/dataExport_serviceterms.html'
+    } else {
+      location.href = '/front/staticPage/wx-serviceterms.html'
     }
   }
 }

+ 8 - 12
jydocs-mobile/vue.config.js

@@ -45,27 +45,23 @@ module.exports = {
     open: false,
     disableHostCheck: true,
     proxy: {
-      '^/dev/api': {
-        target: 'http://192.168.20.180:821',
+      '^/jydocs': {
+        target: 'https://web2-jytest.jydev.jianyu360.com',
+        // target: 'http://192.168.20.180:821',
         changeOrigin: true,
-        logLevel: 'debug',
-        pathRewrite: {
-          '^/dev/api': '/jydocs'
-        }
+        logLevel: 'debug'
       },
       '^/jypay': {
+        // target: 'https://web2-jytest.jydev.jianyu360.com',
         target: 'http://192.168.20.145:86',
         changeOrigin: true,
         logLevel: 'debug'
       },
       '^/jyintegral': {
-        // target: 'http://web2-jytest.jydev.jianyu360.com',
-        target: 'http://192.168.20.145:820',
+        target: 'http://web2-jytest.jydev.jianyu360.com',
+        // target: 'http://192.168.20.145:820',
         changeOrigin: true,
-        logLevel: 'debug',
-        pathRewrite: {
-          '^/jyintegral': '/jyintegral'
-        }
+        logLevel: 'debug'
       }
     }
   },

+ 1 - 1
jydocs-pc/.env.alone

@@ -1,6 +1,6 @@
 NODE_ENV=development
 VUE_APP_BASE_API='/jydocs/'
 VUE_APP_BASE_URL='/'
-VUE_APP_MOCK=true
+VUE_APP_MOCK=false
 VUE_APP_ALONE=true
 VUE_APP_BASE_PUBLIC='/'

+ 1 - 1
jydocs-pc/.env.development

@@ -3,4 +3,4 @@ VUE_APP_BASE_API='/jydocs/'
 VUE_APP_BASE_URL='/swordfish/frontPage/docs/sess/index/'
 VUE_APP_MOCK=false
 VUE_APP_BASE_PUBLIC='http://localhost:8080/'
-VUE_APP_LOG_URL='https://web2-jytest.jydev.jianyu360.com/jyLogs/pointsLogs?logAction='
+VUE_APP_LOG_URL='https://web2-jytest.jydev.jianyu360.com/jyLogs/actionInfo?logAction='

+ 1 - 1
jydocs-pc/.env.production

@@ -2,4 +2,4 @@ NODE_ENV=production
 VUE_APP_BASE_API='/jydocs/'
 VUE_APP_BASE_URL='/swordfish/docs/index'
 VUE_APP_BASE_PUBLIC='/page_docs/'
-VUE_APP_LOG_URL='https://www.jianyu360.com/jyLogs/pointsLogs?logAction='
+VUE_APP_LOG_URL='https://www.jianyu360.com/jyLogs/actionInfo?logAction='

+ 2 - 2
jydocs-pc/public/index.html

@@ -7,7 +7,7 @@
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title>app1</title>
     <% if (process.env.NODE_ENV === 'development') { %>
-      <link href="https://web2-jytest.jianyu360.cn/css/bootstrap.min.css" rel="stylesheet">
+      <!-- <link href="https://web2-jytest.jianyu360.cn/css/bootstrap.min.css" rel="stylesheet">
       <link href="https://web2-jytest.jianyu360.cn/css/bootswatch.min.css" rel="stylesheet">
       <link href="https://web2-jytest.jianyu360.cn/css/font.css?v=6302" rel="stylesheet">
       <link href="https://web2-jytest.jianyu360.cn/css/jy.css?v=6302" rel="stylesheet">
@@ -24,7 +24,7 @@
       <link href='https://web2-jytest.jianyu360.cn/css/reset.css?v=6302' rel="stylesheet" type="text/css"/>
       <link href='https://web2-jytest.jianyu360.cn/pccss/reset_pc.css' rel="stylesheet" type="text/css"/>
       <link href='https://web2-jytest.jianyu360.cn/css/pc.css?v=6302' rel="stylesheet"/>
-      <link href='https://web2-jytest.jianyu360.cn/pccss/public-nav-1200.css?v=6302' rel="stylesheet" type="text/css"/>
+      <link href='https://web2-jytest.jianyu360.cn/pccss/public-nav-1200.css?v=6302' rel="stylesheet" type="text/css"/> -->
     <% } %>
   </head>
   <body>

+ 9 - 0
jydocs-pc/src/api/modules/detail.js

@@ -75,3 +75,12 @@ export function getShare (data) {
     data
   })
 }
+
+export function getRecommend (data) {
+  console.log(data)
+  return request({
+    url: '/detail/recommend',
+    method: 'post',
+    data
+  })
+}

+ 128 - 0
jydocs-pc/src/components/recommend.vue

@@ -0,0 +1,128 @@
+<template>
+  <div class="c-recommend">
+    <div class="r-bott">
+        <h3>相关推荐</h3>
+        <div class="docs" v-for="item in recomes" :key="item.docId">
+            <div class="imgs">
+                <img :src="item.previewImgId" alt="">
+                <i class="el-icon-jy-word"></i>
+            </div>
+            <div class="conts">
+                <h5>{{item.docName}}</h5>
+                <!-- <p>贡献者:{{item.price}}</p> -->
+                <div class="d-tip">
+                    <p>{{item.downTimes}}次下载</p>
+                    <el-divider direction="vertical"></el-divider>
+                    <p>共{{item.docPageSize}}页</p>
+                    <el-divider direction="vertical"></el-divider>
+                    <p>{{item.docFileSize}}</p>
+                </div>
+                <div class="r-coin">500剑鱼币</div>
+            </div>
+        </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { Divider } from 'element-ui'
+export default {
+  props: {
+    recomes: {}
+  },
+  components: {
+    [Divider.name]: Divider
+  },
+  data () {
+    return {
+      
+    }
+  },
+  methods: {
+    
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.c-recommend {
+  // display: flex;
+  // flex-direction: initial;
+  .r-bott {
+      min-height: 448px;
+      border-radius: 4px;
+      background: #fff;
+      margin-top: 16px;
+      padding: 15px 12px;
+      h3 {
+          color: #686868;
+          font-size: 16px;
+          line-height: 24px;
+          font-weight: 500;
+          margin-top: 0;
+          margin-bottom: 13px;
+      }
+      .docs {
+          display: flex;
+          height: 112px;
+          .imgs {
+              display: table;
+              position: relative;
+              border-radius: 4px;
+              border: 1px solid #ECECEC;
+              img {
+                  width: 78px;
+                  height: 112px;
+                  border: 0;
+              }
+              i {
+                  position: absolute;
+                  right: 0;
+                  bottom: 0;
+              }
+          }
+          .conts {
+              margin-left: 8px;
+              h5 {
+                  margin: 0;
+                  font-size: 14px;
+                  line-height: 24px;
+                  font-weight: 500;
+                  display: -webkit-box;
+                  -webkit-line-clamp:2;
+                  overflow: hidden;
+                  text-overflow: ellipsis;
+                  -webkit-box-orient: vertical;
+              }
+              p {
+                  margin: 0;
+                  color: #999999;
+                  font-size: 12px;
+                  line-height: 20px;
+              }
+              .d-tip {
+                  display: flex;
+                  flex-direction: initial;
+                  align-items: center;
+                  .el-divider--vertical {
+                      height: 0.8em;
+                      margin: 0 2px;
+                  }
+                  p {
+                      padding: 0 1px;
+                  }
+              }
+              .r-coin {
+                  color: #2CB7CA;
+                  font-size: 14px;
+                  line-height: 24px;
+                  margin-top: 2px;
+              }
+          }
+      }
+      .docs:not(:last-child) {
+        margin-bottom: 16px;
+      }
+  }
+}
+</style>

+ 35 - 11
jydocs-pc/src/views/Content.vue

@@ -18,8 +18,8 @@
                   <div class="coin"><i class="el-icon-jy-iconJianYu"></i><span>{{datas.price}}</span></div>
               </div>
               <div class="buyed" v-if="buyed == 1">您已兑换过该文档,可直接下载</div>
-              <div class="buyed no-buyed" v-else-if="datas.price > coinNum && buyed == 0">剑鱼币余额不足,现有 {{coinNum}} 剑鱼币,还需 {{datas.price - coinNum}} 剑鱼币,请先充值</div>
-              <el-divider class="heng-line" v-else></el-divider>
+              <div class="buyed no-buyed" v-if="redShow">剑鱼币余额不足,现有 {{coinNum}} 剑鱼币,还需 {{datas.price - coinNum}} 剑鱼币,请先充值</div>
+              <el-divider class="heng-line" v-if="lineShow"></el-divider>
               <div class="load-doc">
                   <el-button type="primary" @click="loadFile">{{btnName}}</el-button>
                   <div class="icons">
@@ -30,14 +30,14 @@
                               <p style="color: #686868;font-size: 14px;text-align:center;">微信扫码分享</p>
                           </div>
                       </el-tooltip>
-                      <span class="spa1 spa2" @click="shoucang"><i :class="collectd==1?'el-icon-jy-guanzhu':'el-icon-jy-weiguanzhu'"></i>收藏</span>
+                      <span class="spa1 spa2" @click="shoucang"><i :class="collectd==1?'el-icon-jy-guanzhu':'el-icon-jy-weiguanzhu'"></i>{{collectd==1?'已收藏':'收藏'}}</span>
                       <el-tooltip content="如果您发现此内容有侵权行为,请联系客服400-108-6670进行投诉" placement="top" effect="dark">
                           <span class="spa1"><i class="el-icon-jy-jubao"></i>投诉举报</span>
                       </el-tooltip>
                   </div>
               </div>
           </div>
-          <div class="middles">
+          <div class="middles" :class="{'actives':buyed == 0, 'actives1':lineShow == 1}">
               <h3>摘要</h3>
               <p>{{datas.docSummary}}</p>
               <div class="continue" v-show="buyed == 0">全文共{{datas.docPageSize}}页,<span @click="continued">继续阅读<i class="el-icon-arrow-down"></i></span></div>
@@ -63,7 +63,7 @@
                                   <p style="color: #686868;font-size: 14px;text-align:center;">微信扫码分享</p>
                               </div>
                           </el-tooltip>
-                          <span class="spa1 spa2" @click="shoucang"><i :class="collectd==1?'el-icon-jy-guanzhu':'el-icon-jy-weiguanzhu'"></i>收藏</span>
+                          <span class="spa1 spa2" @click="shoucang"><i :class="collectd==1?'el-icon-jy-guanzhu':'el-icon-jy-weiguanzhu'"></i>{{collectd==1?'已收藏':'收藏'}}</span>
                           <el-tooltip content="如果您发现此内容有侵权行为,请联系客服400-108-6670进行投诉" placement="top" effect="dark">
                               <span class="spa1"><i class="el-icon-jy-jubao"></i>投诉举报</span>
                           </el-tooltip>
@@ -79,14 +79,16 @@
                 <img :src="item.s_pic">
               </a>
           </div>
+          <v-recommend :recomes="recomes"></v-recommend>
       </div>
   </div>
 </template>
 
 <script>
 import { Button, Tooltip, Divider, Message } from 'element-ui'
-import { getDetails, getShow, getDown, getAdverse, getCoin, getAdd, getRemove } from '../api/modules/detail'
+import { getDetails, getShow, getRecommend, getDown, getAdverse, getCoin, getAdd, getRemove } from '../api/modules/detail'
 import { formatSize, dateFormatter } from '@/utils/'
+import vRecommend from '@/components/recommend'
 const pdfjsLib = require('pdfjs-dist/build/pdf.js')
 const pdfjsViewer = require('pdfjs-dist/web/pdf_viewer.js')
 export default {
@@ -94,7 +96,8 @@ export default {
     [Button.name]: Button,
     [Tooltip.name]: Tooltip,
     [Divider.name]: Divider,
-    [Message.name]: Message
+    [Message.name]: Message,
+    vRecommend
   },
   data () {
     return {
@@ -103,6 +106,7 @@ export default {
       datas: [],
       conts: [],
       adsUrl: [],
+      recomes: [],
       coinNum: 0,
       btnName: '',
       buyed: 0,
@@ -110,6 +114,8 @@ export default {
       offsetTop: 0,
       offsetWidth: 0,
       colWidth: 0,
+      redShow: false,
+      lineShow: false,
       fixed: false,
       pdfh5: null,
       pdfDocument: null,
@@ -217,30 +223,41 @@ export default {
       getCoin({ B: true }).then(res => {
         if (res.data.error_code === 0) {
           this.coinNum = res.data.data.points.balance
-          console.log(this.buyed)
           if (this.buyed === 1) {
             this.btnName = '下载文档'
+            this.lineShow = false
           } else {
             if (this.coinNum < this.datas.price) {
               this.btnName = '立即充值'
+              this.redShow = true
             } else {
               this.btnName = '立即兑换'
+              this.redShow = false
+              this.lineShow = true
             }
           }
         }
       })
     },
+    recommend (str) {
+      getRecommend({ docTag: str, docId: this.docIds, num: 3 }).then(res => {
+        res.data.data.forEach(v => {
+          v.docFileSize = formatSize(v.docFileSize)
+          this.recomes.push(v)
+        });
+      })
+    },
     details () {
       getDetails({ docId: this.docIds, from: this.$route.query.from }).then(res => {
         if (res.data.error_code === 0) {
           this.datas = res.data.data.detail
           this.datas.docFileSize = formatSize(this.datas.docFileSize)
-          this.datas.uploadDate = dateFormatter(this.datas.uploadDate, 'yyyy-MM-ss')
+          this.datas.uploadDate = dateFormatter(this.datas.uploadDate, 'yyyy-MM-dd')
           this.datas.docSummary = this.datas.docSummary.split('').length >= 500 ? this.datas.docSummary + '...' : this.datas.docSummary
           this.datas.tags = this.datas.tags.split(',')
           this.buyed = res.data.data.status
-          console.log(res.data.data.status)
           this.coined()
+          this.recommend(res.data.data.detail.tags)
           if (res.data.data.status === 1) {
             this.buyShow()
           }
@@ -412,7 +429,7 @@ export default {
               color: #2CB7CA;
               background: rgba(44,183,202,0.05);
               font-size: 12px;
-              line-height: 20px;
+              line-height: 24px;
               text-align: center;
               border-radius: 4px;
               margin: 10px 0 8px 0;
@@ -464,6 +481,7 @@ export default {
           }
       }
       .middles {
+          height: 316px;
           padding: 24px 40px;
           background: #fff;
           border-radius: 4px;
@@ -494,6 +512,12 @@ export default {
               }
           }
       }
+      .actives {
+        height: 530px;
+      }
+      .actives1 {
+        height: 552px;
+      }
       .head-tip {
             width: 920px;
             height: 42px;

+ 2 - 2
jydocs-pc/vue.config.js

@@ -18,8 +18,8 @@ module.exports = {
         }
       },
       '^/jyintegral': {
-        // target: 'http://web2-jytest.jydev.jianyu360.com',
-        target: 'http://192.168.20.145:820',
+        target: 'http://web2-jytest.jydev.jianyu360.com',
+        // target: 'http://192.168.20.145:820',
         changeOrigin: true,
         logLevel: 'debug',
         pathRewrite: {