Commit 5c132245 by yanglang123

xiugai

parent 1bfa5cd1
......@@ -10,6 +10,7 @@ import {
} from "antd-mobile";
import API from "../../../util/urlconfig";
import { Sticky, StickyContainer } from "react-sticky";
import SignResultModal from "./signResultModal/";
import MediaDisplay from "../../../common/mediaDisplay/index";
import blackPage from "../../../common/mediaDisplay/black-bg.png";
......@@ -70,14 +71,16 @@ class TrainingSteps extends Component {
commentHasMore: true,
showContentOccupy: false,
isNative: false,
enablePosition: 0,
baomingModal: false,
refreshTrainComment: "",
activityStateCode: "", //0待开始;1待报名;2待签到;3立即报名;4立即签到;5进行中;6已结束;7未报名;8未签到
activityStateName: "",
enablePosition: 0, // 0 线上活动 1线下活动(需要扫码)
signTimeId: "", //签到
signType: "", //签到
hasFinished: "", //控制是否可以评论
signResultVisible: false,
signResultCode: 0,
reasonFromApi: "",
};
this.contentDomHeightSetForSticky =
this.contentDomHeightSetForSticky.bind(this);
......@@ -109,14 +112,14 @@ class TrainingSteps extends Component {
let { introductionVo } = _this.props.TrainingStepsReducer;
let {
activityStateCode,
activityStateName,
enablePosition,
signTimeId,
signType,
hasFinished,
} = introductionVo;
_this.setState({
activityStateCode: activityStateCode,
activityStateName: activityStateName,
enablePosition: enablePosition,
signTimeId: signTimeId,
signType: signType,
hasFinished: hasFinished,
......@@ -260,9 +263,9 @@ class TrainingSteps extends Component {
let {
activityStateCode,
hasFinished,
activityStateName,
signTimeId,
signType,
enablePosition,
} = this.state;
let signUpTitle =
activityStateCode == "1"
......@@ -271,8 +274,10 @@ class TrainingSteps extends Component {
? "待签到"
: activityStateCode == "3"
? "立即报名"
: activityStateCode == "4"
: activityStateCode == "4" && enablePosition == 0
? "立即签到"
: activityStateCode == "4" && enablePosition == 1
? "扫码签到"
: activityStateCode == "5"
? "进行中"
: activityStateCode == "7"
......@@ -336,7 +341,12 @@ class TrainingSteps extends Component {
type="primary"
className="signup-button"
onClick={() => {
this.handleOk(activityStateCode, signTimeId, signType);
this.handleOk(
activityStateCode,
signTimeId,
signType,
enablePosition
);
}}
>
{signUpTitle}
......@@ -361,6 +371,13 @@ class TrainingSteps extends Component {
报名成功后,待活动开始,您要在活动现场扫码签到哦
</div>
</Modal>
<SignResultModal
visible={this.state.signResultVisible}
status={this.state.signResultCode}
reasonFromApi={this.state.reasonFromApi}
closeSignResultModal={this.closeSignResultModal}
/>
</Fragment>
) : (
""
......@@ -368,6 +385,111 @@ class TrainingSteps extends Component {
</div>
);
}
signIn = (e) => {
//需要再有些优化
e.preventDefault();
let comecodeToken =
sessionStorage.getItem(func.companyCode() + "daying") || "";
let accountId = sessionStorage.getItem("accountId") || "";
// 交银康联RN
const msg = {
method: "scannerAction", //这一行表明调用RN的相机功能
params: {
comecodeToken,
accountId,
},
};
// 空白页不需要传递了terminalMp 使用判断终端即可
if (parseInt(terminalMp) == 0) {
//ios
window.webkit.messageHandlers.scannerAction.postMessage(
JSON.stringify(msg)
);
} else if (parseInt(terminalMp) == 1) {
//安卓
let orgId = sessionStorage.getItem("orgId");
nativeView.scannerAction(accountId, comecodeToken, orgId);
} else {
//微信
let that = this;
let appid = sessionStorage.getItem("appid");
wx.ready(function () {
wx.scanQRCode({
// 默认为0,扫描结果由微信处理,1则直接返回扫描结果
needResult: 1,
desc: "scanQRCode desc",
success: function (res) {
console.log(res, "扫描结果");
if (
typeof res.resultStr == "string" &&
(res.resultStr.includes("http://") ||
res.resultStr.includes("https://"))
) {
window.location.href = res.resultStr;
return;
}
let resultParam = JSON.parse(res.resultStr);
if (resultParam.type == "sign") {
delete resultParam.type;
let resultStr = JSON.stringify(resultParam);
that.props.sign(resultStr, (backData) => {
that.setState({
signResultVisible: true,
signResultCode: parseInt(backData.data.code),
reasonFromApi: backData.data.name,
});
});
} else {
/*跳转规则
扫码用的type:
项目:project
签到:sign(这是好的)
投票:vote
课程:course
调研:research
考试:exam
专辑:Album */
let url =
resultParam.type == "exam"
? "exam/examdetail"
: resultParam.type == "course"
? "course/courseplay"
: resultParam.type == "project"
? "train/trainingsteps"
: resultParam.type == "research"
? "SurveyDetails"
: resultParam.type == "train"
? "train/trainingdetail"
: resultParam.type == "vote"
? "vote"
: resultParam.type == "lecturer"
? "teacher/detail"
: resultParam.type == "Album"
? "AlbumDetail"
: "";
//跳转页面
hashHistory.push({
pathname: func.routerBefore() + "/" + url,
query: { id: resultParam.id },
});
}
},
});
wx.error(function (res) {
//alert(res);
console.log("签名错误");
console.log(res);
});
});
}
};
closeSignResultModal() {
this.setState({
signResultVisible: false,
});
}
//简介
renderIntroduction = (introductionVo) => {
let introStartTime = moment(
......@@ -749,9 +871,11 @@ class TrainingSteps extends Component {
});
};
//确认报名
handleOk = (code, signTimeId, signType) => {
handleOk = (code, signTimeId, signType, type) => {
// type 0 线上 1线下(扫码)
let { id, finished } = this.props.location.query;
if (code == "4") {
if (type == 0) {
let _this = this;
let params = {
trainingProjectId: id,
......@@ -771,6 +895,7 @@ class TrainingSteps extends Component {
});
});
});
}
} else {
let params = {
id: id,
......@@ -848,7 +973,7 @@ class TrainingSteps extends Component {
toSurvey = (id) => {
hashHistory.push({
pathname: func.routerBefore() + "/allDescribe",
query: { id: id, bizType: '2' },
query: { id: id, bizType: "2" },
});
};
}
......
import React, { Component } from 'react';
import "./style.less";
import { Modal } from "antd-mobile";
import failResultIcon from "./sign-result-fail.png";
import successResultIcon from "./sign-result-success.png";
import authResultIcon from "./sign-result-auth.png";
import bgResultIcon from "./sign-result-bg.png";
import intl from "react-intl-universal";
class SignResultModal extends Component {
constructor(props) {
super(props)
this.state = {
signModalVisible: false,
signResultStatus: 1
}
}
componentDidMount() {
const { visible, status } = this.props;
this.setState({
signModalVisible: visible,
signResultStatus: status
});
}
componentWillReceiveProps(nextProps) {
if (nextProps.visible != this.props.visible) {
this.setState({
signModalVisible: nextProps.visible,
signResultStatus: nextProps.status
});
}
}
getIconByStatus(status) {
switch (status) {
case 1:
case 5:
return failResultIcon;
case 2:
case 3:
case 4:
return successResultIcon;
case 6:
return authResultIcon;
default:
return failResultIcon;
}
}
getResultTitleByStatus(status) {
switch (status) {
case 1:
return intl.get("signFail") || "签到失败";
case 2:
return intl.get("signSuccess") || "签到成功";
case 3:
return intl.get("alreadySign") || "已签到";
case 4:
return intl.get("reSignSuccess") || "补签成功";
case 5:
return intl.get("signFail") || "签到失败";
case 6:
return intl.get("signNoAuth") || "没有权限";
default:
return intl.get("signFail") || "签到失败";
}
}
getResultReasonByStatus(status, reasonFromApi) {
switch (status) {
case 1:
return intl.get("sign.not.start") || "签到时间未开始";
case 2:
return intl.get("signSuccess") || "签到成功";
case 3:
return intl.get("sign.already.success") || "您已签到成功";
case 4:
return intl.get("reSignSuccess") || "补签成功";
case 5:
return intl.get("sign.out.deadline") || "签到时间已过";
case 6:
return intl.get("sign.no.auth") || "您没有权限访问该项目";
default:
return reasonFromApi;
}
}
getResultBtnByStatus(status) {
switch (status) {
case 1:
case 5:
case 6:
return intl.get("AssignOK") || "我知道了";
case 2:
case 3:
case 4:
return intl.get("signConfirm") || "确认";
default:
return intl.get("AssignOK") || "我知道了";
}
}
render() {
const { status, reasonFromApi,closeSignResultModal } = this.props;
let blueIcon = this.getIconByStatus(status);
let signTitleCode = this.getResultTitleByStatus(status);
let signReasonCode = this.getResultReasonByStatus(status, reasonFromApi);
let signBtnCode = this.getResultBtnByStatus(status);
return (
<div className="sign-result-modal-container">
<Modal
visible={this.state.signModalVisible }
width={450}
height={480}
className="sign-result-modal"
>
<div className="sign-result-block">
<div className="result-blue-icon">
<img src={bgResultIcon} alt="" className="result-blue-bg" />
<img className="result-blue-icon" src={blueIcon} alt="" />
</div>
<div className="result-title">
{signTitleCode}
</div>
<div className="result-reason">
{signReasonCode}
</div>
<div className="result-btn" onClick={closeSignResultModal}>
{signBtnCode}
</div>
</div>
</Modal>
</div>
)
}
}
export default SignResultModal;
.singleLineOverflow {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
#wmy-root-body .sign-result-modal {
width: 450px;
height: 480px;
}
#wmy-root-body .sign-result-modal .am-modal-content {
border-radius: 20px;
}
#wmy-root-body .sign-result-modal .sign-result-block {
width: 100%;
height: 480px;
background-color: #fff;
border-radius: 20px;
}
#wmy-root-body .sign-result-modal .sign-result-block .result-blue-icon {
width: 100%;
height: 198px;
text-align: center;
position: relative;
}
#wmy-root-body .sign-result-modal .sign-result-block .result-blue-icon .result-blue-bg {
width: 100%;
height: 198px;
position: absolute;
left: 0;
top: 0;
}
#wmy-root-body .sign-result-modal .sign-result-block .result-blue-icon .result-blue-icon {
width: 110px;
height: 112px;
margin-top: 48px;
}
#wmy-root-body .sign-result-modal .sign-result-block .result-title {
width: 100%;
height: 50px;
line-height: 50px;
font-size: 36px;
color: #333;
margin-top: 32px;
font-weight: 600;
}
#wmy-root-body .sign-result-modal .sign-result-block .result-reason {
width: 100%;
height: 40px;
line-height: 40px;
font-size: 28px;
color: #666;
margin-top: 16px;
font-weight: 400;
}
#wmy-root-body .sign-result-modal .sign-result-block .result-btn {
width: 170px;
height: 64px;
margin: 0 auto;
background-color: #4285f4;
border-radius: 34px;
margin-top: 32px;
font-size: 28px;
color: #fff;
line-height: 62px;
text-align: center;
font-weight: 400;
}
@import "../../../../static/theme.less";
.sign-result-modal-container {}
#wmy-root-body{
.sign-result-modal {
width: 450px;
height: 480px;
.am-modal-content {
border-radius: 20px;
}
.sign-result-block {
width : 100%;
height : 480px;
background-color: #fff;
border-radius : 20px;
.result-blue-icon {
width : 100%;
height : 198px;
text-align: center;
position : relative;
.result-blue-bg {
width : 100%;
height : 198px;
position: absolute;
left : 0;
top : 0;
}
.result-blue-icon {
width : 110px;
height : 112px;
margin-top: 48px;
}
}
.result-title {
width : 100%;
height : 50px;
line-height: 50px;
font-size : 36px;
color : #333;
margin-top : 32px;
font-weight: 600;
}
.result-reason {
width : 100%;
height : 40px;
line-height: 40px;
font-size : 28px;
color : #666;
margin-top : 16px;
font-weight: 400;
}
.result-btn {
width : 170px;
height : 64px;
margin : 0 auto;
background-color: @themeColor;
border-radius : 34px;
margin-top : 32px;
font-size : 28px;
color : #fff;
line-height : 62px;
text-align : center;
font-weight : 400;
}
}
}
}
......@@ -23,11 +23,14 @@
}
.train-index-list-container .train-index-list-item-container .train-index-list-item-info .train-index-list-item-info-name {
width: 100%;
height: 40px;
line-height: 40px;
font-size: 32px;
color: #333;
font-weight: 500;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-all;
}
.train-index-list-container .train-index-list-item-container .train-index-list-item-info .train-index-list-item-info-name .qt {
padding: 8px 20px;
......
......@@ -15,11 +15,15 @@
width: 60%;
.train-index-list-item-info-name {
width: 100%;
height: 40px;
line-height: 40px;
font-size: 32px;
color: #333;
font-weight: 500;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-all;
.qt {
padding: 8px 20px;
background-color: #e7f7e8;
......
import api from '../../util/urlconfig';
import excute from '../../util/fetchUtil';
import API from '../../util/urlconfig';
import { Toast } from "antd-mobile";
//纪检信箱
export function myCommentListApi(params, callback) {
return (dispatch) => {
return excute.post(
API.myCommentListApi,
params,
(response) => {
Toast.info('提交成功')
export function getPointListApi(selectedTypeCopy,callback) {
const url = api.myPoint + "?pageNo=1&pageSize=20&type=" + selectedTypeCopy;
// console.log('selectedType',selectedType);
return dispatch => {
return excute.get(url, (backData) => {
if (callback) {
callback(response.data);
callback(backData);
}
});
}
);
};
}
// export function addPointList(pageNo, year, selectedType, callback) {
// let selectedTypeCopy = ''
// if (year == undefined) {
// year = '';
// }
// if (selectedType != '全部') {
// selectedTypeCopy = selectedType
// }
// const url = api.myPoint + "?pageNo=" + pageNo + "&pageSize=20&year=" + year + '&type=' + selectedTypeCopy;
// console.log(url);
// return dispatch => {
// return excute.get(url, (backData) => {
// if (backData != undefined) {
// dispatch({ type: ADD_MYPOINT_LIST, data: backData })
// if (callback) {
// callback();
// }
// }
// });
// }
// }
\ No newline at end of file
......@@ -4,15 +4,15 @@ import { connect } from "react-redux";
import { hashHistory } from "react-router";
import func from "../../util/commonFunc";
import { bindActionCreators } from "redux";
import { myCommentListApi } from "./action";
import { getPointListApi } from "./action";
import giftImg from "./image/gift.png";
import shopImg from "./image/shop-icon.png";
import jinbi from "./image/jinbi.png";
class myComment extends Component {
class MyIntegral extends Component {
constructor(props) {
super(props);
this.state = {
score: "320",
score: "340",
scoreNow: "6",
showBtn: false,
contList: [
......@@ -55,9 +55,14 @@ class myComment extends Component {
};
document.title = "我的积分";
}
componentWillMount() {
console.log("我的积分");
this.props.getPointListApi('', (res) => {
console.log(res)
});
}
componentDidMount() {
// this.props.myCommentListApi({});
// this.props.getPointListApi({});
}
handleTo = (url) => {
hashHistory.push({
......@@ -101,7 +106,7 @@ class myComment extends Component {
积分
</div>
</div>
{contList.map((item,index) => {
{contList.map((item, index) => {
return (
<div className="box-content" key={index}>
<div className="content-items">
......@@ -131,7 +136,7 @@ const mapStateToProps = (state) => {
};
const mapDispatchToProps = (dispatch) => {
return {
myCommentListApi: bindActionCreators(myCommentListApi, dispatch),
getPointListApi: bindActionCreators(getPointListApi, dispatch),
};
};
export default connect(mapStateToProps, mapDispatchToProps)(myComment);
export default connect(mapStateToProps, mapDispatchToProps)(MyIntegral);
......@@ -183,7 +183,7 @@ class NewsListPage extends Component {
return;
}
this.getNewsList(pageNo + 1);
this.getNewsList(pageNo + 1,this.state.currentClassifyId);
};
render() {
......
......@@ -246,7 +246,7 @@ class NewsMessage extends Component {
})
let param2 = {
pageNo: 1,
pageSize: 20,
pageSize: 30,
terminalName: "MOBILE",
typeName: "news",
typeTwo: itemid
......
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