This commit is contained in:
ywyonui 2025-08-30 12:03:06 +08:00
commit 6b935abf5e
3 changed files with 55 additions and 4 deletions

View File

@ -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 {

View File

@ -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);

View File

@ -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);