zhengjinyi 3 anni fa
parent
commit
8c0db9bea1

+ 15 - 7
components/cm-module/supplier/notice.vue

@@ -53,6 +53,7 @@ export default {
 			StaticUrl: this.$Static,
 			skeletonShow: true,
 			shopId: 0,
+			allCount:0,
 			accountCount: 0,
 			notificationCount: 0
 		}
@@ -77,13 +78,19 @@ export default {
 			this.getUserAuthShopMessageCount()
 		},
 		clearNews() {
-			uni.vibrateShort({
-				success: function() {
-					console.log('success')
-				}
-			})
-			this.UserService.authUpdateShopMessageAsRead({ messageType: '' })
+			// 标记消息已读
+			if(this.allCount == 0){
+				this.$util.msg('暂无未读消息', 2000)
+				return
+			}
+			this.UserService.authUpdateShopMessageAsRead({ commonId:this.shopId,messageType: '' })
 				.then(response => {
+					uni.vibrateShort({
+						success: function() {
+							console.log('success')
+						}
+					})
+					this.initData()
 					this.$util.msg('已将所有消息标记为已读', 2000)
 				})
 				.catch(error => {
@@ -91,9 +98,10 @@ export default {
 				})
 		},
 		getUserAuthShopMessageCount() {
-			//供应商详情
+			//供应商通知消息中心
 			this.ShopService.getUserAuthShopMessageCount({ commonId: this.shopId })
 				.then(response => {
+					this.allCount = response.data.count
 					this.accountCount = response.data.accountCount
 					this.notificationCount = response.data.notificationCount
 					this.skeletonShow = false //预加载圆圈隐藏

+ 20 - 21
pages/notice/shop/mixins/notice.mixins.js

@@ -55,7 +55,6 @@ const noticeMixins = {
                 .catch(error => {
                     this.$util.msg(error.msg, 2000)
                 })
-            console.log('获取消息通知数据')
         },
         getReachBottomData(index) {
             //上拉加载
@@ -84,34 +83,34 @@ const noticeMixins = {
                     this.$util.msg(error.msg, 2000)
                 })
         },
-        deleteBtn(id,index) {
-		    // 删除通知消息
-		    this.UserService.authDeleteMessage({ id: id })
-		        .then(response => {
-		            let _this = this
-		            uni.vibrateShort({
-		                success: function() {
-		                    _this.list.splice(index, 1) 
-		                }
-		            })
-		        })
-		        .catch(error => {
-		            console.log('error=>', error.msg)
-		        })
+        deleteBtn(id, index) {
+            // 删除通知消息
+            this.UserService.authDeleteMessage({ id: id })
+                .then(response => {
+                    let _this = this
+                    uni.vibrateShort({
+                        success: function() {
+                            _this.list.splice(index, 1)
+                        }
+                    })
+                })
+                .catch(error => {
+                    console.log('error=>', error.msg)
+                })
         },
         noticeUsersText(cell) { // 账户通知文案
             const map = {
-			    1: '您的注册信息已审核通过,恭喜您成为采美平台供应商用户。您可以上架商品到采美商城进行出售了',
-			    2: `恭喜您(微信昵称:${cell.content})成功成为【采美信息技术有限公司】的运营人员。`,
-			    3: '该商品上架审核未通过,暂时不能上架采美商城。请登录采美网站修改商品资料重新提交。',
-			    4: '该商品新品展示审核未通过,未能展示在采美商城新品橱窗。',
-			    5: `该商品的资质证书将于${cell.content}后失效,请及时登录采美网站上传新证书。`
+                1: '您的注册信息已审核通过,恭喜您成为采美平台供应商用户。您可以上架商品到采美商城进行出售了',
+                2: `恭喜您(微信昵称:${cell.content})成功成为【采美信息技术有限公司】的运营人员。`,
+                3: '该商品上架审核未通过,暂时不能上架采美商城。请登录采美网站修改商品资料重新提交。',
+                4: '该商品新品展示审核未通过,未能展示在采美商城新品橱窗。',
+                5: `该商品的资质证书将于${cell.content}后失效,请及时登录采美网站上传新证书。`
             }
             return map[cell.shopMessType]
         },
         noticeServeText(cell) { // 服务通知文案
             const map = {
-			    1: `您的供应商账号上架费将于${cell.content}后到期,到期后将无法发布和编辑商品,同时也会影响到其他采美提供的支持服务。请联系采美工作人员进行续费,联系电话0755-22907771 或15338851365`
+                1: `您的供应商账号上架费将于${cell.content}后到期,到期后将无法发布和编辑商品,同时也会影响到其他采美提供的支持服务。请联系采美工作人员进行续费,联系电话0755-22907771 或15338851365`
             }
             return map[cell.shopTieredType]
         }

+ 13 - 6
pages/tabBar/notice/index.vue

@@ -75,6 +75,7 @@ export default {
 			StaticUrl: this.$Static,
 			skeletonShow: true,
 			clubId: 0,
+			allCount:0,
 			tradeCount: 0,
 			accountCount: 0,
 			notificationCount: 0,
@@ -103,13 +104,18 @@ export default {
 		},
 		clearNews() {
 			// 标记消息已读
-			uni.vibrateShort({
-				success: function() {
-					console.log('success')
-				}
-			})
-			this.UserService.authUpdateMessageAsRead({ messageType: '' })
+			if(this.allCount == 0){
+				this.$util.msg('暂无未读消息', 2000)
+				return
+			}
+			this.UserService.authUpdateMessageAsRead({ commonId:this.clubId,messageType: '' })
 				.then(response => {
+					uni.vibrateShort({
+						success: function() {
+							console.log('success')
+						}
+					})
+					this.initData()
 					this.$util.msg('已将所有消息标记为已读', 2000)
 				})
 				.catch(error => {
@@ -120,6 +126,7 @@ export default {
 			//供应商详情
 			this.UserService.getUserAuthClubMessageCount({ commonId: this.clubId })
 				.then(response => {
+					this.allCount = response.data.count
 					this.tradeCount = response.data.tradeCount // 交易物流
 					this.accountCount = response.data.account // 账户通知
 					this.notificationCount = response.data.notificationCount // 服务通知

+ 2 - 2
services/user.service.js

@@ -616,7 +616,7 @@ export default class UserService {
 	 *@param messageType:''
 	 */
     authUpdateMessageAsRead(data = {}) {
-	    return this.AjaxService.post({
+	    return this.AjaxService.get({
 	        url: '/user/login/auth/updateMessageAsRead',
 	        data,
 	        isLoading: true,
@@ -627,7 +627,7 @@ export default class UserService {
 	 *@param messageType:''
 	 */
     authUpdateShopMessageAsRead(data = {}) {
-	    return this.AjaxService.post({
+	    return this.AjaxService.get({
 	        url: '/user/login/auth/updateShopMessageAsRead',
 	        data,
 	        isLoading: true,