From 5046d0d13dc6a8563b8e54e31913bc44cfa1072f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 26 四月 2022 19:23:18 +0800
Subject: [PATCH] 2022-04-26

---
 src/views/mobdesign/menuform/index.jsx |   81 +++++++++++++++++++++++++++++++++-------
 1 files changed, 66 insertions(+), 15 deletions(-)

diff --git a/src/views/mobdesign/menuform/index.jsx b/src/views/mobdesign/menuform/index.jsx
index 95da5b8..38fb28c 100644
--- a/src/views/mobdesign/menuform/index.jsx
+++ b/src/views/mobdesign/menuform/index.jsx
@@ -25,19 +25,24 @@
   selectChange = (key, value) => {
     const { config } = this.props
 
-    if (key === 'cacheUseful') {
-      this.props.updateConfig({...config, cacheUseful: value})
-    } else if (key === 'timeUnit') {
-      this.props.updateConfig({...config, timeUnit: value})
-    } else if (key === 'advertUrl') {
-      this.props.updateConfig({...config, advertUrl: value})
-    } else if (key === 'advertTime') {
-      this.props.updateConfig({...config, advertTime: value})
-    } else if (key === 'pullRefresh') {
-      this.props.updateConfig({...config, pullRefresh: value})
-    } else if (key === 'statusBarbgColor') {
-      this.props.updateConfig({...config, statusBarbgColor: value})
-    }
+    this.props.updateConfig({...config, [key]: value})
+    // if (key === 'cacheUseful') {
+    //   this.props.updateConfig({...config, cacheUseful: value})
+    // } else if (key === 'timeUnit') {
+    //   this.props.updateConfig({...config, timeUnit: value})
+    // } else if (key === 'advertUrl') {
+    //   this.props.updateConfig({...config, advertUrl: value})
+    // } else if (key === 'advertTime') {
+    //   this.props.updateConfig({...config, advertTime: value})
+    // } else if (key === 'pullRefresh') {
+    //   this.props.updateConfig({...config, pullRefresh: value})
+    // } else if (key === 'statusBarbgColor') {
+    //   this.props.updateConfig({...config, statusBarbgColor: value})
+    // } else if (key === 'permission') {
+    //   this.props.updateConfig({...config, permission: value})
+    // } else if (key === 'share') {
+    //   this.props.updateConfig({...config, share: value})
+    // }
   }
 
   // 鑿滃崟鍚嶇О
@@ -129,7 +134,7 @@
               </Tooltip>
             }>
               {getFieldDecorator('permission', {
-                initialValue: config.permission || 'true'
+                initialValue: config.permission || 'false'
               })(
                 <Radio.Group onChange={(e) => {this.selectChange('permission', e.target.value)}}>
                   <Radio value="true">浣跨敤</Radio>
@@ -219,7 +224,12 @@
             </Form.Item>
           </Col> : null}
           {adapters.includes('app') && config.advertUrl ? <Col span={24}>
-            <Form.Item label="鍋滅暀(s)">
+            <Form.Item label={
+              <Tooltip placement="topLeft" title="骞垮憡椤电殑鍋滅暀鏃堕棿銆�">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                鍋滅暀(s)
+              </Tooltip>
+            }>
               {getFieldDecorator('advertTime', {
                 initialValue: config.advertTime || 3,
                 rules: [
@@ -233,6 +243,47 @@
               )}
             </Form.Item>
           </Col> : null}
+          {adapters.includes('weixin') || adapters.includes('wxmini') ? <Col span={24}>
+            <Form.Item label="鍒嗕韩">
+              {getFieldDecorator('share', {
+                initialValue: config.share || 'default'
+              })(
+                <Radio.Group onChange={(e) => {this.selectChange('share', e.target.value)}}>
+                  <Radio value="default">榛樿</Radio>
+                  <Radio value="custom">鑷畾涔�</Radio>
+                </Radio.Group>
+              )}
+            </Form.Item>
+          </Col> : null}
+          {config.share === 'custom' && (adapters.includes('weixin') || adapters.includes('wxmini')) ? <Col span={24}>
+            <Form.Item label="鍒嗕韩鏍囬">
+              {getFieldDecorator('share_title', {
+                initialValue: config.share_title || '',
+                rules: [
+                  {
+                    required: true,
+                    message: '璇疯緭鍏ュ垎浜爣棰�!'
+                  }
+                ]
+              })(<Input placeholder="" autoComplete="off" onChange={(e) => {this.selectChange('share_title', e.target.value)}}/>)}
+            </Form.Item>
+          </Col> : null}
+          {config.share === 'custom' && (adapters.includes('weixin') || adapters.includes('wxmini')) ? <Col span={24}>
+            <Form.Item label="鍒嗕韩鎻忚堪">
+              {getFieldDecorator('share_des', {
+                initialValue: config.share_des || ''
+              })(<Input placeholder="" autoComplete="off" onChange={(e) => {this.selectChange('share_des', e.target.value)}}/>)}
+            </Form.Item>
+          </Col> : null}
+          {config.share === 'custom' && (adapters.includes('weixin') || adapters.includes('wxmini')) ? <Col span={24}>
+            <Form.Item label="鍒嗕韩鍥剧墖">
+              {getFieldDecorator('share_url', {
+                initialValue: config.share_url || ''
+              })(
+                <SourceComponent type="picture" placement="right" onChange={(val) => {this.selectChange('share_url', val)}}/>
+              )}
+            </Form.Item>
+          </Col> : null}
           <Col span={24}>
             <Form.Item label="澶囨敞">
               {getFieldDecorator('Remark', {

--
Gitblit v1.8.0