Commit 24904985 authored by baixian's avatar baixian

微官网

parents 34ce7633 a688575e
......@@ -11,7 +11,7 @@
<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>
......@@ -19,4 +19,4 @@
<body>
<div id="root"></div>
<script type="text/javascript" src="/dist/main.f651b7.js"></script></body>
</html>
\ No newline at end of file
</html>
......@@ -3,19 +3,23 @@ const { location } = window;
const basepath = `${location.protocol}//${pathify(window.location.host)}/`;
let api = '';
let dakaapi = '';
let dakaapiv4 = '';
if (ENVIRONMENT == 'pro') {
// api = 'https://test.wp53.cn/v2/api/';
// dakaapi = 'https:clock.wp53.cn/v3/';
api = 'https://wx.m.shangjiadao.cn/v2/api/';
dakaapi = 'https://qxapi.qingxiao.online/daka/v3/';
dakaapiv4 = 'https://qxapi.qingxiao.online/daka/v4/';
} else if (ENVIRONMENT == 'dev') {
// api = 'https://wx.m.shangjiadao.cn/v2/api/';
// dakaapi = 'https://qxapi.qingxiao.online/daka/v3/';
api = 'https://test.wp53.cn/v2/api/';
dakaapi = 'https://clock.wp53.cn/v3/';
dakaapiv4 = 'https://clock.wp53.cn/v4/';
} else if (ENVIRONMENT == 'testenv') {
api = 'https://test.wp53.cn/v2/api/';
dakaapi = 'https:clock.wp53.cn/v3/';
dakaapiv4 = 'https:clock.wp53.cn/v4/';
}
export default {
userRegister: `${api}service/user/register`,
......@@ -24,8 +28,8 @@ export default {
replenish: `${api}v1/user/replenish`,
verifyCodeLogin: `${api}service/user/clock_login`,
login: `${api}service/user/login`,
videoupload: `${dakaapi}member/media_access`,
imgupload: `${dakaapi}member/oss/access`,
videoupload: `${dakaapiv4}member/media_access`,
imgupload: `${dakaapiv4}member/oss/access`,
memberSchools: `${dakaapi}member/school`,
getCategorys: `${dakaapi}common/categorys`,
memberSchool: `${dakaapi}member/school`,
......@@ -41,6 +45,12 @@ export default {
fileTransForm: `${dakaapi}member/file_convert/create`,
fileConvertQuery: `${dakaapi}member/file_convert/query`,
editorUpload: `${dakaapi}common/editor_upload`,
getfeatures: `${dakaapi}member/features`,
bindWx: {
getPreAuthorizationUrl: `${dakaapi}member/wechat/open/get_pre_authorization_url`,
getOfficialAccount: `${dakaapi}member/wechat/open/get_official_account`,
bindToOpenPlatform: `${dakaapi}member/wechat/open/bind_to_open_platform`,
},
newLogin: {
loginPost: `${dakaapi}common/business_login`,
},
......
......@@ -210,19 +210,33 @@ export default {
},
],
},
// {
// id: '70',
// name: '直播课堂',
// key: 70,
// isFather: false,
// style: {
// width: '20px',
// height: '20px',
// },
// activeurl: `${__IMGCDN__}menu/live.png?v=1`,
// notactiveurl: `${__IMGCDN__}menu/liveactive.png`,
// path: '/sjd/liveClass',
// relativePath: ['/sjd/liveClass', '/sjd/addLive', '/sjd/editLive/:id'],
// },
{
id: '70',
name: '直播课堂',
key: 70,
id: '80',
name: '公众号推送配置',
key: 80,
isFather: false,
style: {
width: '20px',
height: '20px',
width: '15px',
height: '15px',
},
activeurl: `${__IMGCDN__}menu/live.png?v=1`,
notactiveurl: `${__IMGCDN__}menu/liveactive.png`,
path: '/sjd/liveClass',
relativePath: ['/sjd/liveClass', '/sjd/addLive', '/sjd/editLive/:id'],
activeurl: `${__IMGCDN__}menu/push.png?v=1`,
notactiveurl: `${__IMGCDN__}menu/pushactive.png`,
path: '/sjd/pushsetting',
relativePath: ['/sjd/pushsetting'],
},
],
};
......@@ -936,8 +936,11 @@ export default {
const { userInfo, sid } = yield select(state => state.webapp);
const { files, uploadtype, contentSort } = payload;
const file = files.files ? files.files[0] : null;
const ext = file.name.split('.').pop();
const REGEXP_VIDEO = /^image\/\w+/;
const params = { type: 1, token: userInfo.token, schoolId: sid };
const params = {
type: 1, token: userInfo.token, schoolId: sid, ext,
};
let signature = {};
if (file && (REGEXP_VIDEO.test(file.type) || file.type === '')) {
const uploaderLoading = message.loading('正在上传图片');
......@@ -976,7 +979,7 @@ export default {
} = yield select(state => state.createtheme);
const filename = `${signature.dir}${getRandomFilename(file.name)}`;
const params = {
key: filename,
key: signature.path,
policy: signature.policy,
OSSAccessKeyId: signature.accessid,
signature: signature.signature,
......@@ -984,7 +987,7 @@ export default {
url: signature.host,
};
const uploadImg = yield call(uploader.uploadImg, params);
const imageUrl = filename;
const imageUrl = signature.path;
if (uploadtype == 'quickcomment') {
jobParams.content.push({
type: 'img',
......@@ -1055,8 +1058,12 @@ export default {
files, uploadtype, orgIndex, contentSort,
} = payload;
const file = files.files ? files.files[0] : null;
const ext = file && file.name.split('.').pop();
console.log(ext, 'ext');
const REGEXP_VIDEO = /^audio\/\w+/;
const params = { type: 2, token: userInfo.token, schoolId: sid };
const params = {
type: 2, token: userInfo.token, schoolId: sid, ext,
};
let signature = {};
if (file && (REGEXP_VIDEO.test(file.type) || file.type === '')) {
const uploadSignature = yield call(uploader.uploadVideoSignature, params);
......@@ -1086,7 +1093,7 @@ export default {
} = yield select(state => state.createtheme);
const filename = `${signature.dir}${getRandomFilename(file.name)}`;
const params = {
key: filename,
key: signature.path,
policy: signature.policy,
OSSAccessKeyId: signature.accessid,
signature: signature.signature,
......@@ -1094,7 +1101,7 @@ export default {
url: signature.host,
};
const uploadImg = yield call(uploader.uploadVideo, params);
const videoUrl = filename;
const videoUrl = signature.path;
document.getElementById('uploadVoice').value = '';
if (uploadtype == 'uploadVoiceJob') {
const duration = yield call(getAudioDuration, file);
......@@ -1159,12 +1166,15 @@ export default {
progressCallBack,
} = payload;
const file = files.files ? files.files[0] : null;
const ext = file && file.name.split('.').pop();
if (file && file.size > 2000 * 1024 * 1024) {
message.error('视频的大小不能超过2GB,请重新上传', 1);
return;
}
const REGEXP_VIDEO = /^video\/\w+/;
const params = { type: 1, token: userInfo.token, schoolId: sid };
const params = {
type: 1, token: userInfo.token, schoolId: sid, ext,
};
let signature = {};
if (file && (REGEXP_VIDEO.test(file.type) || file.type === '')) {
const uploadSignature = yield call(uploader.uploadVideoSignature, params);
......@@ -1210,7 +1220,7 @@ export default {
} = yield select(state => state.createtheme);
const filename = `${signature.dir}${getRandomFilename(file.name)}`;
const params = {
key: filename,
key: signature.path,
policy: signature.policy,
OSSAccessKeyId: signature.accessid,
signature: signature.signature,
......@@ -1222,7 +1232,7 @@ export default {
const uploadImg = yield call(uploader.uploadVideo, params, (res) => {
progressCallBack(res);
});
const videoUrl = filename;
const videoUrl = signature.path;
if (JSON.stringify(uploadImg) == '{"status":"ok"}') {
yield put({
type: 'updateState',
......
......@@ -454,8 +454,11 @@ export default {
files,
} = payload;
const file = files ? files[0] : null;
const ext = file && file.name.split('.').pop();
const REGEXP_IMAGE = /^image\/\w+/;
const params = { prefix: 'excel', token: userInfo.token, schoolId: sid };
const params = {
prefix: 'excel', token: userInfo.token, schoolId: sid, ext,
};
let signature = {};
if (file) {
const uploaderLoading = message.loading('正在上传学员');
......@@ -478,7 +481,7 @@ export default {
const file = files ? files[0] : null;
const filename = `${signature.dir}${getRandomFilename(file.name)}`;
const params = {
key: filename,
key: signature.path,
policy: signature.policy,
OSSAccessKeyId: signature.accessid,
signature: signature.signature,
......@@ -492,7 +495,7 @@ export default {
type: 'uploadStudents',
payload: {
uploaderLoading,
file_name: fileName,
file_name: signature.path,
file_info: JSON.stringify({
name: file.name || '',
size: file.size || '',
......
......@@ -61,6 +61,7 @@ import createmarke from './createmarke';
import newthemelist from './newthemelist';
import clockmember from './clockmember';
import common from './common';
import pushsetting from './pushsetting';
export default {
loginModel,
indexstaicModel,
......@@ -116,4 +117,5 @@ export default {
newthemelist,
clockmember,
common,
pushsetting,
};
......@@ -323,6 +323,7 @@ export default {
}
} else {
if (schoolDetail.data.sort) {
console.log(schoolDetail.data.sort, 'schoolDetail.data.sort');
const sortnewpageInfo = [];
try {
moduleSort = JSON.parse(schoolDetail.data.sort);
......
import { routerRedux } from 'dva/router';
import { message } from 'antd';
import { delay } from 'redux-saga';
import {
LocalStorage,
SessionStorage,
isExpired,
getRandomString,
} from '../utils/index';
import errorcode from '../common/errorcode';
import * as pushSettingAjax from '../services/pushsetting';
import * as commomAjax from '../services/common';
export default {
namespace: 'pushsetting',
state: {
isEmpty: true,
wxInfo: {
title: '',
created_at: '',
logo: '',
},
hasPushAuth: false,
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
},
},
effects: {
* gobindwx({ payload }, { call, put, select }) {
const { sid } = yield select(state => state.webapp);
const data = yield call(pushSettingAjax.getPreAuthorizationUrl, {
school_id: sid,
});
if (data.code == 200) {
window.open(data.data);
} 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;
if (auth_code) {
yield put(routerRedux.replace({
pathname: '/sjd/pushsetting',
}));
const bindToOpenPlatformData = yield call(pushSettingAjax.bindToOpenPlatform, {
auth_code,
school_id: sid,
});
if (bindToOpenPlatformData.code == 200) {
yield put(routerRedux.replace({
pathname: '/sjd/pushsetting',
}));
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data: bindToOpenPlatformData,
},
});
}
return;
}
const getfeaturesData = yield call(commomAjax.getfeatures, {
school_id: sid,
});
if (getfeaturesData.code == 200) {
const status = getfeaturesData.data.list.find(ele => ele.type == 1);
if (!status) {
yield put({
type: 'updateState',
payload: {
hasPushAuth: false,
},
});
} else {
yield put({
type: 'updateState',
payload: {
hasPushAuth: true,
},
});
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: '',
},
},
});
} else if (data.code == 40000) {
yield put({
type: 'updateState',
payload: {
isEmpty: true,
},
});
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data,
},
});
}
}
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data: getfeaturesData,
},
});
}
},
},
reducers: {
save(state, action) {
return { ...state, ...action.payload };
},
updateState(state, action) {
return { ...state, ...action.payload };
},
},
};
......@@ -1426,6 +1426,22 @@ export default {
},
});
}
if (pathname === '/sjd/pushsetting') {
dispatch({
type: 'pushsetting/queryinfo',
});
dispatch({
type: 'updateState',
payload: {
breadcrumbList: [
{
path: pathname,
name: '公众号消息推送配置',
},
],
},
});
}
const editLiveclass = pathToRegexp('/sjd/editLive/:id').exec(pathname);
if (editLiveclass) {
dispatch({
......
......@@ -64,12 +64,12 @@ class StudentClock extends React.Component {
</div>
{ele.subject && ele.subject.subject_type == 3 &&
<div className={PageStyle.playstatus}>
{timeCompare(ele.created_at_time)}打卡成功 已闯{ele.clock_days} 已坚持打卡{ele.clock_days}
{timeCompare(ele.created_at_time)} &nbsp;&nbsp; 已坚持{ele.clock_days} 浏览{ele.visit_pv_count && ele.visit_pv_count != 0 ? ele.visit_pv_count : 1}
</div>
}
{ele.subject && (ele.subject.subject_type == 2 || ele.subject.subject_type == 1) &&
<div className={PageStyle.playstatus}>
{timeCompare(ele.created_at_time)}打卡成功 已坚持打卡{ele.clock_days}
{timeCompare(ele.created_at_time)} &nbsp;&nbsp;已坚持{ele.clock_days} && {ele.visit_pv_count != 0 ? ele.visit_pv_count : 1}
</div>
}
</div>
......@@ -97,10 +97,10 @@ class StudentClock extends React.Component {
</div>
</div>
}
<div className={PageStyle.circlename}>{(ele.subject && ele.subject.classes && ele.subject.classes.title) || ''}</div>
{/* <div className={PageStyle.circlename}>{(ele.subject && ele.subject.classes && ele.subject.classes.title) || ''}</div> */}
<div className={PageStyle.operatebox}>
<div className={PageStyle.operateboxleft}>
{ele.website_read || 0}阅读
{/* {ele.websitcirclenamee_read || 0}阅读 */}
</div>
<div className={PageStyle.operateboxright}>
<div className={PageStyle.operateitem}>
......
import React from 'react';
import { connect } from 'dva';
import qs from 'qs';
import { List, Avatar, Empty, Button, message } from 'antd';
import ClipboardJS from 'clipboard';
import pageStyles from './index.less';
import disData from '../../common/dis.data';
import { LocalStorage, SessionStorage, pageIn, imagify } from '../../utils/index';
class PushSetting extends React.Component {
constructor(props) {
super(props);
this.state = {
};
}
componentDidMount() {
pageIn('轻校-公众号消息推送配置');
this.clipboard = new ClipboardJS('#btnCopyLink'); // 点击按钮复制到粘贴板
this.clipboard.on('success', () => {
message.success('复制成功', 0.3);
});
}
componentWillUnmount() {
}
goBindWx = () => {
const { dispatch } = this.props;
dispatch({
type: 'pushsetting/gobindwx',
});
}
render() {
const {
isEmpty,
wxInfo,
sid,
hasPushAuth,
} = this.props;
const data = [
{
title: 'Ant Design Title 1',
},
];
return (
<div className={pageStyles.container}>
{!isEmpty && hasPushAuth &&
<List
itemLayout="horizontal"
dataSource={[wxInfo]}
renderItem={item => (
<List.Item>
<List.Item.Meta
avatar={<Avatar src={imagify(item.head_img)} />}
title={<span>{item.title}</span>}
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>
)}
/>
}
{isEmpty && hasPushAuth &&
<Empty
image="https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg"
imageStyle={{
height: 60,
}}
description={
<span>
该校区暂未绑定自己的公众号,绑定之后可以使用自己的公众号推送
</span>
}
>
<Button type="primary" onClick={this.goBindWx}>绑定公众号</Button>
</Empty>
}
{!hasPushAuth &&
<Empty
image="https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg"
imageStyle={{
height: 60,
}}
description={
<span>
该校区暂未开启自定义公众号推送功能,请联系轻校客服
</span>
}
>
</Empty>
}
</div>
);
}
}
PushSetting.propTypes = {
};
function mapStateToProps(state) {
const {
isEmpty,
wxInfo,
hasPushAuth,
} = state.pushsetting;
const { locationQuery, sid } = state.webapp;
return {
hasPushAuth,
isEmpty,
wxInfo,
sid,
};
}
export default connect(mapStateToProps)(PushSetting);
@import '../../less/variables.less';
@images: '@{imagesroot}/login/';
.container {
background-color: #fff;
border-radius: 2px;
padding: 20px;
}
\ No newline at end of file
......@@ -301,6 +301,11 @@ const ClockMember = props => (
{ ClockMember => (<ClockMember {...props} />) }
</Bundle>
);
const PushSetting = props => (
<Bundle load={() => import(/* webpackChunkName:"PushSetting" */'./pages/pushsetting/index')}>
{ PushSetting => (<PushSetting {...props} />) }
</Bundle>
);
const CeIndex = props => (
<Bundle load={() => import(/* webpackChunkName:"CeIndex" */'./pages/ceshi/index')}>
{ CeIndex => (<CeIndex {...props} />) }
......@@ -366,6 +371,7 @@ function RouterConfig({ history }) {
<Route path="/sjd/editLive/:id" exact component={AddLive} />
<Route path="/sjd/clockList" exact component={ClockList} />
<Route path="/sjd/member/:type/:id" exact component={ClockMember} />
<Route path="/sjd/pushsetting" exact component={PushSetting} />
{/* <Route path="/sjd/ceshi" exact component={CeIndex} /> */}
<Route component={Errorpage} />
</Switch>
......
......@@ -111,3 +111,10 @@ export function getschooluuid(params) {
method: 'GET',
});
}
export function getfeatures(params) {
const data = qs.stringify(params);
return request({
url: `${api.getfeatures}?${data}`,
method: 'GET',
});
}
import qs from 'qs';
import request from '../utils/request';
import api from '../common/api';
// common: `${dakaapi}member/erp/classes`,
// changeClassStatus: `${dakaapi}member/erp/class/status`,
// addClassStudents: `${dakaapi}member/erp/class/student/add`,
export function getPreAuthorizationUrl(params) {
const data = qs.stringify(params);
return request({
url: `${api.bindWx.getPreAuthorizationUrl}?${data}`,
method: 'GET',
data,
});
}
export function getOfficialAccount(params) {
const data = qs.stringify(params);
return request({
url: `${api.bindWx.getOfficialAccount}?${data}`,
method: 'GET',
data,
});
}
export function bindToOpenPlatform(params) {
const data = qs.stringify(params);
return request({
url: `${api.bindWx.bindToOpenPlatform}?${data}`,
method: 'POST',
data,
});
}
......@@ -14,7 +14,9 @@ export function uploadSignature({ type, token, schoolId }) {
},
});
}
export function uploadVideoSignature({ type, token, schoolId }) {
export function uploadVideoSignature({
type, token, schoolId, ext,
}) {
return request({
url: `${api.videoupload}`,
method: 'GET',
......@@ -22,6 +24,7 @@ export function uploadVideoSignature({ type, token, schoolId }) {
type,
token,
school_id: schoolId,
ext,
},
timeout: 60 * 60 * 1000,
});
......@@ -67,7 +70,9 @@ export function uploadVideo(params, progressCallback) {
},
});
}
export function uploadImageSignature({ type, token, schoolId }) {
export function uploadImageSignature({
type, token, schoolId, ext,
}) {
return request({
url: `${api.imgupload}`,
method: 'GET',
......@@ -75,10 +80,13 @@ export function uploadImageSignature({ type, token, schoolId }) {
type,
token,
school_id: schoolId,
ext,
},
});
}
export function uploadExcelSignature({ prefix, token, schoolId }) {
export function uploadExcelSignature({
prefix, token, schoolId, ext,
}) {
return request({
url: `${api.imgupload}`,
method: 'GET',
......@@ -86,6 +94,7 @@ export function uploadExcelSignature({ prefix, token, schoolId }) {
prefix,
token,
school_id: schoolId,
ext,
},
});
}
......
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