From 72a4a671431d25095146dc7e36efbb4a871c39b9 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期六, 02 十二月 2023 10:47:37 +0800
Subject: [PATCH] #
---
pages/business/plan/plan.vue | 66 ++++++++++++++++++++++++++++++--
1 files changed, 61 insertions(+), 5 deletions(-)
diff --git a/pages/business/plan/plan.vue b/pages/business/plan/plan.vue
index 573653a..0f066b8 100644
--- a/pages/business/plan/plan.vue
+++ b/pages/business/plan/plan.vue
@@ -101,6 +101,7 @@
<view class="fxbtn">
<uni-icons type="plusempty" color="#fff" @click="gotoggle()" ></uni-icons>
</view>
+ <uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
</view>
</template>
@@ -113,7 +114,7 @@
user: {
username: '',
id: 0,
- type: 'user_id'
+ type: ''
},
falg: true,
csmtrList: [],
@@ -157,7 +158,8 @@
name:'鍏朵粬',
value: 7
},
- ]
+ ],
+ param: {curr:1,limit:4}
}
},
onLoad() {
@@ -175,7 +177,7 @@
this.getDetail()
}
setTimeout(()=> {
- this.getCsmtr1()
+ this.getList()
},50)
},
onReachBottom() {
@@ -214,10 +216,60 @@
// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦� uni-popup 缁勪欢涓婄粦瀹� type灞炴��
this.$refs.popup.open(type)
},
+ getList() {
+ let that = this
+ that.csmtrList = []
+ uni.showLoading()
+ if (this.user.type == 'user_id') {
+ that.param = {curr:1,limit:4,user_id: that.user.id}
+ } else if(this.user.type == 'dept_id') {
+ that.param = {curr:1,limit:4,dept_id: that.user.id}
+ }
+ uni.request({
+ url: that.baseUrl + '/plan/page/auth',
+ header: {'token' : uni.getStorageSync('token'),},
+ data: that.param,
+ method:'GET',
+ success(result) {
+ if (result.statusCode === 404) {
+ uni.showToast({title: '璇烽噸鏂扮櫥褰�', icon: "none", position: 'top'})
+ return
+ }
+ var res = result.data
+ if (res.code === 200) {
+ let list = res.data.records
+ that.csmtrList = that.reload ? list : that.csmtrList.concat(list);
+ if (res.data.records.length == 0) {
+ that.status = 'noMore'
+ }
+ } else if (res.code === 403) {
+ uni.showToast({title: res.msg, icon: "none", position: 'top'})
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../../login/login'
+ });
+ }, 1000);
+ } else {
+ uni.showToast({title: res.msg, icon: "none",position: 'top'})
+ }
+ },
+ fail(result) {
+ uni.showToast({title: '璇锋眰澶辫触'})
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../../login/login'
+ });
+ }, 1000);
+ },
+ complete() {
+ uni.hideLoading()
+ }
+ })
+ },
getCsmtr1(e) {
let that = this
that.csmtrList = []
- uni.showLoading({})
+ uni.showLoading()
let param = {curr:1,limit:4,dept_id: 0,user_id: 67}
if (this.user.type == 'user_id') {
param = {curr:1,limit:4,user_id: that.user.id}
@@ -226,6 +278,7 @@
} else {
param = {curr:1,limit:4}
}
+ param = {curr:1,limit:4}
uni.request({
url: that.baseUrl + '/plan/page/auth',
header: {'token' : uni.getStorageSync('token'),},
@@ -292,7 +345,10 @@
if (res.code === 200) {
let list = res.data.records
that.csmtrList = that.reload ? list : that.csmtrList.concat(list);
- that.curr = that.curr + 1
+ console.log(list);
+ if (list.length > 0) {
+ that.curr = that.curr + 1
+ }
if (res.data.records.length == 0) {
that.status = 'noMore'
}
--
Gitblit v1.9.1