Commit 4c1d3ca3 authored by lvtz's avatar lvtz

fix

parent c8f3b39a
......@@ -97,22 +97,10 @@ Page({
clockTotal: '',
listLoading: false,
shareBtnShow: 0,
sort: [{
name: 'schoolinfo',
desc: '机构信息',
}, {
name: 'banner',
desc: 'banner图片或视频',
}, {
name: 'course',
desc: '体验课',
}, {
name: 'clocklist',
desc: '学员动态',
}, {
name: 'orgdesc',
desc: '机构介绍',
}, ],
sort: [
{ name: 'orgdesc', desc: '学校介绍'},
{ name: 'clocklist', desc: '学生动态'}
],//默认排序
schoolDetail: '',
fixBottomBtn: false,
scorefeedbackshow: false,
......@@ -939,6 +927,7 @@ Page({
data.banner = data.banner ? JSON.parse(data.banner) : '';
data.tags = data.tags ? JSON.parse(data.tags) : '';
let dataSort = '';
// 机构信息/banner图片或视频/体验课 不参与排序 固定位置
if (data.sort) {
dataSort = JSON.parse(data.sort)
let removeItem1 = dataSort.findIndex( item => item.name=="banner");
......@@ -948,29 +937,13 @@ Page({
let removeItem3 = dataSort.findIndex( item => item.name=="course");
dataSort.splice(removeItem3,1)
}
// 未设置微官网则 学生动态/学校介绍
data.sort = data.sort ? dataSort : [
// {
// name: 'schoolinfo',
// desc: '机构信息',
// },
// {
// name: 'banner',
// desc: 'banner图片或视频',
// },
// {
// name: 'course',
// desc: '体验课',
// },
{
name: 'clocklist',
desc: '学员动态',
},
{
name: 'orgdesc',
desc: '机构介绍',
}
{ name: 'orgdesc', desc: '学校介绍'},
{ name: 'clocklist', desc: '学生动态'}
];
console.log(data.sort,'1112131223')
}else{
this.schoolInfoGet()
this.setData({
......@@ -979,12 +952,16 @@ Page({
})
}
console.log(data.sort,'11111')
data.distance = getFlatternDistance(this.data.latitude, this.data.longitude, Number(data.latitude), Number(data.longitude));
this.setData({
schoolInfo: data ? data : '',
websitehomeEmpty: data && data.banner ? false : true
},()=>{
console.log(this.data.schoolInfo.banner,'banner')
console.log(data.sort,'排序')
console.log(this.data.schoolInfo.sort,'schoolInfo.sort')
if(that.data.schoolInfo.banner.type=='video'){
wxGetImageInfo({src: videoPoster(that.data.schoolInfo.banner.src[0])}).then((res)=>{
let w=750, initratio, bannerVideoH;
......
......@@ -98,6 +98,11 @@
<image class="icon-mobile" src="{{localImageRoot}}2c/websiteindex/website_phone.png?{{imageVersion}}" bindtap="makecall" data-mobile="{{schoolInfo.tel_phone}}"></image>
</view>
</view>
<block wx:for="{{schoolInfo.sort?schoolInfo.sort:sort}}" wx:key="idx" wx:for-index="idx" wx:for-item="sortItem" >
<!-- 广告banner -->
<block wx:if="{{sortItem.name=='adCarousel'}}">
<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="{{adsList}}" wx:key="index">
......@@ -105,6 +110,9 @@
</swiper-item>
</swiper>
</view>
</block>
<!-- 名师风采 -->
<block wx:if="{{sortItem.name=='teacher'}}">
<view class="section-wrap section-teacher" wx:if="{{teacherTotal>0}}">
<view class="box-title">
<view class="title">名师风采<view class="text">({{teacherTotal}})</view></view>
......@@ -121,8 +129,45 @@
</view>
</view>
</view>
<block wx:for="{{schoolInfo.sort?schoolInfo.sort:sort}}" wx:key="idx" wx:for-index="idx" wx:for-item="sortItem" >
</block>
<!-- 学校介绍 -->
<view class="section-wrap business-instro" id="business-info" wx:if="{{sortItem.name=='orgdesc'}}">
<view class="box-title">
<view class="title">学校介绍</view>
<view class="right" bindtap="toMoreList" data-type="schoolinfo1" wx:if="{{schoolInfoTotal>0}}">
更多<image class="icon-arr" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view>
</view>
<view class="desc-box" wx:if="{{schoolInfo.intro}}">
<view class="content">{{schoolInfo.intro}}</view>
<view class="expend-box" bindtap="expandSchoolInfo">{{infoexpanded?'向下展开':'向上收起'}}
<image wx:if="{{infoexpanded}}" class="icon-arr" src="{{localImageRoot}}2c/websiteindex/icon_arrdown_yellow.png?{{imageVersion}}"></image>
<image wx:if="{{!infoexpanded}}" class="icon-arr icon-arr-trans" src="{{localImageRoot}}2c/websiteindex/icon_arrdown_yellow.png?{{imageVersion}}"></image>
</view>
</view>
<view class="instro-swiper" wx:if="{{schoolInfoTotal>0}}">
<swiper indicator-dots="{{false}}" autoplay="{{false}}" circular="{{true}}" style="height:368rpx;" bindtap="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>
</swiper-item>
</swiper>
<view class="label-box">
<view class="icon-item" bindtap="toMoreList" data-type="schoolinfo1">
<image class="icon" src="{{localImageRoot}}2c/websiteindex/label_pic.png?{{imageVersion}}"></image>{{schoolInfoPicTotal}}
</view>
<view class="icon-item" bindtap="toMoreList" data-type="schoolinfo2">
<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" >
<image class="cover" src="{{imageRoot}}2c/websiteindex/exainfo{{index+1}}.png?{{imageVersion}}"></image>
</view>
</view>
</view>
<!-- 学生动态 -->
<view class="section-wrap student-clock-box" id="student-clock" wx:if="{{sortItem.name=='clocklist'}}">
<block wx:if="{{clockList.length > 0}}">
<view class="box-title">
......@@ -169,43 +214,8 @@
<list-loading loading="{{listLoading}}"></list-loading>
<view class="btn-more" bindtap="goclocklist" wx:if="{{clockList.length > 0}}">查看更多学员作品</view>
</view>
<view class="section-wrap business-instro" id="business-info" wx:if="{{sortItem.name=='orgdesc'}}">
<view class="box-title">
<view class="title">学校介绍</view>
<view class="right" bindtap="toMoreList" data-type="schoolinfo1" wx:if="{{schoolInfoTotal>0}}">
更多<image class="icon-arr" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view>
</view>
<view class="desc-box" wx:if="{{schoolInfo.intro}}">
<view class="content">{{schoolInfo.intro}}</view>
<view class="expend-box" bindtap="expandSchoolInfo">{{infoexpanded?'向下展开':'向上收起'}}
<image wx:if="{{infoexpanded}}" class="icon-arr" src="{{localImageRoot}}2c/websiteindex/icon_arrdown_yellow.png?{{imageVersion}}"></image>
<image wx:if="{{!infoexpanded}}" class="icon-arr icon-arr-trans" src="{{localImageRoot}}2c/websiteindex/icon_arrdown_yellow.png?{{imageVersion}}"></image>
</view>
</view>
<view class="instro-swiper" wx:if="{{schoolInfoTotal>0}}">
<swiper indicator-dots="{{false}}" autoplay="{{false}}" circular="{{true}}" style="height:368rpx;" bindtap="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>
</swiper-item>
</swiper>
<view class="label-box">
<view class="icon-item" bindtap="toMoreList" data-type="schoolinfo1">
<image class="icon" src="{{localImageRoot}}2c/websiteindex/label_pic.png?{{imageVersion}}"></image>{{schoolInfoPicTotal}}
</view>
<view class="icon-item" bindtap="toMoreList" data-type="schoolinfo2">
<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" >
<image class="cover" src="{{imageRoot}}2c/websiteindex/exainfo{{index+1}}.png?{{imageVersion}}"></image>
</view>
</view>
</view>
</block>
<!-- 课堂瞬间 -->
<block wx:if="{{sortItem.name == 'classmoments'}}">
<view class="section-wrap section-brick" wx:if="{{momentTotal>0}}">
<view class="box-title">
<view class="title">课堂瞬间</view>
......@@ -221,6 +231,9 @@
/>
</view>
</view>
</block>
<!-- 在线课堂 -->
<block wx:if="{{sortItem.name == 'onlineclass'}}">
<view class="section-wrap online-classroom" wx:if="{{onlineCoursesList.length>0}}">
<view class="box-title">
<view class="title">在线课堂</view>
......@@ -243,6 +256,9 @@
</view>
</view>
</view>
</block>
<!-- 一起打卡 -->
<block wx:if="{{sortItem.name == 'togetherclock'}}">
<view class="section-wrap section-subject" wx:if="{{subjectList.length>0}}">
<view class="box-title">
<view class="title">一起打卡</view>
......@@ -266,6 +282,8 @@
<list-loading loading="{{subjectListLoading}}"></list-loading>
</view>
</view>
</block>
</block>
<view class="videodialog" wx:if="{{videostatus.videoShow}}">
<view class="videodialogmask" bindtap="closeVideo"></view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment