Commit 8a66ef90 authored by wangxuelai's avatar wangxuelai

'微信消息推送给'

parent c007c73a
...@@ -226,15 +226,15 @@ export default { ...@@ -226,15 +226,15 @@ export default {
// }, // },
{ {
id: '80', id: '80',
name: '公众号消息推送配置', name: '公众号推送配置',
key: 80, key: 80,
isFather: false, isFather: false,
style: { style: {
width: '20px', width: '15px',
height: '20px', height: '15px',
}, },
activeurl: `${__IMGCDN__}menu/live.png?v=1`, activeurl: `${__IMGCDN__}menu/push.png?v=1`,
notactiveurl: `${__IMGCDN__}menu/liveactive.png`, notactiveurl: `${__IMGCDN__}menu/pushactive.png`,
path: '/sjd/pushsetting', path: '/sjd/pushsetting',
relativePath: ['/sjd/pushsetting'], relativePath: ['/sjd/pushsetting'],
}, },
......
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import qs from 'qs'; import qs from 'qs';
import { List, Avatar, Empty, Button } from 'antd'; import { List, Avatar, Empty, Button, message } from 'antd';
import ClipboardJS from 'clipboard';
import pageStyles from './index.less'; import pageStyles from './index.less';
import disData from '../../common/dis.data'; import disData from '../../common/dis.data';
import { LocalStorage, SessionStorage, pageIn } from '../../utils/index'; import { LocalStorage, SessionStorage, pageIn, imagify } from '../../utils/index';
class PushSetting extends React.Component { class PushSetting extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -13,6 +14,10 @@ class PushSetting extends React.Component { ...@@ -13,6 +14,10 @@ class PushSetting extends React.Component {
} }
componentDidMount() { componentDidMount() {
pageIn('轻校-公众号消息推送配置'); pageIn('轻校-公众号消息推送配置');
this.clipboard = new ClipboardJS('#btnCopyLink'); // 点击按钮复制到粘贴板
this.clipboard.on('success', () => {
message.success('复制成功', 0.3);
});
} }
componentWillUnmount() { componentWillUnmount() {
} }
...@@ -26,6 +31,7 @@ class PushSetting extends React.Component { ...@@ -26,6 +31,7 @@ class PushSetting extends React.Component {
const { const {
isEmpty, isEmpty,
wxInfo, wxInfo,
sid,
} = this.props; } = this.props;
const data = [ const data = [
{ {
...@@ -41,9 +47,15 @@ class PushSetting extends React.Component { ...@@ -41,9 +47,15 @@ class PushSetting extends React.Component {
renderItem={item => ( renderItem={item => (
<List.Item> <List.Item>
<List.Item.Meta <List.Item.Meta
avatar={<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />} avatar={<Avatar src={imagify(item.head_img)} />}
title={<span>{item.title}</span>} title={<span>{item.title}</span>}
description={`${item.created_at}绑定`} description={
(
<div>
<div>{`${item.created_at}绑定`}</div>
<div ><span id="linkcopy">{ENVIRONMENT == 'pro' ? `https://h5.qingxiao.online/qxbindpush.html?sid=${sid}` : `https://clock-h5.wp53.cn/qxbindpush.html?sid=${sid}`}</span><span style={{ paddingLeft: '10px' }} className="hreflink" data-clipboard-target="#linkcopy" id="btnCopyLink">复制</span></div>
</div>
)}
/> />
</List.Item> </List.Item>
)} )}
...@@ -77,10 +89,11 @@ function mapStateToProps(state) { ...@@ -77,10 +89,11 @@ function mapStateToProps(state) {
isEmpty, isEmpty,
wxInfo, wxInfo,
} = state.pushsetting; } = state.pushsetting;
const { locationQuery } = state.webapp; const { locationQuery, sid } = state.webapp;
return { return {
isEmpty, isEmpty,
wxInfo, wxInfo,
sid,
}; };
} }
export default connect(mapStateToProps)(PushSetting); export default connect(mapStateToProps)(PushSetting);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment