king
2024-07-01 b45eed171519ffe4f95d0d10743e7b3a25fcd569
2024-07-01
11个文件已修改
237 ■■■■ 已修改文件
public/manifest.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/index.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/newpagebutton/index.jsx 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/index.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/appcheck/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/appmanage/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/appmanage/submutilform/index.jsx 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pay/index.jsx 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/manifest.json
@@ -6,5 +6,5 @@
  "display": "standalone",
  "theme_color": "#000000",
  "background_color": "#ffffff",
  "mk_version": "20240601"
  "mk_version": "20240701"
}
src/index.js
@@ -48,6 +48,7 @@
    GLOB.nginx = config.nginx + '' === 'true'
    GLOB.WXAppID = config.WXAppID || ''
    GLOB.WXminiAppID = config.WXminiAppID || ''
    GLOB.WXMerchID = config.WXMerchID || ''
    GLOB.WXNotice = config.WXNotice + '' === 'true'
    GLOB.execType = config.execType === 'x' ? 'x' : ''
    GLOB.accessToken = {}
@@ -60,7 +61,7 @@
    GLOB.defLang = ''
    if (config.WXApps) {
      config.WXApps = config.WXApps.filter(app => app.appId && app.appName && ['public', 'miniProgram'].includes(app.appType))
      config.WXApps = config.WXApps.filter(app => app.appId && app.appName && ['public', 'miniProgram', 'merchant'].includes(app.appType))
      if (config.WXApps.length) {
        GLOB.WXApps = config.WXApps
      }
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -444,7 +444,7 @@
      } else if (this.record.pageTemplate === 'pay') {
        reOptions.Ot = requireOptions.filter(op => op.value === 'requiredSgl')
        shows.push('payMode', 'wxApp')
        shows.push('payMode', 'wxApp', 'wxMerch')
        if (this.record.payMode === 'inner') {
          reRequired.innerFunc = true
          shows.push('innerFunc')
@@ -520,7 +520,7 @@
        shows.push('innerFunc', 'Ot', 'execSuccess', 'execError', 'urlkey')
      } else if (_funcType === 'pay') {
        shows.push('payType', 'wxApp', 'Ot', 'execSuccess', 'execError', 'syncComponent', 'openmenu')
        shows.push('payType', 'wxApp', 'wxMerch', 'Ot', 'execSuccess', 'execError', 'syncComponent', 'openmenu')
        if (this.record.openmenu && this.record.openmenu !== 'goback') {
          shows.push('open')
        }
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -331,9 +331,21 @@
    extraParam.push('dataM')
  }
  let apps = []
  let merchs = []
  if (!appType) {
    if (typeof(card.openmenu) === 'string') {
      card.openmenu = []
    }
    if (window.GLOB.WXApps) {
      window.GLOB.WXApps.forEach(item => {
        if (item.appType === 'merchant') {
          merchs.push({value: item.appId, text: item.appName})
        } else {
          apps.push({value: item.appId, text: item.appName})
        }
      })
    }
  } else {
    if (typeof(card.openmenu) !== 'string') {
@@ -509,10 +521,20 @@
      key: 'wxApp',
      label: '关联应用',
      initVal: card.wxApp || '',
      tooltip: '请关联支付(或退款)的公众号或小程序。',
      tooltip: '请关联支付的公众号或小程序。',
      required: true,
      forbid: !!appType || !window.GLOB.WXApps,
      options: window.GLOB.WXApps ? window.GLOB.WXApps.map(item => ({value: item.appId, text: item.appName})) : []
      forbid: apps.length === 0,
      options: apps
    },
    {
      type: 'select',
      key: 'wxMerch',
      label: '关联商户',
      initVal: card.wxMerch || '',
      tooltip: '请关联支付的商户号。',
      required: true,
      forbid: merchs.length === 0,
      options: merchs
    },
    {
      type: 'text',
@@ -1764,6 +1786,19 @@
    extraParam.push('dataM')
  }
  let apps = []
  let merchs = []
  if (window.GLOB.WXApps) {
    window.GLOB.WXApps.forEach(item => {
      if (item.appType === 'merchant') {
        merchs.push({value: item.appId, text: item.appName})
      } else {
        apps.push({value: item.appId, text: item.appName})
      }
    })
  }
  let forms = [
    {
      type: 'select',
@@ -1911,10 +1946,20 @@
      key: 'wxApp',
      label: '关联应用',
      initVal: card.wxApp || '',
      tooltip: '请关联支付(或退款)的公众号或小程序。',
      tooltip: '请关联支付的公众号或小程序。',
      required: true,
      forbid: !window.GLOB.WXApps,
      options: window.GLOB.WXApps ? window.GLOB.WXApps.map(item => ({value: item.appId, text: item.appName})) : []
      forbid: apps.length === 0,
      options: apps
    },
    {
      type: 'select',
      key: 'wxMerch',
      label: '关联商户',
      initVal: card.wxMerch || '',
      tooltip: '请关联支付的商户号。',
      required: true,
      forbid: merchs.length === 0,
      options: merchs
    },
    {
      type: 'text',
src/tabviews/zshare/actionList/newpagebutton/index.jsx
@@ -241,8 +241,34 @@
    } else if (btn.pageTemplate === 'pay') {
      _name = '支付'
      let appId = ''
      let merchId = ''
      if (btn.wxApp) {
        appId = btn.wxApp
        if (!window.GLOB.WXApps || window.GLOB.WXApps.findIndex(item => item.appId === btn.wxApp) === -1) {
          notification.warning({
            top: 92,
            message: '按钮关联应用不在可用列表中,请重新保存按钮配置!',
            duration: 5
          })
          return
        }
      }
      if (btn.wxMerch) {
        merchId = btn.wxMerch
        if (!window.GLOB.WXApps || window.GLOB.WXApps.findIndex(item => item.appId === btn.wxMerch) === -1) {
          notification.warning({
            top: 92,
            message: '按钮关联商户不在可用列表中,请重新保存按钮配置!',
            duration: 5
          })
          return
        }
      }
      if (btn.payMode === 'system' || btn.payMode === 'inner') {
        this.prequest(Id, data[0] || {})
        this.prequest(Id, data[0] || {}, appId, merchId)
      } else {
        confirm({
          title: '请在付款页面完成订单支付。',
@@ -259,13 +285,7 @@
          },
        })
        let appId = ''
        if (btn.wxApp && window.GLOB.WXApps && window.GLOB.WXApps.findIndex(item => item.appId === btn.wxApp) > -1) {
          appId = btn.wxApp
        }
        window.open('#/pay/' + window.btoa(window.encodeURIComponent(JSON.stringify({ ID: Id, appId: appId }))))
        window.open('#/pay/' + window.btoa(window.encodeURIComponent(JSON.stringify({ ID: Id, appId, merchId }))))
      }
    } else if (btn.pageTemplate === 'custom') {
      let url = btn.url
@@ -323,7 +343,7 @@
    }
  }
  prequest = (ID, data) => {
  prequest = (ID, data, appId, merchId) => {
    const { btn, BID } = this.props
    let param = null
@@ -388,13 +408,7 @@
          },
        })
        let appId = ''
        if (btn.wxApp && window.GLOB.WXApps && window.GLOB.WXApps.findIndex(item => item.appId === btn.wxApp) > -1) {
          appId = btn.wxApp
        }
        window.open('#/pay/' + window.btoa(window.encodeURIComponent(JSON.stringify({ ID: id, appId: appId }))))
        window.open('#/pay/' + window.btoa(window.encodeURIComponent(JSON.stringify({ ID: id, appId, merchId }))))
      } else {
        this.execError(res)
      }
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2551,8 +2551,16 @@
    let domain = ''
    let appId = window.GLOB.WXAppID || ''
    if (verify.wxAppId && window.GLOB.WXApps && window.GLOB.WXApps.findIndex(item => item.appId === verify.wxAppId) > -1) {
    if (verify.wxAppId && verify.wxAppId !== appId) {
      appId = verify.wxAppId
      if (!window.GLOB.WXApps || window.GLOB.WXApps.findIndex(item => item.appId === verify.wxAppId) === -1) {
        notification.warning({
          top: 92,
          message: '按钮关联公众号不在可用列表中,请重新保存按钮配置!',
          duration: 5
        })
        return
      }
    }
    
    if (['8IFltwzyKcu15iA8fqSyb6m-pMa88a3ZTu0No3vDHgo', 'LOB-bbt9jVncGh7IOAUdESh1Sgzcbt62UwOqSqcK9ok'].includes(verify.wxTemplateId) && window.GLOB.sysType !== 'cloud') {
src/templates/zshare/verifycard/index.jsx
@@ -695,11 +695,19 @@
      activeKey = 'cbScripts'
    }
    let oriVerify = fromJS(_verify).toJS()
    if (_verify.wxAppId) {
      if (!window.GLOB.WXApps || window.GLOB.WXApps.filter(app => app.appType === 'public').length === 0) {
        delete _verify.wxAppId
      }
    }
    this.setState({
      activeKey: activeKey,
      verifyInter: verifyInter,
      verify: _verify,
      oriVerify: fromJS(_verify).toJS()
      oriVerify: oriVerify
    })
    if (card.intertype === 'inner') return
src/views/appcheck/index.jsx
@@ -86,6 +86,8 @@
              cell.logo = _param.logo || ''
              cell.wxAppId = _param.wxAppId || ''
              cell.wxAppName = _param.wxAppName || ''
              cell.wxMerchId = _param.wxMerchId || ''
              cell.wxMerchName = _param.wxMerchName || ''
            }
            return cell
