FIXBUG
This commit is contained in:
parent
0689181985
commit
f0c19a16ce
2
App.vue
2
App.vue
@ -1,5 +1,7 @@
|
||||
<script>
|
||||
import pageAnimation from './components/page-animation'
|
||||
export default {
|
||||
mixins: [pageAnimation],
|
||||
onLaunch: function() {
|
||||
console.log('App Launch')
|
||||
},
|
||||
|
28
components/page-animation/index.css
Normal file
28
components/page-animation/index.css
Normal file
@ -0,0 +1,28 @@
|
||||
/* #ifdef H5 */
|
||||
uni-page {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
uni-page.animation-before {
|
||||
/* 在页面上使用 transform 会导致页面内的 fixed 定位渲染为 absolute,需要在动画完成后移除 */
|
||||
transform: translateY(20px);
|
||||
}
|
||||
|
||||
uni-page.animation-leave {
|
||||
transition: all .3s ease;
|
||||
}
|
||||
|
||||
uni-page.animation-enter {
|
||||
transition: all .3s ease;
|
||||
}
|
||||
|
||||
uni-page.animation-show {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
uni-page.animation-after {
|
||||
/* 在页面上使用 transform 会导致页面内的 fixed 定位渲染为 absolute,需要在动画完成后移除 */
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
/* #endif */
|
37
components/page-animation/index.vue
Normal file
37
components/page-animation/index.vue
Normal file
@ -0,0 +1,37 @@
|
||||
<script>
|
||||
import './index.css'
|
||||
export default {
|
||||
// #ifdef H5
|
||||
onLaunch: function() {
|
||||
this.show()
|
||||
this.$router.beforeEach((to, from, next) => {
|
||||
this.hide(next)
|
||||
})
|
||||
this.$router.afterEach(() => {
|
||||
setTimeout(this.show, 50)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
hide(callback) {
|
||||
const classList = document.querySelector('uni-page').classList
|
||||
classList.add('animation-before', 'animation-leave')
|
||||
classList.remove('animation-show')
|
||||
setTimeout(() => {
|
||||
classList.remove('animation-before', 'animation-leave')
|
||||
callback && callback()
|
||||
}, 300)
|
||||
},
|
||||
show() {
|
||||
const classList = document.querySelector('uni-page').classList
|
||||
classList.add('animation-before')
|
||||
setTimeout(() => {
|
||||
classList.add('animation-enter', 'animation-after', 'animation-show')
|
||||
setTimeout(() => {
|
||||
classList.remove('animation-before', 'animation-after', 'animation-enter')
|
||||
}, 300)
|
||||
}, 20)
|
||||
}
|
||||
},
|
||||
// #endif
|
||||
}
|
||||
</script>
|
@ -4,7 +4,7 @@
|
||||
*/
|
||||
export default {
|
||||
config: {
|
||||
baseUrl: "http://shop-test.szjixun.cn",
|
||||
baseUrl: "https://shop.szjixun.cn",
|
||||
// baseUrl: "http://114.218.158.24:9022",
|
||||
header: {
|
||||
"Content-Type": "application/json;charset=UTF-8",
|
||||
|
@ -145,6 +145,13 @@ page {
|
||||
.name {
|
||||
font-size: 16px;
|
||||
color: #000000;
|
||||
// 超出一行显示省略号
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
|
||||
}
|
||||
.intro {
|
||||
font-size: 14px;
|
||||
|
Loading…
Reference in New Issue
Block a user