shish 3 年 前
コミット
7f5dd51e86
2 ファイル変更19 行追加5 行削除
  1. 15 5
      ghsApp/src/admin/home/workbench.vue
  2. 4 0
      ghsApp/src/api/shop-admin/index.js

+ 15 - 5
ghsApp/src/admin/home/workbench.vue

@@ -31,7 +31,7 @@
 			<div class="user-top" style="position: relative;">
 				<div class="app-size-28">今日概况</div>
 				<image :src="`${constant.imgUrl}/icon/notice_icon.png`" @click="toNotify()" class="mind-item"></image>
-				<view class="red-mind" @click="toNotify()">1</view>
+				<view class="red-mind" @click="toNotify()" v-if="notifyNum>0">{{ notifyNum }}</view>
 			</div>
 			<div class="income-amount" @click="pageTo({url:'/admin/stat/kdIncome'})">
 				<div>收入</div>
@@ -175,6 +175,7 @@ import { getStat,getStrokeCount } from '@/api/console'
 import autoUpdateMixins from "@/mixins/autoUpdate";
 import { getWeixinId } from "@/api/invite/index";
 import { getErrorPrice } from "@/api/item"
+import { getStaffInfo } from "@/api/shop-admin"
 export default {
 	name: "admin-workbench",
 	components: { },
@@ -216,7 +217,8 @@ export default {
 			//登录状态 0未登录 1登录
 			loginStyle :0,
 			errorPirceList:[],
-			lookMoney:1
+			lookMoney:1,
+			notifyNum:0
 		};
 	},
 	onShareAppMessage(res) {
@@ -235,6 +237,9 @@ export default {
 			if(!this.$util.isEmpty(newVal.admin) && newVal.admin.currentGhsShopId > 0){
 				this.loginStyle = 1				
 			}
+			if(newVal.staff && newVal.staff.notifyNum && Number(newVal.staff.notifyNum)>0){
+				this.notifyNum = Number(newVal.staff.notifyNum)
+			}
 		}
 	},
 	onLoad(option) {
@@ -247,14 +252,19 @@ export default {
 		uni.stopPullDownRefresh();
 	},
 	onShow() {
-		this.showShopName()
+		this.getShopName()
 		if(!this.$util.isEmpty(this.loginInfo.admin) && this.loginInfo.admin.currentGhsShopId > 0){
 			this.loginStyle  = 1
 		}
+		getStaffInfo().then(res=>{
+			if(res.code == 1){
+				this.notifyNum = res.data.staff.notifyNum ? Number(res.data.staff.notifyNum) : 0
+			}
+		})
 	},
 	methods: {
 		...mapActions(['setUserShopAll']),
-		showShopName(){
+		getShopName(){
 			currentShop().then(res => {
 				if(res.code == 1){
 					let sjName = res.data.merchantName ? res.data.merchantName : ''
@@ -371,7 +381,7 @@ export default {
 				}
 			})
 
-			this.showShopName()
+			this.getShopName()
 
 			getWeixinId().then(res => {
 				this.getappIdList = res.data

+ 4 - 0
ghsApp/src/api/shop-admin/index.js

@@ -13,4 +13,8 @@ export const generateAdmin = data => {
 //获取所有在职员工 ssh 20220510
 export const getAllStaff = data => {
 	return https.get('/shop-admin/get-all-staff', data)
+}
+
+export const getStaffInfo = data => {
+	return https.get('/shop-admin/get-staff-info', data)
 }