|
@@ -1,21 +1,25 @@
|
|
<template>
|
|
<template>
|
|
<!-- 我的钢瓶 -->
|
|
<!-- 我的钢瓶 -->
|
|
- <view class="card_information">
|
|
|
|
- <view class="head_mine_title">我的钢瓶</view>
|
|
|
|
- <view style="width: 100%;">
|
|
|
|
- <u-tabs :list="bottleList" lineWidth="40" :scrollable="false" @click="bottleClick"></u-tabs>
|
|
|
|
|
|
+ <view>
|
|
|
|
+ <view class="head_sticky">
|
|
|
|
+ <view class="head_mine_title">我的钢瓶</view>
|
|
|
|
+ <view style="width: 100%;">
|
|
|
|
+ <u-tabs :list="bottleList" lineWidth="40" :scrollable="false" @click="bottleClick"></u-tabs>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <!-- 在这里放置可滚动的内容 -->
|
|
<view style="width: 100%;" v-if="list.length > 0">
|
|
<view style="width: 100%;" v-if="list.length > 0">
|
|
<view class="card_dinay" v-for="(item,index) in list" :key="index">
|
|
<view class="card_dinay" v-for="(item,index) in list" :key="index">
|
|
<view style="display: flex;align-items: center;">
|
|
<view style="display: flex;align-items: center;">
|
|
<view class="item_current">{{index + 1}}</view>
|
|
<view class="item_current">{{index + 1}}</view>
|
|
<view class="item_title1">{{item.inner_code}}</view>
|
|
<view class="item_title1">{{item.inner_code}}</view>
|
|
</view>
|
|
</view>
|
|
- <view class="iconfont icon-yehuaqiping icon_cylinder"></view>
|
|
|
|
|
|
+ <view class="iconfont icon-yehuaqiping icon_cylinder" :style="{color:getColor()}"></view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view style="width: 100%;height: 150rpx;"></view>
|
|
</view>
|
|
</view>
|
|
<view class="empty_information" v-else>
|
|
<view class="empty_information" v-else>
|
|
- <u-empty mode="message"></u-empty>
|
|
|
|
|
|
+ <u-empty mode="list" text="暂无钢瓶"></u-empty>
|
|
</view>
|
|
</view>
|
|
<view class="card_button_bottom">
|
|
<view class="card_button_bottom">
|
|
<view class="bottom_btn_flex">
|
|
<view class="bottom_btn_flex">
|
|
@@ -41,30 +45,66 @@
|
|
name: '不合格瓶区'
|
|
name: '不合格瓶区'
|
|
}],
|
|
}],
|
|
current: 1,
|
|
current: 1,
|
|
|
|
+ Pagination: {
|
|
|
|
+ PageIndex: 1,
|
|
|
|
+ PageSize: 20,
|
|
|
|
+ Total: 0,
|
|
|
|
+ },
|
|
|
|
+ loadingMore: true,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
uni.$on('refresh', () => {
|
|
uni.$on('refresh', () => {
|
|
|
|
+ this.list = []
|
|
|
|
+ this.Pagination.PageIndex = 1
|
|
this.getList()
|
|
this.getList()
|
|
})
|
|
})
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 触底事件
|
|
|
|
+ bottomingEvent() {
|
|
|
|
+ if (!this.loadingMore) {
|
|
|
|
+ this.getList()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
bottleClick(value) {
|
|
bottleClick(value) {
|
|
this.current = value.index + 1
|
|
this.current = value.index + 1
|
|
|
|
+ this.Pagination.PageIndex = 1
|
|
this.list = []
|
|
this.list = []
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
// 获取列表
|
|
// 获取列表
|
|
getList() {
|
|
getList() {
|
|
|
|
+ this.loadingMore = true;
|
|
this.$api.get('/api/gas-cylinder-status', {
|
|
this.$api.get('/api/gas-cylinder-status', {
|
|
|
|
+ page: this.Pagination.PageIndex,
|
|
|
|
+ pageSize: this.Pagination.PageSize,
|
|
status: this.current,
|
|
status: this.current,
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
- this.list = res.data.list
|
|
|
|
|
|
+ const data = res.data.list
|
|
|
|
+ if (this.loadingMore == true && data) {
|
|
|
|
+ this.list = this.list.concat(data);
|
|
|
|
+ }
|
|
|
|
+ if (data.length < this.Pagination.PageSize) {
|
|
|
|
+ this.loadingMore = true
|
|
|
|
+ } else {
|
|
|
|
+ this.loadingMore = false
|
|
|
|
+ this.Pagination.PageIndex++
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ getColor() {
|
|
|
|
+ if (this.current == 1) {
|
|
|
|
+ return '#19be6b'
|
|
|
|
+ } else if (this.current == 2) {
|
|
|
|
+ return '#ff9900'
|
|
|
|
+ } else if (this.current == 3) {
|
|
|
|
+ return '#fa3534'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 添加钢瓶
|
|
// 添加钢瓶
|
|
addCylinder() {
|
|
addCylinder() {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -83,15 +123,22 @@
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.head_mine_title {
|
|
.head_mine_title {
|
|
- margin: 20rpx;
|
|
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ padding-top: 20rpx;
|
|
|
|
+ font-size: 36rpx;
|
|
|
|
+ font-weight: 600;
|
|
}
|
|
}
|
|
|
|
|
|
- .card_information {
|
|
|
|
|
|
+ .head_sticky {
|
|
|
|
+ position: -webkit-sticky;
|
|
|
|
+ position: sticky;
|
|
|
|
+ top: 0;
|
|
|
|
+ /* 设置吸顶的位置 */
|
|
|
|
+ background: #fff;
|
|
|
|
+ z-index: 1000;
|
|
padding-top: var(--status-bar-height);
|
|
padding-top: var(--status-bar-height);
|
|
- margin: 0rpx 20rpx;
|
|
|
|
- display: flex;
|
|
|
|
- flex-direction: column;
|
|
|
|
- align-items: center;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
.card_dinay {
|
|
.card_dinay {
|
|
@@ -105,7 +152,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
.item_current {
|
|
.item_current {
|
|
- width: 40rpx;
|
|
|
|
|
|
+ min-width: 40rpx;
|
|
color: #82848a;
|
|
color: #82848a;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -118,19 +165,21 @@
|
|
}
|
|
}
|
|
|
|
|
|
.card_button_bottom {
|
|
.card_button_bottom {
|
|
- position: absolute;
|
|
|
|
|
|
+ position: fixed;
|
|
bottom: 20rpx;
|
|
bottom: 20rpx;
|
|
left: 0;
|
|
left: 0;
|
|
right: 0;
|
|
right: 0;
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
- margin-bottom: 100rpx;
|
|
|
|
|
|
+ height: 120rpx;
|
|
|
|
+ margin-bottom: 80rpx;
|
|
padding-bottom: constant(safe-area-inset-bottom); //兼容 IOS<11.2
|
|
padding-bottom: constant(safe-area-inset-bottom); //兼容 IOS<11.2
|
|
padding-bottom: env(safe-area-inset-bottom); //兼容 IOS>11.2
|
|
padding-bottom: env(safe-area-inset-bottom); //兼容 IOS>11.2
|
|
display: flex;
|
|
display: flex;
|
|
- align-items: center;
|
|
|
|
|
|
+ align-items: flex-start;
|
|
}
|
|
}
|
|
|
|
|
|
.bottom_btn_flex {
|
|
.bottom_btn_flex {
|
|
|
|
+ margin-top: 20rpx;
|
|
flex: 1;
|
|
flex: 1;
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
@@ -144,4 +193,8 @@
|
|
color: #fff;
|
|
color: #fff;
|
|
border-radius: 10rpx;
|
|
border-radius: 10rpx;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .empty_information {
|
|
|
|
+ margin-top: 30%;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|