index.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //import * as WxJsApi from '@/utils/wxJsApi.js'
  2. import * as API from '@/apis/common.js'
  3. import TabbarHr from '@/components/TabbarHr.vue'
  4. export default {
  5. data() {
  6. return {
  7. list:[],
  8. isReady:false,
  9. background: {
  10. backgroundColor: '#2295ff',
  11. },
  12. src:[
  13. '/static/img/news1.png',
  14. '/static/img/news2.png',
  15. '/static/img/news4.png',
  16. '/static/img/news5.png',
  17. '/static/img/news3.png',
  18. ],
  19. }
  20. },
  21. components: {
  22. TabbarHr
  23. },
  24. onLoad(op){
  25. //this.id=op.id;
  26. },
  27. methods: {
  28. gotoUrlNews(row){
  29. var url='pages/hr/newsIndex/newsList/newsList?id='+row.classifyId;
  30. if(row.classifyId=="5"){
  31. url="pages/hr/newsIndex/servicesList/servicesList"
  32. }
  33. if(row.classifyId=="4"){
  34. url="pages/job/newsIndex/newsRecommend/newsRecommend"
  35. }
  36. if(row.classifyId=="6"){
  37. url="pages/hr/newsIndex/newsRecommend/newsRecommend"
  38. }
  39. this.gotoUrl(url)
  40. },
  41. getList(){
  42. uni.showLoading({
  43. title:"加载中",mask:true,
  44. })
  45. API.messageClassifyHR().then((response) => {
  46. this.list=response.data;
  47. uni.hideLoading()
  48. }).catch(error => {
  49. uni.showToast({
  50. title:error
  51. })
  52. })
  53. },
  54. getInfo(){
  55. API.readMessageNum().then((response) => {
  56. var a =response.data;
  57. this.carhelp.set("tabbar_show_num",a);
  58. }).catch(error => {
  59. uni.showToast({
  60. title:error
  61. })
  62. })
  63. },
  64. },onReady(){
  65. this.getInfo();
  66. this.getList();
  67. this.isReady=true;
  68. },onShow(){
  69. if(this.isReady){
  70. this.getInfo();
  71. this.getList();
  72. }
  73. },
  74. }