|
|
@@ -1,91 +1,40 @@
|
|
|
<template>
|
|
|
<!-- 预览 -->
|
|
|
- <div
|
|
|
- class="tarcer-dev-Preview"
|
|
|
- v-loading="loading"
|
|
|
- v-if="isData"
|
|
|
- >
|
|
|
+ <div class="tarcer-dev-Preview" v-loading="loading" v-if="isData">
|
|
|
<Header />
|
|
|
|
|
|
- <HeaderOne
|
|
|
- v-if="!Ispreview && data"
|
|
|
- :text="data.name"
|
|
|
- :allList="allList"
|
|
|
- />
|
|
|
- <div
|
|
|
- class="main"
|
|
|
- v-if="data"
|
|
|
- >
|
|
|
+ <HeaderOne v-if="!Ispreview && data" :text="data.name" :allList="allList" />
|
|
|
+ <div class="main" v-if="data">
|
|
|
<div class="flassify">
|
|
|
<div class="text">
|
|
|
<p class="p1">{{ data.name }}</p>
|
|
|
<p class="p2">
|
|
|
- {{$t('Key227')}}:
|
|
|
- <span
|
|
|
- v-for="(item, i) in data.teacher"
|
|
|
- :key="i + item"
|
|
|
- >
|
|
|
- {{ item }}{{ i == data.teacher.length - 1 ? "" : "," }}
|
|
|
+ {{ $t('Key227') }}:
|
|
|
+ <span v-for="(item, i) in data.teacher" :key="i + item">
|
|
|
+ {{ item }}{{ i == data.teacher.length - 1 ? '' : ',' }}
|
|
|
</span>
|
|
|
</p>
|
|
|
<!-- <p>{{ data.updateTime }}</p> -->
|
|
|
</div>
|
|
|
- <div
|
|
|
- class="pay_collect"
|
|
|
- v-if="!Ispreview"
|
|
|
- >
|
|
|
- <div
|
|
|
- class="price"
|
|
|
- v-if="!data.isPurchased"
|
|
|
- >
|
|
|
+ <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>
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class="pay"
|
|
|
- @click="buy"
|
|
|
- v-if="!data.isPurchased"
|
|
|
- >
|
|
|
- <!-- 购买 -->{{ $t("Key72") }}
|
|
|
+ <span class="price_1" v-html="changePrice(data.price * 1, 24, 16)"></span>
|
|
|
</div>
|
|
|
- <div
|
|
|
- class="download"
|
|
|
- v-if="data.isPurchased && IsDownload"
|
|
|
- >
|
|
|
- <img
|
|
|
- @click="download"
|
|
|
- src="../../assets/teacherdev/download.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
+ <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="" />
|
|
|
<!-- <span>DOWNLOAD</span> -->
|
|
|
</div>
|
|
|
<div class="collect">
|
|
|
- <img
|
|
|
- @click="changeCollect"
|
|
|
- v-show="!data.isFavorite"
|
|
|
- src="../../assets/teacherdev/collect4.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- <img
|
|
|
- @click="changeCollect"
|
|
|
- v-show="data.isFavorite"
|
|
|
- src="../../assets/teacherdev/collect3.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
+ <img @click="changeCollect" v-show="!data.isFavorite" src="../../assets/teacherdev/collect4.png" alt="" />
|
|
|
+ <img @click="changeCollect" v-show="data.isFavorite" src="../../assets/teacherdev/collect3.png" alt="" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div :class="data.isPurchased || Ispreview ? 'buy' : 'NObuy'">
|
|
|
<!--fileUrl需要改成安全地址 file_url_https -->
|
|
|
- <iframe
|
|
|
- :src="attachment[0].newpath"
|
|
|
- width="100%"
|
|
|
- height="1000px"
|
|
|
- id="ifm"
|
|
|
- ></iframe>
|
|
|
+ <iframe :src="attachment[0].newpath" width="100%" height="1000px" id="ifm"></iframe>
|
|
|
<!-- <object
|
|
|
type="text/html"
|
|
|
height="1000px"
|
|
|
@@ -122,25 +71,10 @@
|
|
|
{{ i / numPages }}
|
|
|
</pdf> -->
|
|
|
</div>
|
|
|
- <div
|
|
|
- v-if="!data.isPurchased && !Ispreview"
|
|
|
- @click="buy"
|
|
|
- class="buyBtn"
|
|
|
- >
|
|
|
- <!-- 点击购买 -->{{ $t("Key574") }}
|
|
|
- </div>
|
|
|
+ <div v-if="!data.isPurchased && !Ispreview" @click="buy" class="buyBtn"><!-- 点击购买 -->{{ $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"
|
|
|
@@ -156,41 +90,31 @@
|
|
|
width="720px"
|
|
|
:before-close="closePyment"
|
|
|
>
|
|
|
- <Payment
|
|
|
- :data="data"
|
|
|
- :orderNumber="orderNumber"
|
|
|
- :closePyment="closePyment"
|
|
|
- />
|
|
|
+ <Payment :data="data" :orderNumber="orderNumber" :closePyment="closePyment" />
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Header from "@/components/Header";
|
|
|
-import HeaderOne from "@/components/teacher-dev/HeaderOne";
|
|
|
-import pdf from "vue-pdf";
|
|
|
-import Confirmorder from "@/components/payment/Confirmorder";
|
|
|
-import Payment from "@/components/payment/Payment";
|
|
|
-import { updateWordPack } from "@/utils/i18n";
|
|
|
-import { getToken, getConfig } from "@/utils/auth";
|
|
|
+import Header from '@/components/Header';
|
|
|
+import HeaderOne from '@/components/teacher-dev/HeaderOne';
|
|
|
+import pdf from 'vue-pdf';
|
|
|
+import Confirmorder from '@/components/payment/Confirmorder';
|
|
|
+import Payment from '@/components/payment/Payment';
|
|
|
+import { updateWordPack } from '@/utils/i18n';
|
|
|
+import { getToken, getConfig } from '@/utils/auth';
|
|
|
|
|
|
-const Base64 = require("js-base64").Base64;
|
|
|
+const Base64 = require('js-base64').Base64;
|
|
|
|
|
|
-import {
|
|
|
- materialdetail,
|
|
|
- materialvisit,
|
|
|
- LearnWebSI,
|
|
|
- Personamaterialdetail,
|
|
|
- getContentFile,
|
|
|
-} from "@/api/api";
|
|
|
+import { materialdetail, materialvisit, LearnWebSI, Personamaterialdetail, getContentFile } from '@/api/api';
|
|
|
export default {
|
|
|
- name: "tarcer-dev-Preview",
|
|
|
+ name: 'tarcer-dev-Preview',
|
|
|
components: {
|
|
|
Header,
|
|
|
HeaderOne,
|
|
|
pdf,
|
|
|
Confirmorder,
|
|
|
- Payment,
|
|
|
+ Payment
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -200,7 +124,7 @@ export default {
|
|
|
data: null,
|
|
|
attachment: null,
|
|
|
loading: false,
|
|
|
- Ispreview: "", // 是不是预览
|
|
|
+ Ispreview: '', // 是不是预览
|
|
|
NopymentShow: false, //添加订单弹窗
|
|
|
PymentShow: false, //支付订单弹窗
|
|
|
orderNumber: null, //订单号
|
|
|
@@ -208,7 +132,7 @@ export default {
|
|
|
allList: null,
|
|
|
isData: false,
|
|
|
goods_detail_type: null,
|
|
|
- file_preview_url: "",
|
|
|
+ file_preview_url: ''
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
|
@@ -216,9 +140,9 @@ export default {
|
|
|
// 下载
|
|
|
download() {
|
|
|
let userInfor = JSON.parse(getToken());
|
|
|
- let UserCode = "",
|
|
|
- UserType = "",
|
|
|
- SessionID = "";
|
|
|
+ let UserCode = '',
|
|
|
+ UserType = '',
|
|
|
+ SessionID = '';
|
|
|
if (userInfor) {
|
|
|
UserCode = userInfor.user_code;
|
|
|
UserType = userInfor.user_type;
|
|
|
@@ -229,19 +153,14 @@ export default {
|
|
|
SessionID,
|
|
|
UserCode,
|
|
|
UserType,
|
|
|
- FileID,
|
|
|
+ FileID
|
|
|
};
|
|
|
location.href =
|
|
|
process.env.VUE_APP_BASE_API +
|
|
|
`/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;
|
|
|
@@ -256,7 +175,7 @@ export default {
|
|
|
},
|
|
|
closePyment(str) {
|
|
|
this.PymentShow = false;
|
|
|
- if (str == "支付成功") {
|
|
|
+ if (str == '支付成功') {
|
|
|
this.getdetail();
|
|
|
}
|
|
|
},
|
|
|
@@ -265,22 +184,20 @@ export default {
|
|
|
price = price ? price : 0;
|
|
|
price = price.toFixed(2);
|
|
|
price = price.toString();
|
|
|
- let arr = price.split(".");
|
|
|
- let str = `<span style="font-size: ${fontSize1 ? fontSize1 : 16}px;">${arr[0]
|
|
|
- }</span>.<span style="font-size: ${fontSize2 ? fontSize2 : 16}px;">${arr[1]
|
|
|
- }</span>`;
|
|
|
+ let arr = price.split('.');
|
|
|
+ let str = `<span style="font-size: ${fontSize1 ? fontSize1 : 16}px;">${arr[0]}</span>.<span style="font-size: ${
|
|
|
+ fontSize2 ? fontSize2 : 16
|
|
|
+ }px;">${arr[1]}</span>`;
|
|
|
return str;
|
|
|
},
|
|
|
// 获取pdf的页数
|
|
|
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) => {
|
|
|
+ .then(pdf => {
|
|
|
if (_this.data.isPurchased) {
|
|
|
_this.numPages = pdf.numPages;
|
|
|
} else {
|
|
|
@@ -288,34 +205,34 @@ export default {
|
|
|
}
|
|
|
_this.loading = false;
|
|
|
})
|
|
|
- .catch((err) => {
|
|
|
- console.error("Pdf Loading failed", err);
|
|
|
+ .catch(err => {
|
|
|
+ console.error('Pdf Loading failed', err);
|
|
|
});
|
|
|
},
|
|
|
// 修改收藏状态
|
|
|
changeCollect() {
|
|
|
this.loading = true;
|
|
|
if (this.data.isFavorite) {
|
|
|
- let Mname = "order-collection_manager-CancelMyGoodsCollection";
|
|
|
+ let Mname = 'order-collection_manager-CancelMyGoodsCollection';
|
|
|
LearnWebSI(Mname, {
|
|
|
goods_id_list: [this.materialId],
|
|
|
- goods_type: 401,
|
|
|
+ goods_type: 401
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
this.$message({
|
|
|
- type: "success",
|
|
|
- message: this.$t("Key396"), //"取消收藏成功",
|
|
|
+ type: 'success',
|
|
|
+ message: this.$t('Key396') //"取消收藏成功",
|
|
|
});
|
|
|
this.data.isFavorite = false;
|
|
|
|
|
|
this.loading = false;
|
|
|
// this.getdetail();
|
|
|
})
|
|
|
- .catch((res) => {
|
|
|
+ .catch(res => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
} else {
|
|
|
- let Mname = "order-collection_manager-AddMyCollection";
|
|
|
+ let Mname = 'order-collection_manager-AddMyCollection';
|
|
|
LearnWebSI(Mname, {
|
|
|
goods_id: this.materialId,
|
|
|
goods_type: 401,
|
|
|
@@ -323,19 +240,19 @@ export default {
|
|
|
goods_person_name_desc: this.data.teacher,
|
|
|
goods_picture_id: this.data.coverFileId,
|
|
|
goods_price: this.data.price,
|
|
|
- goods_detail_type: this.goods_detail_type,
|
|
|
+ goods_detail_type: this.goods_detail_type
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
this.$message({
|
|
|
- type: "success",
|
|
|
- message: this.$t("Key575"), //"收藏成功",
|
|
|
+ type: 'success',
|
|
|
+ message: this.$t('Key575') //"收藏成功",
|
|
|
});
|
|
|
this.data.isFavorite = true;
|
|
|
|
|
|
this.loading = false;
|
|
|
// this.getdetail();
|
|
|
})
|
|
|
- .catch((res) => {
|
|
|
+ .catch(res => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
}
|
|
|
@@ -344,7 +261,7 @@ export default {
|
|
|
buy() {
|
|
|
if (!this.data.isAudited) {
|
|
|
// "您还未通过审核不能购买"
|
|
|
- this.$message.warning(this.$t("Key576"));
|
|
|
+ this.$message.warning(this.$t('Key576'));
|
|
|
return;
|
|
|
}
|
|
|
this.NopymentShow = true;
|
|
|
@@ -354,19 +271,19 @@ export default {
|
|
|
this.loading = true;
|
|
|
materialdetail({
|
|
|
materialId: this.materialId,
|
|
|
- isSelectForUpdate: this.Ispreview ? true : false,
|
|
|
+ isSelectForUpdate: this.Ispreview ? true : false
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
if (res.data.result) {
|
|
|
- let index = res.data.result.tag.indexOf("downloadable");
|
|
|
+ let index = res.data.result.tag.indexOf('downloadable');
|
|
|
if (index != -1) {
|
|
|
this.IsDownload = true;
|
|
|
}
|
|
|
this.data = res.data.result;
|
|
|
- this.data.pymentTeacher = "";
|
|
|
+ this.data.pymentTeacher = '';
|
|
|
res.data.result.teacher.forEach((item, i) => {
|
|
|
if (i != this.data.teacher.length - 1) {
|
|
|
- this.data.pymentTeacher += item + ";";
|
|
|
+ this.data.pymentTeacher += item + ';';
|
|
|
} else {
|
|
|
this.data.pymentTeacher += item;
|
|
|
}
|
|
|
@@ -400,13 +317,11 @@ export default {
|
|
|
// var previewUrl =
|
|
|
// originUrl + `&fullfilename=${this.attachment[0].name}`;
|
|
|
// GC 找的免费的 需要后台部署 谷歌可以 火狐和edge不行
|
|
|
- let path =
|
|
|
- `${this.file_preview_url}/onlinePreview?url=` +
|
|
|
- Base64.encode(this.attachment[0].fileUrlHttps);
|
|
|
+ let path = `${this.file_preview_url}/onlinePreview?url=` + Base64.encode(this.attachment[0].fileUrlHttps);
|
|
|
this.attachment[0].newpath = path;
|
|
|
}
|
|
|
})
|
|
|
- .catch((res) => {
|
|
|
+ .catch(res => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
@@ -414,28 +329,26 @@ export default {
|
|
|
this.loading = true;
|
|
|
Personamaterialdetail({
|
|
|
materialId: this.materialId,
|
|
|
- isSelectForUpdate: this.Ispreview ? true : false,
|
|
|
+ isSelectForUpdate: this.Ispreview ? true : false
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
if (res.data.result) {
|
|
|
- let index = res.data.result.tag.indexOf("downloadable");
|
|
|
+ let index = res.data.result.tag.indexOf('downloadable');
|
|
|
if (index != -1) {
|
|
|
this.IsDownload = true;
|
|
|
}
|
|
|
this.data = res.data.result;
|
|
|
- this.data.pymentTeacher = "";
|
|
|
+ this.data.pymentTeacher = '';
|
|
|
res.data.result.teacher.forEach((item, i) => {
|
|
|
if (i != this.data.teacher.length - 1) {
|
|
|
- this.data.pymentTeacher += item + ";";
|
|
|
+ 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);
|
|
|
- let path =
|
|
|
- `${this.file_preview_url}/onlinePreview?url=` +
|
|
|
- Base64.encode(this.attachment[0].fileUrlHttps);
|
|
|
+ let path = `${this.file_preview_url}/onlinePreview?url=` + Base64.encode(this.attachment[0].fileUrlHttps);
|
|
|
this.attachment[0].newpath = path;
|
|
|
this.loading = false;
|
|
|
// if (
|
|
|
@@ -453,60 +366,60 @@ export default {
|
|
|
this.changePrice(this.data.price * 1, 24, 16);
|
|
|
}
|
|
|
})
|
|
|
- .catch((res) => {
|
|
|
+ .catch(res => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
getimgurl(item) {
|
|
|
- let index = item.tag.indexOf("downloadable");
|
|
|
- let type = "";
|
|
|
+ let index = item.tag.indexOf('downloadable');
|
|
|
+ let type = '';
|
|
|
if (index != -1) {
|
|
|
type = item.tag[2];
|
|
|
} else {
|
|
|
type = item.tag[1];
|
|
|
}
|
|
|
return type;
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
async created() {
|
|
|
let data = JSON.parse(getConfig());
|
|
|
this.file_preview_url = data.doc_preview_service_address;
|
|
|
await updateWordPack({
|
|
|
word_key_list: [
|
|
|
- "Key5",
|
|
|
- "Key8",
|
|
|
- "Key9",
|
|
|
- "Key39",
|
|
|
- "Key43",
|
|
|
- "Key52",
|
|
|
- "Key53",
|
|
|
- "Key54",
|
|
|
- "Key55",
|
|
|
- "Key58",
|
|
|
- "Key72",
|
|
|
- "Key94",
|
|
|
- "Key475",
|
|
|
- "Key109",
|
|
|
- "Key131",
|
|
|
- "Key214",
|
|
|
- "Key232",
|
|
|
- "Key108",
|
|
|
- "Key396",
|
|
|
- "Key472",
|
|
|
- "Key473",
|
|
|
- "Key474",
|
|
|
- "Key572",
|
|
|
- "Key574",
|
|
|
- "Key575",
|
|
|
- "Key576",
|
|
|
- "Key696",
|
|
|
- "Key697",
|
|
|
- "Key227",
|
|
|
- "Key803",
|
|
|
- "Key790",
|
|
|
- "Key791",
|
|
|
- "Key792"
|
|
|
- ],
|
|
|
+ 'Key5',
|
|
|
+ 'Key8',
|
|
|
+ 'Key9',
|
|
|
+ 'Key39',
|
|
|
+ 'Key43',
|
|
|
+ 'Key52',
|
|
|
+ 'Key53',
|
|
|
+ 'Key54',
|
|
|
+ 'Key55',
|
|
|
+ 'Key58',
|
|
|
+ 'Key72',
|
|
|
+ 'Key94',
|
|
|
+ 'Key475',
|
|
|
+ 'Key109',
|
|
|
+ 'Key131',
|
|
|
+ 'Key214',
|
|
|
+ 'Key232',
|
|
|
+ 'Key108',
|
|
|
+ 'Key396',
|
|
|
+ 'Key472',
|
|
|
+ 'Key473',
|
|
|
+ 'Key474',
|
|
|
+ 'Key572',
|
|
|
+ 'Key574',
|
|
|
+ 'Key575',
|
|
|
+ 'Key576',
|
|
|
+ 'Key696',
|
|
|
+ 'Key697',
|
|
|
+ 'Key227',
|
|
|
+ 'Key803',
|
|
|
+ 'Key790',
|
|
|
+ 'Key791',
|
|
|
+ 'Key792'
|
|
|
+ ]
|
|
|
});
|
|
|
this.isData = true;
|
|
|
},
|
|
|
@@ -514,23 +427,23 @@ export default {
|
|
|
this.materialId = this.$route.query.id;
|
|
|
this.Ispreview = this.$route.query.type;
|
|
|
this.allList = this.$route.query.allList;
|
|
|
- if (this.$route.query.invok_module == "GCLS-Personal") {
|
|
|
+ if (this.$route.query.invok_module == 'GCLS-Personal') {
|
|
|
this.PersonalDetail();
|
|
|
} else {
|
|
|
if (this.materialId) {
|
|
|
this.getdetail();
|
|
|
if (!this.Ispreview) {
|
|
|
materialvisit({
|
|
|
- id: this.materialId,
|
|
|
+ id: this.materialId
|
|
|
})
|
|
|
- .then((res) => { })
|
|
|
- .catch((res) => {
|
|
|
+ .then(res => {})
|
|
|
+ .catch(res => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|