index.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //import * as WxJsApi from '@/utils/wxJsApi.js'
  2. import * as API from '@/apis/common.js'
  3. import TabbarJob from '@/components/TabbarJob.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/news3.png',
  17. ],
  18. }
  19. },
  20. components: {
  21. TabbarJob
  22. },
  23. onLoad(op){
  24. //this.id=op.id;
  25. },
  26. methods: {
  27. gotoUrlNews(row){
  28. var url='pages/job/newsIndex/newsList/newsList?id='+row.classifyId;
  29. if(row.classifyId=="5"){
  30. url="pages/hr/newsIndex/servicesList/servicesList"
  31. }
  32. if(row.classifyId=="4"){
  33. url="pages/job/newsIndex/newsRecommend/newsRecommend"
  34. }
  35. if(row.classifyId=="6"){
  36. url="pages/hr/newsIndex/newsRecommend/newsRecommend"
  37. }
  38. this.gotoUrl(url)
  39. },
  40. getList(){
  41. uni.showLoading({
  42. title:"加载中",mask:true,
  43. })
  44. API.messageClassify().then((response) => {
  45. this.list=response.data;
  46. uni.hideLoading()
  47. }).catch(error => {
  48. uni.showToast({
  49. title:error
  50. })
  51. })
  52. },
  53. getInfo(){
  54. API.readMessageNum().then((response) => {
  55. var a =response.data;
  56. this.carhelp.set("tabbar_show_num",a);
  57. }).catch(error => {
  58. uni.showToast({
  59. title:error
  60. })
  61. })
  62. },
  63. },onReady(){
  64. this.getInfo();
  65. this.getList();
  66. this.isReady=true;
  67. },onShow(){
  68. if(this.isReady){
  69. this.getInfo();
  70. this.getList();
  71. }
  72. },
  73. }