login.js 815 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. *@des 登录注册相关接口
  3. *@author hjp1011 21931118@qq.com
  4. *@blog http://www.wephp.com
  5. *@date 2019/11/15 15:14:47
  6. *@param login.js
  7. */
  8. export function getTabBarBadge() {
  9. //获取待办数量
  10. var url = this.$mConfig.baseUrl + '/fw/queryDocumentAndNotice';
  11. var token = this.$preToken + ' ' + this.$store.state.accessToken;
  12. this.$http.request({
  13. url: url,
  14. header: {
  15. 'content-type': 'application/json',
  16. 'Authorization': token
  17. },
  18. data: {
  19. pageNum: 1,
  20. pageSize: 20,
  21. orderByColumn: "ID",
  22. isAsc: "desc",
  23. }
  24. }).then(r => {
  25. console.log('-----------'+r.total)
  26. var sum = r.total;
  27. if (sum > 0) {
  28. uni.setTabBarBadge({
  29. index: 1,
  30. text: sum.toString()
  31. })
  32. }else{
  33. //移除角标
  34. uni.removeTabBarBadge({
  35. index:1
  36. })
  37. }
  38. })
  39. //获取待办数量结束
  40. };