123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- //import * as WxJsApi from '@/utils/wxJsApi.js'
- import * as API from '@/apis/hr/news.js'
- export default {
- data() {
- return {
- isReady:false,
- list: [{
- name: '我要用人',
- list:[],
- approvalStatus:"1",
- pageIndex:1,
- recordsTotal:0
- }, {
- name: '我有工人',
- list:[],
- approvalStatus:"0",
- pageIndex:1,
- recordsTotal:0
- }],
- current: 0
- }
- },
- components: {
-
- },
- onLoad(op){
- //this.id=op.id;
- },
- methods: {
- change(index) {
- this.current = index;
- var obj=this.list[this.current];
-
- if(obj.list.length==0){
- this.getLabourList()
- }
- },
- myLoadmore(){
- var obj=this.list[this.current];
- obj.pageIndex+=1;
- this.getLabourList()
- },
- getLabourList(){
- uni.showLoading({
- title:"加载中"
- })
- var obj=this.list[this.current];
- var data={
- typeB:obj.approvalStatus,
- pageIndex:obj.pageIndex
- };
- API.getLabourList(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.getLabourList()
- this.isReady=true;
- },onShow(){
- if(this.isReady){
-
- }
- },
- }
|