Explorar o código

Signed-off-by: 李妹妹 <1639016684@qq.com>

李妹妹 hai 2 días
pai
achega
7c31cb5af7

+ 5 - 1
api/home.js

@@ -39,4 +39,8 @@ export function courseTypeDataApi(data) {
 // 课程列表分页
 export function courseListDataApi(data) {
 	return request('/app/course/publicCourse/list', data || {}, 'GET');
-}
+}
+//原乡行配置
+export function getHisStoreConfig(data) {
+	return request('/store/app/index/getHisStoreConfig', data || {}, 'GET');
+}

+ 1 - 1
pages/index/homePageSearch.vue

@@ -174,7 +174,7 @@ export default {
 				pageNum: this.searchPage.pageNum,
 				pageSize: this.searchPage.pageSize,
 				keyword: this.keywordValue,
-				yxxTag: 3
+				// yxxTag: 3
 			};
 			uni.showLoading({
 				title: "加载中...",

+ 21 - 5
pages/index/index.vue

@@ -126,7 +126,7 @@
 
 <script>
 import {
-	courseTypeDataApi, courseListDataApi
+	courseTypeDataApi, courseListDataApi,getHisStoreConfig
 } from '@/api/home'
 export default {
 	data() {
@@ -157,11 +157,12 @@ export default {
 				background: '#FFFFFFFF',
 				padding: '8rpx 20rpx 10rpx',
 				borderRadius: '32rpx'
-			}
+			},
+			yxy:{}
 		}
 	},
 	onLoad() {
-		this.getOneCourseTypeData()
+		this.loadConfig()
 		this.getFreeCourseTypeData()
 	},
 	methods: {
@@ -181,6 +182,21 @@ export default {
 				url: '/pages/index/video'
 			})
 		},
+		async loadConfig() {
+		  try {
+		    // 1. 先拿配置(必须等它完成)
+		    const res = await getHisStoreConfig({ name: 'moduleShow' })
+		    const list = res?.courseChannels || []
+		    const y = list.filter(item => item.dictLabel == '原乡行')
+		    this.yxy = y[0] || {}
+		
+		    // 2. 配置拿完,再加载视频(关键!)
+		    await this.getOneCourseTypeData()
+		  } catch (err) {
+		    console.error('加载配置失败', err)
+		    this.yxy = {}
+		  }
+		},
 		// 获取央广原乡行-类型
 		async getOneCourseTypeData() {
 			const params = {
@@ -188,7 +204,7 @@ export default {
 				pageSize: 4,
 				isShow: 1,
 				cateType: 1,
-				yxxTag: 1,
+				yxxTag:this.yxy.dictValue,
 				homePage: 1
 			};
 			const res = await courseTypeDataApi(params);
@@ -256,7 +272,7 @@ export default {
 				pageNum: 1,
 				pageSize: 10,
 				subCateId: cateId,
-				yxxTag: 1,
+				yxxTag:this.yxy.dictValue,
 				recommendSlot: 1,
 			};
 			const res = await courseListDataApi(params);

+ 20 - 5
pages/index/video.vue

@@ -120,7 +120,7 @@
 
 <script>
 import {
-	courseTypeDataApi, courseListDataApi
+	courseTypeDataApi, courseListDataApi,getHisStoreConfig
 } from '@/api/home'
 import { getCourseStudyList } from '@/api/course'
 export default {
@@ -149,10 +149,11 @@ export default {
 				pageSize: 6,
 				total: 0,
 			},
+			yxy:{}
 		}
 	},
 	onLoad() {
-		this.getOneCourseTypeData();
+		this.loadConfig();
 		this.getYxxCourseList();
 	},
 	methods: {
@@ -172,7 +173,21 @@ export default {
 				this.resetCourseStudyDataList()
 			}
 		},
-
+        async loadConfig() {
+          try {
+            // 1. 先拿配置(必须等它完成)
+            const res = await getHisStoreConfig({ name: 'moduleShow' })
+            const list = res?.courseChannels || []
+            const y = list.filter(item => item.dictLabel == '原乡行')
+            this.yxy = y[0] || {}
+        
+            // 2. 配置拿完,再加载视频(关键!)
+            await this.getOneCourseTypeData()
+          } catch (err) {
+            console.error('加载配置失败', err)
+            this.yxy = {}
+          }
+        },
 		// 获取学习记录课程列表
 		async getCourseStudyListMethos() {
 			const res = await getCourseStudyList({courseType:1},
@@ -249,7 +264,7 @@ export default {
 				pageSize: 50,
 				isShow: 1,
 				cateType: 1,
-				yxxTag: 1
+				yxxTag: this.yxy.dictValue,
 			};
 			const res = await courseTypeDataApi(params);
 			if (res.code === 200) {
@@ -263,7 +278,7 @@ export default {
 				pageNum: this.yxxPage.pageNum,
 				pageSize: this.yxxPage.pageSize,
 				subCateId: this.categoryIndex,
-				yxxTag: 1,
+				yxxTag:this.yxy.dictValue,
 			};
 			if (params.subCateId === 0) {
 				delete params.subCateId;

+ 5 - 5
pages_mall/components/RecommendSection.vue

@@ -116,11 +116,11 @@ export default {
 	},
 	methods: {
 	onLive(){
-		// uni.showToast({
-		// 	title: '暂无课程',
-		// 	icon: 'none'
-		// })
-		uni.navigateTo({ url: '/pages_live/livingList' })
+		uni.showToast({
+			title: '暂无课程',
+			icon: 'none'
+		})
+		//uni.navigateTo({ url: '/pages_live/livingList' })
 	},
 		onLiveSwiperChange(e) {
 			this.liveCurrent = e.detail.current

+ 2 - 2
pages_mall/my.vue

@@ -457,7 +457,7 @@
 			left: 0;
 			top: 0;
 			width: 100%;
-			height: 100%;
+		    height: 100%;
 			// background: linear-gradient(to bottom, #FF233C, #FFF5F5);
 			background-image: url("@/static/images/bg.png");
 			background-size: contain;
@@ -510,7 +510,7 @@
 	}
 
 	.cover-container {
-		margin-top: -110rpx;
+		margin-top: -70rpx;
 		padding: 0 24rpx;
 		position: relative;
 		padding-bottom: 120rpx;