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
4aca0cfa
Commit
4aca0cfa
authored
May 27, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面, 修改
parent
2e197983
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
272 deletions
+91
-272
course-card.vue
src/components/index/course-card.vue
+78
-134
index.vue
src/pages/index/index.vue
+13
-138
No files found.
src/components/index/course-card.vue
View file @
4aca0cfa
...
...
@@ -3,132 +3,65 @@
<view
class=
"course-item"
>
<view
style=
"width:287rpx;"
>
<view
class=
"course-name"
>
成都2022科学益智L4-05乐思会
{{
stuCourseList
[
0
].
CourseName
}}
</view>
<van-progress
percentage=
"75"
:show-pivot=
"false"
track-color=
"#EFEFEF"
color=
"#282828"
stroke-width=
"5"
/>
<van-progress
percentage=
"75"
:show-pivot=
"false"
track-color=
"#EFEFEF"
color=
"#282828"
stroke-width=
"5"
/>
<view
class=
"course-progress"
>
上课进度
5/12
上课进度
{{
stuCourseList
[
0
].
CompleteNum
}}
/
{{
stuCourseList
[
0
].
TotalClassNum
}}
</view>
<view
class=
"course-opera"
>
<van-button
@
click=
"exchangeItemHandler"
class-prefix=
"iconfont"
icon=
" icon-qiehuan1"
round
type=
"default"
size=
"mini"
custom-style=
"color:#E23B4A;font-size: 24rpx;padding-left:10rpx;padding-right:10px;"
>
切换课程
custom-style=
"color:#E23B4A;font-size: 24rpx;padding-left:10rpx;padding-right:10px;"
>
切换课程
</van-button>
</view>
</view>
<image
class=
"illustration"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_494.png"
mode=
"widthFix"
></image>
<template
v-if=
"stuCourseList[0].CoverImg"
>
<image
class=
"illustration"
:src=
"stuCourseList[0].CoverImg"
mode=
"widthFix"
></image>
</
template
>
<
template
v-else
>
<image
class=
"illustration"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_494.png"
mode=
"widthFix"
></image>
</
template
>
</view>
<image
class=
"end"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_413.png"
mode=
"widthFix"
></image>
<van-popup
:show=
"showItems"
round
position=
"bottom"
@
click-overlay=
"hideExchangeBoxHandler"
custom-style=
"height: 60%"
>
<image
class=
"end"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_413.png"
mode=
"widthFix"
></image>
<van-popup
:show=
"showItems"
round
position=
"bottom"
@
click-overlay=
"hideExchangeBoxHandler"
custom-style=
"height: 60%"
>
<view
class=
"exchange-items"
>
<view
class=
"title-box"
>
<text
class=
"main-title"
>
课程选择
</text>
<text
class=
"sub-title"
>
(共有
3
门课程)
</text>
<text
class=
"sub-title"
>
(共有
{{stuCourseList.length}}
门课程)
</text>
</view>
<view
class=
"items"
>
<view
class=
"item-course"
>
<view
class=
"course-pic"
>
<image
src=
"https://www.kfzimg.com/G06/M00/B5/48/p4YBAFsJY12AK0n7AAEM2KDUHRw535_n.jpg"
mode=
"aspectFill"
></image>
</view>
<view
class=
"content"
>
<view
class=
"one_line course-name"
>
高中物理鸿志班(二期周五下午上课)
</view>
<van-progress
percentage=
"46"
:show-pivot=
"false"
track-color=
"#EFEFEF"
color=
"#282828"
stroke-width=
"5"
/>
<view
class=
"course-progress"
>
上课进度 5/12
</view>
<view
style=
"text-align: right;"
>
<van-button
@
click=
"hideExchangeBoxHandler"
color=
"#C91727"
round
size=
"mini"
custom-style=
"color:#FFF;font-size: 24rpx;padding-left:16rpx;padding-right:10px;"
>
选择课程
</van-button>
</view>
</view>
</view>
<view
class=
"item-course"
>
<view
class=
"course-pic"
>
<image
src=
"https://www.kfzimg.com/G06/M00/B5/48/p4YBAFsJY12AK0n7AAEM2KDUHRw535_n.jpg"
mode=
"aspectFill"
></image>
</view>
<view
class=
"content"
>
<view
class=
"one_line course-name"
>
高中物理鸿志班(二期周五下午上课)
</view>
<van-progress
percentage=
"46"
:show-pivot=
"false"
track-color=
"#EFEFEF"
color=
"#282828"
stroke-width=
"5"
/>
<view
class=
"course-progress"
>
上课进度 5/12
</view>
<view
style=
"text-align: right;"
>
<van-button
@
click=
"hideExchangeBoxHandler"
color=
"#C91727"
round
size=
"mini"
custom-style=
"color:#FFF;font-size: 24rpx;padding-left:16rpx;padding-right:10px;"
>
选择课程
</van-button>
</view>
</view>
</view>
<view
class=
"item-course"
>
<view
class=
"course-pic"
>
<image
src=
"https://www.kfzimg.com/G06/M00/B5/48/p4YBAFsJY12AK0n7AAEM2KDUHRw535_n.jpg"
mode=
"aspectFill"
></image>
</view>
<view
class=
"content"
>
<view
class=
"one_line course-name"
>
高中物理鸿志班(二期周五下午上课)
</view>
<van-progress
percentage=
"46"
:show-pivot=
"false"
track-color=
"#EFEFEF"
color=
"#282828"
stroke-width=
"5"
/>
<view
class=
"course-progress"
>
上课进度 5/12
</view>
<view
style=
"text-align: right;"
>
<van-button
@
click=
"hideExchangeBoxHandler"
color=
"#C91727"
round
size=
"mini"
custom-style=
"color:#FFF;font-size: 24rpx;padding-left:16rpx;padding-right:10px;"
>
选择课程
</van-button>
</view>
</view>
</view>
<view
class=
"item-course"
>
<view
class=
"course-pic"
>
<image
src=
"https://www.kfzimg.com/G06/M00/B5/48/p4YBAFsJY12AK0n7AAEM2KDUHRw535_n.jpg"
mode=
"aspectFill"
></image>
</view>
<view
class=
"content"
>
<view
class=
"one_line course-name"
>
高中物理鸿志班(二期周五下午上课)
</view>
<van-progress
percentage=
"46"
:show-pivot=
"false"
track-color=
"#EFEFEF"
color=
"#282828"
stroke-width=
"5"
/>
<view
class=
"course-progress"
>
上课进度 5/12
<
template
v-for=
"(item,index) in stuCourseList"
>
<view
class=
"item-course"
>
<view
class=
"course-pic"
>
<image
v-if=
"item.CoverImg"
:src=
"item.CoverImg"
mode=
"aspectFill"
></image>
<image
v-else
src=
"https://www.kfzimg.com/G06/M00/B5/48/p4YBAFsJY12AK0n7AAEM2KDUHRw535_n.jpg"
mode=
"aspectFill"
></image>
</view>
<view
style=
"text-align: right;"
>
<van-button
@
click=
"hideExchangeBoxHandler"
color=
"#C91727"
round
size=
"mini"
custom-style=
"color:#FFF;font-size: 24rpx;padding-left:16rpx;padding-right:10px;"
>
选择课程
</van-button>
<view
class=
"content"
>
<view
class=
"one_line course-name"
>
{{
item
.
CourseName
}}
</view>
<van-progress
percentage=
"46"
:show-pivot=
"false"
track-color=
"#EFEFEF"
color=
"#282828"
stroke-width=
"5"
/>
<view
class=
"course-progress"
>
上课进度
{{
item
.
CompleteNum
}}
/
{{
item
.
TotalClassNum
}}
</view>
<view
style=
"text-align: right;"
>
<van-button
@
click=
"hideExchangeBoxHandler"
color=
"#C91727"
round
size=
"mini"
custom-style=
"color:#FFF;font-size: 24rpx;padding-left:16rpx;padding-right:10px;"
>
选择课程
</van-button>
</view>
</view>
</view>
</
view
>
</
template
>
</view>
</view>
</van-popup>
</view>
</template>
<
script
>
...
...
@@ -143,18 +76,18 @@
onMounted
,
}
from
"vue"
;
export
default
{
props
:
{}
,
setup
()
{
props
:
[
"stuCourseList"
]
,
setup
(
props
,
context
)
{
let
data
=
reactive
({
statusBarHeight
:
24
,
showItems
:
false
showItems
:
false
});
let
methods
=
{
exchangeItemHandler
(){
data
.
showItems
=
true
let
methods
=
{
exchangeItemHandler
()
{
data
.
showItems
=
true
},
hideExchangeBoxHandler
(){
data
.
showItems
=
false
hideExchangeBoxHandler
()
{
data
.
showItems
=
false
}
}
return
{
...
...
@@ -215,8 +148,9 @@
.course-card
.course-item
.course-opera
{
margin-top
:
20
rpx
;
}
.course-card
.exchange-items
{
padding
:
50
rpx
0
;
.course-card
.exchange-items
{
padding
:
50
rpx
0
;
padding-bottom
:
0
;
height
:
100%
;
box-sizing
:
border-box
;
...
...
@@ -224,59 +158,69 @@
flex-direction
:
column
;
background
:
#F6F6F6
;
}
.course-card
.exchange-items
.title-box
{
padding
:
0
50
rpx
;
.course-card
.exchange-items
.title-box
{
padding
:
0
50
rpx
;
}
.course-card
.exchange-items
.title-box
.main-title
{
.course-card
.exchange-items
.title-box
.main-title
{
font-size
:
36
rpx
;
font-weight
:
800
;
color
:
#282828
;
color
:
#282828
;
}
.course-card
.exchange-items
.title-box
.sub-title
{
.course-card
.exchange-items
.title-box
.sub-title
{
font-size
:
26
rpx
;
font-weight
:
normal
;
color
:
#6F6F6F
;
color
:
#6F6F6F
;
margin-left
:
10
rpx
;
}
.course-card
.exchange-items
.items
{
.course-card
.exchange-items
.items
{
width
:
100%
;
flex
:
1
;
overflow-y
:
auto
;
margin-top
:
40
rpx
;
padding
:
0
50
rpx
;
flex
:
1
;
overflow-y
:
auto
;
margin-top
:
40
rpx
;
padding
:
0
50
rpx
;
box-sizing
:
border-box
;
}
.course-card
.exchange-items
.items
.item-course
{
.course-card
.exchange-items
.items
.item-course
{
margin-bottom
:
50
rpx
;
padding
:
40
rpx
36
rpx
;
padding
:
40
rpx
36
rpx
;
display
:
flex
;
align-items
:
flex-start
;
background-color
:
#FFF
;
border-radius
:
30
rpx
;
}
.course-card
.exchange-items
.items
.item-course
.course-pic
{
.course-card
.exchange-items
.items
.item-course
.course-pic
{
width
:
100
rpx
;
height
:
140
rpx
;
margin-right
:
36
rpx
;
overflow
:
hidden
;
}
.course-card
.exchange-items
.items
.item-course
.course-pic
image
{
width
:
100%
;
.course-card
.exchange-items
.items
.item-course
.course-pic
image
{
width
:
100%
;
height
:
100%
;
}
.course-card
.exchange-items
.items
.item-course
.content
{
flex
:
1
;
.course-card
.exchange-items
.items
.item-course
.content
{
flex
:
1
;
width
:
1px
;
}
.course-card
.exchange-items
.items
.item-course
.content
.course-name
{
.course-card
.exchange-items
.items
.item-course
.content
.course-name
{
font-size
:
30
rpx
;
font-weight
:
bold
;
color
:
#282828
;
line-height
:
42
rpx
;
margin-bottom
:
20
rpx
;
}
.course-card
.exchange-items
.items
.item-course
.content
.course-progress
{
.course-card
.exchange-items
.items
.item-course
.content
.course-progress
{
color
:
#282828
;
font-weight
:
400
;
font-size
:
20
rpx
;
...
...
src/pages/index/index.vue
View file @
4aca0cfa
...
...
@@ -8,19 +8,19 @@
</view>
<view
class=
"index-header-tetx"
>
<view
class=
"index-header-title"
>
welcome
{{
userData
}}
welcome
</view>
<view
class=
"index-header-name"
>
周一围
</view>
<view
class=
"index-header-name"
>
{{
userData
.
AccountName
}}
</view>
</view>
</view>
</navbar>
<view
style=
"margin: 40rpx 0 10rpx 0;"
>
<view
style=
"padding:0 50rpx;font-weight: 800;color: #282828;"
>
<view
style=
"font-size: 36rpx;"
>
Hello,
</view>
<view
style=
"font-size: 36rpx;"
>
Hello,
{{
userData
.
AccountName
}}
</view>
<view
style=
"font-size: 50rpx;"
>
您的学情反馈已准备好
</view>
</view>
</view>
<course-card></course-card>
<course-card
:stuCourseList=
"stuCourseList"
></course-card>
<view
class=
"index-student-title flex"
>
<text>
考情详情
</text>
<view>
(共53条)
</view>
...
...
@@ -61,11 +61,6 @@
import
navbar
from
'../../components/navbar.vue'
import
bottom
from
'../../components/bottom.vue'
export
default
{
// data(){
// return{
// }
// }
components
:
{
indexassembly
,
navbar
,
...
...
@@ -80,25 +75,11 @@
proxy
}
=
getCurrentInstance
();
let
data
=
reactive
({
ActiveMsg
:
{
pageIndex
:
1
,
pageSize
:
10
,
ActivityType
:
0
,
SelectIsEnd
:
0
,
},
ActivityList
:
[],
pageData
:
{
LearningGardenList
:
[]
},
SurveyObj
:{
ActivitySurveyId
:
0
,
ActivitySurveyGuestId
:
0
,
},
userData
:
{}
stuCourseList
:
[],
//学员课程列表
userData
:
{},
//用户信息
});
let
methods
=
{
jumpPage
(
url
)
{
uni
.
navigateTo
({
url
:
url
,
...
...
@@ -109,10 +90,7 @@
url
:
'/pages/timetable/timeTable'
,
})
},
//跳转至详情
goActiveDetail
(
Id
)
{
// this.jumpPage(`/pages/activity/activityDetails?Id=${Id}`);
},
base64_decode
(
data
)
{
var
b64
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
;
var
o1
,
...
...
@@ -149,89 +127,14 @@
}
}
while
(
i
<
data
.
length
);
dec
=
tmp_arr
.
join
(
""
);
//dec = utf8_decode(dec);
return
dec
;
},
//{"cmd":"checkin","params":{"classId":0,"ClassDate":"2022-4-19","ClassRoomId":27,
//"School_Id":0,"TeacherId":8,"CheckStatus":0,"StudyNum":"90","ClassTimeId":16531}}
scan
()
{
//调起条码扫描
console
.
log
(
"进来了"
)
let
that
=
this
uni
.
scanCode
({
scanType
:
[
'qrCode'
],
success
:
function
(
res
)
{
// 解码
var
saveObj
=
{};
try
{
saveObj
=
that
.
base64_decode
(
res
.
result
)
// console.log(saveObj)
}
catch
(
e
)
{
//TODO handle the exception
// console.log(e)
}
var
jsonObj
=
JSON
.
parse
(
saveObj
)
if
(
jsonObj
.
cmd
==
"checkin"
){
var
userData
=
uni
.
getStorageSync
(
'userInfo'
);
console
.
log
(
"userData"
,
userData
);
jsonObj
.
params
.
StuId
=
userData
.
AccountId
;
var
array
=
[];
array
.
push
(
jsonObj
.
params
);
console
.
log
(
"jsonObj.params"
,
jsonObj
.
params
)
let
result
=
getSweepCode
(
array
);
if
(
result
)
{
// console.log(result)
if
(
result
.
Code
==
1
)
{
console
.
log
(
'扫码成功'
)
uni
.
navigateTo
({
url
:
'./success'
,
})
}
else
{
console
.
log
(
'扫码失败'
)
uni
.
navigateTo
({
url
:
'./fail'
})
}
}
}
},
});
},
async
getActivityData
()
{
// let res = await getActivityList(data.ActiveMsg);
// if (res.resultCode == 1) {
// data.ActivityList = res.data.pageData;
// }
return
dec
;
},
getIndexData
()
{
//获取学员课程列表
getStuCourse
()
{
proxy
.
$request
(
"/Stu/GetStuCourse"
,
{}).
then
(
res
=>
{
data
.
pageData
=
res
.
Data
uni
.
setStorageSync
(
"indexData"
,
res
.
Data
);
data
.
SurveyObj
.
ActivitySurveyId
=
res
.
Data
.
ActivitySurveyId
;
data
.
SurveyObj
.
ActivitySurveyGuestId
=
res
.
Data
.
ActivitySurveyGuestId
;
if
(
data
.
pageData
.
LearningGardenList
.
length
>
0
)
{
data
.
pageData
.
LearningGardenList
.
forEach
((
x
,
y
)
=>
{
if
(
x
.
List
.
length
>
0
)
{
x
.
List
.
forEach
(
async
(
item
,
index
)
=>
{
await
this
.
getColor
(
item
.
Img
,
index
,
y
).
then
(
v
=>
{
data
.
pageData
.
LearningGardenList
[
v
.
y
]
.
List
[
v
.
index
].
bgcolor
=
v
.
formatres
;
data
.
pageData
.
LearningGardenList
[
v
.
y
]
.
List
[
v
.
index
].
bgcolor1
=
v
.
formatres1
;
data
.
pageData
.
LearningGardenList
[
v
.
y
]
.
List
[
v
.
index
].
bgcolor2
=
v
.
formatres2
;
})
})
}
})
}
data
.
stuCourseList
=
res
.
Data
;
//console.log("data.stuCourseList",this.stuCourseList)
})
},
async
getColor
(
src
,
index
,
y
)
{
...
...
@@ -244,33 +147,6 @@
obj
.
y
=
y
return
obj
},
againdata
()
{
data
.
userData
=
uni
.
getStorageSync
(
'userInfo'
);
methods
.
getIndexData
();
methods
.
getActivityData
();
},
jumpGarden
(
id
)
{
if
(
id
==
1
)
{
uni
.
navigateTo
({
url
:
"/pages/learningGarden/learningGardenList"
})
}
else
if
(
id
==
2
)
{
// uni.navigateTo({
// url:"/pages/learningGarden/learningGardenList"
// })
}
},
jumpJiahemini
()
{
let
userinfo
=
uni
.
getStorageSync
(
'userInfo'
);
wx
.
navigateToMiniProgram
({
appId
:
'wx38e054ee42b054f4'
,
path
:
''
,
//为空则打开首页
extraData
:
{
Id
:
userinfo
.
Id
||
0
}
})
}
};
onMounted
(()
=>
{
...
...
@@ -282,8 +158,7 @@
};
},
onShow
()
{
this
.
getActivityData
();
this
.
getIndexData
();
this
.
getStuCourse
();
this
.
userData
=
uni
.
getStorageSync
(
'userInfo'
);
},
onShareAppMessage
()
{
...
...
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