xuqiaoying 3 жил өмнө
parent
commit
5994a5e6ad

+ 1 - 1
common/request.js

@@ -33,7 +33,7 @@ RVQplIVs5z3MxcUa9ptKPHUTgh8xMCBvl8sUJKwkmn4vYWeDfHT22EL7Hr1pTMwU
 hF6WiNlWfQTVoF1rhwIDAQAB
 -----END PUBLIC KEY-----`;
 
-export const version = '1.3.12' 
+export const version = '1.3.16' 
 export const tenantId = '867735392558919680' 
 export const myRequest = (options) => {
 	if (store.state.allowLoading && !options.noLoading) {

+ 42 - 9
pages/index/index.vue

@@ -101,12 +101,12 @@
 			</view>
 			<view class="filters">
 				<scroll-view class="scroll_view_H" scroll-x="true" >
-					<template v-if="tabNum == 0">
+					<template v-if="tabNum == 0 && courseName.length > 1">
 						<view v-for="(item, index) in courseName" :key="index" class="filter_item"  @click="changeCou(item.recommendId, index)">
 							<view class="name" :class="{nactive: couIndex == index}">{{ item.name }}</view>
 						</view>
 					</template>
-					<template v-if="tabNum == 1">
+					<template v-if="tabNum == 1 && bankName.length > 1">
 						<view v-for="(item, index) in bankName" :key="index" class="filter_item" @click="changebank(item.recommendId, index)">
 							<view class="name" :class="{nactive: couIndex == index}">{{ item.name }}</view>
 						</view>
@@ -115,7 +115,8 @@
 			</view>
 			<view class="course-list" v-show="tabCurrent==0">
 				<template v-if="list1.length">
-					<navigator  hover-class="none" class="list_item" v-for="(item,index) in list1" :key="index" :url="'/pages3/course/detail?id='+item.goodsId">
+					<!-- hover-class="none" -->
+					<view  class="list_item" v-for="(item,index) in list1" :key="index" @click="tobuy(item)">
 						<view class="course_content">
 							<view class="c_title">{{item.goodsName}}</view>
 							<view class="c_downs">
@@ -144,7 +145,7 @@
 								</view>
 							</view>
 						</view>					
-					</navigator>
+					</view>
 				</template>
 				<template v-else>
 					<u-empty text="暂无推荐课程" mode="list" margin-top="100"></u-empty>
@@ -320,13 +321,27 @@ export default {
 			}
 		})
 	},
-	onShow() {
+	async onShow() {
+		// console.log('-----couIndex', this.couIndex, this.courseId)
 		this.getInfo() // 判断有没有关注公众号		
 		this.isClickOff() //关注公众号,每天最多显示1次;当天学员关闭弹窗后,无需再显示
 		uni.removeStorageSync('goPath')
-		this.list1 = []
-		this.list2 = []
-		this.courseLists();
+		
+		if (this.courseId || this.bankId) {
+			if (this.tabNum == 0) {
+				this.list1 = []
+				this.paramList[0].pageNum = 1
+				this.list1 = await this.getGoodsList(this.courseId, 0)
+			} else {
+				this.list2 = []
+				this.paramList[1].pageNum = 1
+				this.list2 = await this.getGoodsList(this.bankId, 1)
+			}
+		} else {
+			this.list1 = []
+			this.list2 = []
+			this.courseLists()
+		}
 		// this.bankList();
 		if (uni.getStorageSync('updateHome')){
 			this.init()
@@ -358,9 +373,11 @@ export default {
 	},
 	async onPullDownRefresh() {
 		if (this.tabNum == 0) {
+			this.list1 = []
 			this.paramList[0].pageNum = 1
 			this.list1 = await this.getGoodsList(this.courseId, 0)
 		} else {
+			this.list2 = []
 			this.paramList[1].pageNum = 1
 			this.list2 = await this.getGoodsList(this.bankId, 1)
 		}
@@ -394,6 +411,22 @@ export default {
 	},
 	methods: {
 		...mapActions(['getUserInfo','appCommonConfig']),
+		tobuy(item) {
+			console.log(item)
+			if (item.goodsType == 1) {
+                uni.navigateTo({
+                    url: '/pages3/course/detail?id='+item.goodsId
+                })
+            } else if (item.goodsType == 2) {
+                uni.navigateTo({
+                    url: '/pages2/bank/detail?id='+item.goodsId
+                })
+            } else {
+                uni.navigateTo({
+                    url: '/pages5/liveDetail/index?id='+item.goodsId
+                })
+            }
+		},
 		getInfo() {
 			// /app/user/getInfo 登录用户信息 // fromPlat来源平台 1小程序 2PC网站
 			this.$api.getInfo({ fromPlat: 1 }).then(res => {
@@ -570,7 +603,7 @@ export default {
 			this.paramList[1].pageNum = 1
 			this.list2 = []
 			let list2 = await this.getGoodsList(recommendId, 1)
-			this.list1.push(...list2)
+			this.list2.push(...list2)
 		},
 		//课程
 		 courseLists() {