Commit f73ef4b5 authored by lvtz's avatar lvtz

fix

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