From 11812ec34931e78939e87effdc32a0d0b8d04b3b Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: Wed, 21 Aug 2024 14:32:22 +0800
Subject: [PATCH] 提交
---
pages/tabBar/firstPage/firstPage.vue | 31 ++++++++++++++++++++++---------
1 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/pages/tabBar/firstPage/firstPage.vue b/pages/tabBar/firstPage/firstPage.vue
index 039b813..307761e 100644
--- a/pages/tabBar/firstPage/firstPage.vue
+++ b/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(){
--
Gitblit v1.9.2