Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thinkApp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
游洁
thinkApp
Commits
d1b3d592
Commit
d1b3d592
authored
May 30, 2022
by
罗超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/youjie/thinkapp
parents
976e2a75
eb72d8bd
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
302 additions
and
125 deletions
+302
-125
JobComponents.vue
src/components/index/JobComponents.vue
+1
-1
course-card.vue
src/components/index/course-card.vue
+8
-0
courseCard.vue
src/components/index/workSituation/courseCard.vue
+2
-0
examList.vue
src/components/index/workSituation/examList.vue
+119
-21
operation.vue
src/components/index/workSituation/operation.vue
+12
-17
studentList.vue
src/components/index/workSituation/studentList.vue
+6
-39
loadmore.vue
src/components/loadmore.vue
+3
-1
workSituation.vue
src/pages/index/workSituation.vue
+130
-7
common.css
src/static/css/common.css
+0
-5
index.js
src/utils/index.js
+21
-34
No files found.
src/components/index/JobComponents.vue
View file @
d1b3d592
...
...
@@ -67,7 +67,7 @@
let
methods
=
{
JobDetails
()
{
uni
.
reLaunch
({
url
:
'/pages/index/
workSituation
?tabNme='
+
'作业情况'
url
:
'/pages/index/
jobDetails
?tabNme='
+
'作业情况'
});
}
}
...
...
src/components/index/course-card.vue
View file @
d1b3d592
...
...
@@ -93,6 +93,12 @@
this
.
$parent
.
getStuHomeWorkAndExam
(
item
.
courseId
);
this
.
currentCourse
=
item
;
data
.
showItems
=
false
setTimeout
(()
=>
{
uni
.
reLaunch
({
url
:
'/pages/index/workSituation?tabNme='
+
'作业情况'
+
'&courseId='
+
item
.
courseId
});
},
500
)
},
//计算完成百分比
calcPercentage
(
item
)
{
...
...
@@ -160,6 +166,8 @@
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
margin-bottom
:
20
rpx
;
height
:
80
rpx
;
overflow
:
hidden
;
}
.course-card
.course-item
.course-progress
{
...
...
src/components/index/workSituation/courseCard.vue
View file @
d1b3d592
...
...
@@ -278,6 +278,8 @@
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
margin-bottom
:
20
rpx
;
height
:
80
rpx
;
overflow
:
hidden
;
}
.course-card
.course-item
.course-progress
{
...
...
src/components/index/workSituation/examList.vue
View file @
d1b3d592
...
...
@@ -4,28 +4,28 @@
<van-icon
name=
"plus"
/>
<text>
导入考试信息
</text>
</view>
<view
class=
"examList activeOne"
>
<view
class=
"examList-center-box"
@
click=
"examDetails"
>
<view
class=
"examList activeOne"
v-for=
"(item,index) in dataList"
:key=
"index"
>
<view
class=
"examList-center-box"
@
click=
"examDetails
(item.ExamId)
"
>
<view
class=
"examList-center-line"
></view>
<view
class=
"examList-center flex"
>
<view
class=
"examList-left"
>
<view
class=
"examList-name"
>
化学高考第一次测试
</view>
<view
class=
"examList-name"
>
{{
item
.
ExamName
}}
</view>
<view
class=
"examList-state flex"
>
<van-icon
name=
"clock-o"
/>
<view
class=
"examList-state-text"
>
2022-05-25
</view>
<view
class=
"examList-state-text"
>
{{
item
.
CreateTime
}}
</view>
</view>
</view>
<view
class=
"examList-right flex"
>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
人数
</view>
<view
class=
"homework-score-num flex"
>
86
{{
item
.
StuNum
}}
</view>
</view>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
平均得分
</view>
<view
class=
"homework-score-num flex"
>
86
{{
item
.
AvgScore
}}
</view>
</view>
</view>
...
...
@@ -38,24 +38,31 @@
</view>
</view>
<view
class=
"examList-hint-right"
>
<view>
重新导入
</view>
<view
@
click=
"clickReimport(item)"
>
重新导入
</view>
</view>
</view>
</view>
</view>
<!--
<view
class=
"noData"
>
暂无数据
</view>
-->
<van-popup
:show=
"show"
:round=
"true"
>
<view
class=
"examList-popup-box"
>
<van-icon
class=
"examList-popup-closure"
name=
"cross"
@
click=
"show=false"
/>
<view
class=
"examList-popup-title"
>
导入考试信息
</view>
<view
class=
"examList-popup-content"
>
<input
v-model=
"obj.name"
class=
"examList-popup-name"
placeholder=
"请输入考试名称"
>
<view
class=
"examList-popup-fil"
@
click=
"uploadFiles"
>
<van-image
class=
"img"
width=
"32rpx"
height=
"32rpx"
fit=
"cover"
<van-uploader
class=
"examList-popup-fil-box flex"
multiple
accept=
".excel"
preview-size=
"120rpx"
@
after-read=
"customUpload"
>
<view
class=
"examList-popup-fil"
>
<van-image
class=
"img"
width=
"32rpx"
height=
"32rpx"
fit=
"cover"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653639041000_305.png"
/>
选择文件
选择文件
</view>
</van-uploader>
</view>
</view>
</van-popup>
...
...
@@ -69,41 +76,128 @@
getCurrentInstance
,
inject
}
from
"vue"
;
import
{
uploadFile
}
from
"@/utils/index"
;
export
default
{
props
:
{
dataList
:[]
},
components
:
{},
setup
()
{
setup
(
props
)
{
let
{
proxy
}
=
getCurrentInstance
();
let
data
=
reactive
({
obj
:
{
Name
:
''
,
Photo
:
''
,
},
showPhone
:
false
,
showLogin
:
tru
e
,
//多次点击
showLogin
:
fals
e
,
//多次点击
show
:
false
,
params
:{
Uid
:
''
,
CourseId
:
''
,
ExamName
:
''
},
fileList
:[],
Msg
:{
PageIndex
:
1
,
PageSize
:
10
,
ExamName
:
''
},
dataList
:
props
.
dataList
});
let
methods
=
{
examDetails
(){
examDetails
(
item
){
uni
.
reLaunch
({
url
:
'/pages/index/examDetails
'
url
:
'/pages/index/examDetails
?examId='
+
item
});
},
//获取考试信息列表
getExamPageList
(){
proxy
.
$request
(
"/Exam/GetExamPageList"
,
data
.
Msg
).
then
(
res
=>
{
data
.
dataList
=
res
.
Data
;
})
},
ImportInformation
(){
this
.
show
=
true
},
uploadFilesBefore
(){
},
uploadFiles
(){
// 重新导入
clickReimport
(
item
){
},
// 添加导入
customUpload
(
event
){
let
host
=
''
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
host
=
'http://192.168.10.36:8082/api'
}
else
{
host
=
'https://eduapi.oytour.com/api'
}
const
{
file
}
=
event
.
detail
;
if
(
file
[
0
].
url
.
indexOf
(
'xls'
)
==-
1
||
file
[
0
].
url
.
indexOf
(
'xlsx'
)
==-
1
){
uni
.
showToast
({
title
:
'请上传xls、xlsx格式的文件'
,
icon
:
'none'
,
duration
:
500
})
return
}
let
params
=
{
// Uid: data.params.Uid,
// CourseId: data.params.CourseId,
// ExamName: data.params.ExamName,
Uid
:
1
,
CourseId
:
1
,
ExamName
:
''
,
}
uni
.
uploadFile
({
url
:
host
+
'/Upload/UploadStuExamScore'
,
filePath
:
file
[
0
].
url
,
name
:
'file'
,
formData
:
{
'myfile'
:
file
[
0
],
'params'
:
JSON
.
stringify
(
params
)
},
success
(
res
)
{
uni
.
hideLoading
();
uni
.
showToast
({
title
:
res
.
Message
,
icon
:
'none'
,
duration
:
500
})
},
fail
(
err
)
{
console
.
log
(
"uploadErr"
,
err
)
}
});
// uploadFile(params, file, (res) => {
// uni.showModal({
// title:res.Message
// })
// });
// return
}
}
};
let
that
=
methods
;
return
{
...
toRefs
(
data
),
...
methods
};
},
onLoad
(){
},
onShow
()
{
}
};
</
script
>
<
style
scoped
>
...
...
@@ -148,8 +242,12 @@
margin-right
:
10
rpx
;
}
.examList-popup-fil
{
}
.examList-popup-fil-box
{
display
:
flex
;
line-height
:
88
rpx
;
padding
:
0
1
0
rpx
;
padding
:
0
1
97
rpx
;
border-radius
:
44
rpx
;
font-size
:
30
rpx
;
color
:
#FFFFFF
;
...
...
src/components/index/workSituation/operation.vue
View file @
d1b3d592
<
template
>
<view
class=
"operation-box"
>
<view
class=
"operation activeOne"
>
<view
class=
"operation activeOne"
v-for=
"(item,index) in dataList"
:key=
"index"
>
<view
class=
"operation-center-box"
@
click=
"JobDetails"
>
<view
class=
"operation-center-line"
></view>
<view
class=
"operation-center flex"
>
<view
class=
"operation-left"
>
<view
class=
"operation-name"
>
高一作业
</view>
<view
class=
"operation-name"
>
{{
item
.
HomeWorkTitle
}}
</view>
<view
class=
"operation-state flex"
>
<view
class=
"operation-state-point"
></view>
<view
class=
"operation-state-text"
>
进行中
</view>
<view
class=
"operation-state-text"
>
{{
item
.
Status
==
0
?
'未开始'
:(
item
.
Status
==
1
?
'进行中'
:
'已结束'
)
}}
</view>
</view>
</view>
<view
class=
"operation-right flex"
>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
学生数
</view>
<view
class=
"homework-score-num flex"
>
86
{{
item
.
StuNum
}}
</view>
</view>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
已提交
</view>
<view
class=
"homework-score-num flex"
>
86
{{
item
.
SubmitNum
}}
</view>
</view>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
已批阅
</view>
<view
class=
"homework-score-num flex"
>
86
{{
item
.
ReviewNum
}}
</view>
</view>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
优 秀
</view>
<view
class=
"homework-score-num flex"
>
66
{{
item
.
ExcellentNum
}}
</view>
</view>
</view>
</view>
</view>
<!--
<view
class=
"noData"
>
暂无数据
</view>
-->
</view>
</view>
</
template
>
...
...
@@ -54,18 +54,13 @@
export
default
{
props
:
{
dataList
:[]
},
components
:
{},
setup
()
{
setup
(
props
)
{
let
data
=
reactive
({
obj
:
{
Name
:
''
,
Photo
:
''
,
},
showPhone
:
false
,
showLogin
:
true
,
//多次点击
dataList
:
props
.
dataList
});
let
methods
=
{
JobDetails
(){
...
...
@@ -78,7 +73,7 @@
...
toRefs
(
data
),
...
methods
};
}
,
}
};
</
script
>
<
style
scoped
>
...
...
src/components/index/workSituation/studentList.vue
View file @
d1b3d592
<
template
>
<view
class=
"studentList-box flex"
>
<view
class=
"studentList-content"
>
<view
class=
"studentList-content"
v-for=
"(item,index) in dataList"
:key=
"index"
>
<view
class=
"studentList flex"
>
<view
class=
"studentList-img"
>
<van-image
width=
"100%"
height=
"100%"
fit=
"cover"
class=
"img"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653
464014000_713
.png"
/>
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653
894192000_645
.png"
/>
</view>
<text>
周杰伦
{{
item
.
StuName
}}
</text>
</view>
</view>
<view
class=
"studentList-content"
>
<view
class=
"studentList flex"
>
<view
class=
"studentList-img"
>
<van-image
width=
"100%"
height=
"100%"
fit=
"cover"
class=
"img"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_713.png"
/>
</view>
<text>
周杰伦
</text>
</view>
</view>
<view
class=
"studentList-content"
>
<view
class=
"studentList flex"
>
<view
class=
"studentList-img"
>
<van-image
width=
"100%"
height=
"100%"
fit=
"cover"
class=
"img"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_713.png"
/>
</view>
<text>
周杰伦
</text>
</view>
</view>
<view
class=
"studentList-content"
>
<view
class=
"studentList flex"
>
<view
class=
"studentList-img"
>
<van-image
width=
"100%"
height=
"100%"
fit=
"cover"
class=
"img"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_713.png"
/>
</view>
<text>
周杰伦
</text>
</view>
</view>
<!--
<view
class=
"noData"
>
暂无数据
</view>
-->
</view>
</
template
>
<
script
>
...
...
@@ -58,10 +24,10 @@
export
default
{
props
:
{
dataList
:
[]
},
components
:
{},
setup
()
{
setup
(
props
)
{
let
data
=
reactive
({
obj
:
{
...
...
@@ -70,6 +36,7 @@
},
showPhone
:
false
,
showLogin
:
true
,
//多次点击
dataList
:
props
.
dataList
});
let
methods
=
{
JobDetails
(){
...
...
src/components/loadmore.vue
View file @
d1b3d592
...
...
@@ -20,7 +20,9 @@ export default {
},
components
:
{},
setup
(
props
)
{
let
data
=
reactive
({});
let
data
=
reactive
({
state
:
props
.
state
});
let
methods
=
{
jumpPage
(
url
)
{
uni
.
navigateTo
({
...
...
src/pages/index/workSituation.vue
View file @
d1b3d592
<
template
>
<view
class=
"workSituationpage"
>
<navbar
class=
"navbarSticky"
bg=
"#F6F6F6"
>
<view
class=
"index-header-box"
>
<view
class=
"index-header-box"
@
click=
"back"
>
<view
class=
"index-header-img"
>
<van-image
width=
"100%"
height=
"100%"
fit=
"cover"
class=
"img"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_713.png"
/>
...
...
@@ -35,14 +35,25 @@
</view>
</view>
</view>
<operation
v-if=
"tabNme=='作业情况'"
></operation>
<studentList
v-if=
"tabNme=='学生列表'"
></studentList>
<examList
v-if=
"tabNme=='考试信息'"
></examList>
<van-empty
description=
"暂无数据"
v-if=
"dataList.length === 0"
/>
<scroll-view
:scroll-top=
"0"
scroll-y=
"true"
class=
"scroll-box"
@
scrolltolower=
"lower"
v-if=
"dataList.length > 0"
>
<operation
v-if=
"tabNme=='作业情况'"
:dataList=
"dataList"
></operation>
<studentList
v-if=
"tabNme=='学生列表'"
:dataList=
"dataList"
></studentList>
<examList
v-if=
"tabNme=='考试信息'"
:dataList=
"dataList"
></examList>
<Loadmore
:state=
"pageState"
/>
</scroll-view>
</view>
</view>
</
template
>
<
script
>
import
Loadmore
from
"@/components/loadmore.vue"
;
import
courseCard
from
'@/components/index/workSituation/courseCard'
import
operation
from
'@/components/index/workSituation/operation'
import
studentList
from
'@/components/index/workSituation/studentList'
...
...
@@ -75,7 +86,8 @@
courseCard
,
operation
,
studentList
,
examList
examList
,
Loadmore
},
setup
(
props
)
{
let
{
...
...
@@ -87,7 +99,20 @@
{
name
:
'作业情况'
,
num
:
5
},
{
name
:
'考试信息'
,
num
:
18
},
],
tabNme
:
'考试信息'
tabNme
:
'作业情况'
,
Msg
:{
PageIndex
:
1
,
PageSize
:
10
,
ExamName
:
''
,
courseId
:
''
},
OperationMsg
:{
courseId
:
''
},
pageCount
:
0
,
timer
:
null
,
//防抖
dataList
:[],
pageState
:
"more"
});
let
methods
=
{
...
...
@@ -98,12 +123,101 @@
},
toggleTitle
(
t
)
{
data
.
tabNme
=
t
}
if
(
this
.
tabNme
==
'学生列表'
){
that
.
getCourseStuList
()
}
else
if
(
this
.
tabNme
==
'作业情况'
){
that
.
getGetCourseHomeWorkList
()
}
else
{
that
.
getExamPageList
()
}
},
//获取学生列表
getCourseStuList
(){
proxy
.
$request
(
"/Teacher/GetCourseStu"
,
data
.
OperationMsg
).
then
(
res
=>
{
if
(
res
){
data
.
dataList
=
res
.
Data
;
data
.
pageState
=
"none"
;
return
if
(
data
.
timer
)
data
.
timer
=
null
;
if
(
data
.
Msg
.
PageIndex
===
1
)
{
data
.
dataList
=
res
.
Data
.
PageData
;
}
else
{
data
.
dataList
=
[...
res
.
Data
.
PageData
,
...
data
.
dataList
];
}
data
.
pageCount
=
res
.
Data
.
PageCount
;
if
(
data
.
Msg
.
PageIndex
>=
res
.
Data
.
PageCount
)
{
data
.
pageState
=
"none"
;
}
else
{
data
.
pageState
=
"more"
;
}
}
})
},
//获取作业情况列表
getGetCourseHomeWorkList
(){
proxy
.
$request
(
"/Teacher/GetCourseHomeWork"
,
data
.
OperationMsg
).
then
(
res
=>
{
if
(
res
){
data
.
dataList
=
res
.
Data
;
data
.
pageState
=
"none"
;
return
if
(
data
.
timer
)
data
.
timer
=
null
;
if
(
data
.
Msg
.
PageIndex
===
1
)
{
data
.
dataList
=
res
.
Data
.
PageData
;
}
else
{
data
.
dataList
=
[...
res
.
Data
.
PageData
,
...
data
.
dataList
];
}
data
.
pageCount
=
res
.
Data
.
PageCount
;
if
(
data
.
Msg
.
PageIndex
>=
res
.
Data
.
PageCount
)
{
data
.
pageState
=
"none"
;
}
else
{
data
.
pageState
=
"more"
;
}
}
})
},
//获取考试信息列表
getExamPageList
(){
proxy
.
$request
(
"/Exam/GetExamPageList"
,
data
.
Msg
).
then
(
res
=>
{
if
(
res
){
if
(
data
.
timer
)
data
.
timer
=
null
;
if
(
data
.
Msg
.
PageIndex
===
1
)
{
data
.
dataList
=
res
.
Data
.
PageData
;
}
else
{
data
.
dataList
=
[...
res
.
Data
.
PageData
,
...
data
.
dataList
];
}
data
.
pageCount
=
res
.
Data
.
PageCount
;
if
(
data
.
Msg
.
PageIndex
>=
res
.
Data
.
PageCount
)
{
data
.
pageState
=
"none"
;
}
else
{
data
.
pageState
=
"more"
;
}
}
})
},
lower
(
e
)
{
if
(
data
.
Msg
.
PageIndex
<
data
.
pageCount
)
{
data
.
pageState
=
"loading"
;
data
.
Msg
.
PageIndex
++
;
if
(
data
.
timer
)
clearTimeout
(
data
.
timer
);
data
.
timer
=
setTimeout
(()
=>
{
if
(
this
.
tabNme
==
'学生列表'
){
this
.
getCourseStuList
()
}
else
if
(
this
.
tabNme
==
'作业情况'
){
this
.
getGetCourseHomeWorkList
()
}
else
{
this
.
getExamPageList
()
}
},
1000
);
}
else
{
data
.
pageState
=
"none"
;
}
},
};
onMounted
(()
=>
{
});
let
that
=
methods
;
return
{
...
toRefs
(
data
),
...
methods
,
...
...
@@ -111,9 +225,18 @@
},
onLoad
(
option
)
{
this
.
tabNme
=
option
.
tabNme
this
.
OperationMsg
.
courseId
=
option
.
courseId
this
.
Msg
.
courseId
=
option
.
courseId
},
onShow
()
{
this
.
userData
=
uni
.
getStorageSync
(
'userInfo'
);
if
(
this
.
tabNme
==
'学生列表'
){
this
.
getCourseStuList
()
}
else
if
(
this
.
tabNme
==
'作业情况'
){
this
.
getGetCourseHomeWorkList
()
}
else
{
this
.
getExamPageList
()
}
},
onShareAppMessage
()
{
return
{
...
...
src/static/css/common.css
View file @
d1b3d592
...
...
@@ -121,9 +121,4 @@
left
:
50vw
;
transform
:
translate
(
-50%
,
-50%
);
z-index
:
999
;
}
.noData
{
font-size
:
26
rpx
;
text-align
:
center
;
padding
:
50
rpx
;
}
\ No newline at end of file
src/utils/index.js
View file @
d1b3d592
...
...
@@ -8,9 +8,9 @@ export let desensitization = (str, beginLen, endLen) => {
return
tempStr
;
}
export
let
uploadFile
=
(
pa
th
,
file
,
successCallback
)
=>
{
export
let
uploadFile
=
(
pa
rams
,
file
,
successCallback
)
=>
{
for
(
let
i
=
0
;
i
<
file
.
length
;
i
++
)
{
UploadSelfFile
(
path
,
file
[
i
],
successCallback
)
UploadSelfFile
(
JSON
.
stringify
(
params
),
file
[
i
],
successCallback
)
}
}
...
...
@@ -31,23 +31,18 @@ export let urlTobase64 = (file, suc) => {
/**
* 上传文件
*/
export
function
UploadSelfFile
(
path
,
file
,
callback
,
configObj
)
{
//用户登录缓存
var
cacheInfo
=
uni
.
getStorageSync
(
"userInfo"
)
//上传配置
var
uploadConfig
=
""
;
if
(
cacheInfo
&&
cacheInfo
.
UploadConfig
)
{
uploadConfig
=
cacheInfo
.
UploadConfig
;
export
function
UploadSelfFile
(
params
,
file
,
callback
,
configObj
)
{
if
(
file
.
url
.
indexOf
(
'xls'
)
==-
1
&&
file
.
url
.
indexOf
(
'xlsx'
)
==-
1
){
uni
.
showModal
({
title
:
'请上传xls、xlsx格式的文件'
})
return
}
//获取文件扩展名
var
index
=
file
.
url
.
lastIndexOf
(
"."
);
var
suffix
=
file
.
url
.
substr
(
index
);
var
timestamp1
=
Date
.
parse
(
new
Date
())
+
"_"
+
(
Math
.
ceil
(
Math
.
random
()
*
1000
));
let
str
=
'/Test'
;
var
newPath
=
"/EduSystem"
+
str
+
'/Upload/'
+
path
;
uni
.
showLoading
({
title
:
'文件上传中...'
});
UploadFileToSystem
(
params
,
file
,
callback
,
configObj
);
return
if
(
uploadConfig
)
{
switch
(
uploadConfig
.
StoreType
)
{
//上传文件到腾讯云
...
...
@@ -71,35 +66,27 @@ export function UploadSelfFile(path, file, callback, configObj) {
/**
* 上传文件到本地文件系统
*/
export
function
UploadFileToSystem
(
uploadConfig
,
fileFullPath
,
fileObj
,
successCall
,
configObj
)
{
let
url
=
uploadConfig
.
UploadDomain
+
"/Upload?filePath="
+
fileFullPath
;
if
(
configObj
)
{
//是否转换图片
if
(
configObj
.
isTrans
&&
configObj
.
isTrans
==
1
)
{
url
+=
"&isTrans=1"
}
if
(
configObj
.
isCreateCover
&&
configObj
.
isCreateCover
==
1
)
{
url
+=
"&isCreateCover=1"
}
export
function
UploadFileToSystem
(
paramsObj
,
fileObj
,
successCall
,
configObj
)
{
console
.
log
(
paramsObj
,
'-----paramsObj'
)
let
host
=
''
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
host
=
'http://192.168.10.36:8082/api'
}
else
{
host
=
'https://eduapi.oytour.com/api'
}
uni
.
uploadFile
({
url
:
url
,
url
:
host
+
'/Upload/UploadStuExamScore'
,
filePath
:
fileObj
.
url
,
name
:
'file'
,
formData
:
{
'myfile'
:
fileObj
'myfile'
:
fileObj
,
params
:
paramsObj
},
success
(
res
)
{
uni
.
hideLoading
();
let
jsonObj
=
JSON
.
parse
(
res
.
data
)
let
index
=
jsonObj
.
FilePath
.
indexOf
(
"."
)
let
suffix
=
jsonObj
.
FilePath
.
slice
(
index
+
1
)
let
uploadResult
=
{
name
:
fileObj
.
name
,
url
:
uploadConfig
.
CustomDomain
+
'/'
+
jsonObj
.
FilePath
,
type
:
fileObj
.
type
,
suffix
:
suffix
,
// VideoCoverImg: uploadConfig.CustomDomain + jsonObj.VideoCoverImg,
Message
:
jsonObj
.
Message
}
successCall
(
uploadResult
);
},
...
...
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