|
|
@@ -241,50 +241,10 @@ export default {
|
|
|
},
|
|
|
onShow() {
|
|
|
let that = this;
|
|
|
- const query = uni.createSelectorQuery().in(this);
|
|
|
- query
|
|
|
- .select('#modules1')
|
|
|
- .boundingClientRect(data => {
|
|
|
- that.h1 = data.height;
|
|
|
- that.countHeight(that);
|
|
|
- })
|
|
|
- .exec();
|
|
|
- query
|
|
|
- .select('#modules2')
|
|
|
- .boundingClientRect(data => {
|
|
|
- that.h2 = data.height;
|
|
|
- that.countHeight(that);
|
|
|
- })
|
|
|
- .exec();
|
|
|
- query
|
|
|
- .select('#modules3')
|
|
|
- .boundingClientRect(data => {
|
|
|
- that.h3 = data.height;
|
|
|
- that.countHeight(that);
|
|
|
- })
|
|
|
- .exec();
|
|
|
- query
|
|
|
- .select('#modules4')
|
|
|
- .boundingClientRect(data => {
|
|
|
- that.h4 = data.height;
|
|
|
- that.countHeight(that);
|
|
|
- })
|
|
|
- .exec();
|
|
|
- query
|
|
|
- .select('#foot')
|
|
|
- .boundingClientRect(data => {
|
|
|
- that.foot_h = data.height;
|
|
|
- that.countModelusPadding();
|
|
|
- })
|
|
|
- .exec();
|
|
|
- query
|
|
|
- .select('#top')
|
|
|
- .boundingClientRect(data => {
|
|
|
- that.top_h = data.height;
|
|
|
- that.countModelusPadding();
|
|
|
- })
|
|
|
- .exec();
|
|
|
this.windowHeight = uni.getSystemInfoSync().windowHeight;
|
|
|
+ setTimeout(function(){
|
|
|
+ that.getHeight()
|
|
|
+ },1800)
|
|
|
},
|
|
|
onPageScroll: function(e) {
|
|
|
//防止触发两次跳动
|
|
|
@@ -305,6 +265,54 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ getHeight(){
|
|
|
+ let that = this
|
|
|
+ const query = uni.createSelectorQuery().in(this);
|
|
|
+ query
|
|
|
+ .select('#modules1')
|
|
|
+ .boundingClientRect(data => {
|
|
|
+ that.h1 = data.height;
|
|
|
+ that.countHeight(that);
|
|
|
+ })
|
|
|
+ .exec();
|
|
|
+ query
|
|
|
+ .select('#modules2')
|
|
|
+ .boundingClientRect(data => {
|
|
|
+ that.h2 = data.height;
|
|
|
+ console.log(data.height,66)
|
|
|
+ that.countHeight(that);
|
|
|
+ })
|
|
|
+ .exec();
|
|
|
+ query
|
|
|
+ .select('#modules3')
|
|
|
+ .boundingClientRect(data => {
|
|
|
+ that.h3 = data.height;
|
|
|
+ that.countHeight(that);
|
|
|
+ })
|
|
|
+ .exec();
|
|
|
+ query
|
|
|
+ .select('#modules4')
|
|
|
+ .boundingClientRect(data => {
|
|
|
+ that.h4 = data.height;
|
|
|
+ console.log(data.height,4444)
|
|
|
+ that.countHeight(that);
|
|
|
+ })
|
|
|
+ .exec();
|
|
|
+ query
|
|
|
+ .select('#foot')
|
|
|
+ .boundingClientRect(data => {
|
|
|
+ that.foot_h = data.height;
|
|
|
+ that.countModelusPadding();
|
|
|
+ })
|
|
|
+ .exec();
|
|
|
+ query
|
|
|
+ .select('#top')
|
|
|
+ .boundingClientRect(data => {
|
|
|
+ that.top_h = data.height;
|
|
|
+ that.countModelusPadding();
|
|
|
+ })
|
|
|
+ .exec();
|
|
|
+ },
|
|
|
favoritesStatus() {
|
|
|
this.$api.coursecollectPD(this.queryData.courseId).then(result => {
|
|
|
if (result.data.data === undefined) {
|
|
|
@@ -339,11 +347,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
getcommendList(v) {
|
|
|
+ let self = this
|
|
|
var data = {
|
|
|
courseId: v
|
|
|
};
|
|
|
this.$api.courseInforecommendList(data).then(res => {
|
|
|
- this.commendList = res.data.data;
|
|
|
+ self.commendList = res.data.data;
|
|
|
});
|
|
|
},
|
|
|
activeList(item, index) {
|
|
|
@@ -375,6 +384,7 @@ export default {
|
|
|
if (res.data.code === 200) {
|
|
|
self.pageData = res.data.data;
|
|
|
self.getTeacher(res.data.data.teacherIds);
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -385,21 +395,24 @@ export default {
|
|
|
};
|
|
|
this.$api.coursechapterlist(data).then(res => {
|
|
|
var chaList = res.data.rows;
|
|
|
- var dataset = {
|
|
|
- chapterId: res.data.rows[0].chapterId
|
|
|
- };
|
|
|
- self.$api.coursesectionlist(dataset).then(result => {
|
|
|
- self.getsec(result.data.rows[0]);
|
|
|
- });
|
|
|
+ if(chaList.length>0){
|
|
|
+ var dataset = {
|
|
|
+ chapterId: res.data.rows[0].chapterId
|
|
|
+ };
|
|
|
+ self.$api.coursesectionlist(dataset).then(result => {
|
|
|
+ self.getsec(result.data.rows[0]);
|
|
|
+ });
|
|
|
+ }
|
|
|
this.chapterList = chaList;
|
|
|
});
|
|
|
},
|
|
|
getTeacher(v) {
|
|
|
+ let self = this
|
|
|
var data = {
|
|
|
teacherIds: v
|
|
|
};
|
|
|
this.$api.teacherList(data).then(res => {
|
|
|
- this.teacherInfo = res.data.rows[0];
|
|
|
+ self.teacherInfo = res.data.rows[0];
|
|
|
});
|
|
|
},
|
|
|
startVideo() {
|