Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
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
viitto
mallapp
Commits
ad1e0095
Commit
ad1e0095
authored
Oct 13, 2020
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
学习卡 教师
parent
a4621c31
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
894 additions
and
19 deletions
+894
-19
course.vue
components/coupon/course.vue
+1
-1
pages.json
pages.json
+6
-0
cart.vue
pages/cart/cart.vue
+0
-1
course-submit.vue
pages/school/course-submit.vue
+20
-15
courseInfo.vue
pages/school/courseInfo.vue
+1
-1
courseList.vue
pages/school/courseList.vue
+1
-1
cardList.vue
pages/school/personal/cardList.vue
+296
-0
followTeacher.vue
pages/school/personal/followTeacher.vue
+260
-0
studycard.vue
pages/school/personal/studycard.vue
+309
-0
No files found.
components/coupon/course.vue
View file @
ad1e0095
...
...
@@ -18,7 +18,7 @@
<view
class=
"details"
>
<view
class=
"item"
v-for=
"(x, i) in ts"
:key=
"i"
>
<view
class=
"ticket"
>
<image
mode=
"aspectFill"
:src=
"x.coupon_data.couponIco"
style=
"width: 100%; height: 100%;"
></image>
<image
mode=
"aspectFill"
:src=
"x.coupon_data.couponIco"
style=
"width: 100%; height: 100%;
border-top-left-radius: 5px;border-bottom-left-radius: 5px;
"
></image>
</view>
<view
class=
"detail"
>
<view
class=
"coupond"
>
...
...
pages.json
View file @
ad1e0095
...
...
@@ -377,6 +377,12 @@
"path"
:
"course-submit"
},{
"path"
:
"components/schoolDraw"
},{
"path"
:
"personal/followTeacher"
},{
"path"
:
"personal/studycard"
},{
"path"
:
"personal/cardList"
//学习卡中心
}]
},
...
...
pages/cart/cart.vue
View file @
ad1e0095
...
...
@@ -261,7 +261,6 @@ export default {
init
()
{
uni
.
showNavigationBarLoading
();
this
.
isloading
=
true
;
this
.
IsEducation
=
1
if
(
this
.
IsEducation
==
1
){
this
.
msg
.
GoodsClassify
=
2
}
...
...
pages/school/course-submit.vue
View file @
ad1e0095
...
...
@@ -56,32 +56,32 @@
<view
class=
"discountbox"
>
<view
class=
"filed"
>
<view
class=
"left"
>
优惠券
</view>
<view
class=
"right"
v-if=
'reduceType!=2'
>
<view
class=
"right"
>
<text
class=
"content"
v-if=
"mchs[0].coupon.user_coupon_id == 0 && couponList.length>0"
@
click=
"showCouponHandler"
>
选择优惠券
</text>
<text
class=
"content"
v-else-if=
"couponList.length==0"
>
暂无优惠券
</text>
<text
class=
"content"
v-else
:style=
"
{ color: pricecolor }" @click="showCouponHandler">已优惠
{{
mchs
[
0
].
coupon
.
coupon_discount
}}
元
</text>
<u-icon
name=
"ellipsis"
size=
"36"
v-if=
"couponList.length > 0"
@
click=
"showCouponHandler"
></u-icon>
</view>
<
view
v-else
style=
"font-size: 11px;color: #999999;"
>
不可使用
</view
>
<
!--
<view
v-else
style=
"font-size: 11px;color: #999999;"
>
不可使用
</view>
--
>
</view>
<view
class=
"filed"
style=
"margin-top: 20px;"
v-if=
"integral.can_use"
>
<view
class=
"left"
>
积分抵扣
</view>
<view
class=
"right"
v-if=
'reduceType!=2'
>
<view
class=
"right"
>
<text
class=
"content"
:style=
"
{ color: secondary }">
{{
`使用${integral.use_num
}
积分抵扣${integral.deduction_price
}
元`
}}
<
/text
>
<
u
-
checkbox
-
group
><
u
-
checkbox
v
-
model
=
"userInt"
:
active
-
color
=
"pricecolor"
@
change
=
"changeUseInt"
:
icon
-
size
=
"28"
shape
=
"circle"
><
/u-checkbox></
u
-
checkbox
-
group
>
<
/view
>
<
view
v
-
else
style
=
"font-size: 11px;color: #999999;"
>
不可使用
<
/view
>
<
!--
<
view
v
-
else
style
=
"font-size: 11px;color: #999999;"
>
不可使用
<
/view> --
>
<
/view
>
<
view
class
=
"filed"
style
=
"margin-top: 20px;"
>
<
view
class
=
"left"
>
学习卡
<
/view
>
<
view
class
=
"right"
v
-
if
=
'reduceType!=1'
>
<
view
class
=
"right"
>
<
text
class
=
"content"
v
-
if
=
"mchs[0].education.use_education_id == 0 && courseList.length>0"
@
click
=
"showCourseHandler"
>
选择学习卡
<
/text
>
<
text
class
=
"content"
v
-
else
-
if
=
"courseList.length==0"
>
暂无学习卡
<
/text
>
<
text
class
=
"content"
v
-
else
:
style
=
"{ color: pricecolor
}
"
@
click
=
"showCourseHandler"
>
已优惠
{{
mchs
[
0
].
education
.
education_money
}}
元
<
/text
>
<
u
-
icon
name
=
"ellipsis"
size
=
"36"
v
-
if
=
"courseList.length > 0"
@
click
=
"showCourseHandler"
><
/u-icon
>
<
/view
>
<
view
v
-
else
style
=
"font-size: 11px;color: #999999;"
>
不可使用
<
/view
>
<
!--
<
view
v
-
else
style
=
"font-size: 11px;color: #999999;"
>
不可使用
<
/view> --
>
<
/view
>
<
view
class
=
"filed"
style
=
"margin-top: 20px;font-size: 12px;color: #999999;"
>
注
:
优惠券
(
包括积分
)
和学习卡只能二选一
...
...
@@ -485,22 +485,29 @@
}
);
}
,
closeCouponHandler
(
e
)
{
closeCouponHandler
(
e
)
{
//优惠券返回
if
(
e
!=
-
1
)
{
this
.
formdata
.
User_Coupon_Id
=
e
;
this
.
formdata
.
Use_Education_Id
=
0
;
this
.
EducationMoney
=
0.0
;
this
.
init
();
}
this
.
showCoupon
=
false
;
this
.
reduceType
=
1
;
}
,
closeCourseHandler
(
e
){
//选择课程卡的返回
if
(
e
!=
-
1
)
{
this
.
formdata
.
Use_Education_Id
=
e
;
this
.
userInt
=
false
;
this
.
formdata
.
User_Coupon_Id
=
0
;
this
.
formdata
.
Use_Integral
=
0
;
this
.
goodPrice
=
0.0
;
this
.
couponPrice
=
0.0
;
// this.EducationMoney=0.0;
this
.
init
();
}
this
.
showCourse
=
false
;
this
.
reduceType
=
2
;
}
,
showCouponHandler
()
{
this
.
showCoupon
=
true
;
...
...
@@ -508,15 +515,13 @@
showCourseHandler
(){
this
.
showCourse
=
true
;
}
,
changeUseInt
(
e
)
{
changeUseInt
(
e
)
{
//选择积分
this
.
userInt
=
e
.
value
;
this
.
formdata
.
Use_Integral
=
this
.
userInt
?
1
:
0
;
this
.
formdata
.
Use_Education_Id
=
0
;
this
.
EducationMoney
=
0.0
;
this
.
init
();
if
(
this
.
userInt
==
true
){
this
.
reduceType
=
1
;
}
else
{
this
.
reduceType
=
0
;
}
}
,
checkboxChange
(
val
){
...
...
pages/school/courseInfo.vue
View file @
ad1e0095
...
...
@@ -95,7 +95,7 @@
<view
style=
"font-size: 14px;color: #1B1D1E;"
>
授课老师
</view>
<view
class=
"teacher-list"
>
<view
class=
"teacher-item"
v-for=
"(ti, i) in g.teacher_list"
:key=
"i"
@
click=
"goteacher(ti)"
>
<
image
:src=
"ti.teacher_logo"
style=
"width: 25px;height: 25px;border-radius: 22.5px;"
></image
>
<
u-avatar
:src=
"ti.teacher_logo"
size=
"50"
></u-avatar
>
<text
style=
"font-size: 12px;color: #666666;margin: 0 5px;"
>
{{
ti
.
teacher_name
}}
</text>
<u-icon
name=
"arrow"
:size=
"20"
color=
"#666666"
></u-icon>
</view>
...
...
pages/school/courseList.vue
View file @
ad1e0095
...
...
@@ -98,7 +98,7 @@
onLoad
(
option
)
{
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
catId
=
option
.
cat_id
;
if
(
option
&&
option
.
coupon_id
&&
option
.
UseType
)
{
//
优惠券
带过来的参数
if
(
option
&&
option
.
coupon_id
&&
option
.
UseType
)
{
//
课程卡
带过来的参数
console
.
log
(
option
.
coupon_id
)
if
(
option
.
UseType
==
1
){
this
.
msg
.
CategoryIds
=
option
.
coupon_id
...
...
pages/school/personal/cardList.vue
0 → 100644
View file @
ad1e0095
<
template
>
<view
class=
"cardList"
:style=
"
{ height: contentHeight }">
<u-empty
v-if=
"g.length == 0"
text=
"暂无相关学习卡"
mode=
"coupon"
></u-empty>
<view
v-if=
"g.length > 0"
style=
"
height: calc(100vh);
width: calc(100vw);
overflow: hidden;
padding-bottom: 50px;
"
>
<scroll-view
:scroll-y=
"true"
:enable-back-to-top=
"true"
:enable-flex=
"true"
@
scrolltolower=
"lower"
:style=
"
{ height: '100%' }"
>
<view
class=
"details"
>
<view
class=
"item"
v-for=
"(x, i) in g"
:key=
"i"
>
<view
class=
"ticket"
>
<image
mode=
"aspectFill"
:src=
"x.CouponIco"
style=
"width: 100%; height: 100%;border-top-left-radius: 5px;border-bottom-left-radius: 5px;"
></image>
</view>
<view
class=
"detail"
>
<view
class=
"coupond"
>
<view
class=
"name"
>
{{
x
.
Name
}}
</view>
<view
class=
"rule"
>
{{
x
.
UseTypeStr
}}
</view>
<view
class=
"date"
>
{{
x
.
StartDate
.
split
(
' '
)[
0
].
replace
(
/-/g
,
'.'
)
+
"-"
+
x
.
EndDate
.
split
(
' '
)[
0
].
replace
(
/-/g
,
'.'
)
}}
</view>
</view>
<view
class=
"chosen"
:style=
"
{'background':mainColor}" @click="receive(x,i)">
<Text>
{{
x
.
IsReceive
==
1
?
'已领取'
:
'立即领取'
}}
</Text>
</view>
</view>
</view>
</view>
<u-loadmore
:status=
"status"
:load-text=
"loadText"
:font-size=
"24"
:margin-top=
"20"
:margin-bottom=
"20"
bg-color=
"#FFF"
/>
</scroll-view>
</view>
<!-- 加载中 -->
<view
class=
"loading"
v-if=
"loading"
>
<u-loading
mode=
"flower"
size=
"48"
>
>
</u-loading>
<Text
style=
"color: #fff; margin-top: 10rpx;"
>
加载中...
</Text>
</view>
<!-- 取消提示 -->
<u-toast
ref=
"uToast"
/>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
'gbAuth'
></auth>
</view>
</
template
>
<
script
>
import
auth
from
"@/components/auth/index.vue"
;
export
default
{
components
:
{
auth
},
data
()
{
return
{
pageTitle
:
"学习卡中心"
,
showAuth
:
false
,
u
:{},
mainColor
:
""
,
contentHeight
:
0
,
msg
:{
pageIndex
:
1
,
pageSize
:
10
,
SmallShopId
:
0
,
},
page_count
:
1
,
g
:
[],
loading
:
false
,
status
:
"loadmore"
,
loadText
:
{
loadmore
:
"轻轻上拉,加载更多"
,
loading
:
"努力加载中"
,
nomore
:
"没有更多了"
,
},
};
},
created
()
{
this
.
contentHeight
=
this
.
$utils
.
calcContentHeight
(
-
40
)
+
"px"
;
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
},
mounted
()
{
let
currentPages
=
getCurrentPages
();
let
u
=
"/"
+
currentPages
[
currentPages
.
length
-
1
].
route
;
let
pages
=
wx
.
getStorageSync
(
"basedata"
)
?
wx
.
getStorageSync
(
"basedata"
).
bar_title
:
[];
pages
.
forEach
((
x
)
=>
{
if
(
x
.
value
==
u
)
{
this
.
pageTitle
=
x
.
new_name
?
x
.
new_name
:
x
.
name
;
}
});
uni
.
setNavigationBarTitle
({
title
:
this
.
pageTitle
,
});
},
onLoad
:
function
(
option
)
{
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
avatarUrl
:
""
};
this
.
showAuth
=
true
;
}
else
{
this
.
init
();
}
},
methods
:
{
init
()
{
this
.
msg
.
SmallShopId
=
this
.
u
.
UserSmallShopId
this
.
request2
(
{
url
:
'/api/AppletEducation/GetAllCouponPageList'
,
data
:
this
.
msg
},
res
=>
{
if
(
res
.
resultCode
==
1
){
this
.
loading
=
false
;
this
.
g
=
this
.
g
.
concat
(
res
.
data
.
pageData
);
this
.
page_count
=
res
.
data
.
pageCount
;
if
(
this
.
page_count
==
1
)
{
this
.
status
=
"nomore"
;
}
}
}
);
},
receive
(
x
,
i
){
if
(
x
.
IsReceive
==
0
){
this
.
request2
(
{
url
:
'/api/AppletEducation/GrantCoupon'
,
data
:
{
CouponId
:
x
.
CouponId
}
},
(
res
)
=>
{
if
(
res
.
resultCode
==
1
){
uni
.
showToast
({
title
:
res
.
message
,
icon
:
"none"
});
this
.
g
[
i
].
IsReceive
=
1
;
}
}
);
}
else
{
uni
.
showToast
({
title
:
"已领取过学习卡"
,
icon
:
"none"
});
}
},
lower
(
e
)
{
if
(
this
.
msg
.
pageIndex
<
this
.
page_count
)
{
this
.
msg
.
pageIndex
++
;
this
.
status
=
"loading"
;
this
.
init
();
}
else
{
this
.
status
=
"nomore"
;
}
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
// this.showAuth=false;
this
.
init
();
},
//关闭登录窗口
gbAuth
(){
uni
.
navigateBack
()
},
},
};
</
script
>
<
style
>
.cardList
{
width
:
100%
;
height
:
100%
;
background
:
#FFF
;
position
:
relative
;
}
.cardList
.loading
{
width
:
180
rpx
;
height
:
180
rpx
;
background
:
#000000
;
opacity
:
0.7
;
border-radius
:
10
rpx
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
position
:
fixed
;
left
:
50%
;
top
:
30%
;
margin-left
:
-100
rpx
;
z-index
:
999
;
}
.cardList
.details
{
padding
:
15px
;
display
:
flex
;
flex-direction
:
column
;
position
:
relative
;
}
.cardList
.item
{
display
:
flex
;
margin-bottom
:
10px
;
align-items
:
flex-start
;
background
:
#fff
;
border-radius
:
5px
;
box-shadow
:
0
4px
6px
1px
rgba
(
76
,
76
,
76
,
0.1
);
}
.cardList
.details
.item
.ticket
{
width
:
104px
;
height
:
78px
;
}
.cardList
.details
.item
.detail
{
width
:
1px
;
flex
:
1
;
background
:
#fff
;
padding
:
10px
;
display
:
flex
;
align-items
:
center
;
}
.cardList
.details
.item
.detail
.coupond
{
flex
:
1
;
}
.cardList
.details
.item
.detail
.coupond
.name
{
font-size
:
13px
;
font-weight
:
600
;
color
:
#000
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-line-clamp
:
1
;
-webkit-box-orient
:
vertical
;
}
.cardList
.details
.item
.detail
.coupond
.date
{
margin-top
:
5px
;
font-size
:
11px
;
color
:
#777
;
}
.cardList
.details
.item
.detail
.coupond
.rule
{
font-size
:
11px
;
color
:
#777
;
margin-top
:
5px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-line-clamp
:
1
;
-webkit-box-orient
:
vertical
;
}
.cardList
.details
.item
.detail
.chosen
{
width
:
60px
;
height
:
25px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
11px
;
border-radius
:
4px
;
color
:
#FFF
;
}
</
style
>
pages/school/personal/followTeacher.vue
0 → 100644
View file @
ad1e0095
<
template
>
<view
class=
"followTeacher"
:style=
"
{ height: contentHeight }">
<view
class=
"followTeacher-top"
>
共关注
{{
count
}}
位老师
</view>
<u-empty
v-if=
"g.length == 0"
text=
"暂无关注教师"
mode=
"list"
></u-empty>
<view
v-if=
"g.length > 0"
style=
"
height: calc(100vh-35px);
width: calc(100vw);
overflow: hidden;
"
>
<scroll-view
:scroll-y=
"true"
:enable-back-to-top=
"true"
:enable-flex=
"true"
@
scrolltolower=
"lower"
:style=
"
{ height: '100%' }"
>
<view
class=
"ftBox"
>
<view
class=
"interDList"
v-for=
"(x, i) in g"
:key=
"i"
>
<u-avatar
:src=
"x.TeacherLogo"
size=
"110"
></u-avatar>
<view
:style=
"
{'width':(windowWidth-30-55-20-70)+'px','margin-left':'10px'}">
<view
class=
"teinfo"
>
{{
x
.
Name
}}
</view>
<view
class=
"teinfo"
style=
"margin-top: 10px;font-size: 11px;color: #999999;"
>
{{
x
.
Major
}}
</view>
</view>
<view
class=
"gzbtn"
@
click=
"setFollowTeacher(x,i)"
>
<text
style=
"color: #999999;"
>
取消关注
</text>
</view>
<!--
<view
class=
"gzbtn"
v-if=
"x.Followteacher==0"
:style=
"
{background:mainColor,'border':'0.5px solid'+mainColor}" @click="setFollowTeacher(x,i)">
<text
style=
"color: #FFF;"
>
关注
</text>
</view>
-->
</view>
</view>
<u-loadmore
:status=
"status"
:load-text=
"loadText"
:font-size=
"24"
:margin-top=
"20"
:margin-bottom=
"20"
bg-color=
"#FFF"
/>
</scroll-view>
</view>
<!-- 加载中 -->
<view
class=
"loading"
v-if=
"loading"
>
<u-loading
mode=
"flower"
size=
"48"
>
>
</u-loading>
<Text
style=
"color: #fff; margin-top: 10rpx;"
>
加载中...
</Text>
</view>
<!-- 取消提示 -->
<u-toast
ref=
"uToast"
/>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
'gbAuth'
></auth>
</view>
</
template
>
<
script
>
import
auth
from
"../../../components/auth/index.vue"
;
export
default
{
components
:
{
auth
},
data
()
{
return
{
pageTitle
:
"教师关注"
,
showAuth
:
false
,
msg
:{
pageIndex
:
1
,
pageSize
:
10
,
},
mainColor
:
""
,
secondary
:
''
,
pricecolor
:
''
,
contentHeight
:
0
,
page
:
1
,
page_count
:
1
,
g
:
[],
loading
:
false
,
status
:
"loadmore"
,
count
:
0
,
loadText
:
{
loadmore
:
"轻轻上拉,加载更多"
,
loading
:
"努力加载中"
,
nomore
:
"没有更多了"
,
},
windowWidth
:
0
,
};
},
created
()
{
this
.
contentHeight
=
this
.
$utils
.
calcContentHeight
(
-
40
)
+
"px"
;
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
secondary
=
this
.
$uiConfig
.
secondary
;
this
.
pricecolor
=
this
.
$uiConfig
.
pricecolor
;
this
.
windowWidth
=
this
.
$utils
.
SystemInfo
().
windowWidth
;
},
mounted
()
{
let
currentPages
=
getCurrentPages
();
let
u
=
"/"
+
currentPages
[
currentPages
.
length
-
1
].
route
;
let
pages
=
wx
.
getStorageSync
(
"basedata"
)
?
wx
.
getStorageSync
(
"basedata"
).
bar_title
:
[];
pages
.
forEach
((
x
)
=>
{
if
(
x
.
value
==
u
)
{
this
.
pageTitle
=
x
.
new_name
?
x
.
new_name
:
x
.
name
;
}
});
uni
.
setNavigationBarTitle
({
title
:
this
.
pageTitle
,
});
},
onLoad
(){
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
avatarUrl
:
""
};
this
.
showAuth
=
true
;
}
else
{
this
.
init
();
}
},
methods
:
{
init
()
{
this
.
loading
=
true
;
this
.
request2
(
{
url
:
'/api/AppletEducation/GetFollowTeacherPageList'
,
data
:
this
.
msg
},
res
=>
{
if
(
res
.
resultCode
==
1
){
this
.
loading
=
false
;
this
.
count
=
res
.
data
.
count
;
// res.data.pageData.forEach(x=>{
// x.Followteacher=1;//1为关注
// })
this
.
g
=
this
.
g
.
concat
(
res
.
data
.
pageData
);
this
.
page_count
=
res
.
data
.
pageCount
;
if
(
this
.
page_count
==
1
)
{
this
.
status
=
"nomore"
;
}
}
}
);
},
setFollowTeacher
(
x
,
i
){
this
.
request2
({
url
:
'/api/AppletEducation/FollowTeacher'
,
data
:
{
ID
:
x
.
ID
,
TeacherId
:
x
.
TeacherId
,
}
},
res
=>
{
this
.
g
.
splice
(
i
,
1
)
this
.
count
--
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
,
duration
:
2000
});
}
);
},
lower
(
e
)
{
if
(
this
.
msg
.
pageIndex
<
this
.
page_count
)
{
this
.
msg
.
pageIndex
++
;
this
.
status
=
"loading"
;
this
.
init
();
}
else
{
this
.
status
=
"nomore"
;
}
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
// this.showAuth=false;
this
.
init
();
},
//关闭登录窗口
gbAuth
(){
uni
.
navigateBack
()
},
},
};
</
script
>
<
style
>
.followTeacher
{
width
:
100%
;
height
:
100vh
;
background
:
#FFF
;
}
.followTeacher
.loading
{
width
:
200
rpx
;
height
:
200
rpx
;
background
:
#000000
;
opacity
:
0.7
;
border-radius
:
10
rpx
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
position
:
fixed
;
left
:
50%
;
top
:
30%
;
margin-left
:
-100
rpx
;
z-index
:
999
;
}
.followTeacher
.interDList
{
width
:
calc
(
100vw
-
30px
)
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
padding
:
20px
0
;
border-bottom
:
1px
solid
#f5f5f5
;
}
.followTeacher
.followTeacher-top
{
width
:
100%
;
height
:
35px
;
padding
:
0
15px
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
font-size
:
11px
;
color
:
#999999
;
background
:
#FAF8F9
;
}
.followTeacher
.ftBox
{
width
:
100%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
}
.followTeacher
.teinfo
{
width
:
100%
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
font-size
:
15px
;
}
.followTeacher
.gzbtn
{
width
:
69px
;
height
:
26px
;
border-radius
:
4px
;
margin-left
:
8px
;
border
:
0.5px
solid
#999999
;
color
:
#111111
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
13px
;
}
</
style
>
pages/school/personal/studycard.vue
0 → 100644
View file @
ad1e0095
<
template
>
<view
class=
"studycard"
:style=
"
{ height: contentHeight }">
<u-tabs
:list=
"list"
:is-scroll=
"false"
:current=
"msg.UseState"
@
change=
"change"
:active-color=
"mainColor"
></u-tabs>
<u-empty
v-if=
"g.length == 0"
text=
"暂无相关学习卡"
mode=
"coupon"
></u-empty>
<view
v-if=
"g.length > 0"
style=
"
height: calc(100vh - 50px);
width: calc(100vw);
overflow: hidden;
padding-bottom: 50px;
"
>
<scroll-view
:scroll-y=
"true"
:enable-back-to-top=
"true"
:enable-flex=
"true"
@
scrolltolower=
"lower"
:style=
"
{ height: '100%' }"
>
<view
class=
"details"
>
<view
class=
"item"
v-for=
"(x, i) in g"
:key=
"i"
>
<view
class=
"ticket"
>
<image
mode=
"aspectFill"
:src=
"x.CouponIco"
style=
"width: 100%; height: 100%;border-top-left-radius: 5px;border-bottom-left-radius: 5px;"
></image>
</view>
<view
class=
"detail"
>
<view
class=
"coupond"
>
<view
class=
"name"
>
{{
x
.
Name
}}
</view>
<view
class=
"rule"
>
{{
x
.
UseTypeStr
}}
</view>
<view
class=
"date"
>
{{
x
.
StartDate
.
split
(
' '
)[
0
].
replace
(
/-/g
,
'.'
)
+
"-"
+
x
.
EndDate
.
split
(
' '
)[
0
].
replace
(
/-/g
,
'.'
)
}}
</view>
</view>
<view
class=
"chosen"
:style=
"
{'color':mainColor,'border':'0.5px solid'+mainColor}" @click="gouseUrl(x)" v-if="msg.UseState==0">
去使用
</view>
<image
v-if=
"msg.UseState==1"
mode=
"aspectFill"
class=
"imgs"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/studycardsy.png"
></image>
<image
v-if=
"msg.UseState==2"
mode=
"aspectFill"
class=
"imgs"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/studycardgq.png"
></image>
</view>
</view>
</view>
<u-loadmore
:status=
"status"
:load-text=
"loadText"
:font-size=
"24"
:margin-top=
"20"
:margin-bottom=
"20"
bg-color=
"#FFF"
/>
</scroll-view>
</view>
<view
style=
"width: 100%;height: 50px;background: #FFFFFF;display: flex;align-items: center;justify-content: center;position: absolute;left: 0;bottom: 0;border-top: 1px solid #E1E1E1;"
@
click=
"goUrl"
>
<Text>
去领取学习卡
</Text>
</view>
<!-- 加载中 -->
<view
class=
"loading"
v-if=
"loading"
>
<u-loading
mode=
"flower"
size=
"48"
>
>
</u-loading>
<Text
style=
"color: #fff; margin-top: 10rpx;"
>
加载中...
</Text>
</view>
<!-- 取消提示 -->
<u-toast
ref=
"uToast"
/>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
'gbAuth'
></auth>
</view>
</
template
>
<
script
>
import
auth
from
"@/components/auth/index.vue"
;
export
default
{
components
:
{
auth
},
data
()
{
return
{
pageTitle
:
"学习卡"
,
showAuth
:
false
,
u
:{},
list
:
[
{
name
:
"未使用"
},
{
name
:
"已使用"
},
{
name
:
"已过期"
},
],
mainColor
:
""
,
contentHeight
:
0
,
msg
:{
pageIndex
:
1
,
pageSize
:
10
,
UseState
:
0
},
page_count
:
1
,
g
:
[],
loading
:
false
,
status
:
"loadmore"
,
loadText
:
{
loadmore
:
"轻轻上拉,加载更多"
,
loading
:
"努力加载中"
,
nomore
:
"没有更多了"
,
},
};
},
created
()
{
this
.
contentHeight
=
this
.
$utils
.
calcContentHeight
(
-
40
)
+
"px"
;
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
},
mounted
()
{
let
currentPages
=
getCurrentPages
();
let
u
=
"/"
+
currentPages
[
currentPages
.
length
-
1
].
route
;
let
pages
=
wx
.
getStorageSync
(
"basedata"
)
?
wx
.
getStorageSync
(
"basedata"
).
bar_title
:
[];
pages
.
forEach
((
x
)
=>
{
if
(
x
.
value
==
u
)
{
this
.
pageTitle
=
x
.
new_name
?
x
.
new_name
:
x
.
name
;
}
});
uni
.
setNavigationBarTitle
({
title
:
this
.
pageTitle
,
});
},
onLoad
:
function
(
option
)
{
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
avatarUrl
:
""
};
this
.
showAuth
=
true
;
}
else
{
this
.
init
();
}
},
methods
:
{
change
(
index
)
{
this
.
msg
.
UseState
=
index
;
this
.
msg
.
pageIndex
=
1
;
this
.
g
=
[];
this
.
loading
=
true
;
this
.
init
();
},
init
()
{
this
.
request2
(
{
url
:
'/api/AppletEducation/GetMemberCouponPageList'
,
data
:
this
.
msg
},
res
=>
{
if
(
res
.
resultCode
==
1
){
this
.
loading
=
false
;
this
.
g
=
this
.
g
.
concat
(
res
.
data
.
pageData
);
this
.
page_count
=
res
.
data
.
pageCount
;
if
(
this
.
page_count
==
1
)
{
this
.
status
=
"nomore"
;
}
}
}
);
},
lower
(
e
)
{
if
(
this
.
msg
.
pageIndex
<
this
.
page_count
)
{
this
.
msg
.
pageIndex
++
;
this
.
status
=
"loading"
;
this
.
init
();
}
else
{
this
.
status
=
"nomore"
;
}
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
// this.showAuth=false;
this
.
init
();
},
//关闭登录窗口
gbAuth
(){
uni
.
navigateBack
()
},
gouseUrl
(
g
){
let
data
=
[]
if
(
g
.
UseType
==
1
||
g
.
UseType
==
2
){
g
.
ProductList
.
forEach
(
x
=>
{
data
.
push
(
x
.
ProductId
)
})
let
id
=
data
.
toString
()
uni
.
redirectTo
({
url
:
'/pages/school/courseList?coupon_id='
+
id
+
'&UseType='
+
g
.
UseType
});
}
else
{
uni
.
redirectTo
({
url
:
'/pages/school/courseList'
});
}
},
goUrl
(){
uni
.
navigateTo
({
url
:
"/pages/school/personal/cardList"
});
}
},
};
</
script
>
<
style
>
.studycard
{
width
:
100%
;
height
:
100%
;
background
:
#FFF
;
position
:
relative
;
}
.studycard
.loading
{
width
:
180
rpx
;
height
:
180
rpx
;
background
:
#000000
;
opacity
:
0.7
;
border-radius
:
10
rpx
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
position
:
fixed
;
left
:
50%
;
top
:
30%
;
margin-left
:
-100
rpx
;
z-index
:
999
;
}
.studycard
.details
{
padding
:
15px
;
display
:
flex
;
flex-direction
:
column
;
position
:
relative
;
}
.studycard
.item
{
display
:
flex
;
margin-bottom
:
10px
;
align-items
:
flex-start
;
background
:
#fff
;
border-radius
:
5px
;
box-shadow
:
0
4px
6px
1px
rgba
(
76
,
76
,
76
,
0.1
);
}
.studycard
.details
.item
.ticket
{
width
:
104px
;
height
:
78px
;
}
.studycard
.details
.item
.detail
{
width
:
1px
;
flex
:
1
;
background
:
#fff
;
padding
:
10px
;
display
:
flex
;
align-items
:
center
;
}
.studycard
.details
.item
.detail
.coupond
{
flex
:
1
;
}
.studycard
.details
.item
.detail
.coupond
.name
{
font-size
:
13px
;
font-weight
:
600
;
color
:
#000
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-line-clamp
:
1
;
-webkit-box-orient
:
vertical
;
}
.studycard
.details
.item
.detail
.coupond
.date
{
margin-top
:
5px
;
font-size
:
11px
;
color
:
#777
;
}
.studycard
.details
.item
.detail
.coupond
.rule
{
font-size
:
11px
;
color
:
#777
;
margin-top
:
5px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-line-clamp
:
1
;
-webkit-box-orient
:
vertical
;
}
.studycard
.details
.item
.detail
.chosen
{
width
:
55px
;
height
:
25px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
11px
;
border-radius
:
4px
;
}
.studycard
.imgs
{
width
:
55px
;
height
:
52px
;
position
:
absolute
;
top
:
16px
;
right
:
16px
;
}
</
style
>
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