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
>
<
template
>
<!-- 确认收货地址对话框 -->
<!-- 确认收货地址对话框 -->
<el-dialog
<el-dialog
title=
"确认收货地址"
:visible.sync=
"dialogVisible"
:visible.sync=
"dialogVisible"
width=
"40%"
@
open=
"open()"
@
close=
"cancelBtn()"
@
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-form-item
label=
"收件人"
prop=
"certificate_name"
>
<el-input
<el-input
v-model=
"addressForm.certificate_name"
placeholder=
"填写真实姓名"
clearable
clearable
placeholder=
"填写真实姓名"
v-model=
"addressForm.certificate_name"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"收件人电话"
prop=
"certificate_phone"
>
<el-form-item
label=
"收件人电话"
prop=
"certificate_phone"
>
<el-input
<el-input
v-model=
"addressForm.certificate_phone"
placeholder=
"填写真实电话"
clearable
clearable
placeholder=
"填写真实电话"
v-model=
"addressForm.certificate_phone"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
<el-row
:gutter=
"20"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"收货地址"
prop=
"certificate_province"
>
<el-form-item
label=
"收货地址"
prop=
"certificate_province"
>
<el-select
<el-select
ref=
"certificate_province"
@
change=
"changeProvince($event)"
v-model=
"addressForm.certificate_province"
clearable
clearable
placeholder=
"选择省份"
placeholder=
"选择省份"
@
change=
"changeProvince($event)"
ref=
"certificate_province"
v-model=
"addressForm.certificate_province"
>
>
<el-option
<el-option
v-for=
"item in selectProvince"
:key=
"item.id"
:key=
"item.id"
:label=
"item.name"
:label=
"item.name"
:value=
"item.id"
:value=
"item.id"
v-for=
"item in selectProvince"
>
>
</el-option>
</el-option>
</el-select>
</el-select>
...
@@ -45,16 +45,16 @@
...
@@ -45,16 +45,16 @@
<el-col
:span=
"8"
>
<el-col
:span=
"8"
>
<el-form-item
class=
"no_label"
label=
" "
prop=
"certificate_city"
>
<el-form-item
class=
"no_label"
label=
" "
prop=
"certificate_city"
>
<el-select
<el-select
ref=
"certificate_city"
v-model=
"addressForm.certificate_city"
clearable
clearable
placeholder=
"选择城市"
placeholder=
"选择城市"
ref=
"certificate_city"
v-model=
"addressForm.certificate_city"
>
>
<el-option
<el-option
v-for=
"item in selectCitySchool"
:key=
"item.id"
:key=
"item.id"
:label=
"item.name"
:label=
"item.name"
:value=
"item.id"
:value=
"item.id"
v-for=
"item in selectCitySchool"
>
>
</el-option>
</el-option>
</el-select>
</el-select>
...
@@ -77,31 +77,31 @@
...
@@ -77,31 +77,31 @@
</el-option>
</el-option>
</el-select>
-->
</el-select>
-->
<el-input
<el-input
v-model=
"county"
placeholder=
"选择所在区县"
clearable
clearable
placeholder=
"选择所在区县"
v-model=
"county"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
<el-form-item
label=
""
prop=
"certificate_address"
>
<el-form-item
label=
""
prop=
"certificate_address"
>
<el-input
<el-input
clearable
placeholder=
"填写详细地址"
ref=
"certificate_address"
ref=
"certificate_address"
v-model=
"certificate_address"
v-model=
"certificate_address"
placeholder=
"填写详细地址"
clearable
></el-input>
></el-input>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<div
class=
"btn"
>
<div
class=
"btn"
>
<el-button
type=
"primary"
@
click=
"setAddress()
"
>
确 定
</el-button>
<el-button
@
click=
"setAddress()"
type=
"primary
"
>
确 定
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
</
template
>
</
template
>
<
script
>
<
script
>
/* eslint-disable */
/* eslint-disable */
import
{
getProAndCity
}
from
"
r/index/signUp
"
;
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
"
;
import
validator
from
"
common/validator
"
;
export
default
{
export
default
{
...
@@ -187,10 +187,7 @@
...
@@ -187,10 +187,7 @@
if
(
res
.
data
.
code
!=
200
)
{
if
(
res
.
data
.
code
!=
200
)
{
return
this
.
$message
.
error
(
res
.
data
.
message
);
return
this
.
$message
.
error
(
res
.
data
.
message
);
}
}
console
.
log
(
res
.
data
.
info
)
if
(
res
.
data
.
info
==
null
)
{
console
.
log
(
res
.
data
.
info
.
length
==
0
)
if
(
res
.
data
.
info
.
length
==
0
)
{
console
.
log
(
111111
)
return
;
return
;
}
else
{
}
else
{
// console.log(Object.keys(res.data.info),'info')
// console.log(Object.keys(res.data.info),'info')
...
...
src/components/index/SignUp/referInfo.vue
View file @
f0ddcdbf
...
@@ -641,7 +641,6 @@
...
@@ -641,7 +641,6 @@
>
>
<el-input
<el-input
:disabled=
"isCode"
:disabled=
"isCode"
@
change=
"changeCode"
clearable
clearable
placeholder=
"邀请码"
placeholder=
"邀请码"
ref=
"code"
ref=
"code"
...
@@ -966,7 +965,7 @@
...
@@ -966,7 +965,7 @@
/* eslint-disable */
/* eslint-disable */
import
{
delPic
,
getAccount
,
getProAndCity
,
getSchool
,
setAccount
}
from
"
r/index/signUp
"
;
import
{
delPic
,
getAccount
,
getProAndCity
,
getSchool
,
setAccount
}
from
"
r/index/signUp
"
;
import
COS
from
"
cos-js-sdk-v5
"
;
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
validator
from
"
common/validator
"
;
import
area
from
"
config/area
"
;
import
area
from
"
config/area
"
;
import
cueDialog
from
"
c/index/cueDialog
"
;
import
cueDialog
from
"
c/index/cueDialog
"
;
...
@@ -1390,8 +1389,7 @@
...
@@ -1390,8 +1389,7 @@
if
(
signUpFile
&&
JSON
.
parse
(
signUpFile
).
length
>
0
)
{
if
(
signUpFile
&&
JSON
.
parse
(
signUpFile
).
length
>
0
)
{
this
.
fileList
=
JSON
.
parse
(
signUpFile
);
this
.
fileList
=
JSON
.
parse
(
signUpFile
);
}
}
this
.
getSchool
();
// this.getSchool();
// this.getProAndCity();
this
.
getTenYear
();
this
.
getTenYear
();
this
.
getAccount
();
// 页面信息个人获取
this
.
getAccount
();
// 页面信息个人获取
this
.
configJson
=
this
.
$store
.
state
.
configJson
;
this
.
configJson
=
this
.
$store
.
state
.
configJson
;
...
@@ -1559,11 +1557,6 @@
...
@@ -1559,11 +1557,6 @@
// console.log(yearArr, "yearArr");
// console.log(yearArr, "yearArr");
this
.
yearArrs
=
yearArr
;
this
.
yearArrs
=
yearArr
;
},
},
//邀请码
changeCode
(
val
)
{
console
.
log
(
val
)
console
.
log
(
this
.
referForm
.
chooseSubject
)
},
//组装出生日期
//组装出生日期
getTime
()
{
getTime
()
{
this
.
referForm
.
birthday
=
this
.
referForm
.
birthday
=
...
@@ -1611,11 +1604,9 @@
...
@@ -1611,11 +1604,9 @@
getProAndCity
({}).
then
((
res
)
=>
{
getProAndCity
({}).
then
((
res
)
=>
{
// console.log(res, "getProAndCity");
// console.log(res, "getProAndCity");
if
(
res
.
data
.
code
!=
200
)
{
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
.
selectProvince
=
res
.
data
.
province_list
;
// this.CityName = res.data.city_list;
// console.log(this.selectProvince, this.CityName);
});
});
},
},
//选择籍贯省份change事件
//选择籍贯省份change事件
...
@@ -1659,7 +1650,7 @@
...
@@ -1659,7 +1650,7 @@
}
}
return
currentCity
;
return
currentCity
;
}
else
{
}
else
{
this
.
$message
.
error
(
res
.
data
.
m
essage
);
this
.
$message
.
error
(
res
.
data
.
m
sg
);
}
}
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
...
@@ -1680,15 +1671,16 @@
...
@@ -1680,15 +1671,16 @@
this
.
referForm
.
jiguan_code
=
this
.
referForm
.
jiguan_code
=
this
.
jgProvinceCode
.
toString
()
+
this
.
jiguan_city
.
toString
();
this
.
jgProvinceCode
.
toString
()
+
this
.
jiguan_city
.
toString
();
},
},
getSchool
()
{
// getSchool() {
getSchool
({}).
then
((
res
)
=>
{
// console.log('getSchool')
// console.log(res, "getSchool");
// getSchool({}).then((res) => {
if
(
res
.
data
.
code
!=
200
)
{
// // console.log(res, "getSchool");
return
this
.
$message
.
error
(
res
.
data
.
message
);
// if (res.data.code != 200) {
}
// return this.$message.error(res.data.message);
this
.
schoolName
=
res
.
data
.
school_list
;
// }
});
// this.schoolName = res.data.school_list;
},
// });
// },
// 学校城市change事件
// 学校城市change事件
changeCity
(
val
,
status
)
{
changeCity
(
val
,
status
)
{
// console.log(12345333,val,status)
// console.log(12345333,val,status)
...
@@ -1738,7 +1730,7 @@
...
@@ -1738,7 +1730,7 @@
}
}
return
currentSchool
;
return
currentSchool
;
}
else
{
}
else
{
this
.
$message
.
error
(
res
.
data
.
m
essage
);
this
.
$message
.
error
(
res
.
data
.
m
sg
);
}
}
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
...
@@ -1817,11 +1809,11 @@
...
@@ -1817,11 +1809,11 @@
// 必选参数
// 必选参数
getAuthorization
:
(
options
,
callback
)
=>
{
getAuthorization
:
(
options
,
callback
)
=>
{
callback
({
callback
({
TmpSecretId
:
resData
.
credentials
.
tmpSecretId
,
TmpSecretId
:
resData
.
credential
.
credential
s
.
tmpSecretId
,
TmpSecretKey
:
resData
.
credentials
.
tmpSecretKey
,
TmpSecretKey
:
resData
.
credential
.
credential
s
.
tmpSecretKey
,
XCosSecurityToken
:
resData
.
credentials
.
sessionToken
,
XCosSecurityToken
:
resData
.
credential
.
credential
s
.
sessionToken
,
StartTime
:
resData
.
startTime
,
// 时间戳,单位秒,如:1580000000
StartTime
:
resData
.
credential
.
startTime
,
// 时间戳,单位秒,如:1580000000
ExpiredTime
:
resData
.
expiredTime
,
// 时间戳,单位秒,如:1580000900
ExpiredTime
:
resData
.
credential
.
expiredTime
,
// 时间戳,单位秒,如:1580000900
});
});
},
},
});
});
...
@@ -1843,12 +1835,12 @@
...
@@ -1843,12 +1835,12 @@
this
.
$message
.
error
(
'
上传失败!
'
)
this
.
$message
.
error
(
'
上传失败!
'
)
}
else
{
}
else
{
console
.
log
(
data
);
console
.
log
(
data
);
this
.
signUploadSuccess
(
'
http://
'
+
data
.
Location
);
this
.
signUploadSuccess
(
'
http://
'
+
data
.
Location
,
image
);
}
}
}
}
);
);
}
else
{
}
else
{
this
.
$message
.
error
(
resData
.
m
essage
);
this
.
$message
.
error
(
resData
.
m
sg
);
}
}
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
...
@@ -1857,16 +1849,26 @@
...
@@ -1857,16 +1849,26 @@
});
});
},
},
// cos上传-告诉后端上传成功
// cos上传-告诉后端上传成功
async
signUploadSuccess
(
path
)
{
async
signUploadSuccess
(
path
,
image
)
{
await
getSignature
(
1
).
then
(
res
=>
{
await
cosSignature
({
image
:
image
,
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
.
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
=>
{
}).
catch
(
err
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
})
})
...
@@ -1949,7 +1951,7 @@
...
@@ -1949,7 +1951,7 @@
delPic
({
object
:
savefile
}).
then
((
res
)
=>
{
delPic
({
object
:
savefile
}).
then
((
res
)
=>
{
// console.log(res, "delpic");
// console.log(res, "delpic");
if
(
res
.
data
.
code
!=
200
)
{
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
)
=>
{
this
.
fileList
.
forEach
((
item
,
idx
)
=>
{
// console.log(item.url == file.url);
// console.log(item.url == file.url);
...
@@ -1963,7 +1965,7 @@
...
@@ -1963,7 +1965,7 @@
);
);
}
}
});
});
this
.
$message
.
success
(
res
.
data
.
m
essage
);
this
.
$message
.
success
(
res
.
data
.
m
sg
);
});
});
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
...
@@ -2106,17 +2108,17 @@
...
@@ -2106,17 +2108,17 @@
if
(
res
.
data
.
code
!=
200
)
{
if
(
res
.
data
.
code
!=
200
)
{
if
(
res
.
data
.
code
==
400068
)
{
if
(
res
.
data
.
code
==
400068
)
{
this
.
$parent
.
statuss
();
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
)
{
if
(
res
.
data
.
code
==
4000346
||
res
.
data
.
code
==
4000347
)
{
this
.
dialogVisible
=
true
;
this
.
dialogVisible
=
true
;
this
.
msg
=
res
.
data
.
m
essage
this
.
msg
=
res
.
data
.
m
sg
return
;
return
;
}
}
this
.
$emit
(
"
getstatus
"
,
res
.
data
.
status
);
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
;
this
.
referForm
=
res
.
data
.
data
;
});
});
...
...
src/request/index/cosUpload.js
View file @
f0ddcdbf
import
{
request
}
from
"
../network
"
;
import
{
request
}
from
"
../network
"
;
import
store
from
'
@/store
'
;
//cos签名-web直传 1-个人信息上传2-作业上传3-银行缴费截图上传
export
function
getSignature
(
index
)
{
export
function
getSignature
(
index
)
{
return
request
({
return
request
({
method
:
'
get
'
,
method
:
'
get
'
,
url
:
`/web/download/getSignature/
${
index
}
`
,
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 = {
...
@@ -25,7 +25,6 @@ let state = {
token
:
localStorage
.
getItem
(
"
index-token-all
"
)
||
""
,
token
:
localStorage
.
getItem
(
"
index-token-all
"
)
||
""
,
isLogin
:
localStorage
.
getItem
(
"
isLogin
"
)
||
"
0
"
,
// 只有1为已登录
isLogin
:
localStorage
.
getItem
(
"
isLogin
"
)
||
"
0
"
,
// 只有1为已登录
activeIndex
:
window
.
localStorage
.
getItem
(
'
index-active-path
'
)
||
"
0
"
,
activeIndex
:
window
.
localStorage
.
getItem
(
'
index-active-path
'
)
||
"
0
"
,
isToSuccess
:
0
,
//订单状态检查跳转界面(成功-跳转到支付成功页面)
};
};
export
default
new
Vuex
.
Store
({
export
default
new
Vuex
.
Store
({
...
...
src/views/index/camp/SignUp.vue
View file @
f0ddcdbf
...
@@ -275,10 +275,13 @@
...
@@ -275,10 +275,13 @@
this
.
type
=
"
examInfo
"
;
this
.
type
=
"
examInfo
"
;
}
else
if
(
this
.
status
==
1
)
{
}
else
if
(
this
.
status
==
1
)
{
// 是否填写邀请码
// 是否填写邀请码
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
;
}
}
...
...
src/views/index/camp/homework/refer.vue
View file @
f0ddcdbf
...
@@ -244,16 +244,8 @@
...
@@ -244,16 +244,8 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
import
{
delPic
,
downloadTeacherWork
,
getStudentWork
,
subStudentWork
}
from
"
r/index/homework
"
;
delPic
,
import
{
cosSignature
,
getSignature
}
from
"
r/index/cosUpload
"
;
downloadTeacherWork
,
getStudentWork
,
PostWorkStudentOss
,
subStudentWork
}
from
"
r/index/homework
"
;
import
{
getSignature
,
}
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
"
;
...
@@ -371,7 +363,7 @@
...
@@ -371,7 +363,7 @@
downloadStuFile
(
url
)
{
downloadStuFile
(
url
)
{
downloadTeacherWork
({
enclosure_url
:
url
}).
then
((
res
)
=>
{
downloadTeacherWork
({
enclosure_url
:
url
}).
then
((
res
)
=>
{
if
(
res
.
data
.
code
!=
200
)
{
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
url
=
res
.
data
.
url
;
let
reg
=
/^.+
(\.
pdf|
\.
txt|
\.
mp3|
\.
mp4
)
$/
;
let
reg
=
/^.+
(\.
pdf|
\.
txt|
\.
mp3|
\.
mp4
)
$/
;
...
@@ -387,7 +379,7 @@
...
@@ -387,7 +379,7 @@
downloadScoreFile
(
url
)
{
downloadScoreFile
(
url
)
{
downloadTeacherWork
({
enclosure_url
:
url
}).
then
((
res
)
=>
{
downloadTeacherWork
({
enclosure_url
:
url
}).
then
((
res
)
=>
{
if
(
res
.
data
.
code
!=
200
)
{
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
url
=
res
.
data
.
url
;
let
reg
=
/^.+
(\.
pdf|
\.
txt|
\.
mp3|
\.
mp4
)
$/
;
let
reg
=
/^.+
(\.
pdf|
\.
txt|
\.
mp3|
\.
mp4
)
$/
;
...
@@ -404,9 +396,9 @@
...
@@ -404,9 +396,9 @@
let
stu_work_num
=
this
.
work_nums
;
let
stu_work_num
=
this
.
work_nums
;
getStudentWork
({
teacher_id
:
stu_work_num
}).
then
((
res
)
=>
{
getStudentWork
({
teacher_id
:
stu_work_num
}).
then
((
res
)
=>
{
if
(
res
.
data
.
code
!=
200
)
{
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
)
{
if
(
student_status
==
1
)
{
// 学生已提交
// 学生已提交
this
.
formData
.
stu_answer
=
res
.
data
.
data
.
stu_answer
;
this
.
formData
.
stu_answer
=
res
.
data
.
data
.
stu_answer
;
...
@@ -457,7 +449,6 @@
...
@@ -457,7 +449,6 @@
}
}
this
.
$forceUpdate
();
//强制刷新
this
.
$forceUpdate
();
//强制刷新
}
}
});
});
},
},
// 成功确认取消,关闭弹框,修改父组件的值
// 成功确认取消,关闭弹框,修改父组件的值
...
@@ -519,11 +510,11 @@
...
@@ -519,11 +510,11 @@
// 必选参数
// 必选参数
getAuthorization
:
(
options
,
callback
)
=>
{
getAuthorization
:
(
options
,
callback
)
=>
{
callback
({
callback
({
TmpSecretId
:
resData
.
credentials
.
tmpSecretId
,
TmpSecretId
:
resData
.
credential
.
credential
s
.
tmpSecretId
,
TmpSecretKey
:
resData
.
credentials
.
tmpSecretKey
,
TmpSecretKey
:
resData
.
credential
.
credential
s
.
tmpSecretKey
,
XCosSecurityToken
:
resData
.
credentials
.
sessionToken
,
XCosSecurityToken
:
resData
.
credential
.
credential
s
.
sessionToken
,
StartTime
:
resData
.
startTime
,
// 时间戳,单位秒,如:1580000000
StartTime
:
resData
.
credential
.
startTime
,
// 时间戳,单位秒,如:1580000000
ExpiredTime
:
resData
.
expiredTime
,
// 时间戳,单位秒,如:1580000900
ExpiredTime
:
resData
.
credential
.
expiredTime
,
// 时间戳,单位秒,如:1580000900
});
});
},
},
});
});
...
@@ -545,12 +536,12 @@
...
@@ -545,12 +536,12 @@
this
.
$message
.
error
(
'
上传失败!
'
)
this
.
$message
.
error
(
'
上传失败!
'
)
}
else
{
}
else
{
console
.
log
(
data
);
console
.
log
(
data
);
this
.
signUploadSuccess
(
'
http://
'
+
data
.
Location
);
this
.
signUploadSuccess
(
'
http://
'
+
data
.
Location
,
image
);
}
}
}
}
);
);
}
else
{
}
else
{
this
.
$message
.
error
(
resData
.
m
essage
);
this
.
$message
.
error
(
resData
.
m
sg
);
}
}
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
...
@@ -559,86 +550,106 @@
...
@@ -559,86 +550,106 @@
});
});
},
},
// cos上传-告诉后端上传成功
// cos上传-告诉后端上传成功
async
signUploadSuccess
(
path
)
{
async
signUploadSuccess
(
path
,
image
)
{
await
getSignature
(
2
).
then
(
res
=>
{
await
cosSignature
({
image
:
image
,
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
.
loading
=
false
;
this
.
$message
.
success
(
'
上传成功!
'
);
this
.
$message
.
success
(
'
上传成功!
'
);
// this.selfInfo.picture_path = path + "?t=" + Date.parse(new Date());
this
.
$forceUpdate
();
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
=>
{
}).
catch
(
err
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
})
})
},
},
async
getOssConfigs
(
image
,
file
)
{
//
async getOssConfigs(image, file) {
let
obj
=
{
//
let obj = {
url
:
""
,
//
url: "",
savefile
:
""
,
//
savefile: "",
};
//
};
await
PostWorkStudentOss
({
//
await PostWorkStudentOss({
image
:
image
,
//
image: image,
teacher_id
:
this
.
work_nums
,
//
teacher_id: this.work_nums,
})
//
})
.
then
((
res
)
=>
{
//
.then((res) => {
if
(
res
.
data
.
code
===
200
)
{
//
if (res.data.code === 200) {
let
oss_url
=
res
.
data
.
config
.
host
;
//
let oss_url = res.data.config.host;
let
filename
=
res
.
data
.
config
.
file
;
//
let filename = res.data.config.file;
let
formData
=
new
FormData
();
//
let formData = new FormData();
formData
.
append
(
"
OSSAccessKeyId
"
,
res
.
data
.
config
.
accessid
);
//
formData.append("OSSAccessKeyId", res.data.config.accessid);
formData
.
append
(
"
policy
"
,
res
.
data
.
config
.
policy
);
//
formData.append("policy", res.data.config.policy);
formData
.
append
(
"
signature
"
,
res
.
data
.
config
.
signature
);
//
formData.append("signature", res.data.config.signature);
formData
.
append
(
"
filename
"
,
res
.
data
.
config
.
file
);
//
formData.append("filename", res.data.config.file);
formData
.
append
(
"
key
"
,
res
.
data
.
config
.
savefile
);
//
formData.append("key", res.data.config.savefile);
formData
.
append
(
"
callback
"
,
res
.
data
.
config
.
callback
);
//
formData.append("callback", res.data.config.callback);
formData
.
append
(
"
success_action_status
"
,
200
);
//
formData.append("success_action_status", 200);
formData
.
append
(
"
file
"
,
file
);
//
formData.append("file", file);
this
.
upload
(
oss_url
,
formData
)
//
this.upload(oss_url, formData)
.
then
((
ress
)
=>
{
//
.then((ress) => {
console
.
log
(
ress
,
"
ress
"
);
//
console.log(ress, "ress");
if
(
ress
.
data
.
code
!=
200
)
{
//
if (ress.data.code != 200) {
this
.
isUploading
=
false
;
//
this.isUploading = false;
return
this
.
$message
.
error
(
ress
.
data
.
message
);
//
return this.$message.error(ress.data.message);
}
//
}
this
.
resultPicture
=
filename
+
"
?t=
"
+
Date
.
parse
(
new
Date
());
//
this.resultPicture = filename + "?t=" + Date.parse(new Date());
this
.
$forceUpdate
();
//
this.$forceUpdate();
this
.
$message
.
success
(
"
上传成功
"
);
//
this.$message.success("上传成功");
obj
=
{
//
obj = {
url_open
:
ress
.
data
.
picture_path
,
//
url_open: ress.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);
this
.
fileList
.
push
(
obj
);
//
this.fileList.push(obj);
this
.
stu_fileListoss
=
this
.
stu_fileList
//
this.stu_fileListoss = this.stu_fileList
.
map
((
item
)
=>
{
//
.map((item) => {
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") +
code
,
//
code,
JSON
.
stringify
(
this
.
stu_fileListoss
)
//
JSON.stringify(this.stu_fileListoss)
);
//
);
this
.
isUploading
=
false
;
//
this.isUploading = false;
})
//
})
.
catch
((
err
)
=>
{
//
.catch((err) => {
this
.
isUploading
=
false
;
//
this.isUploading = false;
this
.
$message
.
error
(
err
);
//
this.$message.error(err);
});
//
});
}
else
{
//
} else {
this
.
isUploading
=
false
;
//
this.isUploading = false;
this
.
$message
.
error
(
res
.
data
.
message
);
//
this.$message.error(res.data.message);
}
//
}
})
//
})
.
catch
((
err
)
=>
{
//
.catch((err) => {
this
.
isUploading
=
false
;
//
this.isUploading = false;
});
//
});
},
//
},
// 下载证明资料图片
// 下载证明资料图片
handleDownload
(
file
)
{
handleDownload
(
file
)
{
// console.log(file,'file22');
// console.log(file,'file22');
...
@@ -664,7 +675,7 @@
...
@@ -664,7 +675,7 @@
delPic
({
object
:
savefile
,
teacher_id
:
stu_work_num
}).
then
((
res
)
=>
{
delPic
({
object
:
savefile
,
teacher_id
:
stu_work_num
}).
then
((
res
)
=>
{
// console.log(res, "delpic");
// console.log(res, "delpic");
if
(
res
.
data
.
code
!=
200
)
{
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
)
=>
{
this
.
stu_fileList
.
forEach
((
item
,
idx
)
=>
{
if
(
item
.
url_open
==
file
.
url_open
)
{
if
(
item
.
url_open
==
file
.
url_open
)
{
...
@@ -677,9 +688,7 @@
...
@@ -677,9 +688,7 @@
return
item
.
url
;
return
item
.
url
;
})
})
.
join
(
"
,
"
);
.
join
(
"
,
"
);
console
.
log
(
this
.
stu_fileListoss
);
this
.
$message
.
success
(
res
.
data
.
msg
);
console
.
log
(
this
.
stu_fileList
);
this
.
$message
.
success
(
res
.
data
.
message
);
window
.
localStorage
.
setItem
(
"
student_file_
"
+
window
.
localStorage
.
setItem
(
"
student_file_
"
+
window
.
localStorage
.
getItem
(
"
index-phone-all
"
)
+
window
.
localStorage
.
getItem
(
"
index-phone-all
"
)
+
code
,
code
,
...
@@ -688,8 +697,6 @@
...
@@ -688,8 +697,6 @@
}
}
});
});
});
});
console
.
log
(
this
.
stu_fileListoss
);
console
.
log
(
this
.
stu_fileList
);
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
// console.log(err, "err");
// console.log(err, "err");
...
@@ -701,14 +708,9 @@
...
@@ -701,14 +708,9 @@
},
},
// 查看已上传的学生作业
// 查看已上传的学生作业
handleCheck
(
url
)
{
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
)
{
if
(
url
.
match
(
/
\.(
jpeg|jpg|gif|png
)
$/
)
!=
null
)
{
this
.
dialogVisibleImage
=
true
;
this
.
dialogVisibleImage
=
true
;
console
.
log
(
url
.
split
(
"
"
),
'
111
'
)
// this.srcList = url.split(" ");
this
.
srcList_url_open
=
url
this
.
srcList_url_open
=
url
this
.
srcList
=
this
.
stu_fileList
.
map
((
item
)
=>
{
this
.
srcList
=
this
.
stu_fileList
.
map
((
item
)
=>
{
return
item
.
url_open
return
item
.
url_open
...
@@ -761,12 +763,12 @@
...
@@ -761,12 +763,12 @@
//作业无修改
//作业无修改
if
(
response
.
data
.
code
==
4000343
)
{
if
(
response
.
data
.
code
==
4000343
)
{
this
.
cancelBtn
()
this
.
cancelBtn
()
return
this
.
$message
.
error
(
response
.
data
.
m
essage
);
return
this
.
$message
.
error
(
response
.
data
.
m
sg
);
}
}
if
(
response
.
data
.
code
!=
200
)
{
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
();
this
.
cancelBtnTrue
();
})
})
.
catch
((
error
)
=>
{
.
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