Commit 52bf5362 by zhanghaozhe

修改全局入口关闭功能

parent e63db1bc
...@@ -7004,11 +7004,6 @@ ...@@ -7004,11 +7004,6 @@
"pify": "^3.0.0" "pify": "^3.0.0"
} }
}, },
"hammerjs": {
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz",
"integrity": "sha1-BO93hiz/K7edMPdpIJWTAiK/YPE="
},
"handle-thing": { "handle-thing": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.0.tgz", "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.0.tgz",
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
"file-loader": "2.0.0", "file-loader": "2.0.0",
"formik": "^1.5.8", "formik": "^1.5.8",
"fs-extra": "7.0.1", "fs-extra": "7.0.1",
"hammerjs": "^2.0.8",
"html-webpack-plugin": "4.0.0-alpha.2", "html-webpack-plugin": "4.0.0-alpha.2",
"html2canvas": "^1.0.0-rc.5", "html2canvas": "^1.0.0-rc.5",
"http-proxy-middleware": "^0.19.1", "http-proxy-middleware": "^0.19.1",
......
...@@ -10,7 +10,6 @@ import { getParam, http, browser } from "@/utils" ...@@ -10,7 +10,6 @@ import { getParam, http, browser } from "@/utils"
import { Toast } from "antd-mobile" import { Toast } from "antd-mobile"
import { addDays } from 'date-fns' import { addDays } from 'date-fns'
import stringify from 'json-stringify-safe' import stringify from 'json-stringify-safe'
import Hammer from 'hammerjs'
//拦截ajax请求,返回mock数据 //拦截ajax请求,返回mock数据
...@@ -31,7 +30,6 @@ class App extends Component { ...@@ -31,7 +30,6 @@ class App extends Component {
isShowActivityEntry: 0, isShowActivityEntry: 0,
isShowChannel: 0, isShowChannel: 0,
} }
this.globalEntry = null
} }
static displayName = 'App' static displayName = 'App'
...@@ -117,8 +115,6 @@ class App extends Component { ...@@ -117,8 +115,6 @@ class App extends Component {
this.setState({ this.setState({
isShowActivityEntry: data.treasure_stage, isShowActivityEntry: data.treasure_stage,
isShowChannel: data.is_show_site_window_by_channel, isShowChannel: data.is_show_site_window_by_channel,
}, () => {
data.treasure_stage && this.bindGlobalEntry()
}) })
window.sessionStorage.setItem('isShowSiteWindowByChannel', data.is_show_site_window_by_channel) window.sessionStorage.setItem('isShowSiteWindowByChannel', data.is_show_site_window_by_channel)
...@@ -311,34 +307,6 @@ class App extends Component { ...@@ -311,34 +307,6 @@ class App extends Component {
} }
} }
bindGlobalEntry = () => {
if (!this.globalEntry) {
return
}
const mc = new Hammer(this.globalEntry)
const {history} = this.props
const _this = this
const entryWidth = this.globalEntry.offsetWidth
const velocityThreshold = 0.4
mc.on('panright tap panend', function (e) {
if (e.type === 'tap') {
history.push('/box/boxActive')
} else if (e.type === 'panright') {
_this.globalEntry.style.transform = `translateX(${e.deltaX}px)`
} else {
if (e.deltaX > entryWidth / 2 || e.velocityX > velocityThreshold) {
_this.globalEntry.style.transition = `.2s`
_this.globalEntry.style.transform = `translateX(${entryWidth + 10}px)`
_this.closeGlobalEntry()
} else {
_this.globalEntry.style.transition = `.2s`
_this.globalEntry.style.transform = `translateX(0px)`
}
}
})
}
closeGlobalEntry = () => { closeGlobalEntry = () => {
localStorage.setItem('globalEntryClosedTime', Date.now().toString()) localStorage.setItem('globalEntryClosedTime', Date.now().toString())
this.setState({ this.setState({
...@@ -364,11 +332,12 @@ class App extends Component { ...@@ -364,11 +332,12 @@ class App extends Component {
<Routes/> <Routes/>
{ {
!!this.state.isShowActivityEntry && !!this.state.isShowChannel && !!this.state.isShowActivityEntry && !!this.state.isShowChannel &&
<div className="year19-index" ref={el => this.globalEntry = el} onTransitionEnd={() => { <div className="year19-index">
this.globalEntry.style.transition = '' <i className={'iconfont iconiconfront-2'} onClick={this.closeGlobalEntry}></i>
}}> <Link to={'/box/boxActive'}>
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/treasure-active/m/global-entry.png" <img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/treasure-active/m/global-entry.png"
alt=""/> alt=""/>
</Link>
</div> </div>
} }
</> </>
......
...@@ -493,6 +493,7 @@ input[type="radio"]:checked:before { ...@@ -493,6 +493,7 @@ input[type="radio"]:checked:before {
color: #555555; color: #555555;
font-weight: 300; font-weight: 300;
} }
.directions-div { .directions-div {
font-size: 13px; font-size: 13px;
line-height: 24px; line-height: 24px;
...@@ -501,14 +502,13 @@ input[type="radio"]:checked:before { ...@@ -501,14 +502,13 @@ input[type="radio"]:checked:before {
} }
.am-modal-button-group-h {
.am-modal-button-group-h{
.am-modal-button { .am-modal-button {
font-size: 15px; font-size: 15px;
} }
} }
.am-modal-alert-content, .am-modal-propmt-content{ .am-modal-alert-content, .am-modal-propmt-content {
color: #333; color: #333;
font-size: 15px; font-size: 15px;
} }
...@@ -522,8 +522,18 @@ input[type="radio"]:checked:before { ...@@ -522,8 +522,18 @@ input[type="radio"]:checked:before {
margin-top: -35px; margin-top: -35px;
z-index: 99; z-index: 99;
font-size: 12px; font-size: 12px;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.iconfont {
$size: 26px;
position: absolute;
top: -($size + 8px);
right: 0;
font-size: $size;
color: #5a5a5a;
}
} }
\ 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