Commit 046da9f4 by FE

redpacket function

parent 8f2dcc1e
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
"qs": "^6.7.0", "qs": "^6.7.0",
"react": "^16.8.6", "react": "^16.8.6",
"react-app-polyfill": "^0.2.2", "react-app-polyfill": "^0.2.2",
"react-copy-to-clipboard": "^5.0.1",
"react-dev-utils": "^8.0.0", "react-dev-utils": "^8.0.0",
"react-dom": "^16.8.6", "react-dom": "^16.8.6",
"react-infinite-scroller": "^1.2.4", "react-infinite-scroller": "^1.2.4",
......
...@@ -16,6 +16,8 @@ import {getParam, http, browser,wxShare} from "@/utils" ...@@ -16,6 +16,8 @@ import {getParam, http, browser,wxShare} from "@/utils"
import {Toast} from 'antd-mobile' import {Toast} from 'antd-mobile'
import {compose, bindActionCreators} from "redux"; import {compose, bindActionCreators} from "redux";
import RedPacket from './redPacket';
class Detail extends Component { class Detail extends Component {
courseId courseId
...@@ -42,6 +44,7 @@ class Detail extends Component { ...@@ -42,6 +44,7 @@ class Detail extends Component {
nowPrice: 0, nowPrice: 0,
laterPrice: 0, laterPrice: 0,
isPdd: 0, // 是否是拼团课程 控制首次单集购买后的 全集购买 接口: 拼团课程走拼团接口,否则直接走购买接口 isPdd: 0, // 是否是拼团课程 控制首次单集购买后的 全集购买 接口: 拼团课程走拼团接口,否则直接走购买接口
isRedPacket: true
} }
} }
...@@ -57,6 +60,27 @@ class Detail extends Component { ...@@ -57,6 +60,27 @@ class Detail extends Component {
if (browser.isWeixin) { if (browser.isWeixin) {
this.isweixinPay() this.isweixinPay()
} }
this.judgeIsRedPacket();
// 红包链接进入详情也
if(getParam('share_code')) {
this.setState({
isRedPacket: true
});
}
}
// 判断时候未红包课程
judgeIsRedPacket = () => {
http.get(`${API.home}/sys/redPacket/showShareActive/${getParam('id')}`).then(res => {
const { code, data } = res.data;
if(code === 200) {
this.setState({
isRedPacket: data.is_show
});
}
})
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
...@@ -398,7 +422,7 @@ class Detail extends Component { ...@@ -398,7 +422,7 @@ class Detail extends Component {
} }
render() { render() {
const { course: { course_info={} }, barInfo, singleBox, singleType } = this.state; const { course: { course_info={} }, barInfo, singleBox, singleType, isRedPacket } = this.state;
let courseInfo = '', let courseInfo = '',
service = '', service = '',
number = 0, number = 0,
...@@ -472,6 +496,8 @@ class Detail extends Component { ...@@ -472,6 +496,8 @@ class Detail extends Component {
</div> </div>
} }
{/*vip课程显示*/} {/*vip课程显示*/}
{ {
course_info.vip_range && course_info.vip_range &&
...@@ -530,6 +556,14 @@ class Detail extends Component { ...@@ -530,6 +556,14 @@ class Detail extends Component {
{/*payCallback={this.payCallback}*/} {/*payCallback={this.payCallback}*/}
{/*weixinPay = {this.weixinPay}*/} {/*weixinPay = {this.weixinPay}*/}
{/* 红包 */}
{
isRedPacket &&
<RedPacket
history={this.props.history}
/>
}
{/*分享赚钱*/} {/*分享赚钱*/}
{ {
course_info.is_dist && course_info.is_dist &&
......
.red-packet {
display: flex;
justify-content: space-between;
align-items: center;
height: 52px;
padding: 0 12px;
border-top: 8px solid #f5f5f5;
}
.red-packet__title {
font-size: 13px;
color: #333;
}
.red-packet__button {
height: 22px;
padding: 0 9px;
border: 1px solid #FF4000;
border-radius: 11px;
box-sizing: border-box;
font-size: 12px;
color: #FF4000;
background-color: transparent;
cursor: pointer;
}
// popup
.popup-mask {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, .6);
z-index: 999;
}
.popup-mask--no {
display: flex;
align-items: center;
justify-content: center;
}
// wechat
.pupup-wechat {
position: relative;
width: 290px;
height: 102px;
margin: 65px auto;
padding: 20px 17px 0;
border-radius: 10px;
box-sizing: border-box;
background-color: #fff;
}
.popup-wechat__title {
margin: 0;
font-size: 15px;
font-weight: 400;
color: #333;
text-align: center;
line-height: 1;
}
.popup-wechat__desc {
margin: 12px 0 0;
font-size: 13px;
color: #555;
text-align: center;
line-height: 20px;
}
.popup-wechat__icon {
position: absolute;
top: -55px;
right: -28px;
width: 60px;
height: 44px;
background-image: url('./throw_icon.png');
background-size: cover;
}
// wechat--no
.popup-password {
text-align: center;
}
.popup-password__content {
width: 290px;
height: 220px;
margin: 0 auto;
padding: 20px 20px 0;
border-radius: 10px;
box-sizing: border-box;
background-color: #fff;
}
.popup-password__header {
font-size: 15px;
font-weight: 400;
color: #333;
text-align: center;
line-height: 1;
}
.popup-password__body {
height: 110px;
margin-top: 15px;
margin-bottom: 13px;
padding-top: 20px;
border-radius: 6px;
text-align: center;
background-color: #F5FBFF;
}
.popup-passowrd__info {
width: 210px;
height: 30px;
margin: 0 auto 15px;
border: 1px solid #99D6FF;
border-radius: 15px;
box-sizing: border-box;
font-size: 12px;
color: #333;
line-height: 30px;
background-color: #fff;
}
.popup-password__success {
margin: 0;
padding-top: 9px;
font-size: 13px;
color: #0099FF;
line-height: 1;
}
.popup-password__button--copy {
width: 111px;
height: 30px;
padding: 0;
border-style: none;
border-radius: 15px;
font-size: 13px;
color: #fff;
text-align: center;
line-height: 30px;
background-color: #0099FF;
cursor: pointer;
}
.popup-password__footer {
font-size: 12px;
color: #999;
text-align: center;
line-height: 16px;
}
.popup-password__button--close {
display: block;
margin-top: 25px;
font-size: 26px;
color: #fff;
}
// 拆
.popup-packet {
text-align: center;
.popup-packet__title {
padding-top: 196px;
}
}
.popup-packet__content {
position: relative;
width: 240px;
height: 300px;
background-image: url('./redb_chai_bj.png');
background-size: cover;
}
.popup-packet__content--open,
.popup-packet__content--money {
background-image: url('./redb_money_bj.png');
}
.popup-packet__content--fragment {
background-image: url('./redb_sp_bj.png');
}
.popup-packet__content--late {
padding-top: 40px;
background-image: url('./hb_bj.png');
.popup-packet__label {
font-size: 18px;
color: #E67600;
}
.popup-packet__value {
margin-top: 7px;
font-size: 14px;
color: #666;
line-height: 19px;
}
.popup-packet__button--bundle {
margin-top: 138px;
}
}
.popup-packet__content--open,
.popup-packet__content--money,
.popup-packet__content--fragment {
.popup-packet__label {
padding-top: 20px;
}
.popup-packet__value {
padding-top: 10px;
}
.popup-packet__tip {
margin-top: 107px;
}
.popup-packet__button--bundle {
margin-top: 28px;
}
}
.popup-packet__title {
margin: 0;
font-size: 15px;
color: #F9F8F1;
text-align: center;
line-height: 1;
}
.popup-packet__label {
font-size: 15px;
font-weight: 400;
color: #EAA40B;
text-align: center;
line-height: 1;
}
.popup-packet__value {
font-size: 28px;
color: #FF3131;
line-height: 1;
}
.popup-packet__value--unit {
padding-left: 1px;
font-size: 12px;
color: #FF3131;
}
.popup-packet__tip {
margin: 0;
padding: 0 25px;
font-size: 12px;
color: #F9F8F1;
text-align: center;
line-height: 17px;
}
.popup-packet__button--split {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding: 0;
border-style: none;
box-sizing: border-box;
background-color: transparent;
cursor: pointer;
outline: none;
}
.popup-packet__button--bundle {
padding: 0;
width: 161px;
height: 30px;
border-style: none;
border-radius: 15px;
font-size: 13px;
color: #2B2B2B;
background-color: #F9DB4A;
cursor: pointer;
&[data-status="done"] {
color: #fff;
background-color: #ABABAB;
}
&[data-status='do'] {
color: #fff;
background-color: #0099FF;
}
}
// form
.popup-form {
text-align: center;
.popup-form__title {
margin-bottom: 15px;
}
.popup-packet__button--bundle {
margin-top: 5px;
}
}
.popup-form__content {
width: 290px;
height: 257px;
padding: 20px 20px 0;
border-radius: 10px;
box-sizing: border-box;
background-color: #fff;
}
.popup-form__title {
font-size: 15px;
font-weight: 400;
color: #333;
line-height: 1;
}
.popup-form__item {
display: flex;
align-items: center;
justify-content: center;
height: 36px;
margin-bottom: 15px;
.popup-form__ipt {
flex: 1;
}
.popup-form__button--code {
margin-left: 10px;
}
}
.popup-form__button--num {
display: block;
position: relative;
height: 36px;
padding: 0 8px;
border: 1px solid #99D6FF;
border-right-style: none;
border-radius: 6px 0 0 6px;
box-sizing: border-box;
font-size: 14px;
color: #333;
line-height: 36px;
&::after {
display: block;
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 1px;
height: 14px;
margin: auto 0;
background-color: #AAAAAA;
}
.iconfont {
font-size: 12px;
color: #333;
}
}
.popup-form__ipt {
height: 36px;
padding: 0 8px;
border: 1px solid #99D6FF;
border-radius: 6px;
box-sizing: border-box;
font-size: 12px;
color: #999;
line-height: 36px;
outline: none;
&[data-bdrs="0 6px 6px 0"] {
border-radius: 0 6px 6px 0;
}
&[data-type="tel"] {
border-left-style: none;
}
}
.popup-form__tip {
margin: 0;
font-size: 12px;
color: #FF3131;
.iconfont {
font-size: 15px;
color: #FF3131;
}
}
.popup-form__button--code {
width: 110px;
height: 36px;
padding: 0;
border: 1px solid #E5E5E5;
border-radius: 6px;
box-sizing: border-box;
font-size: 13px;
color: #999;
text-align: center;
line-height: 36px;
background-color: transparent;
&[data-status='do'] {
border-color: #0099FF;
color: #0099FF;
}
}
// 已领
.popup-done {
text-align: center;
.popup-done__desc {
margin-top: 30px;
}
.popup-packet__button--bundle {
margin-top: 15px;
}
}
.popup-done__content {
width: 290px;
height: 162px;
padding-top: 30px;
border-radius: 10px;
box-sizing: border-box;
background-color: #fff;
}
.popup-done__title {
margin: 0;
font-size: 18px;
font-weight: 400;
color: #333;
text-align: center;
line-height: 1;
}
.popup-done__title--overtime {
font-size: 15px;
color: #FF3131;
.iconfont {
color: #FF3131;
}
}
.popup-done__desc {
margin: 0;
font-size: 12px;
color: #999;
text-align: center;
line-height: 1;
}
// bind
.popup-bind {
text-align: center;
}
.popup-bind__content {
width: 290px;
padding-top: 20px;
padding-bottom: 18px;
border-radius: 10px;
background-color: #fff;
.popup-bind__desc {
margin-top: 10px;
}
}
.popup-bind__title {
margin: 0;
font-size: 14px;
color: #333;
text-align: center;
line-height: 1;
}
.popup-bind__desc {
margin: 0;
padding: 0 20px;
font-size: 12px;
color: #666;
text-align: left;
}
.popup-bind__list {
padding: 0 0 10px;
}
.popup-bind__account {
display: flex;
align-items: center;
height: 30px;
margin: 0 52px;
text-align: left;
&:nth-child(n+2) {
border-top: 1px solid #E5E5E5;
}
}
.popup-bind__account--name {
margin: 0;
font-size: 12px;
color: #999;
}
.icon-sina {
display: inline-block;
width: 22px;
height: 22px;
background-image: url('./sina.png');
background-size: 100% auto;
background-repeat: no-repeat;
background-position: center;
}
.icon-qq {
display: inline-block;
width: 22px;
height: 22px;
background-image: url('./qq.png');
background-size: 100% auto;
background-repeat: no-repeat;
background-position: center;
}
.popup-bind__button {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 28px;
}
.popup-bind__button--cancle {
width: 105px;
height: 30px;
border: 1px solid #0099FF;
box-sizing: border-box;
border-radius: 15px;
font-size: 14px;
color: #0099FF;
background-color: transparent;
cursor: pointer;
outline: none;
}
.popup-bind__button--confirm {
width: 105px;
height: 30px;
border-style: none;
border-radius: 15px;
box-sizing: border-box;
font-size: 14px;
color: #fff;
background-color: #0099FF;
cursor: pointer;
outline: none;
}
\ No newline at end of file
import React, { Component } from 'react'; import React, { Component } from 'react';
import './veri-code-input.scss' import './veri-code-input.scss'
import { http, api, validateEmail, validateTel } from '@/utils'; import { http, validateEmail, validateTel } from '@/utils';
import { Toast } from "antd-mobile"; import { Toast } from "antd-mobile";
import { has } from 'lodash' import { has } from 'lodash'
......
...@@ -3056,6 +3056,13 @@ copy-descriptor@^0.1.0: ...@@ -3056,6 +3056,13 @@ copy-descriptor@^0.1.0:
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=
copy-to-clipboard@^3:
version "3.2.0"
resolved "https://registry.npm.taobao.org/copy-to-clipboard/download/copy-to-clipboard-3.2.0.tgz#d2724a3ccbfed89706fac8a894872c979ac74467"
integrity sha1-0nJKPMv+2JcG+siolIcsl5rHRGc=
dependencies:
toggle-selection "^1.0.6"
core-js-compat@^3.0.0: core-js-compat@^3.0.0:
version "3.0.1" version "3.0.1"
resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.0.1.tgz#bff73ba31ca8687431b9c88f78d3362646fb76f0" resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.0.1.tgz#bff73ba31ca8687431b9c88f78d3362646fb76f0"
...@@ -9246,6 +9253,14 @@ react-app-polyfill@^0.2.2: ...@@ -9246,6 +9253,14 @@ react-app-polyfill@^0.2.2:
raf "3.4.1" raf "3.4.1"
whatwg-fetch "3.0.0" whatwg-fetch "3.0.0"
react-copy-to-clipboard@^5.0.1:
version "5.0.1"
resolved "https://registry.npm.taobao.org/react-copy-to-clipboard/download/react-copy-to-clipboard-5.0.1.tgz#8eae107bb400be73132ed3b6a7b4fb156090208e"
integrity sha1-jq4Qe7QAvnMTLtO2p7T7FWCQII4=
dependencies:
copy-to-clipboard "^3"
prop-types "^15.5.8"
react-dev-utils@^8.0.0: react-dev-utils@^8.0.0:
version "8.0.0" version "8.0.0"
resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-8.0.0.tgz#7c5b227a45a32ea8ff7fbc318f336cf9e2c6e34c" resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-8.0.0.tgz#7c5b227a45a32ea8ff7fbc318f336cf9e2c6e34c"
...@@ -9519,11 +9534,6 @@ redux-logger@^3.0.6: ...@@ -9519,11 +9534,6 @@ redux-logger@^3.0.6:
dependencies: dependencies:
deep-diff "^0.3.5" deep-diff "^0.3.5"
redux-persist@^5.10.0:
version "5.10.0"
resolved "https://registry.npm.taobao.org/redux-persist/download/redux-persist-5.10.0.tgz#5d8d802c5571e55924efc1c3a9b23575283be62b"
integrity sha1-XY2ALFVx5Vkk78HDqbI1dSg75is=
redux-thunk@^2.3.0: redux-thunk@^2.3.0:
version "2.3.0" version "2.3.0"
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622" resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"
...@@ -11043,6 +11053,11 @@ to-regex@^3.0.1, to-regex@^3.0.2: ...@@ -11043,6 +11053,11 @@ to-regex@^3.0.1, to-regex@^3.0.2:
regex-not "^1.0.2" regex-not "^1.0.2"
safe-regex "^1.1.0" safe-regex "^1.1.0"
toggle-selection@^1.0.6:
version "1.0.6"
resolved "https://registry.npm.taobao.org/toggle-selection/download/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32"
integrity sha1-bkWxJj8gF/oKzH2J14sVuL932jI=
topo@2.x.x: topo@2.x.x:
version "2.0.2" version "2.0.2"
resolved "https://registry.yarnpkg.com/topo/-/topo-2.0.2.tgz#cd5615752539057c0dc0491a621c3bc6fbe1d182" resolved "https://registry.yarnpkg.com/topo/-/topo-2.0.2.tgz#cd5615752539057c0dc0491a621c3bc6fbe1d182"
......
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