Commit 9e087fdf by xuzhenghua

碎片

parents 2858b903 065cd925
......@@ -57,6 +57,7 @@
"qs": "^6.7.0",
"react": "^16.8.6",
"react-app-polyfill": "^0.2.2",
"react-copy-to-clipboard": "^5.0.1",
"react-dev-utils": "^8.0.0",
"react-dom": "^16.8.6",
"react-infinite-scroller": "^1.2.4",
......
......@@ -16,6 +16,8 @@ import { getParam, http, browser, wxShare } from "@/utils"
import { Toast } from 'antd-mobile'
import { bindActionCreators } from "redux";
import RedPacket from './redPacket';
class Detail extends Component {
courseId
......@@ -42,6 +44,7 @@ class Detail extends Component {
nowPrice: 0,
laterPrice: 0,
isPdd: 0, // 是否是拼团课程 控制首次单集购买后的 全集购买 接口: 拼团课程走拼团接口,否则直接走购买接口
isRedPacket: true
}
}
......@@ -57,6 +60,27 @@ class Detail extends Component {
if (browser.isWeixin) {
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) {
......@@ -402,7 +426,11 @@ class Detail extends Component {
}
render() {
<<<<<<< HEAD
const {course: {course_info = {}}, barInfo, singleBox, singleType} = this.state;
=======
const { course: { course_info={} }, barInfo, singleBox, singleType, isRedPacket } = this.state;
>>>>>>> 065cd9254ee2ef96b11c0c8966485b5deb121f6c
let courseInfo = '',
service = '',
number = 0,
......@@ -476,6 +504,7 @@ class Detail extends Component {
</div>
}
<<<<<<< HEAD
{/*vip课程显示*/}
{
course_info.vip_range &&
......@@ -497,6 +526,16 @@ class Detail extends Component {
})
}
</p>
=======
{/*vip课程显示*/}
{
course_info.vip_range &&
<div className="vip">
<p>已开通年会员:{course_info.vip_range}</p>
<p>年会员QQ群:{course_info.course_qq},加群请备注您的学号:{course_info.uid}</p>
>>>>>>> 065cd9254ee2ef96b11c0c8966485b5deb121f6c
</div>
{/*试听弹窗*/}
......@@ -540,6 +579,7 @@ class Detail extends Component {
<ShareRank courseInfo={course_info}/>
}
<<<<<<< HEAD
{/**
* 拼团
* is_aist: 是否AI特训营
......@@ -554,6 +594,21 @@ class Detail extends Component {
invitedFriends={this.invitedFriends}
/>
}
=======
{/* 红包 */}
{
isRedPacket &&
<RedPacket
history={this.props.history}
/>
}
{/*分享赚钱*/}
{
course_info.is_dist &&
<ShareRank courseInfo={course_info} />
}
>>>>>>> 065cd9254ee2ef96b11c0c8966485b5deb121f6c
{/*砍价*/}
{
......
......@@ -3056,6 +3056,13 @@ copy-descriptor@^0.1.0:
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
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:
version "3.0.1"
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:
raf "3.4.1"
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:
version "8.0.0"
resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-8.0.0.tgz#7c5b227a45a32ea8ff7fbc318f336cf9e2c6e34c"
......@@ -11046,6 +11061,11 @@ to-regex@^3.0.1, to-regex@^3.0.2:
regex-not "^1.0.2"
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:
version "2.0.2"
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