king
2024-07-01 b45eed171519ffe4f95d0d10743e7b3a25fcd569
src/views/appmanage/submutilform/index.jsx
@@ -21,7 +21,8 @@
    typename: 'mob',
    adapters: [],
    exts: [],
    WXApps: null
    WXApps: null,
    WXMerchs: null
  }
  UNSAFE_componentWillMount() {
@@ -48,16 +49,22 @@
      }
    }
    let apps = null
    let WXApps = null
    let WXMerchs = null
    if (window.GLOB.WXApps) {
      apps = window.GLOB.WXApps.filter(app => app.appType === 'public')
      WXApps = window.GLOB.WXApps.filter(app => app.appType === 'public')
      if (apps.length === 0) {
        apps = null
      if (WXApps.length === 0) {
        WXApps = null
      }
      WXMerchs = window.GLOB.WXApps.filter(app => app.appType === 'merchant')
      if (WXMerchs.length === 0) {
        WXMerchs = null
      }
    }
    this.setState({typename, adapters, exts, langs: _langs, WXApps: apps})
    this.setState({typename, adapters, exts, langs: _langs, WXApps, WXMerchs})
  }
  /**
@@ -77,6 +84,10 @@
          if (values.wxAppId) {
            let app = window.GLOB.WXApps.filter(app => app.appType === 'public' && values.wxAppId === app.appId)[0]
            values.wxAppName = app ? app.appName : values.wxAppId
          }
          if (values.wxMerchId) {
            let app = window.GLOB.WXApps.filter(app => app.appType === 'merchant' && values.wxMerchId === app.appId)[0]
            values.wxMerchName = app ? app.appName : values.wxMerchId
          }
          resolve(values)
@@ -103,7 +114,7 @@
  render() {
    const { card, type } = this.props
    const { getFieldDecorator } = this.props.form
    const { typename, adapters, exts, langs, WXApps } = this.state
    const { typename, adapters, exts, langs, WXApps, WXMerchs } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -194,9 +205,9 @@
          </Col> : null}
          {WXApps ? <Col span={12}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="用户可通过此公众号进行支付及退款。">
              <Tooltip placement="topLeft" title="用户可通过此公众号进行支付、退款、授权登录。">
                <QuestionCircleOutlined className="mk-form-tip" />
                关联公众号
                关联应用
              </Tooltip>
            }>
              {getFieldDecorator('wxAppId', {
@@ -208,6 +219,22 @@
              )}
            </Form.Item>
          </Col> : null}
          {WXMerchs ? <Col span={12}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="用户可通过此商户号进行支付及退款。">
                <QuestionCircleOutlined className="mk-form-tip" />
                关联商户
              </Tooltip>
            }>
              {getFieldDecorator('wxMerchId', {
                initialValue: card ? card.wxMerchId : ''
              })(
                <Select allowClear>
                  {WXMerchs.map(item => <Select.Option key={item.appId} value={item.appId}>{item.appName}</Select.Option>)}
                </Select>
              )}
            </Form.Item>
          </Col> : null}
          {typename !== 'pc' && (adapters.includes('weixin') || adapters.includes('wxmini')) ? <Col span={12}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="在公众号或小程序中,可添加绑定系统用户、自定义分享等功能,自定义分享设置后,当前子应用将默认使用此分享链接。">