Commit 9b5257be by xuzhenghua

pull

parent 6bd2899e
......@@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
importScripts(
"/precache-manifest.0c6a4068dad710bf120fb4432c488d7e.js"
"/precache-manifest.77acc686b9ed655a6c00d43d85474d5d.js"
);
workbox.clientsClaim();
......
......@@ -28,6 +28,14 @@ const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
const printHostingInstructions = require('react-dev-utils/printHostingInstructions');
const FileSizeReporter = require('react-dev-utils/FileSizeReporter');
const printBuildError = require('react-dev-utils/printBuildError');
const childProcess = require('child_process')
const deploymentBranches = ['master', 'pre', 'dev'];
const version = childProcess.execSync('git symbolic-ref --short -q HEAD', {'encoding': 'utf8'})
if(!deploymentBranches.includes(version.trim())){
console.log(chalk.yellow(`当前不在上线分支,请切换至上线分支(${deploymentBranches.join('/')})打包\n`))
return
}
const measureFileSizesBeforeBuild =
FileSizeReporter.measureFileSizesBeforeBuild;
......
......@@ -6,7 +6,7 @@
.banner__con {
width: 100%;
height: 170px;
background: url('./images/banner.png') center center no-repeat;
background: url('./images/formal-banner.png') center center no-repeat;
background-size: 100% 100%;
}
.content__con {
......@@ -233,7 +233,7 @@
margin-left: 0;
}
}
.user_avatar {
width: 22px;
......
......@@ -189,7 +189,7 @@ class Invite extends Component {
<div className="box__out">
<div className="box__middle">
<div className="box__inner">
<p>当前中奖热力:</p>
<p>当前中奖概率:</p>
<p className="hot__value">{hotValue}</p>
<div className="hot__progress">
<div className="progress__bar">
......
#prize-winner-list {
height: 100%;
background: #5327fa;
padding-bottom: 10px;
.banner {
width: 100%;
......@@ -31,7 +31,6 @@
ul {
width: 355px;
height: 316px;
margin: 0 auto;
background: rgba(57, 0, 201, 1);
border: 1px solid rgba(89, 112, 255, 1);
......
import React, { Component } from 'react';
import './index.scss';
import ListHeader from './../blessingPreheat/listHeader/index'
import { http, getParam } from '@/utils';
import { Toast } from 'antd-mobile';
import AddressPopup from './../blessingPreheat/addressPopup/index'
import { Popup } from '@/common'
import { connect } from 'react-redux'
import jsCookie from 'js-cookie'
@connect(({user}) => (
{
uid: user.data.uid || ''
}
))
class BlessingGetPrize extends Component {
popupInstance = null
constructor(props) {
super(props);
this.state = {
date: '',
next_date: '',
name: '',
is_winning: "", //是否中奖
is_virtual: 1, // 实物奖品 虚拟奖品
prize_data: [],
address: false,
}
}
componentDidMount () {
const _this = this;
setTimeout(function(){
const {history, uid} = _this.props;
if(!uid) {
history.push('/passport');
}else{
http.get(`${API.home}/sys/lottery_result?id=${getParam('id')}`).then(res => {
const {code, msg, data} = res.data;
if(code === 200) {
_this.setState({
...data.info,
prize_data: data.prize_data.slice(0, 6),
})
} else {
Toast.info(msg);
}
});
}
}, 300);
}
showAddress = (bool) => {
const {history, uid} = this.props;
const {name} = this.state;
if (bool && !uid) {
history.push('/passport')
} else {
if (bool && !this.popupInstance) {
this.popupInstance = Popup({
title: '恭喜您',
content: <AddressPopup tip='填写您的联系方式' prize={name} handleToHide={() => this.showAddress(false)}/>
})
} else {
this.popupInstance.close()
this.popupInstance = null
}
}
}
render() {
const {date, next_date, name, is_winning, is_virtual, prize_data, address} = this.state;
return (
<div className="blessing_get_prize">
<div className='is__get_prize'>
<div className="get_piriz__info">
<div className='result'>{date}中奖结果</div>
{
is_winning === 0 && (
<div className='no_prize'>很遗憾,你未中奖~</div>
)
}
{
is_winning === 1 && is_virtual === 0 && (
<div className='real__prize'>
<div>恭喜你,已抽中{name}奖品</div>
<span onClick={()=> this.showAddress(true)} className='address'>填写收货地址</span>
</div>
)
}
{
is_winning === 1 && is_virtual === 1 && (
<div className='virtual '>
<div>恭喜你抽中{name}</div>
<div>奖品已存放到你的账户</div>
</div>
)
}
</div>
</div>
{
prize_data && prize_data.length > 0 && <>
<div className='current_stage'>
{next_date}
</div>
<ListHeader text="抽奖已开启" styles={{margin: '16px 0 18px'}}/>
<div className='prize_list_container'>
{
prize_data.length > 0 && prize_data.map((item, index) => {
return (<div className='prize__item' key={index}>
<img className='prize__image' src={item.img}></img>
<div className='name__num'>
<span>{item.name}</span>
<span>{`*${item.num}`}</span>
</div>
</div>)
})
}
</div>
<a href='/blessingPreheat' className='join__button'>
立即参与抽奖
</a>
<div className='prize__tip'>
<div className='line'></div>
<span>中奖小tips</span>
<div className='line'></div>
</div>
<div className='blessing__des'>积攒的福气值越高,中奖概率越大哦</div>
<a className='to__preheat' href='/invite'>积攒更多福气值</a>
</>
}
{
(!prize_data || prize_data.length === 0) && (
<div className="active_over_container">
<img src='https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/acitve__over.png' alt=''/>
<p>七月在线双十一抽奖活动已结束, 感谢你的参与!</p>
</div>
)
}
</div>
)
}
}
export default BlessingGetPrize
\ No newline at end of file
.blessing_get_prize {
width: 100vw;
height: 100vh;
overflow: auto;
background-color: #4B00F3;
padding-bottom: 58px;
.is__get_prize {
width: 100%;
height: 140px;
background: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/quan2x.png') center center no-repeat;
background-size: 100% 100%;
margin-top: 10px;
position: relative;
.get_piriz__info {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
.result {
height:16px;
line-height: 16px;
font-size:16px;
font-weight:400;
color:rgba(76,33,239,1);
margin-top: 30px;
}
.virtual {
font-size:16px;
font-weight:500;
color:rgba(76,33,239,1);
line-height:20px;
margin-top: 10px;
div {
width: 100%;
text-align: center;
text-align-last: center;
margin-top: 4px;
}
}
.no_prize {
font-size:16px;
font-weight:500;
color:rgba(76,33,239,1);
width: 100%;
text-align: center;
text-align-last: center;
margin-top: 18px;
}
.real__prize {
font-size:16px;
font-weight:500;
color:rgba(76,33,239,1);
width: 100%;
margin-top: 16px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
div {
line-height: 20px;
width: 80%;
text-align: center;
text-align-last: center;
}
.address {
font-size:12px;
font-weight:400;
text-decoration:underline;
color:rgba(76,33,239,1);
margin-top: 6px;
}
}
}
}
.current_stage {
width:100%;
font-size:16px;
font-weight:500;
color:rgba(255,255,255,1);
text-align: center;
text-align-last: center;
margin-top: 36px;
}
.prize_list_container {
width: 100%;
height:250px;
background:rgba(53,0,162,1);
box-shadow:0px 3px 6px 0px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: flex-start;
flex-wrap: wrap;
padding: 16px;
.prize__item {
width: 106px;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
margin-right: 10px;
&:nth-child(3n) {
margin-right: 0;
}
.prize__image {
width: 106px;
height: 82px;
}
.name__num {
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
font-size:12px;
font-weight:400;
color:rgba(255,255,255,1);
margin-top: 6px;
span {
&:first-child {
width: 70px;
flex: 0 0 auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&:last-child {
width: 36px;
flex: 0 0 auto;
}
}
}
}
}
.join__button {
display: block;
width:340px;
height:50px;
background:linear-gradient(90deg,rgba(255,105,5,1) 0%,rgba(255,180,5,1) 100%);
font-size:18px;
font-weight:500;
color:rgba(255,255,255,1);
border-radius:5px;
margin: 20px auto 32px;
line-height: 50px;
text-align: center;
text-align-last: center;
}
.prize__tip {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
font-size:14px;
font-weight:400;
color:rgba(255,255,255,1);
margin-bottom: 12px;
.line {
width: 128px;
height: 1px;
background: #fff;
}
span {
margin: 0 8px;
}
}
.blessing__des {
font-size:12px;
font-weight:300;
color:rgba(255,255,255, .6);
text-align: center;
margin-bottom: 16px;
}
.to__preheat {
display: inline-block;
width: 100%;
font-size:14px;
font-weight:300;
text-decoration:underline;
color:rgba(255,255,255, .6);
text-align: center;
}
.active_over_container {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
margin-top: 70px;
img {
width: 170px;
height: 134px;
}
p {
width:238px;
height:39px;
font-size:16px;
font-weight:400;
color:rgba(255,255,255,1);
line-height:24px;
text-align: center;
text-align-last: center;
margin-top: 20px;
}
}
}
.address__prize {
font-size: 16px;
width: 100%;
text-align: center;
text-align-last: center;
color: #525C65;
line-height: 16px;
margin-top: 16px;
}
\ No newline at end of file
......@@ -54,6 +54,7 @@ class AddressPopup extends Component {
render() {
const { isLoading, addressInfo } = this.state;
const {tip, prize} = this.props;
return (
<>
{
......@@ -84,7 +85,14 @@ class AddressPopup extends Component {
}}
render={({errors}) => (
<Form className="address-form">
<p className="address-form__desc">请及时填写收货信息,获得实物奖品后将第一时间为您邮寄</p>
{
prize ? (
<p className='address__prize'>您抽中了{prize}<span style={{'color': '#FF4000'}}>实物奖品</span></p>
) : (null)
}
{
tip ? (<p className="address-form__desc">{tip}</p>) : (<p className="address-form__desc">请及时填写收货信息,获得实物奖品后将第一时间为您邮寄</p>)
}
<Field
name="name"
render={({ field }) => (
......
......@@ -97,10 +97,10 @@ class Banner extends Component {
render() {
const { toSection, navs, index } = this.props;
const { toSection, navs, index, isFormal } = this.props;
return (
<div id={'main-banner'}>
<div className="banner"></div>
<div className={`banner ${isFormal ? 'formal_banner' : ''}`}></div>
<nav id={'main-nav'}>
<ul>
{
......
#main-banner{
overflow: auto;
margin-bottom: 70px;
.banner{
width: 375px;
height: 183px;
background: url("https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/banner.png") no-repeat;
background-size: contain;
}
.formal_banner {
background: url("https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/formal_banner.png") no-repeat;
background-size: contain;
}
#main-nav{
position: absolute;
top: 183px;
......
......@@ -141,6 +141,7 @@ class CollectBlessing extends Component {
Toast.info('今日已分享,记得明天来~', 2, null, false);
}else {
handleToShowShare();
this.shareTimer && clearInterval(this.shareTimer);
this.shareTimer = setInterval(() => {
this.setState(
{
......@@ -148,6 +149,9 @@ class CollectBlessing extends Component {
},
() => {
if (seconds === 0) {
this.setState({
seconds: 5
});
typeof cb === 'function' && cb();
clearInterval(this.shareTimer);
}
......
......@@ -82,7 +82,7 @@
.collect-blessing__share-button {
display: block;
width: 20px;
height: 11px;
height: 14px;
border-style: none;
background-color: transparent;
background-size: auto 100%;
......@@ -90,15 +90,17 @@
background-position: center;
&[data-type="qq"] {
background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/qq-icon.png');
background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/qq.png');
}
&[data-type="wechat"] {
background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/wechat-icon.png');
height: 16px;
background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/wechat.png');
}
&[data-type="weibo"] {
background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/icon-weibo.png');
height: 17px;
background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/weibo.png');
}
}
......@@ -198,7 +200,7 @@
line-height: 1;
&:last-child {
margin-bottom: 0;
margin-bottom: 0;
}
span {
font: size 12px;
......
......@@ -9,7 +9,7 @@
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .5);
z-index: 2;
z-index: 11;
.iconfont {
margin: 16px 0 0;
......
......@@ -2,100 +2,28 @@
background: #5327FA;
}
.timeline-share{
height: 215px;
padding-bottom: 30px;
.title{
margin-bottom: 20px;
}
.content{
text-align: center;
.qr-code{
width: 120px;
height: 120px;
}
}
}
.test__record {
width: 106px;
height: 26px;
border:1px solid rgba(255,246,4,1);
border-radius:13px;
font-size:14px;
font-weight:400;
color:rgba(255,246,4,1);
border: 1px solid rgba(255, 246, 4, 1);
border-radius: 13px;
font-size: 14px;
font-weight: 400;
color: rgba(255, 246, 4, 1);
margin: 10px auto 14px;
display: flex;
justify-content: center;
align-items: center;
}
.sort__rules {
font-size:12px;
font-weight:400;
color:rgba(255,255,255,1);
font-size: 12px;
font-weight: 400;
color: rgba(255, 255, 255, 1);
text-align: center;
text-align-last: center;
}
.join-lottery {
background: #5327FA;
text-align: center;
.title {
color: #fff;
margin-bottom: 15px;
}
.text {
width: 275px;
height: 248px;
padding: 36px 30px 0;
margin-bottom: 10px;
text-align: center;
background: url("https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/join-lottery-bg.png");
background-size: contain;
font-size: 14px;
.code {
color: #FF0000;
margin-bottom: 8px;
}
.time, .hint {
font-size: 12px;
color: #525C65;
}
.time {
margin-bottom: 20px;
}
.hint{
color: rgba(82, 92, 101, .8);
margin-bottom: 10px;
text-align: left;
}
.qr-code {
width: 90px;
height: 90px;
}
}
button {
width: 133px;
height: 30px;
background: #fff;
border-radius: 15px;
font-size: 14px;
color: #5327FA;
-webkit-appearance: none;
outline: none;
border: none;
}
}
.invite-popup {
.content {
display: flex;
......@@ -131,7 +59,7 @@
text-align: center;
}
.luck-draw__button {
.luck-draw__button, .prize-record {
display: block;
width: 106px;
height: 26px;
......@@ -149,3 +77,158 @@
outline: none;
}
.formal-draw-btns {
display: flex;
justify-content: center;
margin: 15px 0;
button {
margin: 0;
}
& button:first-child {
margin-right: 27px;
}
}
.prize-record-popup {
.title {
margin-bottom: 11px;
}
.record-container {
width: 250px;
.list-title {
display: flex;
border-radius: 2px 2px 0 0;
div {
width: 50%;
height: 33px;
line-height: 33px;
background: #edeeef;
text-align: center;
font-size: 12px;
color: #525C65;
}
}
ul {
border: 1px solid #CFDBE5;
border-bottom: 0;
li {
border-bottom: 1px solid #CFDBE5;
display: flex;
height: 33px;
line-height: 33px;
font-size: 12px;
& > div {
width: 50%;
text-align: center;
}
.time {
color: #525C65;
}
.name {
color: #09f;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-decoration: underline;
}
}
}
}
}
.address-mask {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, .6);
z-index: 100;
.address-popup {
position: absolute;
top: 179px;
left: 50%;
margin-left: -150px;
width: 300px;
height: 309px;
padding: 18px 25px;
background: #fff;
border-radius: 5px;
font-size: 12px;
.address-info-container {
position: relative;
padding-bottom: 24px;
text-align: center;
}
.title {
font-size: 16px;
color: #525C65;
text-align: center;
margin-bottom: 11px;
}
.tip {
color: #999;
margin-bottom: 15px;
}
input {
width: 250px;
height: 40px;
border: 1px solid rgba(221, 221, 221, 1);
-webkit-appearance: none;
outline: none;
margin-bottom: 10px;
padding-left: 10px;
&::placeholder {
color: #999;
}
}
button {
width: 141px;
height: 33px;
margin-top: 13px;
text-align: center;
line-height: 33px;
background: #ccced0;
color: #fff;
-webkit-appearance: none;
outline: none;
border: none;
border-radius: 16px;
font-size: 15px;
&.active{
background: #09f;
}
}
}
.iconfont{
position: absolute;
bottom: -50px;
left: 50%;
transform: translateX(-50%);
font-size: 33px;
color: #fff;
}
}
......@@ -46,6 +46,16 @@ class Live extends Component {
})
}
toLogin = () => {
const {history} = this.props
if (!getParam('version')) {
history.push('/passport')
} else {
SendMessageToApp("toLogin")
}
}
toLiveRoom = id => {
const {history, isLogin} = this.props
var _czc = _czc || []
......@@ -78,9 +88,9 @@ class Live extends Component {
}
makeSubscribe = id => {
const {user, history} = this.props
const {user} = this.props
if (user.hasError) {
history.push('/passport/login')
this.toLogin()
}
var name = '直播间id=' + id
......@@ -114,14 +124,15 @@ class Live extends Component {
})
}
})
} else {
} else if(data.errno == 4030 || data.errno == 4040){
}else {
Toast.info(data.msg, 2, null, false)
}
})
}
render() {
const {tabs, lives, today} = this.state
const {tabs, lives, todayIndex} = this.state
return (
<div id={'live'}>
<div className="title">
......@@ -131,14 +142,14 @@ class Live extends Component {
</div>
<div className="live-container">
{
today !== '' &&
todayIndex !== '' &&
<Tabs
tabs={tabs}
tabBarBackgroundColor={'transparent'}
tabBarActiveTextColor={'#5600DF'}
tabBarInactiveTextColor={'#FFF604'}
tabBarUnderlineStyle={{display: 'none'}}
initialPage={today}
initialPage={todayIndex}
swipeable={false}
>
{
......
......@@ -72,7 +72,7 @@ class BlessingRank extends Component {
<dl className="rank__table-header">
<dd className="rank__table-column">排名</dd>
<dd className="rank__table-column">用户</dd>
<dd className="rank__table-column">成绩</dd>
<dd className="rank__table-column">分数</dd>
<dd className="rank__table-column">奖品</dd>
</dl>
{
......
......@@ -30,7 +30,8 @@ class Passport extends Component {
const {location} = props
const {pathname, search, hash} = location
const from = location.state && location.state.from || {pathname: pathname, search: search, hash: hash}
this.redirectURL = window.location.origin + from.pathname + from.search + from.hash
const referrer = document.referrer
this.redirectURL = referrer ? referrer : window.location.origin + from.pathname + from.search + from.hash
this.state = {
loginWays: [
{
......
......@@ -32,7 +32,8 @@ class Login extends Component {
search: window.location.search,
hash: ''
};
const redirectURI = window.location.origin + from.pathname + from.search + from.hash;
const referrer = document.referrer
const redirectURI = referrer ? referrer : window.location.origin + from.pathname + from.search + from.hash;
switch (method) {
case '账号登录':
......
......@@ -182,6 +182,10 @@ export default [
component: loadable(() => import(/* webpackChunkName: 'blessing-preheat' */'@/components/blessingPreheat/index'))
},
{
path: '/blessingGetPrize',
component: loadable(() => import(/* webpackChunkName: 'blessing-getPrize' */'@/components/blessingGetPrize/index'))
},
{
path: '/prize-winner-list',
component: loadable(() => import(/* webpackChunkName: 'prize-winner-list' */'@/components/activity/prize-winner-list'))
},
......
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