public/options.json | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/api/index.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/index.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/tabviews/zshare/actionList/normalbutton/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/templates/zshare/verifycard/baseform/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/templates/zshare/verifycard/baseform/index.scss | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/templates/zshare/verifycard/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/design/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
public/options.json
@@ -8,8 +8,8 @@ "filter": "false", "defaultApp": "mk", "defaultLang": "zh-CN", "WXAppID": "", "WXminiAppID": "", "WXAppID": "wx4d8a34c8d4494872", "WXminiAppID": "wx9b9af4dbe2698680", "debugger": false, "licenseKey": "", "probation": "", src/api/index.js
@@ -110,23 +110,29 @@ /** * @description 微信业务请求 */ wxRequest (url, method, param) { let _url = document.location.origin + '/' + window.GLOB.service + url wxAccessToken () { let _url = document.location.origin + '/' + window.GLOB.service + 'wxpay/getaccesstoken' if (process.env.NODE_ENV !== 'production') { _url = document.location.origin + '/' + url _url = document.location.origin + '/wxpay/getaccesstoken' } if (param) { return axios({ url: _url, method, data: param }) } return axios({ url: _url, method return new Promise(resolve => { if (window.GLOB.accessToken.accessTime && (parseInt(new Date().getTime() / 1000) - window.GLOB.accessToken.accessTime < 30)) { resolve(window.GLOB.accessToken) } else { window.GLOB.accessToken = {} axios({ url: _url, method: 'get' }).then(res => { if (res.oa_access_token || res.mini_access_token) { window.GLOB.accessToken.accessTime = parseInt(new Date().getTime() / 1000) window.GLOB.accessToken.oa_access_token = res.oa_access_token window.GLOB.accessToken.mini_access_token = res.mini_access_token } resolve(res) }) } }) } @@ -224,7 +230,6 @@ let url = '/webapi/dologon/s_visitor_login' if (window.GLOB.mainSystemApi) { // url = window.GLOB.mainSystemApi.replace(/\/webapi(.*)/, '/webapi/dologon/s_visitor_login') param.rduri = window.GLOB.mainSystemApi.replace(/\/webapi(.*)/, '/webapi/dologon/s_visitor_login') } @@ -259,14 +264,12 @@ if (isCloud) { param.debug = 'Y' if (options.cloudServiceApi) { // url = options.cloudServiceApi.replace(/\/webapi(.*)/, '/webapi/dologon') param.rduri = options.cloudServiceApi.replace(/\/webapi(.*)/, '/webapi/dologon') } } else if (window.GLOB.mainSystemApi) { if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') { param.linkurl = window.GLOB.linkurl } // url = window.GLOB.mainSystemApi.replace(/\/webapi(.*)/, '/webapi/dologon') param.rduri = window.GLOB.mainSystemApi.replace(/\/webapi(.*)/, '/webapi/dologon') } src/index.js
@@ -71,6 +71,12 @@ GLOB.probation = false GLOB.watermark = config.watermark !== false GLOB.keepKey = config.keepPassword !== 'false' GLOB.WXAppID = config.WXAppID || '' GLOB.WXminiAppID = config.WXminiAppID || '' GLOB.accessToken = { accessTime: parseInt(new Date().getTime() / 1000), oa_access_token: '58_n--VVhcdIR_Y70FreSGNCqoKuhIjY9CHYjIiVNaOQ3k_wZYvz9FaZdU65WJ6qKAHCmePComqYfyEd11qaqhXIrUToUvP8cFxVo6gvNeIFO2XR4HgBzbhHCNtxH6spvlsXoH5xlUmNB-9cIIoOEQgACAXNZ' } if (config.externalDatabase !== false && config.externalDatabase !== 'false' && config.externalDatabase !== undefined) { GLOB.externalDatabase = config.externalDatabase ? `[${config.externalDatabase}]..` : '' src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -834,6 +834,10 @@ }) }, 600) } if (res.status) { this.triggerNote(res) // 消息 } resolve(res) }, () => { this.updateStatus() @@ -1327,6 +1331,9 @@ }) }, 600) } this.triggerNote(res) // 消息 if (params.length === 0) { this.execSuccess(res) _resolve() @@ -1535,10 +1542,6 @@ id = res.mk_b_id || res[btn.output] || '' } if (btn.verify && btn.verify.noteEnable === 'true' && id) { this.sendMessage(id) } if (res.mk_icon) { sessionStorage.setItem('avatar', res.mk_icon) } @@ -1596,9 +1599,134 @@ } } sendMessage = (id) => { const { btn : { verify } } = this.props triggerNote = (res) => { const { btn } = this.props if (!btn.verify) return if (btn.verify.noteEnable !== 'true' && btn.verify.wxNote !== 'true') return let id = '' if (btn.output) { id = res.mk_b_id || res[btn.output] || '' } if (!id) return if (btn.verify.noteEnable === 'true') { this.sendMessage(btn.verify, id) } if (btn.verify.wxNote === 'true') { this.sendWxMessage(btn.verify, id) } } sendWxMessage = (verify, id) => { let param = { func: 's_get_sms_weixin_local', upid: id } param.LText = Utils.formatOptions(Utils.getuuid()) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt(param.LText, param.timestamp) Api.genericInterface(param).then(res => { // res.data = [{openid: 'o2E7gvoSFvQRG7I8_gZxf4y3ONkQ', send_id: '2223333', first: '您的缴费信息如下', keyword1: '010000000001', keyword2: '2022年07月03日', keyword3: '供暖缴费', keyword4: '20元', keyword5: '成功', remark: '感谢您的使用!'}] if (!res.status) { notification.warning({ top: 92, message: res.message, duration: 5 }) return } else if (!res.send_data || res.send_data.length === 0) { return } let _param = { touser: '', template_id: verify.wxTemplateId, data: {} } if (verify.wxNoteLink === 'url' && verify.wxNoteLinkUrl) { _param.url = verify.wxNoteLinkUrl } else if (verify.wxNoteLink === 'miniProgram' && window.GLOB.WXminiAppID) { _param.miniprogram = { appid: window.GLOB.WXminiAppID, pagepath: '/pages/index/index' } if (verify.wxNoteLinkMenuId) { _param.miniprogram.pagepath = `/pages/index/index?MenuId=${verify.wxNoteLinkMenuId}` } } let keys = [] verify.wxNoteKeys.forEach(item => { keys.push(item.key) _param.data[item.key] = {value: '', color: item.color} }) let params = res.send_data.map(item => { let m = fromJS(_param).toJS() m.touser = item.openid || '' if (item.bid && m.miniprogram && m.miniprogram.pagepath.indexOf('MenuId') > -1) { m.miniprogram.pagepath = m.miniprogram.pagepath + `&BID=${item.bid}` } if (item.send_id) { // 防重入id m.client_msg_id = item.send_id } keys.forEach(key => { if (item[key] !== undefined) { m.data[key].value = item[key] } }) return m }) Api.wxAccessToken().then(res => { if (!res.oa_access_token) return params.forEach(n => { if (!n.touser) return Api.wxNginxRequest(`cgi-bin/message/template/send?access_token=${res.oa_access_token}`, 'post', n).then(re => { if (verify.wxNoteCallback === 'true') { let _p = { func: 's_get_sms_weixin_local_suc_err', upid: id, send_id: n.client_msg_id || '', status_result: re.errcode === 0 ? 'S' : 'E', msg_result: re.errmsg } _p.LText = Utils.formatOptions(Utils.getuuid()) _p.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') _p.secretkey = Utils.encrypt(_p.LText, _p.timestamp) Api.genericInterface(_p).then(result => { if (!result.status) { notification.warning({ top: 92, message: result.message, duration: 5 }) } }) } }) }) }) }) } sendMessage = (verify, id) => { let param = { func: 's_get_sms_local', TypeCharOne: verify.noteTemp, // N不同内容,Y相同内容 src/templates/zshare/verifycard/baseform/index.jsx
@@ -1,10 +1,13 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' // import { is, fromJS } from 'immutable' import { Form, Row, Col, Select, Radio, Tooltip } from 'antd' import { fromJS } from 'immutable' import { Form, Row, Col, Select, Radio, Tooltip, Input } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' // import './index.scss' import asyncComponent from '@/utils/asyncComponent' import './index.scss' const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) class BillCodeForm extends Component { static propTpyes = { @@ -18,10 +21,6 @@ state = { wxTemps: [], miniTemps: [], } UNSAFE_componentWillMount() { } componentDidMount() { @@ -45,7 +44,10 @@ } else if (verify.wxNote === 'true') { if (!verify.wxTemplateId) { error = '开启公众号消息推送时,需要选择消息模板!' } else if (verify.wxNoteLink === 'url' && !verify.wxNoteLinkUrl) { error = '请填写网址!' } } return error @@ -65,6 +67,11 @@ } if (_verify.wxNote !== 'true') { _verify.wxTemplateId = '' _verify.wxNoteLink = '' _verify.wxNoteLinkUrl = '' _verify.wxNoteLinkMenuId = '' _verify.wxNoteCallback = 'false' _verify.wxNoteKeys = null } this.props.onChange(_verify) @@ -78,17 +85,71 @@ this.props.onChange(_verify) } onWxTemplateChange = (val) => { onWxTemplateChange = (val, option) => { const { verify } = this.props let _verify = {...verify, wxTemplateId: val} let keys = [] if (option.props.content) { keys = option.props.content.match(/{{[a-zA-Z0-9]+\.DATA}}/g) keys = keys.map(key => key.replace(/{{|\.DATA}}/g, '')) } let index = 1 _verify.wxNoteKeys = keys.map(key => { let item = { key: key, color: '#000000', readonly: false } if (key === 'first') { item.value = 'first' item.readonly = true } else if (key === 'remark') { item.value = 'remark' item.readonly = true } else { item.value = 'p' + index index++ } return item }) this.props.onChange(_verify) } onWxNoteKeyChange = (key, val) => { let _verify = fromJS(this.props.verify).toJS() _verify.wxNoteKeys = _verify.wxNoteKeys.map(m => { if (m.key === key) { m.value = val } return m }) this.props.onChange(_verify) } onWxNoteColorChange = (key, val) => { let _verify = fromJS(this.props.verify).toJS() _verify.wxNoteKeys = _verify.wxNoteKeys.map(m => { if (m.key === key) { m.color = val } return m }) this.props.onChange(_verify) } render() { const { unionFields, verify, notes, card } = this.props // const { getFieldDecorator } = this.props.form const { wxTemps } = this.state const formItemLayout = { labelCol: { @@ -104,7 +165,7 @@ return ( <Form {...formItemLayout}> <Row gutter={24}> {card.sqlType !== 'custom' ? <Col span={8}> {card.sqlType !== 'custom' && card.intertype !== 'inner' ? <Col span={8}> <Form.Item label={ <Tooltip placement="bottomLeft" title={'默认sql执行顺序为自定义脚本之前'}> <QuestionCircleOutlined className="mk-form-tip" /> @@ -117,22 +178,22 @@ </Radio.Group> </Form.Item> </Col> : null} <Col span={8}> {card.intertype !== 'inner' ? <Col span={8}> <Form.Item label={'失效验证'}> <Radio.Group value={verify.invalid} onChange={(e) => {this.onOptionChange(e.target.value, 'invalid')}}> <Radio value="true">开启</Radio> <Radio value="false">不开启</Radio> </Radio.Group> </Form.Item> </Col> <Col span={8}> </Col> : null} {card.intertype !== 'inner' ? <Col span={8}> <Form.Item label={'账期验证'}> <Radio.Group value={verify.accountdate} onChange={(e) => {this.onOptionChange(e.target.value, 'accountdate')}}> <Radio value="true">开启</Radio> <Radio value="false">不开启</Radio> </Radio.Group> </Form.Item> </Col> </Col> : null} {verify.accountdate === 'true' ? <Col span={8}> <Form.Item label={'验证公司'} required> <Select defaultValue={verify.accountfield || ''} onChange={(val) => {this.onOptionChange(val, 'accountfield')}}> @@ -234,13 +295,73 @@ <Form.Item label="消息模板" required> <Select value={verify.wxTemplateId} onSelect={this.onWxTemplateChange}> {wxTemps.map(option => <Select.Option key={option.template_id} value={option.template_id}> <Select.Option key={option.template_id} content={option.content} value={option.template_id}> {option.title} </Select.Option> )} </Select> </Form.Item> </Col> : null} {verify.wxNote === 'true' ? <Col span={8}> <Form.Item label={ <Tooltip placement="bottomLeft" title={'是否将消息执行结果回传系统。'}> <QuestionCircleOutlined className="mk-form-tip" /> 消息回调 </Tooltip> }> <Radio.Group value={verify.wxNoteCallback || 'false'} onChange={(e) => {this.onOptionChange(e.target.value, 'wxNoteCallback')}}> <Radio value="true">开启</Radio> <Radio value="false">不开启</Radio> </Radio.Group> </Form.Item> </Col> : null} {verify.wxNote === 'true' ? <Col span={8}> <Form.Item label={ <Tooltip placement="bottomLeft" title={'点击消息时的跳转地址。'}> <QuestionCircleOutlined className="mk-form-tip" /> 跳转链接 </Tooltip> }> <Radio.Group value={verify.wxNoteLink || ''} onChange={(e) => {this.onOptionChange(e.target.value, 'wxNoteLink')}}> <Radio value="">无</Radio> <Radio value="url">网址</Radio> <Radio value="miniProgram">小程序</Radio> </Radio.Group> </Form.Item> </Col> : null} {verify.wxNoteLink === 'url' ? <Col span={8}> <Form.Item label="网址" required> <Input placeholder="" autoComplete="off" value={verify.wxNoteLinkUrl || ''} onChange={(e) => {this.onOptionChange(e.target.value, 'wxNoteLinkUrl')}}/> </Form.Item> </Col> : null} {verify.wxNoteLink === 'miniProgram' ? <Col span={8}> <Form.Item label={ <Tooltip placement="bottomLeft" title={`跳转至小程序指定菜单,空值默认跳转至小程序首页。`}> <QuestionCircleOutlined className="mk-form-tip" /> 菜单ID </Tooltip> }> <Input placeholder="" autoComplete="off" value={verify.wxNoteLinkMenuId || ''} onChange={(e) => {this.onOptionChange(e.target.value, 'wxNoteLinkMenuId')}}/> </Form.Item> </Col> : null} {verify.wxNote === 'true' && verify.wxNoteKeys ? verify.wxNoteKeys.map(item => <Col span={8} key={item.key}> <Form.Item className="mk-note-keyword" label={item.key} required> <Select value={item.value} disabled={item.readonly} onSelect={(val) => this.onWxNoteKeyChange(item.key, val)}> <Select.Option value="p1">p1</Select.Option> <Select.Option value="p2">p2</Select.Option> <Select.Option value="p3">p3</Select.Option> <Select.Option value="p4">p4</Select.Option> <Select.Option value="p5">p5</Select.Option> <Select.Option value="p6">p6</Select.Option> <Select.Option value="p7">p7</Select.Option> <Select.Option value="p8">p8</Select.Option> <Select.Option value="p9">p9</Select.Option> <Select.Option value="p10">p10</Select.Option> </Select> <ColorSketch value={item.color || '#ffffff'} onChange={(val, hex) => {this.onWxNoteColorChange(item.key, hex)}} /> </Form.Item> </Col>) : null} </Row> </Form> ) src/templates/zshare/verifycard/baseform/index.scss
@@ -0,0 +1,26 @@ .mk-note-keyword { .ant-select { width: 50%; .ant-select-selection { border-radius: 4px 0px 0px 4px; } } .color-sketch-block { width: 50%; display: inline-block; vertical-align: top; position: relative; top: 4px; .color-sketch-block-box { width: calc(100% - 75px); height: 32px; border-radius: 0px 4px 4px 0px; .color-sketch-block-inner { border-radius: 0px 4px 4px 0px; } } .color-sketch-value { width: 75px; } } } src/templates/zshare/verifycard/index.jsx
@@ -597,7 +597,7 @@ let verifyInter = card.intertype === 'system' || (card.intertype === 'custom' && card.procMode === 'system') ? 'system' : 'inner' this.setState({ activeKey: verifyInter === 'system' ? 'base' : 'tip', activeKey: verifyInter === 'system' || card.intertype === 'inner' ? 'base' : 'tip', verifyInter: verifyInter, setting: config.setting || {}, verify: _verify, @@ -1498,7 +1498,7 @@ return ( <div id="verify-card-box-tab"> <Tabs activeKey={activeKey} className="verify-card-box" onChange={this.changeTab}> {verifyInter === 'system' ? <TabPane tab={ {verifyInter === 'system' || card.intertype === 'inner' ? <TabPane tab={ <span> 基础验证 {verify.default === 'false' ? <span className="count-tip"><ExclamationOutlined style={{color: 'orange'}}/></span> : null} src/views/design/index.jsx
@@ -17,10 +17,10 @@ class Design extends Component { componentDidMount() { setGLOBFuncs() // 获取微信公众号及小程序消息模板 if (!sessionStorage.getItem('wxTemplates')) { Api.wxRequest('wxpay/getaccesstoken', 'get').then(res => { if (window.GLOB.systemType !== 'production' && window.GLOB.WXAppID && !sessionStorage.getItem('wxTemplates')) { Api.wxAccessToken().then(res => { let wxtoken = res.oa_access_token || '' let minitoken = res.mini_access_token || ''