|
@@ -32,7 +32,7 @@
|
|
|
</van-popup>
|
|
|
<span class="head-text">学习资料提取</span>
|
|
|
<div class="head-button">
|
|
|
- <div class="head-button-download">
|
|
|
+ <div class="head-button-download">
|
|
|
<img
|
|
|
class=""
|
|
|
style="width: 12px; height: 13px; margin-right: 5px"
|
|
@@ -67,7 +67,7 @@ import { PDFDocumentProxy } from 'pdfjs-dist/types/web/pdf_find_controller';
|
|
|
PDFJS.GlobalWorkerOptions.workerSrc = pdfjsWorker; //设置PDFJS.GlobalWorkerOptions.workerSrc的地址
|
|
|
document.title = '预览pdf';
|
|
|
import { Toast } from 'vant';
|
|
|
-import api from '@/api/api'
|
|
|
+import api from '@/api/api';
|
|
|
export default defineComponent({
|
|
|
setup() {},
|
|
|
data() {
|
|
@@ -80,19 +80,27 @@ export default defineComponent({
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ download() {
|
|
|
+ const name: string = this.$route.query.name as string;
|
|
|
+ let src = window.location.origin + `/pdf/${name}.pdf`;
|
|
|
+ tt.miniProgram.navigateTo({
|
|
|
+ url:'/otherPages/download/index?src='+src
|
|
|
+ })
|
|
|
+ },
|
|
|
send() {
|
|
|
let reg = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
|
|
|
if (reg.test(this.emailAddress)) {
|
|
|
- api.studentEmailInfo({
|
|
|
- address:this.emailAddress,
|
|
|
- dictCode:Number(this.$route.query.code)
|
|
|
- }).then(res=>{
|
|
|
- Toast.success('成功发送')
|
|
|
- })
|
|
|
+ api
|
|
|
+ .studentEmailInfo({
|
|
|
+ address: this.emailAddress,
|
|
|
+ dictCode: Number(this.$route.query.code),
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ Toast.success('成功发送');
|
|
|
+ });
|
|
|
} else {
|
|
|
- Toast.fail('邮箱格式错误')
|
|
|
+ Toast.fail('邮箱格式错误');
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
getPdf(url: string) {
|
|
|
let that = this;
|
|
@@ -139,9 +147,9 @@ export default defineComponent({
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
- const token:string = this.$route.query.token as string
|
|
|
- window.localStorage.setItem('token',token)
|
|
|
- const name:string = this.$route.query.name as string
|
|
|
+ const token: string = this.$route.query.token as string;
|
|
|
+ window.localStorage.setItem('token', token);
|
|
|
+ const name: string = this.$route.query.name as string;
|
|
|
this.getPdf(`./pdf/${name}.pdf`);
|
|
|
},
|
|
|
});
|