--- /dev/null
+/***
+ * @Date: 2024-04-15 10:55:58
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-07-31 14:36:25
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230/nativeapp/nativeui/bloodpressure/src/ChinaMobilelIOTFirstView.cpp
+ */
+
+#include "ui_resource_image.h"
+#include "UiConfig.h"
+#include "wearable_log.h"
+#include "chinamobilelIOT/include/ChinaMobilelIOTView.h"
+#include "chinamobilelIOT/include/ChinaMobilelIOTPresenter.h"
+#include "chinamobilelIOT/include/ChinaMobilelIOTFirstView.h"
+namespace OHOS
+{
+ static ChinaMobilelIOTFirstView *g_pChinaMobilelIOTFirstView{nullptr};
+ static const char *BINDPATH = "/user/res/ChinamobileIOT/devicebinding.bin";
+ static const char *CHECKINPATH = "/user/res/ChinamobileIOT/fieldcheckin.bin";
+ static const char *PERSONALPATH = "/user/res/ChinamobileIOT/personalinformation.bin";
+ static const char *TASKPATH = "/user/res/ChinamobileIOT/worktask.bin";
+
+ ChinaMobilelIOTFirstView::ChinaMobilelIOTFirstView()
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ChinaMobilelIOTFirstView::ChinaMobilelIOTFirstView");
+ g_pChinaMobilelIOTFirstView = this;
+ }
+ ChinaMobilelIOTFirstView::~ChinaMobilelIOTFirstView()
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ChinaMobilelIOTFirstView::~ChinaMobilelIOTFirstView");
+ DeInit();
+ g_pChinaMobilelIOTFirstView = nullptr;
+ }
+ ChinaMobilelIOTFirstView *ChinaMobilelIOTFirstView::GetInstance()
+ {
+ return g_pChinaMobilelIOTFirstView;
+ }
+ void ChinaMobilelIOTFirstView::DeInit()
+ {
+ if (group)
+ {
+ group->RemoveAll();
+ delete group;
+ group = nullptr;
+ }
+ }
+
+ void ChinaMobilelIOTFirstView::InitImage(UIImageView *Image,const char *path,uint16_t x,uint16_t y,const char *id)
+ {
+ Image = new UIImageView();
+ Image->SetPosition(x, y);
+ Image->SetSrc(path);
+ Image->SetAutoEnable(false);
+ Image->SetWidth(164);
+ Image->SetHeight(128);
+ Image->SetTouchable(true);
+ Image->SetViewId(id);
+ Image->SetResizeMode(UIImageView::COVER);
+ UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::ChinaMobilelIOTPresenter::GetInstance();
+ Image->SetOnClickListener(clickListener);
+ group->Add(Image);
+ }
+ /***
+ * @description:
+ * @return 初始化图片是否成功
+ */
+ bool ChinaMobilelIOTFirstView::Initbackground()
+ {
+ InitImage(icon_1,BINDPATH,59,97,DEVICEBINDING);
+ InitImage(icon_2,CHECKINPATH,243,97,FIELDCHECKIN);
+ InitImage(icon_3,PERSONALPATH,243,241,PERSONALINFORMATION);
+ InitImage(icon_4,TASKPATH,243,241,WORKTASK);
+ return true;
+ }
+ /***
+ * @description:
+ * @return 是否初始化成功
+ */
+ UIViewGroup *ChinaMobilelIOTFirstView::ChinaMobilelIOTFirstViewInit()
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "bool ChinaMobilelIOTFirstView::InitView()");
+ group = new UIViewGroup();
+ if (group == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmPopUpView::group null!");
+ return nullptr;
+ }
+ group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
+ if (!Initbackground())
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Initbackground error!");
+ return nullptr;
+ }
+ return group;
+ }
+
+}