瀏覽代碼

问题修改

wenmenghao 2 年之前
父節點
當前提交
71fdcf4bd2
共有 2 個文件被更改,包括 27 次插入9 次删除
  1. 8 0
      jydocs-pc/src/api/modules/detail.js
  2. 19 9
      jydocs-pc/src/views/Content.vue

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

@@ -84,3 +84,11 @@ export function getRecommend (data) {
     data
   })
 }
+export function getSimpleData (data) {
+  return request({
+    baseURL: '/jypay',
+    url: '/user/getSimpleData',
+    method: 'post',
+    params: data
+  })
+}

+ 19 - 9
jydocs-pc/src/views/Content.vue

@@ -24,7 +24,7 @@
           剑鱼币,请先充值</div>
         <el-divider class="heng-line" v-if="lineShow"></el-divider>
         <div class="load-doc">
-          <el-button type="primary" @click="loadFile" >{{ islogin ? btnName : '查看详情' }}</el-button>
+          <el-button type="primary" @click="loadFile">{{ islogin ? btnName : '查看详情' }}</el-button>
           <div class="icons">
             <el-tooltip placement="bottom" effect="light" popper-class="f-share">
               <span class="spa1"><i class="el-icon-jy-share"></i>分享</span>
@@ -76,7 +76,7 @@
                 <span class="spa1"><i class="el-icon-jy-jubao"></i>投诉</span>
               </el-tooltip>
             </div>
-            <el-button type="primary" @click="loadFile">{{ islogin? btnName : '查看详情' }}</el-button>
+            <el-button type="primary" @click="loadFile">{{ islogin ? btnName : '查看详情' }}</el-button>
           </div>
         </div>
       </div>
@@ -93,7 +93,7 @@
 </template>
 <script>
 import { Button, Tooltip, Divider, Message } from 'element-ui'
-import { getDetails, getShow, getRecommend, getDown, getAdverse, getCoin, getAdd, getRemove } from '../api/modules/detail'
+import { getDetails, getShow, getRecommend, getDown, getAdverse, getCoin, getAdd, getRemove, getSimpleData } from '../api/modules/detail'
 import { formatSize, dateFormatter, recoveryPageData } from '@/utils/'
 import vRecommend from '@/components/recommend'
 import { getSearchTag } from '../api/modules/home'
@@ -142,14 +142,10 @@ export default {
     }
   },
   created () {
-    const this_ = this
-    window.loginCallback = function () {
-      this_.islogin = true
-      this_.coined()
-      // console.log(this_)
-    }
+    window.loginCallback = this.loginCallback
     this.docIds = this.$route.params.id
     this.locaHref = window.location.origin
+    this.getSimpleData_()
     this.setTop()
     this.adverse()
   },
@@ -180,6 +176,20 @@ export default {
     }
   },
   methods: {
+    loginCallback () {
+      this.islogin = true
+      this.adverse()
+      this.tabs = recoveryPageData('jy-docs-search-tags-pc')
+      this.getTags()
+      this.details()
+    },
+    getSimpleData_ () {
+      getSimpleData({ t: new Date().getTime() }).then((res) => {
+        if (!res.data.error) {
+          this.islogin = true
+        }
+      })
+    },
     setTop () {
       this.$nextTick(() => {
         // 获取到达页面顶端的值