Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

wangkaiyue 4 yıl önce
ebeveyn
işleme
2e86459d77

+ 4 - 12
jydocs-mobile/src/api/main.ts

@@ -44,8 +44,6 @@ export function getMyLibList (params: any) {
 }
 
 export function getDetails (data: any) {
-  console.log(data)
-  // data = qs.stringify(data)
   return $request({
     url: '/detail',
     method: 'post',
@@ -70,8 +68,6 @@ export function getDown (data: any) {
 }
 
 export function getAdd (data: any) {
-  console.log(data)
-  // data = qs.stringify(data)
   return $request({
     url: '/user/collect/add',
     method: 'post',
@@ -80,8 +76,6 @@ export function getAdd (data: any) {
 }
 
 export function getRemove (data: any) {
-  console.log(data)
-  // data = qs.stringify(data)
   return $request({
     url: '/user/collect/remove',
     method: 'post',
@@ -90,7 +84,6 @@ export function getRemove (data: any) {
 }
 
 export function getCoin (data: any) {
-  console.log(data)
   return $request({
     baseURL: '/jyintegral',
     url: '/getList',
@@ -100,7 +93,6 @@ export function getCoin (data: any) {
 }
 
 export function getShare (data: any) {
-  console.log(data)
   return $request({
     url: '/share/url',
     method: 'post',
@@ -114,7 +106,7 @@ export function getDocPay (data: any) {
   return $request({
     url: '/user/buy',
     method: 'post',
-    params: data
+    data
   })
 }
 
@@ -122,9 +114,10 @@ export function getDocPay (data: any) {
 export function getListDetail (data: any) {
   data = qs.stringify(data)
   return $request({
+    baseURL: '/jyintegral',
     url: '/getList',
     method: 'post',
-    params: data
+    data
   })
 }
 
@@ -135,7 +128,6 @@ export function getAccountInfo (data: any) {
   return $request({
     baseURL: '',
     url: '/jypay/user/getAccountInfo',
-    method: 'post',
-    params: data
+    method: 'post'
   })
 }

+ 1 - 1
jydocs-mobile/src/components/Recharge.vue

@@ -59,7 +59,7 @@ export default class extends Vue {
     }
 
     buyMoney () {
-      window.location.href = '/page_points/recharge?id=' + this.detailData.docId
+      window.location.href = '/page_points_app/pay'
     }
 }
 </script>

+ 6 - 1
jydocs-mobile/src/components/SharePopup.vue

@@ -10,7 +10,7 @@
                 <span class="icon_jianyu"></span>
                 <span class="share_t_text">分享招标信息及文档,好友访问立得剑鱼币</span>
             </div>
-            <span class="share_detail">了解详情</span>
+            <span class="share_detail" @click="reviewDetail()">了解详情</span>
         </div>
         <div class="share_channel">
             <div class="share_c_wx share_out" @click="shareClick('1')">
@@ -55,6 +55,11 @@ export default class extends Vue {
         link: this.links.url
       })
     }
+
+    // 了解详情
+    reviewDetail () {
+      location.href = '/page_points_app/share'
+    }
 }
 </script>
 

+ 14 - 6
jydocs-mobile/src/components/docs-card/Card.vue

@@ -1,13 +1,13 @@
 <template>
   <div class="doc-container van-hairline--bottom" @click="clickCard">
-    <div class="docs-card oneline" v-if="cardType === 'oneline'" key="docs-card">
+    <div class="docs-card oneline" :class="highlightKey.length === 0 ? '' : 'highlight'" v-if="cardType === 'oneline'" key="docs-card">
       <div class="docs-header flex-r-c center">
         <van-icon :name="docTypeIcon" />
         <div class="d-title flex van-ellipsis" v-html="hightLightTitle"></div>
         <Price :price="price" />
       </div>
     </div>
-    <div class="docs-card image flex-r-c" v-else-if="cardType === 'image'" key="docs-card">
+    <div class="docs-card image flex-r-c" :class="highlightKey.length === 0 ? '' : 'highlight'" v-else-if="cardType === 'image'" key="docs-card">
       <div class="image-container">
         <img v-lazy="imageSrc" />
         <van-icon class="doc-type-icon" :name="docTypeIcon" />
@@ -32,7 +32,7 @@
         </div>
       </div>
     </div>
-    <div class="docs-card" v-else key="docs-card">
+    <div class="docs-card" :class="highlightKey.length === 0 ? '' : 'highlight'" v-else key="docs-card">
       <div class="docs-header flex-r-c">
         <van-icon :name="docTypeIcon" />
         <div class="d-title flex van-ellipsis" v-html="hightLightTitle"></div>
@@ -129,6 +129,17 @@ export default class DocsCard extends Vue {
     }
   }
 
+  &.highlight {
+    .docs-desc,
+    .d-title {
+      ::v-deep {
+        em {
+          color: $color_main;
+        }
+      }
+    }
+  }
+
   @include diy-icon('pdf');
   @include diy-icon('word');
   @include diy-icon('excel');
@@ -139,9 +150,6 @@ export default class DocsCard extends Vue {
       margin-left: 4px;
       font-size: 16px;
       color: #171826;
-      em {
-        color: $color_main;
-      }
     }
   }
 

+ 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
     }
   },

+ 64 - 0
jydocs-mobile/src/utils/wxShare.ts

@@ -0,0 +1,64 @@
+import Vue from 'vue'
+import WeiXinSDK from '@/utils/wx-js-sdk-register.ts'
+import { isWeiXinBrowser, androidOrIOS } from '@/utils/globalFunctions'
+import { getWxSdkSign } from '@/api/index.ts'
+
+declare module 'vue/types/vue' {
+  interface Vue {
+    $env: any;
+    $registerWxSdk: any;
+    $wxSdk: any;
+  }
+}
+
+const inWeiXinBrowser = isWeiXinBrowser()
+const isAndroidOrIos = androidOrIOS()
+const firstUrl = location.href.split('#')[0]
+
+export async function getSdkSign (url: string) {
+  const sdkInfo = await getWxSdkSign({ url })
+  if (!sdkInfo) return
+  const info = sdkInfo.data
+  if (info && info.wxsdk && Array.isArray(info.wxsdk)) {
+    const sdk = info.wxsdk
+    return new WeiXinSDK({
+      appId: sdk[0],
+      timestamp: sdk[1],
+      nonceStr: sdk[2],
+      signature: sdk[3]
+    })
+  }
+}
+
+/* 微信自定义分享封装函数 */
+/**
+ * url:获取微信分享签名的url地址
+ * isShare:当前所在路径是否需要分享
+ *  */
+export async function weChatShare (options: any) {
+  if (!inWeiXinBrowser) return
+
+  const device = isAndroidOrIos
+  // 获取并注册sdkSign
+  const url = location.href.split('#')[0]
+  if (device === 'ios') {
+    // url = firstUrl
+    console.log(firstUrl)
+  }
+  const wxSdk: any = await getSdkSign(url)
+  Vue.prototype.$wxSdk = wxSdk
+  wxSdk.shareToFriendAndQQ(options)
+  wxSdk.shareToFriendsAndQZone(options)
+  return wxSdk
+}
+
+export async function weChatPay (options: any) {
+  if (!inWeiXinBrowser) return
+
+  // 获取并注册sdkSign
+  const url = location.href.split('#')[0]
+  const wxSdk: any = await getSdkSign(url)
+  Vue.prototype.$wxSdk = wxSdk
+  wxSdk.chooseWXPayForWeiXinJSBridge(options)
+  return wxSdk
+}

+ 9 - 2
jydocs-mobile/src/views/Search.vue

@@ -11,7 +11,7 @@
       >
         <van-tab v-for="(item, index) in docsTypeConf.list" :key="index" :title="item.label" :name="item.type"></van-tab>
       </van-tabs>
-      <div class="sort-list flex-r-c center">
+      <div class="sort-list flex-r-c center" v-if="listState.loaded">
         <div
           class="sort-list-item flex-r-c center flex"
           :class="{
@@ -279,7 +279,14 @@ export default class extends Vue {
 
   calcSubInfo (item: any) {
     const { uploadDate, downTimes } = item
-    return [dateFormatter(uploadDate, 'yyyy/MM/dd'), `${downTimes}次下载`]
+    const subInfoArr = []
+    if (uploadDate !== undefined) {
+      subInfoArr.push(dateFormatter(uploadDate, 'yyyy/MM/dd'))
+    }
+    if (downTimes !== undefined) {
+      subInfoArr.push(`${downTimes}次下载`)
+    }
+    return subInfoArr
   }
 
   setScrollTop () {

+ 27 - 11
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>
@@ -41,6 +41,7 @@ import { Icon, Toast, GoodsAction, GoodsActionIcon, GoodsActionButton } from 'va
 import Recharge from '@/components/Recharge.vue'
 import sharePop from '@/components/SharePopup.vue'
 import { MixinTop } from '@/utils/mixin-top'
+import { weChatShare } from '@/utils/wxShare'
 const pdfjsLib = require('pdfjs-dist/build/pdf.js')
 const pdfjsViewer = require('pdfjs-dist/web/pdf_viewer.js')
 
@@ -60,6 +61,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 +71,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 = []
@@ -118,12 +121,21 @@ export default class extends Vue {
     window.removeEventListener('scroll', this.watchPage)
   }
 
+  async getShareUrl () {
+    const { data } = await this.getShare({ docId: this.docIds })
+    this.links = data.url || location.href
+    // 注册微信sdk
+    weChatShare({
+      config: {
+        title: this.detailData.docName,
+        desc: this.detailData.docSummary,
+        url: this.links
+      }
+    })
+  }
+
   shared () {
     ;(this.$refs.shares as any).show = true
-    this.getShare({ docId: this.docIds }).then((res: any) => {
-      console.log(res)
-      this.links = res.data
-    })
   }
 
   // updateText (type: any, value = '') {
@@ -200,15 +212,17 @@ 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()
       }
       this.collectd = res.data.collect
+      this.getShareUrl()
     })
     this.getCoin({ B: true }).then((res: any) => {
       console.log(res.data.data)
-      this.coins = res.data.data.points
+      this.coins = res.data.points
     })
   }
 
@@ -244,15 +258,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)
       }
     }
   }

+ 22 - 12
jydocs-mobile/src/views/purchase/purchase.vue

@@ -13,7 +13,7 @@
           <div class="docs_other">
             <!-- <div class="docs_auther">贡献者:张三</div> -->
             <div class="docs_download">
-              <span>{{response.downTimes}}次下载</span> | 共{{response.docPageSize}}页 | {{response.docFileSize}}K
+              <span>{{response.downTimes}}次下载</span> | 共{{response.docPageSize}}页 | {{response.docFileSize}}
             </div>
             <div class="docs_money"><span class="docs_num">{{response.price}}</span> 剑鱼币</div>
           </div>
@@ -51,7 +51,7 @@
     <div class="j-footer exchange_footer">
       <div class="apply_detail">
         <div class="det_left">
-          支付积分
+          支付剑鱼币
         </div>
         <div class="det_right">
           <span class="det_money">{{response.price}}</span>
@@ -59,7 +59,7 @@
         </div>
       </div>
       <div class="readly">
-        <van-checkbox v-model="checked" checked-color="#2ABED1" >我已阅读并同意<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="clause()">《剑鱼文库线上购买及服务条款》</a><a href="javascript:;" class="clause" @click="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 { getDocPay } from '../../api/main'
+import { isWeiXinBrowser, formatSize } from '../../utils/globalFunctions'
 @Component({
   name: 'purchase-page',
   components: {
@@ -97,7 +97,7 @@ export default class extends Vue {
   protected getListDetail!: any
   protected getAccountInfo!: any
   checked = false
-  btnChecked = true
+  btnChecked = false
   tel = ''
   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
@@ -119,13 +119,16 @@ export default class extends Vue {
   }
 
   validator (val: any) {
-    console.log(val)
     if (this.tel === '') {
       return true
     }
     return this.regPhoneExg.test(val)
   }
 
+  checkBtn () {
+    this.getBool(this.validator(this.tel))
+  }
+
   // 判断按钮是否可以点击
   iptValue () {
     let bool = this.validator(this.tel)
@@ -134,6 +137,10 @@ export default class extends Vue {
     } else {
       bool = false
     }
+    this.getBool(this.validator(this.tel))
+  }
+
+  getBool (bool) {
     if (this.checked === true && bool === true) {
       this.btnChecked = true
     } else {
@@ -158,7 +165,7 @@ export default class extends Vue {
         this.response.docName = item.docName
         this.response.price = item.price
         this.response.downTimes = item.downTimes
-        this.response.docFileSize = item.docFileSize
+        this.response.docFileSize = formatSize(item.docFileSize)
         this.response.docPageSize = item.docPageSize
         this.response.previewImgId = item.previewImgId
       }
@@ -166,7 +173,8 @@ export default class extends Vue {
 
     this.getListDetail({ B: true }).then((res: any) => {
       console.log(res)
-      if (res.data.error_code === 0) {
+      if (res.error_code === 0) {
+        console.log(111)
         this.response.balance = res.data.points.balance
       }
     })
@@ -178,7 +186,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.balance)
+        this.$router.push('/purchasesuccess' + this.response.balance)
       }
     })
   }
@@ -190,9 +198,11 @@ export default class extends Vue {
 
   // 剑鱼标讯产品与服务线上购买服务条款
   clause2 () {
-    // app:https://app-a2.jianyu360.com/jyapp/front/staticPage/dataExport_serviceterms.html
-    // this.$router.push('/readme')
-    // wx:https://www.jianyu360.com/front/staticPage/wx-serviceterms.html
+    if (!isWeiXinBrowser) {
+      location.href = '/front/staticPage/wx-serviceterms.html'
+    } else {
+      location.href = '/jyapp/front/staticPage/dataExport_serviceterms.html'
+    }
   }
 }
 </script>

+ 1 - 1
jydocs-mobile/src/views/user/Library.vue

@@ -155,7 +155,7 @@ export default class UserLibrary extends Vue {
   }
 
   toDocDetail (item: any) {
-    const { docId: id } = item
+    const { DocId: id } = item
     this.saveState()
     this.$router.push({
       name: 'details',

+ 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"

+ 14 - 6
jydocs-pc/src/components/doc-item-card/Card.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="docs-card-container" @click="clickCard">
-    <div class="docs-card hover flex-r-c" v-if="cardType === 'oneline'" key="docs-card">
+    <div class="docs-card hover flex-r-c" :class="highlightKey.length === 0 ? '' : 'highlight'" v-if="cardType === 'oneline'" key="docs-card">
       <div class="docs-card-header flex-r-c flex">
         <span class="card-title-icon" :class="docTypeIcon"></span>
         <span class="card-title flex" v-html="hightLightTitle"></span>
@@ -17,7 +17,7 @@
         </slot>
       </div>
     </div>
-    <div class="docs-card hover flex-r-c" v-else-if="cardType === 'image'" key="docs-card">
+    <div class="docs-card hover flex-r-c" :class="highlightKey.length === 0 ? '' : 'highlight'" v-else-if="cardType === 'image'" key="docs-card">
       <div class="image-container">
         <el-image :src="imageSrc" lazy></el-image>
         <span class="doc-type-icon" :class="docTypeIcon"></span>
@@ -40,7 +40,7 @@
         </div>
       </div>
     </div>
-    <div class="docs-card hover" v-else key="docs-card">
+    <div class="docs-card hover" :class="highlightKey.length === 0 ? '' : 'highlight'" v-else key="docs-card">
       <div class="docs-card-header flex-r-c left">
         <span class="card-title-icon" :class="docTypeIcon"></span>
         <span class="card-title flex" v-html="hightLightTitle"></span>
@@ -155,6 +155,17 @@ export default {
   border-bottom: 1px solid rgba($color: #000, $alpha: 0.05);
   cursor: pointer;
 
+  &.highlight {
+    .card-desc,
+    .card-title {
+      ::v-deep {
+        em {
+          color: $color-text--highlight;
+        }
+      }
+    }
+  }
+
   @include diy-icon("word");
   @include diy-icon("excel");
   @include diy-icon("ppt");
@@ -168,9 +179,6 @@ export default {
     }
     .card-title {
       line-height: 24px;
-      em {
-        color: $color-text--highlight;
-      }
     }
   }
 

+ 2 - 1
jydocs-pc/src/views/Content.vue

@@ -39,7 +39,7 @@
           </div>
           <div class="middles">
               <h3>摘要</h3>
-              <p>{{datas.docSummary + datas.docSummary.length >= 500 ? '...' : ''}}</p>
+              <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>
           </div>
           <div class="head-tip" id="fixedTop" :class="{'is-fixed':fixed}" v-show="buyed == 1">
@@ -236,6 +236,7 @@ export default {
           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.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)

+ 5 - 4
jydocs-pc/src/views/Search.vue

@@ -170,10 +170,11 @@ export default {
     },
     toDocDetail (item) {
       const { docId: id } = item
-      this.$router.push({
-        name: 'content',
-        params: { id }
-      })
+      window.open(`./content/${id}`) // 打开新窗口
+      // this.$router.push({
+      //   name: 'content',
+      //   params: { id }
+      // })
     },
     onPageChange (p) {
       this.listState.pageNum = p

+ 29 - 17
jydocs-pc/src/views/purchase/purchase.vue

@@ -26,7 +26,7 @@
                 <div class="doc_in_actions">
                   <span class="doc_download">{{response.downTimes}}次下载</span>
                   <span class="doc_pages"> | 共{{response.docPageSize}}页 | </span>
-                  <span class="doc_readhot">{{response.docFileSize}}k</span>
+                  <span class="doc_readhot">{{response.docFileSize}}</span>
                 </div>
               </div>
               <div class="doc_abstract">
@@ -60,7 +60,7 @@
           </div>
         </div>
         <div class="doc_agreement">
-          <el-checkbox v-model="checked" >我已阅读并同意<a href="/front/staticPage/serviceterms.html" class="agree_link">《剑鱼标讯线上购买与服务条款》</a></el-checkbox>
+          <el-checkbox v-model="checked" @change="checkBtn()">我已阅读并同意<a href="/front/staticPage/serviceterms.html" class="agree_link">《剑鱼标讯线上购买与服务条款》</a></el-checkbox>
         </div>
         <div class="doc_surepur">
           <button class="btnsure" @click="setExhange()" :disabled="!this.btnChecked" id="btnsure">确定兑换</button>
@@ -73,6 +73,7 @@
 <script>
 import { checkbox, input } from 'element-ui'
 import { getDocPays, getJYchannel, getDetails, getBindPhone } from '../../api/modules/purchase'
+import { formatSize } from '../../utils/globalFunctions'
 
 export default {
   name: 'purchasePage',
@@ -115,7 +116,7 @@ export default {
           this.response.docName = item.docName
           this.response.price = item.price
           this.response.downTimes = item.downTimes
-          this.response.docFileSize = item.docFileSize
+          this.response.docFileSize = formatSize(item.docFileSize)
           this.response.docPageSize = item.docPageSize
           this.response.previewImgId = item.previewImgId
           this.response.docSummary = item.docSummary
@@ -143,26 +144,37 @@ export default {
         }
       })
     },
-    // 手机号输入事件
-    getValue () {
+    
+    getBool (bool) {
+      if (this.checked === true && bool === true) {
+        this.btnChecked = true
+      } else {
+        this.btnChecked = false
+      }
+    },
+    inputEvent () {
       var regex = /^(0|\+?86|17951)?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8}$/
       var bool = regex.test(this.tel)
-      if (bool || this.tel === '') {
+      console.log(bool)
+      if (this.tel === '') {
         this.setShow = false
-        this.phoneChecked = true
+        bool = true
       } else {
-        this.setShow = true
-        this.phoneChecked = false
+        if (bool) {
+          this.setShow = false
+        } else {
+          this.setShow = true
+        }
       }
-      this.btnSure()
+      this.getBool(bool)
     },
-    // 判断按钮是否可以点击
-    btnSure () {
-      if (this.checked === true && this.phoneChecked === true) {
-        this.btnChecked = true
-      } else {
-        this.btnChecked = false
-      }
+    // 手机号输入事件
+    getValue () {
+      this.inputEvent()
+    },
+    // 复选框点击事件
+    checkBtn () {
+      this.inputEvent()
     }
   }
 }