Ver código fonte

fix: fail 回调改用 showModal 显示具体错误信息,便于真机排查

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
skyline 2 semanas atrás
pai
commit
8c9f98ca96
1 arquivos alterados com 9 adições e 4 exclusões
  1. 9 4
      haha-mp/src/pages/index/index.vue

+ 9 - 4
haha-mp/src/pages/index/index.vue

@@ -191,7 +191,11 @@ const confirmPayScoreAndOpenDoor = async (deviceId: string) => {
       },
       fail: (err: any) => {
         logger.error('[支付分] openBusinessView 失败或用户取消', JSON.stringify(err));
-        uni.showToast({ title: '授权已取消', icon: 'none' });
+        uni.showModal({
+          title: '支付分调起失败',
+          content: '错误详情: ' + JSON.stringify(err),
+          showCancel: false,
+        });
       },
       complete: () => {
         logger.log('[支付分] openBusinessView complete 回调触发');
@@ -200,9 +204,10 @@ const confirmPayScoreAndOpenDoor = async (deviceId: string) => {
   } catch (error: any) {
     uni.hideLoading();
     logger.error('预创建支付分订单失败', error);
-    uni.showToast({
-      title: error?.message || '创建支付分订单失败',
-      icon: 'none',
+    uni.showModal({
+      title: '异常',
+      content: error?.message || '创建支付分订单失败',
+      showCancel: false,
     });
   }
 };