Merge branch 'master' of http://119.29.194.155:8894/zwq/zhxy-jzd
This commit is contained in:
commit
6b935abf5e
@ -148,6 +148,49 @@ const goToDetail = (xkkc: any) => {
|
||||
|
||||
const switchXk = (xk: any) => {
|
||||
xkkcList.value = xk.xkkcs;
|
||||
|
||||
// 对课程列表进行排序:先按课程名称,再按课程名称中的序号,最后按上课时间
|
||||
xkkcList.value.sort((a: any, b: any) => {
|
||||
// 提取课程名称(去掉序号部分)
|
||||
const getCourseName = (kcmc: string) => {
|
||||
return kcmc.replace(/\d+$/, '');
|
||||
};
|
||||
|
||||
// 提取课程名称中的序号
|
||||
const getCourseNumber = (kcmc: string) => {
|
||||
const match = kcmc.match(/(\d+)$/);
|
||||
return match ? parseInt(match[1]) : 0;
|
||||
};
|
||||
|
||||
const aCourseName = getCourseName(a.kcmc);
|
||||
const bCourseName = getCourseName(b.kcmc);
|
||||
|
||||
// 首先按课程名称排序(最高优先级)
|
||||
if (aCourseName !== bCourseName) {
|
||||
return aCourseName.localeCompare(bCourseName, 'zh-CN');
|
||||
}
|
||||
|
||||
// 如果课程名称相同,则按课程名称中的序号排序(按数值大小,不是字符串)
|
||||
const aNumber = getCourseNumber(a.kcmc);
|
||||
const bNumber = getCourseNumber(b.kcmc);
|
||||
|
||||
// 如果都有序号,按数值大小排序
|
||||
if (aNumber > 0 && bNumber > 0) {
|
||||
if (aNumber !== bNumber) {
|
||||
return aNumber - bNumber; // 数值排序:3 < 14
|
||||
}
|
||||
}
|
||||
|
||||
// 如果序号相同或没有序号,则按上课时间排序
|
||||
if (a.studyTime && b.studyTime) {
|
||||
return a.studyTime.localeCompare(b.studyTime, 'zh-CN');
|
||||
}
|
||||
// 如果某个没有上课时间,则排在后面
|
||||
if (a.studyTime && !b.studyTime) return -1;
|
||||
if (!a.studyTime && b.studyTime) return 1;
|
||||
return 0;
|
||||
});
|
||||
|
||||
if (!props.canSelected) {
|
||||
return;
|
||||
}
|
||||
@ -229,6 +272,12 @@ if (props.xk && props.xk.xkkcs) {
|
||||
color: #333;
|
||||
flex: 1;
|
||||
margin-right: 10px;
|
||||
line-height: 1.4;
|
||||
min-height: 44px; /* 统一两行高度:16px * 1.4 * 2 ≈ 44px */
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.detail-btn {
|
||||
|
||||
@ -150,13 +150,14 @@ const payNow = async () => {
|
||||
openId: getUser.openId,
|
||||
});
|
||||
if (res.resultCode === 1 && res.result) {
|
||||
setData({
|
||||
window.open(res.result.cashierPayHtml, '_blank');
|
||||
/* setData({
|
||||
...getData,
|
||||
...res.result
|
||||
});
|
||||
uni.redirectTo({
|
||||
url: `/pages/base/jc/pay/wait?payUrl=${encodeURIComponent(res.result.cashierPayHtml)}`
|
||||
});
|
||||
});*/
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
@ -132,13 +132,14 @@ const payNow = async () => {
|
||||
openId: getUser.openId,
|
||||
});
|
||||
if (res.resultCode === 1 && res.result) {
|
||||
setData({
|
||||
window.open(res.result.cashierPayHtml, '_blank');
|
||||
/* setData({
|
||||
...getData,
|
||||
...res.result
|
||||
});
|
||||
uni.redirectTo({
|
||||
url: `/pages/base/xk/pay/wait?payUrl=${encodeURIComponent(res.result.cashierPayHtml)}`
|
||||
});
|
||||
});*/
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.log(error);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user