From cb9ade2afd2a367ad767bc605ab7086c695dd010 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 09 十二月 2022 15:53:32 +0800
Subject: [PATCH] 2022-12-09

---
 src/menu/components/card/cardcomponent/options.jsx |   39 +++++++++++++++++++++++++++++++--------
 1 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/src/menu/components/card/cardcomponent/options.jsx b/src/menu/components/card/cardcomponent/options.jsx
index dfbcf7c..40d460f 100644
--- a/src/menu/components/card/cardcomponent/options.jsx
+++ b/src/menu/components/card/cardcomponent/options.jsx
@@ -40,6 +40,12 @@
   if (hasMenus) {
     ops = [{value: 'menus', label: '鑿滃崟缁�'}]
   }
+  let adapters = sessionStorage.getItem('adapter') || ''
+  if (adapters.indexOf('wxmini') > -1) {
+    ops.push({value: 'miniprogram', label: '灏忕▼搴�'})
+  } else if (setting.click === 'miniprogram') {
+    setting.click = ''
+  }
 
   const cardSettingForm = [
     {
@@ -97,11 +103,11 @@
       forbid: subtype !== 'propcard'
     },
     {
-      type: !hasMenus ? 'radio' : 'select',
+      type: ops.length === 0 ? 'radio' : 'select',
       field: 'click',
       label: '鐐瑰嚮浜嬩欢',
       initval: setting.click || '',
-      tooltip: '褰撶粦瀹氱偣鍑讳簨浠舵椂锛屽崱鐗囩殑鍒囨崲鍔熻兘灏嗗け鏁堛��',
+      // tooltip: '褰撶粦瀹氱偣鍑讳簨浠舵椂锛屽崱鐗囩殑鍒囨崲鍔熻兘灏嗗け鏁堛��',
       required: false,
       options: [
         {value: '', label: '鏃�'},
@@ -114,11 +120,13 @@
         {field: 'menu', values: ['menu']},
         {field: 'linkurl', values: ['link']},
         {field: 'open', values: ['menu', 'link', 'menus']},
-        {field: 'joint', values: ['menu', 'link', 'menus']},
+        {field: 'joint', values: ['menu', 'link', 'menus', 'miniprogram']},
         {field: 'linkbtn', values: ['button']},
         {field: 'clickType', values: ['button']},
         {field: 'menuType', values: ['menus']},
         {field: 'menus', values: ['menus']},
+        {field: 'miniAppId', values: ['miniprogram']},
+        {field: 'miniPath', values: ['miniprogram']},
       ]
     },
     {
@@ -148,16 +156,31 @@
       span: 24
     },
     {
+      type: 'text',
+      field: 'miniAppId',
+      label: '灏忕▼搴廇ppID',
+      initval: setting.miniAppId || '',
+      required: true
+    },
+    {
+      type: 'text',
+      field: 'miniPath',
+      label: '椤甸潰璺緞',
+      initval: setting.miniPath || '',
+      tooltip: '鍙寚瀹氳烦杞皬绋嬪簭椤甸潰锛屼负绌烘椂鎵撳紑棣栭〉锛屾敞锛氬弬鏁版嫾鎺ュ湪鎸囧畾椤甸潰鏃舵湁鏁堛��',
+      required: false
+    },
+    {
       type: 'radio',
       field: 'open',
       label: '鎵撳紑鏂瑰紡',
       initval: setting.open || 'blank',
       required: false,
       options: [
-        {value: 'blank', label: '鏂扮獥鍙�'},
-        {value: 'self', label: '褰撳墠绐楀彛'},
+        {value: 'blank', label: appType !== 'mob' ? '鏂扮獥鍙�' : '鏂伴〉闈�'},
+        {value: 'self', label: appType !== 'mob' ? '褰撳墠绐楀彛' : '褰撳墠椤甸潰'},
       ],
-      forbid: appType !== 'pc'
+      forbid: appType !== 'pc' && appType !== 'mob'
     },
     {
       type: 'radio',
@@ -219,7 +242,7 @@
           editable: true,
           unique: true,
           required: false,
-          width: '35%'
+          width: '30%'
         },
         {
           title: '鑿滃崟',
@@ -228,7 +251,7 @@
           editable: true,
           required: true,
           extends: !appType ? 'Menu' : [{key: 'label', value: 'label'}],
-          width: '35%',
+          width: '40%',
           render: (text, record) => record.label,
           options: menulist
         }

--
Gitblit v1.8.0