Browse Source

预生产收货任务列表--上拉加载

hella_online_20240829
yufei0306 3 months ago
parent
commit
2b3d3407db
  1. 14
      src/api/httpRequest3.js
  2. 39
      src/pages/index/index.vue
  3. 26
      src/pages/productReceipt/job/productReceiptJob.vue
  4. 4
      src/pages/productReceipt/job/scrapReceiptJob.vue
  5. 4
      src/pages/productReceipt/job/semiProductReceiptJob.vue

14
src/api/httpRequest3.js

@ -1,6 +1,9 @@
import storage from '../common/utils/storage'
import {
removeToken
} from '@/common/utils/auth'
function service(options = {}) {
var token = storage.getStorage(storage.constant.token)
var tenantId = storage.getStorage('tenantId')
@ -20,7 +23,7 @@ function service(options = {}) {
"dataType":"json",
"tenant-id":tenantId
};
options.timeout = 10000
options.timeout = 300000
options.url = requestUrl+options.url
@ -31,6 +34,13 @@ function service(options = {}) {
if(res.data.code==0){
resolve(res.data);
}else {
if(res.data.code==401){
uni.clearStorageSync()
removeToken();
uni.reLaunch({
url: '/pages/login/index'
})
}
reject("系统异常:"+res.data.msg)
console.log("系统异常",res.data.msg)
}

39
src/pages/index/index.vue

@ -156,24 +156,27 @@
},
onShow() {
if (uni.getStorageSync("hasLogin") == null || uni.getStorageSync("hasLogin") == false) {
uni.showModal({
title: '未登录',
content: '您未登录 , 需要登录后才能继续', //
showCancel: !this.forcedLogin,
success: (res) => {
if (res.confirm) {
//使reLanch
if (this.forcedLogin) {
uni.reLaunch({
url: '../login/index'
})
} else {
uni.navigateTo({
url: '../login/index'
})
}
}
}
// uni.showModal({
// title: '',
// content: ' , ', //
// showCancel: !this.forcedLogin,
// success: (res) => {
// if (res.confirm) {
// //使reLanch
// if (this.forcedLogin) {
// uni.reLaunch({
// url: '../login/index'
// })
// } else {
// uni.navigateTo({
// url: '../login/index'
// })
// }
// }
// }
// })
uni.reLaunch({
url: '../login/index'
})
} else {
this.timerRefresh();

26
src/pages/productReceipt/job/productReceiptJob.vue

@ -72,7 +72,7 @@
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
loadingType: "noMore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
@ -94,13 +94,7 @@
this.getList('refresh');
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
@ -126,7 +120,15 @@
}
},
methods: {
methods: {
onReachBottom() {
console.log('onReachBottom',this.loadingType)
//
if (this.loadingType == 'loading' || this.loadingType == 'noMore') {
return;
}
this.getList("more");
},
refresh() {
this.getList('refresh');
},
@ -183,9 +185,9 @@
} else {
updateTitle("报废收货任务(" + this.totalCount + ")");
}
this.loadingType = "loadmore";
this.loadingType = "more";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
this.loadingType = "noMore";
return;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
@ -332,7 +334,7 @@
goHome()
},
onReach() {
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
if (this.loadingType == 'loading' || this.loadingType == 'noMore') {
return;
}
this.getList("more");

4
src/pages/productReceipt/job/scrapReceiptJob.vue

@ -17,7 +17,9 @@
};
},
onReachBottom() {
this.$refs.productreceiptjob.onReach();
},
onPullDownRefresh() {
this.$refs.productreceiptjob.refresh();
},

4
src/pages/productReceipt/job/semiProductReceiptJob.vue

@ -17,7 +17,9 @@
};
},
onReachBottom() {
this.$refs.productreceiptjob.onReach();
},
onShow() {
if(this.$refs.productreceiptjob!=undefined){
this.$refs.productreceiptjob.refresh();

Loading…
Cancel
Save