This commit is contained in:
Lx 2025-04-16 17:41:03 +08:00
parent b741f1140a
commit 222dd08ee9
4 changed files with 407 additions and 422 deletions

View File

@ -195,6 +195,7 @@
flex-direction: column; flex-direction: column;
padding: 0 20rpx; padding: 0 20rpx;
box-sizing: border-box; box-sizing: border-box;
} }
} }
.messageItem { .messageItem {

View File

@ -175,7 +175,9 @@ export default {
}, },
onShow() { onShow() {
if (getToken()) { if (getToken()) {
// this.findSelfInfo() this.selfInfoLocal = getLocalUserInfo()
this.getUserInfo()
this.systemInfo()
} }
}, },

View File

@ -1,230 +1,212 @@
<template> <template>
<view class="page flex-col"> <view class="page flex-col">
<view class="top_"> <view class="top_">
<u-swiper class="lunbo_" :list="swiperList" keyName="swiperPicture" radius="10" height="300" indicator <u-swiper class="lunbo_" :list="swiperList" keyName="swiperPicture" radius="10" height="300" indicator
indicatorMode="line"></u-swiper> indicatorMode="line"></u-swiper>
</view> </view>
<view class="section_2 flex-col"> <view class="section_2 flex-col">
<view class="list_1 flex-row"> <view class="list_1 flex-row">
<view <view class="image-text_1 flex-col align-items-center justify-content-center;"
class="image-text_1 flex-col align-items-center justify-content-center;" v-for="(item, index) in loopData0" :key="index" @click="handleItemClick(item)">
v-for="(item, index) in loopData0" <image class="label_1" referrerpolicy="no-referrer" :src="item.url" />
:key="index" <text class="text-group_1" v-text="item.text"></text>
@click="handleItemClick(item)" </view>
> </view>
<image <view class="box_4 flex-row justify-between">
class="label_1"
referrerpolicy="no-referrer"
:src="item.url"
/>
<text class="text-group_1" v-text="item.text"></text>
</view>
</view>
<view class="box_4 flex-row justify-between">
<view class="image-text_2 flex-row justify-between"> <view class="image-text_2 flex-row justify-between">
<!-- <u-notice-bar direction="column" duration="10000" bgColor="#e9f1ff" color="black" :text="textList.map(item => item.title)" @click="handleNoticeClick" icon="/static/lanhu_shouye2gai/FigmaDDSSlicePNGd2c17b5f24182e597acbfa50481040c1.png"></u-notice-bar> --> <!-- <u-notice-bar direction="column" duration="10000" bgColor="#e9f1ff" color="black" :text="textList.map(item => item.title)" @click="handleNoticeClick" icon="/static/lanhu_shouye2gai/FigmaDDSSlicePNGd2c17b5f24182e597acbfa50481040c1.png"></u-notice-bar> -->
<u-notice-bar <u-notice-bar direction="column" duration="10000" bgColor="#e9f1ff" color="black" :text="textList"
direction="column" @click="handleNoticeClick"
duration="10000" icon="/static/lanhu_shouye2gai/FigmaDDSSlicePNGd2c17b5f24182e597acbfa50481040c1.png" />
bgColor="#e9f1ff" </view>
color="black"
:text="textList"
@click="handleNoticeClick"
icon="/static/lanhu_shouye2gai/FigmaDDSSlicePNGd2c17b5f24182e597acbfa50481040c1.png"
/>
</view>
<view class="group_3 flex-col justify-between"> <view class="group_3 flex-col justify-between">
<view class="block_5 flex-col"></view> <view class="block_5 flex-col"></view>
<view class="block_6 flex-col"></view> <view class="block_6 flex-col"></view>
<view class="block_7 flex-col"></view> <view class="block_7 flex-col"></view>
</view> </view>
</view> </view>
<view class="box_5 flex-row justify-between"> <view class="box_5 flex-row justify-between">
<text class="text_2">优质驾校</text> <text class="text_2">优质驾校</text>
<view class="image-text_3 flex-row justify-between"> <view class="image-text_3 flex-row justify-between">
<text class="text-group_3" @click="goSchoolList()">查看更多</text> <text class="text-group_3" @click="goSchoolList()">查看更多</text>
<image <image class="thumbnail_2" referrerpolicy="no-referrer"
class="thumbnail_2" src="/static/lanhu_shouye2gai/FigmaDDSSlicePNGc8586e4d9e76802e4b93ae8fb3654b38.png" />
referrerpolicy="no-referrer" </view>
src="/static/lanhu_shouye2gai/FigmaDDSSlicePNGc8586e4d9e76802e4b93ae8fb3654b38.png" </view>
/> <view class="itemContent">
</view> <!-- 使用 scroll-view 包裹 SchoolInfo 组件 -->
</view> <scroll-view class="school-scroll-view" scroll-y>
<view class="itemContent"> <SchoolInfo style="" v-for="(school, index) in schoolList" :key="index" :schoolInfo="school"
<!-- 使用 scroll-view 包裹 SchoolInfo 组件 --> @click="goSchoolDetail(school)" />
<scroll-view class="school-scroll-view" scroll-y > </scroll-view>
<SchoolInfo style="" v-for="(school, index) in schoolList" :key="index" :schoolInfo="school" </view>
@click="goSchoolDetail(school)"/>
</scroll-view>
</view>
</view> </view>
<!-- <tabbar :msg='msg'></tabbar> --> <!-- <tabbar :msg='msg'></tabbar> -->
</view> </view>
</template> </template>
<script> <script>
import SchoolInfo from './SchoolInfo.vue'; import SchoolInfo from './SchoolInfo.vue';
import request from "@/utils/request"; import request from "@/utils/request";
import { import {
getCoachId, getCoachId,
getInviteId, getInviteId,
getLocalUserInfo, getLocalUserInfo,
getToken, getToken,
removeCoachId, removeCoachId,
removeInviteId, removeInviteId,
removeTenantId, removeTenantId,
setCoachId, setCoachId,
setInviteId, setInviteId,
setLocalUserInfo, setLocalUserInfo,
setStaffType, setStaffType,
setTenantId setTenantId
} from '@/utils/auth' } from '@/utils/auth'
export default { export default {
components: { components: {
SchoolInfo SchoolInfo
}, },
data() { data() {
return { return {
loopData0: [ loopData0: [{
{ url: '/static/lanhu_shouye2gai/xcbm.png',
url: '/static/lanhu_shouye2gai/xcbm.png', text: '学车报名'
text: '学车报名' },
}, {
{ url: '/static/lanhu_shouye2gai/yyxl.png',
url: '/static/lanhu_shouye2gai/yyxl.png', text: '预约训练'
text: '预约训练' },
}, {
{ url: '/static/lanhu_shouye2gai/kslr.png',
url: '/static/lanhu_shouye2gai/kslr.png', text: '考试结果录入'
text: '考试结果录入' },
}, {
{ url: '/static/lanhu_shouye2gai/pj.png',
url: '/static/lanhu_shouye2gai/pj.png', text: '评价'
text: '评价' },
}, ],
], swiperList: [],
swiperList: [], msg: "1",
msg: "1", constants: {},
constants: {}, schoolList: [],
schoolList: [], //
// isTriggered: false,
isTriggered: false, pageNo: 1,
pageNo: 1, pageSize: 10,
pageSize: 10, total: 0,
total: 0, imageUrl: this.$imagesUrl,
imageUrl: this.$imagesUrl, textList: [],
textList:[], noticeList: [],
noticeList: [], qTenantId: null,
qTenantId: null, qCoachId: null,
qCoachId: null, };
}; },
}, onLoad(query) {
onLoad(query) { console.log('query', query)
console.log('query',query) // setInviteId('JLPXF1')
// setInviteId('JLPXF1') // this.getTenantIdByInviteId()
// this.getTenantIdByInviteId() this.getSwiperList()
this.getSwiperList() this.getTextList()
this.getTextList()
const q = decodeURIComponent(query.q) // const q = decodeURIComponent(query.q) //
let theRequest = this.getUrlValue(q) let theRequest = this.getUrlValue(q)
if(theRequest.hasOwnProperty("inviteId")){ if (theRequest.hasOwnProperty("inviteId")) {
//code //code
setInviteId(theRequest['inviteId']) setInviteId(theRequest['inviteId'])
this.getTenantIdByInviteId() this.getTenantIdByInviteId()
/* //先登录 /* //先登录
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/login' url: '/pages/login/login'
}) */ }) */
}else{ } else {
removeInviteId() removeInviteId()
removeCoachId() removeCoachId()
removeTenantId() removeTenantId()
this.getList()
/* uni.reLaunch({
url: '/pages-home/home/home'
}) */
}
},
methods: {
getTenantIdByInviteId(){
console.log('1122', getInviteId())
if(!getInviteId()){
console.log(1)
this.getList()
return
}
request({
url: '/app-api/dl-drive-school-coach-small/getCoachByUniqueCode',
method: 'GET',
params: {
uniqueCode: getInviteId()
}
}).then(res => {
console.log(123)
if(res.data != null){
this.qTenantId = res.data.tenantId
this.qCoachId = res.data.userId
setTenantId(res.data.tenantId)
this.getList() this.getList()
if(res.data.type == 'jl'){ /* uni.reLaunch({
setCoachId(res.data.userId) url: '/pages-home/home/home'
setStaffType('02') }) */
}
if(res.data.type == 'yg'){
setCoachId(res.data.userId)
setStaffType('01')
}
} }
}) },
}, methods: {
getList() { getTenantIdByInviteId() {
console.log('getInviteId',getInviteId()) console.log('1122', getInviteId())
const params = { if (!getInviteId()) {
pageNo: this.pageNo, console.log(1)
pageSize: this.pageSize, this.getList()
serviceCodes: 'jiaxiao', return
}; }
request({
url: '/app-api/dl-drive-school-coach-small/getCoachByUniqueCode',
method: 'GET',
params: {
uniqueCode: getInviteId()
}
}).then(res => {
console.log(123)
if (res.data != null) {
this.qTenantId = res.data.tenantId
this.qCoachId = res.data.userId
setTenantId(res.data.tenantId)
this.getList()
if (res.data.type == 'jl') {
setCoachId(res.data.userId)
setStaffType('02')
}
if (res.data.type == 'yg') {
setCoachId(res.data.userId)
setStaffType('01')
}
}
})
},
getList() {
console.log('getInviteId', getInviteId())
const params = {
pageNo: this.pageNo,
pageSize: this.pageSize,
serviceCodes: 'jiaxiao',
};
if (this.qTenantId) { if (this.qTenantId) {
params.tenantId = this.qTenantId; params.tenantId = this.qTenantId;
} }
console.log('params', params) console.log('params', params)
request({ request({
url: '/userClient/base/companySmallProgram/pageNoTenantId', url: '/userClient/base/companySmallProgram/pageNoTenantId',
method: 'GET', method: 'GET',
params: params, params: params,
tenantIdFlag: false tenantIdFlag: false
}).then(res => { }).then(res => {
res.data.records.forEach(item => { res.data.records.forEach(item => {
item.features = ['有接送', '规模大'] item.features = ['有接送', '规模大']
item.imageUrl = this.imageUrl + '/' + item.photo item.imageUrl = this.imageUrl + '/' + item.photo
}) })
this.schoolList = this.schoolList.concat(res.data.records) this.schoolList = this.schoolList.concat(res.data.records)
this.isTriggered = false this.isTriggered = false
this.total = res.data.total this.total = res.data.total
console.log(res) console.log(res)
}) })
}, },
getUrlValue(url) { getUrlValue(url) {
var theRequest = new Object(); var theRequest = new Object();
if (url.indexOf("?") != -1) { if (url.indexOf("?") != -1) {
// //
var str = url.split("?")[1]; var str = url.split("?")[1];
var strs = str.split("&"); var strs = str.split("&");
for (var i = 0; i < strs.length; i++) { for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]); theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
} }
} }
return theRequest return theRequest
}, },
/** /**
* 实时讯息 * 实时讯息
*/ */
/* async getTextList() { /* async getTextList() {
let res = await request({ let res = await request({
url: '/app-api/base/notice/pageList', url: '/app-api/base/notice/pageList',
method: 'get', method: 'get',
@ -240,189 +222,191 @@ export default {
this.textList.push(item.title) this.textList.push(item.title)
}) })
}, */ }, */
async getTextList() { async getTextList() {
let res = await request({ let res = await request({
url: '/app-api/base/notice/pageList', url: '/app-api/base/notice/pageList',
method: 'get', method: 'get',
params: { params: {
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,
parentServer: 'jiaxiao', parentServer: 'jiaxiao',
server: 'wx' server: 'wx'
} }
}) })
this.noticeList = res.data.records // this.noticeList = res.data.records //
this.textList = res.data.records.map(item => item.title) // title this.textList = res.data.records.map(item => item.title) // title
}, },
handleNoticeClick(index) { handleNoticeClick(index) {
const currentNotice = this.noticeList[index] const currentNotice = this.noticeList[index]
if (currentNotice && currentNotice.id) { if (currentNotice && currentNotice.id) {
uni.navigateTo({ uni.navigateTo({
url: `/pagesA/noticeContent/index?id=${currentNotice.id}` url: `/pagesA/noticeContent/index?id=${currentNotice.id}`
}) })
} }
}, },
getSwiperList() { getSwiperList() {
request({ request({
url: '/app-api/drivingSchool/text/swiper/list', url: '/app-api/drivingSchool/text/swiper/list',
method: 'GET' method: 'GET'
}).then(res => { }).then(res => {
res.data.forEach(item => { res.data.forEach(item => {
item.swiperPicture = this.imageUrl + '/' + item.swiperPicture item.swiperPicture = this.imageUrl + '/' + item.swiperPicture
}) })
this.swiperList = res.data this.swiperList = res.data
}) })
}, },
/** /**
* 上滑加载数据 * 上滑加载数据
*/ */
onReachBottomCus() { onReachBottomCus() {
// * // *
if (this.pageNo * this.pageSize >= this.total) { if (this.pageNo * this.pageSize >= this.total) {
uni.$u.toast('没有更多数据了') uni.$u.toast('没有更多数据了')
return return
} }
//+1, //+1,
this.pageNo++ this.pageNo++
// //
this.getList() this.getList()
}, },
/** /**
* 下拉刷新数据 * 下拉刷新数据
*/ */
onRefresherrefresh() { onRefresherrefresh() {
this.isTriggered = true this.isTriggered = true
this.pageNo = 1 this.pageNo = 1
this.total = 0 this.total = 0
this.schoolList = [] this.schoolList = []
this.getList() this.getList()
}, },
goSchoolList() { goSchoolList() {
uni.navigateTo({ uni.navigateTo({
url: '/newPages/schoolList/index', url: '/newPages/schoolList/index',
}); });
}, },
goSchoolDetail(data) { goSchoolDetail(data) {
uni.navigateTo({ uni.navigateTo({
url: `/newPages/schoolDetail/index?id=${data.id}&tenantId=${data.tenantId}&schoolName=${data.corpName}`, url: `/newPages/schoolDetail/index?id=${data.id}&tenantId=${data.tenantId}&schoolName=${data.corpName}`,
// url: '/newPages/schoolDetail/index', // url: '/newPages/schoolDetail/index',
}); });
}, },
handleItemClick(item) { handleItemClick(item) {
// item.text // item.text
switch (item.text) { switch (item.text) {
case '学车报名': case '学车报名':
uni.navigateTo({ uni.navigateTo({
url: '/newPages/schoolList/index' url: '/newPages/schoolList/index'
}); });
break; break;
case '预约训练': case '预约训练':
if (!getToken()) { if (!getToken()) {
/* uni.showToast({ /* uni.showToast({
title: '请先登录', title: '请先登录',
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); */ }); */
uni.showModal({ uni.showModal({
title: '未登录', title: '未登录',
content: '请先登录', content: '请先登录',
confirmText: '去登录', confirmText: '去登录',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/login/login' url: '/pages/login/login'
}); });
}
}
});
return;
}
uni.navigateTo({
url: '/pagesA/appointment/index'
});
break;
case '考试结果录入':
if (!getToken()) {
uni.showModal({
title: '未登录',
content: '请先登录',
confirmText: '去登录',
success: (res) => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
});
}
}
});
return;
}
uni.navigateTo({
url: '/pagesA/examinationList/index'
});
break;
case '评价':
if (!getToken()) {
uni.showModal({
title: '未登录',
content: '请先登录',
confirmText: '去登录',
success: (res) => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
});
}
}
});
return;
}
uni.navigateTo({
url: '/pagesA/evaluate/index'
});
break;
default:
console.warn('未知的点击项:', item.text);
break;
} }
} }
});
return;
}
uni.navigateTo({
url: '/pagesA/appointment/index'
});
break;
case '考试结果录入':
if (!getToken()) {
uni.showModal({
title: '未登录',
content: '请先登录',
confirmText: '去登录',
success: (res) => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
});
}
}
});
return;
}
uni.navigateTo({
url: '/pagesA/examinationList/index'
});
break;
case '评价':
if (!getToken()) {
uni.showModal({
title: '未登录',
content: '请先登录',
confirmText: '去登录',
success: (res) => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
});
}
}
});
return;
}
uni.navigateTo({
url: '/pagesA/evaluate/index'
});
break;
default:
console.warn('未知的点击项:', item.text);
break;
}
}
} }
}; };
</script> </script>
<style lang='scss'> <style lang='scss'>
@import '../common/common.scss'; @import '../common/common.scss';
@import './assets/style/index.rpx.scss'; @import './assets/style/index.rpx.scss';
// 使
.text-group_1 {
text-align: center;
}
// image-text_1 使 // 使
.image-text_1 { .text-group_1 {
display: flex; text-align: center;
flex-direction: column; }
align-items: center; // 使
justify-content: center; // 使
}
// scroll-view // image-text_1 使
.school-scroll-view { .image-text_1 {
height: 500rpx; // display: flex;
overflow-y: auto; flex-direction: column;
margin-left: 22rpx; align-items: center; // 使
} justify-content: center; // 使
}
.itemContent { // scroll-view
padding: 30rpx 0; .school-scroll-view {
display: flex; height: 500rpx; //
flex-direction: column; overflow-y: auto;
row-gap: 20rpx; margin-left: 22rpx;
} }
.top_ { .itemContent {
//padding-top: 200rpx; padding: 30rpx 0;
} display: flex;
</style> flex-direction: column;
row-gap: 20rpx;
margin-bottom: 200rpx;
}
.top_ {
//padding-top: 200rpx;
}
</style>

