Browse Source

commit -m 消息通知

zhengjinyi 3 năm trước cách đây
mục cha
commit
c9c88c755b

+ 50 - 46
common/config/wxLogin.js

@@ -7,54 +7,58 @@ const newUserService = new UserService(ajaxService)
 
 // 根据微信的code获取用户登录状态:1已登录过 -1未登录过
 const wxLoginAuthorize = async function(){
-	const wechatCode = await authorize.getCode('weixin');// 根据微信的code获取用户登录状态:1已登录过 -1未登录过
-	const getUserInfo = await authorize.getUserInfo('weixin');
-	newUserService.UserLoginAuthApplets({ 
-		code:wechatCode,
-		encryptedData:getUserInfo.encryptedData,
-		iv:getUserInfo.iv
-	})
-	.then(response =>{
-		store.commit('updateStatus',response.data)
-		store.commit('login',response.data);
-		uni.setStorageSync('token',response.data.token)
-		uni.setStorageSync('unionId',response.data.unionId)
-	})
-	.catch(error =>{
-		uni.setStorageSync('unionId',error.data.unionId)
-		store.commit('logout',error.data)
-		store.commit('updateStatus',error.data)
-	})
+    const wechatCode = await authorize.getCode('weixin')// 根据微信的code获取用户登录状态:1已登录过 -1未登录过
+    const getUserInfo = await authorize.getUserInfo('weixin')
+    newUserService.UserLoginAuthApplets({ 
+        code:wechatCode,
+        encryptedData:getUserInfo.encryptedData,
+        iv:getUserInfo.iv
+    })
+        .then(response =>{
+            store.commit('updateStatus',response.data)
+            store.commit('login',response.data)
+            store.commit('updateNotice', response.data.savedCount)
+            uni.setStorageSync('token',response.data.token)
+            uni.setStorageSync('unionId',response.data.unionId)
+        })
+        .catch(error =>{
+            uni.setStorageSync('unionId',error.data.unionId)
+            store.commit('logout',error.data)
+            store.commit('updateStatus',error.data)
+            store.commit('updateNotice', error.data)
+        })
 }
 const wxLoginQuick = async function(){// 根据微信的code获取用户登录状态:1已登录过 -1未登录过跳转
-		const wechatCode = await authorize.getCode('weixin');// 根据微信的code获取用户登录状态:1已登录过 -1未登录过
-		const getUserInfo = await authorize.getUserInfo('weixin');
-		newUserService.UserLoginAuthApplets({ 
-			code:wechatCode,
-			encryptedData:getUserInfo.encryptedData,
-			iv:getUserInfo.iv
-		})
-		.then(response =>{
-			console.log(response)
-			store.commit('updateStatus',response.data)
-			store.commit('login',response.data);
-			uni.setStorageSync('token',response.data.token)
-			uni.setStorageSync('unionId',response.data.unionId)
-			if(response.data.userIdentity ==1){
-				uni.navigateTo({url:'/pages/seller/index/index'})
-			}else if(response.data.userIdentity === 3){
-				uni.navigateTo({url:'/pages/supplier/index/index'})
-			}else{
-				uni.switchTab({url:'/pages/tabBar/user/user'})
-			}
-		})
-		.catch(error =>{
-			uni.setStorageSync('unionId',error.data.unionId)
-			store.commit('logout',error.data)
-			store.commit('updateStatus',error.data)
-		})
+    const wechatCode = await authorize.getCode('weixin')// 根据微信的code获取用户登录状态:1已登录过 -1未登录过
+    const getUserInfo = await authorize.getUserInfo('weixin')
+    newUserService.UserLoginAuthApplets({ 
+        code:wechatCode,
+        encryptedData:getUserInfo.encryptedData,
+        iv:getUserInfo.iv
+    })
+        .then(response =>{
+            console.log(response)
+            store.commit('updateStatus',response.data)
+            store.commit('login',response.data)
+            store.commit('updateNotice', response.data.savedCount)
+            uni.setStorageSync('token',response.data.token)
+            uni.setStorageSync('unionId',response.data.unionId)
+            if(response.data.userIdentity ==1){
+                uni.navigateTo({url:'/pages/seller/index/index'})
+            }else if(response.data.userIdentity === 3){
+                uni.navigateTo({url:'/pages/supplier/index/index'})
+            }else{
+                uni.switchTab({url:'/pages/tabBar/user/user'})
+            }
+        })
+        .catch(error =>{
+            uni.setStorageSync('unionId',error.data.unionId)
+            store.commit('logout',error.data)
+            store.commit('updateStatus',error.data)
+            store.commit('updateNotice', error.data)
+        })
 }
 export default{
-	wxLoginAuthorize,
-	wxLoginQuick
+    wxLoginAuthorize,
+    wxLoginQuick
 }

+ 30 - 9
components/cm-module/supplier/notice.vue

@@ -22,8 +22,10 @@
 						<image class="icon-image" :src="StaticUrl + 'icon/icon-notice-users@2x.png'" mode=""></image>
 					</view>
 					<view class="notice-cell-text"> 账户通知 <text class="cell-text">官方</text> </view>
-					<view class="notice-cell-badge">
-						<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"> 99+ </text>
+					<view class="notice-cell-badge" v-if="accountCount>0">
+						<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"> 
+							{{ accountCount | BadgeType }}
+						</text>
 					</view>
 				</view>
 				<view class="notice-cell" @click="navigator('/pages/notice/shop/notice-serve')">
@@ -31,8 +33,10 @@
 						<image class="icon-image" :src="StaticUrl + 'icon/icon-notice-serve@2x.png'" mode=""></image>
 					</view>
 					<view class="notice-cell-text"> 服务通知 <text class="cell-text">官方</text> </view>
-					<view class="notice-cell-badge">
-						<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"> 5 </text>
+					<view class="notice-cell-badge" v-if="notificationCount>0">
+						<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"> 
+							{{ notificationCount | BadgeType }}
+						</text>
 					</view>
 				</view>
 			</view>
