订单也调整
This commit is contained in:
parent
149838c727
commit
f36da921c8
@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<view class="mobile-index">
|
||||
<view class="u-page upage">
|
||||
<scroll-view :scroll-top="scrollTop" :scrollY="true" class="u-page upage"
|
||||
scroll-with-animation @scroll="scroll" @refresherrefresh="refresh">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<Order ref="pageRef" :topLevel="topLevel" v-if="current===0" />
|
||||
<Equipment ref="pageRef" :topLevel="topLevel" v-if="current===1" />
|
||||
@ -11,7 +12,7 @@
|
||||
<component ref="pageRef" :topLevel="topLevel" :is="refs[current]"
|
||||
:isLogin="isLogin" @userLogOut="isLogin=''"></component>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="navigation">
|
||||
<view @click="changeCurrent(index)" class="nav-item"
|
||||
:class="current===index?'nav-item-selected':''"
|
||||
@ -21,8 +22,11 @@
|
||||
</view>
|
||||
</view>
|
||||
<Loading :show="loading" />
|
||||
<u-back-top :scrollTop="scrollTop" zIndex="100" :duration="500"
|
||||
:iconStyle="{ color: '#fff' }" :customStyle="{background: 'linear-gradient(180deg, #96fe11 0%, #f0fdbf 100%)',filter: 'opacity(0.96)'}"></u-back-top>
|
||||
<view @click="goTop">
|
||||
<u-back-top :scrollTop="oldScrollTop" zIndex="100" :duration="500"
|
||||
:iconStyle="{ color: '#fff' }" :customStyle="{background: 'linear-gradient(180deg, #96fe11 0%, #f0fdbf 100%)',
|
||||
filter: 'opacity(0.96)'}"></u-back-top>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -67,18 +71,13 @@ export default {
|
||||
topLevel: 0,// 页面是否滚动到顶
|
||||
// 滚动顶部
|
||||
scrollTop: 0,
|
||||
oldScrollTop: 0,
|
||||
// refs组件列表
|
||||
refs: ['order','equipment','route','my'],
|
||||
// 登录状态
|
||||
isLogin: this.$store.state.vuex_token,
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
const level = e.scrollTop/60;
|
||||
if(level<=1) this.topLevel = level;
|
||||
else this.topLevel = 1;
|
||||
this.scrollTop = e.scrollTop;
|
||||
},
|
||||
onLoad(){
|
||||
let index = uni.getStorageSync('current');
|
||||
this.current = index?index:0;
|
||||
@ -86,33 +85,21 @@ export default {
|
||||
this.changeCurrent(this.current);
|
||||
},
|
||||
onShow(){
|
||||
// 小程序除我的页,其它不要刷新
|
||||
let index = uni.getStorageSync('current');
|
||||
this.current = index?index:0;
|
||||
this.isLogin = this.$store.state.vuex_token;
|
||||
if(this.current === 3){
|
||||
this.changeCurrent(this.current);
|
||||
}
|
||||
},
|
||||
|
||||
// 上拉刷新
|
||||
onPullDownRefresh(){
|
||||
try{
|
||||
this.changeCurrent(this.current);
|
||||
}catch(e){}
|
||||
finally{
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
},
|
||||
// 滑动到底部
|
||||
onReachBottom(){
|
||||
// // 小程序除我的页,其它不要刷新
|
||||
// let index = uni.getStorageSync('current');
|
||||
// this.current = index?index:0;
|
||||
// this.isLogin = this.$store.state.vuex_token;
|
||||
// if(this.current === 3){
|
||||
// this.changeCurrent(this.current);
|
||||
// }
|
||||
},
|
||||
methods:{
|
||||
// 切换页面
|
||||
changeCurrent(index){
|
||||
this.current = index;
|
||||
uni.setStorageSync('current',index);
|
||||
if(this.current === 1 && !this.isLogin){
|
||||
// if(this.current === 1 && !this.isLogin){
|
||||
if(!this.isLogin){
|
||||
const url = '/aircraft/server/index/index';
|
||||
uni.navigateTo({
|
||||
url: `/aircraft/server/my/child_pages/login?nextUrl=${url}`
|
||||
@ -123,6 +110,24 @@ export default {
|
||||
this.$refs.pageRef.init();
|
||||
})
|
||||
},
|
||||
// 滚动回顶部
|
||||
goTop() {
|
||||
this.scrollTop = this.oldScrollTop;
|
||||
this.$nextTick(()=>{
|
||||
this.scrollTop = 0;
|
||||
});
|
||||
},
|
||||
// 滚动监听
|
||||
scroll(e){
|
||||
const level = e.detail.scrollTop/60;
|
||||
if(level<=1) this.topLevel = level;
|
||||
else this.topLevel = 1;
|
||||
this.oldScrollTop = e.detail.scrollTop;
|
||||
},
|
||||
// 上拉刷新
|
||||
refresh(){
|
||||
this.changeCurrent(this.current);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -134,9 +139,9 @@ export default {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #F5F5F5;
|
||||
height: 100%;
|
||||
.upage{
|
||||
background-color: #F5F5F5;
|
||||
width: 100%;
|
||||
height: calc(100vh - 114rpx - constant(safe-area-inset-bottom));
|
||||
height: calc(100vh - 114rpx - env(safe-area-inset-bottom));
|
||||
@ -157,7 +162,7 @@ export default {
|
||||
align-items: center;
|
||||
border-top: 2rpx solid #E6E6E6;
|
||||
.nav-item-selected{
|
||||
color: #333333;
|
||||
color: #333333 !important;
|
||||
}
|
||||
.nav-item{
|
||||
font-family: Source Han Sans SC;
|
||||
|
@ -1,14 +1,34 @@
|
||||
<template>
|
||||
<div class="aircraft-order">
|
||||
订单
|
||||
<u-image width="100%" :src="fileUrl+banner" mode="widthFix" />
|
||||
<view class="order-list">
|
||||
<view class="order-item">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import configService from '@/common/config.service.js';
|
||||
export default {
|
||||
// #ifdef MP
|
||||
options: {
|
||||
styleIsolation: 'shared'
|
||||
},
|
||||
// #endif
|
||||
props: {
|
||||
topLevel:{
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
fileUrl: configService.fileUrl + 'aerocraft/order/',//订单页图标基础路径
|
||||
// 轮播图
|
||||
banner: 'banner.png',
|
||||
|
||||
}
|
||||
},
|
||||
@ -23,6 +43,19 @@ export default {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.aircraft-order{
|
||||
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.order-list{
|
||||
flex: 1;
|
||||
z-index: 1;
|
||||
margin-top: -30rpx;
|
||||
width: 100%;
|
||||
background-color: #F5F5F5;
|
||||
border-radius: 24rpx 16rpx 16rpx 16rpx;
|
||||
.order-item{
|
||||
border-radius: 24rpx 16rpx 16rpx 16rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -35,6 +35,5 @@ export default {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.aircraft-route{
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
@ -45,8 +45,8 @@
|
||||
"pages": [{
|
||||
"path": "index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "飞行运载系统",
|
||||
"enablePullDownRefresh": true
|
||||
"navigationBarTitleText": "飞行运载系统"
|
||||
// "enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user