订单也调整

This commit is contained in:
Double-_-Z 2025-07-23 00:15:17 +08:00
parent 149838c727
commit f36da921c8
4 changed files with 75 additions and 38 deletions

View File

@ -1,6 +1,7 @@
<template> <template>
<view class="mobile-index"> <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 --> <!-- #ifdef MP-WEIXIN -->
<Order ref="pageRef" :topLevel="topLevel" v-if="current===0" /> <Order ref="pageRef" :topLevel="topLevel" v-if="current===0" />
<Equipment ref="pageRef" :topLevel="topLevel" v-if="current===1" /> <Equipment ref="pageRef" :topLevel="topLevel" v-if="current===1" />
@ -11,7 +12,7 @@
<component ref="pageRef" :topLevel="topLevel" :is="refs[current]" <component ref="pageRef" :topLevel="topLevel" :is="refs[current]"
:isLogin="isLogin" @userLogOut="isLogin=''"></component> :isLogin="isLogin" @userLogOut="isLogin=''"></component>
<!-- #endif --> <!-- #endif -->
</view> </scroll-view>
<view class="navigation"> <view class="navigation">
<view @click="changeCurrent(index)" class="nav-item" <view @click="changeCurrent(index)" class="nav-item"
:class="current===index?'nav-item-selected':''" :class="current===index?'nav-item-selected':''"
@ -21,8 +22,11 @@
</view> </view>
</view> </view>
<Loading :show="loading" /> <Loading :show="loading" />
<u-back-top :scrollTop="scrollTop" zIndex="100" :duration="500" <view @click="goTop">
:iconStyle="{ color: '#fff' }" :customStyle="{background: 'linear-gradient(180deg, #96fe11 0%, #f0fdbf 100%)',filter: 'opacity(0.96)'}"></u-back-top> <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> </view>
</template> </template>
@ -67,18 +71,13 @@ export default {
topLevel: 0,// topLevel: 0,//
// //
scrollTop: 0, scrollTop: 0,
oldScrollTop: 0,
// refs // refs
refs: ['order','equipment','route','my'], refs: ['order','equipment','route','my'],
// //
isLogin: this.$store.state.vuex_token, 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(){ onLoad(){
let index = uni.getStorageSync('current'); let index = uni.getStorageSync('current');
this.current = index?index:0; this.current = index?index:0;
@ -86,33 +85,21 @@ export default {
this.changeCurrent(this.current); this.changeCurrent(this.current);
}, },
onShow(){ onShow(){
// // //
let index = uni.getStorageSync('current'); // let index = uni.getStorageSync('current');
this.current = index?index:0; // this.current = index?index:0;
this.isLogin = this.$store.state.vuex_token; // this.isLogin = this.$store.state.vuex_token;
if(this.current === 3){ // if(this.current === 3){
this.changeCurrent(this.current); // this.changeCurrent(this.current);
} // }
},
//
onPullDownRefresh(){
try{
this.changeCurrent(this.current);
}catch(e){}
finally{
uni.stopPullDownRefresh();
}
},
//
onReachBottom(){
}, },
methods:{ methods:{
// //
changeCurrent(index){ changeCurrent(index){
this.current = index; this.current = index;
uni.setStorageSync('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'; const url = '/aircraft/server/index/index';
uni.navigateTo({ uni.navigateTo({
url: `/aircraft/server/my/child_pages/login?nextUrl=${url}` url: `/aircraft/server/my/child_pages/login?nextUrl=${url}`
@ -123,6 +110,24 @@ export default {
this.$refs.pageRef.init(); 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> </script>
@ -134,9 +139,9 @@ export default {
min-height: 100vh; min-height: 100vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-color: #F5F5F5;
height: 100%; height: 100%;
.upage{ .upage{
background-color: #F5F5F5;
width: 100%; width: 100%;
height: calc(100vh - 114rpx - constant(safe-area-inset-bottom)); height: calc(100vh - 114rpx - constant(safe-area-inset-bottom));
height: calc(100vh - 114rpx - env(safe-area-inset-bottom)); height: calc(100vh - 114rpx - env(safe-area-inset-bottom));
@ -157,7 +162,7 @@ export default {
align-items: center; align-items: center;
border-top: 2rpx solid #E6E6E6; border-top: 2rpx solid #E6E6E6;
.nav-item-selected{ .nav-item-selected{
color: #333333; color: #333333 !important;
} }
.nav-item{ .nav-item{
font-family: Source Han Sans SC; font-family: Source Han Sans SC;

View File

@ -1,14 +1,34 @@
<template> <template>
<div class="aircraft-order"> <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> <u-toast ref="uToast"></u-toast>
</div> </div>
</template> </template>
<script> <script>
import configService from '@/common/config.service.js';
export default { export default {
// #ifdef MP
options: {
styleIsolation: 'shared'
},
// #endif
props: {
topLevel:{
type: Number,
default: 0
},
},
data(){ data(){
return { return {
fileUrl: configService.fileUrl + 'aerocraft/order/',//
//
banner: 'banner.png',
} }
}, },
@ -23,6 +43,19 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.aircraft-order{ .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> </style>

View File

@ -35,6 +35,5 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.aircraft-route{ .aircraft-route{
min-height: 100vh;
} }
</style> </style>

View File

@ -45,8 +45,8 @@
"pages": [{ "pages": [{
"path": "index/index", "path": "index/index",
"style": { "style": {
"navigationBarTitleText": "飞行运载系统", "navigationBarTitleText": "飞行运载系统"
"enablePullDownRefresh": true // "enablePullDownRefresh": true
} }
}, },
{ {