Browse Source

对接系统消息 初始化接口信息

zxl 1 year ago
parent
commit
d30afe6159

+ 70 - 0
src/api/client/message.js

@@ -25,3 +25,73 @@ export function addClientComment(data) {
     },
   });
 }
+
+/**
+ *@description 订单通知接口 - 查看是否有系统新消息
+ */
+export function getIsHaveNewInform(data) {
+  return request({
+    url: '/maintain/new/inform',
+    methods: 'get',
+    data: data,
+    headers: {
+      'content-type': 'application/x-www-form-urlencoded',
+    },
+  });
+}
+
+/**
+ *@description 订单通知接口 - 获取用户的订单通知列表
+ */
+export function getOrderInform(data) {
+  return request({
+    url: '/maintain/order/inform',
+    methods: 'get',
+    data: data,
+    headers: {
+      'content-type': 'application/x-www-form-urlencoded',
+    },
+  });
+}
+
+/**
+ *@description 订单通知接口 - 获取用户的评价通知列表
+ */
+export function getOrderCommentInform(data) {
+  return request({
+    url: '/maintain/comment/inform',
+    methods: 'get',
+    data: data,
+    headers: {
+      'content-type': 'application/x-www-form-urlencoded',
+    },
+  });
+}
+
+/**
+ *@description 订单通知接口 - 获取用户的点赞回复通知列表
+ */
+export function getEvaluateInform(data) {
+  return request({
+    url: '/maintain/evaluate/inform',
+    methods: 'get',
+    data: data,
+    headers: {
+      'content-type': 'application/x-www-form-urlencoded',
+    },
+  });
+}
+
+/**
+ *@description 订单通知接口 - 获取用户的优惠券通知列表
+ */
+export function getCouponInform(data) {
+  return request({
+    url: '/maintain/coupon/inform',
+    methods: 'get',
+    data: data,
+    headers: {
+      'content-type': 'application/x-www-form-urlencoded',
+    },
+  });
+}

+ 22 - 1
src/pages/client/clientPackage/message/LikeReply/index.vue

@@ -22,7 +22,28 @@
 </template>
 
 <script>
-export default {};
+import { getEvaluateInform } from '@/api/client/message.js';
+export default {
+  data() {
+    return {
+      queryParams:{
+        number:1,
+        size:10,
+        counting:true
+      }
+    };
+  },
+  mounted(){
+    this.handlerInitList()
+  },
+  methods: {
+    handlerInitList(){
+      getEvaluateInform(this.queryParams).then(res=>{
+        console.log("@@@@res",res)
+      })
+    }
+  },
+};
 </script>
 
 <style lang="scss" scoped>

+ 22 - 1
src/pages/client/clientPackage/message/benefits/index.vue

@@ -28,7 +28,28 @@
 </template>
 
 <script>
-export default {};
+import { getCouponInform } from '@/api/client/message.js';
+export default {
+  data() {
+    return {
+      queryParams:{
+        number:1,
+        size:10,
+        counting:true
+      }
+    };
+  },
+  mounted(){
+    this.handlerInitList()
+  },
+  methods: {
+    handlerInitList(){
+      getCouponInform(this.queryParams).then(res=>{
+        console.log("@@@@res",res)
+      })
+    }
+  },
+};
 </script>
 
 <style lang="scss" scoped>

+ 22 - 1
src/pages/client/clientPackage/message/evaluateNotice/index.vue

@@ -40,7 +40,28 @@
 </template>
 
 <script>
-export default {};
+  import { getOrderCommentInform } from '@/api/client/message.js';
+export default {
+  data(){
+    return{
+      queryParams:{
+        number:1,
+        size:10,
+        counting:true
+      }
+    }
+  },
+  mounted(){
+    this.handlerInitList()
+  },
+  methods: {
+    handlerInitList(){
+      getOrderCommentInform(this.queryParams).then(res=>{
+        console.log("@@@@res",res)
+      })
+    }
+  },
+};
 </script>
 
 <style lang="scss" scoped>

+ 18 - 2
src/pages/client/clientPackage/message/orderNotice/index.vue

@@ -27,11 +27,27 @@
 </template>
 
 <script>
