shish 1 год назад
Родитель
Сommit
e990a12bc6
1 измененных файлов с 9 добавлено и 4 удалено
  1. 9 4
      mallApp/src/pages/home/category.vue

+ 9 - 4
mallApp/src/pages/home/category.vue

@@ -87,9 +87,6 @@ export default {
 			path: "pages/home/category?account="+this.option.account,
 		}
 	},
-  onLoad () {
-    this.hdId = this.option.hdId ? this.option.hdId : 0
-  },
 	onShow(){
 		if(!this.$util.isEmpty(this.loginInfo)){
 			this.globalLoginStyle = 1
@@ -121,8 +118,9 @@ export default {
 			this.$util.pageTo({url:"/pages/login/index?needBack=1"})
 		},
     init(){
+      this.hdId = this.option.hdId ? this.option.hdId : 0
       this.classInit()
-			getInfo().then(res=>{
+			getInfo({hdId:this.hdId}).then(res=>{
 				if(res.code == 1){
 					if(res.data.info && res.data.info.merchantName){
 						let sjName = res.data.info.merchantName
@@ -131,6 +129,13 @@ export default {
 						this.shopName = name
 						this.shopImg = res.data.info.avatar
 					}
+
+					if(res.data.hd && Number(res.data.hd.id) > 0){
+						if(Number(this.hdId) == 0){
+							this.hdId = res.data.hd.id
+						}
+					}
+
 				}
 			})
     },