选课与支付调整

This commit is contained in:
hebo 2025-08-28 17:02:37 +08:00
parent fdf951803d
commit cf6bc42396
3 changed files with 55 additions and 4 deletions

View File

@ -148,6 +148,49 @@ const goToDetail = (xkkc: any) => {
const switchXk = (xk: any) => { const switchXk = (xk: any) => {
xkkcList.value = xk.xkkcs; 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) { if (!props.canSelected) {
return; return;
} }
@ -229,6 +272,12 @@ if (props.xk && props.xk.xkkcs) {
color: #333; color: #333;
flex: 1; flex: 1;
margin-right: 10px; 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 { .detail-btn {

View File

@ -150,13 +150,14 @@ const payNow = async () => {
openId: getUser.openId, openId: getUser.openId,
}); });
if (res.resultCode === 1 && res.result) { if (res.resultCode === 1 && res.result) {
setData({ window.open(res.result.cashierPayHtml, '_blank');
/* setData({
...getData, ...getData,
...res.result ...res.result
}); });
uni.redirectTo({ uni.redirectTo({
url: `/pages/base/jc/pay/wait?payUrl=${encodeURIComponent(res.result.cashierPayHtml)}` url: `/pages/base/jc/pay/wait?payUrl=${encodeURIComponent(res.result.cashierPayHtml)}`
}); });*/
} }
} catch (error) { } catch (error) {
console.log(error); console.log(error);

View File

@ -132,13 +132,14 @@ const payNow = async () => {
openId: getUser.openId, openId: getUser.openId,
}); });
if (res.resultCode === 1 && res.result) { if (res.resultCode === 1 && res.result) {
setData({ window.open(res.result.cashierPayHtml, '_blank');
/* setData({
...getData, ...getData,
...res.result ...res.result
}); });
uni.redirectTo({ uni.redirectTo({
url: `/pages/base/xk/pay/wait?payUrl=${encodeURIComponent(res.result.cashierPayHtml)}` url: `/pages/base/xk/pay/wait?payUrl=${encodeURIComponent(res.result.cashierPayHtml)}`
}); });*/
} }
} catch (error) { } catch (error) {
console.log(error); console.log(error);