| | |
| | | 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}) |
| | | // } |
| | | } |
| | | |
| | | // 菜单名称 |
| | |
| | | </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> |
| | |
| | | </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: [ |
| | |
| | | )} |
| | | </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', { |