123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- //import * as WxJsApi from '@/utils/wxJsApi.js'
- import * as API from '@/apis/hr/my.js'
- export default {
- data() {
- return {
- isReady:false,
- src: '/static/img/head/png',
- keyword: '遥看瀑布挂前川',
- list: [
- {
- name: '招聘中',
- list:[],
- status:"publish",
- pageIndex:1,
- recordsTotal:0
- }, {
- name: '审核中',
- list:[],
- status:"approve",
- pageIndex:1,
- recordsTotal:0
- }, {
- name: '已下架',
- list:[],
- status:"close",
- pageIndex:1,
- recordsTotal:0
- }],
- current: 0,
- customStyle: {
- margin: '0',
- background: 'none!important'
- }
- }
- },
- components: {
-
- },
- onReachBottom() {
- if(this.list[this.current].list.length<this.list[this.current].recordsTotal){
- this.myLoadmore();
- }
- },
- onLoad(op){
- //this.id=op.id;
- },
- methods: {
- publish(count,id){
- uni.showLoading({
- title:"加载中",mask:true,
- })
-
- var data={
- recruitmentId:id,
- publishTag:count
- };
- API.publishRecruitment(data).then((res) => {
- for(var i in this.list){
- var obj=this.list[i];
- obj.list=[]
- obj.pageIndex=1
- }
- this.getList()
- uni.hideLoading()
-
- }).catch(error => {
- uni.showToast({
-
- title:error
- })
- })
- },
- myLoadmore(){
- var obj=this.list[this.current];
- obj.pageIndex+=1;
- this.getList()
- }, change(index) {
- this.current = index;
- var obj=this.list[this.current];
-
- if(obj.list.length==0){
- this.getList()
- }
- },
- getList(){
-
- uni.showLoading({
- title:"加载中",mask:true,
- })
- var obj=this.list[this.current];
- var data={
- status:obj.status,
- pageIndex:obj.pageIndex
- };
- API.loadOwnRecruitments(data).then((res) => {
-
- obj.list=[
- ...obj.list,
- ...res.data.data
- ];
- obj.recordsTotal=res.data.recordsTotal
- uni.hideLoading()
- console.log(this.list)
- }).catch(error => {
- uni.showToast({
-
- title:error
- })
- })
- }
-
- },onReady(){
- this.getList()
- this.isReady=true;
- },onShow(){
- if(this.isReady){
-
- }
- },
- }
|