Commit 128e59bd by zhanghaozhe

限时免费

parent bee07508
...@@ -4,6 +4,7 @@ import './index.scss' ...@@ -4,6 +4,7 @@ import './index.scss'
import { HeaderBar } from "@common/index" import { HeaderBar } from "@common/index"
import { WhiteSpace, Toast } from "antd-mobile"; import { WhiteSpace, Toast } from "antd-mobile";
import VList from '@/common/v-list-base' import VList from '@/common/v-list-base'
import { Popup } from "@common/index"
import WithFullSize from "@/HOCs/WithFullSize" import WithFullSize from "@/HOCs/WithFullSize"
function showToast(msg) { function showToast(msg) {
...@@ -61,6 +62,26 @@ class LimitFree extends Component { ...@@ -61,6 +62,26 @@ class LimitFree extends Component {
} }
} }
getCourse = id => {
//todo 联调
const instance = Popup({
className: 'get-course-popup',
closable: false,
clickMaskClose: false,
title: <div>
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/time_limited_free/M/check.png" alt=""/>
<div>课程有效期7天,快去学习吧~</div>
</div>,
content: <div className={'btns'}>
<button onClick={() => {
instance.close()
}}>知道了
</button>
<button>立即学习</button>
</div>
})
}
render() { render() {
const {tab, courses, navItemStyle, tabActiveIndex} = this.state const {tab, courses, navItemStyle, tabActiveIndex} = this.state
return ( return (
...@@ -107,6 +128,7 @@ class LimitFree extends Component { ...@@ -107,6 +128,7 @@ class LimitFree extends Component {
* course_status: * course_status:
* 0未领取 1已领取未过期 2 已领取已过期 3 正常已购买 * 0未领取 1已领取未过期 2 已领取已过期 3 正常已购买
* */ * */
//todo 状态2
let des, bottom let des, bottom
switch (item.course_status) { switch (item.course_status) {
case 0: case 0:
...@@ -117,7 +139,7 @@ class LimitFree extends Component { ...@@ -117,7 +139,7 @@ class LimitFree extends Component {
bottom = <div className={'bottom'}> bottom = <div className={'bottom'}>
<span className={'red'}>限时免费</span> <span className={'red'}>限时免费</span>
<span className={'origin-price'}>¥{item.price0}</span> <span className={'origin-price'}>¥{item.price0}</span>
<button>免费领取</button> <button onClick={this.getCourse.bind(this, item.course_id)}>免费领取</button>
</div> </div>
break break
case 1: case 1:
......
...@@ -173,4 +173,49 @@ ...@@ -173,4 +173,49 @@
color: #AAA; color: #AAA;
text-align: center; text-align: center;
} }
}
.get-course-popup {
top: 210px !important;
padding-bottom: 0 !important;
padding-left: 0 !important;
padding-right: 0 !important;
.title {
text-align: center;
margin-bottom: 30px;
img {
width: 30px;
height: 30px;
}
div {
font-size: 14px;
color: #525C65;
}
}
.btns {
border-top: 1px solid #DDD;
display: flex;
height: 40px;
button {
-webkit-appearance: none;
width: 50%;
border: none;
outline: none;
color: #333;
background: #fff;
border-radius: 0 0 5px 5px;
}
& button:first-child {
border-right: 1px solid #DDD;
}
& button:last-child{
color: #09f;
}
}
} }
\ No newline at end of file
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