1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- //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:"2",
- pageIndex:1,
- recordsTotal:0
- }],
- current: 0
- }
- },
- components: {
-
- },
- onReachBottom() {
- if(this.list[this.current].list.length<this.list[this.current].recordsTotal){
- this.myLoadmore();
- }
- },
- 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:"加载中",mask:true,
- })
- 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){
-
- }
- },
- }
|