|
@@ -69,7 +69,6 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
<div class="foot-tip tops" id="footp">
|
|
|
<div class="load-doc">
|
|
@@ -161,7 +160,6 @@ import commonDialog from '@/components/dialog/Dialog'
|
|
|
import { getSearchTag } from '../api/modules/home'
|
|
|
import { getDocPays } from '../api/modules/purchase'
|
|
|
import { getJyAdListApi } from '../api/modules/publicapply'
|
|
|
-import { getUserInfo } from '../api/modules/user'
|
|
|
import { mapState } from 'vuex'
|
|
|
export default {
|
|
|
components: {
|
|
@@ -255,16 +253,16 @@ export default {
|
|
|
})
|
|
|
const nArr = arr.concat(oldArr)
|
|
|
return nArr.splice(0, 3)
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
userMemberInfo: {
|
|
|
handler (val) {
|
|
|
- if(val) {
|
|
|
+ if (val) {
|
|
|
this.getDocInfo()
|
|
|
const date = parseInt(new Date().getTime() / 1000)
|
|
|
const sevenDay = 60 * 60 * 24 * 7
|
|
|
- if(val.endTime-date <= sevenDay) {
|
|
|
+ if (val.endTime - date <= sevenDay) {
|
|
|
this.redShow = true
|
|
|
}
|
|
|
}
|
|
@@ -275,10 +273,14 @@ export default {
|
|
|
methods: {
|
|
|
// 使用免费下载特权
|
|
|
downLoadFreeEvent () {
|
|
|
- if(this.userMemberInfo.free_download === 0) {
|
|
|
+ if (this.userMemberInfo.free_download === 0) {
|
|
|
// 未留资,去留资
|
|
|
- vm.isNeedSubmit('pc_Library_details_free')
|
|
|
- } else if(this.userMemberInfo.free_download === 2) {
|
|
|
+ try {
|
|
|
+ vm.isNeedSubmit('pc_Library_details_free')
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
+ } else if (this.userMemberInfo.free_download === 2) {
|
|
|
// 已留资,未使用特权,可以下载
|
|
|
getDocPays({ docId: this.datas.docId, payType: 2 }).then((res) => {
|
|
|
console.log(res)
|
|
@@ -298,17 +300,17 @@ export default {
|
|
|
},
|
|
|
dialogConfirm () {
|
|
|
const text = this.dialogInfo.confirmText
|
|
|
- if(text === '立即充值') {
|
|
|
+ if (text === '立即充值') {
|
|
|
window.location.href = '/swordfish/integral/index/recharge?id=' + this.datas.docId
|
|
|
- } else if(text === '明日再来' || text === '我知道了') {
|
|
|
+ } else if (text === '明日再来' || text === '我知道了') {
|
|
|
this.dialogInfo.visible = false
|
|
|
}
|
|
|
},
|
|
|
async getDocInfo () {
|
|
|
- if(this.userMemberInfo.docMemberStatus) {
|
|
|
+ if (this.userMemberInfo.docMemberStatus) {
|
|
|
this.btnName = '下载文档'
|
|
|
} else {
|
|
|
- if(this.datas.productType === 2) {
|
|
|
+ if (this.datas.productType === 2) {
|
|
|
this.btnName = `开通文库会员${this.datas.docMemberDiscount}折下载`
|
|
|
} else {
|
|
|
this.btnName = '开通文库会员免费下载'
|
|
@@ -505,7 +507,7 @@ export default {
|
|
|
// 获取广告信息
|
|
|
getJyAdListApi({ codes: ['jydoc-content-right', 'jy-pc-docmember-detail'] }).then(res => {
|
|
|
const resData = res.data
|
|
|
- if(resData && resData.error_code === 0) {
|
|
|
+ if (resData && resData.error_code === 0) {
|
|
|
this.jyPcDocmemberDetail = resData.data['jy-pc-docmember-detail']
|
|
|
this.adsUrl = resData.data['jydoc-content-right']
|
|
|
}
|
|
@@ -561,7 +563,7 @@ export default {
|
|
|
window.location.href = '/swordfish/page_big_pc/order/doc-member'
|
|
|
} else {
|
|
|
// 点击“下载文档”,剑鱼币余额不足,弹窗提示:
|
|
|
- if(this.coinNum < this.datas.price) {
|
|
|
+ if (this.coinNum < this.datas.price) {
|
|
|
// 剑鱼币余额不足
|
|
|
const params = {
|
|
|
visible: true,
|
|
@@ -570,12 +572,12 @@ export default {
|
|
|
footText: '',
|
|
|
showCancel: true,
|
|
|
confirmText: '立即充值',
|
|
|
- cancelText: '我再想想',
|
|
|
+ cancelText: '我再想想'
|
|
|
}
|
|
|
this.dialogInfo = params
|
|
|
} else {
|
|
|
// 已下载,点击“下载文档”,调起浏览器进行文档下载。
|
|
|
- if(this.buyed === 1) {
|
|
|
+ if (this.buyed === 1) {
|
|
|
getDown({ docId: this.datas.docId }).then(res => {
|
|
|
if (res.data.error_code === 0) {
|
|
|
window.location.href = res.data.data
|
|
@@ -598,7 +600,7 @@ export default {
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
- if(this.coinNum < this.datas.price) {
|
|
|
+ if (this.coinNum < this.datas.price) {
|
|
|
// 剑鱼币余额不足
|
|
|
const params = {
|
|
|
visible: true,
|
|
@@ -607,7 +609,7 @@ export default {
|
|
|
footText: '',
|
|
|
showCancel: true,
|
|
|
confirmText: '立即充值',
|
|
|
- cancelText: '我再想想',
|
|
|
+ cancelText: '我再想想'
|
|
|
}
|
|
|
this.dialogInfo = params
|
|
|
} else {
|