Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
campSite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨梦雪
campSite
Commits
f0ddcdbf
Commit
f0ddcdbf
authored
Sep 26, 2023
by
杨梦雪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload
parent
08ad47dd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
183 additions
and
171 deletions
+183
-171
src/components/index/SignUp/deliveryAddress.vue
src/components/index/SignUp/deliveryAddress.vue
+22
-25
src/components/index/SignUp/referInfo.vue
src/components/index/SignUp/referInfo.vue
+41
-39
src/request/index/cosUpload.js
src/request/index/cosUpload.js
+10
-1
src/store/index.js
src/store/index.js
+0
-1
src/views/index/camp/SignUp.vue
src/views/index/camp/SignUp.vue
+3
-0
src/views/index/camp/homework/refer.vue
src/views/index/camp/homework/refer.vue
+107
-105
No files found.
src/components/index/SignUp/deliveryAddress.vue
View file @
f0ddcdbf
<
template
>
<!-- 确认收货地址对话框 -->
<el-dialog
title=
"确认收货地址"
:visible.sync=
"dialogVisible"
width=
"40%"
@
open=
"open()"
@
close=
"cancelBtn()"
@
open=
"open()"
title=
"确认收货地址"
width=
"40%"
>
<el-form
ref=
"addressRef"
:model=
"addressForm"
:rules=
"addressRules
"
>
<el-form
:model=
"addressForm"
:rules=
"addressRules"
ref=
"addressRef
"
>
<el-form-item
label=
"收件人"
prop=
"certificate_name"
>
<el-input
v-model=
"addressForm.certificate_name"
placeholder=
"填写真实姓名"
clearable
placeholder=
"填写真实姓名"
v-model=
"addressForm.certificate_name"
></el-input>
</el-form-item>
<el-form-item
label=
"收件人电话"
prop=
"certificate_phone"
>
<el-input
v-model=
"addressForm.certificate_phone"
placeholder=
"填写真实电话"
clearable
placeholder=
"填写真实电话"
v-model=
"addressForm.certificate_phone"
></el-input>
</el-form-item>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"收货地址"
prop=
"certificate_province"
>
<el-select
ref=
"certificate_province"
v-model=
"addressForm.certificate_province"
@
change=
"changeProvince($event)"
clearable
placeholder=
"选择省份"
@
change=
"changeProvince($event)"
ref=
"certificate_province"
v-model=
"addressForm.certificate_province"
>
<el-option
v-for=
"item in selectProvince"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
v-for=
"item in selectProvince"
>
</el-option>
</el-select>
...
...
@@ -45,16 +45,16 @@
<el-col
:span=
"8"
>
<el-form-item
class=
"no_label"
label=
" "
prop=
"certificate_city"
>
<el-select
ref=
"certificate_city"
v-model=
"addressForm.certificate_city"
clearable
placeholder=
"选择城市"
ref=
"certificate_city"
v-model=
"addressForm.certificate_city"
>
<el-option
v-for=
"item in selectCitySchool"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
v-for=
"item in selectCitySchool"
>
</el-option>
</el-select>
...
...
@@ -77,31 +77,31 @@
</el-option>
</el-select>
-->
<el-input
v-model=
"county"
placeholder=
"选择所在区县"
clearable
placeholder=
"选择所在区县"
v-model=
"county"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item
label=
""
prop=
"certificate_address"
>
<el-input
clearable
placeholder=
"填写详细地址"
ref=
"certificate_address"
v-model=
"certificate_address"
placeholder=
"填写详细地址"
clearable
></el-input>
</el-form-item>
</el-form>
<div
class=
"btn"
>
<el-button
type=
"primary"
@
click=
"setAddress()
"
>
确 定
</el-button>
<el-button
@
click=
"setAddress()"
type=
"primary
"
>
确 定
</el-button>
</div>
</el-dialog>
</
template
>
<
script
>
/* eslint-disable */
import
{
getProAndCity
}
from
"
r/index/signUp
"
;
import
{
setAddress
,
g
etAddress
}
from
"
r/index/certificate
"
;
import
{
getAddress
,
s
etAddress
}
from
"
r/index/certificate
"
;
import
validator
from
"
common/validator
"
;
export
default
{
...
...
@@ -187,10 +187,7 @@
if
(
res
.
data
.
code
!=
200
)
{
return
this
.
$message
.
error
(
res
.
data
.
message
);
}
console
.
log
(
res
.
data
.
info
)
console
.
log
(
res
.
data
.
info
.
length
==
0
)
if
(
res
.
data
.
info
.
length
==
0
)
{
console
.
log
(
111111
)
if
(
res
.
data
.
info
==
null
)
{
return
;
}
else
{
// console.log(Object.keys(res.data.info),'info')
...
...
src/components/index/SignUp/referInfo.vue
View file @
f0ddcdbf
...
...
@@ -641,7 +641,6 @@
>
<el-input
:disabled=
"isCode"
@
change=
"changeCode"
clearable
placeholder=
"邀请码"
ref=
"code"
...
...
@@ -966,7 +965,7 @@
/* eslint-disable */
import
{
delPic
,
getAccount
,
getProAndCity
,
getSchool
,
setAccount
}
from
"
r/index/signUp
"
;
import
COS
from
"
cos-js-sdk-v5
"
;
import
{
getSignature
}
from
"
r/index/cosUpload
"
;
import
{
cosSignature
,
getSignature
}
from
"
r/index/cosUpload
"
;
import
validator
from
"
common/validator
"
;
import
area
from
"
config/area
"
;
import
cueDialog
from
"
c/index/cueDialog
"
;
...
...
@@ -1390,8 +1389,7 @@
if
(
signUpFile
&&
JSON
.
parse
(
signUpFile
).
length
>
0
)
{
this
.
fileList
=
JSON
.
parse
(
signUpFile
);
}
this
.
getSchool
();
// this.getProAndCity();
// this.getSchool();
this
.
getTenYear
();
this
.
getAccount
();
// 页面信息个人获取
this
.
configJson
=
this
.
$store
.
state
.
configJson
;
...
...
@@ -1559,11 +1557,6 @@
// console.log(yearArr, "yearArr");
this
.
yearArrs
=
yearArr
;
},
//邀请码
changeCode
(
val
)
{
console
.
log
(
val
)
console
.
log
(
this
.
referForm
.
chooseSubject
)
},
//组装出生日期
getTime
()
{
this
.
referForm
.
birthday
=
...
...
@@ -1611,11 +1604,9 @@
getProAndCity
({}).
then
((
res
)
=>
{
// console.log(res, "getProAndCity");
if
(
res
.
data
.
code
!=
200
)
{
return
this
.
$message
.
error
(
res
.
data
.
m
essage
);
return
this
.
$message
.
error
(
res
.
data
.
m
sg
);
}
this
.
selectProvince
=
res
.
data
.
province_list
;
// this.CityName = res.data.city_list;
// console.log(this.selectProvince, this.CityName);
});
},
//选择籍贯省份change事件
...
...
@@ -1659,7 +1650,7 @@
}
return
currentCity
;
}
else
{
this
.
$message
.
error
(
res
.
data
.
m
essage
);
this
.
$message
.
error
(
res
.
data
.
m
sg
);
}
})
.
catch
((
err
)
=>
{
...
...
@@ -1680,15 +1671,16 @@
this
.
referForm
.
jiguan_code
=
this
.
jgProvinceCode
.
toString
()
+
this
.
jiguan_city
.
toString
();
},
getSchool
()
{
getSchool
({}).
then
((
res
)
=>
{
// console.log(res, "getSchool");
if
(
res
.
data
.
code
!=
200
)
{
return
this
.
$message
.
error
(
res
.
data
.
message
);
}
this
.
schoolName
=
res
.
data
.
school_list
;
});
},
// getSchool() {
// console.log('getSchool')
// getSchool({}).then((res) => {
// // console.log(res, "getSchool");
// if (res.data.code != 200) {
// return this.$message.error(res.data.message);
// }
// this.schoolName = res.data.school_list;
// });
// },
// 学校城市change事件
changeCity
(
val
,
status
)
{
// console.log(12345333,val,status)
...
...
@@ -1738,7 +1730,7 @@
}
return
currentSchool
;
}
else
{
this
.
$message
.
error
(
res
.
data
.
m
essage
);
this
.
$message
.
error
(
res
.
data
.
m
sg
);
}
})
.
catch
((
err
)
=>
{
...
...
@@ -1817,11 +1809,11 @@
// 必选参数
getAuthorization
:
(
options
,
callback
)
=>
{
callback
({
TmpSecretId
:
resData
.
credentials
.
tmpSecretId
,
TmpSecretKey
:
resData
.
credentials
.
tmpSecretKey
,
XCosSecurityToken
:
resData
.
credentials
.
sessionToken
,
StartTime
:
resData
.
startTime
,
// 时间戳,单位秒,如:1580000000
ExpiredTime
:
resData
.
expiredTime
,
// 时间戳,单位秒,如:1580000900
TmpSecretId
:
resData
.
credential
.
credential
s
.
tmpSecretId
,
TmpSecretKey
:
resData
.
credential
.
credential
s
.
tmpSecretKey
,
XCosSecurityToken
:
resData
.
credential
.
credential
s
.
sessionToken
,
StartTime
:
resData
.
credential
.
startTime
,
// 时间戳,单位秒,如:1580000000
ExpiredTime
:
resData
.
credential
.
expiredTime
,
// 时间戳,单位秒,如:1580000900
});
},
});
...
...
@@ -1843,12 +1835,12 @@
this
.
$message
.
error
(
'
上传失败!
'
)
}
else
{
console
.
log
(
data
);
this
.
signUploadSuccess
(
'
http://
'
+
data
.
Location
);
this
.
signUploadSuccess
(
'
http://
'
+
data
.
Location
,
image
);
}
}
);
}
else
{
this
.
$message
.
error
(
resData
.
m
essage
);
this
.
$message
.
error
(
resData
.
m
sg
);
}
})
.
catch
((
err
)
=>
{
...
...
@@ -1857,16 +1849,26 @@
});
},
// cos上传-告诉后端上传成功
async
signUploadSuccess
(
path
)
{
await
getSignature
(
1
).
then
(
res
=>
{
async
signUploadSuccess
(
path
,
image
)
{
await
cosSignature
({
image
:
image
,
index
:
'
1
'
}
).
then
(
res
=>
{
if
(
res
.
data
.
code
!=
200
)
{
this
.
loading
=
false
;
return
this
.
$message
.
error
(
'
上传失败!
'
);
}
this
.
loading
=
false
;
this
.
$message
.
success
(
'
上传成功!
'
);
// this.selfInfo.picture_path
= path + "?t=" + Date.parse(new Date());
this
.
resultPicture
=
path
+
"
?t=
"
+
Date
.
parse
(
new
Date
());
this
.
$forceUpdate
();
let
obj
=
{
url
:
res
.
data
.
savefile
,
};
this
.
fileList
.
push
(
obj
);
let
code
=
this
.
$store
.
state
.
indexIdentity
;
window
.
localStorage
.
setItem
(
"
sign_up_file_
"
+
+
window
.
localStorage
.
getItem
(
"
index-phone-all
"
)
+
code
,
JSON
.
stringify
(
this
.
fileList
)
);
}).
catch
(
err
=>
{
this
.
loading
=
false
;
})
...
...
@@ -1949,7 +1951,7 @@
delPic
({
object
:
savefile
}).
then
((
res
)
=>
{
// console.log(res, "delpic");
if
(
res
.
data
.
code
!=
200
)
{
return
this
.
$message
.
error
(
res
.
data
.
m
essage
);
return
this
.
$message
.
error
(
res
.
data
.
m
sg
);
}
this
.
fileList
.
forEach
((
item
,
idx
)
=>
{
// console.log(item.url == file.url);
...
...
@@ -1963,7 +1965,7 @@
);
}
});
this
.
$message
.
success
(
res
.
data
.
m
essage
);
this
.
$message
.
success
(
res
.
data
.
m
sg
);
});
})
.
catch
((
err
)
=>
{
...
...
@@ -2106,17 +2108,17 @@
if
(
res
.
data
.
code
!=
200
)
{
if
(
res
.
data
.
code
==
400068
)
{
this
.
$parent
.
statuss
();
return
this
.
$message
.
error
(
res
.
data
.
m
essage
);
return
this
.
$message
.
error
(
res
.
data
.
m
sg
);
}
return
this
.
$message
.
error
(
res
.
data
.
m
essage
);
return
this
.
$message
.
error
(
res
.
data
.
m
sg
);
}
if
(
res
.
data
.
code
==
4000346
||
res
.
data
.
code
==
4000347
)
{
this
.
dialogVisible
=
true
;
this
.
msg
=
res
.
data
.
m
essage
this
.
msg
=
res
.
data
.
m
sg
return
;
}
this
.
$emit
(
"
getstatus
"
,
res
.
data
.
status
);
this
.
$message
.
success
(
res
.
data
.
m
essage
);
this
.
$message
.
success
(
res
.
data
.
m
sg
);
this
.
referForm
=
res
.
data
.
data
;
});
...
...
src/request/index/cosUpload.js
View file @
f0ddcdbf
import
{
request
}
from
"
../network
"
;
import
store
from
'
@/store
'
;
//cos签名-web直传 1-个人信息上传2-作业上传3-银行缴费截图上传
export
function
getSignature
(
index
)
{
return
request
({
method
:
'
get
'
,
url
:
`/web/download/getSignature/
${
index
}
`
,
})
}
//cos签名-web直传 1-个人信息上传2-作业上传3-银行缴费截图上传
export
function
cosSignature
(
data
)
{
data
[
'
identity
'
]
=
store
.
state
.
indexIdentity
;
return
request
({
method
:
'
post
'
,
url
:
'
/web/download/getSignature
'
,
data
})
}
src/store/index.js
View file @
f0ddcdbf
...
...
@@ -25,7 +25,6 @@ let state = {
token
:
localStorage
.
getItem
(
"
index-token-all
"
)
||
""
,
isLogin
:
localStorage
.
getItem
(
"
isLogin
"
)
||
"
0
"
,
// 只有1为已登录
activeIndex
:
window
.
localStorage
.
getItem
(
'
index-active-path
'
)
||
"
0
"
,
isToSuccess
:
0
,
//订单状态检查跳转界面(成功-跳转到支付成功页面)
};
export
default
new
Vuex
.
Store
({
...
...
src/views/index/camp/SignUp.vue
View file @
f0ddcdbf
...
...
@@ -275,10 +275,13 @@
this
.
type
=
"
examInfo
"
;
}
else
if
(
this
.
status
==
1
)
{
// 是否填写邀请码
console
.
log
(
this
.
doubt_code
)
if
(
this
.
doubt_code
==
0
)
{
console
.
log
(
'
referInfo
'
)
this
.
type
=
"
referInfo
"
;
this
.
status
=
2
;
}
else
{
console
.
log
(
'
invitation
'
)
this
.
type
=
"
invitation
"
;
this
.
status
=
1
;
}
...
...
src/views/index/camp/homework/refer.vue
View file @
f0ddcdbf
...
...
@@ -244,16 +244,8 @@
</
template
>
<
script
>
import
{
delPic
,
downloadTeacherWork
,
getStudentWork
,
PostWorkStudentOss
,
subStudentWork
}
from
"
r/index/homework
"
;
import
{
getSignature
,
}
from
"
r/index/cosUpload
"
;
import
{
delPic
,
downloadTeacherWork
,
getStudentWork
,
subStudentWork
}
from
"
r/index/homework
"
;
import
{
cosSignature
,
getSignature
}
from
"
r/index/cosUpload
"
;
import
fileImg
from
"
@/assets/img/homework/file_img.png
"
;
import
COS
from
"
cos-js-sdk-v5
"
;
...
...
@@ -371,7 +363,7 @@
downloadStuFile
(
url
)
{
downloadTeacherWork
({
enclosure_url
:
url
}).
then
((
res
)
=>
{
if
(
res
.
data
.
code
!=
200
)
{
return
this
.
$message
.
error
(
res
.
data
.
m
essage
);
return
this
.
$message
.
error
(
res
.
data
.
m
sg
);
}
let
url
=
res
.
data
.
url
;
let
reg
=
/^.+
(\.
pdf|
\.
txt|
\.
mp3|
\.
mp4
)
$/
;
...
...
@@ -387,7 +379,7 @@
downloadScoreFile
(
url
)
{
downloadTeacherWork
({
enclosure_url
:
url
}).
then
((
res
)
=>
{
if
(
res
.
data
.
code
!=
200
)
{
return
this
.
$message
.
error
(
res
.
data
.
m
essage
);
return
this
.
$message
.
error
(
res
.
data
.
m
sg
);
}
let
url
=
res
.
data
.
url
;
let
reg
=
/^.+
(\.
pdf|
\.
txt|
\.
mp3|
\.
mp4
)
$/
;
...
...
@@ -404,9 +396,9 @@
let
stu_work_num
=
this
.
work_nums
;
getStudentWork
({
teacher_id
:
stu_work_num
}).
then
((
res
)
=>
{
if
(
res
.
data
.
code
!=
200
)
{
return
this
.
$message
.
error
(
res
.
data
.
m
essage
);
return
this
.
$message
.
error
(
res
.
data
.
m
sg
);
}
this
.
$message
.
success
(
res
.
data
.
m
essage
);
this
.
$message
.
success
(
res
.
data
.
m
sg
);
if
(
student_status
==
1
)
{
// 学生已提交
this
.
formData
.
stu_answer
=
res
.
data
.
data
.
stu_answer
;
...
...
@@ -457,7 +449,6 @@
}
this
.
$forceUpdate
();
//强制刷新
}
});
},
// 成功确认取消,关闭弹框,修改父组件的值
...
...
@@ -519,11 +510,11 @@
// 必选参数
getAuthorization
:
(
options
,
callback
)
=>
{
callback
({
TmpSecretId
:
resData
.
credentials
.
tmpSecretId
,
TmpSecretKey
:
resData
.
credentials
.
tmpSecretKey
,
XCosSecurityToken
:
resData
.
credentials
.
sessionToken
,
StartTime
:
resData
.
startTime
,
// 时间戳,单位秒,如:1580000000
ExpiredTime
:
resData
.
expiredTime
,
// 时间戳,单位秒,如:1580000900
TmpSecretId
:
resData
.
credential
.
credential
s
.
tmpSecretId
,
TmpSecretKey
:
resData
.
credential
.
credential
s
.
tmpSecretKey
,
XCosSecurityToken
:
resData
.
credential
.
credential
s
.
sessionToken
,
StartTime
:
resData
.
credential
.
startTime
,
// 时间戳,单位秒,如:1580000000
ExpiredTime
:
resData
.
credential
.
expiredTime
,
// 时间戳,单位秒,如:1580000900
});
},
});
...
...
@@ -545,12 +536,12 @@
this
.
$message
.
error
(
'
上传失败!
'
)
}
else
{
console
.
log
(
data
);
this
.
signUploadSuccess
(
'
http://
'
+
data
.
Location
);
this
.
signUploadSuccess
(
'
http://
'
+
data
.
Location
,
image
);
}
}
);
}
else
{
this
.
$message
.
error
(
resData
.
m
essage
);
this
.
$message
.
error
(
resData
.
m
sg
);
}
})
.
catch
((
err
)
=>
{
...
...
@@ -559,86 +550,106 @@
});
},
// cos上传-告诉后端上传成功
async
signUploadSuccess
(
path
)
{
await
getSignature
(
2
).
then
(
res
=>
{
async
signUploadSuccess
(
path
,
image
)
{
await
cosSignature
({
image
:
image
,
index
:
'
2
'
}
).
then
(
res
=>
{
if
(
res
.
data
.
code
!=
200
)
{
this
.
loading
=
false
;
return
this
.
$message
.
error
(
'
上传失败!
'
);
}
this
.
loading
=
false
;
this
.
$message
.
success
(
'
上传成功!
'
);
// this.selfInfo.picture_path = path + "?t=" + Date.parse(new Date());
this
.
$forceUpdate
();
this
.
resultPicture
=
path
+
"
?t=
"
+
Date
.
parse
(
new
Date
());
this
.
$message
.
success
(
"
上传成功
"
);
let
obj
=
{
url_open
:
res
.
data
.
savefile
,
// savefile: res.data.config.savefile,
name
:
res
.
data
.
config
.
savefile
.
split
(
"
/work/
"
)[
1
],
};
this
.
stu_fileList
.
push
(
obj
);
this
.
fileList
.
push
(
obj
);
this
.
stu_fileListoss
=
this
.
stu_fileList
.
map
((
item
)
=>
{
return
item
.
url_open
;
})
.
join
(
"
,
"
);
let
code
=
this
.
$store
.
state
.
indexIdentity
;
window
.
localStorage
.
setItem
(
"
student_file_
"
+
+
window
.
localStorage
.
getItem
(
"
index-phone-all
"
)
+
code
,
JSON
.
stringify
(
this
.
stu_fileListoss
)
);
}).
catch
(
err
=>
{
this
.
loading
=
false
;
})
},
async
getOssConfigs
(
image
,
file
)
{
let
obj
=
{
url
:
""
,
savefile
:
""
,
};
await
PostWorkStudentOss
({
image
:
image
,
teacher_id
:
this
.
work_nums
,
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
let
oss_url
=
res
.
data
.
config
.
host
;
let
filename
=
res
.
data
.
config
.
file
;
let
formData
=
new
FormData
();
formData
.
append
(
"
OSSAccessKeyId
"
,
res
.
data
.
config
.
accessid
);
formData
.
append
(
"
policy
"
,
res
.
data
.
config
.
policy
);
formData
.
append
(
"
signature
"
,
res
.
data
.
config
.
signature
);
formData
.
append
(
"
filename
"
,
res
.
data
.
config
.
file
);
formData
.
append
(
"
key
"
,
res
.
data
.
config
.
savefile
);
formData
.
append
(
"
callback
"
,
res
.
data
.
config
.
callback
);
formData
.
append
(
"
success_action_status
"
,
200
);
formData
.
append
(
"
file
"
,
file
);
this
.
upload
(
oss_url
,
formData
)
.
then
((
ress
)
=>
{
console
.
log
(
ress
,
"
ress
"
);
if
(
ress
.
data
.
code
!=
200
)
{
this
.
isUploading
=
false
;
return
this
.
$message
.
error
(
ress
.
data
.
message
);
}
this
.
resultPicture
=
filename
+
"
?t=
"
+
Date
.
parse
(
new
Date
());
this
.
$forceUpdate
();
this
.
$message
.
success
(
"
上传成功
"
);
obj
=
{
url_open
:
ress
.
data
.
picture_path
,
savefile
:
res
.
data
.
config
.
savefile
,
name
:
res
.
data
.
config
.
savefile
.
split
(
"
/work/
"
)[
1
],
};
this
.
stu_fileList
.
push
(
obj
);
this
.
fileList
.
push
(
obj
);
this
.
stu_fileListoss
=
this
.
stu_fileList
.
map
((
item
)
=>
{
return
item
.
url_open
;
})
.
join
(
"
,
"
);
let
code
=
this
.
$store
.
state
.
indexIdentity
;
window
.
localStorage
.
setItem
(
"
student_file_
"
+
+
window
.
localStorage
.
getItem
(
"
index-phone-all
"
)
+
code
,
JSON
.
stringify
(
this
.
stu_fileListoss
)
);
this
.
isUploading
=
false
;
})
.
catch
((
err
)
=>
{
this
.
isUploading
=
false
;
this
.
$message
.
error
(
err
);
});
}
else
{
this
.
isUploading
=
false
;
this
.
$message
.
error
(
res
.
data
.
message
);
}
})
.
catch
((
err
)
=>
{
this
.
isUploading
=
false
;
});
},
//
async getOssConfigs(image, file) {
//
let obj = {
//
url: "",
//
savefile: "",
//
};
//
await PostWorkStudentOss({
//
image: image,
//
teacher_id: this.work_nums,
//
})
//
.then((res) => {
//
if (res.data.code === 200) {
//
let oss_url = res.data.config.host;
//
let filename = res.data.config.file;
//
let formData = new FormData();
//
formData.append("OSSAccessKeyId", res.data.config.accessid);
//
formData.append("policy", res.data.config.policy);
//
formData.append("signature", res.data.config.signature);
//
formData.append("filename", res.data.config.file);
//
formData.append("key", res.data.config.savefile);
//
formData.append("callback", res.data.config.callback);
//
formData.append("success_action_status", 200);
//
formData.append("file", file);
//
this.upload(oss_url, formData)
//
.then((ress) => {
//
console.log(ress, "ress");
//
if (ress.data.code != 200) {
//
this.isUploading = false;
//
return this.$message.error(ress.data.message);
//
}
//
this.resultPicture = filename + "?t=" + Date.parse(new Date());
//
this.$forceUpdate();
//
this.$message.success("上传成功");
//
obj = {
//
url_open: ress.data.picture_path,
//
savefile: res.data.config.savefile,
//
name: res.data.config.savefile.split("/work/")[1],
//
};
//
this.stu_fileList.push(obj);
//
this.fileList.push(obj);
//
this.stu_fileListoss = this.stu_fileList
//
.map((item) => {
//
return item.url_open;
//
})
//
.join(",");
//
//
let code = this.$store.state.indexIdentity;
//
window.localStorage.setItem("student_file_" +
//
+window.localStorage.getItem("index-phone-all") +
//
code,
//
JSON.stringify(this.stu_fileListoss)
//
);
//
this.isUploading = false;
//
})
//
.catch((err) => {
//
this.isUploading = false;
//
this.$message.error(err);
//
});
//
} else {
//
this.isUploading = false;
//
this.$message.error(res.data.message);
//
}
//
})
//
.catch((err) => {
//
this.isUploading = false;
//
});
//
},
// 下载证明资料图片
handleDownload
(
file
)
{
// console.log(file,'file22');
...
...
@@ -664,7 +675,7 @@
delPic
({
object
:
savefile
,
teacher_id
:
stu_work_num
}).
then
((
res
)
=>
{
// console.log(res, "delpic");
if
(
res
.
data
.
code
!=
200
)
{
return
this
.
$message
.
error
(
res
.
data
.
m
essage
);
return
this
.
$message
.
error
(
res
.
data
.
m
sg
);
}
this
.
stu_fileList
.
forEach
((
item
,
idx
)
=>
{
if
(
item
.
url_open
==
file
.
url_open
)
{
...
...
@@ -677,9 +688,7 @@
return
item
.
url
;
})
.
join
(
"
,
"
);
console
.
log
(
this
.
stu_fileListoss
);
console
.
log
(
this
.
stu_fileList
);
this
.
$message
.
success
(
res
.
data
.
message
);
this
.
$message
.
success
(
res
.
data
.
msg
);
window
.
localStorage
.
setItem
(
"
student_file_
"
+
window
.
localStorage
.
getItem
(
"
index-phone-all
"
)
+
code
,
...
...
@@ -688,8 +697,6 @@
}
});
});
console
.
log
(
this
.
stu_fileListoss
);
console
.
log
(
this
.
stu_fileList
);
})
.
catch
((
err
)
=>
{
// console.log(err, "err");
...
...
@@ -701,14 +708,9 @@
},
// 查看已上传的学生作业
handleCheck
(
url
)
{
console
.
log
(
url
,
"
url
"
);
console
.
log
(
this
.
srcList
,
"
fileList
"
);
// console.log(url.match(/\.(jpeg|jpg|gif|png)$/) != null)
// 是否为图片
if
(
url
.
match
(
/
\.(
jpeg|jpg|gif|png
)
$/
)
!=
null
)
{
this
.
dialogVisibleImage
=
true
;
console
.
log
(
url
.
split
(
"
"
),
'
111
'
)
// this.srcList = url.split(" ");
this
.
srcList_url_open
=
url
this
.
srcList
=
this
.
stu_fileList
.
map
((
item
)
=>
{
return
item
.
url_open
...
...
@@ -761,12 +763,12 @@
//作业无修改
if
(
response
.
data
.
code
==
4000343
)
{
this
.
cancelBtn
()
return
this
.
$message
.
error
(
response
.
data
.
m
essage
);
return
this
.
$message
.
error
(
response
.
data
.
m
sg
);
}
if
(
response
.
data
.
code
!=
200
)
{
return
this
.
$message
.
error
(
response
.
data
.
m
essage
);
return
this
.
$message
.
error
(
response
.
data
.
m
sg
);
}
this
.
$message
.
success
(
response
.
data
.
m
essage
);
this
.
$message
.
success
(
response
.
data
.
m
sg
);
this
.
cancelBtnTrue
();
})
.
catch
((
error
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment