From 1a176e4bdba485301385caac1a29102e598d25cc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 13 五月 2025 11:32:02 +0800
Subject: [PATCH] 2025-05-13

---
 src/views/appmanage/index.jsx |  109 ++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 73 insertions(+), 36 deletions(-)

diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx
index 910f152..da7e730 100644
--- a/src/views/appmanage/index.jsx
+++ b/src/views/appmanage/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import { fromJS } from 'immutable'
 import { Spin, notification, Input, Button, Table, Modal, Typography, Row, Col, Tooltip } from 'antd'
-import { QuestionCircleOutlined } from '@ant-design/icons'
+import { QuestionCircleOutlined, LinkOutlined } from '@ant-design/icons'
 import moment from 'moment'
 import md5 from 'md5'
 
@@ -32,12 +32,12 @@
   bg_black_style_yellow_green: {name: '榛勭豢鑹�', color: '#a0d911'},
   bg_black_style_green: {name: '缁胯壊', color: '#52c41a'},
   bg_black_style_cyan: {name: '闈掕壊', color: '#13c2c2'},
-  bg_black_style_blue_purple: {name: '钃濈传鑹�', color: '#2f54eb'},
+  bg_black_style_blue_purple: {name: '钃濈传鑹�', color: '#3860f4'},
   bg_black_style_purple: {name: '绱壊', color: '#722ed1'},
   bg_black_style_magenta: {name: '娲嬬孩鑹�', color: '#eb2f96'},
   bg_black_style_grass_green: {name: '鑽夌豢鑹�', color: '#aeb303'},
   bg_black_style_deep_red: {name: '娣辩孩鑹�', color: '#c32539'},
-  bg_black_style_deep_blue: {name: '娣辩孩鑹�', color: '#1d3661'}
+  bg_black_style_deep_blue: {name: '娣辫摑鑹�', color: '#1d3661'}
 }
 
 class AppManage extends Component {
@@ -377,7 +377,7 @@
   }
 
   deleteTran = (record) => {
-    const _this = this
+    const that = this
 
     let param = {
       func: 's_sVersion_del',
@@ -395,7 +395,7 @@
                 message: '鎿嶄綔鎴愬姛锛�',
                 duration: 3
               })
-              _this.getTransList()
+              that.getTransList()
             } else {
               notification.warning({
                 top: 92,
@@ -414,7 +414,7 @@
   }
 
   enableTran = (record) => {
-    const _this = this
+    const that = this
 
     let param = {
       func: 's_sVersion_sub',
@@ -432,7 +432,7 @@
                 message: '鎿嶄綔鎴愬姛锛�',
                 duration: 3
               })
-              _this.getTransList()
+              that.getTransList()
             } else {
               Modal.error({
                 title: result.message,
@@ -487,13 +487,14 @@
               cell.share_link = _param.share_link || '' // 鍒嗕韩閾炬帴
               cell.wxAppId = _param.wxAppId || ''
               cell.wxAppName = _param.wxAppName || ''
+              cell.wxMerchId = _param.wxMerchId || ''
+              cell.wxMerchName = _param.wxMerchName || ''
 
               if (cell.adapter && (cell.adapter === 'true' || cell.adapter === 'false')) {
                 cell.adapter = ''
               }
 
               cell.userbind = _param.userbind || ''
-              cell.instantMessage = _param.instantMessage || ''
             }
 
             if (cell.user_binding !== 'true') {
@@ -599,7 +600,7 @@
   }
 
   deleteApp = (record) => {
-    const _this = this
+    const that = this
 
     confirm({
       content: '纭畾鍒犻櫎銆�' + record.remark + '銆嬪悧锛�',
@@ -619,12 +620,12 @@
                 duration: 5
               })
 
-              _this.setState({
+              that.setState({
                 selectApp: null,
                 selectSubApp: null,
                 loading: true
               })
-              _this.getAppList()
+              that.getAppList()
             } else {
               if (result.message.indexOf('kei_no宸茶鑿滃崟浣跨敤锛屼笉鍙垹闄�') > -1) {
                 result.message = 'kei_no宸茶鑿滃崟浣跨敤锛屼笉鍙垹闄�'
@@ -647,7 +648,7 @@
   
   deleteSubApp = (record) => {
     const { selectApp } = this.state
-    const _this = this
+    const that = this
 
     let param = {
       func: 's_kei_addupt',
@@ -668,7 +669,6 @@
     sublist = sublist.map(item => {
       if (item.typename !== 'pc') {
         item.userbind = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{8}/, 'userbind')
-        item.instantMessage = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{14}/, 'instantmessage')
       }
       return item
     })
@@ -677,7 +677,7 @@
     param.LText = sublist.map(item => {
       let _par = this.getCusParam(item)
 
-      return `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}'`
+      return `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}','${item.app_name || selectApp.remark || ''}','${item.app_icon || ''}','${item.allow_subscribe || ''}','${item.link_remark || ''}'`
     })
     param.LText = param.LText.join(' union all ')
     param.LText = Utils.formatOptions(param.LText, 'x')
@@ -694,11 +694,11 @@
                 duration: 5
               })
       
-              _this.setState({
+              that.setState({
                 selectSubApp: null,
                 loading: true
               })
-              _this.getAppList()
+              that.getAppList()
             } else {
               notification.warning({
                 top: 92,
@@ -746,7 +746,6 @@
       })
     }
     if (applangList.length) {
-      applangList.unshift('zh-CN')
       applangList = JSON.stringify(applangList)
     } else {
       applangList = ''
@@ -769,7 +768,6 @@
       })
     }
     if (applangList.length) {
-      applangList.unshift('zh-CN')
       applangList = JSON.stringify(applangList)
     } else {
       applangList = ''
@@ -819,7 +817,7 @@
       }
     })
 
-    const _this = this
+    const that = this
 
     confirm({
       content: '纭畾瑕佹墽琛屽悧锛�',
@@ -855,10 +853,10 @@
                 message: '鎵ц鎴愬姛銆�',
                 duration: 3
               })
-              _this.setState({
+              that.setState({
                 scriptIndex: 1
               }, () => {
-                _this.getScriptList()
+                that.getScriptList()
               })
             }
             resolve()
@@ -949,7 +947,6 @@
         selectApp.sublist = selectApp.sublist.map(item => {
           if (item.typename !== 'pc') {
             item.userbind = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{8}/, 'userbind')
-            item.instantMessage = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{14}/, 'instantmessage')
           }
           return item
         })
@@ -957,7 +954,7 @@
         param.LText = selectApp.sublist.map(item => {
           let _par = this.getCusParam(item)
     
-          return `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}'`
+          return `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}','${item.app_name || selectApp.remark || ''}','${item.app_icon || ''}','${item.allow_subscribe || ''}','${item.link_remark || ''}'`
         })
         param.LText = param.LText.join(' union all ')
         param.LText = Utils.formatOptions(param.LText, 'x')
@@ -1004,9 +1001,6 @@
     if (item.userbind) {
       _par.userbind = item.userbind
     }
-    if (item.instantMessage) {
-      _par.instantMessage = item.instantMessage
-    }
     if (item.apptype) {
       _par.apptype = item.apptype
     }
@@ -1038,6 +1032,10 @@
     if (item.wxAppId) {
       _par.wxAppId = item.wxAppId
       _par.wxAppName = item.wxAppName || item.wxAppId
+    }
+    if (item.wxMerchId) {
+      _par.wxMerchId = item.wxMerchId
+      _par.wxMerchName = item.wxMerchName || item.wxMerchId
     }
 
     return _par
@@ -1092,7 +1090,6 @@
       sublist = sublist.map(item => {
         if (item.typename !== 'pc') {
           item.userbind = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{8}/, 'userbind')
-          item.instantMessage = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{14}/, 'instantmessage')
         }
         return item
       })
@@ -1100,7 +1097,7 @@
       param.LText = sublist.map(item => {
         let _par = this.getCusParam(item)
 
-        return `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}'`
+        return `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}','${item.app_name || selectApp.remark || ''}','${item.app_icon || ''}','${item.allow_subscribe || ''}','${item.link_remark || ''}'`
       })
       param.LText = param.LText.join(' union all ')
       param.LText = Utils.formatOptions(param.LText, 'x')
@@ -1135,6 +1132,43 @@
           confirmloading: false
         })
       })