@@ -47,7 +51,15 @@ export default {
 			CustomBar: this.CustomBar,
 			StatusBar: this.StatusBar,
 			StaticUrl: this.$Static,
-			skeletonShow:true
+			skeletonShow:true,
+			shopId:0,
+			accountCount:0,
+			notificationCount:0
+		}
+	},
+	filters:{
+		BadgeType(value) {
+			if(value){return value > 99 ? '99+' : value}
 		}
 	},
 	created() {
@@ -59,9 +71,8 @@ export default {
 	methods: {
 		async initData() {
 			const userInfo = await this.$api.getStorage()
-			this.skeletonShow = true //预加载圆圈
-			this.userId = userInfo.userId ? userInfo.userId : 0
-			this.initGetList()
+			this.shopId = userInfo.shopId ? userInfo.shopId : 0
+			this.getUserAuthShopMessageCount()
 		},
 		clearNews() {
 			uni.vibrateShort({
@@ -71,8 +82,18 @@ export default {
 			});
 			this.$util.msg('已将所有消息标记为已读', 2000)
 		},
-		initGetList() {
+		getUserAuthShopMessageCount() {
 			console.log('获取消息通知数据')
+			//供应商详情
+			this.ShopService.getUserAuthShopMessageCount({ commonId: this.shopId })
+				.then(response => {
+					this.accountCount = response.data.accountCount
+					this.notificationCount = response.data.notificationCount
+					this.skeletonShow = false //预加载圆圈隐藏
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
 			this.skeletonShow = false
 		},
 		navigator(url) {

+ 3 - 1
mixins/appMixins.js

@@ -17,14 +17,16 @@ const appMixins = {
             })
                 .then(response =>{
                     this.$store.commit('updateStatus',response.data)
+                    this.$store.commit('updateNotice', response.data.savedCount)
                     this.login(response.data)
                     uni.setStorageSync('token',response.data.token)
                     uni.setStorageSync('unionId',response.data.unionId)
                 })
                 .catch(error =>{
                     this.logout(error.data)
-                    uni.setStorageSync('unionId',error.data.unionId)
                     this.$store.commit('updateStatus',error.data)
+                    this.$store.commit('updateNotice', error.data)
+                    uni.setStorageSync('unionId',error.data.unionId)
                     if(!this.hasLogin){
                         if(uni.getStorageSync('isActivitySwitch')){
                             const  lockTime = uni.getStorageSync('lockTime')

+ 90 - 74
pages/notice/club/notice-coupon.vue

@@ -47,71 +47,14 @@ export default {
 	data() {
 		return {
 			skeletonShow: true,
+			StaticUrl: this.$Static,
 			listQuery: {
-				userId: 0,
+				commonId: 0,
+				messageType: 4,
 				pageNum: 1,
 				pageSize: 10
 			},
-			list: [
-				{
-					type:1,
-					couponType:0,
-					couponAmount:'50000.00',
-					time: '2022-07-05 16:51:20',
-				},
-				{
-					type:1,
-					couponType:1,
-					categoryType:1,
-					couponAmount:'50000.00',
-					time: '2022-07-05 16:51:20',
-				},
-				{
-					type:1,
-					couponType:1,
-					categoryType:2,
-					couponAmount:'50000.00',
-					time: '2022-07-05 16:51:20',
-				},
-				{
-					type:1,
-					couponType:2,
-					couponAmount:'50000.00',
-					time: '2022-07-05 16:51:20',
-				},
-				{
-					type:1,
-					couponType:3,
-					shopName:'采美信息技术有限公司',
-					couponAmount:'50000.00',
-					time: '2022-07-05 16:51:20',
-				},
-				{
-					type:1,
-					couponType:4,
-					couponAmount:'50000.00',
-					time: '2022-07-05 16:51:20',
-				},
-				{
-					type:2,
-					couponType:4,
-					couponAmount:'50000.00',
-					endTime:"3天",
-					time: '2022-07-05 16:51:20',
-				},
-				{
-					type:3,
-					couponAmount:'50000.00',
-					endTime:"7天后",
-					time: '2022-07-05 16:51:20',
-				},
-				{
-					type:3,
-					couponAmount:'50000.00',
-					endTime:"今日即将",
-					time: '2022-07-05 16:51:20',
-				},
-			],
+			list: [],
 			isEmpty: false,
 			loadding: false,
 			pullUpOn: true,
@@ -129,26 +72,99 @@ export default {
 	methods: {
 		async initData() {
 			const userInfo = await this.$api.getStorage()
-			this.skeletonShow = false //预加载圆圈
-			this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
-			this.initGetCartGoodsList()
+			this.listQuery.commonId = userInfo.clubId ? userInfo.clubId : 0
+			this.getUserAuthClubMessageList()
 		},
-		deleteBtn(id){// 删除通知消息
-			uni.vibrateShort({
-				success: function () {
-					console.log('success');
-				}
-			});
-		},
-		initGetCartGoodsList() {
+		getUserAuthClubMessageList() {
+			this.UserService.getUserAuthClubMessageList(this.listQuery)
+				.then(response => {
+					let data = response.data
+					this.hasNextPage = response.data.hasNextPage
+					if (data.list && data.list.length > 0) {
+						this.isEmpty = false
+						this.list = [...data.list]
+						this.pullFlag = false
+						setTimeout(() => {
+							this.pullFlag = true
+						}, 500)
+						if (this.hasNextPage) {
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						} else {
+							if (this.list.length < 3) {
+								this.pullUpOn = true
+								this.loadding = false
+							} else {
+								this.pullUpOn = false
+								this.loadding = false
+								this.nomoreText = '到底了'
+							}
+						}
+					} else {
+						this.isEmpty = true
+					}
+					this.skeletonShow = false
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
 			console.log('获取消息通知数据')
 		},
-		initLogin() {
-			this.$api.redirectTo('/pages/login/login')
+		getReachBottomData(index) {
+			//上拉加载
+			this.listQuery.pageNum += 1
+			this.UserService.getUserAuthClubMessageList(this.listQuery)
+				.then(response => {
+					let data = response.data
+					if (data.list && data.list.length > 0) {
+						this.hasNextPage = data.hasNextPage
+						this.list = this.list.concat(data.list)
+						this.pullFlag = false // 防上拉暴滑
+						setTimeout(() => {
+							this.pullFlag = true
+						}, 500)
+						if (this.hasNextPage) {
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						} else {
+							this.pullUpOn = false
+							this.loadding = false
+							this.nomoreText = '已至底部'
+						}
+					}
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		},
+		deleteBtn(id) {
+			// 删除通知消息
+			this.UserService.authDeleteMessage({ id: id })
+				.then(response => {
+					uni.vibrateShort({
+						success: function() {
+							console.log('success')
+						}
+					})
+					this.listQuery.pageNum = 1
+					this.getUserAuthClubMessageList()
+				})
+				.catch(error => {
+					console.log('error=>', error.msg)
+				})
+		}
+	},
+	onReachBottom() {
+		if (this.hasNextPage) {
+			this.loadding = true
+			this.pullUpOn = true
+			this.getReachBottomData()
 		}
 	},
 	onPullDownRefresh() {
 		//下拉刷新
+		this.listQuery.pageNum = 1
+		this.getUserAuthShopMessageList()
 		uni.stopPullDownRefresh()
 	},
 	onShow() {}

+ 89 - 68
pages/notice/club/notice-order.vue

@@ -49,64 +49,12 @@ export default {
 			skeletonShow: true,
 			StaticUrl: this.$Static,
 			listQuery: {
-				userId: 0,
+				commonId: 0,
+				messageType: 1,
 				pageNum: 1,
 				pageSize: 10
 			},
-			list: [
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					orderId: 1234,
-					type:1,
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:2,
-					orderId: 1234,
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:3,
-					returnAmount:'100000.00',
-					orderId: 1234,
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:4,
-					cancelType:0,
-					orderId: 1234,
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:4,
-					cancelType:1,
-					orderId: 1234,
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:4,
-					cancelType:2,
-					orderId: 1234,
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:5,
-					orderId: 1234,
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:6,
-					orderId: 1234,
-				},
-			],
+			list: [],
 			isEmpty: false,
 			loadding: false,
 			pullUpOn: true,
@@ -124,26 +72,99 @@ export default {
 	methods: {
 		async initData() {
 			const userInfo = await this.$api.getStorage()
-			this.skeletonShow = false //预加载圆圈
-			this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
-			this.initGetCartGoodsList()
+			this.listQuery.commonId = userInfo.clubId ? userInfo.clubId : 0
+			this.getUserAuthClubMessageList()
 		},
-		deleteBtn(id){// 删除通知消息
-			uni.vibrateShort({
-				success: function () {
-					console.log('success');
-				}
-			});
-		},
-		initGetCartGoodsList() {
+		getUserAuthClubMessageList() {
+			this.UserService.getUserAuthClubMessageList(this.listQuery)
+				.then(response => {
+					let data = response.data
+					this.hasNextPage = response.data.hasNextPage
+					if (data.list && data.list.length > 0) {
+						this.isEmpty = false
+						this.list = [...data.list]
+						this.pullFlag = false
+						setTimeout(() => {
+							this.pullFlag = true
+						}, 500)
+						if (this.hasNextPage) {
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						} else {
+							if (this.list.length < 3) {
+								this.pullUpOn = true
+								this.loadding = false
+							} else {
+								this.pullUpOn = false
+								this.loadding = false
+								this.nomoreText = '到底了'
+							}
+						}
+					} else {
+						this.isEmpty = true
+					}
+					this.skeletonShow = false
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
 			console.log('获取消息通知数据')
 		},
-		initLogin() {
-			this.$api.redirectTo('/pages/login/login')
+		getReachBottomData(index) {
+			//上拉加载
+			this.listQuery.pageNum += 1
+			this.UserService.getUserAuthClubMessageList(this.listQuery)
+				.then(response => {
+					let data = response.data
+					if (data.list && data.list.length > 0) {
+						this.hasNextPage = data.hasNextPage
+						this.list = this.list.concat(data.list)
+						this.pullFlag = false // 防上拉暴滑
+						setTimeout(() => {
+							this.pullFlag = true
+						}, 500)
+						if (this.hasNextPage) {
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						} else {
+							this.pullUpOn = false
+							this.loadding = false
+							this.nomoreText = '已至底部'
+						}
+					}
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		},
+		deleteBtn(id) {
+			// 删除通知消息
+			this.UserService.authDeleteMessage({ id: id })
+				.then(response => {
+					uni.vibrateShort({
+						success: function() {
+							console.log('success')
+						}
+					})
+					this.listQuery.pageNum = 1
+					this.getUserAuthClubMessageList()
+				})
+				.catch(error => {
+					console.log('error=>', error.msg)
+				})
+		}
+	},
+	onReachBottom() {
+		if (this.hasNextPage) {
+			this.loadding = true
+			this.pullUpOn = true
+			this.getReachBottomData()
 		}
 	},
 	onPullDownRefresh() {
 		//下拉刷新
+		this.listQuery.pageNum = 1
+		this.getUserAuthShopMessageList()
 		uni.stopPullDownRefresh()
 	},
 	onShow() {}

+ 90 - 62
pages/notice/club/notice-serve.vue

@@ -49,58 +49,13 @@ export default {
 			skeletonShow: true,
 			StaticUrl: this.$Static,
 			listQuery: {
-				userId: 0,
+				commonId: 0,
+				messageType: 3,
 				pageNum: 1,
 				pageSize: 10
 			},
-			list: [
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:1,
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:2,
-					vipTime:'3个月'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:3,
-					endTime:'7日后'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:3,
-					endTime:'今日'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:4,
-					vipTime:'3个月'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:5
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:6
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:7,
-					wechatName:'@ZJY'
-				},
-			],
-			isEmpty: true,
+			list: [],
+			isEmpty: false,
 			loadding: false,
 			pullUpOn: true,
 			pullFlag: true,
@@ -117,26 +72,99 @@ export default {
 	methods: {
 		async initData() {
 			const userInfo = await this.$api.getStorage()
-			this.skeletonShow = false //预加载圆圈
-			this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
-			this.initGetCartGoodsList()
+			this.listQuery.commonId = userInfo.clubId ? userInfo.clubId : 0
+			this.getUserAuthClubMessageList()
 		},
-		deleteBtn(id){// 删除通知消息
-			uni.vibrateShort({
-				success: function () {
-					console.log('success');
-				}
-			});
-		},
-		initGetCartGoodsList() {
+		getUserAuthClubMessageList() {
+			this.UserService.getUserAuthClubMessageList(this.listQuery)
+				.then(response => {
+					let data = response.data
+					this.hasNextPage = response.data.hasNextPage
+					if (data.list && data.list.length > 0) {
+						this.isEmpty = false
+						this.list = [...data.list]
+						this.pullFlag = false
+						setTimeout(() => {
+							this.pullFlag = true
+						}, 500)
+						if (this.hasNextPage) {
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						} else {
+							if (this.list.length < 3) {
+								this.pullUpOn = true
+								this.loadding = false
+							} else {
+								this.pullUpOn = false
+								this.loadding = false
+								this.nomoreText = '到底了'
+							}
+						}
+					} else {
+						this.isEmpty = true
+					}
+					this.skeletonShow = false
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
 			console.log('获取消息通知数据')
 		},
-		initLogin() {
-			this.$api.redirectTo('/pages/login/login')
+		getReachBottomData(index) {
+			//上拉加载
+			this.listQuery.pageNum += 1
+			this.UserService.getUserAuthClubMessageList(this.listQuery)
+				.then(response => {
+					let data = response.data
+					if (data.list && data.list.length > 0) {
+						this.hasNextPage = data.hasNextPage
+						this.list = this.list.concat(data.list)
+						this.pullFlag = false // 防上拉暴滑
+						setTimeout(() => {
+							this.pullFlag = true
+						}, 500)
+						if (this.hasNextPage) {
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						} else {
+							this.pullUpOn = false
+							this.loadding = false
+							this.nomoreText = '已至底部'
+						}
+					}
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		},
+		deleteBtn(id) {
+			// 删除通知消息
+			this.UserService.authDeleteMessage({ id: id })
+				.then(response => {
+					uni.vibrateShort({
+						success: function() {
+							console.log('success')
+						}
+					})
+					this.listQuery.pageNum = 1
+					this.getUserAuthClubMessageList()
+				})
+				.catch(error => {
+					console.log('error=>', error.msg)
+				})
+		}
+	},
+	onReachBottom() {
+		if (this.hasNextPage) {
+			this.loadding = true
+			this.pullUpOn = true
+			this.getReachBottomData()
 		}
 	},
 	onPullDownRefresh() {
 		//下拉刷新
+		this.listQuery.pageNum = 1
+		this.getUserAuthShopMessageList()
 		uni.stopPullDownRefresh()
 	},
 	onShow() {}

+ 89 - 61
pages/notice/club/notice-users.vue

@@ -49,57 +49,12 @@ export default {
 			skeletonShow: true,
 			StaticUrl: this.$Static,
 			listQuery: {
-				userId: 0,
+				commonId: 0,
+				messageType: 2,
 				pageNum: 1,
 				pageSize: 10
 			},
-			list: [
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:1,
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:2,
-					vipTime:'3个月'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:3,
-					endTime:'7日后'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:3,
-					endTime:'今日'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:4,
-					vipTime:'3个月'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:5
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:6
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:7,
-					wechatName:'@ZJY'
-				},
-			],
+			list: [],
 			isEmpty: false,
 			loadding: false,
 			pullUpOn: true,
@@ -117,26 +72,99 @@ export default {
 	methods: {
 		async initData() {
 			const userInfo = await this.$api.getStorage()
-			this.skeletonShow = false //预加载圆圈
-			this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
-			this.initGetCartGoodsList()
+			this.listQuery.commonId = userInfo.clubId ? userInfo.clubId : 0
+			this.getUserAuthClubMessageList()
 		},
-		deleteBtn(id){// 删除通知消息
-			uni.vibrateShort({
-				success: function () {
-					console.log('success');
-				}
-			});
-		},
-		initGetCartGoodsList() {
+		getUserAuthClubMessageList() {
+			this.UserService.getUserAuthClubMessageList(this.listQuery)
+				.then(response => {
+					let data = response.data
+					this.hasNextPage = response.data.hasNextPage
+					if (data.list && data.list.length > 0) {
+						this.isEmpty = false
+						this.list = [...data.list]
+						this.pullFlag = false
+						setTimeout(() => {
+							this.pullFlag = true
+						}, 500)
+						if (this.hasNextPage) {
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						} else {
+							if (this.list.length < 3) {
+								this.pullUpOn = true
+								this.loadding = false
+							} else {
+								this.pullUpOn = false
+								this.loadding = false
+								this.nomoreText = '到底了'
+							}
+						}
+					} else {
+						this.isEmpty = true
+					}
+					this.skeletonShow = false
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
 			console.log('获取消息通知数据')
 		},
-		initLogin() {
-			this.$api.redirectTo('/pages/login/login')
+		getReachBottomData(index) {
+			//上拉加载
+			this.listQuery.pageNum += 1
+			this.UserService.getUserAuthClubMessageList(this.listQuery)
+				.then(response => {
+					let data = response.data
+					if (data.list && data.list.length > 0) {
+						this.hasNextPage = data.hasNextPage
+						this.list = this.list.concat(data.list)
+						this.pullFlag = false // 防上拉暴滑
+						setTimeout(() => {
+							this.pullFlag = true
+						}, 500)
+						if (this.hasNextPage) {
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						} else {
+							this.pullUpOn = false
+							this.loadding = false
+							this.nomoreText = '已至底部'
+						}
+					}
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		},
+		deleteBtn(id) {
+			// 删除通知消息
+			this.UserService.authDeleteMessage({ id: id })
+				.then(response => {
+					uni.vibrateShort({
+						success: function() {
+							console.log('success')
+						}
+					})
+					this.listQuery.pageNum = 1
+					this.getUserAuthClubMessageList()
+				})
+				.catch(error => {
+					console.log('error=>', error.msg)
+				})
+		}
+	},
+	onReachBottom() {
+		if (this.hasNextPage) {
+			this.loadding = true
+			this.pullUpOn = true
+			this.getReachBottomData()
 		}
 	},
 	onPullDownRefresh() {
 		//下拉刷新
+		this.listQuery.pageNum = 1
+		this.getUserAuthShopMessageList()
 		uni.stopPullDownRefresh()
 	},
 	onShow() {}

+ 15 - 31
pages/notice/shop/components/notice-cell.vue

@@ -5,23 +5,17 @@
 		<template v-if="cellType === 1">
 			<view class="tui-notice-cell clearfix">
 				<view class="tui-cell-top">
-					<view class="cell-title"> {{ cell.type | noticeUsersFilters }} </view>
+					<view class="cell-title"> {{ cell.shopMessType | noticeUsersFilters }} </view>
 					<view class="cell-time"> {{ cell.time }} </view>
 				</view>
-				<template v-if="cell.type === 3 || cell.type === 4 || cell.type === 5">
-					<view class="tui-cell-content" >
-						<view class="cell-image">
-							<img :src="cell.image" alt="">
-						</view>
-						<view class="cell-content">
-							{{ noticeUsersText(cell)}}
-						</view>
-					</view> 
+				<template v-if="cell.shopMessType === 3 || cell.shopMessType === 4 || cell.shopMessType === 6">
+					<view class="tui-cell-content">
+						<view class="cell-image"> <img :src="cell.mainImage" alt="" /> </view>
+						<view class="cell-content"> {{ noticeUsersText(cell) }} </view>
+					</view>
 				</template>
 				<template v-else>
-					<view class="tui-cell-content">
-						{{ noticeUsersText(cell)}}
-					</view> 
+					<view class="tui-cell-content"> {{ noticeUsersText(cell) }} </view>
 				</template>
 			</view>
 		</template>
@@ -29,12 +23,10 @@
 		<template v-if="cellType === 2">
 			<view class="tui-notice-cell clearfix">
 				<view class="tui-cell-top">
-					<view class="cell-title"> {{ cell.type | noticeServeFilters }} </view>
+					<view class="cell-title"> {{ cell.shopTieredType | noticeServeFilters }} </view>
 					<view class="cell-time"> {{ cell.time }} </view>
 				</view>
-				<view class="tui-cell-content"> 
-					{{ noticeServeText(cell)}}
-				</view> 
+				<view class="tui-cell-content"> {{ noticeServeText(cell) }} </view>
 			</view>
 		</template>
 	</view>
@@ -47,27 +39,19 @@ export default {
 	mixins: [noticeMixins],
 	name: 'notice-cell',
 	props: {
-		cellType:{
-			type:Number
+		cellType: {
+			type: Number
 		},
 		cell: {
 			type: Object
 		}
 	},
 	data() {
-		return {
-			
-		}
+		return {}
 	},
-	created() {
-		
-	},
-	methods: {
-		
-	}
+	created() {},
+	methods: {}
 }
 </script>
 
-<style lang="scss">
-
-</style>
+<style lang="scss"></style>

+ 5 - 5
pages/notice/shop/mixins/notice.mixins.js

@@ -25,18 +25,18 @@ const noticeMixins = {
         noticeUsersText(cell) { // 账户通知文案
             const map = {
 			    1: '您的注册信息已审核通过,恭喜您成为采美平台供应商用户。您可以上架商品到采美商城进行出售了',
-			    2: `恭喜您(微信昵称:${cell.wechatName})成功成为【采美信息技术有限公司】的运营人员。`,
+			    2: `恭喜您(微信昵称:${cell.content})成功成为【采美信息技术有限公司】的运营人员。`,
 			    3: '该商品上架审核未通过,暂时不能上架采美商城。请登录采美网站修改商品资料重新提交。',
 			    4: '该商品新品展示审核未通过,未能展示在采美商城新品橱窗。',
-			    5: `该商品的资质证书将于${cell.endtime}后失效,请及时登录采美网站上传新证书。`
+			    5: `该商品的资质证书将于${cell.content}后失效,请及时登录采美网站上传新证书。`
             }
-            return map[cell.type]
+            return map[cell.shopMessType]
         },
         noticeServeText(cell) { // 服务通知文案
             const map = {
-			    1: `您的供应商账号上架费将于${cell.endTime}后到期,到期后将无法发布和编辑商品,同时也会影响到其他采美提供的支持服务。请联系采美工作人员进行续费,联系电话0755-22907771 或15338851365`
+			    1: `您的供应商账号上架费将于${cell.content}后到期,到期后将无法发布和编辑商品,同时也会影响到其他采美提供的支持服务。请联系采美工作人员进行续费,联系电话0755-22907771 或15338851365`
             }
-            return map[cell.type]
+            return map[cell.shopTieredType]
         }
     }
 }

+ 99 - 50
pages/notice/shop/notice-serve.vue

@@ -41,7 +41,7 @@
 import { mapState, mapMutations } from 'vuex'
 import noticeCell from './components/notice-cell.vue'
 export default {
-	components:{
+	components: {
 		noticeCell
 	},
 	data() {
@@ -49,36 +49,12 @@ export default {
 			skeletonShow: true,
 			StaticUrl: this.$Static,
 			listQuery: {
-				userId: 0,
+				commonId: 0,
+				messageType: 3,
 				pageNum: 1,
 				pageSize: 10
 			},
-			list: [
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:1,
-					endTime:'30日后到期'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:1,
-					endTime:'7日后到期'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:1,
-					endTime:'今日后到期'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:1,
-					endTime:'已过期'
-				}
-			],
+			list: [],
 			isEmpty: false,
 			loadding: false,
 			pullUpOn: true,
@@ -96,26 +72,99 @@ export default {
 	methods: {
 		async initData() {
 			const userInfo = await this.$api.getStorage()
-			this.skeletonShow = false //预加载圆圈
-			this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
-			this.initGetCartGoodsList()
+			this.listQuery.commonId = userInfo.shopId ? userInfo.shopId : 0
+			this.getUserAuthShopMessageList()
 		},
-		deleteBtn(id){// 删除通知消息
-			uni.vibrateShort({
-				success: function () {
-					console.log('success');
-				}
-			});
-		},
-		initGetCartGoodsList() {
+		getUserAuthShopMessageList() {
+			this.ShopService.getUserAuthShopMessageList(this.listQuery)
+				.then(response => {
+					let data = response.data
+					this.hasNextPage = response.data.hasNextPage
+					if (data.list && data.list.length > 0) {
+						this.isEmpty = false
+						this.list = [...data.list]
+						this.pullFlag = false
+						setTimeout(() => {
+							this.pullFlag = true
+						}, 500)
+						if (this.hasNextPage) {
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						} else {
+							if (this.list.length < 5) {
+								this.pullUpOn = true
+								this.loadding = false
+							} else {
+								this.pullUpOn = false
+								this.loadding = false
+								this.nomoreText = '到底了'
+							}
+						}
+					} else {
+						this.isEmpty = true
+					}
+					this.skeletonShow = false
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
 			console.log('获取消息通知数据')
 		},
-		initLogin() {
-			this.$api.redirectTo('/pages/login/login')
+		getReachBottomData(index) {
+			//上拉加载
+			this.listQuery.pageNum += 1
+			this.ShopService.getUserAuthShopMessageList(this.listQuery)
+				.then(response => {
+					let data = response.data
+					if (data.list && data.list.length > 0) {
+						this.hasNextPage = data.hasNextPage
+						this.list = this.list.concat(list)
+						this.pullFlag = false // 防上拉暴滑
+						setTimeout(() => {
+							this.pullFlag = true
+						}, 500)
+						if (this.hasNextPage) {
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						} else {
+							this.pullUpOn = false
+							this.loadding = false
+							this.nomoreText = '已至底部'
+						}
+					}
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		},
+		deleteBtn(id) {
+			// 删除通知消息
+			this.UserService.authDeleteMessage({ id: id })
+				.then(response => {
+					uni.vibrateShort({
+						success: function() {
+							console.log('success')
+						}
+					})
+					this.listQuery.pageNum = 1
+					this.getUserAuthShopMessageList()
+				})
+				.catch(error => {
+					console.log('error=>', error.msg)
+				})
+		}
+	},
+	onReachBottom() {
+		if (this.hasNextPage) {
+			this.loadding = true
+			this.pullUpOn = true
+			this.getReachBottomData()
 		}
 	},
 	onPullDownRefresh() {
 		//下拉刷新
+		this.listQuery.pageNum = 1
+		this.getUserAuthShopMessageList()
 		uni.stopPullDownRefresh()
 	},
 	onShow() {}
@@ -136,10 +185,10 @@ page {
 		margin-top: -300rpx;
 	}
 }
-.tui-swipeout-content{
-	white-space:normal !important;
+.tui-swipeout-content {
+	white-space: normal !important;
 }
-.tui-notice{
+.tui-notice {
 	margin-bottom: 24rpx;
 }
 .tui-notice-cell {
@@ -148,26 +197,26 @@ page {
 	background-color: #ffffff;
 	border-radius: 16rpx;
 	box-sizing: border-box;
-	padding:16rpx 24rpx;
+	padding: 16rpx 24rpx;
 	margin: 0 auto;
-	.tui-cell-top{
+	.tui-cell-top {
 		width: 100%;
 		height: 88rpx;
 		line-height: 88rpx;
 		float: left;
-		.cell-title{
+		.cell-title {
 			font-size: 32rpx;
 			color: #333333;
 			float: left;
 			font-weight: bold;
 		}
-		.cell-time{
+		.cell-time {
 			font-size: 24rpx;
 			color: #999999;
 			float: right;
 		}
 	}
-	.tui-cell-content{
+	.tui-cell-content {
 		width: 100%;
 		height: auto;
 		float: left;
@@ -175,7 +224,7 @@ page {
 		border-radius: 8rpx;
 		line-height: 44rpx;
 		padding: 24rpx;
-		background-color: #F7F7F7;
+		background-color: #f7f7f7;
 		font-size: 28rpx;
 		color: #666666;
 		text-align: justify;

+ 102 - 76
pages/notice/shop/notice-users.vue

@@ -41,7 +41,7 @@
 import { mapState, mapMutations } from 'vuex'
 import noticeCell from './components/notice-cell.vue'
 export default {
-	components:{
+	components: {
 		noticeCell
 	},
 	data() {
@@ -49,59 +49,12 @@ export default {
 			skeletonShow: true,
 			StaticUrl: this.$Static,
 			listQuery: {
-				userId: 0,
+				commonId: 0,
+				messageType: 2,
 				pageNum: 1,
 				pageSize: 10
 			},
-			list: [
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:1,
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:2,
-					wechatName:'@ZJY'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:3,
-					endTime:'7日后'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:4,
-					endTime:'今日'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:5,
-					endtime:'3个月'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:5,
-					endtime:'1个月'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:5,
-					endtime:'7天'
-				},
-				{
-					time: '2022-07-05 16:51:20',
-					image: 'https://img.caimei365.com/group1/M00/00/1E/rB-lF2JgwhiAWYBKAAE3BA2cBSY917.jpg',
-					type:5,
-					endtime:'今天'
-				},
-			],
+			list: [],
 			isEmpty: false,
 			loadding: false,
 			pullUpOn: true,
@@ -119,26 +72,99 @@ export default {
 	methods: {
 		async initData() {
 			const userInfo = await this.$api.getStorage()
-			this.skeletonShow = false //预加载圆圈
-			this.listQuery.userId = userInfo.userId ? userInfo.userId : 0
-			this.initGetCartGoodsList()
+			this.listQuery.commonId = userInfo.shopId ? userInfo.shopId : 0
+			this.getUserAuthShopMessageList()
 		},
-		deleteBtn(id){// 删除通知消息
-			uni.vibrateShort({
-				success: function () {
-					console.log('success');
-				}
-			});
-		},
-		initGetCartGoodsList() {
+		getUserAuthShopMessageList() {
+			this.ShopService.getUserAuthShopMessageList(this.listQuery)
+				.then(response => {
+					let data = response.data
+					this.hasNextPage = response.data.hasNextPage
+					if (data.list && data.list.length > 0) {
+						this.isEmpty = false
+						this.list = [...data.list]
+						this.pullFlag = false
+						setTimeout(() => {
+							this.pullFlag = true
+						}, 500)
+						if (this.hasNextPage) {
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						} else {
+							if (this.list.length < 3) {
+								this.pullUpOn = true
+								this.loadding = false
+							} else {
+								this.pullUpOn = false
+								this.loadding = false
+								this.nomoreText = '到底了'
+							}
+						}
+					} else {
+						this.isEmpty = true
+					}
+					this.skeletonShow = false
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
 			console.log('获取消息通知数据')
 		},
-		initLogin() {
-			this.$api.redirectTo('/pages/login/login')
+		getReachBottomData(index) {
+			//上拉加载
+			this.listQuery.pageNum += 1
+			this.ShopService.getUserAuthShopMessageList(this.listQuery)
+				.then(response => {
+					let data = response.data
+					if (data.list && data.list.length > 0) {
+						this.hasNextPage = data.hasNextPage
+						this.list = this.list.concat(data.list)
+						this.pullFlag = false // 防上拉暴滑
+						setTimeout(() => {
+							this.pullFlag = true
+						}, 500)
+						if (this.hasNextPage) {
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						} else {
+							this.pullUpOn = false
+							this.loadding = false
+							this.nomoreText = '已至底部'
+						}
+					}
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		},
+		deleteBtn(id) {
+			// 删除通知消息
+			this.UserService.authDeleteMessage({ id: id })
+				.then(response => {
+					uni.vibrateShort({
+						success: function() {
+							console.log('success')
+						}
+					})
+					this.listQuery.pageNum = 1
+					this.getUserAuthShopMessageList()
+				})
+				.catch(error => {
+					console.log('error=>', error.msg)
+				})
+		}
+	},
+	onReachBottom() {
+		if (this.hasNextPage) {
+			this.loadding = true
+			this.pullUpOn = true
+			this.getReachBottomData()
 		}
 	},
 	onPullDownRefresh() {
 		//下拉刷新
+		this.listQuery.pageNum = 1
+		this.getUserAuthShopMessageList()
 		uni.stopPullDownRefresh()
 	},
 	onShow() {}
@@ -159,10 +185,10 @@ page {
 		margin-top: -300rpx;
 	}
 }
-.tui-swipeout-content{
-	white-space:normal !important;
+.tui-swipeout-content {
+	white-space: normal !important;
 }
-.tui-notice{
+.tui-notice {
 	margin-bottom: 24rpx;
 }
 .tui-notice-cell {
@@ -171,26 +197,26 @@ page {
 	background-color: #ffffff;
 	border-radius: 16rpx;
 	box-sizing: border-box;
-	padding:16rpx 24rpx;
+	padding: 16rpx 24rpx;
 	margin: 0 auto;
-	.tui-cell-top{
+	.tui-cell-top {
 		width: 100%;
 		height: 88rpx;
 		line-height: 88rpx;
 		float: left;
-		.cell-title{
+		.cell-title {
 			font-size: 32rpx;
 			color: #333333;
 			float: left;
 			font-weight: bold;
 		}
-		.cell-time{
+		.cell-time {
 			font-size: 24rpx;
 			color: #999999;
 			float: right;
 		}
 	}
-	.tui-cell-content{
+	.tui-cell-content {
 		width: 100%;
 		height: auto;
 		float: left;
@@ -198,23 +224,23 @@ page {
 		border-radius: 8rpx;
 		line-height: 44rpx;
 		padding: 24rpx;
-		background-color: #F7F7F7;
+		background-color: #f7f7f7;
 		font-size: 28rpx;
 		color: #666666;
 		text-align: justify;
-		.cell-image{
+		.cell-image {
 			width: 128rpx;
 			height: 128rpx;
 			border-radius: 8rpx;
 			float: left;
-			image{
+			image {
 				width: 128rpx;
 				height: 128rpx;
 				display: block;
 				border-radius: 8rpx;
 			}
 		}
-		.cell-content{
+		.cell-content {
 			width: 479rpx;
 			height: 100%;
 			box-sizing: border-box;

+ 8 - 9
pages/supplier/index/index.vue

@@ -90,20 +90,14 @@ export default {
 				title: '账户中心', // 导航栏 中间的标题
 				textLeft: false
 			},
-			upNum:120,
+			upNum:0,
 			isIphoneX: this.$store.state.isIphoneX,
 			CustomBar: this.CustomBar // 顶部导航栏高度
 		}
 	},
 	filters: {
-		BadgeType(n) {
-			let num = ''
-			if (n > 99) {
-				num = '99+'
-			} else {
-				num = n
-			}
-			return num
+		BadgeType(value) {
+			if(value){return value > 99 ? '99+' : value}
 		}
 	},
 	onLoad() {
@@ -111,10 +105,15 @@ export default {
 			// 一定要等视图更新完再调用方法
 			setTimeout(() => {
 				this.isUserData = true
+				this.initData();
 			}, 100)
 		})
 	},
 	methods: {
+		async initData() {
+			const userInfo = await this.$api.getStorage()
+			this.upNum = userInfo.savedCount
+		},
 		// 切换组件
 		cut_index(type) {
 			this.show_index = type

+ 0 - 1
pages/tabBar/home/index.vue

@@ -232,7 +232,6 @@ export default {
 			// 获取购物车数量
 			this.OrderService.ShoppingCartCount({ userId: this.userID }).then(res => {
 				this.$store.commit('updateAllNum', res.data)
-				this.$store.commit('updateNotice', 120)
 			})
 		},
 		handleClick(data) {

+ 51 - 17
pages/tabBar/notice/index.vue

@@ -17,13 +17,15 @@
 				</view>
 			</view>
 			<view class="container-notice">
-				<view class="notice-cell"  @click="navigator('/pages/notice/club/notice-order')">
+				<view class="notice-cell" @click="navigator('/pages/notice/club/notice-order')">
 					<view class="notice-cell-icon">
 						<image class="icon-image" :src="StaticUrl + 'icon/icon-notice-order@2x.png'" mode=""></image>
 					</view>
 					<view class="notice-cell-text"> 交易物流 <text class="cell-text">官方</text> </view>
-					<view class="notice-cell-badge">
-						<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"> 99+ </text>
+					<view class="notice-cell-badge" v-if="tradeCount>0">
+						<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
+							{{ tradeCount | BadgeType }}
+						</text>
 					</view>
 				</view>
 				<view class="notice-cell" @click="navigator('/pages/notice/club/notice-users')">
@@ -31,8 +33,10 @@
 						<image class="icon-image" :src="StaticUrl + 'icon/icon-notice-users@2x.png'" mode=""></image>
 					</view>
 					<view class="notice-cell-text"> 账户通知 <text class="cell-text">官方</text> </view>
-					<view class="notice-cell-badge">
-						<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"> 99+ </text>
+					<view class="notice-cell-badge" v-if="accountCount>0">
+						<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
+							{{ accountCount | BadgeType }}
+						</text>
 					</view>
 				</view>
 				<view class="notice-cell" @click="navigator('/pages/notice/club/notice-serve')">
@@ -40,8 +44,10 @@
 						<image class="icon-image" :src="StaticUrl + 'icon/icon-notice-serve@2x.png'" mode=""></image>
 					</view>
 					<view class="notice-cell-text"> 服务通知 <text class="cell-text">官方</text> </view>
-					<view class="notice-cell-badge">
-						<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"> 5 </text>
+					<view class="notice-cell-badge" v-if="notificationCount>0">
+						<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
+							{{ notificationCount | BadgeType }}
+						</text>
 					</view>
 				</view>
 				<view class="notice-cell" @click="navigator('/pages/notice/club/notice-coupon')">
@@ -49,8 +55,10 @@
 						<image class="icon-image" :src="StaticUrl + 'icon/icon-notice-coupon@2x.png'" mode=""></image>
 					</view>
 					<view class="notice-cell-text"> 优惠促销 <text class="cell-text">官方</text> </view>
-					<view class="notice-cell-badge">
-						<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"> 10 </text>
+					<view class="notice-cell-badge" v-if="promotionCount>0">
+						<text class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
+							{{ promotionCount | BadgeType }}
+						</text>
 					</view>
 				</view>
 			</view>
@@ -65,10 +73,22 @@ export default {
 			CustomBar: this.CustomBar,
 			StatusBar: this.StatusBar,
 			StaticUrl: this.$Static,
-			skeletonShow:true
+			skeletonShow: true,
+			clubId: 0,
+			tradeCount: 0,
+			accountCount: 0,
+			notificationCount: 0,
+			promotionCount: 0
 		}
 	},
 	onLoad() {},
+	filters: {
+		BadgeType(value) {
+			if (value) {
+				return value > 99 ? '99+' : value
+			}
+		}
+	},
 	computed: {
 		...mapState(['hasLogin', 'userInfo'])
 	},
@@ -76,19 +96,32 @@ export default {
 		async initData() {
 			const userInfo = await this.$api.getStorage()
 			this.skeletonShow = true //预加载圆圈
-			this.userId = userInfo.userId ? userInfo.userId : 0
-			this.initGetCartGoodsList()
+			this.clubId = userInfo.clubId ? userInfo.clubId : 0
+			console.log('clubId',this.clubId)
+			this.getUserAuthClubMessageCount()
 		},
 		clearNews() {
 			uni.vibrateShort({
-				success: function () {
-					console.log('success');
+				success: function() {
+					console.log('success')
 				}
-			});
+			})
 			this.$util.msg('已将所有消息标记为已读', 2000)
 		},
-		initGetCartGoodsList() {
+		getUserAuthClubMessageCount() {
 			console.log('获取消息通知数据')
+			//供应商详情
+			this.UserService.getUserAuthClubMessageCount({ commonId: this.clubId })
+				.then(response => {
+					this.tradeCount = response.data.tradeCount // 交易物流
+					this.accountCount = response.data.account // 账户通知
+					this.notificationCount = response.data.notificationCount // 服务通知
+					this.promotionCount = response.data.promotionCount // 优惠促销
+					this.skeletonShow = false //预加载圆圈隐藏
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
 			this.skeletonShow = false
 		},
 		initLogin() {
@@ -96,10 +129,11 @@ export default {
 		},
 		navigator(url) {
 			this.$api.navigateTo(url)
-		},
+		}
 	},
 	onPullDownRefresh() {
 		//下拉刷新
+		this.initData()
 		uni.stopPullDownRefresh()
 	},
 	onShow() {

+ 2 - 2
services/config.env.js

@@ -3,8 +3,8 @@ if(process.env.NODE_ENV === 'development'){
     // 开发环境
     // URL_CONFIG = 'http://192.168.2.67:18002'	 //智捷联调地址
     // URL_CONFIG = 'http://192.168.2.68:18002'	 //涛涛联调地址
-    // URL_CONFIG = 'http://192.168.2.75:18002'	 //超超联调地址
-    URL_CONFIG = 'https://core-b.caimei365.com'
+    URL_CONFIG = 'http://192.168.2.180:18002'	 //超超联调地址
+    // URL_CONFIG = 'https://core-b.caimei365.com'
     // URL_CONFIG = 'https://core.caimei365.com'
 }else{
     // 生产环境

+ 268 - 243
services/shop.service.js

@@ -2,250 +2,275 @@
  * 这是与购物有关的业务逻辑的服务
  */
 export default class ShopService {
-	constructor(AjaxService) {
-		Object.assign(this, { AjaxService })
-		this.name = 'ShopService'
-	}
-	/* 小程序-供应商注册第一步 */
-	SupplierAppletsRegistered (data = {}) {
-		return this.AjaxService.post({ 
-			url:'/user/register/shop', 
-			data, 
-			isLoading: true,
-			  
-		})
-	}
-	/* 小程序-搜索供应商列表 */
-	GetSearchSupplierList (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/commodity/search/query/shop', 
-			data, 
-			isLoading: true ,
-			  
-		})
-	}
-	/* 小程序供应商个人中心 */
-	GetHomePageData (data = {}) {
-		return this.AjaxService.get({ url:'/user/shop/personal/data', data, isLoading: true })
-	}
-	/* 小程序供应商我的商品 */
-	GetSupplierPyProduct (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/commodity/shop/product/list', 
-			data, 
-			isLoading: true ,
-			  
-		})
-	}
-	/* 小程序供应商操作添加删除主推商品 */
-	SupplierSwitchFeaturedyProduct (data = {}) {
-		return this.AjaxService.post({ 
-			url:'/commodity/shop/featured/switch', 
-			data, 
-			isLoading: true ,
-			  
-		})
-	}
-	/* 小程序供应商操作下架商品 */
-	SupplierSoldOutProduct (data = {}) {
-		return this.AjaxService.post({ 
-			url:'/commodity/shop/product/offline', 
-			data, 
-			isLoading: true ,
-			  
-		})
-	}
-	/* 小程序供应商我的店铺详情 */
-	GetSupplierHomeDeatils (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/user/shop/home/data', 
-			data, 
-			isLoading: true ,
-		})
-	}
-	/* 小程序供应商我的店铺banner */
-	GetSupplierHomeBanner (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/user/shop/home/images', 
-			data, 
-			isLoading: true ,
-		})
-	}
-	/* 小程序供应商我的店铺主推商品 */
-	GetSupplierHomeProduct (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/commodity/shop/product/main', 
-			data, 
-			isLoading: true ,
-			  
-		})
-	}
-	/* 小程序供应商我的店铺全部商品 */
-	GetSupplierHomeProductList (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/commodity/search/query/product/shop', 
-			data, 
-			isLoading: false ,
-			  
-		})
-	}
-	/* 发货-添加商品资质初始化查询商品 */
-	GetSupplierLogisticsRecord (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/order/shop/ship/logistics/record', 
-			data, 
-			isLoading: false ,
-			  
-		})
-	}
-	/* 发货-商品资质回显 */
-	GetSupplierQualificationData (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/order/shop/qualification/list', 
-			data, 
-			isLoading: false ,
-			  
-		})
-	}
-	/* 发货-保存商品资质 */
-	GetSupplierQualificationUpdata (data = {}) {
-		return this.AjaxService.post({ 
-			url:'/order/shop/qualification/save', 
-			data, 
-			isLoading: false ,
-			  
-		})
-	}
-	/* 小程序供应商我的订单 */
-	GetSupplierMyOrderList (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/order/shop/list', 
-			data, 
-			isLoading: true ,
-			  
-		})
-	}
-	/* 小程序发货-权限控制 */
-	MiniShipments (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/order/shop/share/code/check', 
-			data, 
-			isLoading: true ,
-			  
-		})
-	}
-	/* 小程序发货-查询供应商子订单详情 */
-	GetShopOrderDetails (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/order/shop/detail', 
-			data, 
-			isLoading: true ,
-			  
-		})
-	}
-	/* 小程序发货-供应商订单详情获取订单分享码 */
-	ShopOrderShareCode (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/order/shop/share/code', 
-			data, 
-			isLoading: false ,
-			  
-		})
-	}
-	/* 小程序发货-供应商订单发货商品查询 */
-	ShopOrderShipmentsInfo (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/order/shop/ship/info', 
-			data, 
-			isLoading: true ,
-			  
-		})
-	}
-	/* 小程序发货-物流公司查询 */
-	GetLogisticsCompany (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/order/shop/ship/company', 
-			data, 
-			isLoading: true ,
-			  
-		})
-	}
-	/* 小程序发货-查看发货记录物流信息 */
-	GetLogisticsInfo (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/order/shop/ship/logistics/info', 
-			data, 
-			isLoading: true ,
-			  
-		})
-	}
-	/* 小程序发货-查看发货记录-添加物流 */
-	ShopAddLogisticsInfo (data = {}) {
-		return this.AjaxService.post({ 
-			url:'/order/shop/ship/logistics/add', 
-			data, 
-			isLoading: true,
-			  
-		})
-	}
-	/* 小程序发货-扫码获取物流公司信息 */
-	GetExpressInformation (data = {}) {
-		return this.AjaxService.post({ 
-			url:'/order/shop/ship/logistics/scan', 
-			data, 
-			isLoading: false,
-			  
-		})
-	}
-	/* 小程序发货-确认发货 */
-	ShopAddLogistics (data = {}) {
-		return this.AjaxService.post({ 
-			url:'/order/shop/ship/delivery',
+    constructor(AjaxService) {
+        Object.assign(this, { AjaxService })
+        this.name = 'ShopService'
+    }
+    /* 小程序-供应商注册第一步 */
+    SupplierAppletsRegistered (data = {}) {
+        return this.AjaxService.post({ 
+            url:'/user/register/shop', 
+            data, 
+            isLoading: true,
+			  
+        })
+    }
+    /* 小程序-搜索供应商列表 */
+    GetSearchSupplierList (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/commodity/search/query/shop', 
+            data, 
+            isLoading: true ,
+			  
+        })
+    }
+    /* 小程序供应商个人中心 */
+    GetHomePageData (data = {}) {
+        return this.AjaxService.get({ url:'/user/shop/personal/data', data, isLoading: true })
+    }
+    /* 小程序供应商我的商品 */
+    GetSupplierPyProduct (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/commodity/shop/product/list', 
+            data, 
+            isLoading: true ,
+			  
+        })
+    }
+    /* 小程序供应商操作添加删除主推商品 */
+    SupplierSwitchFeaturedyProduct (data = {}) {
+        return this.AjaxService.post({ 
+            url:'/commodity/shop/featured/switch', 
+            data, 
+            isLoading: true ,
+			  
+        })
+    }
+    /* 小程序供应商操作下架商品 */
+    SupplierSoldOutProduct (data = {}) {
+        return this.AjaxService.post({ 
+            url:'/commodity/shop/product/offline', 
+            data, 
+            isLoading: true ,
+			  
+        })
+    }
+    /* 小程序供应商我的店铺详情 */
+    GetSupplierHomeDeatils (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/user/shop/home/data', 
+            data, 
+            isLoading: true ,
+        })
+    }
+    /* 小程序供应商我的店铺banner */
+    GetSupplierHomeBanner (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/user/shop/home/images', 
+            data, 
+            isLoading: true ,
+        })
+    }
+    /* 小程序供应商我的店铺主推商品 */
+    GetSupplierHomeProduct (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/commodity/shop/product/main', 
+            data, 
+            isLoading: true ,
+			  
+        })
+    }
+    /* 小程序供应商我的店铺全部商品 */
+    GetSupplierHomeProductList (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/commodity/search/query/product/shop', 
+            data, 
+            isLoading: false ,
+			  
+        })
+    }
+    /* 发货-添加商品资质初始化查询商品 */
+    GetSupplierLogisticsRecord (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/shop/ship/logistics/record', 
+            data, 
+            isLoading: false ,
+			  
+        })
+    }
+    /* 发货-商品资质回显 */
+    GetSupplierQualificationData (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/shop/qualification/list', 
+            data, 
+            isLoading: false ,
+			  
+        })
+    }
+    /* 发货-保存商品资质 */
+    GetSupplierQualificationUpdata (data = {}) {
+        return this.AjaxService.post({ 
+            url:'/order/shop/qualification/save', 
+            data, 
+            isLoading: false ,
+			  
+        })
+    }
+    /* 小程序供应商我的订单 */
+    GetSupplierMyOrderList (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/shop/list', 
+            data, 
+            isLoading: true ,
+			  
+        })
+    }
+    /* 小程序发货-权限控制 */
+    MiniShipments (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/shop/share/code/check', 
+            data, 
+            isLoading: true ,
+			  
+        })
+    }
+    /* 小程序发货-查询供应商子订单详情 */
+    GetShopOrderDetails (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/shop/detail', 
+            data, 
+            isLoading: true ,
+			  
+        })
+    }
+    /* 小程序发货-供应商订单详情获取订单分享码 */
+    ShopOrderShareCode (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/shop/share/code', 
+            data, 
+            isLoading: false ,
+			  
+        })
+    }
+    /* 小程序发货-供应商订单发货商品查询 */
+    ShopOrderShipmentsInfo (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/shop/ship/info', 
+            data, 
+            isLoading: true ,
+			  
+        })
+    }
+    /* 小程序发货-物流公司查询 */
+    GetLogisticsCompany (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/shop/ship/company', 
+            data, 
+            isLoading: true ,
+			  
+        })
+    }
+    /* 小程序发货-查看发货记录物流信息 */
+    GetLogisticsInfo (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/shop/ship/logistics/info', 
+            data, 
+            isLoading: true ,
+			  
+        })
+    }
+    /* 小程序发货-查看发货记录-添加物流 */
+    ShopAddLogisticsInfo (data = {}) {
+        return this.AjaxService.post({ 
+            url:'/order/shop/ship/logistics/add', 
+            data, 
+            isLoading: true,
+			  
+        })
+    }
+    /* 小程序发货-扫码获取物流公司信息 */
+    GetExpressInformation (data = {}) {
+        return this.AjaxService.post({ 
+            url:'/order/shop/ship/logistics/scan', 
+            data, 
+            isLoading: false,
+			  
+        })
+    }
+    /* 小程序发货-确认发货 */
+    ShopAddLogistics (data = {}) {
+        return this.AjaxService.post({ 
+            url:'/order/shop/ship/delivery',
 			 data, 
 			 isLoading: true ,
 			   
-		})
-	}
-	/* 小程序发货-发货记录 */
-	ShopShipmentsRecord (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/order/shop/ship/delivery/record', 
-			data, 
-			isLoading: true ,
-			  
-		})
-	}
-	/* 小程序发货-撤销发货 */
-	ShopCancelShipment (data = {}) {
-		return this.AjaxService.post({ 
-			url:'/order/shop/ship/delivery/cancel', 
-			data, 
-			isLoading: true ,
-			  
-		})
-	}
-	/* 一级分类 */
-	GetPrimaryClassification (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/commodity/type/first',
-			data, 
-			isLoading: false ,
-		})
-	}
-	/* 二级级分类 */
-	GetPrimarySecondaryClassification (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/supplier/secondaryClassification', 
-			data, 
-			isLoading: false ,
-		})
-	}
-	/* 三级分类 */
-	GetPrimaryThreeLevelClassification (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/supplier/threeLevelClassification', 
-			data, 
-			isLoading: false ,
-		})
-	}
+        })
+    }
+    /* 小程序发货-发货记录 */
+    ShopShipmentsRecord (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/shop/ship/delivery/record', 
+            data, 
+            isLoading: true ,
+			  
+        })
+    }
+    /* 小程序发货-撤销发货 */
+    ShopCancelShipment (data = {}) {
+        return this.AjaxService.post({ 
+            url:'/order/shop/ship/delivery/cancel', 
+            data, 
+            isLoading: true ,
+			  
+        })
+    }
+    /* 一级分类 */
+    GetPrimaryClassification (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/commodity/type/first',
+            data, 
+            isLoading: false ,
+        })
+    }
+    /* 二级级分类 */
+    GetPrimarySecondaryClassification (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/supplier/secondaryClassification', 
+            data, 
+            isLoading: false ,
+        })
+    }
+    /* 三级分类 */
+    GetPrimaryThreeLevelClassification (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/supplier/threeLevelClassification', 
+            data, 
+            isLoading: false ,
+        })
+    }
+    /**
+	 *@供应商消息通知中心未读消息数量
+	 */
+    getUserAuthShopMessageCount(data = {}) {
+	    return this.AjaxService.get({
+	        url: '/user/login/auth/shopMessageCount',
+	        data,
+	        isLoading: false,
+	    })
+    }
+    /**
+	 *@供应商消息通知列表
+	 *@param commonId:供应商shopId
+	 *@param messageType:消息类型1.交易物流2.账户通知3.服务通知4.优惠促销
+	 *@param pageNum	页码
+	 *@param pageSize	条数
+	 */
+    getUserAuthShopMessageList(data = {}) {
+	    return this.AjaxService.get({
+	        url: '/user/login/auth/shopMessageList',
+	        data,
+	        isLoading: false,
+	
+	    })
+    }
 }

+ 36 - 0
services/user.service.js

@@ -575,4 +575,40 @@ export default class UserService {
 
         })
     }
+    /**
+	 *@机构消息通知中心未读消息数量
+	 */
+    getUserAuthClubMessageCount(data = {}) {
+	    return this.AjaxService.get({
+	        url: '/user/login/auth/ClubMessageCount',
+	        data,
+	        isLoading: false,
+	    })
+    }
+    /**
+	 *@机构消息通知列表
+	 *@param commonId:机构clubId
+	 *@param messageType:消息类型1.交易物流2.账户通知3.服务通知4.优惠促销
+	 *@param pageNum	页码
+	 *@param pageSize	条数
+	 */
+    getUserAuthClubMessageList(data = {}) {
+	    return this.AjaxService.get({
+	        url: '/user/login/auth/ClubMessageList',
+	        data,
+	        isLoading: true,
+	
+	    })
+    }
+    /**
+	 *@删除通知消息
+	 *@param id:消息Id
+	 */
+    authDeleteMessage(data = {}) {
+	    return this.AjaxService.post({
+	        url: '/user/login/auth/deleteMessage',
+	        data,
+	        isLoading: true,
+	    })
+    }
 }