|
@@ -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)
|
|
|
}
|
|
|
}
|
|
|
}
|