Commit 76d916e3 authored by haiyoucuv's avatar haiyoucuv

init

parent 1a83e769
...@@ -20,7 +20,6 @@ import Sharepage from "./pages/sharepage/sharepage"; ...@@ -20,7 +20,6 @@ import Sharepage from "./pages/sharepage/sharepage";
import AgentSharepage from "./pages/agentSharepage/sharepage"; import AgentSharepage from "./pages/agentSharepage/sharepage";
import Prizepage from "./pages/prizepage/prizepage"; import Prizepage from "./pages/prizepage/prizepage";
import Userhomepage from "./pages/userhomepage/userhomepage"; import Userhomepage from "./pages/userhomepage/userhomepage";
import Opuspage from "./pages/opuspage/opuspage";
import shareStore from "./store/share"; import shareStore from "./store/share";
import { isWeChat, onInitShare, onUpdateShare } from "./utils/share"; import { isWeChat, onInitShare, onUpdateShare } from "./utils/share";
import { isMiniprogram } from "./utils/utils"; import { isMiniprogram } from "./utils/utils";
......
This diff is collapsed.
import React from "react";
import {observer} from "mobx-react";
import "./ConfirmPop.less";
import {Button} from "@src/components/Button";
import modalStore from "@src/store/modal";
import {Toast} from "@spark/ui";
import API from "@src/api";
import store from "@src/store";
import {PAGE_MAP} from "@src/utils/constants";
import {_asyncThrottle} from "@src/utils/utils";
@observer
class ConfirmPop extends React.Component {
clickCancel = () => {
modalStore.closePop("ConfirmPop");
};
clickConfirm = _asyncThrottle( async () => {
const {title, photoImg, content, confirm} = this.props.popData;
const {success} = await API.saveOrUpdateWork({
worksImg: photoImg,
worksTitle: title,
worksDesc: content,
lockAgree: confirm,
});
if (!success) return;
modalStore.closePopAll();
store.changePage(PAGE_MAP.HOME_PAGE);
Toast("上传成功,请耐心等待审核~");
});
render() {
const {title, photoImg} = this.props.popData;
console.log(title, photoImg);
return <div className="ConfirmPop modal_center">
<div className="light"/>
<div className="bg">
<div className="title">
活动期间仅可上传1张照片哦
</div>
<img className="picture" src={photoImg}/>
<div className="txt">
{title}
</div>
</div>
<Button className="confirm md18" onClick={this.clickConfirm}/>
<Button className="cancel md17" onClick={this.clickCancel}/>
</div>;
}
}
export default ConfirmPop;
@import "../../res.less";
.ConfirmPop {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.bg {
position: absolute;
left: 110px;
top: 456px;
width: 529px;
height: 662px;
.sparkBg("ConfirmPop/bg.png")
}
.title {
font-size: 25px;
color: rgb(239, 125, 30);
line-height: 3.823;
text-align: center;
position: absolute;
left: 110px;
top: 120px;
}
.picture {
border-radius: 26px;
background-color: rgb(233, 219, 189);
position: absolute;
left: 155px;
top: 245px;
width: 220px;
height: 218px;
}
.txt{
font-size: 25px;
color: rgb(239, 125, 30);
line-height: 3.823;
text-align: center;
position: absolute;
left: 30px;
width: 460px;
top: 455px;
}
.confirm {
position: absolute;
left: 375px;
top: 985px;
width: 207px;
height: 80px;
.sparkBg("ConfirmPop/confirm.png")
}
.cancel {
position: absolute;
left: 168px;
top: 992px;
width: 191px;
height: 71px;
.sparkBg("ConfirmPop/cancel.png")
}
}
\ No newline at end of file
import React from "react";
import {observer} from "mobx-react";
import "./PrivacyPop.less";
import {Button} from "@src/components/Button";
import modalStore from "@src/store/modal";
@observer
class PrivacyPop extends React.Component {
clickClose = () => {
modalStore.closePop("PrivacyPop");
};
render() {
const {agreeText} = this.props.popData;
return <div className="PrivacyPop modal_center">
<div className="light"/>
<div className="bg">
<div className="rankText" dangerouslySetInnerHTML={{__html:agreeText}}/>
</div>
<Button className="close md44" onClick={this.clickClose}/>
</div>;
}
}
export default PrivacyPop;
@import "../../res.less";
.PrivacyPop {
position: absolute;
left: 0;
top: 0;
width: 750px;
height: 1624px;
.bg {
position: absolute;
left: 109px;
top: 321px;
width: 529px;
height: 924px;
.sparkBg("yinsirulepop/bg.png")
}
.rankText {
font-size: 24px;
color: rgb(75, 38, 20);
line-height: 1.5;
text-align: left;
position: absolute;
left: 40px;
top: 400px;
width: 480px;
height: 630px;
overflow-x: hidden;
overflow-y: auto;
}
.close {
position: absolute;
left: 345px;
top: 1343px;
width: 61px;
height: 61px;
.sparkBg("common/closeBtn.png")
}
}
\ No newline at end of file
...@@ -132,12 +132,12 @@ class Taskpop extends React.Component { ...@@ -132,12 +132,12 @@ class Taskpop extends React.Component {
modalStore.closePop("Taskpop"); modalStore.closePop("Taskpop");
// store.getHomeInfo() // store.getHomeInfo()
if(store.curPage == PAGE_MAP.OPUS_PAGE) { // if(store.curPage == PAGE_MAP.OPUS_PAGE) {
store.workDetailNum = getUrlParam("worksNum") // store.workDetailNum = getUrlParam("worksNum")
await store.getOpusInfo() // await store.getOpusInfo()
} else { // } else {
await store.getHomeInfo(); // await store.getHomeInfo();
} // }
}) })
......
...@@ -8,8 +8,6 @@ import RankPrizePop from "@src/components/RankPrizePop/RankPrizePop"; ...@@ -8,8 +8,6 @@ import RankPrizePop from "@src/components/RankPrizePop/RankPrizePop";
import RankNoPrizePop from "@src/components/RankNoPrizePop/RankNoPrizePop"; import RankNoPrizePop from "@src/components/RankNoPrizePop/RankNoPrizePop";
import NoPrizeCard from "@src/components/NoPrizeCard/NoPrizeCard"; import NoPrizeCard from "@src/components/NoPrizeCard/NoPrizeCard";
import CodePop from "@src/components/CodePop/CodePop"; import CodePop from "@src/components/CodePop/CodePop";
import PrivacyPop from "@src/components/PrivacyPop/PrivacyPop";
import ConfirmPop from "@src/components/ConfirmPop/ConfirmPop";
import LoginPop from "@src/components/LoginPop/LoginPop"; import LoginPop from "@src/components/LoginPop/LoginPop";
import Taskpop from "@src/components/taskpop/taskpop"; import Taskpop from "@src/components/taskpop/taskpop";
import Drawchancepop from "@src/components/drawchancepop/drawchancepop"; import Drawchancepop from "@src/components/drawchancepop/drawchancepop";
...@@ -39,10 +37,6 @@ export const cfg = { ...@@ -39,10 +37,6 @@ export const cfg = {
NoPrizeCard, NoPrizeCard,
// 二维码弹窗 // 二维码弹窗
CodePop, CodePop,
// 隐私弹窗
PrivacyPop,
// 上传确认弹窗
ConfirmPop,
// 登录弹窗 // 登录弹窗
LoginPop, LoginPop,
// 规则弹窗 // 规则弹窗
......
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './opuspage.less';
import { _asyncThrottle, dateFormatter } from '@src/utils/utils';
import store from '@src/store';
import modalStore from '@src/store/modal';
import { Button } from '@src/components/Button';
import { PAGE_MAP } from '@src/utils/constants';
import { LOG_KEY, pageView, sensorLog } from '@src/utils/sensors';
@observer
class Opuspage extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.flushIndex()
pageView("b12108", {
page_name: "作品详情页",
});
sensorLog(LOG_KEY.exposure, "b12108", "d12109", {
page_name: "作品详情页",
button_name: "返回按钮",
});
sensorLog(LOG_KEY.exposure, "b12108", "d12110", {
page_name: "作品详情页",
button_name: "评论按钮",
});
sensorLog(LOG_KEY.exposure, "b12108", "d12111", {
page_name: "作品详情页",
button_name: "点赞按钮",
});
}
flushIndex = async () => {
await store.getOpusInfo()
}
doComment = () => {
sensorLog(LOG_KEY.click, "b12108", "d12110", {
page_name: "作品详情页",
button_name: "评论按钮",
});
modalStore.pushPop("Commentpop")
}
doThumbsUp = _asyncThrottle(() => {
if (!store.endOpus) {
return
}
sensorLog(LOG_KEY.click, "b12108", "d12111", {
page_name: "作品详情页",
button_name: "点赞按钮",
});
if (store.opusInfo?.remainThumbsTimes > 0) {
store.doThumbsUp()
} else {
modalStore.pushPop("Nopointpop")
}
})
handleOnScroll = _asyncThrottle(async () => {
let dom = document.getElementById("commentlist")
const contentScrollTop = dom.scrollTop; //滚动条距离顶部
const clientHeight = dom.clientHeight; //可视区域
const scrollHeight = dom.scrollHeight;//滚动区域总高度
if (contentScrollTop + clientHeight >= scrollHeight - 10) {
if (store.nowPage >= store.totalPage) {
return
}
await store.getCommentInfo(store.nowPage + 1)
}
// console.log(contentScrollTop, clientHeight, scrollHeight)
})
backHandle = () => {
sensorLog(LOG_KEY.click, "b12108", "d12109", {
page_name: "作品详情页",
button_name: "返回按钮",
});
store.changePage(PAGE_MAP.HOME_PAGE)
}
render() {
return (
<div className="opuspage">
<span className="bg2"></span>
<span className="bg"></span>
<div className='infoList'>
<div className='list' id="commentlist"
onScrollCapture={() => this.handleOnScroll()} >
{
store.commentInfo?.map((item, index) => {
return (
<div className="commentbox" key={"com" + index}>
<div className='comInfoBox'>
<span className="commentinfo">{item.content}</span>
<span className="time">{dateFormatter(item.time, "yyyy/MM/dd hh:mm:ss")}</span>
</div>
<span className="uid">{item.nickname}</span>
<span className="avatar">
<img src={item.avatar}></img>
</span>
</div>
)
})
}
</div>
{
store.opusInfo?.salesmanFlag ? <Button className="big_pinglun md32" onClick={this.doComment}></Button> :
<div>
<Button className="dianzan md33" onClick={this.doThumbsUp}></Button>
<Button className="pinglun md32" onClick={this.doComment}></Button>
</div>
}
{/* */}
<div className="infobox">
<span className="infotitle">{store.opusInfo?.worksInfo?.worksTitle}</span>
<span className="infolab">
{store.opusInfo?.worksInfo?.worksDesc}
</span>
<span className="line"></span>
<span className="infobg">
<img src={store.opusInfo?.worksInfo?.worksImg}></img>
</span>
</div>
</div>
<Button className="back md31" onClick={this.backHandle}></Button>
{/* <span className="zan"></span> */}
</div>
);
}
}
export default Opuspage;
@import "../../res.less";
.opuspage {
width: 750px;
height: 100vh;
left: 0px;
top: 0px;
position: absolute;
overflow-y: hidden;
.bg2 {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("opusPage/bg2.png");
}
.bg {
width: 750px;
height: 1456px;
left: 0px;
top: 168px;
position: absolute;
.sparkBg("opusPage/bg.png");
}
.infoList {
width: 646px;
height: auto;
left: 59px;
top: 223px;
bottom: 10px;
overflow-y: scroll;
position: fixed;
overflow-x: hidden;
}
.list {
width: 646px;
height: 169px;
left: 2px;
top: 1190px;
position: absolute;
}
.commentbox {
width: 636px;
height: 189px;
left: 0px;
top: 0px;
position: relative;
.comInfoBox {
width: 554px;
height: 130px;
left: 92px;
top: 54px;
position: absolute;
}
.commentinfo {
width: 554px;
height: auto;
left: 0px;
top: 0px;
position: relative;
display: block;
font-size: 26px;
color: rgba(59, 59, 59, 1);
}
.uid {
width: 102px;
height: 25px;
left: 91px;
top: 20px;
position: absolute;
font-size: 26px;
line-height: 25px;
color: rgba(59, 59, 59, 1);
}
.time {
width: 290px;
height: 19px;
left: 0px;
// top: 111px;
margin-top: 10px;
position: relative;
display: block;
font-size: 20px;
line-height: 19px;
color: rgba(174, 174, 174, 1);
}
.avatar {
width: 74px;
height: 74px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("opusPage/avatar.png");
img {
width: 74px;
height: 74px;
left: 0px;
top: 0px;
position: absolute;
border-radius: 90px;
}
}
}
.dianzan {
width: 283px;
height: 108px;
left: 330px;
top: 1019px;
position: absolute;
.sparkBg("opusPage/dianzan.png");
}
.pinglun {
width: 283px;
height: 108px;
left: -10px;
top: 1019px;
position: absolute;
.sparkBg("opusPage/pinglun.png");
}
.big_pinglun {
width: 373px;
height: 110px;
left: 129px;
top: 1019px;
position: absolute;
.sparkBg("opusPage/big_pinglun.png");
}
.infobox {
width: 632px;
height: 981px;
left: 0;
top: 0;
position: absolute;
.infotitle {
width: 609px;
height: 45px;
left: 10px;
top: 750px;
position: absolute;
font-size: 38px;
line-height: 37px;
color: rgba(244, 148, 31, 1);
overflow-x:hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
.infolab {
width: 608px;
height: 148px;
left: 11px;
top: 833px;
position: absolute;
font-size: 26px;
color: rgba(59, 59, 59, 1);
overflow-x: hidden;
overflow-y: auto;
word-wrap: break-word;
}
.line {
width: 612px;
height: 2px;
left: 9px;
top: 810px;
position: absolute;
opacity: 0.49;
.sparkBg("opusPage/line.png");
}
.infobg {
width: 632px;
height: 705px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("opusPage/infobg.png");
img {
width: 632px;
height: 705px;
left: 0px;
top: 0px;
position: absolute;
border-radius: 30px;
object-fit: contain;
}
}
}
.back {
width: 58px;
height: 58px;
left: 32px;
top: 85px;
position: absolute;
.sparkBg("opusPage/back.png");
}
.zan {
width: 487px;
height: 487px;
left: 130px;
top: 505px;
position: absolute;
.sparkBg("opusPage/zan.png");
}
}
...@@ -28,7 +28,6 @@ export const PAGE_MAP = { ...@@ -28,7 +28,6 @@ export const PAGE_MAP = {
DRAW_PAGE: "drawPage", DRAW_PAGE: "drawPage",
PRIZE_PAGE: "prize", PRIZE_PAGE: "prize",
USER_HOME_PAGE:"userHomePage", USER_HOME_PAGE:"userHomePage",
OPUS_PAGE:"opusPage"
}; };
......
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