Commit aa58db5b by zhoule

下掉(注释)首页弹窗

parent 73f6dc74
...@@ -3,44 +3,41 @@ import "./index.scss" ...@@ -3,44 +3,41 @@ import "./index.scss"
import { http } from "src/utils" import { http } from "src/utils"
class UserGift extends Component { class UserGift extends Component {
state = { // state = {
user_gift: "", // user_gift: "",
} // }
// componentDidMount() {
componentDidMount() { // http.get(`${API["base-api"]}/m/home/popup`).then((res) => {
http.get(`${API["base-api"]}/m/home/popup`).then((res) => { // const { errno, data } = res.data
const { errno, data } = res.data // if (errno === 200) {
if (errno === 200) { // this.setState({
this.setState({ // user_gift: data.new_user_gift.prize_img,
user_gift: data.new_user_gift.prize_img, // })
}) // }
} // })
}) // }
} // get_newerModal = () => {
// this.props.get_newerModal()
get_newerModal = () => { // }
this.props.get_newerModal() // close = () => {
} // this.props.close()
close = () => { // }
this.props.close() // render() {
} // const { user_gift } = this.state
// return (
render() { // <div className={"user-gift-popup"}>
const { user_gift } = this.state // <div className={"user-gift-bgimg"}>
return ( // <img onClick={this.get_newerModal} src={user_gift} alt="" />
<div className={"user-gift-popup"}> // <img
<div className={"user-gift-bgimg"}> // className={"close_gift_box"}
<img onClick={this.get_newerModal} src={user_gift} alt="" /> // src="https://cdn.julyedu.com/tinypng-common/close_icon.png"
<img // onClick={this.close}
className={"close_gift_box"} // alt=""
src="https://cdn.julyedu.com/tinypng-common/close_icon.png" // />
onClick={this.close} // </div>
alt="" // </div>
/> // )
</div> // }
</div>
)
}
} }
export default UserGift export default UserGift
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