|
@@ -2,16 +2,16 @@
|
|
|
<div class="details-p">
|
|
|
<div class="tops">
|
|
|
<h3>
|
|
|
- <van-icon class="word01" name="diy-word" />
|
|
|
+ <van-icon class="word01" :name="'diy-' + fileType(detailData.docFileType)" />
|
|
|
{{detailData.docName}}
|
|
|
</h3>
|
|
|
</div>
|
|
|
<div class="middles">
|
|
|
<h3>摘要</h3>
|
|
|
<p>{{detailData.docSummary}}</p>
|
|
|
- <div class="continue">全文共18页,<span>继续阅读<van-icon name="arrow-down" size="18" /></span></div>
|
|
|
+ <div class="continue" v-show="!buyed">全文共{{detailData.docPageSize}}页,<span @click="continued">继续阅读<van-icon name="arrow-down" size="18" /></span></div>
|
|
|
</div>
|
|
|
- <div class="botts">
|
|
|
+ <div class="botts" v-show="buyed">
|
|
|
<div class="cont-page">
|
|
|
优化招投标市场营商环境与国企采购人主体责任、采购与招标培训资料摘要摘要。优化招投标市场营商环境与国企采购人主体责任、采购与招标培训资料摘要摘要。优化招投标市场营商环境与国企采购人主体责任、采购与招标培训资料摘要摘要。优化招投标市场营商环境与国企采购人主体责任、采购与招标培训资料摘要摘要。优化招投标市场营商环境与国企采购人主体责任、采购与招标培训资料摘要摘要。优化招投标市场营商环境与国企采购人主体责任、采购与招标培训资料摘要摘要。
|
|
|
</div>
|
|
@@ -20,17 +20,17 @@
|
|
|
<van-goods-action-icon class="no-icon">
|
|
|
<template #default>
|
|
|
<p class="p1">剑鱼币</p>
|
|
|
- <p class="p2">500</p>
|
|
|
+ <p class="p2">{{detailData.price}}</p>
|
|
|
</template>
|
|
|
</van-goods-action-icon>
|
|
|
<van-goods-action-icon icon="diy-jubao" text="投诉举报" @click="jubaod" />
|
|
|
- <van-goods-action-icon :icon="collectd?'diy-weiguanzhu':'diy-guanzhu'" text="收藏" @click="canged" />
|
|
|
+ <van-goods-action-icon :icon="collectd==1?'diy-guanzhu':'diy-weiguanzhu'" text="收藏" @click="canged" />
|
|
|
<van-goods-action-button text="下载文档" @click="uploaded" />
|
|
|
</van-goods-action>
|
|
|
<!-- 充值 -->
|
|
|
- <recharge ref="charge"></recharge>
|
|
|
+ <recharge ref="charge" :detailData="detailData" :coins="coins"></recharge>
|
|
|
<!-- 购买 -->
|
|
|
- <purchase ref="buys"></purchase>
|
|
|
+ <purchase ref="buys" :detailData="detailData" :coins="coins"></purchase>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -52,15 +52,22 @@ import Purchase from '@/components/RechargeHave.vue'
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions({
|
|
|
- getDetails: 'main/getDetails'
|
|
|
+ getDetails: 'main/getDetails',
|
|
|
+ getCoin: 'main/getCoin',
|
|
|
+ getAdd: 'main/getAdd',
|
|
|
+ getRemove: 'main/getRemove'
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
export default class extends Vue {
|
|
|
getDetails: any
|
|
|
+ getCoin: any
|
|
|
+ coins: any = []
|
|
|
+ getAdd: any
|
|
|
+ getRemove: any
|
|
|
detailData: any = []
|
|
|
- collectd = true
|
|
|
- nums = 1
|
|
|
+ collectd = 0
|
|
|
+ buyed = 0
|
|
|
created () {
|
|
|
this.onList()
|
|
|
}
|
|
@@ -69,6 +76,12 @@ export default class extends Vue {
|
|
|
this.getDetails({ docId: '111' }).then((res: any) => {
|
|
|
console.log(res.data)
|
|
|
this.detailData = res.data.detail
|
|
|
+ this.buyed = res.data.status
|
|
|
+ this.collectd = res.data.docCang
|
|
|
+ })
|
|
|
+ this.getCoin({ L: true }).then((res: any) => {
|
|
|
+ console.log(res.data.data)
|
|
|
+ this.coins = res.data.data.points
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -80,21 +93,64 @@ export default class extends Vue {
|
|
|
}
|
|
|
|
|
|
canged () {
|
|
|
- this.collectd = !this.collectd
|
|
|
+ if (this.collectd === 0) {
|
|
|
+ this.getAdd({ docId: '111' }).then((res: any) => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.error_code === 0) {
|
|
|
+ this.collectd = 1
|
|
|
+ Toast('收藏成功')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.getRemove({ docId: '111' }).then((res: any) => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.error_code === 0) {
|
|
|
+ this.collectd = 0
|
|
|
+ Toast('取消收藏')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ continued () {
|
|
|
+ this.uploaded()
|
|
|
}
|
|
|
|
|
|
uploaded () {
|
|
|
- if (this.nums === 0) {
|
|
|
- ;(this.$refs.charge as any).show = true
|
|
|
+ if (this.buyed === 1) {
|
|
|
+ this.$router.push('/')
|
|
|
+ } else {
|
|
|
+ if (this.coins.balance < this.detailData.price) {
|
|
|
+ ;(this.$refs.charge as any).show = true
|
|
|
+ } else {
|
|
|
+ ;(this.$refs.buys as any).show = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ fileType (val: any) {
|
|
|
+ if (val === 1) {
|
|
|
+ return 'word'
|
|
|
+ } else if (val === 2) {
|
|
|
+ return 'pdf'
|
|
|
+ } else if (val === 3) {
|
|
|
+ return 'excel'
|
|
|
+ } else if (val === 4) {
|
|
|
+ return 'ppt'
|
|
|
+ } else if (val === 5) {
|
|
|
+ return 'txt'
|
|
|
} else {
|
|
|
- ;(this.$refs.buys as any).show = true
|
|
|
+ return ''
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+@include diy-icon('pdf', 24, 24);
|
|
|
@include diy-icon('word', 24, 24);
|
|
|
+@include diy-icon('excel', 24, 24);
|
|
|
+@include diy-icon('ppt', 24, 24);
|
|
|
@include diy-icon('jubao', 20, 20);
|
|
|
@include diy-icon('weiguanzhu', 20, 20);
|
|
|
@include diy-icon('guanzhu', 20, 20);
|
|
@@ -167,16 +223,15 @@ export default class extends Vue {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
.no-icon {
|
|
|
- p {
|
|
|
- color:#2ABED1;
|
|
|
- }
|
|
|
.p1 {
|
|
|
font-size: 12px;
|
|
|
line-height: 18px;
|
|
|
+ color: #5F5E64;
|
|
|
}
|
|
|
.p2 {
|
|
|
font-size: 18px;
|
|
|
line-height: 26px;
|
|
|
+ color: #FB483D;
|
|
|
}
|
|
|
.van-icon {
|
|
|
display: none!important;
|