View File

@ -32,7 +32,7 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "newPages/orderList/index", "path": "newPages/orderList/index",
"style": { "style": {
@ -41,8 +41,8 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "newPages/courseList/index", "path": "newPages/courseList/index",
"style": { "style": {
@ -51,7 +51,7 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "newPages/my/index", "path": "newPages/my/index",
"style": { "style": {
@ -60,7 +60,7 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "newPages/schoolDetail/index", "path": "newPages/schoolDetail/index",
"style": { "style": {
@ -69,9 +69,9 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "newPages/schoolList/index", "path": "newPages/schoolList/index",
"style": { "style": {
@ -80,7 +80,7 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "newPages/messageCenter/index", "path": "newPages/messageCenter/index",
"style": { "style": {
@ -99,11 +99,9 @@
} }
], ],
"subPackages": [ "subPackages": [{
{
"root": "pagesA", "root": "pagesA",
"pages": [ "pages": [{
{
"path": "appointmentAdd/index", "path": "appointmentAdd/index",
"style": { "style": {
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
@ -194,28 +192,28 @@
] ]
}, },
{ {
"root": "uni_modules", "root": "uni_modules",
"name": "modules", "name": "modules",
"pages": [] "pages": []
} }
], ],
"tabBar": { "tabBar": {
"list": [ "color": "#999999", //
{ "selectedColor": "#2c78f5", //
"pagePath": "newPages/newIndex/index", "list": [{
"text": "首页", "pagePath": "newPages/newIndex/index",
"iconPath": "static/imgs/homeone.png", "text": "首页",
"selectedIconPath": "static/imgs/hometwo.png" "iconPath": "static/imgs/homeone.png",
}, "selectedIconPath": "static/imgs/hometwo.png"
{ },
"pagePath": "newPages/my/index", {
"text": "我的", "pagePath": "newPages/my/index",
"iconPath": "static/imgs/myone.png", "text": "我的",
"selectedIconPath": "static/imgs/mytwo.png" "iconPath": "static/imgs/myone.png",
} "selectedIconPath": "static/imgs/mytwo.png"
] }
}, ]
},
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app", "navigationBarTitleText": "uni-app",
@ -223,4 +221,4 @@
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
}, },
"uniIdRouter": {} "uniIdRouter": {}
} }