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