diff --git a/common/include/dm_constants.h b/common/include/dm_constants.h
index 8883eeb3e78dcceec849b895725ad8acc9854b8b..5e8b12431053b5ee8aea2d5e3941b63ed1c82d36 100755
--- a/common/include/dm_constants.h
+++ b/common/include/dm_constants.h
@@ -84,6 +84,7 @@ enum {
DM_AUTH_PEER_REJECT,
DM_AUTH_NOT_AUTH,
DM_AUTH_DONT_AUTH,
+ DM_AUTH_NOT_START,
DM_SOFTBUS_FAILED = 3000,
DM_SOFTBUS_CREATE_SESSION_SERVER_FAILED,
DM_HICHAIN_FAILED = 4000,
@@ -186,6 +187,18 @@ const int32_t ACE_X = 50;
const int32_t ACE_Y = 300;
const int32_t ACE_WIDTH = 600;
const int32_t ACE_HEIGHT = 400;
+const std::string EVENT_CONFIRM = "EVENT_CONFIRM";
+const std::string EVENT_CANCEL = "EVENT_CANCEL";
+const std::string EVENT_INIT = "EVENT_INIT";
+const std::string EVENT_CONFIRM_CODE = "0";
+const std::string EVENT_CANCEL_CODE = "1";
+const std::string EVENT_INIT_CODE = "2";
+
+//timer
+const std::string TIMER_PREFIX = "deviceManagerTimer:";
+const std::string STATE_TIMER_PREFIX = "stateTimer_";
+const int32_t TIMER_PREFIX_LENGTH = 19;
+const int32_t TIMER_DEFAULT = 0;
} // namespace DistributedHardware
} // namespace OHOS
#endif
diff --git a/common/include/show_confirm_dialog/dialog_ui/js/pages/index/index.js b/common/include/show_confirm_dialog/dialog_ui/js/pages/index/index.js
index 13a4384c54373870c4ca3b1e17d2daf7567c1239..1850093f0f9060dde2ce28411b680c5eaba63fa6 100644
--- a/common/include/show_confirm_dialog/dialog_ui/js/pages/index/index.js
+++ b/common/include/show_confirm_dialog/dialog_ui/js/pages/index/index.js
@@ -1,12 +1,19 @@
import router from '@ohos.router'
var timel = null;
+var EVENT_CONFIRM = "EVENT_CONFIRM";
+var EVENT_CANCEL = "EVENT_CANCEL";
+var EVENT_INIT = "EVENT_INIT";
+var EVENT_CONFIRM_CODE = "0";
+var EVENT_CANCEL_CODE = "1";
+var EVENT_INIT_CODE = "2";
export default {
data: {
seconds:60,
},
onInit() {
console.info('getParams: ' + router.getParams());
+ callNativeHandler(EVENT_INIT, EVENT_INIT_CODE);
},
onShow() {
timel = setInterval(this.run,1000)
@@ -17,15 +24,15 @@ export default {
clearInterval(timel);
timel = null;
console.info('click cancel');
- callNativeHandler("EVENT_CONFIRM", "1");
+ callNativeHandler(EVENT_CANCEL, EVENT_CANCEL_CODE);
}
},
onConfirm() {
console.info('click confirm');
- callNativeHandler("EVENT_CONFIRM", "0");
+ callNativeHandler(EVENT_CONFIRM, EVENT_CONFIRM_CODE);
},
onCancel() {
console.info('click cancel');
- callNativeHandler("EVENT_CANCEL", "1");
+ callNativeHandler(EVENT_CANCEL, EVENT_CANCEL_CODE);
}
}
\ No newline at end of file
diff --git a/ext/pin_auth/input_pin_dialog/dialog_ui/js/pages/index/index.js b/ext/pin_auth/input_pin_dialog/dialog_ui/js/pages/index/index.js
index 488972d500f7250991051ef8511d5c24f22ce86d..b0405866e1fa6d464fb316930f6688999a28663e 100644
--- a/ext/pin_auth/input_pin_dialog/dialog_ui/js/pages/index/index.js
+++ b/ext/pin_auth/input_pin_dialog/dialog_ui/js/pages/index/index.js
@@ -3,6 +3,12 @@ import router from '@ohos.router';
var numbs = 0;
var code = 0;
var inputVal = 0;
+var EVENT_CONFIRM = "EVENT_CONFIRM";
+var EVENT_CANCEL = "EVENT_CANCEL";
+var EVENT_INIT = "EVENT_INIT";
+var EVENT_CONFIRM_CODE = "0";
+var EVENT_CANCEL_CODE = "1";
+var EVENT_INIT_CODE = "2";
export default {
data: {
pincode: router.getParams().pinCode,
@@ -11,7 +17,7 @@ export default {
},
onInit() {
code = router.getParams().pinCode;
- callNativeHandler("EVENT_CONFIRM", "2");
+ callNativeHandler(EVENT_INIT, EVENT_INIT_CODE);
},
onChange(e){
inputVal = e.value;
@@ -22,11 +28,11 @@ export default {
console.info('click confirm numbs < 3 ');
if(code == inputVal){
console.info('click confirm code == inputVal');
- callNativeHandler("EVENT_INPUT", "0");
+ callNativeHandler(EVENT_CONFIRM, EVENT_CONFIRM_CODE);
}else{
if(numbs == 3){
console.info('click confirm code != inputVal and numbs == 3');
- callNativeHandler("EVENT_CONFIRM", "1");
+ callNativeHandler(EVENT_CANCEL, EVENT_CANCEL_CODE);
}
console.info('click confirm code != inputVal');
this.isShow = true;
@@ -34,11 +40,11 @@ export default {
}
}else{
console.info('click confirm numbs > 3 ');
- callNativeHandler("EVENT_CONFIRM", "1");
+ callNativeHandler(EVENT_CANCEL, EVENT_CANCEL_CODE);
}
},
onCancel() {
console.info('click cancel');
- callNativeHandler("EVENT_CONFIRM", "1");
+ callNativeHandler(EVENT_CANCEL, EVENT_CANCEL_CODE);
}
}
\ No newline at end of file
diff --git a/ext/pin_auth/show_pin_dialog/dialog_ui/js/pages/index/index.hml b/ext/pin_auth/show_pin_dialog/dialog_ui/js/pages/index/index.hml
index 845c99e570c9e56592ea375fa53410773b4c743c..715ceda514b37e784da387dac2e99d674181b4be 100644
--- a/ext/pin_auth/show_pin_dialog/dialog_ui/js/pages/index/index.hml
+++ b/ext/pin_auth/show_pin_dialog/dialog_ui/js/pages/index/index.hml
@@ -8,7 +8,7 @@
{{ pincode }}
-