2025-03-15 17:32:23 +08:00
|
|
|
<template>
|
|
|
|
<view class="page flex-col">
|
|
|
|
<view class="group_1 flex-row">
|
2025-04-07 18:08:13 +08:00
|
|
|
|
2025-03-15 17:32:23 +08:00
|
|
|
</view>
|
|
|
|
<view class="group_2 flex-row">
|
|
|
|
<image
|
2025-04-07 18:08:13 +08:00
|
|
|
class="label_1"
|
|
|
|
referrerpolicy="no-referrer"
|
|
|
|
src="/static/lanhu_kechengliebiao/FigmaDDSSlicePNG53ddee177d4f9800624b95a9ec941112.png"
|
|
|
|
@click="goBack()"
|
2025-03-15 17:32:23 +08:00
|
|
|
/>
|
|
|
|
<text class="text_2">课程</text>
|
2025-04-07 18:08:13 +08:00
|
|
|
|
2025-03-15 17:32:23 +08:00
|
|
|
</view>
|
2025-04-07 18:08:13 +08:00
|
|
|
<scroll-view
|
|
|
|
class="scroll-view"
|
|
|
|
scroll-y
|
|
|
|
:style="{ height: scrollHeight + 'px' }"
|
|
|
|
>
|
|
|
|
<view class="group_6 flex-col" v-for="(item, index) in schoolAllClassList" :key="index"
|
|
|
|
@click="goToDetail(item.id)">
|
|
|
|
<view class="image-text_1 flex-row">
|
|
|
|
<image
|
|
|
|
class="image_2"
|
|
|
|
referrerpolicy="no-referrer"
|
|
|
|
:src="imagesUrl + '/' + item.photo"
|
|
|
|
/>
|
|
|
|
<view class="text-group_1 flex-col justify-between">
|
|
|
|
<text class="text_3">{{ item.tittle }}</text>
|
|
|
|
<view class="text-wrapper_1 flex-row justify-between">
|
|
|
|
<text class="text_4">¥{{ item.price - item.favour }}</text>
|
|
|
|
<text class="text_5">¥{{ item.price }}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="text-wrapper_2 flex-col">
|
|
|
|
<text class="text_6">{{ item.type }}</text>
|
|
|
|
</view>
|
|
|
|
<view class="text-wrapper_3 flex-col">
|
|
|
|
<text class="text_7">{{ item.name }}</text>
|
2025-03-15 17:32:23 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
2025-04-07 18:08:13 +08:00
|
|
|
</scroll-view>
|
|
|
|
|
2025-03-15 17:32:23 +08:00
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
<script>
|
2025-03-27 15:49:36 +08:00
|
|
|
import request from "@/utils/request";
|
|
|
|
import config from "@/config.js"
|
|
|
|
|
2025-03-15 17:32:23 +08:00
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
2025-04-07 18:08:13 +08:00
|
|
|
imagesUrl: config.imagesUrl,
|
|
|
|
tenantId: undefined,
|
|
|
|
schoolAllClassList: [],
|
|
|
|
scrollHeight: 0,
|
2025-03-15 17:32:23 +08:00
|
|
|
};
|
|
|
|
},
|
2025-03-27 15:49:36 +08:00
|
|
|
onLoad(options) {
|
|
|
|
if (options.tenantId) {
|
2025-04-07 18:08:13 +08:00
|
|
|
this.tenantId = options.tenantId
|
|
|
|
console.log("首页传入数据", options)
|
|
|
|
console.log("驾校租户id", this.tenantId)
|
|
|
|
this.getSchoolAllClass()
|
2025-03-27 15:49:36 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
onReady() {
|
2025-04-07 18:08:13 +08:00
|
|
|
// 动态计算滚动区域高度
|
|
|
|
this.calculateScrollHeight();
|
|
|
|
},
|
2025-03-27 15:49:36 +08:00
|
|
|
methods: {
|
2025-04-07 18:08:13 +08:00
|
|
|
goBack() {
|
|
|
|
uni.navigateBack({
|
|
|
|
delta: 1
|
|
|
|
});
|
|
|
|
},
|
|
|
|
getSchoolAllClass() {
|
|
|
|
request({
|
|
|
|
url: '/app-api/dl-drive-school-course-small/list',
|
|
|
|
method: 'GET',
|
|
|
|
params: {
|
|
|
|
tenantId: this.tenantId,
|
|
|
|
},
|
|
|
|
tenantIdFlag: false
|
|
|
|
}).then(res => {
|
|
|
|
this.schoolAllClassList = res.data;
|
|
|
|
this.total = res.data.total;
|
|
|
|
console.log('驾校课程列表', this.schoolAllClassList);
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
calculateScrollHeight() {
|
|
|
|
// 获取屏幕高度
|
|
|
|
const screenHeight = uni.getSystemInfoSync().windowHeight;
|
|
|
|
// 获取顶部区域高度(根据实际情况调整)
|
|
|
|
const topHeight = 100; // 假设顶部区域高度为 100px
|
|
|
|
// 计算滚动区域高度
|
|
|
|
this.scrollHeight = screenHeight - topHeight;
|
|
|
|
},
|
|
|
|
// 跳转到详情页
|
|
|
|
goToDetail(courseId) {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/newPages/courseDetail/index?courseId=${courseId}&tenantId=${this.tenantId}`,
|
|
|
|
});
|
|
|
|
},
|
2025-03-27 15:49:36 +08:00
|
|
|
}
|
2025-03-15 17:32:23 +08:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style lang='scss'>
|
|
|
|
@import '../common/common.scss';
|
|
|
|
@import './assets/style/index.rpx.scss';
|
2025-03-27 15:49:36 +08:00
|
|
|
|
|
|
|
.scroll-view {
|
|
|
|
flex: 1;
|
|
|
|
overflow-y: auto;
|
|
|
|
}
|
2025-03-15 17:32:23 +08:00
|
|
|
</style>
|