Commit 99225ed9 by yanglang123

投票新页面

parent 192bee37
...@@ -30,8 +30,6 @@ class AllDescribe extends Component { ...@@ -30,8 +30,6 @@ class AllDescribe extends Component {
render() { render() {
let { id, type } = this.props.location.query; let { id, type } = this.props.location.query;
const { list } = this.state; const { list } = this.state;
let pageWidth =
document.body.clientWidth > 750 ? 750 : document.body.clientWidth;
return ( return (
<div className="describe-out"> <div className="describe-out">
<div className="describe-top"> <div className="describe-top">
...@@ -65,7 +63,7 @@ class AllDescribe extends Component { ...@@ -65,7 +63,7 @@ class AllDescribe extends Component {
<div <div
className="describe-btn" className="describe-btn"
onClick={() => { onClick={() => {
this.handleTo(id, type); this.handleTo(id, type, list);
}} }}
> >
立即{type} 立即{type}
...@@ -75,13 +73,20 @@ class AllDescribe extends Component { ...@@ -75,13 +73,20 @@ class AllDescribe extends Component {
); );
} }
// 跳转到投票 // 跳转到投票
handleTo = (id, type) => { handleTo = (id, type, list) => {
//pageMode(呈现样式:1逐题呈现 2整页呈现)
if (type == "投票") { if (type == "投票") {
// hashHistory.push({
// pathname: func.routerBefore() + "/SurveyDetails",
// query: { id: id },
// });
if (list.pageMode == 2) {
hashHistory.push({ hashHistory.push({
pathname: func.routerBefore() + "/SurveyDetails", pathname: func.routerBefore() + "/vote",
query: { id: id }, query: { id: id, name: list.name, voteNum: list.voteNum },
}); });
} }
}
}; };
} }
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
......
import React from 'react'; import React from "react";
import { hashHistory } from 'react-router'; import { hashHistory } from "react-router";
import FontAwesome from 'react-fontawesome'; import FontAwesome from "react-fontawesome";
import { TabBar } from 'antd-mobile'; import { TabBar } from "antd-mobile";
import func from '../util/commonFunc'; import func from "../util/commonFunc";
//首页title //首页title
//我的title //我的title
import MenumeNav from './nav/menumeNav.jsx'; import MenumeNav from "./nav/menumeNav.jsx";
import IconfontD from "../common/iconfontd"; import IconfontD from "../common/iconfontd";
import { connect, dispatch } from 'react-redux' import { connect, dispatch } from "react-redux";
import { import {
ticket, ticket,
getTabInfo, getTabInfo,
getReturnSite, getReturnSite,
checkoutSiteStatus, checkoutSiteStatus,
} from '../redux/action/myModel.js' } from "../redux/action/myModel.js";
import { import { getAssToken } from "../redux/action/home/home";
getAssToken
} from '../redux/action/home/home';
import intl from "react-intl-universal"; import intl from "react-intl-universal";
...@@ -26,15 +24,18 @@ class App extends React.Component { ...@@ -26,15 +24,18 @@ class App extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
title: '', title: "",
selectedTab: 'menuhome', selectedTab: "menuhome",
label: 'cog', label: "cog",
lefticon: [], lefticon: [],
isLogin: true, isLogin: true,
righticon: [ righticon: [
<span style={{ fontSize: "140%", fontWeight: "lighter" }} <span
onClick={() => hashHistory.push(func.routerBefore() + '/sendmessage')}> style={{ fontSize: "140%", fontWeight: "lighter" }}
<FontAwesome name="" className='iconfont icon-daohangyou-xiaoxi' /></span>, onClick={() => hashHistory.push(func.routerBefore() + "/sendmessage")}
>
<FontAwesome name="" className="iconfont icon-daohangyou-xiaoxi" />
</span>,
], ],
hidden: false, hidden: false,
touchStartY: 0, touchStartY: 0,
...@@ -45,37 +46,35 @@ class App extends React.Component { ...@@ -45,37 +46,35 @@ class App extends React.Component {
isHomeSite: true, isHomeSite: true,
initSite: "", initSite: "",
canVisit: true, canVisit: true,
}; };
this.iosTouch = this.iosTouch.bind(this); this.iosTouch = this.iosTouch.bind(this);
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
let tab = nextProps.location.pathname.split("/")[3]; let tab = nextProps.location.pathname.split("/")[3];
if (tab === 'menutrain') { if (tab === "menutrain") {
this.setState({ this.setState({
selectedTab: 'menutrain', selectedTab: "menutrain",
}); });
func.changeDocumentTitle(intl.get("TrainingProgram2")); func.changeDocumentTitle(intl.get("TrainingProgram2"));
} else if (tab === 'menucourse') { } else if (tab === "menucourse") {
this.setState({ this.setState({
selectedTab: 'menucourse', selectedTab: "menucourse",
}); });
func.changeDocumentTitle(intl.get("Course")); func.changeDocumentTitle(intl.get("Course"));
} else if (tab === 'menume') { } else if (tab === "menume") {
this.setState({ this.setState({
selectedTab: 'menume', selectedTab: "menume",
}); });
func.changeDocumentTitle(intl.get("Account")); func.changeDocumentTitle(intl.get("Account"));
} else if(tab==="association"){ } else if (tab === "association") {
this.setState({ this.setState({
selectedTab: 'association', selectedTab: "association",
}); });
func.changeDocumentTitle(intl.get("association")); func.changeDocumentTitle(intl.get("association"));
} else { } else {
this.setState({ this.setState({
selectedTab: 'menuhome', selectedTab: "menuhome",
}); });
func.changeDocumentTitle(intl.get("Home")); func.changeDocumentTitle(intl.get("Home"));
} }
...@@ -84,11 +83,10 @@ class App extends React.Component { ...@@ -84,11 +83,10 @@ class App extends React.Component {
window.location.reload(); window.location.reload();
} }
} }
} }
componentWillMount() { componentWillMount() {
console.log('diyici') console.log("diyici");
if (navigator.appVersion.indexOf("iPhone") != -1) { if (navigator.appVersion.indexOf("iPhone") != -1) {
//this.iosTouch(); //this.iosTouch();
} }
...@@ -97,40 +95,39 @@ class App extends React.Component { ...@@ -97,40 +95,39 @@ class App extends React.Component {
switch (tab) { switch (tab) {
case "menutrain": case "menutrain":
this.setState({ this.setState({
selectedTab: 'menutrain', selectedTab: "menutrain",
}); });
func.changeDocumentTitle(intl.get("TrainingProgram2")); func.changeDocumentTitle(intl.get("TrainingProgram2"));
break; break;
case "menucourse": case "menucourse":
this.setState({ this.setState({
selectedTab: 'menucourse', selectedTab: "menucourse",
}); });
func.changeDocumentTitle(intl.get("Course")); func.changeDocumentTitle(intl.get("Course"));
break; break;
case "menume": case "menume":
this.setState({ this.setState({
selectedTab: 'menume', selectedTab: "menume",
}); });
func.changeDocumentTitle(intl.get("Account")); func.changeDocumentTitle(intl.get("Account"));
break; break;
case "association": case "association":
this.setState({ this.setState({
selectedTab: 'association', selectedTab: "association",
}); });
func.changeDocumentTitle(intl.get("association")); func.changeDocumentTitle(intl.get("association"));
break; break;
default: default:
this.setState({ this.setState({
selectedTab: 'menuhome', selectedTab: "menuhome",
}); });
func.changeDocumentTitle(intl.get("Home")); func.changeDocumentTitle(intl.get("Home"));
break; break;
} }
} }
componentDidMount() { componentDidMount() {
console.log('dierci') console.log("dierci");
window.menuShowTab = 0; window.menuShowTab = 0;
//token验证 //token验证
let states = this.props.location.query.input; let states = this.props.location.query.input;
...@@ -138,16 +135,16 @@ class App extends React.Component { ...@@ -138,16 +135,16 @@ class App extends React.Component {
let _this = this; let _this = this;
if (this.state.tabInfo.length == 0) { if (this.state.tabInfo.length == 0) {
this.setState({ this.setState({
showTab: 1 showTab: 1,
}) });
window.menuShowTab = 1; window.menuShowTab = 1;
//tab底部配置,暂时隐藏 //tab底部配置,暂时隐藏
this.props.getTabInfo((backData) => { this.props.getTabInfo((backData) => {
if (backData.code == '1000') { if (backData.code == "1000") {
_this.setState({ _this.setState({
tabInfo: backData.data.bottomMenuVOS, tabInfo: backData.data.bottomMenuVOS,
showTab: backData.data.display showTab: backData.data.display,
}) });
// // 我的报告浮窗 // // 我的报告浮窗
// if(backData.data.terminalId){ // if(backData.data.terminalId){
// this.props.getReportHome({terminalId:backData.data.terminalId},(res)=>{ // this.props.getReportHome({terminalId:backData.data.terminalId},(res)=>{
...@@ -155,16 +152,13 @@ class App extends React.Component { ...@@ -155,16 +152,13 @@ class App extends React.Component {
// } // }
} }
window.menuShowTab = backData.data.display; window.menuShowTab = backData.data.display;
}) });
} }
// console.log(store); // console.log(store);
if (!this.props.signResult) { if (!this.props.signResult) {
let _this = this; let _this = this;
this.props.getTicket(location.href, () => { this.props.getTicket(location.href, () => {});
});
} }
//如果点击过子站点,才去判断当前是不是主站点,为了13685 bug by zj //如果点击过子站点,才去判断当前是不是主站点,为了13685 bug by zj
...@@ -175,8 +169,8 @@ class App extends React.Component { ...@@ -175,8 +169,8 @@ class App extends React.Component {
if (currentSite != res.data) { if (currentSite != res.data) {
this.setState({ this.setState({
isHomeSite: false, isHomeSite: false,
initSite: window.location.origin + "/#/" + res.data + "/" initSite: window.location.origin + "/#/" + res.data + "/",
}) });
} }
}); });
} }
...@@ -185,29 +179,26 @@ class App extends React.Component { ...@@ -185,29 +179,26 @@ class App extends React.Component {
this.props.checkoutSiteStatus({ type: 3 }, (res) => { this.props.checkoutSiteStatus({ type: 3 }, (res) => {
if (res.code == "1000") { if (res.code == "1000") {
if (res.data == 1) { if (res.data == 1) {
this.setState( this.setState({
{ canVisit: true,
canVisit: true });
}
)
} else if (res.data == 0) { } else if (res.data == 0) {
this.setState({ this.setState({
canVisit: false canVisit: false,
}) });
} }
} }
}) });
} }
iosTouch() { iosTouch() {
let _this = this; let _this = this;
this.setState({ this.setState({
hidden: true hidden: true,
}); });
document.body.ontouchstart = (e) => { document.body.ontouchstart = (e) => {
_this.setState({ _this.setState({
touchStartY: e.targetTouches[0].pageY touchStartY: e.targetTouches[0].pageY,
}); });
}; };
document.body.ontouchmove = (e) => { document.body.ontouchmove = (e) => {
...@@ -216,186 +207,211 @@ class App extends React.Component { ...@@ -216,186 +207,211 @@ class App extends React.Component {
//下滑 //下滑
if (!_this.state.hidden) { if (!_this.state.hidden) {
_this.setState({ _this.setState({
hidden: true hidden: true,
}) });
} }
} else { } else {
//上滑 //上滑
if (_this.state.hidden) { if (_this.state.hidden) {
_this.setState({ _this.setState({
hidden: false hidden: false,
}) });
} }
} }
}; };
} }
getTab = () => { getTab = () => {
let { tabInfo } = this.state; let { tabInfo } = this.state;
let tabHome = (<TabBar.Item let tabHome = (
<TabBar.Item
title={<span>{intl.get("Home")}</span>} title={<span>{intl.get("Home")}</span>}
key="home" key="home"
icon={ icon={
<IconfontD code={"iconhometabbar-home-unselect"} style={{ fontSize: 48 }} /> <IconfontD
code={"iconhometabbar-home-unselect"}
style={{ fontSize: 48 }}
/>
} }
selectedIcon={ selectedIcon={
<IconfontD code={"iconhometabbar-home-selected"} style={{ fontSize: 48 }} /> <IconfontD
code={"iconhometabbar-home-selected"}
style={{ fontSize: 48 }}
/>
} }
selected={this.state.selectedTab === 'menuhome'} selected={this.state.selectedTab === "menuhome"}
onPress={() => { onPress={() => {
this.setState({ this.setState({
selectedTab: 'menuhome', selectedTab: "menuhome",
}); });
hashHistory.push(func.routerBefore() + '/') hashHistory.push(func.routerBefore() + "/");
}} }}
data-seed="logId" data-seed="logId"
> ></TabBar.Item>
</TabBar.Item>); );
let tabTrain = (<TabBar.Item let tabTrain = (
<TabBar.Item
icon={ icon={
<IconfontD code={"iconhometabbar-training-unselect"} style={{ fontSize: 48 }} /> <IconfontD
code={"iconhometabbar-training-unselect"}
style={{ fontSize: 48 }}
/>
} }
selectedIcon={ selectedIcon={
<IconfontD code={"iconhometabbar-training-selected"} style={{ fontSize: 48 }} /> <IconfontD
code={"iconhometabbar-training-selected"}
style={{ fontSize: 48 }}
/>
} }
title={<span>{intl.get("TrainingProgram2")}</span>} title={<span>{intl.get("TrainingProgram2")}</span>}
key="train" key="train"
selected={this.state.selectedTab === 'menutrain'} selected={this.state.selectedTab === "menutrain"}
onPress={() => { onPress={() => {
this.setState({ this.setState({
selectedTab: 'menutrain', selectedTab: "menutrain",
}); });
console.log(func.routerBefore() + '/menutrain'); console.log(func.routerBefore() + "/menutrain");
hashHistory.push(func.routerBefore() + '/menutrain') hashHistory.push(func.routerBefore() + "/menutrain");
}} }}
data-seed="logId1"> data-seed="logId1"
</TabBar.Item> ></TabBar.Item>
) );
let tabCourse = (<TabBar.Item let tabCourse = (
style={{ visibility: 'hidden' }} <TabBar.Item
style={{ visibility: "hidden" }}
icon={ icon={
<IconfontD code={"iconhometabbar-course-unselect"} style={{fontSize:48}}/> <IconfontD
code={"iconhometabbar-course-unselect"}
style={{ fontSize: 48 }}
/>
} }
selectedIcon={ selectedIcon={
<IconfontD code={"iconhometabbar-course-selected"} style={{fontSize:48}}/> <IconfontD
code={"iconhometabbar-course-selected"}
style={{ fontSize: 48 }}
/>
} }
title={<span>{intl.get("Course")}</span>} title={<span>{intl.get("Course")}</span>}
key="course" key="course"
selected={this.state.selectedTab === 'menucourse'} selected={this.state.selectedTab === "menucourse"}
onPress={() => { onPress={() => {
this.setState({ this.setState({
selectedTab: 'menucourse', selectedTab: "menucourse",
}); });
hashHistory.push(func.routerBefore() + '/menucourse') hashHistory.push(func.routerBefore() + "/menucourse");
}} }}
> ></TabBar.Item>
</TabBar.Item>
); );
let menuHome = (<TabBar.Item let menuHome = (
<TabBar.Item
icon={ icon={
<IconfontD code={"iconhometabbar-mine-unselect"} style={{fontSize:48}}/> <IconfontD
code={"iconhometabbar-mine-unselect"}
style={{ fontSize: 48 }}
/>
} }
selectedIcon={ selectedIcon={
<IconfontD code={"iconhometabbar-mine-selected"} style={{fontSize:48}}/> <IconfontD
code={"iconhometabbar-mine-selected"}
style={{ fontSize: 48 }}
/>
} }
title={<span>{intl.get("QuicklinkMyStudy")}</span>} title={<span>{intl.get("QuicklinkMyStudy")}</span>}
key="me" key="me"
selected={this.state.selectedTab === 'menume'} selected={this.state.selectedTab === "menume"}
onPress={() => { onPress={() => {
this.setState({ this.setState({
selectedTab: 'menume', selectedTab: "menume",
}); });
hashHistory.push(func.routerBefore() + '/menume') hashHistory.push(func.routerBefore() + "/menume");
}} }}
> ></TabBar.Item>
</TabBar.Item> );
)
let association =( // let association =(
<TabBar.Item // <TabBar.Item
icon={ // icon={
<IconfontD code={"iconhometabbar-community-unselect"} style={{fontSize:48}}/> // <IconfontD code={"iconhometabbar-community-unselect"} style={{fontSize:48}}/>
} // }
selectedIcon={ // selectedIcon={
<IconfontD code={"iconhometabbar-community-unselect"} style={{fontSize:48}}/> // <IconfontD code={"iconhometabbar-community-unselect"} style={{fontSize:48}}/>
} // }
title={<span>{intl.get("association")}</span>} // title={<span>{intl.get("association")}</span>}
key="assocition" // key="assocition"
selected={this.state.selectedTab === 'assocition'} // selected={this.state.selectedTab === 'assocition'}
onPress={() => { // onPress={() => {
this.setState({ // this.setState({
selectedTab: 'assocition', // selectedTab: 'assocition',
}); // });
// hashHistory.push(func.routerBefore() + '/menume') // // hashHistory.push(func.routerBefore() + '/menume')
this.props.getAssToken(); // this.props.getAssToken();
}} // }}
> // >
</TabBar.Item> // </TabBar.Item>
) // )
tab = JSON.stringify(tabHome); tab = JSON.stringify(tabHome);
for (let index = 1; index < tabInfo.length; index++) { for (let index = 1; index < tabInfo.length; index++) {
switch (tabInfo[index].id) { switch (tabInfo[index].id) {
case '2': case "2":
tabResult = tabResult + JSON.stringify(tabTrain); tabResult = tabResult + JSON.stringify(tabTrain);
break; break;
case '3': case "3":
tabResult = tabResult + JSON.stringify(tabCourse); tabResult = tabResult + JSON.stringify(tabCourse);
break; break;
case '4': case "4":
tabResult = tabResult + JSON.stringify(tabMarket); tabResult = tabResult + JSON.stringify(tabMarket);
break; break;
case '5': case "5":
tabResult = tabResult + JSON.stringify(menuHome); tabResult = tabResult + JSON.stringify(menuHome);
break; break;
case '6': case "6":
tabResult = tabResult + JSON.stringify(association); tabResult = tabResult + JSON.stringify(association);
default: default:
break; break;
} }
} }
if (typeof (tabResult) == 'string') { if (typeof tabResult == "string") {
return JSON.parse(tabResult); return JSON.parse(tabResult);
} else { } else {
return tabResult; return tabResult;
} }
};
}
//bug 13650 zj //bug 13650 zj
goHomeSite = () => { goHomeSite = () => {
this.setState({ this.setState(
{
isHomeSite: true, isHomeSite: true,
}, () => { },
() => {
window.location.href = this.state.initSite; window.location.href = this.state.initSite;
})
} }
);
};
render() { render() {
if (this.props.signResult) { if (this.props.signResult) {
if (!this.state.wxconfig) { if (!this.state.wxconfig) {
wx.config({ wx.config({
// debug: true, // debug: true,
...this.props.signResult, ...this.props.signResult,
jsApiList: ["hideMenuItems", "showMenuItems", 'scanQRCode'], jsApiList: ["hideMenuItems", "showMenuItems", "scanQRCode"],
}); });
console.log('===========statr======'); console.log("===========statr======");
console.log(this.props.signResult, '===========cwj======'); console.log(this.props.signResult, "===========cwj======");
console.log('==========end======'); console.log("==========end======");
this.state.wxconfig = true; this.state.wxconfig = true;
} }
wx.ready(() => { wx.ready(() => {
wx.hideMenuItems({ wx.hideMenuItems({
menuList: ["menuItem:share:appMessage", "menuItem:share:timeline", "menuItem:share:qq", "menuItem:share:weiboApp"] // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3 menuList: [
"menuItem:share:appMessage",
"menuItem:share:timeline",
"menuItem:share:qq",
"menuItem:share:weiboApp",
], // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3
}); });
}); });
} }
...@@ -412,212 +428,193 @@ class App extends React.Component { ...@@ -412,212 +428,193 @@ class App extends React.Component {
// }); // });
// } // }
var resultTab = new Array(); var resultTab = new Array();
this.state.tabInfo.map((item, index) => { this.state.tabInfo.map((item, index) => {
if (item.checked) { if (item.checked) {
resultTab.push(item); resultTab.push(item);
} }
}) });
return ( return (
this.state.canVisit ?
this.state.isLogin ? (
<div className="container" style={{ width: "100%", height: "100%" }}> <div className="container" style={{ width: "100%", height: "100%" }}>
{/* 头部 */} {/* 头部 */}
{this.state.selectedTab === 'menuhome' ? {this.state.selectedTab === "menuhome" ? null : this.state
null : .selectedTab === "menume" ? (
this.state.selectedTab === 'menume' ? <MenumeNav></MenumeNav> <MenumeNav></MenumeNav>
) : null}
: null}
<div
style={{
<div style={{ position: 'relative', overflowX: "hidden", width: "100%", height: "100%" }}> position: "relative",
{this.props && this.props.children && React.cloneElement(this.props.children, { overflowX: "hidden",
changeTitle: title => this.setState({ title }), width: "100%",
changeRightIcon: righticon => this.setState({ righticon }) height: "100%",
, }}
changeLeftIcon: lefticon => this.setState({ lefticon }) >
{this.props &&
this.props.children &&
React.cloneElement(this.props.children, {
changeTitle: (title) => this.setState({ title }),
changeRightIcon: (righticon) => this.setState({ righticon }),
changeLeftIcon: (lefticon) => this.setState({ lefticon }),
})} })}
</div> </div>
{/*返回主站点按钮*/} {/*返回主站点按钮*/}
{!this.state.isHomeSite ? {!this.state.isHomeSite ? (
<a onClick={this.goHomeSite} style={{ <a
boxShadow: '0px 1px 4px 0px rgba(0, 0, 0, 0.25)', borderRadius: '0px 100px 100px 0px', paddingLeft: '10px', paddingRight: '20px', height: 48, position: "fixed", left: 0, bottom: 148, zIndex: 999, onClick={this.goHomeSite}
background: '#4285F4' style={{
}}> boxShadow: "0px 1px 4px 0px rgba(0, 0, 0, 0.25)",
<div > borderRadius: "0px 100px 100px 0px",
<div style={{ color: '#ffffff', width: 'auto', fontSize: 24, height: 32, marginLeft: 8, marginTop: 4 }}>{"< 返回站点"}</div> paddingLeft: "10px",
paddingRight: "20px",
height: 48,
position: "fixed",
left: 0,
bottom: 148,
zIndex: 999,
background: "#4285F4",
}}
>
<div>
<div
style={{
color: "#ffffff",
width: "auto",
fontSize: 24,
height: 32,
marginLeft: 8,
marginTop: 4,
}}
>
{"< 返回站点"}
</div> </div>
</a> : "" </div>
} </a>
) : (
""
)}
{/* 底部五个tab页 */} {/* 底部五个tab页 */}
{ {showTab == 0 ? null : (
showTab == 0 ? <div className={"index-tab-bar-container"}>
null {" "}
: <div className={"index-tab-bar-container"}> <TabBar <TabBar
unselectedTintColor="#949494" unselectedTintColor="#949494"
tintColor="#D23A29" tintColor="#D23A29"
barTintColor="white" barTintColor="white"
hidden={this.state.hidden} hidden={this.state.hidden}
> >
{ {resultTab.map((data, index) => {
resultTab.map((data, index) => { if (data.id == "1" && data.checked) {
if (data.id == '1' && data.checked) {
return ( return (
<TabBar.Item <TabBar.Item
title={<span>{intl.get("Home") || "首页"}</span>} title={<span>{intl.get("Home") || "首页"}</span>}
key="home" key="home"
icon={ icon={
<IconfontD code={"iconhometabbar-home-unselect"} style={{ fontSize: 48 }} /> <IconfontD
code={"iconhometabbar-home-unselect"}
style={{ fontSize: 48 }}
/>
} }
selectedIcon={ selectedIcon={
<IconfontD code={"iconhometabbar-home-selected"} style={{ fontSize:48,color:'#E05540'}} /> <IconfontD
code={"iconhometabbar-home-selected"}
style={{ fontSize: 48, color: "#E05540" }}
/>
} }
selected={this.state.selectedTab === 'menuhome'} selected={this.state.selectedTab === "menuhome"}
onPress={() => { onPress={() => {
this.setState({ this.setState({
selectedTab: 'menuhome', selectedTab: "menuhome",
}); });
//暂时修改
hashHistory.push(func.routerBefore() + '/') hashHistory.push(func.routerBefore() + '/')
}} }}
data-seed="logId" data-seed="logId"
> ></TabBar.Item>
</TabBar.Item> );
)
} }
if (data.id == '2' && data.checked) { if (data.id == "2" && data.checked) {
return ( return (
<TabBar.Item <TabBar.Item
hidden={!tabInfo[1].checked} hidden={!tabInfo[1].checked}
icon={ icon={
<IconfontD code={"iconhometabbar-training-unselect"} style={{ fontSize: 48 }} /> <IconfontD
code={"iconhometabbar-training-unselect"}
style={{ fontSize: 48 }}
/>
} }
selectedIcon={ selectedIcon={
<IconfontD code={"iconhometabbar-training-selected"} style={{fontSize:48,color:'#E05540'}} /> <IconfontD
code={"iconhometabbar-training-selected"}
style={{ fontSize: 48, color: "#E05540" }}
/>
}
title={
<span>{intl.get("TrainingProgram2") || "活动"}</span>
} }
title={<span>{intl.get("TrainingProgram2") || "活动"}</span>}
key="train" key="train"
selected={this.state.selectedTab === 'menutrain'} selected={this.state.selectedTab === "menutrain"}
onPress={() => { onPress={() => {
this.setState({ this.setState({
selectedTab: 'menutrain', selectedTab: "menutrain",
}); });
console.log(func.routerBefore() + '/menutrain'); console.log(func.routerBefore() + "/menutrain");
hashHistory.push(func.routerBefore() + '/menutrain') hashHistory.push(func.routerBefore() + "/menutrain");
}} }}
data-seed="logId1" data-seed="logId1"
> ></TabBar.Item>
</TabBar.Item> );
)
} }
if (data.id == '5' && data.checked) { if (data.id == "5" && data.checked) {
return ( return (
<TabBar.Item <TabBar.Item
hidden={tabInfo[4] && tabInfo[4].checked} hidden={tabInfo[4] && tabInfo[4].checked}
icon={ icon={
<IconfontD code={"iconhometabbar-mine-unselect"} style={{fontSize:48}}/> <IconfontD
code={"iconhometabbar-mine-unselect"}
style={{ fontSize: 48 }}
/>
} }
selectedIcon={ selectedIcon={
<IconfontD code={"iconhometabbar-mine-selected"} style={{fontSize:48,color:'#E05540'}}/> <IconfontD
code={"iconhometabbar-mine-selected"}
style={{ fontSize: 48, color: "#E05540" }}
/>
}
title={
<span>{intl.get("QuicklinkMyStudy") || "我的"}</span>
} }
title={<span>{intl.get("QuicklinkMyStudy") || "我的"}</span>}
key="me" key="me"
selected={this.state.selectedTab === 'menume'} selected={this.state.selectedTab === "menume"}
onPress={() => { onPress={() => {
this.setState({ this.setState({
selectedTab: 'menume', selectedTab: "menume",
}); });
//暂时修改
hashHistory.push(func.routerBefore() + '/menume') hashHistory.push(func.routerBefore() + '/menume')
}}
>
</TabBar.Item>
)
}
if (data.id == '6' && data.checked) {
return (
<TabBar.Item
hidden={tabInfo[5] && tabInfo[5].checked}
icon={
<IconfontD code={"iconhometabbar-community-unselect"} style={{fontSize:48}}/>
}
selectedIcon={
<IconfontD code={"iconhometabbar-community-unselect"} style={{fontSize:48}}/>
}
title={<span>{intl.get("association") || "社群"}</span>}
key="association"
selected={this.state.selectedTab === 'association'}
onPress={() => {
this.setState({
selectedTab: 'association',
});
// hashHistory.push(func.routerBefore() + '/association')
this.props.getAssToken();
}} }}
> ></TabBar.Item>
</TabBar.Item> );
)
}
})
} }
})}
</TabBar> </TabBar>
</div> </div>
} )}
</div>) : (<div></div>)
: <div style={{ background: '#fff', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<div style={{ background: "#fff", width: 426, height: 310 }}>
<img className="emptyIcon" style={{
background: "#fff",
width: "426px",
height: "288px",
}}
src={"https://cloud-wmy.oss-cn-shanghai.aliyuncs.com/wmy/no-shift.png"} />
<div style={{
background: "#fff",
width: "426px",
marginTop: '26px',
fontSize: '24px',
color: '#999999',
textAlign: 'center'
}}>站点暂未发布</div>
</div>
<a onClick={this.goHomeSite} style={{
boxShadow: '0px 1px 4px 0px rgba(0, 0, 0, 0.25)', borderRadius: '0px 100px 100px 0px', paddingLeft: '10px', paddingRight: '20px', height: 48, position: "fixed", left: 0, bottom: 148, zIndex: 999,
background: '#4285F4'
}}>
<div >
<div style={{ color: '#ffffff', width: 'auto', fontSize: 24, height: 32, marginLeft: 8, marginTop: 4 }}>{"< 返回站点"}</div>
</div>
</a>
</div> </div>
); );
} }
} }
function mapStateToProps(state, ownProps) { function mapStateToProps(state, ownProps) {
const { myModel, home } = state; const { myModel, home } = state;
return { return {
showInfo: home.homeShowInfo, showInfo: home.homeShowInfo,
signResult: myModel.signResult, signResult: myModel.signResult,
} };
} }
function mapDispatchToProps(dispatch) { function mapDispatchToProps(dispatch) {
...@@ -625,9 +622,10 @@ function mapDispatchToProps(dispatch) { ...@@ -625,9 +622,10 @@ function mapDispatchToProps(dispatch) {
getTicket: (url, callBack) => dispatch(ticket(url, callBack)), getTicket: (url, callBack) => dispatch(ticket(url, callBack)),
getTabInfo: (callBack) => dispatch(getTabInfo(callBack)), getTabInfo: (callBack) => dispatch(getTabInfo(callBack)),
getReturnSite: (callBack) => dispatch(getReturnSite(callBack)), getReturnSite: (callBack) => dispatch(getReturnSite(callBack)),
checkoutSiteStatus: (data, callBack) => dispatch(checkoutSiteStatus(data, callBack)), checkoutSiteStatus: (data, callBack) =>
dispatch(checkoutSiteStatus(data, callBack)),
getAssToken: (data, callback) => dispatch(getAssToken(data, callback)), getAssToken: (data, callback) => dispatch(getAssToken(data, callback)),
} };
} }
export default connect(mapStateToProps, mapDispatchToProps)(App); export default connect(mapStateToProps, mapDispatchToProps)(App);
...@@ -502,7 +502,18 @@ class TrainingSteps extends Component { ...@@ -502,7 +502,18 @@ class TrainingSteps extends Component {
> >
活动介绍 活动介绍
</p> </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 ? ( {introductionVo.videoUrl ? (
<div <div
style={{ style={{
...@@ -526,14 +537,13 @@ class TrainingSteps extends Component { ...@@ -526,14 +537,13 @@ class TrainingSteps extends Component {
<div <div
style={{ style={{
width: "100%", width: "100%",
height: "280px",
paddingLeft: "40px", paddingLeft: "40px",
paddingRight: "15px", paddingRight: "15px",
marginBottom: "10px", marginBottom: "10px",
}} }}
> >
<img <img
style={{ width: "100%", height: "280px" }} style={{ width: "100%" }}
src={item.img} src={item.img}
alt="" alt=""
/> />
...@@ -541,19 +551,6 @@ class TrainingSteps extends Component { ...@@ -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> </div>
{introductionVo.researchName ? ( {introductionVo.researchName ? (
<div <div
...@@ -730,7 +727,7 @@ class TrainingSteps extends Component { ...@@ -730,7 +727,7 @@ class TrainingSteps extends Component {
dataSource={this.state.dataSource} dataSource={this.state.dataSource}
renderRow={row.bind(this)} renderRow={row.bind(this)}
onEndReached={this.onLoadMore} onEndReached={this.onLoadMore}
listStyle={50} // listStyle={50}
isLoading={this.state.isLoading} isLoading={this.state.isLoading}
page={{ page={{
pageTotal: reviewListTotle, pageTotal: reviewListTotle,
......
...@@ -236,7 +236,6 @@ class ShowAnswer extends Component { ...@@ -236,7 +236,6 @@ class ShowAnswer extends Component {
let { isAnswer, isAnalysis } = this.state; let { isAnswer, isAnalysis } = this.state;
return ( return (
<div className="question-block" key={rowId}> <div className="question-block" key={rowId}>
<div style={{ backgroundColor: "#fff" }}>
<div className="question-topic" style={{ marginBottom: "-60px" }}> <div className="question-topic" style={{ marginBottom: "-60px" }}>
<h4> <h4>
{`${Number.parseInt(rowId) + 1}`}. {`${Number.parseInt(rowId) + 1}`}.
...@@ -343,7 +342,7 @@ class ShowAnswer extends Component { ...@@ -343,7 +342,7 @@ class ShowAnswer extends Component {
</div> </div>
) : null} ) : null}
<div className="sep-bottom"></div> <div className="sep-bottom"></div>
</div>
</div> </div>
); );
} }
......
...@@ -31,7 +31,6 @@ import intl from "react-intl-universal"; ...@@ -31,7 +31,6 @@ import intl from "react-intl-universal";
componentWillReceiveProps = (nextProps) => { componentWillReceiveProps = (nextProps) => {
if (nextProps.data !== this.props.data) { if (nextProps.data !== this.props.data) {
console.log(12312312,nextProps.data.options)
this.setState({ this.setState({
data:nextProps.data.options, data:nextProps.data.options,
}) })
......
...@@ -82,7 +82,6 @@ class details extends Component { ...@@ -82,7 +82,6 @@ class details extends Component {
} }
//单选题其他txt回现1 //单选题其他txt回现1
if (data.question && data.question.type == 1) { if (data.question && data.question.type == 1) {
console.log('danxuan', data.question.options)
data.question.options.map((v, i) => { data.question.options.map((v, i) => {
if (v.check == 1 && v.isOther == 1) { if (v.check == 1 && v.isOther == 1) {
this.state.oneid = v.id this.state.oneid = v.id
...@@ -172,17 +171,13 @@ class details extends Component { ...@@ -172,17 +171,13 @@ class details extends Component {
/* bug11641 回车符显示换行 zhouzhongyang 20200617 end*/ /* bug11641 回车符显示换行 zhouzhongyang 20200617 end*/
questionItem = (item, sectionId, rowId) => { questionItem = (item, sectionId, rowId) => {
return ( return (
<div className="question-block"> <div className="question-block">
{/*是否展开调研说明*/} {/*是否展开调研说明*/}
{item.isFrist == 1 && item.remark !== '' ? {item.isFrist == 1 && item.remark !== '' ?
<div style={{ fontSize: '.28rem', padding: ' 0.1rem 0.3rem', borderBottom: '5px solid rgba(248,248,248,1)' }} > <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> <h4 style={{ float: 'left', padding: '15px 0', fontSize: '32px' }}>投票</h4>
</div> </div>
<div style={{ clear: 'both' }}></div> <div style={{ clear: 'both' }}></div>
......
...@@ -46,96 +46,6 @@ class mehomeNav extends React.Component { ...@@ -46,96 +46,6 @@ class mehomeNav extends React.Component {
this.props.search(value); 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() { render() {
return ( return (
<Fragment> <Fragment>
......
...@@ -20,11 +20,7 @@ ...@@ -20,11 +20,7 @@
} }
.news-list-page-container .news-list-page-scroll-container .news-classify-list-container { .news-list-page-container .news-list-page-scroll-container .news-classify-list-container {
width: 100%; width: 100%;
height: 176px; height: 90px;
position: sticky;
background-color: #fff;
left: 0;
top: 0;
z-index: 9; z-index: 9;
overflow-y: hidden; overflow-y: hidden;
overflow-x: auto; overflow-x: auto;
...@@ -44,6 +40,7 @@ ...@@ -44,6 +40,7 @@
position: relative; position: relative;
z-index: 2; z-index: 2;
padding: 0 10px; 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 { .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; max-width: 324px;
......
...@@ -17,11 +17,7 @@ ...@@ -17,11 +17,7 @@
.news-classify-list-container { .news-classify-list-container {
width: 100%; width: 100%;
height: 176px; height: 90px;
position: sticky;
background-color: #fff;
left: 0;
top: 0;
z-index: 9; z-index: 9;
overflow-y: hidden; overflow-y: hidden;
overflow-x: auto; overflow-x: auto;
...@@ -41,6 +37,7 @@ ...@@ -41,6 +37,7 @@
position: relative; position: relative;
z-index: 2; z-index: 2;
padding: 0 10px; padding: 0 10px;
overflow-x: auto;
.news-classify-item-container{ .news-classify-item-container{
max-width: 324px; max-width: 324px;
height: 88px; height: 88px;
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
.NewMessageCss-pis .ant-tabs-extra-content .extra-wrapper .mask { .NewMessageCss-pis .ant-tabs-extra-content .extra-wrapper .mask {
height: 1500px; height: 1500px;
opacity: 0.5; opacity: 0.5;
background: rgba(0, 0, 0, 0.4); background: rgba(0, 0, 0, 0.1);
position: absolute; position: absolute;
width: 100%; width: 100%;
} }
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
.mask{ .mask{
height: 1500px; height: 1500px;
opacity: 0.5; opacity: 0.5;
background: rgba(0, 0, 0, 0.4); background: rgba(0, 0, 0, 0.1);
position: absolute; position: absolute;
width: 100%; width: 100%;
} }
......
.singleLineOverflow {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.no-content-auth-container { .no-content-auth-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -29,7 +35,7 @@ ...@@ -29,7 +35,7 @@
.no-content-auth-container .no-auth-confirm .no-auth-confirm-bg { .no-content-auth-container .no-auth-confirm .no-auth-confirm-bg {
width: 100%; width: 100%;
height: 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 { .no-content-auth-container .no-auth-confirm .no-auth-confirm-modal {
width: 540px; width: 540px;
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
.no-auth-confirm-bg { .no-auth-confirm-bg {
width: 100%; width: 100%;
height: 100%; height: 100%;
background: rgba(0, 0, 0, 0.4); background: rgba(0, 0, 0, 0.1);
} }
.no-auth-confirm-modal { .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 { ...@@ -1087,7 +1087,7 @@ p {
right: 0; right: 0;
left: 0; left: 0;
bottom: 0; bottom: 0;
background-color: rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.1);
height: 100%; height: 100%;
z-index: 1000; z-index: 1000;
} }
...@@ -1405,7 +1405,7 @@ p { ...@@ -1405,7 +1405,7 @@ p {
bottom: 0; bottom: 0;
height: 100%; height: 100%;
z-index: 999; 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 { #wmy-root-body .am-modal-mask-hidden {
display: none; display: none;
......
...@@ -1262,7 +1262,7 @@ p { ...@@ -1262,7 +1262,7 @@ p {
right: 0; right: 0;
left: 0; left: 0;
bottom: 0; bottom: 0;
background-color: rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.1);
height: 100%; height: 100%;
z-index: 1000; z-index: 1000;
} }
...@@ -1631,7 +1631,7 @@ p { ...@@ -1631,7 +1631,7 @@ p {
bottom: 0; bottom: 0;
height: 100%; height: 100%;
z-index: 999; 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(() => ...@@ -173,6 +173,19 @@ const AllDescribe = LazyLoad(() =>
import('./components/AllDescribe/index') 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(() => const MediaPreview = LazyLoad(() =>
import('./common/preview/preview') import('./common/preview/preview')
) )
...@@ -348,6 +361,11 @@ class AppRouter extends React.Component { ...@@ -348,6 +361,11 @@ class AppRouter extends React.Component {
{/* 详情中转页面 AllDescribe*/} {/* 详情中转页面 AllDescribe*/}
<Route path="/*/*/allDescribe" component={AllDescribe} /> <Route path="/*/*/allDescribe" component={AllDescribe} />
{/* 投票 Vote*/}
<Route path="/*/*/vote" component={Vote} />
<Route path="/*/*/voteDetail" component={VoteDetail} />
<Route path="/*/*/theCharts" component={TheCharts} />
{/*empty*/} {/*empty*/}
<Route path="/*/*/empty" component={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 ( ...@@ -28,9 +28,6 @@ if (
host.indexOf("192.168.1.131") != -1 || host.indexOf("192.168.1.131") != -1 ||
host.indexOf("192.168.2.23") != -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"; baseUrl = "https://wx.fairyclass.cn";
} else if (urlHeader.indexOf("wechats") != -1) { } else if (urlHeader.indexOf("wechats") != -1) {
//本地域名访问 //本地域名访问
...@@ -443,5 +440,9 @@ const url = { ...@@ -443,5 +440,9 @@ const url = {
practiceTabIndex: `${baseUrl}${CHATPRACTICE}student/practice/list/tab/index/get`, //陪练列表,默认显示哪个tab(未开始,进行中,已结束) practiceTabIndex: `${baseUrl}${CHATPRACTICE}student/practice/list/tab/index/get`, //陪练列表,默认显示哪个tab(未开始,进行中,已结束)
//进入详情页面 //进入详情页面
allDescribeUrl:`${baseUrl}${WEBSTUDENT}api/research/details`, allDescribeUrl:`${baseUrl}${WEBSTUDENT}api/research/details`,
//投票列表数据
voteListApi:`${baseUrl}${WEBSTUDENT}api/researchQuestion/list/all`,
voteSumbitApi:`${baseUrl}${WEBSTUDENT}api/researchAnswer/submit`,
}; };
export default url; 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