he2802 4 yıl önce
ebeveyn
işleme
c898b80488

+ 3 - 1
common/api.js

@@ -9,6 +9,7 @@ import userInfo from './httpList/userInfo.js'
 import teacher from './httpList/teacher.js'
 import chapter from './httpList/chapter.js'
 import collect from './httpList/collect.js'
+import advertising from './httpList/advertising.js'
 export default {
 	...login,
 	...polyvVideo,
@@ -20,5 +21,6 @@ export default {
 	...userInfo,
 	...teacher,
 	...chapter,
-	...collect
+	...collect,
+	...advertising
 }

+ 14 - 0
common/httpList/advertising.js

@@ -0,0 +1,14 @@
+import {
+	myRequest
+} from '../request.js'
+export default {
+	advertisingList(data) {
+		return myRequest({
+			url: '/app/common/advertising/list',
+			method: 'get',
+			data: data,
+			noToken:true
+		})
+	},
+	
+}

+ 7 - 0
common/httpList/userInfo.js

@@ -10,4 +10,11 @@ export default {
 			data: data,
 		})
 	},
+	appInfoAttached(data) {
+		return myRequest({
+			url: '/app/user/infoAttached',
+			method: 'get',
+			data: data,
+		})
+	},
 }

+ 19 - 12
components/home.vue

@@ -7,7 +7,7 @@
 		</view>
 		<scroll-view scroll-y="true" @scroll="scroll" :style="'height: ' + windowHeight + 'px;'" @scrolltolower="scrollTolower">
 			<view class="box">
-				<view class="my_swiper"><u-swiper :list="list" height="330" border-radius="25" mode="none"></u-swiper></view>
+				<view class="my_swiper"><u-swiper :list="list" @click="swiperClick" height="330" border-radius="25" mode="none"></u-swiper></view>
 				<!-- 日历-->
 				<view class="calendar_card">
 					<view class="card_box">
@@ -133,17 +133,7 @@ export default {
 				}
 			],
 			current: 0,
-			list: [
-				{
-					image: 'http://192.168.0.222:8080/img/banner1.png'
-				},
-				{
-					image: 'https://cdn.uviewui.com/uview/swiper/2.jpg'
-				},
-				{
-					image: 'https://cdn.uviewui.com/uview/swiper/3.jpg'
-				}
-			],
+			list: [],
 			paramList: [
 				{
 					pageNum: 1,
@@ -176,8 +166,25 @@ export default {
 	mounted() {
 		this.windowHeight = uni.getSystemInfoSync().windowHeight;
 		this.initList();
+		this.advertisingList();
 	},
 	methods: {
+		swiperClick(index){
+			let item = this.list[index]
+			uni.navigateTo({
+				url: item.jumpUrl
+			});
+		},
+		advertisingList(){
+			let self = this
+			this.$api.advertisingList().then(res => {
+				let index;
+				for (index in res.data.rows ) {
+				  res.data.rows[index].image = res.data.rows[index].adverUrl
+				}
+				self.list = res.data.rows
+			});
+		},
 		initList() {
 			this.courseList();
 			this.bankList();

+ 12 - 2
components/my.vue

@@ -35,7 +35,7 @@
 								收藏
 							</view>
 							<view class="head_t2">
-								100
+								{{collectTotal}}
 							</view>
 						</navigator>
 					</u-col>
@@ -129,13 +129,23 @@
 			return {
 				list:[23,24,25,26,27,28,29],
 				content:'此功能暂未开放',
-				show:false
+				show:false,
+				collectTotal:0
 			};
 		},
+		mounted(){
+			this.getInfoAttached()
+		},
 		methods: {
 			jumpPopup(){
 				this.show = true
 			},
+			getInfoAttached(){
+				let self = this
+				this.$api.appInfoAttached().then(res => {
+					self.collectTotal = res.data.data.collectTotal
+				});
+			},
 			
 		},
 		computed: {...mapGetters(['userInfo'])}

+ 18 - 4
pages2/course/detail.vue

@@ -45,7 +45,7 @@
 							</view>
 						</u-col>
 						<u-col span="3" text-align="right">
-							<view class="video_t2" @click="activeStatus = !activeStatus">
+							<view class="video_t2" @click="swipStatus">
 								共{{ chapterList.length }}章节
 								<u-icon name="arrow-right" size="28" style="transition: all 0.2s;margin-left:10rpx" :class="activeStatus ? 'rotoct' : ''"></u-icon>
 							</view>
@@ -227,7 +227,8 @@ export default {
 			boxList: [], //章节弹窗列表
 			payStatus: true, //是否购买该课程
 			commendList: [], //推荐课程列表
-			collecStatus: false //收藏状态
+			collecStatus: false ,//收藏状态
+			initH4:0,
 		};
 	},
 	onLoad(option) {
@@ -270,6 +271,13 @@ export default {
 		}
 	},
 	methods: {
+		swipStatus(){
+			this.activeStatus = !this.activeStatus
+			let self = this
+			self.$nextTick(function(){
+				self.getHeight()
+			})
+		},
 		getHeight(){
 			let that = this
 			const query = uni.createSelectorQuery().in(this);
@@ -298,8 +306,10 @@ export default {
 			query
 				.select('#modules4')
 				.boundingClientRect(data => {
-					that.h4 = data.height;
-					console.log(data.height,4444)
+				//	that.h4 = data.height;
+					if(that.h4==0){
+						that.h4 = data.height
+					}
 					that.countHeight(that);
 				})
 				.exec();
@@ -358,6 +368,10 @@ export default {
 			};
 			this.$api.courseInforecommendList(data).then(res => {
 				self.commendList = res.data.data;
+				self.$nextTick(function(){
+					self.getHeight()
+				})
+				
 			});
 		},
 		activeList(item, index) {