马宇豪
2024-08-21 11812ec34931e78939e87effdc32a0d0b8d04b3b
pages/tabBar/firstPage/firstPage.vue
@@ -13,7 +13,7 @@
         </view>
      </view>
    <u-toast ref="uToast"></u-toast>
    <view class="cardList">
    <view class="cardList" v-if="user.useProd == 1">
      <view class="switchPanel">
        <view class="switchBtns">
          <view class="btnItem" @click="changeTab(1)">
@@ -100,7 +100,8 @@
    postHazmatUse,
    postHazmatUsed,
    postHazmatDiscard,
    postProductDiscard, getProductByCode, postProductSold
    postProductDiscard, getProductByCode, postProductSold,
    getUserInfo
  } from '../../../api/index.js'
  import VUE_APP_BASE_URL from 'common/constant.js'
  import take from '../../../static/take.png'
@@ -159,6 +160,7 @@
          id: null,
          remaining: ''
        },
        user: {},
        rules: {
          remaining: {
            type: 'string',
@@ -168,7 +170,7 @@
          }
        },
        tabNum: 1,
        blockText: '原材料',
        blockText: '危化品',
        blockStyle: {
          transform: 'translateX(0px)'
        }
@@ -188,11 +190,23 @@
      },
    created(){
      uni.hideTabBar()
      this.getUserInfo()
    },
    mounted() {
    },
      methods: {
      getUserInfo(){
        getUserInfo().then(res => {
          if(res.code == 200) {
            this.user = res.data
            uni.setStorageSync('userSet', res.data)
          }else{
            uni.$u.toast(res.message)
          }
        })
      },
      scanCode(title){
        const t = this
        t.modalTitle = title
@@ -265,7 +279,7 @@
            duration: 2000
          })
        })
        t.showModal = false
        t.closeModal()
      },
      confirmBack() {
@@ -291,8 +305,7 @@
              duration: 2000
            })
          })
          t.showModal = false
          t.hazmatBack.remaining = ''
          t.closeModal()
        }).catch(errors => {
          uni.$u.toast('请完善必填信息')
        })
@@ -318,7 +331,7 @@
            duration: 2000
          })
        })
        t.showModal = false
        t.closeModal()
      },
      confirmSell(){
@@ -341,7 +354,7 @@
            duration: 2000
          })
        })
        t.showModal = false
        t.closeModal()
      },
      confirmCancle(){
@@ -385,7 +398,7 @@
            })
          })
        }
        t.showModal = false
        t.closeModal()
      },
      closeModal(){