From 192bb670c6dec8a3efee45325fb1c7e61a34bd73 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期六, 02 三月 2024 10:07:41 +0800
Subject: [PATCH] #
---
pages/business/plan/plan.vue | 81 +++++++++++++++++++++++++++++++++++++---
1 files changed, 75 insertions(+), 6 deletions(-)
diff --git a/pages/business/plan/plan.vue b/pages/business/plan/plan.vue
index 191f96b..2b69ffb 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: [],
@@ -153,7 +154,12 @@
name:'骞冲簱',
value: 6
},
- ]
+ {
+ name:'鍏朵粬',
+ value: 7
+ },
+ ],
+ param: {curr:1,limit:4}
}
},
onLoad() {
@@ -171,7 +177,7 @@
this.getDetail()
}
setTimeout(()=> {
- this.getCsmtr1()
+ this.getList()
},50)
},
onReachBottom() {
@@ -192,23 +198,79 @@
this.toggle('right')
},
add(val) {
- let addPlan = 'addPlan'
+ let addPlan = 'addPlan',_this = this
if (val > 1) {
addPlan = 'addPlan' + val
}
uni.navigateTo({
url:'/pages/business/plan/' + addPlan,
+ success() {
+ _this.$refs.popup.close()
+ }
})
+
+
},
toggle(type) {
this.type = type
// 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) {
+ console.log(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}
@@ -217,12 +279,14 @@
} else {
param = {curr:1,limit:4}
}
+ param = {curr:1,limit:4}
uni.request({
url: that.baseUrl + '/plan/page/auth',
header: {'token' : uni.getStorageSync('token'),},
data: param,
method:'GET',
success(result) {
+ console.log(result);
if (result.statusCode === 404) {
uni.showToast({title: '璇烽噸鏂扮櫥褰�', icon: "none", position: 'top'})
return
@@ -275,6 +339,7 @@
data: param,
method:'GET',
success(result) {
+ console.log(result);
if (result.statusCode === 404) {
uni.showToast({title: '璇烽噸鏂扮櫥褰�', icon: "none", position: 'top'})
return
@@ -283,7 +348,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'
}
@@ -366,6 +434,7 @@
margin-top: 20px;
}
.popup-content {
+ width: 60vw;
margin-top: 260rpx;
display: flex;
align-items: center;
--
Gitblit v1.9.1