driverSchool/pagesA/courseDetail/index.vue

158 lines
4.4 KiB
Vue
Raw Permalink Normal View History

2025-03-15 17:32:23 +08:00
<template>
<view class="page flex-col">
2025-04-09 10:05:29 +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>
<view class="group_3 flex-col">
2025-04-07 18:08:13 +08:00
<image
style="width: 100%; height: 100%;"
:src="imagesUrl + '/' + courseDetails.photo"
/>
2025-03-15 17:32:23 +08:00
</view>
<view class="group_4 flex-col">
<view class="section_2 flex-row justify-between">
<view class="text-wrapper_1">
<text class="text_3"></text>
2025-03-27 15:49:36 +08:00
<text class="text_4">{{ courseDetails.price ? courseDetails.price.toFixed(2) : '--' }}</text>
2025-03-15 17:32:23 +08:00
</view>
2025-04-09 16:01:16 +08:00
<!-- <text class="text_5">3000.00</text>-->
2025-03-15 17:32:23 +08:00
</view>
2025-03-27 15:49:36 +08:00
<text class="text_6">{{ courseDetails.name }}</text>
2025-03-15 17:32:23 +08:00
<view class="section_3 flex-row justify-between">
<view class="text-wrapper_2 flex-col">
2025-03-27 15:49:36 +08:00
<text class="text_7">{{ courseDetails.tittle }}</text>
2025-03-15 17:32:23 +08:00
</view>
<view class="text-wrapper_3 flex-col">
2025-03-27 15:49:36 +08:00
<text class="text_8">{{ courseDetails.type }}</text>
2025-03-15 17:32:23 +08:00
</view>
</view>
2025-04-09 16:01:16 +08:00
<text class="text_9">周一至周日&nbsp;08:00-18:00</text>
2025-03-15 17:32:23 +08:00
</view>
<view class="group_5 flex-col">
<view class="section_4 flex-row justify-between">
<view class="block_3 flex-col"></view>
2025-04-09 10:05:29 +08:00
<text class="text_10">课程介绍</text>
2025-03-15 17:32:23 +08:00
</view>
2025-04-09 13:40:12 +08:00
<view class="u-content" v-if="courseDetails.remark">
2025-04-09 10:05:29 +08:00
<u-parse :content="courseDetails.remark"></u-parse>
2025-03-15 17:32:23 +08:00
</view>
2025-04-09 13:40:12 +08:00
<view class="u-content" v-else>
<u-empty
mode="list"
text="该课程没有简介..."
>
</u-empty>
</view>
2025-03-15 17:32:23 +08:00
</view>
<view class="group_6 flex-row">
2025-03-27 15:49:36 +08:00
<view class="image-text_1 flex-col justify-between" @click="zxkf()">
2025-03-15 17:32:23 +08:00
<image
2025-04-07 18:08:13 +08:00
class="label_2"
referrerpolicy="no-referrer"
src="/static/lanhu_kechengxiangqing/FigmaDDSSlicePNG283b4603035848d5dcc7209d10653327.png"
2025-03-15 17:32:23 +08:00
/>
<text class="text-group_1">咨询客服</text>
</view>
2025-03-27 15:49:36 +08:00
<view class="text-wrapper_4 flex-col" @click="goRegisterNow()">
<text class="text_11">立即报名</text>
2025-03-15 17:32:23 +08:00
</view>
</view>
</view>
</template>
<script>
2025-03-27 15:49:36 +08:00
import request from "@/utils/request";
import config from "@/config.js"
2025-04-12 17:52:46 +08:00
import {getLocalUserInfo, getUserInfo, getToken} from "@/utils/auth";
2025-04-09 10:05:29 +08:00
import headers from "@/components/header/headers.vue";
2025-04-07 18:08:13 +08:00
2025-03-15 17:32:23 +08:00
export default {
2025-04-09 10:05:29 +08:00
components: {headers},
2025-03-15 17:32:23 +08:00
data() {
return {
2025-04-07 18:08:13 +08:00
courseId: undefined,
tenantId: undefined,
courseDetails: [],
driveSchoolPhone: [],
imagesUrl: config.imagesUrl,
userDetails: [],
2025-03-15 17:32:23 +08:00
};
},
2025-03-27 15:49:36 +08:00
onLoad(options) {
2025-04-07 18:08:13 +08:00
this.courseId = options.courseId;
this.tenantId = options.tenantId;
this.getCourseDetails();
2025-03-27 15:49:36 +08:00
this.userDetails = getLocalUserInfo();
2025-04-07 18:08:13 +08:00
this.getServicePhone()
},
2025-03-27 15:49:36 +08:00
methods: {
2025-04-07 18:08:13 +08:00
goBack() {
uni.navigateBack({
delta: 1
});
},
getCourseDetails() {
request({
url: '/app-api/dl-drive-school-course-small/get',
method: 'GET',
params: {
id: this.courseId,
tenantId: this.tenantId,
},
tenantIdFlag: false
}).then(res => {
this.courseDetails = res.data;
})
},
zxkf() {
uni.makePhoneCall({
phoneNumber: this.driveSchoolPhone.phone
});
},
getServicePhone() {
request({
url: '/app-api/dl-drive-school-course-small/getServicePhone',
method: 'GET',
params: {
tenantId: this.tenantId,
}
}).then(res => {
this.driveSchoolPhone = res.data
})
},
2025-03-27 15:49:36 +08:00
2025-04-07 18:08:13 +08:00
goRegisterNow() {
2025-04-12 17:52:46 +08:00
console.log('token',getToken())
if (!getToken()) {
uni.showModal({
title: '未登录',
content: '请先登录',
confirmText: '去登录',
success: (res) => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
});
}
}
});
return;
}
2025-04-07 18:08:13 +08:00
uni.navigateTo({
2025-04-15 17:47:29 +08:00
url: `/pagesA/register/index?courseId=${this.courseDetails.id}&userId=${this.userDetails.id}&tenantId=${this.tenantId}`,
2025-04-07 18:08:13 +08:00
// url: '/pages/index/bmPage'
});
},
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-04-09 10:05:29 +08:00
.u-content{
margin-top: 20rpx;
padding: 10rpx;
}
2025-03-15 17:32:23 +08:00
</style>