From 5706228a119361a22618f4565bb21c274584a6a3 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 18 四月 2022 09:48:23 +0800 Subject: [PATCH] 2022-04-18 --- src/views/mobdesign/menuform/index.jsx | 74 +++++++++++++++++++++++++++++------- 1 files changed, 59 insertions(+), 15 deletions(-) diff --git a/src/views/mobdesign/menuform/index.jsx b/src/views/mobdesign/menuform/index.jsx index 4478d02..38fb28c 100644 --- a/src/views/mobdesign/menuform/index.jsx +++ b/src/views/mobdesign/menuform/index.jsx @@ -25,21 +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}) - } else if (key === 'permission') { - this.props.updateConfig({...config, permission: 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}) + // } } // 鑿滃崟鍚嶇О @@ -240,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