Commit 554c945a authored by 杨梦雪's avatar 杨梦雪

upload

parent fcdc2e72
...@@ -157,38 +157,38 @@ ...@@ -157,38 +157,38 @@
:before-close="handleClose" :before-close="handleClose"
:visible.sync="bankDialogVisible" :visible.sync="bankDialogVisible"
title="银行卡支付" title="银行卡支付"
width="30%" width="200"
> >
<div>收款单位:{{ payee }}</div> <div class="bank_pay">
<div>账号:{{ bank_idcard }}</div> <div><span>收款单位:</span>{{ payee }}</div>
<div>开户行:{{ bank_first }}</div> <div><span>账号:</span>{{ bank_idcard }}</div>
<div>上传转账截图</div> <div><span>开户行:</span>{{ bank_first }}</div>
<span>上传转账截图</span>
<div class="image_add"> <div class="image_add">
<div class="image_in"> <div class="image_in">
<el-upload <el-upload
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
:class="{ hide: hideUpload }" :class="{ hide: hideUpload }"
:disabled="isUploading || fileList.length >= 1" :disabled="isUploading || fileList.length >= 1"
:file-list="fileList" :file-list="fileList"
:http-request="uploadPicture" :http-request="uploadPicture"
:limit="1" :limit="1"
:on-progress="handleUploadProgress" :on-progress="handleUploadProgress"
:on-success="uploadSuccess" :on-success="uploadSuccess"
accept=".jpg,.jpeg,.png" accept=".jpg,.jpeg,.png"
action="#" action="#"
list-type="picture-card" list-type="picture-card"
name="multipartFile" name="multipartFile"
ref="imgUrl" ref="imgUrl"
> >
<div slot="file" slot-scope="{ file }"> <div slot="file" slot-scope="{ file }">
<div :key="idx" v-for="(item, idx) in fileList"> <div :key="idx" v-for="(item, idx) in fileList">
<img <img
:src="file.url" :src="file.url"
alt="" alt=""
class="el-upload-list__item-thumbnail" class="el-upload-list__item-thumbnail"
/> />
<span class="el-upload-list__item-actions"> <span class="el-upload-list__item-actions">
<span <span
@click="handlePictureCardPreview(file)" @click="handlePictureCardPreview(file)"
class="el-upload-list__item-preview" class="el-upload-list__item-preview"
...@@ -210,17 +210,19 @@ ...@@ -210,17 +210,19 @@
<i class="el-icon-delete"></i> <i class="el-icon-delete"></i>
</span> </span>
</span> </span>
</div>
</div> </div>
</div> <i class="el-icon-circle-plus"> </i>
<i class="el-icon-circle-plus" style="font-size: 44px"> </i> </el-upload>
</el-upload> </div>
</div>
<el-dialog :visible.sync="dialogVisible"> <el-dialog :visible.sync="dialogVisible">
<img :src="resultPicture" alt="" width="100%"/> <img :src="resultPicture" alt="" width="100%"/>
</el-dialog> </el-dialog>
</div>
</div> </div>
<span class="dialog-footer" slot="footer"> <span class="dialog-footer" slot="footer">
<el-button @click="bankDialogVisible = false">取 消</el-button> <el-button @click="bankDialogVisible = false">取 消</el-button>
<el-button @click="uploadConfirm" type="primary">确 定</el-button> <el-button @click="uploadConfirm" type="primary">确 定</el-button>
...@@ -232,10 +234,9 @@ ...@@ -232,10 +234,9 @@
<script> <script>
/* eslint-disable */ /* eslint-disable */
import ConfirmSignUp from "c/index/SignUp/ConfirmSignUp"; import ConfirmSignUp from "c/index/SignUp/ConfirmSignUp";
import {SERVER_WS_URL} from "@/config/server";
import {delPayingPic, getAccount, signUpInit,} from "r/index/signUp"; import {delPayingPic, getAccount, signUpInit,} from "r/index/signUp";
import {getWxConfig} from "r/index/pay"; import {getWxConfig} from "r/index/pay";
import {getSignature,checkAsync} from "r/index/cosUpload"; import {achievementCallBack, cosSignature} from "r/index/cosUpload";
import COS from "cos-js-sdk-v5"; import COS from "cos-js-sdk-v5";
export default { export default {
...@@ -310,11 +311,11 @@ ...@@ -310,11 +311,11 @@
}); });
}, },
// 子组件触发,关闭确认报名弹框 // 子组件触发,关闭确认报名弹框
closeCFSUDialog(val,isSuccess) { closeCFSUDialog(val, isSuccess) {
console.log(val, "val"); console.log(val, "val");
console.log(isSuccess, "isSuccess"); console.log(isSuccess, "isSuccess");
this.confirmSignUpDialogFu = val; this.confirmSignUpDialogFu = val;
if(isSuccess==1){ if (isSuccess == 1) {
this.$emit("getstatus", 6); this.$emit("getstatus", 6);
} }
}, },
...@@ -510,7 +511,7 @@ ...@@ -510,7 +511,7 @@
async getCosConfigs(image, file) { async getCosConfigs(image, file) {
console.log(file) console.log(file)
this.loading = true; this.loading = true;
await getSignature(3) await cosSignature({image: image, index: '3'})
.then((res) => { .then((res) => {
console.log(res, "开始上传图片"); console.log(res, "开始上传图片");
let resData = res.data.data let resData = res.data.data
...@@ -519,19 +520,19 @@ ...@@ -519,19 +520,19 @@
// 必选参数 // 必选参数
getAuthorization: (options, callback) => { getAuthorization: (options, callback) => {
callback({ callback({
TmpSecretId: resData.credentials.tmpSecretId, TmpSecretId: resData.credentials.credential.credentials.tmpSecretId,
TmpSecretKey: resData.credentials.tmpSecretKey, TmpSecretKey: resData.credentials.credential.credentials.tmpSecretKey,
XCosSecurityToken: resData.credentials.sessionToken, XCosSecurityToken: resData.credentials.credential.credentials.sessionToken,
StartTime: resData.startTime, // 时间戳,单位秒,如:1580000000 StartTime: resData.credentials.credential.startTime, // 时间戳,单位秒,如:1580000000
ExpiredTime: resData.expiredTime, // 时间戳,单位秒,如:1580000900 ExpiredTime: resData.credentials.credential.expiredTime, // 时间戳,单位秒,如:1580000900
}); });
}, },
}); });
console.log(resData) console.log(resData)
cos.putObject({ cos.putObject({
Bucket: resData.bucket, Bucket: resData.credentials.bucket,
Region: resData.region, Region: resData.credentials.region,
Key: '111/fg.png', Key: resData.key,
Body: file, Body: file,
onProgress: (progressData) => { onProgress: (progressData) => {
console.log("上传进度:" + JSON.stringify(progressData)); console.log("上传进度:" + JSON.stringify(progressData));
...@@ -545,7 +546,7 @@ ...@@ -545,7 +546,7 @@
this.$message.error('上传失败!') this.$message.error('上传失败!')
} else { } else {
console.log(data); console.log(data);
this.signUploadSuccess('http://' + data.Location); this.signUploadSuccess('http://' + data.Location, resData);
} }
} }
); );
...@@ -559,16 +560,30 @@ ...@@ -559,16 +560,30 @@
}); });
}, },
// cos上传-告诉后端上传成功 // cos上传-告诉后端上传成功
async signUploadSuccess(path) { async signUploadSuccess(path, resData) {
await getSignature(3).then(res => { await achievementCallBack({key: resData.key, index: 1}).then(res => {
if (res.data.code != 200) { if (res.data.code != 200) {
this.loading = false; this.loading = false;
return this.$message.error('上传失败!'); return this.$message.error('上传失败!');
} }
this.loading = false; this.loading = false;
this.$message.success('上传成功!'); this.$message.success('上传成功!');
// this.selfInfo.picture_path = path + "?t=" + Date.parse(new Date()); this.resultPicture = path + "?t=" + Date.parse(new Date());
this.$forceUpdate(); this.$forceUpdate();
let obj = {
url: res.data.picture_path,
savefile: res.data.config.savefile,
};
this.fileList.push(obj);
let code = this.$store.state.indexIdentity;
window.localStorage.setItem("sign_up_payfile_" + window.localStorage.getItem("index-phone-all") + code, JSON.stringify(this.fileList));
this.$message.success({
message:
"您已上传成功,等待短信通知,审核通过后登录报名网址。",
duration: 5000,
});
this.changeStatus();
this.hideUpload = this.fileList.length >= this.limitCount;
}).catch(err => { }).catch(err => {
this.loading = false; this.loading = false;
}) })
...@@ -820,4 +835,14 @@ ...@@ -820,4 +835,14 @@
// line-height: 12px; // line-height: 12px;
// } // }
// } // }
.bank_pay {
& div {
margin: 8px 0;
}
& span {
font-weight: 600;
}
}
</style> </style>
...@@ -590,7 +590,7 @@ ...@@ -590,7 +590,7 @@
: [{ required: false }] : [{ required: false }]
" "
label="备注或其它" label="备注或其它"
prop="clothes_size" prop="note_other"
style="height: 73px" style="height: 73px"
> >
<el-input <el-input
......
...@@ -6,7 +6,16 @@ ...@@ -6,7 +6,16 @@
<img :src="item.url" class="small" style="width: 100%;"/> <img :src="item.url" class="small" style="width: 100%;"/>
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
<div @click="viewMore" class="search">
<div class="search_back">
<div class="search_input">
<span>快速搜索 CAMP CENTER</span>
<i class="el-icon-search"></i>
</div>
</div>
</div>
</div> </div>
<div class="com-container home_content"> <div class="com-container home_content">
<!-- 热门活动 --> <!-- 热门活动 -->
<div> <div>
...@@ -105,7 +114,6 @@ ...@@ -105,7 +114,6 @@
<script> <script>
import banner1 from "../../../assets/img/Banner/banner1.png"; import banner1 from "../../../assets/img/Banner/banner1.png";
import banner2 from "../../../assets/img/Banner/banner2.jpg";
import {hot} from "r/base/home"; import {hot} from "r/base/home";
export default { export default {
...@@ -195,6 +203,7 @@ ...@@ -195,6 +203,7 @@
.bannerImg { .bannerImg {
width: 100%; width: 100%;
min-width: 1150px; min-width: 1150px;
position: relative;
::v-deep .el-carousel__container { ::v-deep .el-carousel__container {
height: inherit; height: inherit;
...@@ -215,6 +224,36 @@ ...@@ -215,6 +224,36 @@
/*width: 100%;*/ /*width: 100%;*/
height: inherit; height: inherit;
} }
.search {
display: flex;
justify-content: center;
position: absolute;
bottom: 0;
z-index: 1000;
width: 100%;
cursor: pointer;
.search_back {
color: #cccccc;
background-color: #fff;
padding: 22px 22px 6px 22px;
width: 60%;
.search_input {
background-color: #fff;
padding: 10px;
display: flex;
justify-content: space-between;
border-bottom: 2px solid var(--all_color);
}
i {
font-size: 20px;
}
}
}
} }
.home_title { .home_title {
......
...@@ -277,11 +277,9 @@ ...@@ -277,11 +277,9 @@
// 是否填写邀请码 // 是否填写邀请码
console.log(this.doubt_code) console.log(this.doubt_code)
if (this.doubt_code == 0) { if (this.doubt_code == 0) {
console.log('referInfo')
this.type = "referInfo"; this.type = "referInfo";
this.status = 2; this.status = 2;
} else { } else {
console.log('invitation')
this.type = "invitation"; this.type = "invitation";
this.status = 1; this.status = 1;
} }
......
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
<script> <script>
import {delPic, downloadTeacherWork, getStudentWork, subStudentWork} from "r/index/homework"; import {delPic, downloadTeacherWork, getStudentWork, subStudentWork} from "r/index/homework";
import {cosSignature, getSignature} from "r/index/cosUpload"; import {achievementCallBack, cosSignature} from "r/index/cosUpload";
import fileImg from "@/assets/img/homework/file_img.png"; import fileImg from "@/assets/img/homework/file_img.png";
import COS from "cos-js-sdk-v5"; import COS from "cos-js-sdk-v5";
...@@ -500,8 +500,8 @@ ...@@ -500,8 +500,8 @@
// cos上传 // cos上传
async getCosConfigs(image, file) { async getCosConfigs(image, file) {
console.log(file) console.log(file)
this.loading = true; this.isUploading = true;
await getSignature(2) await cosSignature({image: image, index: '2'})
.then((res) => { .then((res) => {
console.log(res, "开始上传图片"); console.log(res, "开始上传图片");
let resData = res.data.data let resData = res.data.data
...@@ -510,19 +510,19 @@ ...@@ -510,19 +510,19 @@
// 必选参数 // 必选参数
getAuthorization: (options, callback) => { getAuthorization: (options, callback) => {
callback({ callback({
TmpSecretId: resData.credential.credentials.tmpSecretId, TmpSecretId: resData.credentials.credential.credentials.tmpSecretId,
TmpSecretKey: resData.credential.credentials.tmpSecretKey, TmpSecretKey: resData.credentials.credential.credentials.tmpSecretKey,
XCosSecurityToken: resData.credential.credentials.sessionToken, XCosSecurityToken: resData.credentials.credential.credentials.sessionToken,
StartTime: resData.credential.startTime, // 时间戳,单位秒,如:1580000000 StartTime: resData.credentials.credential.startTime, // 时间戳,单位秒,如:1580000000
ExpiredTime: resData.credential.expiredTime, // 时间戳,单位秒,如:1580000900 ExpiredTime: resData.credentials.credential.expiredTime, // 时间戳,单位秒,如:1580000900
}); });
}, },
}); });
console.log(resData) console.log(resData)
cos.putObject({ cos.putObject({
Bucket: resData.bucket, Bucket: resData.credentials.bucket,
Region: resData.region, Region: resData.credentials.region,
Key: '111/fg.png', Key: resData.key,
Body: file, Body: file,
onProgress: (progressData) => { onProgress: (progressData) => {
console.log("上传进度:" + JSON.stringify(progressData)); console.log("上传进度:" + JSON.stringify(progressData));
...@@ -532,11 +532,11 @@ ...@@ -532,11 +532,11 @@
console.log(data); console.log(data);
if (err) { if (err) {
console.log(err); console.log(err);
this.loading = false; this.isUploading = false;
this.$message.error('上传失败!') this.$message.error('上传失败!')
} else { } else {
console.log(data); console.log(data);
this.signUploadSuccess('http://' + data.Location, image); this.signUploadSuccess('http://' + data.Location, resData);
} }
} }
); );
...@@ -546,24 +546,22 @@ ...@@ -546,24 +546,22 @@
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
// this.getIdCardPic();
}); });
}, },
// cos上传-告诉后端上传成功 // cos上传-告诉后端上传成功
async signUploadSuccess(path, image) { async signUploadSuccess(path, resData) {
await cosSignature({image: image, index: '2'}).then(res => { await achievementCallBack({key: resData.key, index: 2}).then(res => {
if (res.data.code != 200) { if (res.data.code != 200) {
this.loading = false; this.loading = false;
return this.$message.error('上传失败!'); return this.$message.error('上传失败!');
} }
this.loading = false; this.isUploading = false;
this.$message.success('上传成功!'); this.$message.success('上传成功!');
this.$forceUpdate();
this.resultPicture = path + "?t=" + Date.parse(new Date()); this.resultPicture = path + "?t=" + Date.parse(new Date());
this.$message.success("上传成功"); this.$forceUpdate();
let obj = { let obj = {
url_open: res.data.savefile, url_open: res.data.picture_path,
// savefile: res.data.config.savefile, savefile: res.data.config.savefile,
name: res.data.config.savefile.split("/work/")[1], name: res.data.config.savefile.split("/work/")[1],
}; };
this.stu_fileList.push(obj); this.stu_fileList.push(obj);
...@@ -573,7 +571,6 @@ ...@@ -573,7 +571,6 @@
return item.url_open; return item.url_open;
}) })
.join(","); .join(",");
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
window.localStorage.setItem("student_file_" + window.localStorage.setItem("student_file_" +
+window.localStorage.getItem("index-phone-all") + +window.localStorage.getItem("index-phone-all") +
...@@ -581,7 +578,7 @@ ...@@ -581,7 +578,7 @@
JSON.stringify(this.stu_fileListoss) JSON.stringify(this.stu_fileListoss)
); );
}).catch(err => { }).catch(err => {
this.loading = false; this.isUploading = false;
}) })
}, },
// async getOssConfigs(image, file) { // async getOssConfigs(image, file) {
......
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