+  import { getOrderInform } from '@/api/client/message.js';
 export default {
   data() {
-    return {};
+    return {
+      queryParams:{
+        number:1,
+        size:10,
+        counting:true
+      }
+    };
+  },
+  mounted(){
+    this.handlerInitList()
+  },
+  methods: {
+    handlerInitList(){
+      getOrderInform(this.queryParams).then(res=>{
+        console.log("@@@@res",res)
+      })
+    }
   },
-  methods: {},
 };
 </script>
 

+ 156 - 130
src/pages/client/tabBar/message/index.vue

@@ -9,15 +9,12 @@
 
       <view :style="{ marginTop: totalHeight + 'px' }">
         <view v-if="current == 0">
-          <view
-            class="orderList"
-            v-for="item in orderList"
-            :key="item.id"
-            @tap="$Router.push(item.url)"
-          >
+          <view class="orderList" v-for="item in orderList" :key="item.id" @tap="$Router.push(item.url)">
             <view class="img">
               <image :src="item.img" style="width: 45px; height: 45px" />
-              <view class="dot"></view>
+              <view class="dot">
+                <u-badge type="warning" max="99" :value="item.numb"></u-badge>
+              </view>
             </view>
             <view class="orderItem">
               <view class="order1">{{ item.name }}</view>
@@ -50,151 +47,180 @@
 </template>
 
 <script>
