陈剑华

fix: 16688 功能缺陷-未登录,点击预约按钮 没有跳转到登陆页面

@@ -4,10 +4,11 @@ import { postInteractAccentionOperateParams } from 'wdBean'; @@ -4,10 +4,11 @@ import { postInteractAccentionOperateParams } from 'wdBean';
4 import { PageRepository } from '../../repository/PageRepository'; 4 import { PageRepository } from '../../repository/PageRepository';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
6 import { HttpUtils } from 'wdNetwork/Index'; 6 import { HttpUtils } from 'wdNetwork/Index';
7 -import { DateTimeUtils } from 'wdKit'; 7 +import { DateTimeUtils, SPHelper } from 'wdKit';
8 import { LiveModel } from '../../viewmodel/LiveModel' 8 import { LiveModel } from '../../viewmodel/LiveModel'
9 import { Logger, ToastUtils } from 'wdKit'; 9 import { Logger, ToastUtils } from 'wdKit';
10 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 10 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  11 +import { SpConstants } from 'wdConstant/Index'
11 12
12 /** 13 /**
13 * 直播预约卡 14 * 直播预约卡
@@ -67,6 +68,13 @@ export struct ZhSingleRow03 { @@ -67,6 +68,13 @@ export struct ZhSingleRow03 {
67 68
68 // 预约/取消预约 69 // 预约/取消预约
69 async bookAndCancel(relationId: string, liveId: string, isSubscribe: boolean) { 70 async bookAndCancel(relationId: string, liveId: string, isSubscribe: boolean) {
  71 + // 未登录,跳转登录
  72 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  73 + if (!user_id) {
  74 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  75 + return
  76 + }
  77 +
70 const res = await LiveModel.liveAppointment(relationId.toString(), liveId.toString(), isSubscribe); 78 const res = await LiveModel.liveAppointment(relationId.toString(), liveId.toString(), isSubscribe);
71 if (res.code == 0) { 79 if (res.code == 0) {
72 ToastUtils.shortToast(isSubscribe ? '预约成功' : '取消预约成功') 80 ToastUtils.shortToast(isSubscribe ? '预约成功' : '取消预约成功')