zhaoxiaohai 3 роки тому
батько
коміт
3795f4053a

+ 8 - 0
pages/tabbar/message/index.js

@@ -1,10 +1,12 @@
 const getHeight = require("../../../utils/getRheRemainingHeight"),
     _Http = getApp().globalData.http;
+
 Page({
     /**
      * 页面的初始数据
      */
     data: {
+        tabShow: true,
         height: 0,
         list: [],
         content: {
@@ -21,6 +23,12 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad(options) {
+        //配置权限
+        let auth = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['消息中心'])[0].apps;
+        if (auth.length == 1) this.setData({
+            tabShow: false,
+            "content.type": (auth[0].meta.title == '系统消息') ? '系统' : '应用'
+        });
     },
     //切换tab选项
     tabChange({

+ 2 - 1
pages/tabbar/message/index.wxml

@@ -1,4 +1,5 @@
-<My_tabs id='tabs' bind:onChange='tabChange' />
+<My_tabs wx:if="{{tabShow}}" isShow='{{tabShow}}' bind:onChange='tabChange' />
+<view id='tabs' />
 <My_listBox id="ListBox" height="{{height}}" bind:getlist='getlist'>
     <view class="unread">总共{{total}}条</view>
     <navigator url="#" class='list' wx:for="{{list}}" data-item="{{item}}" bindtap="toDetails">

+ 7 - 3
pages/tabbar/message/modules/tabs.js

@@ -16,6 +16,9 @@ Component({
         },
         onChange: {
             type: Function
+        },
+        isShow: {
+            type: Boolean
         }
     },
 
@@ -40,14 +43,15 @@ Component({
         /* 改变选中 */
         changeTab(e) {
             if (this.data.acIndex == e.currentTarget.dataset.index) return;
-                this.setData({
-                    acIndex: e.currentTarget.dataset.index
-                })
+            this.setData({
+                acIndex: e.currentTarget.dataset.index
+            })
             this.triggerEvent("onChange", e.currentTarget.dataset.item)
             this.setBorBotLeft()
         },
         //更改横线位置
         setBorBotLeft() {
+            if (this.data.isShow) return;
             let animation = wx.createAnimation({
                 duration: 1000,
                 timingFunction: 'ease',