diff --git a/pages/home/index.vue b/pages/home/index.vue index b3e24c6..7950e0b 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -367,15 +367,14 @@ import request,{host} from '@/common/request' } }, onLoad() { - // uni.setTabBarItem({ - // index:0, - // pagePath:"/pages/home/rePassword" - // }) this.getHeadImg() if(this.isAdmin){ this.getPlantBase() }else{ - this.getBaseName(this.$store.getters['userInfo'].plantBaseInfoId) + this.$store.commit("setBaseId", { + id: this.$store.getters['userInfo'].plantBaseInfoId, + name: this.$store.getters['userInfo'].plantBaseInfoName + }) } this.$provise.on("updateMassif", this.getMassif) this.$provise.on("updateStock", this.getStock) @@ -438,20 +437,20 @@ import request,{host} from '@/common/request' } }, //获取基地名称 - async getBaseName(plantBaseInfoId){ - var res=await request("/api/purchase/purchaseUserShow",{ - params:{plantBaseInfoId} - }) - if(res.statu){ - this.$store.commit("setBaseId", {id:plantBaseInfoId,name:res.data.baseName}) - }else{ - uni.showModal({ - title:"提示", - content:res.msg||"获取基地名称失败!", - showCancel:false, - }) - } - }, + // async getBaseName(plantBaseInfoId){ + // var res=await request("/api/purchase/purchaseUserShow",{ + // params:{plantBaseInfoId} + // }) + // if(res.statu){ + // this.$store.commit("setBaseId", {id:plantBaseInfoId,name:res.data.baseName}) + // }else{ + // uni.showModal({ + // title:"提示", + // content:res.msg||"获取基地名称失败!", + // showCancel:false, + // }) + // } + // }, async getBaseInfo(){ if(this.$store.state.baseInfo.id){ var res=await request("/api/plantIndex/queryFarmWorkAndInput",{