Commit b0612d0a authored by Mac's avatar Mac

1

parent dfac6db7
......@@ -87,7 +87,7 @@ export function UploadViittoFile(path, file, callback) {
vtUploadUrl = "http://upload.oytour.com";
viewFileUrl = "https://imgfile.oytour.com";
} else if (locationName.indexOf('oytour') !== -1) {
vtUploadUrl = "http://upload.oytour.com";
vtUploadUrl = "https://upload.oytour.com";
viewFileUrl = "https://imgfile.oytour.com";
}
var UploadConfig = {
......
......@@ -8,7 +8,7 @@ LoadingBar.setDefaults({
position: "bottom"
});
let loadAsyncRouter = false;
const whiteList = ["/login", "/", "/contractConfirm","/contractPay","/contractView","/contractSign","/noticeView","/autologin","/courseRefundH5"]; // 不重定向白名单
const whiteList = ["/login", "/", "/contractConfirm","/contractPay","/contractView","/contractSign","/noticeView","/autologin","/courseRefundH5","/koreaUpload"]; // 不重定向白名单
router.beforeEach((to, from, next) => {
localStorage.setItem("routerBefore", from.path);
LoadingBar.start();
......
<style>
.koreaUpload {
width: 100%;
background-color: #fff;
height: 100%;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
text-size-adjust: 100%;
color: #000;
}
.koreaUpload .box {
width: 90%;
height: 200px;
margin-top: 40px;
border-radius: 8px;
margin-left: 5%;
border: 1px dashed #e2e2e2;
display: flex;
align-items: center;
justify-content: center;
}
.koreaUpload .avatar-uploader{
}
</style>
<template>
<div class="koreaUpload">
<div class="box">
<el-upload class="avatar-uploader " action="" :before-upload="uploadFile" :show-file-list="false">
<i class="el-icon-upload" style="font-size: 40px;color: #e2e2e2;"></i>
<div class="el-upload__text" style="font-size: 18px;">上传文件</em></div>
</el-upload>
</div>
<div>{{fliename}}</div>
</div>
</template>
<script>
import wx from 'weixin-js-sdk'
import {
UploadViittoFile
} from "../api/common/common";
export default {
meta: {
title: "文件上传"
},
data() {
return {
data: '',
fliename:'',
};
},
created() {
if (this.$route.query) {
this.data = JSON.parse(this.$route.query.data)
}
},
methods: {
uploadFile(files) {
console.log(files)
let ft = files.name.substring(files.name.lastIndexOf('.') + 1, files.name.length)
let stringArr = this.data.FileType
if (stringArr.indexOf(ft) == '-1') {//判断文件格式
this.$q.notify({
type: 'negative',
message: `请上传正确的文件格式!`,
position: 'top'
})
return false;
}
if (this.data.FileSizeLimit > 0) {//判断文件大小
const size = files.size / 1024 / 1024
this.FileName = size
if (size > this.data.FileSizeLimit) {
this.$q.notify({
type: 'negative',
message: "文件大小不能超过" + this.data.FileSizeLimit + "MB哦!",
position: 'top'
})
return false;
}
}
UploadViittoFile('korea', files, res => {
console.log(res)
if (res.Code == 1) {
res.data = this.data;
wx.miniProgram.navigateBack({ delta: 1 })
wx.miniProgram.postMessage({ data: res })
} else {
this.$q.notify({
type: 'negative',
message: "上传失败!",
position: 'top'
})
return false;
}
}).catch(() => {
this.$q.notify({
type: 'negative',
message: "上传失败!",
position: 'top'
})
return false;
})
},
},
mounted() { }
};
</script>
\ No newline at end of file
......@@ -1294,6 +1294,12 @@ const routes = [{
component: () =>
import("pages/courseRefundH5.vue")
},
{
path: "/koreaUpload",//韩国管 上传
component: () =>
import("pages/koreaUpload.vue")
},
{
path: "/financial/financalDocument/PrintPage", //财务单据打印
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment