Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
Project
Project
Details
Activity
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
wangxuelai
wechatapp.shangjiadao.com
Commits
58a2ae8e
Commit
58a2ae8e
authored
Apr 13, 2020
by
lvtz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix website
parent
029e9110
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
356 additions
and
328 deletions
+356
-328
app.json
app.json
+4
-1
api.js
constants/api.js
+3
-2
websiteindex.js
service/customer/websiteindex.js
+20
-0
businessinfolist.js
src/pages/websiteindex/businessinfolist.js
+14
-93
businessinfolist.json
src/pages/websiteindex/businessinfolist.json
+1
-1
businessinfolist.wxml
src/pages/websiteindex/businessinfolist.wxml
+27
-5
businessinfolist.wxss
src/pages/websiteindex/businessinfolist.wxss
+186
-94
index.js
src/pages/websiteindex/index.js
+40
-98
index.wxml
src/pages/websiteindex/index.wxml
+27
-32
index.wxss
src/pages/websiteindex/index.wxss
+34
-2
No files found.
app.json
View file @
58a2ae8e
...
...
@@ -722,7 +722,10 @@
"freshlist"
,
"onlineclassroomlist"
,
"momentvideo"
,
"newsvideo"
"newsvideo"
,
"teacherlist"
,
"teacherdetail"
,
"subjectlist"
]
},
{
...
...
constants/api.js
View file @
58a2ae8e
...
...
@@ -216,7 +216,7 @@ const apis = {
websitecourseshow
:
`
${
api
}
common/website/course/show`
,
//体验课详情
momentlist
:
`
${
api
}
common/moment`
,
//C端-课堂瞬间列表
momentdetail
:
`
${
api
}
common/moment/detail`
,
//C端-课堂瞬间详情
newslist
:
`
${
api
}
common/news`
,
//C端-机构新鲜事列表创
newslist
:
`
${
api
}
common/news`
,
//C端-机构新鲜事列表创
待删
newsdetail
:
`
${
api
}
student/news/detail`
,
//C端-机构新鲜详情
teacherlist
:
`
${
api
}
common/website/teachers`
,
//名师列表
onlinecourseslist
:
`
${
api
}
common/online_courses`
,
//C端-在线课列表
...
...
@@ -224,7 +224,8 @@ const apis = {
onlinesubcourses
:
`
${
api
}
student/online_courses/sub_courses`
,
//C端-线上课专栏对应的单课列表
onlinecoursesverifypwd
:
`
${
api
}
student/online_courses/verify_pwd`
,
//C端-线上课堂验证密码接口
websiteBarrage
:
`
${
api
}
common/odd_job/school_barrage`
,
//微官网弹幕
websitesubject
:
`
${
api
}
common/website/subject/index`
,
//主题列表
websitesubject
:
`
${
api
}
common/website/subject_mixtures`
,
//主题列表,一起打卡
websiteads
:
`
${
api
}
common/website/ads`
,
//广告banner
},
papersquare
:
{
lastwall
:
`
${
api
}
common/clock/last_wall`
,
//最新一次精选作品
...
...
service/customer/websiteindex.js
View file @
58a2ae8e
...
...
@@ -124,6 +124,24 @@ function teacherlistGet (data) {
notExactly
:
true
})
}
function
teacherDetailGet
(
data
)
{
return
wxRequest
({
url
:
`apis.customer.websiteindex.teacherlist/
${
data
.
id
}
`
,
data
,
method
:
'GET'
,
errorresolve
:
1
,
notExactly
:
true
})
}
function
adslistGet
(
data
)
{
return
wxRequest
({
url
:
apis
.
customer
.
websiteindex
.
websiteads
,
data
,
method
:
'GET'
,
errorresolve
:
1
,
notExactly
:
true
})
}
function
onlinecourseslistGet
(
data
)
{
return
wxRequest
({
url
:
apis
.
customer
.
websiteindex
.
onlinecourseslist
,
...
...
@@ -187,6 +205,8 @@ export {
momentdetailGet
,
newslistGet
,
teacherlistGet
,
teacherDetailGet
,
adslistGet
,
newsdetailGet
,
onlinecourseslistGet
,
onlinecoursesdetailGet
,
...
...
src/pages/websiteindex/businessinfolist.js
View file @
58a2ae8e
...
...
@@ -15,6 +15,8 @@ Page({
* 页面的初始数据
*/
data
:
{
statusBarHeight
:
app
.
globalData
.
statusBarHeight
,
titleBarHeight
:
app
.
globalData
.
titleBarHeight
,
imageRoot
:
app
.
globalData
.
imageRoot
,
imageVersion
:
app
.
globalData
.
imageVersion
,
localImageRoot
:
'../../../images/'
,
...
...
@@ -27,7 +29,12 @@ Page({
emptyPage
:
false
,
listLoading
:
false
,
schoolInfo
:
''
,
schoolDetail
:
''
schoolDetail
:
''
,
curtab
:
1
,
tabbox
:
[
{
tab
:
1
,
title
:
'学校相册'
},
{
tab
:
2
,
title
:
'学校视频'
}
]
},
/**
* 生命周期函数--监听页面加载
...
...
@@ -39,40 +46,7 @@ Page({
this
.
setData
({
sid
:
sid
||
0
});
app
.
getCurrentSchoolStudentId
({
source_id
:
this
.
data
.
sid
,
source_type
:
10
,
}).
then
(()
=>
{
this
.
websitehomeGet
();
this
.
setData
({
page
:
1
,
hasmore
:
true
,
})
this
.
getWebsiteIntrosList
(
'init'
);
})
const
myLocation
=
LocalStorage
.
getItem
(
'myLocation'
);
const
that
=
this
;
if
(
myLocation
)
{
this
.
setData
({
latitude
:
Number
(
myLocation
.
split
(
'-'
)[
0
]),
longitude
:
Number
(
myLocation
.
split
(
'-'
)[
1
]),
})
}
else
{
wx
.
getLocation
({
type
:
'wgs84'
,
success
(
res
)
{
const
{
latitude
,
longitude
}
=
res
;
LocalStorage
.
setItem
(
'myLocation'
,
latitude
+
'-'
+
longitude
)
that
.
setData
({
latitude
:
latitude
,
longitude
:
longitude
,
})
}
})
}
this
.
getWebsiteIntrosList
(
'init'
)
},
/**
...
...
@@ -120,52 +94,12 @@ Page({
onReachBottom
:
function
()
{
this
.
getWebsiteIntrosList
(
'up'
)
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
()
{
const
visitor
=
LocalStorage
.
getItem
(
'visitor'
);
app
.
setSharerLog
({
source_path
:
'src/pages/websiteindex/businessinfolist'
,
source_type_model
:
1
,
source_id
:
this
.
data
.
sid
,
param
:
JSON
.
stringify
({
query
:
`sid=
${
this
.
data
.
sid
}
&w=
${
app
.
globalData
.
currentSchoolStudentId
}
`
})
});
return
{
title
:
`我发现一家好机构@
${
this
.
data
.
schoolInfo
.
title
}
,推荐给你`
,
path
:
`/src/pages/websiteindex/businessinfolist?sid=
${
this
.
data
.
sid
}
&w=
${
app
.
globalData
.
currentSchoolStudentId
}
`
,
tabShift
(
e
)
{
const
{
tab
}
=
e
.
currentTarget
.
dataset
;
if
(
tab
==
this
.
data
.
curtab
){
return
}
},
websitehomeGet
()
{
websitehome
({
school_id
:
this
.
data
.
sid
}).
then
((
res
)
=>
{
const
{
code
,
data
}
=
res
;
if
(
code
==
200
)
{
if
(
res
.
data
){
data
.
distance
=
getFlatternDistance
(
this
.
data
.
latitude
,
this
.
data
.
longitude
,
Number
(
data
.
latitude
),
Number
(
data
.
longitude
));
data
.
banner
=
data
.
banner
?
JSON
.
parse
(
data
.
banner
)
:
''
;
this
.
setData
({
schoolInfo
:
data
})
}
else
{
this
.
schoolInfoGet
()
}
}
}).
catch
((
e
)
=>
{
})
},
callPhone
(){
wx
.
makePhoneCall
({
phoneNumber
:
this
.
data
.
schoolInfo
.
tel_phone
})
this
.
curtab
=
tab
;
},
getWebsiteIntrosList
(
type
)
{
if
(
!
this
.
data
.
hasmore
)
{
...
...
@@ -284,17 +218,4 @@ Page({
})
},
schoolInfoGet
()
{
getSchoolDetail
(
this
.
data
.
sid
).
then
((
res
)
=>
{
const
{
code
,
data
}
=
res
;
if
(
code
==
200
)
{
this
.
setData
({
schoolDetail
:
data
,
})
}
})
},
})
\ No newline at end of file
src/pages/websiteindex/businessinfolist.json
View file @
58a2ae8e
{
"navigation
BarTitleText"
:
"机构介绍
"
,
"navigation
Style"
:
"custom
"
,
"usingComponents"
:
{
"list-loading"
:
"../../../components/listloading"
,
"empty-content"
:
"../../../components/emptycontent"
,
...
...
src/pages/websiteindex/businessinfolist.wxml
View file @
58a2ae8e
<!--src/pages/websiteindex/businessinfolist.wxml-->
<wxs src="../../../filter/index.wxs" module="filter" />
<view class="container">
<view class="info-box">
<view class="container" style="padding-top: {{statusBarHeight+titleBarHeight+15}}px">
<view class="headerbox" style="padding-top: {{statusBarHeight}}px;">
<view class="tabsboxwrap" style="height: {{titleBarHeight}}px;">
<view class="backbtnbox" bindtap="goback">
<image class="backbtn" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}" />
</view>
<view class="tabsbox">
<view class="tabitem {{curtab==item.tab? 'active' : ''}}" wx:for="{{tabbox}}" wx:key="index" data-tab="{{item.tab}}" bindtap="tabShift">{{item.title}}</view>
</view>
</view>
</view>
<view class="list-box" wx:if="{{curtab==1}}">
<view class="list-item" wx:for="{{infoList}}" wx:key="index">
<view class="cover-box">
<image class="cover" src="{{filter.gifvideoPoster(item.content)}}" mode="aspectFill"></image>
</view>
<view class="title-box">
<view class="title">{{item.title}}</view>
</view>
</view>
</view>
<!-- <view class="info-box">
<view class="title-box">
{{schoolDetail.title}}
<view class="text">{{schoolInfo.title?schoolInfo.title:schoolDetail.title}}</view>
...
...
@@ -19,8 +41,8 @@
<image class="icon" src="{{imageRoot}}2c/websiteindex/phone.png" ></image>
</view>
</view>
</view>
<view class="business-info">
</view>
-->
<
!-- <
view class="business-info">
<view wx:if="{{!emptyPage}}">
<brick-layout
card="{{infoList}}"
...
...
@@ -32,6 +54,6 @@
<view class="" wx:if="{{emptyPage}}">
<empty-content text="暂无数据" emptyimg="common/empty/empty_c_sraech.png.png"></empty-content>
</view>
</view>
</view>
-->
</view>
\ No newline at end of file
src/pages/websiteindex/businessinfolist.wxss
View file @
58a2ae8e
/* src/pages/websiteindex/businessinfolist.wxss */
.container{
page {
background: #f9f9f9;
}
.container {
}
.headerbox {
position: fixed;
width: 100%;
z-index: 2;
top: 0;
left: 0;
background-color: #fff;
}
.tabsboxwrap {
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.backbtnbox {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
padding: 26rpx;
}
.backbtnbox .backbtn {
width: 12rpx;
height: 24rpx;
transform: rotate(-180deg);
}
.tabsbox {
display: flex;
align-items: center;
border: 1px solid #fea917;
border-radius: 6rpx;
overflow: hidden;
}
.tabsbox .tabitem {
width: 175rpx;
height: 64rpx;
display: flex;
align-items: center;
justify-content: center;
background-color: #fff;
color: #fea917;
font-size: 26rpx;
}
.tabsbox .tabitem.active {
color: #fff;
background-color: #fea917;
}
.list-box {
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 0 24rpx;
overflow: hidden;
}
.list-box .list-item {
width: 338rpx;
height: 255rpx;
border-radius: 20rpx;
background: #fff;
margin-bottom: 26rpx;
}
.list-box .list-item:nth-child(2n-1) {
margin-right: 26rpx;
}
.list-box .list-item .cover-box {
width: 100%;
height: 190rpx;
}
.list-box .list-item .cover-box .cover {
width: 100%;
height: 100%;
}
.list-box .list-item .title-box {
height: 65rpx;
display: flex;
align-items: center;
justify-content: center;
}
.list-box .list-item .title {
font-size: 26rpx;
color: #222;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding: 0 26rpx;
}
.container .info-box {
margin: 50rpx 24rpx 0 24rpx;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 20rpx 0px rgba(0, 0, 0, 0.08);
border-radius: 20rpx;
padding: 27rpx 10rpx 0 27rpx;
}
.container .info-box .title-box {
display: flex;
align-items: center;
padding-bottom: 26rpx;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.container .info-box .title-box .text {
font-size: 30rpx;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(0, 0, 0, 1);
line-height: 1;
padding-right: 28rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.container .info-box .title-box .count {
font-size: 22rpx;
font-family: PingFang-SC-Regular;
font-weight: 400;
color: rgba(255, 192, 0, 1);
line-height: 1;
padding: 5rpx 10rpx;
background: rgba(255, 209, 70, 0.1);
border-radius: 15rpx;
white-space: nowrap;
}
.container .info-box .address-box {
height: 84rpx;
display: flex;
align-items: center;
justify-content: space-between;
/* border-bottom: 1px solid rgba(0,0,0,.05); */
}
.container .info-box .address-box .address-box-text {
flex: 1;
font-size: 22rpx;
font-family: PingFang-SC-Regular;
font-weight: 400;
color: rgba(136, 136, 136, 1);
line-height: 30rpx;
padding-right: 20rpx;
}
.container .info-box .address-box .content {
display: flex;
align-items: center;
font-size: 22rpx;
font-family: PingFang-SC-Regular;
font-weight: 400;
color: rgba(136, 136, 136, 1);
line-height: 1;
}
.container .address-box .distance {
font-size: 22rpx;
font-family: PingFang-SC-Regular;
font-weight: 400;
color: rgba(136, 136, 136, 1);
padding-right: 20rpx;
}
.container .info-box .address-box .content .map-icon {
width: 20rpx;
height: 23rpx;
margin-right: 22rpx;
}
.container .info-box .address-box .btn {
display: flex;
align-items: center;
position: relative;
}
.container .info-box .address-box .btn .line {
width: 1px;
height: 34rpx;
background: rgba(0, 0, 0, 1);
opacity: 0.05;
margin-right: 6rpx;
}
.container .info-box .address-box .btn .icon {
width: 80rpx;
height: 80rpx;
}
.business-info {
margin-top: 40rpx;
padding: 0 24rpx;
}
.container .info-box{
margin: 50rpx 24rpx 0 24rpx;
background:rgba(255,255,255,1);
box-shadow:0px 0px 20rpx 0px rgba(0, 0, 0, 0.08);
border-radius:20rpx;
padding: 27rpx 10rpx 0 27rpx;
}
.container .info-box .title-box{
display: flex;
align-items: center;
padding-bottom: 26rpx;
border-bottom: 1px solid rgba(0,0,0,.05);
}
.container .info-box .title-box .text{
font-size:30rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(0,0,0,1);
line-height:1;
padding-right: 28rpx;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.container .info-box .title-box .count{
font-size:22rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(255,192,0,1);
line-height:1;
padding: 5rpx 10rpx;
background:rgba(255,209,70,.1);
border-radius:15rpx;
white-space: nowrap;
}
.container .info-box .address-box{
height: 84rpx;
display: flex;
align-items: center;
justify-content: space-between;
/* border-bottom: 1px solid rgba(0,0,0,.05); */
}
.container .info-box .address-box .address-box-text{
flex: 1;
font-size:22rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(136,136,136,1);
line-height:30rpx;
padding-right: 20rpx;
}
.container .info-box .address-box .content{
display: flex;
align-items: center;
font-size:22rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(136,136,136,1);
line-height:1;
}
.container .address-box .distance{
font-size:22rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(136,136,136,1);
padding-right: 20rpx;
}
.container .info-box .address-box .content .map-icon{
width:20rpx;
height:23rpx;
margin-right: 22rpx;
}
.container .info-box .address-box .btn{
display: flex;
align-items: center;
position: relative;
}
.container .info-box .address-box .btn .line{
width:1px;
height:34rpx;
background:rgba(0,0,0,1);
opacity:0.05;
margin-right: 6rpx;
}
.container .info-box .address-box .btn .icon{
width: 80rpx;
height: 80rpx;
}
.business-info{
margin-top: 40rpx;
padding: 0 24rpx;
}
\ No newline at end of file
src/pages/websiteindex/index.js
View file @
58a2ae8e
...
...
@@ -10,8 +10,8 @@ import {
commonclock
,
websitecourseshow
,
onlinecourseslistGet
,
newslistGet
,
teacherlistGet
,
adslistGet
,
momentlistGet
,
websiteBarrage
,
websitesubjectGet
...
...
@@ -88,6 +88,9 @@ Page({
'businessinfo'
:
0
},
// 初始离页面头部的距离
schoolInfoList
:
''
,
// 学校介绍
schoolInfoTotal
:
0
,
schoolInfoPicTotal
:
0
,
schoolInfoVideoTotal
:
0
,
mockSchoolInfoList
:
[
1
,
1
,
1
,
1
],
//直接循环四次空
clockPage
:
1
,
clockTotal
:
''
,
...
...
@@ -128,10 +131,10 @@ Page({
momentList
:
[],
//课堂瞬间列表
momentTotal
:
0
,
freshList
:
[],
//新鲜事列表
freshTotal
:
0
,
teacherList
:
[],
//名师列表
teacherTotal
:
0
,
adsList
:
[],
//广告banner
adsTotal
:
0
,
businessInstroEg
:
[{
title
:
'教室介绍1'
},
...
...
@@ -199,13 +202,13 @@ Page({
this
.
websitecourseshowGet
()
this
.
websiteintrosGet
();
this
.
clockListGet
();
this
.
newslistGet
();
this
.
teacherListGet
();
this
.
adsListGet
();
this
.
momentlistGet
();
// this.onlineCoursesListGet();
this
.
userShow
();
this
.
websiteBarrage
()
this
.
subjectListGet
(
'init'
)
this
.
subjectListGet
()
const
myLocation
=
LocalStorage
.
getItem
(
'myLocation'
);
const
that
=
this
;
wx
.
login
({
...
...
@@ -238,12 +241,11 @@ Page({
this
.
websitecourseshowGet
()
this
.
websiteintrosGet
();
this
.
clockListGet
();
this
.
newslistGet
();
this
.
momentlistGet
();
this
.
onlineCoursesListGet
();
this
.
userShow
();
this
.
websiteBarrage
()
this
.
subjectListGet
(
'init'
)
this
.
subjectListGet
()
}
...
...
@@ -330,7 +332,6 @@ Page({
// clearInterval(this.data.voiceInterval);
},
onReachBottom
:
function
()
{
// Do something when page reach bottom.
this
.
subjectListGet
(
'up'
);
},
onPullDownRefresh
:
function
()
{
// Do something when pull down.
...
...
@@ -475,7 +476,7 @@ Page({
}
=
e
.
currentTarget
.
dataset
;
let
url
=
""
;
switch
(
type
)
{
case
'
businessInstr
o'
:
case
'
schoolinf
o'
:
url
=
`/src/pages/websiteindex/businessinfolist`
;
break
;
case
'moment'
:
...
...
@@ -514,11 +515,11 @@ Page({
}
}).
catch
((
e
)
=>
{})
},
//
新鲜事
newslistGet
()
{
new
slistGet
({
//
广告banner
adsListGet
()
{
ad
slistGet
({
page
:
1
,
perPage
:
4
,
perPage
:
20
,
school_id
:
this
.
data
.
sid
,
}).
then
((
res
)
=>
{
const
{
...
...
@@ -528,10 +529,9 @@ Page({
if
(
code
!=
200
)
{
// 失败的处理
}
else
{
this
.
setData
({
fresh
List
:
data
.
list
,
fresh
Total
:
data
.
total
ads
List
:
data
.
list
,
ads
Total
:
data
.
total
})
console
.
log
(
this
.
data
.
freshList
)
}
}).
catch
((
e
)
=>
{})
},
...
...
@@ -920,6 +920,7 @@ Page({
const
that
=
this
;
data
.
banner
=
data
.
banner
?
JSON
.
parse
(
data
.
banner
)
:
''
;
data
.
tags
=
data
.
tags
?
JSON
.
parse
(
data
.
tags
)
:
''
;
let
dataSort
=
''
;
if
(
data
.
sort
)
{
dataSort
=
JSON
.
parse
(
data
.
sort
)
...
...
@@ -988,6 +989,11 @@ Page({
})
})
},
makecall
()
{
wx
.
makePhoneCall
({
phoneNumber
:
JSON
.
parse
(
this
.
data
.
schoolInfo
.
school
.
tel_phone
)[
0
]
})
},
// 体验课
websitecourseshowGet
()
{
websitecourseshow
({
...
...
@@ -1288,7 +1294,9 @@ Page({
if
(
code
==
200
)
{
this
.
setData
({
schoolInfoList
:
data
.
list
,
schoolInfoTotal
:
data
.
total
schoolInfoTotal
:
data
.
total
,
schoolInfoPicTotal
:
data
.
list
.
filter
(
item
=>
item
.
type
==
1
).
length
||
0
,
schoolInfoVideoTotal
:
data
.
list
.
filter
(
item
=>
item
.
type
==
2
).
length
||
0
,
})
}
})
...
...
@@ -1303,6 +1311,11 @@ Page({
url
:
`/src/pages/websiteindex/onlineclassroomlist?sid=
${
this
.
data
.
sid
}
`
,
})
},
goSubjectList
()
{
wx
.
navigateTo
({
url
:
`/src/pages/websiteindex/subjectlist?sid=
${
this
.
data
.
sid
}
`
,
})
},
goOnlineClass
(
e
)
{
const
{
item
...
...
@@ -1420,19 +1433,13 @@ Page({
})
}
},
subjectListGet
(
type
)
{
if
(
!
this
.
data
.
subjectHasmore
)
{
return
;
}
if
(
this
.
data
.
subjectListLoading
)
{
return
};
subjectListGet
()
{
this
.
setData
({
subjectListLoading
:
true
})
websitesubjectGet
({
page
:
this
.
data
.
subjectPage
,
perPage
:
10
,
page
:
1
,
perPage
:
3
,
school_id
:
this
.
data
.
sid
,
}).
then
((
res
)
=>
{
const
{
code
,
data
}
=
res
;
...
...
@@ -1444,72 +1451,8 @@ Page({
}
else
{
if
(
data
.
total
)
{
this
.
setData
({
subjectTotal
:
data
.
total
})
}
switch
(
type
)
{
case
'init'
:
//页面进来第一次加载
this
.
setData
({
subjectList
:
data
.
list
||
[]
},
()
=>
{
if
(
this
.
data
.
subjectTotal
>
this
.
data
.
subjectList
.
length
)
{
let
subjectPage
=
this
.
data
.
subjectPage
+
1
;
this
.
setData
({
subjectPage
,
})
}
else
{
// 没有更多了
this
.
setData
({
subjectHasmore
:
false
})
}
})
break
;
case
'down'
:
// 页面下拉刷新
this
.
setData
({
subjectList
:
data
.
list
||
[]
},
()
=>
{
if
(
this
.
data
.
subjectTotal
>
this
.
data
.
subjectList
.
length
)
{
let
subjectPage
=
this
.
data
.
subjectPage
+
1
;
this
.
setData
({
subjectPage
,
})
}
else
{
// 没有更多了
this
.
setData
({
subjectHasmore
:
false
})
}
})
wx
.
stopPullDownRefresh
();
break
;
case
'up'
:
// 页面上拉刷新
let
list
=
this
.
data
.
subjectList
;
let
_list
=
list
.
concat
(
data
.
list
);
this
.
setData
({
subjectList
:
_list
// [`subjectList[${this.data.page - 1}]`]: data.list
},
()
=>
{
if
(
this
.
data
.
subjectTotal
>
this
.
data
.
subjectList
.
length
)
{
let
subjectPage
=
this
.
data
.
subjectPage
+
1
;
this
.
setData
({
subjectPage
,
})
}
else
{
// 没有更多了
this
.
setData
({
subjectHasmore
:
false
})
}
})
break
;
default
:
break
;
}
if
(
this
.
data
.
subjectList
.
length
==
0
)
{
this
.
setData
({
subjectEmptyPage
:
true
})
}
else
{
this
.
setData
({
subjectEmptyPage
:
false
subjectTotal
:
data
.
total
,
subjectList
:
data
.
list
||
[]
})
}
}
...
...
@@ -1520,27 +1463,26 @@ Page({
})
},
goSharemoretheme
(
e
){
console
.
log
(
e
,
'跳转'
)
const
{
item
}
=
e
.
currentTarget
.
dataset
;
console
.
log
(
item
)
switch
(
item
.
source_type
)
{
switch
(
item
.
subject_mixture
.
subject_type
)
{
case
1
:
wx
.
navigateTo
({
url
:
`/src/pages/themeindex/
index?id=
${
item
.
subject_data
.
class_id
}
&tid=
${
item
.
source_
id
}
`
url
:
`/src/pages/themeindex/
landpage?tid=
${
item
.
subject_mixture
.
subject_id
}
&sid=
${
this
.
data
.
s
id
}
`
})
break
;
case
2
:
wx
.
navigateTo
({
url
:
`/src/pages/calendarthemeindex/
index?id=
${
item
.
subject_data
.
class_id
}
&tid=
${
item
.
source_
id
}
`
url
:
`/src/pages/calendarthemeindex/
landpage?tid=
${
item
.
subject_mixture
.
subject_id
}
&sid=
${
this
.
data
.
s
id
}
`
})
break
;
case
3
:
wx
.
navigateTo
({
url
:
`/src/pages/sharemoretheme/index?tid=
${
item
.
s
ource_
id
}
`
url
:
`/src/pages/sharemoretheme/index?tid=
${
item
.
s
ubject_mixture
.
subject_id
}
&sid=
${
this
.
data
.
s
id
}
`
})
break
;
default
:
break
;
}
}
})
\ No newline at end of file
src/pages/websiteindex/index.wxml
View file @
58a2ae8e
...
...
@@ -39,10 +39,10 @@
<image class="video-image" src="{{imageRoot}}2c/websiteindex/exabanner.png?{{imageVersion}}"></image>
</view>
</block>
<view class="notice-box">
<view class="notice-box"
wx:if="{{schoolInfo.notice}}"
>
<image class="icon-label" src="{{localImageRoot}}2c/websiteindex/icon_notice.png?{{imageVersion}}"></image>
<view class="text">
同学们好,疫情期间欢迎小朋友们进入在线课堂课堂课堂课堂课堂课堂
</view>
<
image class="icon-arr" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image
>
<view class="text">
{{schoolInfo.notice}}
</view>
<
!-- <image class="icon-arr" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image> --
>
</view>
</view>
...
...
@@ -55,8 +55,7 @@
<view class="info-r">
<view class="info-title">{{schoolInfo.title?schoolInfo.title: schoolDetail.title}}</view>
<view class="info-num-box">
<view class="num-item">书法美术书法术</view>
<view class="num-item">因材施教</view>
<view class="num-item" wx:for="{{schoolInfo.tags}}" wx:key="index">{{item}}</view>
</view>
</view>
<button open-type="share" class="page-share-btn">
...
...
@@ -92,18 +91,18 @@
</view>
<view class="address" wx:if="{{schoolInfo.distance}}">
<view class="main">{{schoolInfo.location_address}}</view>
<view class="other"
>自己设置的另外的
</view>
<view class="other"
wx:if="{{schoolInfo.address}}">{{schoolInfo.address}}
</view>
</view>
<view class="address" wx:else>
<view class="other">暂未设置位置信息</view>
</view>
<image class="icon-mobile" src="{{localImageRoot}}2c/websiteindex/website_phone.png?{{imageVersion}}"></image>
<image class="icon-mobile" src="{{localImageRoot}}2c/websiteindex/website_phone.png?{{imageVersion}}"
bindtap='makecall'
></image>
</view>
</view>
<view class="section-wrap section-ad">
<view class="section-wrap section-ad"
wx:if="{{adsTotal>0}}"
>
<swiper indicator-dots="{{false}}" autoplay="{{true}}" circular="{{true}}" style="height:180rpx;">
<swiper-item wx:for="{{
3
}}" wx:key="index">
<image class="cover" src="http://shangjiadao.oss-cn-hangzhou.aliyuncs.com/qingxiao/biz/image/common/defaultCourseImg.png" mode="
widthFix
"/>
<swiper-item wx:for="{{
adsList
}}" wx:key="index">
<image class="cover" src="http://shangjiadao.oss-cn-hangzhou.aliyuncs.com/qingxiao/biz/image/common/defaultCourseImg.png" mode="
aspectFill
"/>
</swiper-item>
</swiper>
</view>
...
...
@@ -175,14 +174,24 @@
<view class="box-title">
<view class="title">学校介绍</view>
</view>
<view class="desc-box" wx:if="{{schoolInfo.intro}}">
<view class="content">{{schoolInfo.intro}}</view>
</view>
<view class="instro-swiper" wx:if="{{schoolInfoTotal>0}}">
<swiper indicator-dots="{{false}}" autoplay="{{false}}" circular="{{true}}" style="height:368rpx;" bind
change="swiperChange
">
<swiper indicator-dots="{{false}}" autoplay="{{false}}" circular="{{true}}" style="height:368rpx;" bind
tap="toMoreList" data-type="schoolinfo
">
<swiper-item wx:for="{{schoolInfoList}}" wx:key="index">
<image class="cover" src="{{filter.imagify(item.content)}}" wx:if="{{item.type==1}}" mode="aspectFill"></image>
<image class="cover" src="{{filter.gifvideoPoster(item.content)}}" wx:else mode="aspectFill"></image>
<!-- <image src="{{filter.imagify(item)}}" class="slide-image" mode="widthFix"/> -->
</swiper-item>
</swiper>
<view class="label-box">
<view class="icon-item">
<image class="icon" src="{{localImageRoot}}2c/websiteindex/label_pic.png?{{imageVersion}}"></image>{{schoolInfoPicTotal}}
</view>
<view class="icon-item">
<image class="icon" src="{{localImageRoot}}2c/websiteindex/label_video.png?{{imageVersion}}"></image>{{schoolInfoVideoTotal}}
</view>
</view>
</view>
<view class="instro-swiper" wx:else>
<view class="list-item" wx:for="{{businessInstroEg}}" wx:key="index" >
...
...
@@ -191,22 +200,6 @@
</view>
</view>
</block>
<view class="section-wrap section-brick" wx:if="{{freshTotal>0}}">
<view class="box-title">
<view class="title">新鲜事</view>
<view class="right" bindtap="toMoreList" data-type="fresh">
更多<image class="icon-arr" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view>
</view>
<view class="brick-list">
<brick-layout
card="{{freshList}}"
bind:tapCard="tapCard"
type="{{3}}"
/>
</view>
<!-- <view class="btn-more" bindtap="toMoreList" data-type="fresh" wx:if="{{freshList.length>0}}">更多新鲜事动态</view> -->
</view>
<view class="section-wrap section-brick" wx:if="{{momentTotal>0}}">
<view class="box-title">
<view class="title">课堂瞬间</view>
...
...
@@ -248,19 +241,21 @@
<view class="section-wrap section-subject" wx:if="{{subjectList.length>0}}">
<view class="box-title">
<view class="title">一起打卡</view>
<view class="right"
bindtap="
">
<view class="right"
bindtap="goSubjectList
">
更多<image class="icon-arr" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view>
</view>
<view class="subject-list">
<view class="list-item" wx:for="{{subjectList}}" wx:key="index" bindtap="goSharemoretheme" data-item="{{item}}">
<view class="cover-box">
<image class="cover" src="{{filter.imagify(item.banner)}}" mode="aspectFill"/>
<image class="cover" src="{{filter.imagify(item.subject_mixture.subject.land_content.cover)}}" mode="aspectFill" wx:if="{{item.subject_mixture.subject_type==3}}"/>
<image class="cover" src="{{filter.imagify(item.subject_mixture.subject.land_content.cover)}}" mode="aspectFill" wx:else/>
<image class="cover" src="https://cdn.s.shangjiadao.cn/clock/min/b/5d68ddeace846.jpg" mode="aspectFill"/>
</view>
<view class="main">
<view class="title">{{item.title}}</view>
<view class="title">{{item.
subject_mixture.
title}}</view>
<view class="count-box">
<image class="icon" src="{{localImageRoot}}2c/websiteindex/icon_user.png?{{imageVersion}}"/>{{item.
invent_student
_count}}人参与
<image class="icon" src="{{localImageRoot}}2c/websiteindex/icon_user.png?{{imageVersion}}"/>{{item.
subject_mixture.subject_students
_count}}人参与
</view>
</view>
</view>
...
...
src/pages/websiteindex/index.wxss
View file @
58a2ae8e
...
...
@@ -98,7 +98,7 @@ page{
.banner-box .notice-box .text{
font-size: 22rpx;
color: #666;
max-width:
5
00rpx;
max-width:
6
00rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
...
...
@@ -838,17 +838,49 @@ page{
}
/* 机构介绍 */
.business-instro{}
.business-instro .desc-box{
padding: 0 24rpx;
position: relative;
}
.business-instro .desc-box .content{
font-size: 26rpx;
color: #666;
line-height: 40rpx;
}
.business-instro .instro-swiper{
padding: 0 24rpx;
border-radius: 10rpx;
overflow: hidden;
position: relative;
}
.business-instro .instro-swiper .cover{
width: 100%;
height: 100%;
border-radius: 10rpx;
}
.business-instro .instro-swiper .label-box{
position: absolute;
bottom: 24rpx;
right: 32rpx;
display: flex;
align-items: center;
}
.business-instro .instro-swiper .label-box .icon-item{
height: 42rpx;
display: flex;
align-items: center;
padding: 0 20rpx;
background: rgba(0,0,0,0.6);
border-radius: 21rpx;
font-size: 22rpx;
color: #fff;
margin-right: 16rpx;
}
.business-instro .instro-swiper .label-box .icon-item .icon{
width: 32rpx;
height: 24rpx;
margin-right: 13rpx;
}
/* 在线学堂 */
.online-classroom{}
.online-classroom .content-box{
...
...
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