zhaoxiaohai преди 3 години
родител
ревизия
5377762c8f

+ 5 - 3
app.js

@@ -26,7 +26,7 @@ App({
     wx.getSystemInfo({
       success(res) {
         //计算底部安全距离高度
-        // safeAreaBottom += res.screenHeight - res.safeArea.height;
+        safeAreaBottom += res.screenHeight - res.safeArea.bottom;
         //计算自定义导航的高度
         height = capsule.height + res.statusBarHeight + (capsule.top - res.statusBarHeight) + 8;
         that.globalData.safeAreaBottom = safeAreaBottom;
@@ -38,8 +38,10 @@ App({
 
   },
   globalData: {
-    myNavBorHeight: null, //自定义头部导航高度
+    myNavBorHeight: 0, //自定义头部导航高度
+    safeAreaBottom: 0, //底部安全距离
     account_list: [], //用户列表
-    bannerDataList: [],
+    bannerDataList: [], //轮播图列表
+    servicehotline: '', //客服手机号
   }
 })

+ 1 - 0
components/My_pageReachBottom/index.js

@@ -8,6 +8,7 @@ Component({
             type: Boolean,
             value: false
         },
+        /* 暂无数据 */
         dummyStatus: {
             type: Boolean,
             value: false

+ 2 - 4
custom-tab-bar/index.js

@@ -51,8 +51,7 @@ Component({
                 url: '/pages/tabbar-pages/user/index'
             }
         ],
-        show: false,
-        phoneNumber: "17757394388"
+        show: false
     },
 
     /**
@@ -80,9 +79,8 @@ Component({
         /* 呼叫电话 */
         CallOut() {
             wx.makePhoneCall({
-                phoneNumber: this.data.phoneNumber
+                phoneNumber: getApp().globalData.servicehotline
             }).catch((e) => {
-                console.log(123)
             })
         },
         onClose() {

+ 1 - 0
pages/login/index.js

@@ -138,6 +138,7 @@ Page({
             //账号列表保存到全局变量中
             getApp().globalData.account_list = res.account_list;
             console.log(getApp().globalData.account_list)
+            getApp().globalData.servicehotline = res.servicehotline;
             /* 判断账号 新 单 多  isnewregister*/
             if (res.account_list.length == 1 && res.account_list[0].isnewregister == 1) {
                 //新账号

+ 52 - 3
pages/tabbar-pages/message/index.js

@@ -10,6 +10,8 @@ Page({
     data: {
         tabsActive: 0, //tabs 下标
         msgList: [],
+        pageNumber: 1,
+        pageTotal: 1
     },
 
     /**
@@ -17,6 +19,39 @@ Page({
      */
     onLoad: function (options) {
         this.getList()
+        const that = this;
+        const h = getApp().globalData.myNavBorHeight + getApp().globalData.safeAreaBottom;
+        wx.getSystemInfo({
+            success(res) {
+                that.setData({
+                    scrollH: res.windowHeight - h - 7
+                })
+            }
+        })
+    },
+    /* 阅读信息 */
+    readMsg(e) {
+        const {
+            index,
+            id,
+            fisread
+        } = e.currentTarget.dataset;
+        if (fisread == 0) _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "system.message.Message",
+            "method": "readMessage",
+            "content": {
+                "tmessageid": id
+            }
+        }).then(res => {
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+            });
+            const name = 'msgList[' + index + '].fisread'
+            this.setData({
+                [name]: 1
+            })
+        });
     },
     /* tabs切换 */
     tabsOnChange(e) {
@@ -25,7 +60,9 @@ Page({
             title
         } = e.detail;
         this.setData({
-            tabsActive: index
+            tabsActive: index,
+            pageNumber: 1,
+            pageTotal: 1
         })
         this.getList()
     },
@@ -51,7 +88,7 @@ Page({
             "method": "queryMessage",
             "content": {
                 "getdatafromdbanyway": true,
-                "pageNumber": 1,
+                "pageNumber": this.data.pageNumber,
                 "pageSize": 20,
                 "ftype": type
             }
@@ -62,10 +99,22 @@ Page({
                 icon: 'none'
             });
             this.setData({
-                msgList: res.data
+                msgList: res.data,
+                pageTotal: res.pageTotal
             })
         })
     },
+    /* 上拉触底 加载数据 */
+    listLoadMore() {
+        if (this.data.pageTotal > this.data.pageNumber) {
+            this.setData({
+                pageNumber: this.data.pageNumber + 1
+            })
+        } else {
+            return
+        };
+        this.getList();
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 19 - 17
pages/tabbar-pages/message/index.wxml

@@ -2,7 +2,6 @@
 <My_navBar></My_navBar>
 <!-- 信息 -->
 <van-tabs active="{{ tabsActive }}" color='#4DC2D4' title-active-color="#4DC2D4" title-inactive-color='rgba(0,0,0,.3)' tab-active-class='tab-active-class' tab-class="tab-class" nav-class='' line-width='60rpx' line-height='6rpx' swipeable bind:change="tabsOnChange">
-    <view class="nav-class"></view>
     <van-tab title="公共消息">
     </van-tab>
     <van-tab title="商户消息">
@@ -10,21 +9,24 @@
     <van-tab title="团队消息">
     </van-tab>
 </van-tabs>
-
-<view class="msg-box">
-    <navigator url="#" wx:for="{{msgList}}">
-        <view class="msgImg">
-            <image src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/message/storeIcon-05.png"></image>
-            <view class="red-dot"></view>
-        </view>
-        <view class="borTop">
-            <view class="msgText">
-                <view class="title u-line-1">{{item.ftitle}}</view>
-                <view class="msg u-line-1">{{item.fmessage}}</view>
+<view class="nav-class"></view>
+<scroll-view scroll-y="true" style="max-height: {{scrollH}}px;" bindscrolltolower='listLoadMore'>
+    <view class="msg-box">
+        <navigator url="#" wx:for="{{msgList}}" data-index="{{index}}" data-id="{{item.tmessageid}}" data-fisread="{{item.fisread}}" bindtap="readMsg">
+            <view class="msgImg">
+                <image src="{{item.imageurl}}"></image>
+                <view wx:if="{{item.fisread==0}}" class="red-dot"></view>
             </view>
-            <view class="msgTime">
-                上午9:34
+            <view class="borTop">
+                <view class="msgText">
+                    <view class="title u-line-1">{{item.ftitle}}</view>
+                    <view class="msg u-line-1">{{item.fmessage}}</view>
+                </view>
+                <view class="msgTime">
+                    上午9:34
+                </view>
             </view>
-        </view>
-    </navigator>
-</view>
+        </navigator>
+    </view>
+    <My_pageReachBottom dummyStatus="{{msgList.length>1}}" loadMore='{{pageNumber>=pageTotal}}'></My_pageReachBottom>
+</scroll-view>

+ 4 - 2
pages/tabbar-pages/message/index.wxss

@@ -1,12 +1,14 @@
 page {
     background-color: #fff !important;
-    padding-bottom: 50px;
 }
 
 .msg-box {
     border-bottom: 2rpx solid rgba(151, 151, 151, .1);
 }
 
+.tabs-nav-class {
+    background-color: #fff !important;
+}
 
 .msg-box navigator:first-child .borTop::after {
     content: ' ';
@@ -15,7 +17,7 @@ page {
 
 /* pages/tabbar-pages/message/index.wxss */
 .nav-class {
-    box-shadow: 0px 10rpx 10rpx 0px rgba(170, 170, 170, 0.15);
+    box-shadow: 0px 3rpx 8rpx 0px rgba(170, 170, 170, 0.2);
     width: 100vw;
     height: 1rpx;
     margin-top: -1rpx;

+ 7 - 0
project.private.config.json

@@ -142,6 +142,13 @@
                     "name": "",
                     "pathName": "pages/storeMessage/editor/editor",
                     "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/businessPartner/applyFor",
+                    "query": "",
                     "scene": null,
                     "launchMode": "default"
                 }