xgwangman 4 jaren geleden
bovenliggende
commit
a4d47f7e48

+ 1 - 1
jydocs-mobile/src/router/modules/main.ts

@@ -28,7 +28,7 @@ export default [
     name: 'details',
     component: () => import('@/views/details/details.vue'),
     meta: {
-      title: '文库详情',
+      title: '剑鱼文库',
       layoutConf: true
     }
   },

+ 11 - 4
jydocs-mobile/src/views/details/details.vue

@@ -9,9 +9,9 @@
         <div class="middles">
             <h3>摘要</h3>
             <p>{{detailData.docSummary}}</p>
-            <div class="continue" v-show="!buyed">全文共{{detailData.docPageSize}}页,<span @click="continued">继续阅读<van-icon name="arrow-down" size="18" /></span></div>
+            <div class="continue" v-show="buyed == 0">全文共{{detailData.docPageSize}}页,<span @click="continued">继续阅读<van-icon name="arrow-down" size="18" /></span></div>
         </div>
-        <div class="botts" v-show="buyed">
+        <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>
@@ -60,6 +60,7 @@ const pdfjsViewer = require('pdfjs-dist/web/pdf_viewer.js')
       getDetails: 'main/getDetails',
       getShow: 'main/getShow',
       getCoin: 'main/getCoin',
+      getDown: 'main/getDown',
       getShare: 'main/getShare',
       getAdd: 'main/getAdd',
       getRemove: 'main/getRemove'
@@ -69,6 +70,7 @@ const pdfjsViewer = require('pdfjs-dist/web/pdf_viewer.js')
 export default class extends Vue {
   getDetails: any
   getCoin: any
+  getDown: any
   getShow: any
   getShare: any
   links: any = []
@@ -200,6 +202,7 @@ export default class extends Vue {
     this.getDetails({ docId: this.docIds, from: this.$route.query.from }).then((res: any) => {
       console.log(res.data)
       this.detailData = res.data.detail
+      this.detailData.docSummary = res.data.detail.docSummary.split('').length >= 500 ? res.data.detail.docSummary + '...' : res.data.detail.docSummary
       this.buyed = res.data.status
       if (res.data.status === 1) {
         this.buyShow()
@@ -246,13 +249,17 @@ export default class extends Vue {
   uploaded () {
     Toast('点击按钮')
     if (this.buyed === 1) {
-      this.$router.push('/')
+      this.getDown({ docId: this.docIds }).then((res: any) => {
+        if (res.error_code === 0) {
+          window.location.href = res.data
+        }
+      })
     } else {
       console.log('111')
       if (this.coins.balance < this.detailData.price) {
         ;(this.$refs.charge as any).show = true
       } else {
-        this.$router.push({ path: '/purchase', query: { id: this.detailData.docId } })
+        this.$router.push('/purchase/' + this.detailData.docId)
       }
     }
   }

+ 9 - 0
jydocs-mobile/vue.config.js

@@ -57,6 +57,15 @@ module.exports = {
         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',
+        changeOrigin: true,
+        logLevel: 'debug',
+        pathRewrite: {
+          '^/jyintegral': '/jyintegral'
+        }
       }
     }
   },

+ 5 - 0
jydocs-mobile/yarn.lock

@@ -9577,6 +9577,11 @@ websocket-extensions@>=0.1.1:
   resolved "https://registry.npm.taobao.org/websocket-extensions/download/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42"
   integrity sha1-f4RzvIOd/YdgituV1+sHUhFXikI=
 
+weixin-js-sdk@^1.6.0:
+  version "1.6.0"
+  resolved "https://registry.npm.taobao.org/weixin-js-sdk/download/weixin-js-sdk-1.6.0.tgz#ff50484d8118ce1208f11248cf4a1c0831577514"
+  integrity sha1-/1BITYEYzhII8RJIz0ocCDFXdRQ=
+
 which-module@^2.0.0:
   version "2.0.0"
   resolved "https://registry.npm.taobao.org/which-module/download/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"