zhaoxiaohai 3 年之前
父節點
當前提交
8acd870873
共有 2 個文件被更改,包括 77 次插入61 次删除
  1. 74 59
      pages/tabbar/message/index.js
  2. 3 2
      pages/tabbar/message/index.wxml

+ 74 - 59
pages/tabbar/message/index.js

@@ -14,7 +14,7 @@ Page({
             pageSize: 20,
             pageTotal: 1,
             type: "应用",
-            where:{}
+            where: {}
         },
         total: 0,
     },
@@ -32,37 +32,93 @@ Page({
         })
         this.getlist(true);
     },
-    
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
     onReady() {
-        getHeight.getHeight("#tabs", this).then(res => {
+        getHeight.getHeight(".head", this).then(res => {
             this.setData({
                 height: res
             })
         })
     },
-
-    toDetails(e) {
+    async toDetails(e) {
         const {
-            item
-        } = e.currentTarget.dataset;
-        wx.navigateTo({
+            objectname,
+            objectid,
+            messageid
+        } = e.currentTarget.dataset.item;
+        _Http.basic({
+            "classname": "system.message.Message",
+            "method": "readMessage",
+            "content": {
+                messageid
+            }
+        }, false)
+        const res = await _Http.basic({
+            "classname": "saletool.common.auth",
+            "method": "isAuth",
+            "content": {
+                objectid,
+                objectname
+            }
+        });
+        if (res.msg != '成功' || res.data[0].isAuth != 1) return wx.showToast({
+            title: '暂无权限进入应用',
+            icon: "none"
+        });
+        switch (objectname) {
+            case 'sat_courseware':
+                wx.navigateTo({
+                    url: `/pages/college/index`,
+                })
+                break;
+            case 'sat_sharematerial':
+                wx.navigateTo({
+                    url: `/pages/promotional/index`,
+                })
+                break;
+            case 'sat_notice':
+                wx.navigateTo({
+                    url: `/pages/annunciate/index`,
+                })
+                break;
+            case 'sat_submitedit':
+                wx.navigateTo({
+                    url: `/pages/submission/index`,
+                })
+                break;
+            case 'sat_orderclue':
+                wx.navigateTo({
+                    url: `/pages/threadedTree/index`,
+                })
+                break;
+            case 'sys_attachment':
+                let item = {
+                    attachmentid: objectid,
+                    document: '营销物料'
+                }
+                wx.navigateTo({
+                    url: 'pages/tabbar/smartStore/index',
+                })
+                break;
+            default:
+                wx.showToast({
+                    title: '当前应用暂不支持跳转',
+                    icon: "none"
+                })
+                break;
+        }
+        /* wx.navigateTo({
             url: './details?id=' + item.messageid,
-        })
+        }) */
     },
-
     getlist(init = false) {
         if (init.detail != undefined) init = init.detail;
-        if (init) this.setData({
-            ['content.pageNumber']: 1
-        })
-        if (this.data.content.pageNumber > this.data.content.pageTotal) return;
+        let content = this.data.content
+        if (init) content.pageNumber = 1;
+        if (content.pageNumber > content.pageTotal) return;
         _Http.basic({
             "classname": "system.message.Message",
             "method": "queryMessage",
-            content: this.data.content
+            content
         }).then(res => {
             this.selectComponent('#ListBox').RefreshToComplete();
             if (res.msg != '成功') return wx.showToast({
@@ -77,49 +133,8 @@ Page({
             })
         })
     },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
     onShow() {
         this.getlist(true);
         this.getTabBar().init();
     },
-
-
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload() {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
-
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage() {
-
-    }
 })

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

@@ -1,9 +1,10 @@
 <!-- <My_tabs id='tabs' bind:onChange='tabChange' /> -->
-<van-tabs id='tabs' active="{{ content.type }}" color='var(--assist)' tab-active-class='tab-active-class' bind:change="tabChange">
+<!-- <van-tabs id='tabs' active="{{ content.type }}" color='var(--assist)' tab-active-class='tab-active-class' bind:change="tabChange">
     <van-tab title="应用消息" name='应用' />
     <van-tab title="系统消息" name='系统' />
 </van-tabs>
-
+ -->
+ <view class="head"></view>
 <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">