driverSchool/newPages/courseList/index.vue

119 lines
3.3 KiB
Vue
Raw Normal View History

2025-03-15 17:32:23 +08:00
<template>
<view class="page flex-col">
2025-04-07 16:47:05 +08:00
<view style="width: 100%;background: #f4f5f6;box-sizing: border-box;padding-top: 88px;">
<headers titles="课程">
<uni-icons type="left" color="#000000" size="22px"></uni-icons>
</headers>
2025-03-15 17:32:23 +08:00
</view>
2025-03-27 15:49:36 +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)">
2025-03-15 17:32:23 +08:00
<view class="image-text_1 flex-row">
<image
class="image_2"
referrerpolicy="no-referrer"
2025-03-27 15:49:36 +08:00
:src="imagesUrl + '/' + item.photo"
2025-03-15 17:32:23 +08:00
/>
<view class="text-group_1 flex-col justify-between">
2025-04-09 13:40:12 +08:00
<text class="text_3">{{ item.name }}</text>
2025-03-15 17:32:23 +08:00
<view class="text-wrapper_1 flex-row justify-between">
2025-04-09 10:56:33 +08:00
<text class="text_4">{{ item.price }}</text>
2025-03-15 17:32:23 +08:00
</view>
</view>
<view class="text-wrapper_3 flex-col">
2025-04-07 16:47:05 +08:00
<view style="display: flex">
2025-04-09 13:40:12 +08:00
<text class="text_7" style="background-color: rgba(223, 235, 255, 1);padding: 5rpx 15rpx">{{ item.tittle }}</text>
2025-04-07 16:47:05 +08:00
<text class="text-wrapper_2 text_7" style="color: black;padding: 5rpx 15rpx;margin-left: 10rpx">{{ item.type }}</text>
</view>
2025-03-15 17:32:23 +08:00
</view>
2025-04-07 16:47:05 +08:00
<!-- <view class="text-wrapper_3 flex-col">-->
<!-- <view >-->
<!-- <text class="text_7">{{ item.name }}</text>-->
<!-- </view>-->
<!-- <view class="text-wrapper_2 flex-col">-->
<!-- <text class="text_6">{{ item.type }}</text>-->
<!-- </view>-->
<!-- </view>-->
2025-03-15 17:32:23 +08:00
</view>
</view>
2025-03-27 15:49:36 +08:00
</scroll-view>
2025-04-07 16:47:05 +08:00
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-04-07 16:47:05 +08:00
import headers from "@/components/header/headers.vue";
2025-03-27 15:49:36 +08:00
2025-03-15 17:32:23 +08:00
export default {
2025-04-07 16:47:05 +08:00
components: {headers},
2025-03-15 17:32:23 +08:00
data() {
return {
2025-03-27 15:49:36 +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) {
this.tenantId = options.tenantId
this.getSchoolAllClass()
}
},
onReady() {
// 动态计算滚动区域高度
this.calculateScrollHeight();
},
methods: {
goBack() {
uni.navigateBack({
2025-04-07 16:47:05 +08:00
delta: 1
2025-03-27 15:49:36 +08:00
});
},
getSchoolAllClass() {
request({
url: '/app-api/dl-drive-school-course-small/list',
method: 'GET',
params: {
2025-04-07 16:47:05 +08:00
tenantId: this.tenantId,
2025-03-27 15:49:36 +08:00
},
2025-04-07 16:47:05 +08:00
tenantIdFlag: false
2025-03-27 15:49:36 +08:00
}).then(res => {
this.schoolAllClassList = res.data;
2025-04-07 16:47:05 +08:00
this.total = res.data.total;
2025-03-27 15:49:36 +08:00
})
},
2025-04-07 16:47:05 +08:00
2025-03-27 15:49:36 +08:00
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-04-09 13:40:12 +08:00
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>