123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <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 style="width: 100%;" v-if="list.length > 0">
- <view class="card_dinay" v-for="(item,index) in list" :key="index">
- <view style="display: flex;align-items: center;">
- <view class="item_current">{{index + 1}}</view>
- <view class="item_title1">{{item.inner_code}}</view>
- </view>
- <view class="iconfont icon-yehuaqiping icon_cylinder"></view>
- </view>
- </view>
- <view class="empty_information" v-else>
- <u-empty mode="message"></u-empty>
- </view>
- <view class="card_button_bottom">
- <view class="bottom_btn_flex">
- <view class="but_allot center_in" @click="addCylinder">添加</view>
- </view>
- <view class="bottom_btn_flex">
- <view class="but_allot center_in" @click="transferCylinders">调拨</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- list: [],
- bottleList: [{
- name: '重瓶区',
- }, {
- name: '空瓶区',
- }, {
- name: '不合格瓶区'
- }],
- current: 1,
- }
- },
- mounted() {
- uni.$on('refresh', () => {
- this.getList()
- })
- this.getList()
- },
- methods: {
- bottleClick(value) {
- this.current = value.index + 1
- this.list = []
- this.getList()
- },
- // 获取列表
- getList() {
- this.$api.get('/api/gas-cylinder-status', {
- status: this.current,
- }).then(res => {
- if (res.code == 200) {
- this.list = res.data.list
- }
- })
- },
- // 添加钢瓶
- addCylinder() {
- uni.navigateTo({
- url: '/pages/information/cylinder?status=' + this.current
- });
- },
- // 调拨钢瓶
- transferCylinders() {
- uni.navigateTo({
- url: '/pages/information/transfer?status=' + this.current
- });
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .head_mine_title {
- margin: 20rpx;
- }
- .card_information {
- padding-top: var(--status-bar-height);
- margin: 0rpx 20rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .card_dinay {
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: calc(100% - 40rpx);
- margin-top: 20rpx;
- border-bottom: 1rpx solid #d7d7d7;
- padding: 30rpx 20rpx;
- }
- .item_current {
- width: 40rpx;
- color: #82848a;
- }
- .item_title1 {
- margin-left: 10rpx;
- }
- .icon_cylinder {
- font-size: 50rpx;
- }
- .card_button_bottom {
- position: absolute;
- bottom: 20rpx;
- left: 0;
- right: 0;
- background-color: #fff;
- margin-bottom: 100rpx;
- padding-bottom: constant(safe-area-inset-bottom); //兼容 IOS<11.2
- padding-bottom: env(safe-area-inset-bottom); //兼容 IOS>11.2
- display: flex;
- align-items: center;
- }
- .bottom_btn_flex {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .but_allot {
- width: 80%;
- background-color: #3C9CFE;
- padding: 20rpx;
- color: #fff;
- border-radius: 10rpx;
- }
- </style>
|