Commit f73ef4b5 authored by lvtz's avatar lvtz

fix

parent 306f04ff
...@@ -57,6 +57,7 @@ Page({ ...@@ -57,6 +57,7 @@ Page({
titleBarHeight: app.globalData.titleBarHeight, titleBarHeight: app.globalData.titleBarHeight,
statusBarHeight: app.globalData.statusBarHeight, statusBarHeight: app.globalData.statusBarHeight,
localImageRoot: '../../../images/', localImageRoot: '../../../images/',
hasModuleSwitch: true,
egBanner: ['https://cdn.img.shangjiadao.cn/qingxiao/dakav2/images/2c/websiteindex/eg/eg_banner.png'], egBanner: ['https://cdn.img.shangjiadao.cn/qingxiao/dakav2/images/2c/websiteindex/eg/eg_banner.png'],
egBannerUrl: 'https://cdn.img.shangjiadao.cn/qingxiao/dakav2/images/2c/websiteindex/eg/eg_banner.png', egBannerUrl: 'https://cdn.img.shangjiadao.cn/qingxiao/dakav2/images/2c/websiteindex/eg/eg_banner.png',
egTag: ['标签一','标签二','标签三'], egTag: ['标签一','标签二','标签三'],
...@@ -226,14 +227,6 @@ Page({ ...@@ -226,14 +227,6 @@ Page({
} }
this.websitehomeGet(); this.websitehomeGet();
this.websitecourseshowGet(); this.websitecourseshowGet();
this.websiteintrosGet();
this.clockListGet();
this.teacherListGet();
this.adsListGet();
this.momentlistGet();
this.onlineCoursesListGet();
// this.websiteBarrage();//弹幕
this.subjectListGet()
}, },
onReady: function () { // Do something when page ready onReady: function () { // Do something when page ready
let that = this; let that = this;
...@@ -312,25 +305,7 @@ Page({ ...@@ -312,25 +305,7 @@ Page({
goBannerVideoPlay() { goBannerVideoPlay() {
return false return false
}, },
// 机构介绍
websiteintrosGet() {
websiteintros({
type: 1,
page: 1,
perPage: 4,
school_id: this.data.sid,
}).then((res) => {
const {
data,
code
} = res;
if (code == 200) {
this.setData({
schoolInfoList: [data.list]
})
}
})
},
expandSchoolInfo (e){ expandSchoolInfo (e){
this.setData({ this.setData({
infoexpanded: !this.data.infoexpanded infoexpanded: !this.data.infoexpanded
...@@ -383,6 +358,11 @@ Page({ ...@@ -383,6 +358,11 @@ Page({
adsList: data.list, adsList: data.list,
adsTotal: data.total adsTotal: data.total
}) })
if(this.data.adsTotal>0 && !this.data.hasModuleSwitch){
this.setData({
'schoolInfo.module_switch.adCarousel': true
})
}
} }
}).catch((e) => {}) }).catch((e) => {})
}, },
...@@ -403,6 +383,11 @@ Page({ ...@@ -403,6 +383,11 @@ Page({
teacherList: data.list, teacherList: data.list,
teacherTotal: data.total teacherTotal: data.total
}) })
if(this.data.teacherTotal>0 && !this.data.hasModuleSwitch){
this.setData({
'schoolInfo.module_switch.teacher': true
})
}
} }
}).catch((e) => {}) }).catch((e) => {})
}, },
...@@ -426,6 +411,11 @@ Page({ ...@@ -426,6 +411,11 @@ Page({
momentList: data.list, momentList: data.list,
momentTotal: data.total momentTotal: data.total
}) })
if(this.data.momentTotal>0 && !this.data.hasModuleSwitch){
this.setData({
'schoolInfo.module_switch.classmoments': true
})
}
} }
}).catch((e) => {}) }).catch((e) => {})
}, },
...@@ -444,6 +434,11 @@ Page({ ...@@ -444,6 +434,11 @@ Page({
this.setData({ this.setData({
onlineCoursesList: data.list onlineCoursesList: data.list
}) })
if(this.data.onlineCoursesList.length>0 && !this.data.hasModuleSwitch){
this.setData({
'schoolInfo.module_switch.onlineclass': true
})
}
} }
}) })
}, },
...@@ -494,6 +489,11 @@ Page({ ...@@ -494,6 +489,11 @@ Page({
clockList: data.list || [], clockList: data.list || [],
clockTotal: data.total_count clockTotal: data.total_count
}) })
if(this.data.clockTotal>0 && !this.data.hasModuleSwitch){
this.setData({
'schoolInfo.module_switch.clocklist': true
})
}
} }
} }
let clockRecordIds = data.list.map((ele) => { let clockRecordIds = data.list.map((ele) => {
...@@ -640,8 +640,16 @@ Page({ ...@@ -640,8 +640,16 @@ Page({
// const myLocation = LocalStorage.getItem('myLocation'); // const myLocation = LocalStorage.getItem('myLocation');
data.banner = data.banner ? JSON.parse(data.banner) : ''; data.banner = data.banner ? JSON.parse(data.banner) : '';
data.tags = data.tags ? JSON.parse(data.tags) : ''; data.tags = data.tags ? JSON.parse(data.tags) : '';
this.data.hasModuleSwitch = data.module_switch ? true : false;
data.module_switch = data.module_switch ? JSON.parse(data.module_switch): {"clocklist":true,"classmoments":true,"onlineclass":true}; data.module_switch = data.module_switch ? JSON.parse(data.module_switch): {
adCarousel: false,
orgdesc: false,
teacher: false,
clocklist: false,
classmoments: false,
onlineclass: false,
togetherclock: false,
};
let dataSort = ''; let dataSort = '';
// 机构信息/banner图片或视频/体验课 不参与排序 固定位置 // 机构信息/banner图片或视频/体验课 不参与排序 固定位置
...@@ -655,7 +663,7 @@ Page({ ...@@ -655,7 +663,7 @@ Page({
let removeItem3 = dataSort.findIndex( item => item.name=="course"); let removeItem3 = dataSort.findIndex( item => item.name=="course");
dataSort.splice(removeItem3,1) dataSort.splice(removeItem3,1)
} }
// 未设置微官网则 学生动态/学校介绍 // 未设置微官网
data.sort = data.sort ? dataSort : [ data.sort = data.sort ? dataSort : [
{ name: 'orgdesc', desc: '学校介绍'}, { name: 'orgdesc', desc: '学校介绍'},
{ name: 'clocklist', desc: '学生动态'}, { name: 'clocklist', desc: '学生动态'},
...@@ -665,7 +673,25 @@ Page({ ...@@ -665,7 +673,25 @@ Page({
{ name: 'onlineclass', desc: '在线课堂'}, { name: 'onlineclass', desc: '在线课堂'},
{ name: 'togetherclock', desc: '一起打卡'} { name: 'togetherclock', desc: '一起打卡'}
]; ];
if (!data.sort.find(ele => ele.name == 'classmoments')) {
data.sort.splice(2,0, { name: 'adCarousel', desc: '广告轮播'})
}
if (!data.sort.find(ele => ele.name == 'classmoments')) {
data.sort.push({ name: 'classmoments', desc: '课堂瞬间'})
}
if (!data.sort.find(ele => ele.name == 'onlineclass')) {
data.sort.push({ name: 'onlineclass', desc: '在线课堂'})
}
if (!data.sort.find(ele => ele.name == 'togetherclock')) {
data.sort.push({ name: 'togetherclock', desc: '一起打卡'})
}
this.websiteintrosGet();
this.clockListGet();
this.teacherListGet();
this.adsListGet();
this.momentlistGet();
this.onlineCoursesListGet();
this.subjectListGet();
}else{ }else{
this.schoolInfoGet() this.schoolInfoGet()
this.setData({ this.setData({
...@@ -676,15 +702,15 @@ Page({ ...@@ -676,15 +702,15 @@ Page({
// data.distance = getFlatternDistance(this.data.latitude, this.data.longitude, Number(data.latitude), Number(data.longitude)); // data.distance = getFlatternDistance(this.data.latitude, this.data.longitude, Number(data.latitude), Number(data.longitude));
this.setData({ this.setData({
schoolInfo: data ? data : '', bannerEmpty: data && data.banner ? false : true,
websitehomeEmpty: data && data.banner ? false : true schoolInfo: data ? data : ''
},()=>{ },()=>{
if(that.data.schoolInfo.intro && that.data.schoolInfo.module_switch.orgdesc){ if(that.data.schoolInfo.intro && that.data.schoolInfo.module_switch.orgdesc){
wx.createSelectorQuery().select('.business-instro .desc-box .content').boundingClientRect(function (rect) { wx.createSelectorQuery().select('.contentMock').boundingClientRect(function (rect) {
rect.height; // 节点高度 rect.height; // 节点高度
}).exec(function (res) { }).exec(function (res) {
let contectHeight = res[0].height; let contectHeight = res[0].height;
if(contectHeight>59){ if(contectHeight>60){
that.setData({ that.setData({
btnmore_isVisible: true, btnmore_isVisible: true,
}) })
...@@ -895,6 +921,11 @@ Page({ ...@@ -895,6 +921,11 @@ Page({
schoolInfoPicTotal: data.list.filter(item=>item.type==1 && item.show_status==1).length || 0, schoolInfoPicTotal: data.list.filter(item=>item.type==1 && item.show_status==1).length || 0,
schoolInfoVideoTotal: data.list.filter(item=>item.type==2 && item.show_status==1).length || 0, schoolInfoVideoTotal: data.list.filter(item=>item.type==2 && item.show_status==1).length || 0,
}) })
if(this.data.schoolInfoPicTotal+this.data.schoolInfoVideoTotal>0 && !this.data.hasModuleSwitch){
this.setData({
'schoolInfo.module_switch.orgdesc': true
})
}
} }
}) })
}, },
...@@ -961,6 +992,11 @@ Page({ ...@@ -961,6 +992,11 @@ Page({
subjectList: data.list || [] subjectList: data.list || []
}) })
} }
if(this.data.subjectTotal>0 && !this.data.hasModuleSwitch){
this.setData({
'schoolInfo.module_switch.togetherclock': true
})
}
} }
}).catch((e) => { }).catch((e) => {
this.setData({ this.setData({
......
...@@ -163,6 +163,7 @@ ...@@ -163,6 +163,7 @@
</view> </view>
<view class="desc-box" wx:if="{{schoolInfo.intro}}"> <view class="desc-box" wx:if="{{schoolInfo.intro}}">
<view class="content contentMock">{{schoolInfo.intro}}</view>
<view class="content {{infoexpanded?'extended':''}}">{{schoolInfo.intro}}</view> <view class="content {{infoexpanded?'extended':''}}">{{schoolInfo.intro}}</view>
<view class="expend-box" bindtap="expandSchoolInfo" wx:if="{{btnmore_isVisible}}">{{infoexpanded?'向下展开':'向上收起'}} <view class="expend-box" bindtap="expandSchoolInfo" wx:if="{{btnmore_isVisible}}">{{infoexpanded?'向下展开':'向上收起'}}
<image class="icon-arr {{infoexpanded?'':'icon-arr-trans'}}" src="{{imageRoot}}2c/websiteindex/icon_arrdown_yellow.png?{{imageVersion}}"></image> <image class="icon-arr {{infoexpanded?'':'icon-arr-trans'}}" src="{{imageRoot}}2c/websiteindex/icon_arrdown_yellow.png?{{imageVersion}}"></image>
......
...@@ -211,6 +211,7 @@ page{ ...@@ -211,6 +211,7 @@ page{
} }
.schoolinfo-box .address-box .icon-box{ .schoolinfo-box .address-box .icon-box{
width: 35rpx; width: 35rpx;
padding-top: 4rpx;
} }
.schoolinfo-box .address-box .icon-box .icon{ .schoolinfo-box .address-box .icon-box .icon{
width: 22rpx; width: 22rpx;
...@@ -250,7 +251,7 @@ page{ ...@@ -250,7 +251,7 @@ page{
position: absolute; position: absolute;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
right: 10rpx; right: 17rpx;
} }
.schoolinfo-box .part-box .content swiper-item{ .schoolinfo-box .part-box .content swiper-item{
line-height: 60rpx; line-height: 60rpx;
...@@ -866,6 +867,15 @@ page{ ...@@ -866,6 +867,15 @@ page{
font-size: 26rpx; font-size: 26rpx;
color: #666; color: #666;
line-height: 40rpx; line-height: 40rpx;
word-break: break-all;
}
.business-instro .desc-box .contentMock{
position: absolute;
left: 0;
width: 100%;
opacity: 0;
z-index: -9;
word-break: break-all;
} }
.business-instro .desc-box .content.extended{ .business-instro .desc-box .content.extended{
max-height: 120rpx; max-height: 120rpx;
......
export default { export default {
imageRoot: 'https://cdn.img.shangjiadao.cn/qingxiao/dakav2/images/', imageRoot: 'https://cdn.img.shangjiadao.cn/qingxiao/dakav2/images/',
host: 'https://qxapi.qingxiao.online/daka', // host: 'https://qxapi.qingxiao.online/daka',
host2: 'https://wx.m.shangjiadao.cn', // host2: 'https://wx.m.shangjiadao.cn',
storageVersion: '5.0', storageVersion: '5.0',
imageVersion: '20200420', imageVersion: '20200420',
// host: 'https://clock.wp53.cn', host: 'https://clock.wp53.cn',
// host2: 'https://test.wp53.cn', host2: 'https://test.wp53.cn',
appId: 'wxc1246ea029394785', appId: 'wxc1246ea029394785',
miniProgram: { miniProgram: {
clock: 'wxdeee20e52a1fd7ee' clock: 'wxdeee20e52a1fd7ee'
......
...@@ -747,7 +747,7 @@ ...@@ -747,7 +747,7 @@
/* 老师点评box */ /* 老师点评box */
.teacher-commnet-detail { .teacher-commnet-detail {
position: relative; /* position: relative; */
} }
.teacher-commnet-detail .teacher-avator-box { .teacher-commnet-detail .teacher-avator-box {
......
...@@ -214,17 +214,6 @@ Page({ ...@@ -214,17 +214,6 @@ Page({
infoexpanded: true,//默认收起 infoexpanded: true,//默认收起
}, },
onLoad: function (options) { // Do some initialize when page load. onLoad: function (options) { // Do some initialize when page load.
// this.innerAudioContext.onPlay(()=>{
// const { actPalyaudioValue, audioStorage} = this.data;
// console.log(audioStorage[actPalyaudioValue], 'audioStorage[actPalyaudioValue]')
// if(audioStorage[actPalyaudioValue]){
// this.innerAudioContext.seek(audioStorage[actPalyaudioValue].currentTime || 0)
// }
// this.data.audioStorage[actPalyaudioValue].isFirst = true;
// })
if (options.scene) { if (options.scene) {
let sceneQuery = scenQueryGet(options.scene); let sceneQuery = scenQueryGet(options.scene);
const { const {
...@@ -254,16 +243,8 @@ Page({ ...@@ -254,16 +243,8 @@ Page({
}).then(() => { }).then(() => {
this.websitehomeGet() this.websitehomeGet()
this.websitecourseshowGet() this.websitecourseshowGet()
// this.websiteintrosGet();
// this.clockListGet();
// this.teacherListGet();
// this.adsListGet();
// this.momentlistGet();
// this.onlineCoursesListGet();
this.userShow(); this.userShow();
// this.websiteBarrage();//弹幕 // const myLocation = LocalStorage.getItem('myLocation');
// this.subjectListGet();
const myLocation = LocalStorage.getItem('myLocation');
const that = this; const that = this;
wx.login({ wx.login({
success(res) { success(res) {
...@@ -283,8 +264,8 @@ Page({ ...@@ -283,8 +264,8 @@ Page({
this.setData({ this.setData({
unauthorized: true unauthorized: true
}) })
// this.websitehomeGet() this.websitehomeGet()
// this.websitecourseshowGet() this.websitecourseshowGet()
// this.websiteintrosGet(); // this.websiteintrosGet();
// this.clockListGet(); // this.clockListGet();
// this.momentlistGet(); // this.momentlistGet();
...@@ -985,7 +966,6 @@ Page({ ...@@ -985,7 +966,6 @@ Page({
if (code == 200) { if (code == 200) {
console.log(data,'data') console.log(data,'data')
if (data) { if (data) {
// const myLocation = LocalStorage.getItem('myLocation'); // const myLocation = LocalStorage.getItem('myLocation');
data.banner = data.banner ? JSON.parse(data.banner) : ''; data.banner = data.banner ? JSON.parse(data.banner) : '';
data.tags = data.tags ? JSON.parse(data.tags) : ''; data.tags = data.tags ? JSON.parse(data.tags) : '';
...@@ -1012,16 +992,7 @@ Page({ ...@@ -1012,16 +992,7 @@ Page({
let removeItem3 = dataSort.findIndex( item => item.name=="course"); let removeItem3 = dataSort.findIndex( item => item.name=="course");
dataSort.splice(removeItem3,1) dataSort.splice(removeItem3,1)
} }
// 未设置微官网则 学生动态/学校介绍 // 未设置微官网
// sort: [
// { name: 'orgdesc', desc: '学校介绍'},
// { name: 'clocklist', desc: '学生动态'},
// { name: 'adCarousel', desc: '广告轮播'},
// { name: 'teacher', desc: '名师风采'},
// { name: 'classmoments', desc: '课堂瞬间'},
// { name: 'onlineclass', desc: '在线课堂'},
// { name: 'togetherclock', desc: '一起打卡'}
// ],//默认排序
data.sort = data.sort ? dataSort : [ data.sort = data.sort ? dataSort : [
{ name: 'orgdesc', desc: '学校介绍'}, { name: 'orgdesc', desc: '学校介绍'},
{ name: 'clocklist', desc: '学生动态'}, { name: 'clocklist', desc: '学生动态'},
...@@ -1439,9 +1410,7 @@ Page({ ...@@ -1439,9 +1410,7 @@ Page({
schoolInfoPicTotal: data.list.filter(item=>item.type==1 && item.show_status==1).length || 0, schoolInfoPicTotal: data.list.filter(item=>item.type==1 && item.show_status==1).length || 0,
schoolInfoVideoTotal: data.list.filter(item=>item.type==2 && item.show_status==1).length || 0, schoolInfoVideoTotal: data.list.filter(item=>item.type==2 && item.show_status==1).length || 0,
}) })
console.log(!this.data.hasModuleSwitch, '!this.data.hasModuleSwitch');
if(this.data.schoolInfoPicTotal+this.data.schoolInfoVideoTotal>0 && !this.data.hasModuleSwitch){ if(this.data.schoolInfoPicTotal+this.data.schoolInfoVideoTotal>0 && !this.data.hasModuleSwitch){
console.log('JIDSFFV')
this.setData({ this.setData({
'schoolInfo.module_switch.orgdesc': true 'schoolInfo.module_switch.orgdesc': true
}) })
......
...@@ -113,25 +113,25 @@ ...@@ -113,25 +113,25 @@
<text class="title" bindtap="feedbackLog">意见反馈</text> <text class="title" bindtap="feedbackLog">意见反馈</text>
<text class="desc">不好用就吐槽</text> <text class="desc">不好用就吐槽</text>
</navigator> </navigator>
<view class="menu-item" wx:if="{{cSchoolTotal > 0}}" bindtap="loginToManager"> <!-- <view class="menu-item" wx:if="{{cSchoolTotal > 0}}" bindtap="loginToManager">
<loginbtn loginCode="{{loginCode}}"/> <loginbtn loginCode="{{loginCode}}"/>
<image class="menuicon" src="{{imageRoot}}2c/ucenter2/icon_exchangeschool.png?{{imageVersion}}"></image> <image class="menuicon" src="{{imageRoot}}2c/ucenter2/icon_exchangeschool.png?{{imageVersion}}"></image>
<text class="title">切换校区</text> <text class="title">切换校区</text>
<text class="desc"></text> <text class="desc"></text>
</view> </view> -->
<view class="menu-item"> <view class="menu-item">
<loginbtn loginCode="{{loginCode}}"/> <loginbtn loginCode="{{loginCode}}"/>
<view class="menu-item-inner" bindtap="loginToManager" wx:if="{{ loginStatus==1 }}"> <view class="menu-item-inner" bindtap="loginToManager" wx:if="{{ loginStatus==1 }}">
<image class="menuicon" src="{{imageRoot}}2c/ucenter2/icon_tologin.png?{{imageVersion}}"></image> <image class="menuicon" src="{{imageRoot}}2c/ucenter2/icon_tologin.png?{{imageVersion}}"></image>
<text class="title">机构登录</text> <text class="title">切换身份</text>
<text class="desc">老师/校长在这里登录</text> <text class="desc"></text>
</view> </view>
<button class="menu-item-inner" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:else> <button class="menu-item-inner" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:else>
<image class="menuicon" src="{{imageRoot}}2c/ucenter2/icon_tologin.png?{{imageVersion}}"></image> <image class="menuicon" src="{{imageRoot}}2c/ucenter2/icon_tologin.png?{{imageVersion}}"></image>
<text class="title">机构登录</text> <text class="title">切换身份</text>
<text class="desc">老师/校长在这里登录</text> <text class="desc"></text>
</button> </button>
</view> </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