@@ -195,8 +197,10 @@
                    </Col>
                    <Col span={12}>
                      <div className="app-item">
                        {item.wxAppName ? <div className="label">关联公众号:</div> : null}
                        {item.wxAppName ? <div className="content">{item.wxAppName}</div> : null}
                        {item.wxAppName || item.wxMerchName ? <>
                          <div className="label">关联应用:</div>
                          <div className="content">{`${item.wxAppName}${item.wxAppName && item.wxMerchName ? ' / ' + item.wxMerchName : item.wxMerchName || ''}`}</div>
                        </> : null}
                      </div>
                    </Col>
                    <Col span={12}>
src/views/appmanage/index.jsx
@@ -487,6 +487,8 @@
              cell.share_link = _param.share_link || '' // 分享链接
              cell.wxAppId = _param.wxAppId || ''
              cell.wxAppName = _param.wxAppName || ''
              cell.wxMerchId = _param.wxMerchId || ''
              cell.wxMerchName = _param.wxMerchName || ''
              if (cell.adapter && (cell.adapter === 'true' || cell.adapter === 'false')) {
                cell.adapter = ''
@@ -1039,6 +1041,10 @@
      _par.wxAppId = item.wxAppId
      _par.wxAppName = item.wxAppName || item.wxAppId
    }
    if (item.wxMerchId) {
      _par.wxMerchId = item.wxMerchId
      _par.wxMerchName = item.wxMerchName || item.wxMerchId
    }
    return _par
  }
