Commit 52bf5362 by zhanghaozhe

修改全局入口关闭功能

parent e63db1bc
......@@ -7004,11 +7004,6 @@
"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": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.0.tgz",
......
......@@ -35,7 +35,6 @@
"file-loader": "2.0.0",
"formik": "^1.5.8",
"fs-extra": "7.0.1",
"hammerjs": "^2.0.8",
"html-webpack-plugin": "4.0.0-alpha.2",
"html2canvas": "^1.0.0-rc.5",
"http-proxy-middleware": "^0.19.1",
......
......@@ -10,7 +10,6 @@ import { getParam, http, browser } from "@/utils"
import { Toast } from "antd-mobile"
import { addDays } from 'date-fns'
import stringify from 'json-stringify-safe'
import Hammer from 'hammerjs'
//拦截ajax请求,返回mock数据
......@@ -31,7 +30,6 @@ class App extends Component {
isShowActivityEntry: 0,
isShowChannel: 0,
}
this.globalEntry = null
}
static displayName = 'App'
......@@ -117,8 +115,6 @@ class App extends Component {
this.setState({
isShowActivityEntry: data.treasure_stage,
isShowChannel: data.is_show_site_window_by_channel,
}, () => {
data.treasure_stage && this.bindGlobalEntry()
})
window.sessionStorage.setItem('isShowSiteWindowByChannel', data.is_show_site_window_by_channel)
......@@ -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 = () => {
localStorage.setItem('globalEntryClosedTime', Date.now().toString())
this.setState({
......@@ -364,11 +332,12 @@ class App extends Component {
<Routes/>
{
!!this.state.isShowActivityEntry && !!this.state.isShowChannel &&
<div className="year19-index" ref={el => this.globalEntry = el} onTransitionEnd={() => {
this.globalEntry.style.transition = ''
}}>
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/treasure-active/m/global-entry.png"
alt=""/>
<div className="year19-index">
<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"
alt=""/>
</Link>
</div>
}
</>
......
......@@ -493,6 +493,7 @@ input[type="radio"]:checked:before {
color: #555555;
font-weight: 300;
}
.directions-div {
font-size: 13px;
line-height: 24px;
......@@ -501,14 +502,13 @@ input[type="radio"]:checked:before {
}
.am-modal-button-group-h{
.am-modal-button-group-h {
.am-modal-button {
font-size: 15px;
}
}
.am-modal-alert-content, .am-modal-propmt-content{
.am-modal-alert-content, .am-modal-propmt-content {
color: #333;
font-size: 15px;
}
......@@ -522,8 +522,18 @@ input[type="radio"]:checked:before {
margin-top: -35px;
z-index: 99;
font-size: 12px;
img {
width: 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