From b45eed171519ffe4f95d0d10743e7b3a25fcd569 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 01 七月 2024 15:43:07 +0800
Subject: [PATCH] 2024-07-01

---
 src/tabviews/zshare/actionList/newpagebutton/index.jsx |   46 ++++++++++++++++++++++++++++++----------------
 1 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/src/tabviews/zshare/actionList/newpagebutton/index.jsx b/src/tabviews/zshare/actionList/newpagebutton/index.jsx
index 1c7f2bb..a3ca370 100644
--- a/src/tabviews/zshare/actionList/newpagebutton/index.jsx
+++ b/src/tabviews/zshare/actionList/newpagebutton/index.jsx
@@ -241,8 +241,34 @@
     } else if (btn.pageTemplate === 'pay') {
       _name = '鏀粯'
 
+      let appId = ''
+      let merchId = ''
+
+      if (btn.wxApp) {
+        appId = btn.wxApp
+        if (!window.GLOB.WXApps || window.GLOB.WXApps.findIndex(item => item.appId === btn.wxApp) === -1) {
+          notification.warning({
+            top: 92,
+            message: '鎸夐挳鍏宠仈搴旂敤涓嶅湪鍙敤鍒楄〃涓紝璇烽噸鏂颁繚瀛樻寜閽厤缃紒',
+            duration: 5
+          })
+          return
+        }
+      }
+      if (btn.wxMerch) {
+        merchId = btn.wxMerch
+        if (!window.GLOB.WXApps || window.GLOB.WXApps.findIndex(item => item.appId === btn.wxMerch) === -1) {
+          notification.warning({
+            top: 92,
+            message: '鎸夐挳鍏宠仈鍟嗘埛涓嶅湪鍙敤鍒楄〃涓紝璇烽噸鏂颁繚瀛樻寜閽厤缃紒',
+            duration: 5
+          })
+          return
+        }
+      }
+
       if (btn.payMode === 'system' || btn.payMode === 'inner') {
-        this.prequest(Id, data[0] || {})
+        this.prequest(Id, data[0] || {}, appId, merchId)
       } else {
         confirm({
           title: '璇峰湪浠樻椤甸潰瀹屾垚璁㈠崟鏀粯銆�',
@@ -259,13 +285,7 @@
           },
         })
 
-        let appId = ''
-
-        if (btn.wxApp && window.GLOB.WXApps && window.GLOB.WXApps.findIndex(item => item.appId === btn.wxApp) > -1) {
-          appId = btn.wxApp
-        }
-
-        window.open('#/pay/' + window.btoa(window.encodeURIComponent(JSON.stringify({ ID: Id, appId: appId }))))
+        window.open('#/pay/' + window.btoa(window.encodeURIComponent(JSON.stringify({ ID: Id, appId, merchId }))))
       }
     } else if (btn.pageTemplate === 'custom') {
       let url = btn.url
@@ -323,7 +343,7 @@
     }
   }
 
-  prequest = (ID, data) => {
+  prequest = (ID, data, appId, merchId) => {
     const { btn, BID } = this.props
 
     let param = null
@@ -388,13 +408,7 @@
           },
         })
 
-        let appId = ''
-
-        if (btn.wxApp && window.GLOB.WXApps && window.GLOB.WXApps.findIndex(item => item.appId === btn.wxApp) > -1) {
-          appId = btn.wxApp
-        }
-
-        window.open('#/pay/' + window.btoa(window.encodeURIComponent(JSON.stringify({ ID: id, appId: appId }))))
+        window.open('#/pay/' + window.btoa(window.encodeURIComponent(JSON.stringify({ ID: id, appId, merchId }))))
       } else {
         this.execError(res)
       }

--
Gitblit v1.8.0