@@ -1248,8 +1254,10 @@
                    </Col>
                    <Col span={12}>
                      <div className="app-item">
                        {item.wxAppName ? <div className="label">关联公众号:</div> : null}
                        {item.wxAppName ? <div className="content">{item.wxAppName}</div> : null}
                        {item.wxAppName || item.wxMerchName ? <>
                          <div className="label">关联应用:</div>
                          <div className="content">{`${item.wxAppName}${item.wxAppName && item.wxMerchName ? ' / ' + item.wxMerchName : item.wxMerchName || ''}`}</div>
                        </> : null}
                      </div>
                    </Col>
                    <Col span={12}>
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="在公众号或小程序中,可添加绑定系统用户、自定义分享等功能,自定义分享设置后,当前子应用将默认使用此分享链接。">
src/views/pay/index.jsx
@@ -27,37 +27,46 @@
    second: 60,
    overdue: false,
    overdone: false,
    appId: ''
    appId: '',
    merchId: ''
  }
  UNSAFE_componentWillMount () {
    let param = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param)))
    let _appId = param.appId || window.GLOB.WXAppID || window.GLOB.WXminiAppID || ''
    let appId = param.appId || window.GLOB.WXAppID || window.GLOB.WXminiAppID || ''
    let merchId = param.merchId || window.GLOB.WXMerchID || ''
    this.setState({
      orderId: param.ID,
      appId: _appId
      appId: appId,
      merchId: merchId
    })
    if (param.ID && _appId) {
      this.getOrder(param.ID, _appId)
    if (param.ID && appId && merchId) {
      this.getOrder(param.ID, appId, merchId)
    } else if (!param.ID) {
      notification.warning({
        top: 92,
        message: '未获取到订单ID!',
        duration: 5
      })
    } else if (!_appId) {
    } else if (!appId) {
      notification.warning({
        top: 92,
        message: '未获取到应用ID!',
        duration: 5
      })
    } else if (!merchId) {
      notification.warning({
        top: 92,
        message: '未获取到商户号!',
        duration: 5
      })
    }
  }
  getOrder = (Id, appId) => {
  getOrder = (Id, appId, merchId) => {
    let param = {
      func: 's_get_weixin_pay_native',
      ID: Id
@@ -108,7 +117,7 @@
          return
        }
        Api.getWxNativePay({ 'out_biz_no': res.out_trade_no, app_id: appId }).then(result => {
        Api.getWxNativePay({ 'out_biz_no': res.out_trade_no, app_id: appId, mchid: merchId }).then(result => {
          if (result.status && result.code_url) {
            this.setState({
              qrcode: result.code_url
@@ -183,7 +192,7 @@
  }
  resetQrcode = () => {
    const { orderNo, appId } = this.state
    const { orderNo, appId, merchId } = this.state
    if (!orderNo) {
      notification.warning({
@@ -199,9 +208,16 @@
        duration: 5
      })
      return
    } else if (!merchId) {
      notification.warning({
        top: 10,
        message: '未获取到商户号!',
        duration: 5
      })
      return
    }
    Api.getWxNativePay({ 'out_biz_no': orderNo, app_id: appId }).then(result => {
    Api.getWxNativePay({ 'out_biz_no': orderNo, app_id: appId, mchid: merchId }).then(result => {
      if (result.status && result.code_url) {
        this.setState({
          qrcode: result.code_url,
@@ -219,9 +235,9 @@
    })
  }
  onChange = () => {
  // onChange = () => {
  }
  // }
  render () {
    const { logo, name, orderNo, icp, copyRight, total, unit, qrcode, second, overdue, overdone } = this.state