Commit ef5722f7 authored by wangxuelai's avatar wangxuelai

'绑定公总号状态添加'

parent a688575e
......@@ -11,12 +11,12 @@
<script src="js/console-polyfill.js"></script>
<![endif]-->
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"></script>
<script src="/js/ueeditor/ueditor.config.js?20200107" charset="utf-8"></script><script src="/js/ueeditor/ueditor.all.js?20200107" charset="utf-8"></script>
<script src="js/console-polyfill.js?20200107" charset="utf-8"></script><script src="js/es6-shim.min.js?20200107" charset="utf-8"></script><script src="js/es5-shim.js?20200107" charset="utf-8"></script><script src="js/es5-sham.min.js?20200107" charset="utf-8"></script><script src="js/json3.min.js?20200107" charset="utf-8"></script><script src="js/html5shiv.min.js?20200107" charset="utf-8"></script><script src="js/polyfill.js?20200107" charset="utf-8"></script><script src="lib/vendor.dll.js?20200107" charset="utf-8"></script>
</head>
</head>
<body>
<div id="root"></div>
<script type="text/javascript" src="/dist/main.1b5c4c.js"></script></body>
</html>
<script type="text/javascript" src="/dist/main.4197ae.js"></script></body>
</html>
\ No newline at end of file
......@@ -46,6 +46,40 @@ export default {
});
}
},
* refreshPushSetting({ payload }, { call, put, select }) {
const { sid } = yield select(state => state.webapp);
const data = yield call(pushSettingAjax.getOfficialAccount, {
school_id: sid,
});
if (data.code == 200) {
yield put({
type: 'updateState',
payload: {
isEmpty: false,
wxInfo: {
title: data.data.title,
created_at: data.data.created_at,
logo: data.data.head_img,
template_config_status: data.data.template_config_status,
},
},
});
} else if (data.code == 40000) {
yield put({
type: 'updateState',
payload: {
isEmpty: true,
},
});
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data,
},
});
}
},
* queryinfo({ payload }, { call, put, select }) {
const { sid, locationQuery } = yield select(state => state.webapp);
const { auth_code } = locationQuery;
......@@ -101,7 +135,8 @@ export default {
wxInfo: {
title: data.data.title,
created_at: data.data.created_at,
logo: '',
logo: data.data.head_img,
template_config_status: data.data.template_config_status,
},
},
});
......
......@@ -27,6 +27,12 @@ class PushSetting extends React.Component {
type: 'pushsetting/gobindwx',
});
}
refreshPushSetting = () => {
const { dispatch } = this.props;
dispatch({
type: 'pushsetting/refreshPushSetting',
});
}
render() {
const {
isEmpty,
......@@ -34,6 +40,7 @@ class PushSetting extends React.Component {
sid,
hasPushAuth,
} = this.props;
console.log(wxInfo, 'wxInfo');
const data = [
{
title: 'Ant Design Title 1',
......@@ -48,12 +55,16 @@ class PushSetting extends React.Component {
renderItem={item => (
<List.Item>
<List.Item.Meta
avatar={<Avatar src={imagify(item.head_img)} />}
avatar={<Avatar src={imagify(item.logo)} />}
title={<span>{item.title}</span>}
description={
(
<div>
<div>{`${item.created_at}绑定`}</div>
{item.template_config_status == 1 && <div>状态:未配置</div>}
{item.template_config_status == 2 && <div>状态:配置中<span style={{ paddingLeft: '10px' }} className="hreflink" onClick={this.refreshPushSetting}>刷新状态</span></div>}
{item.template_config_status == 3 && <div>状态:配置成功</div>}
{item.template_config_status == 4 && <div>状态:配置失败,请联系轻校客服 </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>
)}
......
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