THUNDERBIRD_REMINDERVIEW_CHARGING, // 充电中
THUNDERBIRD_REMINDERVIEW_CHARGE_COMPLETE, // 充电完成
THUNDERBIRD_REMINDERVIEW_DIALOGUE_NOT_ENOUGH,//对话不足
- THUNDERBIRD_REMINDERVIEW_DIALOGUE_USE_UP, //对话用尽
- THUNDERBIRD_REMINDERVIEW_FLOW_NOT_ENOUGH, //流量不足
- THUNDERBIRD_REMINDERVIEW_FLOW_USE_UP, //流量用尽
+
THUNDERBIRD_REMINDERVIEW_CLOSE_BATTERY, //电量过低即将关机
};
// uapi_set_sleep_mode_active(false);//睡眠模式激活标志位
ThunderBirdModel::GetInstance()->HighFrequence();
// 从ThunderBirdModel获取当前表情和状态文本
- std::string currentStatusText = "发呆中... ";
+ std::string currentStatusText = "发呆中... ";
Isband(true);
if (ThunderBirdModel::GetInstance()) {
currentStatusText = ThunderBirdModel::GetInstance()->GetCurrentStatusText();
// 调用退出对话模式
//ThunderBirdModel::GetInstance()->OnExitDialogueMode();
}
- //长亮屏
+ //取消常亮屏
+ ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON);
// ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON);
if (TextLabel)
{
if(ThunderBirdReminderView::GetInstance())
{
ThunderBirdReminderView::GetInstance()->UpdateTaskReminderIcon(LN_CHAT_STAMINA_QRCODE_FILE);
- }
- if((chatLeft < 20 && chatLeft > 0))//对话不足
+ }
+ if(chatLeft == 0)//对话用尽
{
ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_DIALOGUE_NOT_ENOUGH);
if (ThunderBirdReminderView::GetInstance()) {
- ThunderBirdReminderView::GetInstance()->UpdateTaskReminderText("对è¯\9dé¢\9d度ä¸\8dè¶³20è½®\nå\8f¯æ\89«ç \81ç»å\85\85");
+ ThunderBirdReminderView::GetInstance()->UpdateTaskReminderText("å\95\8aå\93¦ï¼\8c对è¯\9dè½®æ\95°å·²ç\94¨å®\8cï¼\8cæ\89«ç \81ç»ä¸\8aå\90§");
}
- }
- else if(flowLeft < 80 && flowLeft > 0)//流量不足
+ }
+ else if(flowLeft == 0)//流量用尽
{
ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_DIALOGUE_NOT_ENOUGH);
if (ThunderBirdReminderView::GetInstance()) {
- ThunderBirdReminderView::GetInstance()->UpdateTaskReminderText("流量不足100M了哦\n扫码可重置流量");
+ ThunderBirdReminderView::GetInstance()->UpdateTaskReminderText("流量用完了哦");
}
- }
- else if(chatLeft == 0)//对话用尽
+ }
+ else if(chatLeft < 20 && chatLeft > 0)//对话不足
{
ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_DIALOGUE_NOT_ENOUGH);
if (ThunderBirdReminderView::GetInstance()) {
- ThunderBirdReminderView::GetInstance()->UpdateTaskReminderText("å\95\8aå\93¦ï¼\8c对è¯\9dè½®æ\95°å·²ç\94¨å®\8cï¼\8c\næ\89«ç \81ç»ä¸\8aå\90§");
+ ThunderBirdReminderView::GetInstance()->UpdateTaskReminderText("对è¯\9dé¢\9d度ä¸\8dè¶³20è½®\nå\8f¯æ\89«ç \81ç»å\85\85");
}
- }
- else if(flowLeft == 0)//流量用尽
+ }
+ else if(flowLeft < 100 && flowLeft > 0)//流量不足
{
ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_DIALOGUE_NOT_ENOUGH);
if (ThunderBirdReminderView::GetInstance()) {
- ThunderBirdReminderView::GetInstance()->UpdateTaskReminderText("流量用完了哦");
+ ThunderBirdReminderView::GetInstance()->UpdateTaskReminderText("流量不足100M了哦\n扫码可重置流量");
}
}
+
} else {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView instance is null, cannot show chat stamina reminder");
}
break;
case ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_DIALOGUE_NOT_ENOUGH://提醒界面-对话不足
+ AI_ForceInterrupt();
+ ln_ws_send_voice_chat_interrupt("体力流量不足");
+ do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_AUDIO_DEINIT, NULL, 0);
ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW);
break;
- case ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_DIALOGUE_USE_UP://提醒界面-对话用尽
- ThunderBirdMainView::GetInstance()->ChangeView(currentView,THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW);
- break;
- case ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_FLOW_NOT_ENOUGH://提醒界面-流量不足
- ThunderBirdMainView::GetInstance()->ChangeView(currentView,THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW);
- break;
+ // case ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_DIALOGUE_USE_UP://提醒界面-对话用尽
+ // ThunderBirdMainView::GetInstance()->ChangeView(currentView,THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW);
+ // break;
+ // case ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_FLOW_NOT_ENOUGH://提醒界面-流量不足
+ // ThunderBirdMainView::GetInstance()->ChangeView(currentView,THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW);
+ // break;
// case ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_FLOW_USE_UP://提醒界面-流量用尽
// ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_FLOW_USE_UP);
// break;
return true;
}
+
/**
* @brief 处理调节界面导航
*/
ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON); // 打开屏幕常亮
// 进入对话模式时记录当前表情
ThunderBirdModel::GetInstance()->OnEnterDialogueMode();
+ // 获取对话体力与流量信息
+ do_ln_http_server_send_data(LN_HTTP_SERVICE_CMD_GET_CHAT_STAMINA, NULL, 0);
// do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_AUDIO_INIT, NULL, 0);
// 音频已在按键按下时初始化,这里直接开始对话
//ln_ws_start_audio_chat(LN_AUDIO_CHAT_VOICE_CHAT_REQUEST);//开始对话
}
if(RemindIcon2)
{
- RemindIcon2->SetPosition(156, 294, 24, 24);
+ RemindIcon2->SetPosition(158, 296, 24, 24);
RemindIcon2->SetSrc("/user/res/volume_up.bin");
RemindIcon2->SetVisible(true);
}
- break;
- }
- case THUNDERBIRD_REMINDERVIEW_DIALOGUE_USE_UP:
- {
- ThunderBirdMainView::GetInstance()->OpenBackGround();
- if(TextLabel)
- {
- TextLabel->SetPosition(47, 64, 266, 84);
- TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
- TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
- TextLabel->SetText("啊哦,对话轮数已用完,扫码续上吧");
- TextLabel->SetVisible(true);
- }
- if(RemindIcon)
- {
- RemindIcon->SetPosition(133, 169, 94, 94);
- RemindIcon->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
- RemindIcon->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
- //RemindIcon->SetSrc("/user/res/volume_up.bin");
- RemindIcon->SetVisible(true);
- }
- if(RemindLabel)
- {
- RemindLabel->SetPosition(132, 296, 96, 28);
- RemindLabel->SetText("按 确认");
- RemindLabel->SetVisible(true);
- }
- if(RemindIcon2)
- {
- RemindIcon2->SetPosition(158, 298, 24, 24);
- RemindIcon2->SetSrc("/user/res/volume_up.bin");
- RemindIcon2->SetVisible(true);
- }
- break;
- }
- case THUNDERBIRD_REMINDERVIEW_FLOW_NOT_ENOUGH:
- {
- ThunderBirdMainView::GetInstance()->OpenBackGround();
- if(TextLabel)
- {
- TextLabel->SetPosition(47, 64, 266, 84);
- TextLabel->SetText("流量不足100M了哦扫码可重置流量");
- TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
- TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
- TextLabel->SetVisible(true);
- }
- if(RemindIcon)
- {
- RemindIcon->SetPosition(133, 169, 94, 94);
- RemindIcon->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
- RemindIcon->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
- RemindIcon->SetSrc(LN_CHAT_STAMINA_QRCODE_FILE);
- RemindIcon->SetVisible(true);
- }
- if(RemindLabel)
- {
- RemindLabel->SetPosition(132, 296, 96, 28);
- RemindLabel->SetText("按 确认");
- RemindLabel->SetVisible(true);
- }
- if(RemindIcon2)
- {
- RemindIcon2->SetPosition(159, 300, 24, 24);
- RemindIcon2->SetSrc("/user/res/volume_up.bin");
- RemindIcon2->SetVisible(true);
- }
- break;
- }
- case THUNDERBIRD_REMINDERVIEW_FLOW_USE_UP:
- {
- if(TextLabel)
- {
- TextLabel->SetPosition(91, 64, 180, 42);
- TextLabel->SetText("流量用完了哦");
- TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
- TextLabel->SetVisible(true);
- }
- if (RemindButton)
- {
- RemindButton->SetPosition(64, 114, 232, 40);
- RemindButton->SetText("可在小程序上续费使用");
- RemindButton->SetLabelPosition(46, 6);
- RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
- RemindButton->SetVisible(true);
- }
- break;
+ break;
}
+
case THUNDERBIRD_REMINDERVIEW_CLOSE_BATTERY:
{
if (RemindButton)
break;
}
}
-
void ThunderBirdReminderView::HideAll()
{
if (group == nullptr) { return; }
{
ln_device_get_user_id_http(uapi_ln_get_device_id(), uapi_ln_get_device_token());
}
+ else if (mail.cmd == LN_HTTP_SERVICE_CMD_GET_CHAT_STAMINA)
+ {
+ printf("LN_HTTP_SERVICE_CMD_GET_CHAT_STAMINA:获取对话体力与流量信息\n");
+ ln_device_get_chat_stamina_http(uapi_ln_get_device_id(), uapi_ln_get_device_token());
+ }
else if (mail.cmd == LN_HTTP_SERVICE_CMD_OTA_GET_TASK)
{
printf("LN_HTTP_SERVICE_CMD_OTA_GET_TASK:获取OTA升级任务\n");
/* 设备信息相关命令 */
#define LN_HTTP_SERVICE_CMD_GET_CHARACTER 0x30 /* 获取设备角色信息(JSON, GET)*/
#define LN_HTTP_SERVICE_CMD_GET_USER_ID 0x31 /* 获取设备绑定用户ID(JSON, GET)*/
+#define LN_HTTP_SERVICE_CMD_GET_CHAT_STAMINA 0x32 /* 获取对话体力与流量信息(JSON, GET)*/
/* 设备信息相关接收命令 */
#define LN_HTTP_RECV_DEVICE_CHARACTER 0x40 /* 设备角色信息 接收 */
#define LN_HTTP_RECV_DEVICE_USER_ID 0x41 /* 设备绑定用户ID 接收 */
uint32_t ln_device_get_user_id_http(const char *device_id,
const char *device_token);
+uint32_t ln_device_get_chat_stamina_http(const char *device_id,
+ const char *device_token);
+
uint32_t ln_ota_get_task_http(const char *device_id,
const char *device_token,
const char *source_version);