+    })
+  }
+
+  updateLink = (item) => {
+    let link = `${window.GLOB.baseurl}${item.typename === 'pad' ? 'mob' : item.typename}/index.html#/index/${this.state.selectApp.kei_no}/${item.typename !== 'pc' ? item.typename + '/' : ''}${item.lang}`
+
+    let param = {
+      func: 's_miniapp_kei_linkurl_upt',
+      id: item.ID,
+      linkurl: link
+    }
+
+    confirm({
+      content: '纭畾鏇存柊搴旂敤閾炬帴鍦板潃鍚楋紵',
+      onOk() {
+        return new Promise(resolve => {
+          Api.getCloudConfig(param).then(result => {
+            if (result.status) {
+              notification.success({
+                top: 92,
+                message: '鎿嶄綔鎴愬姛锛�',
+                duration: 3
+              })
+            } else {
+              notification.warning({
+                top: 92,
+                message: result.message,
+                duration: 5
+              })
+            }
+            resolve()
+          }, () => {
+            resolve()
+          })
+        })
+      },
+      onCancel() {}
     })
   }
 
@@ -1248,8 +1282,10 @@
                     </Col>
                     <Col span={12}>
                       <div className="app-item">
-                        {item.wxAppName ? <div className="label">鍏宠仈鍏紬鍙�:</div> : null}
-                        {item.wxAppName ? <div className="content">{item.wxAppName}</div> : null}
+                        {item.wxAppName || item.wxMerchName ? <>
+                          <div className="label">鍏宠仈搴旂敤:</div>
+                          <div className="content">{`${item.wxAppName}${item.wxAppName && item.wxMerchName ? ' / ' + item.wxMerchName : item.wxMerchName || ''}`}</div>
+                        </> : null}
                       </div>
                     </Col>
                     <Col span={12}>
@@ -1277,14 +1313,14 @@
                     </Col>
                     <Col span={12}>
                       <div className="app-item">
-                        <div className="label">鏍囬:</div>
-                        <div className="content">{item.title || '鏃�'}</div>
+                        <div className="label">搴旂敤鍚嶇О:</div>
+                        <div className="content">{item.app_name || ''}</div>
                       </div>
                     </Col>
                     <Col span={12}>
                       <div className="app-item">
-                        <div className="label">缃戠珯澶村儚:</div>
-                        <div className="content">{item.favicon ? <img style={{width: '18px', height: '18px', borderRadius: '4px'}} src={item.favicon} alt="" /> : '鏃�'}</div>
+                        <div className="label">LOGO:</div>
+                        <div className="content">{item.app_icon ? <img style={{width: '18px', height: '18px', borderRadius: '4px'}} src={item.app_icon} alt="" /> : '鏃�'}</div>
                       </div>
                     </Col>
                   </Row>
@@ -1294,6 +1330,7 @@
                     <Button type="link" onClick={() => this.setState({ selectSubApp: item, subVisible: 'edit' })} style={{color: '#8E44AD'}}>淇敼</Button>
                     <Button type="link" onClick={() => this.deleteSubApp(item)} style={{color: '#ff4d4f'}}>鍒犻櫎</Button>
                     <Button type="link" onClick={() => this.jumpApp(item)}>缂栬緫搴旂敤</Button>
+                    <Button type="link" onClick={() => this.updateLink(item)}><LinkOutlined style={{color: 'orange'}}/></Button>
                     <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${window.GLOB.baseurl}${item.typename === 'pad' ? 'mob' : item.typename}/index.html#/index/${this.state.selectApp.kei_no}/${item.typename !== 'pc' ? item.typename + '/' : ''}${item.lang}${item.wxAppId ? '/' + item.wxAppId : ''}` }}></Paragraph>
                   </div>
                 </div>
@@ -1345,7 +1382,7 @@
         </Modal>
         <Modal
           title={subVisible === 'plus' ? '娣诲姞瀛愬簲鐢�' : '缂栬緫瀛愬簲鐢�'}
-          width={'850px'}
+          width={'970px'}
           maskClosable={false}
           visible={subVisible !== false}
           onCancel={() => this.setState({subVisible: false, confirmloading: false})}
@@ -1355,7 +1392,7 @@
           okText="纭畾"
           destroyOnClose
         >
-          <SubMutilForm type={subVisible} card={subVisible === 'edit' ? selectSubApp : ''} wrappedComponentRef={(inst) => this.submobcardRef = inst} inputSubmit={this.submitSubCard} />
+          <SubMutilForm type={subVisible} selectApp={selectApp} card={subVisible === 'edit' ? selectSubApp : ''} wrappedComponentRef={(inst) => this.submobcardRef = inst} inputSubmit={this.submitSubCard} />
         </Modal>
       </div>
     )

--
Gitblit v1.8.0