浏览代码

fix: 修复错误

zhangyuhan 4 年之前
父节点
当前提交
bcaad276ba

+ 1 - 1
jydocs-pc/package.json

@@ -6,7 +6,7 @@
     "serve": "vue-cli-service serve --port 8080",
     "serve:alone": "vue-cli-service serve --mode alone",
     "build": "vue-cli-service build",
-    "build": "vue-cli-service build --mode test",
+    "build:test": "vue-cli-service build --mode test",
     "lint": "vue-cli-service lint --fix"
   },
   "dependencies": {

+ 1 - 0
jydocs-pc/src/api/modules/purchase.js

@@ -22,6 +22,7 @@ export function getDocPays (data) {
 export function getJYchannel (data) {
   data = qs.stringify(data)
   return request({
+    baseURL: '/jyintegral',
     url: '/getList',
     method: 'post',
     data: data

+ 1 - 1
jydocs-pc/src/router.js

@@ -24,7 +24,7 @@ export default new Router({
       component: () => import('@/views/Search.vue')
     },
     {
-      path: '/purchase',
+      path: '/purchase/:id',
       name: 'purchase',
       component: () => import('@/views/purchase/purchase.vue')
     },

+ 5 - 5
jydocs-pc/src/views/Content.vue

@@ -212,13 +212,13 @@ export default {
           this.datas = res.data.data.detail
           this.datas.tags = this.datas.tags.split(',')
           this.buyed = !!(res.data.data.status)
-          this.collectd = res.data.data.docCang
+          this.collectd = res.data.data.collect
         }
       })
       getCoin({ B: true }).then(res => {
-        console.log(res)
+        console.log(res.data, '111111')
         if (res.data.error_code === 0) {
-          this.coinNum = res.data.data.data.points.balance
+          this.coinNum = res.data.data.points.balance
           if (this.buyed) {
             this.btnName = '下载文档'
           } else {
@@ -290,9 +290,9 @@ export default {
         })
       } else {
         if (this.coinNum < this.datas.price) {
-          window.location.href = '/page_points/recharge?id=' + this.detailData.docId
+          window.location.href = '/page_points/recharge?id=' + this.datas.docId
         } else {
-          this.$router.push({ path: '/purchase', query: { id: this.detailData.docId } })
+          this.$router.push({ name: 'purchase', params: { id: this.datas.docId } })
         }
       }
     },

+ 2 - 2
jydocs-pc/src/views/purchase/purchase.vue

@@ -99,8 +99,8 @@ export default {
     // 文档信息
     async getWordDetail () {
       getDetails({ docId: this.query, phone: this.tel }).then((res) => {
-        console.log(res)
-        if (res.data.data.status === 1) {
+        console.log(res.data.data)
+        if (res.data.data.error_msg !== '') {
           const item = res.data.data.detail
           console.log(item)
           this.response.docName = item.docName