zhaoxiaohai 3 years ago
parent
commit
b6e010658d
2 changed files with 14 additions and 13 deletions
  1. 11 10
      pages/tabbar/home/index.js
  2. 3 3
      pages/tabbar/home/index.wxml

+ 11 - 10
pages/tabbar/home/index.js

@@ -5,6 +5,7 @@ Page({
      * 页面的初始数据
      */
     data: {
+        user: {},
         gridList: [{
             name: "通告",
             path: "/pages/annunciate/index",
@@ -28,21 +29,20 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad(options) {
-        //获取胶囊位置信息
-        this.setData({
-                capsule: wx.getMenuButtonBoundingClientRect()
-            })
-
-            _Http.login().then(res => {
-                console.log(res)
-            })
+        let user = wx.getStorageSync('userMsg');
+        this.refreshData(user)
+        this.setData({ //获取胶囊位置信息
+            capsule: wx.getMenuButtonBoundingClientRect(),
+            user
+        })
     },
-    /* 应用程序 */
+    /* 更新数据 */
+    refreshData(item) {},
+    /* 宫格区域应用程序 */
     applications(e) {
         const {
             name
         } = e.currentTarget.dataset;
-        console.log(name)
         /* switch (name) {
             case "通告":
                 wx.navigateTo({
@@ -54,6 +54,7 @@ Page({
                 break;
         } */
     },
+    /* 去通告 */
     toAnnunciate() {
         wx.navigateTo({
             url: '/pages/annunciate/index'

+ 3 - 3
pages/tabbar/home/index.wxml

@@ -4,10 +4,10 @@
 <view style="position: fixed;top: 0; z-index: 999999999;">
     <view style="width: 100vw;height: {{capsule.top-6+'px'}};background-color:#085CDF;" />
     <view class="header">
-        <view class="header_title">
-            营销总监
+        <navigator url="/pages/login/selectSite" class="header_title">
+            {{user.sitename}}
             <van-icon name="arrow-down" />
-        </view>
+        </navigator>
     </view>
 </view>
 <!-- 轮播区域 -->