Commit 99225ed9 by yanglang123

投票新页面

parent 192bee37
......@@ -30,8 +30,6 @@ class AllDescribe extends Component {
render() {
let { id, type } = this.props.location.query;
const { list } = this.state;
let pageWidth =
document.body.clientWidth > 750 ? 750 : document.body.clientWidth;
return (
<div className="describe-out">
<div className="describe-top">
......@@ -65,7 +63,7 @@ class AllDescribe extends Component {
<div
className="describe-btn"
onClick={() => {
this.handleTo(id, type);
this.handleTo(id, type, list);
}}
>
立即{type}
......@@ -75,12 +73,19 @@ class AllDescribe extends Component {
);
}
// 跳转到投票
handleTo = (id, type) => {
handleTo = (id, type, list) => {
//pageMode(呈现样式:1逐题呈现 2整页呈现)
if (type == "投票") {
hashHistory.push({
pathname: func.routerBefore() + "/SurveyDetails",
query: { id: id },
});
// hashHistory.push({
// pathname: func.routerBefore() + "/SurveyDetails",
// query: { id: id },
// });
if (list.pageMode == 2) {
hashHistory.push({
pathname: func.routerBefore() + "/vote",
query: { id: id, name: list.name, voteNum: list.voteNum },
});
}
}
};
}
......
......@@ -502,7 +502,18 @@ class TrainingSteps extends Component {
>
活动介绍
</p>
<div className="train-info">
<div>
<List className="train-info-contain">
<List.Item>
<MediaDisplay
width={document.body.clientWidth - 80}
content={introductionVo.description}
/>
</List.Item>
</List>
</div>
</div>
{introductionVo.videoUrl ? (
<div
style={{
......@@ -526,14 +537,13 @@ class TrainingSteps extends Component {
<div
style={{
width: "100%",
height: "280px",
paddingLeft: "40px",
paddingRight: "15px",
marginBottom: "10px",
}}
>
<img
style={{ width: "100%", height: "280px" }}
style={{ width: "100%" }}
src={item.img}
alt=""
/>
......@@ -541,19 +551,6 @@ class TrainingSteps extends Component {
);
})
)}
<div className="train-info">
<div>
<List className="train-info-contain">
<List.Item>
<MediaDisplay
width={document.body.clientWidth - 80}
content={introductionVo.description}
/>
</List.Item>
</List>
</div>
</div>
</div>
{introductionVo.researchName ? (
<div
......@@ -730,7 +727,7 @@ class TrainingSteps extends Component {
dataSource={this.state.dataSource}
renderRow={row.bind(this)}
onEndReached={this.onLoadMore}
listStyle={50}
// listStyle={50}
isLoading={this.state.isLoading}
page={{
pageTotal: reviewListTotle,
......
......@@ -236,7 +236,6 @@ class ShowAnswer extends Component {
let { isAnswer, isAnalysis } = this.state;
return (
<div className="question-block" key={rowId}>
<div style={{ backgroundColor: "#fff" }}>
<div className="question-topic" style={{ marginBottom: "-60px" }}>
<h4>
{`${Number.parseInt(rowId) + 1}`}.
......@@ -343,7 +342,7 @@ class ShowAnswer extends Component {
</div>
) : null}
<div className="sep-bottom"></div>
</div>
</div>
);
}
......
......@@ -31,7 +31,6 @@ import intl from "react-intl-universal";
componentWillReceiveProps = (nextProps) => {
if (nextProps.data !== this.props.data) {
console.log(12312312,nextProps.data.options)
this.setState({
data:nextProps.data.options,
})
......
......@@ -82,7 +82,6 @@ class details extends Component {
}
//单选题其他txt回现1
if (data.question && data.question.type == 1) {
console.log('danxuan', data.question.options)
data.question.options.map((v, i) => {
if (v.check == 1 && v.isOther == 1) {
this.state.oneid = v.id
......@@ -172,17 +171,13 @@ class details extends Component {
/* bug11641 回车符显示换行 zhouzhongyang 20200617 end*/
questionItem = (item, sectionId, rowId) => {
return (
<div className="question-block">
{/*是否展开调研说明*/}
{item.isFrist == 1 && item.remark !== '' ?
<div style={{ fontSize: '.28rem', padding: ' 0.1rem 0.3rem', borderBottom: '5px solid rgba(248,248,248,1)' }} >
<div >
<div>
<h4 style={{ float: 'left', padding: '15px 0', fontSize: '32px' }}>投票</h4>
</div>
<div style={{ clear: 'both' }}></div>
......
......@@ -46,96 +46,6 @@ class mehomeNav extends React.Component {
this.props.search(value);
}
}
// 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,
// });
// }
render() {
return (
<Fragment>
......
......@@ -20,11 +20,7 @@
}
.news-list-page-container .news-list-page-scroll-container .news-classify-list-container {
width: 100%;
height: 176px;
position: sticky;
background-color: #fff;
left: 0;
top: 0;
height: 90px;
z-index: 9;
overflow-y: hidden;
overflow-x: auto;
......@@ -44,6 +40,7 @@
position: relative;
z-index: 2;
padding: 0 10px;
overflow-x: auto;
}
.news-list-page-container .news-list-page-scroll-container .news-classify-list-container .news-classify-list-scroll-container .news-classify-item-container {
max-width: 324px;
......
......@@ -17,11 +17,7 @@
.news-classify-list-container {
width: 100%;
height: 176px;
position: sticky;
background-color: #fff;
left: 0;
top: 0;
height: 90px;
z-index: 9;
overflow-y: hidden;
overflow-x: auto;
......@@ -41,6 +37,7 @@
position: relative;
z-index: 2;
padding: 0 10px;
overflow-x: auto;
.news-classify-item-container{
max-width: 324px;
height: 88px;
......
......@@ -67,7 +67,7 @@
.NewMessageCss-pis .ant-tabs-extra-content .extra-wrapper .mask {
height: 1500px;
opacity: 0.5;
background: rgba(0, 0, 0, 0.4);
background: rgba(0, 0, 0, 0.1);
position: absolute;
width: 100%;
}
......
......@@ -97,7 +97,7 @@
.mask{
height: 1500px;
opacity: 0.5;
background: rgba(0, 0, 0, 0.4);
background: rgba(0, 0, 0, 0.1);
position: absolute;
width: 100%;
}
......
.singleLineOverflow {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.no-content-auth-container {
width: 100%;
height: 100%;
......@@ -29,7 +35,7 @@
.no-content-auth-container .no-auth-confirm .no-auth-confirm-bg {
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.4);
background: rgba(0, 0, 0, 0.1);
}
.no-content-auth-container .no-auth-confirm .no-auth-confirm-modal {
width: 540px;
......
......@@ -34,7 +34,7 @@
.no-auth-confirm-bg {
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.4);
background: rgba(0, 0, 0, 0.1);
}
.no-auth-confirm-modal {
......
import excute from '../../util/fetchUtil';
import API from '../../util/urlconfig';
import { Toast } from "antd-mobile";
export function VoteListApi(params, callback) {
const url = `${API.voteListApi}?researchId=${params.id}`;
return (dispatch) => {
return excute.get(
url,
(response) => {
if (callback) {
callback(response.data);
}
}
);
};
}
export function voteSumbitApi(params, callback) {
return (dispatch) => {
return excute.post(
API.voteSumbitApi,
params,
(response) => {
if (Number.parseFloat(response.code) === 1000) {
Toast.info("提交成功");
if (callback) {
callback(response.data);
}
}
}
);
};
}
\ No newline at end of file
import React, { Component } from "react";
import "./style.less";
import { hashHistory } from "react-router";
import func from "../../util/commonFunc";
import moment from "moment";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import { VoteListApi, voteSumbitApi } from "./action";
import { Modal } from "antd-mobile";
class Vote extends Component {
constructor(props) {
super(props);
this.state = {
list: [],
modalStatu: false,
oldVoteNum: 0,
// oldVoteNum: this.props.location.query.voteNum,
voteNum: this.props.location.query.voteNum,
};
}
componentDidMount() {
let _this = this;
let { id } = this.props.location.query;
let params = {
id: id,
};
this.props.VoteListApi(params, (response) => {
let list = response;
list.map((item) => {
item["actived"] = true;
});
_this.setState({
list: list,
});
});
}
render() {
let { name } = this.props.location.query;
const { list, voteNum, oldVoteNum } = this.state;
console.log(list, "投票数据列表111111111111");
return (
<div className="vote-out">
<div className="vote-title">{name}</div>
<div
style={{
width: "92%",
margin: "0 auto",
display: "flex",
justifyContent: "space-between",
marginBottom: "20px",
}}
>
<div
style={{
fontSize: "30px",
color: "rgba(255,255,255,0.6)",
}}
>
点击图片可查看详情
</div>
<div
style={{
fontSize: "30px",
color: "rgba(255,255,255,1)",
}}
>
剩余投票次数:{voteNum}
</div>
</div>
<div className="vote-box">
{list.map((item, index) => {
return (
<div className="vote-top">
<div
className="top-img"
onClick={() => {
this.handleTo(item);
}}
>
<img src={item.contentAppendixUrl} alt="" />
<div className="index-icon">{index + 1}</div>
</div>
<div className="top-content">
<div className="cont-name">{item.options[0].content}</div>
<div
className={
item.keywords == "精石之美"
? "cont-icon1"
: item.keywords == "突破之美"
? "cont-icon2"
: item.keywords == "进取之美"
? "cont-icon3"
: "cont-icon4"
}
>
{item.keywords}
</div>
<div
className={
item.actived ? "top-btn-select" : "top-btn-selected"
}
onClick={() => {
this.handleVote(item, voteNum);
}}
>
{item.actived ? "投票" : "已投票"}
</div>
<Modal
title=""
visible={this.state.modalStatu}
transparent
maskClosable={false}
className={"signup-modal"}
onClose={this.baomingHidden}
footer={[
{
text: "确定",
onPress: () => {
this.baomingHidden();
},
},
]}
>
<div className="modal-body">
{voteNum == 0
? "本次投票最多选择" + oldVoteNum + "项"
: "本次投票最少选择1项"}
</div>
</Modal>
</div>
</div>
);
})}
</div>
<div
className="sumbit-btn"
onClick={() => {
this.handleSumbit(voteNum, oldVoteNum);
}}
>
{oldVoteNum == 0 ? "查看排名" : "提交"}
</div>
</div>
);
}
//跳转详情
handleTo = (item) => {
hashHistory.push({
pathname: func.routerBefore() + "/voteDetail",
query: {
id: this.props.location.query.id,
content: item.content,
keywords: item.keywords,
name: item.options[0].content,
img: item.contentAppendixUrl,
},
});
};
// 投票
handleVote = (item, voteNum) => {
let _this = this;
if (voteNum == 0) {
_this.setState({
modalStatu: true,
});
} else {
if (item.actived) {
_this.setState({
voteNum: voteNum - 1,
});
item.actived = false;
}
}
};
//提交
handleSumbit = (voteNum, oldVoteNum) => {
if (oldVoteNum == 0) {
hashHistory.push({
pathname: func.routerBefore() + "/theCharts",
query: {
id: this.props.location.query.id,
},
});
} else {
let xkeyData = [];
const { list } = this.state;
let _this = this;
list.map((item) => {
if (item.actived) {
xkeyData.push({
questionId: item.options[0].questionId,
questionType: item.options[0].questionType,
questionItems: [{ optionId: "", content: "", score: "" }],
});
} else {
xkeyData.push({
questionId: item.options[0].questionId,
questionType: item.options[0].questionType,
questionItems: [
{ optionId: item.options[0].id, content: "", score: "" },
],
});
}
});
let params = {
researchId: this.props.location.query.id,
terminalType: 2,
startTime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
submitTime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
questions: xkeyData,
};
if (voteNum == 3) {
this.setState({
modalStatu: true,
});
} else {
_this.props.voteSumbitApi(params, (response) => {
console.log(response);
});
}
}
};
baomingHidden = () => {
this.setState({
modalStatu: false,
});
};
}
const mapStateToProps = (state) => {
return {};
};
const mapDispatchToProps = (dispatch) => {
return {
VoteListApi: bindActionCreators(VoteListApi, dispatch),
voteSumbitApi: bindActionCreators(voteSumbitApi, dispatch),
};
};
export default connect(mapStateToProps, mapDispatchToProps)(Vote);
.vote-out {
padding-top: 60px;
padding-bottom: 40px;
width: 100%;
min-height: 100%;
background: linear-gradient(0deg, #ff9286 0%, #d23a29), linear-gradient(180deg, rgba(255, 255, 255, 0) 59%, #f5f5f5 100%), linear-gradient(0deg, rgba(210, 58, 41, 0) 0%, #d23a29);
}
.vote-out .vote-title {
width: 92%;
margin: 0 auto;
margin-bottom: 40px;
height: 60px;
line-height: 60px;
text-align: center;
font-size: 42px;
color: #fff;
font-family: PingFang SC, PingFang SC-500;
font-weight: 500;
background: linear-gradient(90deg, rgba(255, 151, 130, 0), #ff9782 53%, rgba(255, 151, 130, 0) 100%);
}
.vote-out .vote-box {
width: 92%;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.vote-out .vote-box .vote-top {
width: 45%;
height: 480px;
border-radius: 40px;
margin-bottom: 40px;
background-color: #fff;
overflow: hidden;
}
.vote-out .vote-box .vote-top .top-img {
width: 100%;
height: 56%;
position: relative;
}
.vote-out .vote-box .vote-top .top-img img {
width: 100%;
height: 100%;
}
.vote-out .vote-box .vote-top .top-img .index-icon {
position: absolute;
top: 0;
left: 0;
width: 72px;
height: 70px;
line-height: 70px;
text-align: center;
background: linear-gradient(136deg, #ffbf61 6%, #fe8819 100%);
border-radius: 40px 0px 40px 0px;
color: #fff;
font-size: 30px;
}
.vote-out .vote-box .vote-top .top-content {
height: 44%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
}
.vote-out .vote-box .vote-top .top-content .cont-name {
font-size: 38px;
color: #353535;
font-family: PingFang SC, PingFang SC-600;
font-weight: 600;
}
.vote-out .vote-box .vote-top .top-btn-select {
width: 140px;
padding: 4px 10px;
text-align: center;
background: linear-gradient(90deg, #ff8058, #ffb865 100%);
border-radius: 40px;
color: #fff;
font-size: 28px;
}
.vote-out .vote-box .vote-top .top-btn-selected {
width: 140px;
padding: 4px 10px;
text-align: center;
background: #e5e6e8;
border-radius: 40px;
color: #999999;
font-size: 28px;
}
.vote-out .cont-icon1 {
width: 140px;
padding: 6px 10px;
color: #e943ff;
font-size: 28px;
background-color: rgba(233, 67, 255, 0.1);
}
.vote-out .cont-icon2 {
width: 140px;
padding: 4px 10px;
color: #e65858;
font-size: 28px;
background-color: rgba(230, 88, 88, 0.1);
}
.vote-out .cont-icon3 {
width: 140px;
padding: 4px 10px;
color: #53af5c;
font-size: 28px;
background-color: rgba(120, 193, 127, 0.1);
}
.vote-out .cont-icon4 {
width: 140px;
padding: 4px 10px;
color: #f5912a;
font-size: 28px;
background-color: rgba(255, 152, 56, 0.1);
}
.vote-out .signup-modal .am-modal-content {
background: linear-gradient(180deg, #ffe2e2 0%, #fff 25%);
}
.vote-out .signup-modal .am-modal-title {
color: #16181a;
font-weight: 600;
}
.vote-out .signup-modal .modal-body {
text-align: left;
margin: 28px 0;
}
.vote-out .signup-modal .am-modal-button {
width: 45% !important;
height: 80px !important;
line-height: 80px !important;
margin: 0 auto;
color: #fff !important;
margin-bottom: 25px;
background: linear-gradient(270deg, #eb6c53, #d23a29);
}
.vote-out .sumbit-btn {
width: 92%;
margin: 0 auto;
text-align: center;
padding: 20px 0;
background: linear-gradient(270deg, #eb6c53 0%, #d23a29);
border-radius: 5px;
color: #fff;
font-size: 36px;
}
.vote-out .detail-box {
width: 90%;
margin: 0 auto;
background-color: #fff;
padding: 60px;
border-radius: 40px;
}
.vote-out .detail-box .detail-name {
font-size: 40px;
color: #353535;
font-family: PingFang SC, PingFang SC-600;
font-weight: 600;
}
.vote-out .detail-box .detail-img {
margin: 30px 0;
}
.vote-out .detail-box .detail-img img {
width: 100%;
}
.vote-out .detail-box .detail-content {
color: #333;
font-size: 30px;
line-height: 60px;
}
.vote-out .charts-box {
width: 90%;
margin: 0 auto;
}
.vote-out .charts-box .charts-top {
display: flex;
}
.vote-out .charts-box .charts-top .charts {
width: 30%;
}
.vote-out .charts-box .charts-top .charts .top-img2 {
width: 180px;
height: 180px;
border-radius: 50%;
}
.vote-out .charts-box .charts-top .charts .top-img2 img {
width: 80%;
height: 80%;
border-radius: 50%;
}
.vote-out .charts-box .charts-top .charts .top-info {
padding: 40px 0;
text-align: center;
background: linear-gradient(0deg, #d64231 0%, #ff7060 100%);
}
.vote-out .charts-box .charts-top .charts .top-info .info-font {
font-size: 40px;
color: #fff;
}
.vote-out {
padding-top: 60px;
padding-bottom: 40px;
width: 100%;
min-height: 100%;
background: linear-gradient(0deg, #ff9286 0%, #d23a29),
linear-gradient(180deg, rgba(255, 255, 255, 0) 59%, #f5f5f5 100%),
linear-gradient(0deg, rgba(210, 58, 41, 0) 0%, #d23a29);
.vote-title {
width: 92%;
margin: 0 auto;
margin-bottom: 40px;
height: 60px;
line-height: 60px;
text-align: center;
font-size: 42px;
color: #fff;
font-family: PingFang SC, PingFang SC-500;
font-weight: 500;
background: linear-gradient(
90deg,
rgba(255, 151, 130, 0),
#ff9782 53%,
rgba(255, 151, 130, 0) 100%
);
}
.vote-box {
width: 92%;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.vote-top {
width: 45%;
height: 480px;
border-radius: 40px;
margin-bottom: 40px;
background-color: #fff;
overflow: hidden;
.top-img {
width: 100%;
height: 56%;
position: relative;
img {
width: 100%;
height: 100%;
}
.index-icon {
position: absolute;
top: 0;
left: 0;
width: 72px;
height: 70px;
line-height: 70px;
text-align: center;
background: linear-gradient(136deg, #ffbf61 6%, #fe8819 100%);
border-radius: 40px 0px 40px 0px;
color: #fff;
font-size: 30px;
}
}
.top-content {
height: 44%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
.cont-name {
font-size: 38px;
color: #353535;
font-family: PingFang SC, PingFang SC-600;
font-weight: 600;
}
}
.top-btn-select {
width: 140px;
padding: 4px 10px;
text-align: center;
background: linear-gradient(90deg, #ff8058, #ffb865 100%);
border-radius: 40px;
color: #fff;
font-size: 28px;
}
.top-btn-selected {
width: 140px;
padding: 4px 10px;
text-align: center;
background: #e5e6e8;
border-radius: 40px;
color: #999999;
font-size: 28px;
}
}
}
.cont-icon1 {
width: 140px;
padding: 6px 10px;
color: #e943ff;
font-size: 28px;
background-color: rgba(233, 67, 255, 0.1);
}
.cont-icon2 {
width: 140px;
padding: 4px 10px;
color: #e65858;
font-size: 28px;
background-color: rgba(230, 88, 88, 0.1);
}
.cont-icon3 {
width: 140px;
padding: 4px 10px;
color: #53af5c;
font-size: 28px;
background-color: rgba(120, 193, 127, 0.1);
}
.cont-icon4 {
width: 140px;
padding: 4px 10px;
color: #f5912a;
font-size: 28px;
background-color: rgba(255, 152, 56, 0.1);
}
.signup-modal {
.am-modal-content {
background: linear-gradient(180deg, #ffe2e2 0%, #fff 25%);
}
.am-modal-title {
color: #16181a;
font-weight: 600;
}
.modal-body {
text-align: left;
margin: 28px 0;
}
.am-modal-button {
width: 45% !important;
height: 80px !important;
line-height: 80px !important;
margin: 0 auto;
color: #fff !important;
margin-bottom: 25px;
background: linear-gradient(270deg, #eb6c53, #d23a29);
}
}
.sumbit-btn {
width: 92%;
margin: 0 auto;
text-align: center;
padding: 20px 0;
background: linear-gradient(270deg, #eb6c53 0%, #d23a29);
border-radius: 5px;
color: #fff;
font-size: 36px;
}
//详情
.detail-box {
width: 90%;
margin: 0 auto;
background-color: #fff;
padding: 60px;
border-radius: 40px;
.detail-name {
font-size: 40px;
color: #353535;
font-family: PingFang SC, PingFang SC-600;
font-weight: 600;
}
.detail-img {
margin: 30px 0;
img {
width: 100%;
}
}
.detail-content {
color: #333;
font-size: 30px;
line-height: 60px;
}
}
//排行榜
.charts-box {
width: 90%;
margin: 0 auto;
.charts-top {
display: flex;
.charts {
width: 30%;
.top-img2 {
width: 180px;
height: 180px;
border-radius: 50%;
// background-image: url(./top2.png);
// background-size: 100%;
// background-repeat: no-repeat;
img {
width: 80%;
height: 80%;
border-radius: 50%;
}
}
.top-info {
padding: 40px 0;
text-align: center;
background: linear-gradient(0deg, #d64231 0%, #ff7060 100%);
.info-font {
font-size: 40px;
color: #fff;
}
}
}
}
}
}
import React, { Component } from "react";
import "./style.less";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import { VoteListApi } from "./action";
import test from './test.png'
import top2 from './top2.png'
class VoteDetail extends Component {
constructor(props) {
super(props);
this.state = {
list: [],
};
}
componentDidMount() {}
render() {
// let { content, keywords, name, img } = this.props.location.query;
let { list } = this.state;
let keywords = '进取之美'
return (
<div className="vote-out">
<div className="charts-box">
<div className="charts-top">
<div className="charts">
<div className="top-img2">
<img src={top2} alt="" />
{/* <img src={test} alt="" /> */}
</div>
<div className="top-info">
<p className="info-font">柳轶倩</p>
<div className="detail-content">
<span
className={
keywords == "精石之美"
? "cont-icon1"
: keywords == "突破之美"
? "cont-icon2"
: keywords == "进取之美"
? "cont-icon3"
: "cont-icon4"
}
>
{keywords}
</span>
</div>
<p className="info-font">142票</p>
</div>
</div>
<div className="charts">
<div className="top-img1"></div>
<div className="top-info"></div>
</div>
<div className="charts">
<div className="top-img3"></div>
<div className="top-info"></div>
</div>
</div>
</div>
</div>
);
}
}
const mapStateToProps = (state) => {
return {};
};
const mapDispatchToProps = (dispatch) => {
return {
VoteListApi: bindActionCreators(VoteListApi, dispatch),
};
};
export default connect(mapStateToProps, mapDispatchToProps)(VoteDetail);
import React, { Component } from "react";
import "./style.less";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
class VoteDetail extends Component {
constructor(props) {
super(props);
this.state = {
list: [],
};
}
componentDidMount() {}
render() {
let { content, keywords, name, img } = this.props.location.query;
return (
<div className="vote-out">
<div className="detail-box">
<div className="detail-name">{name}</div>
<div className="detail-img">
<img src={img} alt="" />
</div>
<div className="detail-content">
<span
className={
keywords == "精石之美"
? "cont-icon1"
: keywords == "突破之美"
? "cont-icon2"
: keywords == "进取之美"
? "cont-icon3"
: "cont-icon4"
}
>
{keywords}
</span>
{content}
</div>
</div>
</div>
);
}
}
const mapStateToProps = (state) => {
return {};
};
const mapDispatchToProps = (dispatch) => {
return {
};
};
export default connect(mapStateToProps, mapDispatchToProps)(VoteDetail);
......@@ -1087,7 +1087,7 @@ p {
right: 0;
left: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.4);
background-color: rgba(0, 0, 0, 0.1);
height: 100%;
z-index: 1000;
}
......@@ -1405,7 +1405,7 @@ p {
bottom: 0;
height: 100%;
z-index: 999;
background-color: rgba(0, 0, 0, 0.4);
background-color: rgba(0, 0, 0, 0.1);
}
#wmy-root-body .am-modal-mask-hidden {
display: none;
......
......@@ -1262,7 +1262,7 @@ p {
right: 0;
left: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.4);
background-color: rgba(0, 0, 0, 0.1);
height: 100%;
z-index: 1000;
}
......@@ -1631,7 +1631,7 @@ p {
bottom: 0;
height: 100%;
z-index: 999;
background-color: rgba(0, 0, 0, 0.4);
background-color: rgba(0, 0, 0, 0.1);
}
......
......@@ -173,6 +173,19 @@ const AllDescribe = LazyLoad(() =>
import('./components/AllDescribe/index')
)
//投票
const Vote = LazyLoad(() =>
import('./components/vote/index')
)
//投票详情
const VoteDetail = LazyLoad(() =>
import('./components/vote/voteDetail')
)
//排行榜
const TheCharts = LazyLoad(() =>
import('./components/vote/theCharts')
)
const MediaPreview = LazyLoad(() =>
import('./common/preview/preview')
)
......@@ -283,13 +296,13 @@ class AppRouter extends React.Component {
<Route path="/*/*/SurveyAnswer" component={SurveyAnswer} />
<Route path="/*/*/InvestigateFinish" component={InvestigateFinish} />
</Route>
{/*我的收藏*/}
<Route path="/*/*/mycollection" component={MyCollection}>
<IndexRoute component={MyCollection} />
</Route>
{/*浏览历史*/}
<Route path="/*/*/browsingHistory" component={BrowsingHistory}>
{/*浏览历史*/}
<Route path="/*/*/browsingHistory" component={BrowsingHistory}>
<IndexRoute component={BrowsingHistory} />
</Route>
{/*新闻中心*/}
......@@ -341,13 +354,18 @@ class AppRouter extends React.Component {
{/* newsMessage*/}
<Route path="/*/*/NewsMessage" component={NewsMessage} />
<Route path={'/*/*/NewsMessageResult'} component={NewsMessageResult} />
{/* 预览资料页面 */}
<Route path="/*/*/dataView" component={DataPreView} />
<Route path="/*/*/mediapreview" component={MediaPreview} />
{/* 详情中转页面 AllDescribe*/}
<Route path="/*/*/allDescribe" component={AllDescribe} />
{/* 投票 Vote*/}
<Route path="/*/*/vote" component={Vote} />
<Route path="/*/*/voteDetail" component={VoteDetail} />
<Route path="/*/*/theCharts" component={TheCharts} />
{/*empty*/}
<Route path="/*/*/empty" component={Empty} />
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -28,9 +28,6 @@ if (
host.indexOf("192.168.1.131") != -1 ||
host.indexOf("192.168.2.23") != -1
) {
//这个基本不用
// baseUrl = 'http://test.wechat.kmelearning.com';
// baseUrl = 'http://dev.wechat.kmelearning.com';
baseUrl = "https://wx.fairyclass.cn";
} else if (urlHeader.indexOf("wechats") != -1) {
//本地域名访问
......@@ -443,5 +440,9 @@ const url = {
practiceTabIndex: `${baseUrl}${CHATPRACTICE}student/practice/list/tab/index/get`, //陪练列表,默认显示哪个tab(未开始,进行中,已结束)
//进入详情页面
allDescribeUrl:`${baseUrl}${WEBSTUDENT}api/research/details`,
//投票列表数据
voteListApi:`${baseUrl}${WEBSTUDENT}api/researchQuestion/list/all`,
voteSumbitApi:`${baseUrl}${WEBSTUDENT}api/researchAnswer/submit`,
};
export default url;
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