|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<!-- 预览 -->
|
|
|
- <div class="tarcer-dev-Preview" v-loading="loading">
|
|
|
+ <div class="tarcer-dev-Preview" v-loading="loading" v-if="isData">
|
|
|
<Header />
|
|
|
|
|
|
<HeaderOne v-if="!Ispreview && data" :text="data.name" :allList="allList" />
|
|
@@ -18,20 +18,13 @@
|
|
|
<div class="pay_collect" v-if="!Ispreview">
|
|
|
<div class="price" v-if="!data.isPurchased">
|
|
|
¥
|
|
|
- <span
|
|
|
- class="price_1"
|
|
|
- v-html="changePrice(data.price * 1, 24, 16)"
|
|
|
- ></span>
|
|
|
+ <span class="price_1" v-html="changePrice(data.price * 1, 24, 16)"></span>
|
|
|
</div>
|
|
|
<div class="pay" @click="buy" v-if="!data.isPurchased">
|
|
|
<!-- 购买 -->{{ $t("Key72") }}
|
|
|
</div>
|
|
|
<div class="download" v-if="data.isPurchased && IsDownload">
|
|
|
- <img
|
|
|
- @click="download"
|
|
|
- src="../../assets/teacherdev/download.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
+ <img @click="download" src="../../assets/teacherdev/download.png" alt="" />
|
|
|
<!-- <span>DOWNLOAD</span> -->
|
|
|
</div>
|
|
|
<div class="collect">
|
|
@@ -53,9 +46,7 @@
|
|
|
<div :class="data.isPurchased || Ispreview ? 'buy' : 'NObuy'">
|
|
|
<!--fileUrl需要改成安全地址 file_url_https -->
|
|
|
<iframe
|
|
|
- v-if="
|
|
|
- attachment[0].fileType != 'pdf' && attachment[0].fileType != 'PDF'
|
|
|
- "
|
|
|
+ v-if="attachment[0].fileType != 'pdf' && attachment[0].fileType != 'PDF'"
|
|
|
:src="
|
|
|
'https://view.officeapps.live.com/op/view.aspx?src=' +
|
|
|
`${attachment[0].fileUrlHttps}`
|
|
@@ -81,14 +72,8 @@
|
|
|
<!-- 点击购买 -->{{ $t("Key574") }}
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-dialog
|
|
|
- :visible.sync="NopymentShow"
|
|
|
- width="720px"
|
|
|
- :before-close="closeNoPyment"
|
|
|
- >
|
|
|
- <div class="dialogTitle" slot="title">
|
|
|
- <!-- 商品详情 -->{{ $t("Key52") }}
|
|
|
- </div>
|
|
|
+ <el-dialog :visible.sync="NopymentShow" width="720px" :before-close="closeNoPyment">
|
|
|
+ <div class="dialogTitle" slot="title"><!-- 商品详情 -->{{ $t("Key52") }}</div>
|
|
|
<Confirmorder
|
|
|
ref="Confirmorder"
|
|
|
:data="data"
|
|
@@ -103,11 +88,7 @@
|
|
|
width="720px"
|
|
|
:before-close="closePyment"
|
|
|
>
|
|
|
- <Payment
|
|
|
- :data="data"
|
|
|
- :orderNumber="orderNumber"
|
|
|
- :closePyment="closePyment"
|
|
|
- />
|
|
|
+ <Payment :data="data" :orderNumber="orderNumber" :closePyment="closePyment" />
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -121,7 +102,12 @@ import Payment from "@/components/payment/Payment";
|
|
|
import { updateWordPack } from "@/utils/i18n";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
|
|
|
-import { materialdetail, materialvisit, LearnWebSI } from "@/api/api";
|
|
|
+import {
|
|
|
+ materialdetail,
|
|
|
+ materialvisit,
|
|
|
+ LearnWebSI,
|
|
|
+ Personamaterialdetail,
|
|
|
+} from "@/api/api";
|
|
|
export default {
|
|
|
name: "tarcer-dev-Preview",
|
|
|
components: {
|
|
@@ -145,6 +131,7 @@ export default {
|
|
|
orderNumber: null, //订单号
|
|
|
IsDownload: false, //是否可以下载
|
|
|
allList: null,
|
|
|
+ isData: false,
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -172,12 +159,7 @@ export default {
|
|
|
`/GCLSFileServer/WebFileDownload?UserCode=${data.UserCode}&UserType=${data.UserType}&SessionID=${data.SessionID}&FileID=${data.FileID}`;
|
|
|
},
|
|
|
// 生成订单 同时切换到支付弹窗
|
|
|
- changeOrderNumber(
|
|
|
- val,
|
|
|
- back_discount_code,
|
|
|
- discount_money,
|
|
|
- receivables_money
|
|
|
- ) {
|
|
|
+ changeOrderNumber(val, back_discount_code, discount_money, receivables_money) {
|
|
|
this.orderNumber = val;
|
|
|
this.NopymentShow = false;
|
|
|
this.data.back_discount_code = back_discount_code;
|
|
@@ -213,9 +195,7 @@ export default {
|
|
|
getNumPages() {
|
|
|
this.loading = true;
|
|
|
let _this = this;
|
|
|
- let loadingTask = pdf.createLoadingTask(
|
|
|
- _this.attachment[0].fileRelativePath
|
|
|
- );
|
|
|
+ let loadingTask = pdf.createLoadingTask(_this.attachment[0].fileRelativePath);
|
|
|
|
|
|
loadingTask.promise
|
|
|
.then((pdf) => {
|
|
@@ -314,8 +294,49 @@ export default {
|
|
|
// this.attachment[0].fileRelativePath =
|
|
|
// process.env.VUE_APP_BASE_API + this.attachment[0].fileRelativePath;
|
|
|
this.attachment[0].fileRelativePath =
|
|
|
- process.env.VUE_APP_PDF_API +
|
|
|
- this.attachment[0].fileRelativePath;
|
|
|
+ process.env.VUE_APP_PDF_API + this.attachment[0].fileRelativePath;
|
|
|
+ console.log(this.attachment[0].fileRelativePath);
|
|
|
+ this.getNumPages();
|
|
|
+ }
|
|
|
+ this.changePrice(this.data.price * 1, 24, 16);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ PersonalDetail() {
|
|
|
+ this.loading = true;
|
|
|
+ Personamaterialdetail({
|
|
|
+ materialId: this.materialId,
|
|
|
+ isSelectForUpdate: this.Ispreview ? true : false,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data.result) {
|
|
|
+ let index = res.data.result.tag.indexOf("downloadable");
|
|
|
+ if (index != -1) {
|
|
|
+ this.IsDownload = true;
|
|
|
+ }
|
|
|
+ this.data = res.data.result;
|
|
|
+ this.data.pymentTeacher = "";
|
|
|
+ res.data.result.teacher.forEach((item, i) => {
|
|
|
+ if (i != this.data.teacher.length - 1) {
|
|
|
+ this.data.pymentTeacher += item + ";";
|
|
|
+ } else {
|
|
|
+ this.data.pymentTeacher += item;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.data.fileType = this.data.tag[this.data.tag.length - 1];
|
|
|
+ this.attachment = JSON.parse(res.data.result.attachment);
|
|
|
+ this.loading = false;
|
|
|
+ if (
|
|
|
+ this.attachment[0].fileType == "pdf" ||
|
|
|
+ this.attachment[0].fileType == "PDF"
|
|
|
+ ) {
|
|
|
+ // this.attachment[0].fileRelativePath =
|
|
|
+ // process.env.VUE_APP_BASE_API + this.attachment[0].fileRelativePath;
|
|
|
+ this.attachment[0].fileRelativePath =
|
|
|
+ process.env.VUE_APP_PDF_API + this.attachment[0].fileRelativePath;
|
|
|
console.log(this.attachment[0].fileRelativePath);
|
|
|
this.getNumPages();
|
|
|
}
|
|
@@ -363,18 +384,23 @@ export default {
|
|
|
this.materialId = this.$route.query.id;
|
|
|
this.Ispreview = this.$route.query.type;
|
|
|
this.allList = this.$route.query.allList;
|
|
|
- if (this.materialId) {
|
|
|
- this.getdetail();
|
|
|
- if (!this.Ispreview) {
|
|
|
- materialvisit({
|
|
|
- id: this.materialId,
|
|
|
- })
|
|
|
- .then((res) => {})
|
|
|
- .catch((res) => {
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
+ if (this.$route.query.invok_module == "GCLS-Personal") {
|
|
|
+ this.PersonalDetail();
|
|
|
+ } else {
|
|
|
+ if (this.materialId) {
|
|
|
+ this.getdetail();
|
|
|
+ if (!this.Ispreview) {
|
|
|
+ materialvisit({
|
|
|
+ id: this.materialId,
|
|
|
+ })
|
|
|
+ .then((res) => {})
|
|
|
+ .catch((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
let node = document.getElementsByClassName("cui-ribbonTopBars")[0];
|
|
|
console.log(node);
|
|
|
},
|