-export default {
-  data() {
-    return {
-      list: [
-        {
-          id: 1,
-          name: '系统通知',
-        },
-        {
-          id: 2,
-          name: '消息通知',
-          badge: {
-            value: 5,
+  import { getIsHaveNewInform } from '@/api/client/message.js';
+  export default {
+    data() {
+      return {
+        list: [{
+            id: 1,
+            name: '系统通知',
+          }
+          // ,
+          // {
+          //   id: 2,
+          //   name: '消息通知',
+          //   badge: {
+          //     value: 5,
+          //   },
+          // },
+        ],
+        current: 0,
+        orderList: [{
+            id: '1',
+            img: '/static/icon/tools.png',
+            name: '订单通知',
+            text: '您的订单成功付款,感谢您的支持。',
+            url: '/pages/client/clientPackage/message/orderNotice/index',
+            numb:0
           },
-        },
-      ],
-      current: 0,
-      orderList: [
-        {
-          id: '1',
-          img: '/static/icon/tools.png',
-          name: '订单通知',
-          text: '您的订单成功付款,感谢您的支持。',
-          url: '/pages/client/clientPackage/message/orderNotice/index',
-        },
-        {
-          id: '3',
-          img: '/static/icon/tools.png',
-          name: '评价通知',
-          text: '您的订单成功付款,感谢您的支持。',
-          url: '/pages/client/clientPackage/message/evaluateNotice/index',
-        },
-        {
-          id: '4',
-          img: '/static/icon/tools.png',
-          name: '点赞回复',
-          text: '您的订单成功付款,感谢您的支持。',
-          url: '/pages/client/clientPackage/message/LikeReply/index',
-        },
-        {
-          id: '5',
-          img: '/static/icon/tools.png',
-          name: '优惠福利',
-          text: '您的订单成功付款,感谢您的支持。',
-          url: '/pages/client/clientPackage/message/benefits/index',
-        },
-      ],
-      type: 'warning',
-      value: 99999,
-      flag: true,
-    };
-  },
-  onShow() {
-    /* 隐藏原生的tabbar */
-    uni.hideTabBar({
-      animation: false,
-    });
-  },
-  computed: {
-    totalHeight() {
-      return uni.getSystemInfoSync().statusBarHeight + 44;
+          {
+            id: '3',
+            img: '/static/icon/tools.png',
+            name: '支付通知',
+            text: '支付通知。',
+            url: '/pages/client/clientPackage/message/orderNotice/index',
+            numb:0
+          },
+          {
+            id: '2',
+            img: '/static/icon/tools.png',
+            name: '评价通知',
+            text: '评价通知。',
+            url: '/pages/client/clientPackage/message/evaluateNotice/index',
+            numb:0
+          },
+          {
+            id: '4',
+            img: '/static/icon/tools.png',
+            name: '点赞回复',
+            text: '点赞回复。',
+            url: '/pages/client/clientPackage/message/LikeReply/index',
+            numb:0
+          },
+          {
+            id: '5',
+            img: '/static/icon/tools.png',
+            name: '优惠福利',
+            text: '优惠福利。',
+            url: '/pages/client/clientPackage/message/benefits/index',
+            numb:0
+          },
+        ],
+        type: 'warning',
+        value: 99999,
+        flag: true,
+      };
     },
-  },
-  methods: {
-    changeInfo(index) {
-      this.current = index.index;
+    onShow() {
+      /* 隐藏原生的tabbar */
+      uni.hideTabBar({
+        animation: false,
+      });
+      this.handlerGetSystemNewInform()
+    },
+    computed: {
+      totalHeight() {
+        return uni.getSystemInfoSync().statusBarHeight + 44;
+      },
     },
+    methods: {
+      // 获取订单详细通知 是否有系统新消息
+      handlerGetSystemNewInform() {
+        getIsHaveNewInform().then(res => {
+          console.log("@@@@res", res)
+          this.orderList[0] = res.data.order
+          this.orderList[1] = res.data.pay
+          this.orderList[2] = res.data.comment
+          this.orderList[3] = res.data.evaluate
+          this.orderList[4] = res.data.coupon
+        })
+      },
+      changeInfo(index) {
+        this.current = index.index;
+        if(index == 0){
+          this.handlerGetSystemNewInform()
+        }
+      },
 
-    notification() {
-      uni.navigateTo({
-        url: `/pages/client/clientPackage/chatRoom/chat`,
-      });
+      notification() {
+        uni.navigateTo({
+          url: `/pages/client/clientPackage/chatRoom/chat`,
+        });
+      },
     },
-  },
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-.container {
-  min-height: 100vh;
-  background-color: #fff;
-  .img {
-    width: 90rpx;
-    height: 90rpx;
-    margin-right: 20rpx;
-    position: relative;
-    .dot {
-      width: 16rpx;
-      height: 16rpx;
-      background-color: red;
-      border-radius: 8rpx;
-      position: absolute;
-      top: -5rpx;
-      right: 0;
-    }
-  }
-  .orderList {
-    display: flex;
-    padding: 30rpx 40rpx;
-    justify-content: space-between;
+  .container {
+    min-height: 100vh;
     background-color: #fff;
 
-    .orderItem {
-      flex: 1;
+    .img {
+      width: 90rpx;
+      height: 90rpx;
+      margin-right: 20rpx;
+      position: relative;
 
-      .order1 {
-        font-size: 16px;
-        margin-bottom: 10rpx;
-        color: #232323;
+      .dot {
+        // width: 16rpx;
+        height: 16rpx;
+        // background-color: red;
+        border-radius: 8rpx;
+        position: absolute;
+        top: -10rpx;
+        right: -10rpx;
       }
+    }
+
+    .orderList {
+      display: flex;
+      padding: 30rpx 40rpx;
+      justify-content: space-between;
+      background-color: #fff;
+      .orderItem {
+        flex: 1;
+
+        .order1 {
+          font-size: 16px;
+          margin-bottom: 10rpx;
+          color: #232323;
+        }
 
-      .order2 {
-        font-size: 12px;
-        color: #9ca3af;
+        .order2 {
+          font-size: 12px;
+          color: #9ca3af;
+        }
       }
     }
-  }
 
-  .message {
-    display: flex;
-    padding: 30rpx 40rpx;
-    justify-content: space-between;
+    .message {
+      display: flex;
+      padding: 30rpx 40rpx;
+      justify-content: space-between;
 
-    .business {
-      flex: 1;
+      .business {
+        flex: 1;
 
-      .businessItem {
-        font-size: 16px;
-        margin-bottom: 10rpx;
-        color: #232323;
-      }
+        .businessItem {
+          font-size: 16px;
+          margin-bottom: 10rpx;
+          color: #232323;
+        }
 
-      .messages {
-        font-size: 12px;
-        color: #9ca3af;
+        .messages {
+          font-size: 12px;
+          color: #9ca3af;
+        }
       }
-    }
 
-    .time {
-      .timeItem {
-        color: #9ca3af;
-        font-size: 14px;
-        margin-bottom: 8px;
+      .time {
+        .timeItem {
+          color: #9ca3af;
+          font-size: 14px;
+          margin-bottom: 8px;
+        }
       }
     }
   }
-}
 </style>