index.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. {extend name="public/base"/}
  2. {block name="css"}
  3. <style>
  4. .van-nav-bar__text, .van-nav-bar .van-icon{color:white;}
  5. .lw-list {display:flex;margin-top:10px;padding-bottom:10px;border-bottom:2px solid #f8f9fb;}
  6. .lw-list .avatar{width:45px;height:45px;}
  7. .lw-list .content {margin-left:10px;font-size:14px;}
  8. .lw-list .content .name{color:#e54d42;}
  9. .lw-list .content .tags .van-tag {margin-top:5px;margin-right:5px;}
  10. .box-border {border-bottom:1px solid #eee;padding-bottom:5px;}
  11. .plr-10 {padding-left:10px;padding-right:10px;}
  12. </style>
  13. {/block}
  14. {block name="body"}
  15. <van-nav-bar
  16. class="bg-blue"
  17. fixed="true"
  18. >
  19. <template #title>
  20. <span class="text-white">简历</span>
  21. </template>
  22. </van-nav-bar>
  23. <div style="width:100%;height:46px;"></div>
  24. <van-dropdown-menu>
  25. <van-dropdown-item v-model="form.jobintention" :options="userwill" @change="onSearch"></van-dropdown-item>
  26. <van-dropdown-item v-model="form.cateid" :options="catelist" @change="onSearch"></van-dropdown-item>
  27. </van-dropdown-menu>
  28. <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
  29. <van-list
  30. v-model="loading"
  31. :finished="finished"
  32. finished-text="没有更多了"
  33. @load="onLoad"
  34. >
  35. <div class="job-box">
  36. <div class="job-item" v-for="item in list" style="padding: 15px 0 0 0;" @click="toResume(item.id)">
  37. <div class="lw-list plr-10">
  38. <img :src="item.avatar ? item.avatar : '__MIMG__/default_avatar.jpg'" class="avatar">
  39. <div class="content">
  40. <div class="name">{{item.realname ? item.realname : item.nickname}}</div>
  41. <div class="tags">
  42. <van-tag type="primary" color="#0081ff" size="medium" v-for="tag in item.com_cate">{{tag}}</van-tag>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="job-flex plr-10" style="height:40px;">
  47. <div class="job-flex-left">
  48. <span>{{item.jobintention_text}} ·</span>
  49. <span>{{item.age?item.age+'岁':'年龄未知'}} ·</span>
  50. <span>{{item.education_text || '学历未知'}} ·</span>
  51. <span>{{item.worker_text || '经验未知'}}</span>
  52. </div>
  53. <div class="job-flex-right salary">浏览量:{{item.volume}}</div>
  54. </div>
  55. </div>
  56. </div>
  57. </van-list>
  58. </van-pull-refresh>
  59. <div style="width:100%;height:50px;"></div>
  60. <van-tabbar v-model="active" active-color="#0081ff" @change="onTabChange">
  61. <van-tabbar-item icon="wap-home-o">首页</van-tabbar-item>
  62. <van-tabbar-item icon="description">简历</van-tabbar-item>
  63. </van-tabbar>
  64. {/block}
  65. {block name="script"}
  66. <script>
  67. new Vue({
  68. el: '#app',
  69. data() {
  70. return {
  71. active: 1,
  72. userwill: {$userwill},
  73. catelist: {$catelist},
  74. form: {
  75. jobintention: 0,
  76. cateid: 0,
  77. },
  78. list: [],
  79. page: 1,
  80. loading: false,
  81. finished: false,
  82. refreshing: false,
  83. };
  84. },
  85. methods: {
  86. onTabChange(index) {
  87. const url = ["{:url('/emp/index')}","{:url('/resume/index')}"];
  88. location.href = url[index];
  89. },
  90. onSearch() {
  91. this.onRefresh();
  92. },
  93. toResume(id) {
  94. location.href = "{:url('/resume/detail')}?id=" + id
  95. },
  96. //加载
  97. onLoad() {
  98. //参数
  99. let self = this;
  100. let param = this.form;
  101. param.page = this.page;
  102. this.page++;
  103. $.post("{:url('/resume/list')}", param, function (json) {
  104. //下拉刷新
  105. if (self.refreshing) {
  106. self.refreshing = false;
  107. }
  108. // 加载状态结束
  109. self.loading = false;
  110. if (json.data.length == 0) {
  111. // 数据全部加载完成
  112. self.finished = true;
  113. } else {
  114. // 增加数据
  115. for (let i = 0; i < json.data.length; i++) {
  116. self.list.push(json.data[i]);
  117. }
  118. }
  119. }, 'json');
  120. },
  121. onRefresh() {
  122. // 清空列表数据
  123. this.list = [];
  124. this.page = 1;
  125. this.loading = true;
  126. this.finished = false;
  127. this.onLoad();
  128. },
  129. },
  130. });
  131. </script>
  132. {/block}