Commit ac91f321 by xuzhenghua

pull

parent 76d9e8a8
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
...@@ -95,7 +95,14 @@ class Prizes extends Component { ...@@ -95,7 +95,14 @@ class Prizes extends Component {
this.state.prizes.map((item, index) => { this.state.prizes.map((item, index) => {
return ( return (
<li key={index}> <li key={index}>
<img src={item.img_name} alt=""/> {
item.img_name
? <i className="prize-list__image" style={{
backgroundImage: `url(${item.img_name})`
}}></i>
: <i className="prize-list__image"></i>
}
{/* <img src={item.img_name} alt=""/> */}
{ {
item.is_captain != 0 && <span className='captain top-tag'>队长专属</span> item.is_captain != 0 && <span className='captain top-tag'>队长专属</span>
} }
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
display: block; display: block;
width: 100%; width: 100%;
background: url($bg) no-repeat; background: url($bg) no-repeat;
background-size: contain; background-size: 100% auto;
} }
&::before { &::before {
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
&::after { &::after {
@include common-deco('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/landing-box-footer.png'); @include common-deco('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/landing-box-footer.png');
height: 85px; height: 85px;
margin-top: -1px;
} }
.bg { .bg {
...@@ -101,6 +102,14 @@ ...@@ -101,6 +102,14 @@
margin-right: 10.5px; margin-right: 10.5px;
margin-bottom: 6.5px; margin-bottom: 6.5px;
.prize-list__image {
display: block;
width: 100%;
height: 100%;
background-position: center;
background-size: cover;
}
img { img {
width: 90px; width: 90px;
object-fit: contain; object-fit: contain;
......
...@@ -8,10 +8,9 @@ import CreateSuccess from './../common/createSuccess/index'; ...@@ -8,10 +8,9 @@ import CreateSuccess from './../common/createSuccess/index';
import TreasureTeam from './team'; import TreasureTeam from './team';
import PrizeStatus from './prize'; import PrizeStatus from './prize';
import SplitSuccess from './../common/splitSuccess/index'; import SplitSuccess from './../common/splitSuccess/index';
import { http, getParam } from '@/utils'; import { http, getParam, SendMessageToApp } from '@/utils';
import Mask from './mask'; import Mask from './mask';
import './index.scss'; import './index.scss';
import { split } from 'react-ace';
@connect(({country, user}) => ({ @connect(({country, user}) => ({
country, country,
...@@ -41,14 +40,18 @@ class MyTreasure extends Component { ...@@ -41,14 +40,18 @@ class MyTreasure extends Component {
} }
componentDidMount() { componentDidMount() {
const { isEnd } = this.state;
if (isEnd) {
this.startCountDown();
}
this.fetchMyTreasure(); this.fetchMyTreasure();
this.fetchActivityStatus(); this.fetchActivityStatus();
} }
componentWillReceiveProps(nextProp) {
const { history } = this.props;
const { userInfo } = nextProp;
if(!userInfo.uid) {
history.push('/passport');
}
}
// 页面加载时,初始化当前需要绑定手机号的奖品名字 // 页面加载时,初始化当前需要绑定手机号的奖品名字
initPrizeName = (params) => { initPrizeName = (params) => {
const key = this.fetchCurrentTeamId(params); const key = this.fetchCurrentTeamId(params);
...@@ -288,8 +291,10 @@ class MyTreasure extends Component { ...@@ -288,8 +291,10 @@ class MyTreasure extends Component {
http.get(`${API.home}/activity/stage`).then(res => { http.get(`${API.home}/activity/stage`).then(res => {
const { code, data } = res.data; const { code, data } = res.data;
if (code === 200) { if (code === 200) {
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内 // treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
if(data.treasure_stage === 0) {
this.startCountDown();
}
this.setState({ this.setState({
isEnd: data.treasure_stage === 0 isEnd: data.treasure_stage === 0
}); });
...@@ -324,7 +329,11 @@ class MyTreasure extends Component { ...@@ -324,7 +329,11 @@ class MyTreasure extends Component {
// 邀请好友 // 邀请好友
handleToInvite = (treasure_code) => { handleToInvite = (treasure_code) => {
const { history } = this.props; const { history } = this.props;
history.push(`/activity/newyear-2019/landing?treasure_code=${treasure_code}&origin=1`); if(getParam('version')){
history.push(`/activity/newyear-2019/landing?treasure_code=${treasure_code}&origin=1&version=${getParam('version')}`);
}else {
history.push(`/activity/newyear-2019/landing?treasure_code=${treasure_code}&origin=1`);
}
} }
// 组队开宝箱 // 组队开宝箱
...@@ -352,25 +361,41 @@ class MyTreasure extends Component { ...@@ -352,25 +361,41 @@ class MyTreasure extends Component {
// 奖品,代金券碎片--合成 // 奖品,代金券碎片--合成
toComposeCoupon = () => { toComposeCoupon = () => {
const { history } = this.props; const { history } = this.props;
history.push('/coupons/my-patch'); if(getParam('version')) {
SendMessageToApp("toCoupon")
}else {
history.push('/coupons/my-patch');
}
} }
// 奖品,指定课程代金券--使用 // 奖品,指定课程代金券--使用
toUseCoupon = (id) => { toUseCoupon = (id) => {
const { history } = this.props; const { history } = this.props;
history.push(`/detail?id=${id}`); if(getParam('version')) {
SendMessageToApp("toCourse", id)
}else {
history.push(`/detail?id=${id}`);
}
} }
// 第三:奖品,通用课程代金券--使用 // 第三:奖品,通用课程代金券--使用
toCourseList = () => { toCourseList = () => {
const { history } = this.props; const { history } = this.props;
history.push('/classify'); if(getParam('version')) {
SendMessageToApp('toQualityCourse')
}else {
history.push('/classify');
}
} }
// 第三:奖品,现金红包--提现 // 第三:奖品,现金红包--提现
toFecthMoney = () => { toFecthMoney = () => {
const { history } = this.props; const { history } = this.props;
history.push('/scholarship'); if(getParam('version')) {
SendMessageToApp('toAccount')
}else {
history.push('/scholarship');
}
} }
// 弹窗--隐藏 // 弹窗--隐藏
...@@ -486,7 +511,7 @@ class MyTreasure extends Component { ...@@ -486,7 +511,7 @@ class MyTreasure extends Component {
successBindPhone={this.successBindPhone} successBindPhone={this.successBindPhone}
desc={ desc={
<> <>
<p className="phone-treasure__desc">恭喜您获得 奖品名称({prizeName}</p> <p className="phone-treasure__desc">恭喜您获得 {prizeName}</p>
<p className="phone-treasure__notice">为了您的账户安全,请于20191231日前绑定手机号,过期将失效</p> <p className="phone-treasure__notice">为了您的账户安全,请于20191231日前绑定手机号,过期将失效</p>
</> </>
} }
...@@ -529,12 +554,17 @@ class MyTreasure extends Component { ...@@ -529,12 +554,17 @@ class MyTreasure extends Component {
</Mask> </Mask>
</div> </div>
} }
<div className="activity-rule__header"> {
<i className="activity-rule__decorate"></i> rule &&
<h2 className="activity-rule__title">活动规则</h2> <>
<i className="activity-rule__decorate"></i> <div className="activity-rule__header">
</div> <i className="activity-rule__decorate"></i>
<div className="activity-rule__body" dangerouslySetInnerHTML={{__html: rule}}></div> <h2 className="activity-rule__title">活动规则</h2>
<i className="activity-rule__decorate"></i>
</div>
<div className="activity-rule__body" dangerouslySetInnerHTML={{__html: rule}}></div>
</>
}
</div> </div>
) )
} }
......
...@@ -86,7 +86,7 @@ export default (props) => { ...@@ -86,7 +86,7 @@ export default (props) => {
{/* 第三:奖品,任意线上课程兑换券 */} {/* 第三:奖品,任意线上课程兑换券 */}
{ {
(!bind_phone && !bind_address && prize_type === 5) && (!bind_phone && !bind_address && prize_type === 5) &&
<a className="team-result">关注服务号“七月在线实验室” 回复“领课” <a className="team-result">关注公众号“七月在线实验室” 回复“领课”
</a> </a>
} }
</> </>
......
...@@ -87,6 +87,8 @@ class YearCourse extends Component { ...@@ -87,6 +87,8 @@ class YearCourse extends Component {
shouldComponentUpdate(nextProps, nextState, nextContext) { shouldComponentUpdate(nextProps, nextState, nextContext) {
if (this.props.isAppUpdate !== nextProps.isAppUpdate) { if (this.props.isAppUpdate !== nextProps.isAppUpdate) {
this.getTeamInfo()
this.getLength()
this.fetchBigCourse() this.fetchBigCourse()
this.fetchFreeCourse() this.fetchFreeCourse()
this.fetchGroupCourse() this.fetchGroupCourse()
...@@ -414,7 +416,11 @@ class YearCourse extends Component { ...@@ -414,7 +416,11 @@ class YearCourse extends Component {
search = `?id=${currentId}` search = `?id=${currentId}`
} }
if (isLogin) { if (isLogin) {
this.props.history.push(`/year/yearTreasure${search}`) if (!getParam('version')) {
this.props.history.push(`/year/yearTreasure${search}`)
} else {
this.props.history.push(`/year/yearTreasure${search}?version=${getParam('version')}`)
}
} else { } else {
this.toLogin() this.toLogin()
} }
...@@ -423,7 +429,12 @@ class YearCourse extends Component { ...@@ -423,7 +429,12 @@ class YearCourse extends Component {
toYearWish = () => { toYearWish = () => {
const isLogin = !this.props.user.hasError const isLogin = !this.props.user.hasError
if (isLogin) { if (isLogin) {
this.props.history.push('/year/yearWish') if (!getParam('version')) {
this.props.history.push('/year/yearWish')
} else {
this.props.history.push(`/year/yearWish?version=${getParam('version')}`)
}
} else { } else {
this.toLogin() this.toLogin()
} }
...@@ -482,7 +493,7 @@ class YearCourse extends Component { ...@@ -482,7 +493,7 @@ class YearCourse extends Component {
{ {
(bigcourse.courseList && bigcourse.courseList.length > 4) && (bigcourse.courseList && bigcourse.courseList.length > 4) &&
<button className="more-button" onClick={() => this.handleToMore('bigcourse')}> <button className="more-button" onClick={() => this.handleToMore('bigcourse')}>
{group.isMore ? '查看更多' : '收起'} {bigcourse.isMore ? '查看更多' : '收起'}
</button> </button>
} }
</> </>
...@@ -520,7 +531,7 @@ class YearCourse extends Component { ...@@ -520,7 +531,7 @@ class YearCourse extends Component {
{ {
(freecourse.courseList && freecourse.courseList.length > 4) && (freecourse.courseList && freecourse.courseList.length > 4) &&
<button className="more-button" onClick={() => this.handleToMore('freecourse')}> <button className="more-button" onClick={() => this.handleToMore('freecourse')}>
{group.isMore ? '查看更多' : '收起'} {freecourse.isMore ? '查看更多' : '收起'}
</button> </button>
} }
</> </>
...@@ -591,7 +602,7 @@ class YearCourse extends Component { ...@@ -591,7 +602,7 @@ class YearCourse extends Component {
{ {
(groupcourse.courseList && groupcourse.courseList.length > 4) && (groupcourse.courseList && groupcourse.courseList.length > 4) &&
<button className="more-button" onClick={() => this.handleToMore('groupcourse')}> <button className="more-button" onClick={() => this.handleToMore('groupcourse')}>
{group.isMore ? '查看更多' : '收起'} {groupcourse.isMore ? '查看更多' : '收起'}
</button> </button>
} }
</> </>
......
File mode changed from 100644 to 100755
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