From cf4bf4d9df524310508f32b4afd521435631df54 Mon Sep 17 00:00:00 2001 From: p15692025051 <846603105@qq.com> Date: Sun, 23 Apr 2023 17:56:30 +0800 Subject: [PATCH] =?utf8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E5=A2=9E=E5=8A=A0?= =?utf8?q?=E6=81=A2=E5=A4=8D=E5=87=BA=E5=8E=82=EF=BC=8C=E4=BD=86=E6=8E=A5?= =?utf8?q?=E5=8F=A3=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- 3.code/1.watch/2.code/appAlipay.py | 9 ++++++++- 3.code/1.watch/2.code/ui_setting.py | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/3.code/1.watch/2.code/appAlipay.py b/3.code/1.watch/2.code/appAlipay.py index 6c68a5d9..a090a930 100644 --- a/3.code/1.watch/2.code/appAlipay.py +++ b/3.code/1.watch/2.code/appAlipay.py @@ -68,6 +68,7 @@ class Alipay(Abstract): def post_processor_after_instantiation(self): EventMesh.subscribe("alipay_1", self.alipay_1) + EventMesh.subscribe("reset_alipay", self.reset_alipay) EventMesh.subscribe("get_payment_code", self.get_payment_code) EventMesh.subscribe("get_collect_code", self.get_collect_code) EventMesh.subscribe("get_parent_code", self.get_parent_code) @@ -254,7 +255,13 @@ class Alipay(Abstract): elif rsp_code == 44: # 服务端已解绑 print("upay_display_notify_cb: not bind !\n") - + + + + def reset_alipay(self, event, msg): + print("reset_alipay") + self.alipay.hw_factory_reset() + def get_binding_code(self, event, msg): return self.result diff --git a/3.code/1.watch/2.code/ui_setting.py b/3.code/1.watch/2.code/ui_setting.py index 57f65b14..37dcc48a 100644 --- a/3.code/1.watch/2.code/ui_setting.py +++ b/3.code/1.watch/2.code/ui_setting.py @@ -364,6 +364,7 @@ class RestoreScreen(Screen): self.restore_cancel.add_event_cb(lambda e: self.concel(e),lv.EVENT.CLICKED, None) def confirm(self, e): ret = 0 + EventMesh.publish("reset_alipay")#恢复支付宝数据 ret = ql_fs.path_exists("/ext/static/storage_file")#电话本 if ret == True: ql_fs.rmdirs("/ext/static/storage_file") -- 2.17.1