zhengjinyi 2 vuotta sitten
vanhempi
commit
8873689e71
1 muutettua tiedostoa jossa 15 lisäystä ja 15 poistoa
  1. 15 15
      pages/tabBar/home/index.js

+ 15 - 15
pages/tabBar/home/index.js

@@ -33,22 +33,22 @@ const homeMiXins = {
     },
     methods: {
         ...mapMutations(['login', 'logout','updateNoticeNum','updateRossShow']),
-        mallOrganizeHome() {
+        async mallOrganizeHome() {
             //初始化首页数据
-            this.CommonService.mallOrganizeHome({ organizeId: 1 })
-                .then(res => {
-                    let data = res.data
-		            this.bannerList = data.bannerList
-		            this.mainmenu = data.mainmenu
-		            this.floorList = data.floorList
-                    // if (this.hasLogin) {
-                    // 	// this.initShoppingCartCount()
-                    // }
-                    this.skeletonShow = true
-                })
-                .catch(error => {
-                    this.$util.msg(error.msg, 2000)
-                })
+            try{
+                const res = await this.CommonService.mallOrganizeHome({ organizeId: 1 })
+                let data = res.data
+                this.bannerList = data.bannerList
+                this.mainmenu = data.mainmenu
+                this.floorList = data.floorList
+                // if (this.hasLogin) {
+                // 	// this.initShoppingCartCount()
+                // }
+                this.skeletonShow = true
+            }catch(error){
+                //TODO handle the exception
+                console.log('error',error)
+            }
         },
         async GetWxAuthorize() {
         	const wechatCode = await authorize.getCode('weixin') // 根据微信的code获取用户登录状态:1已登录过 -1未登录过