From e6a02c8b09a796e436a501e9b87d19e25c34c9d1 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期日, 07 四月 2024 15:53:37 +0800
Subject: [PATCH] #

---
 pages/business/pricing/priQuote.vue |   98 +++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 83 insertions(+), 15 deletions(-)

diff --git a/pages/business/pricing/priQuote.vue b/pages/business/pricing/priQuote.vue
index 2af380e..7f3c556 100644
--- a/pages/business/pricing/priQuote.vue
+++ b/pages/business/pricing/priQuote.vue
@@ -53,35 +53,41 @@
 					type: ''
 				},
 				falg: true,
-				list: []
+				list: [],
+				curr: 2,
+				reload: false,
+				status: 'more',
 			}
 		},
 		onShow() {
 			let that = this
 			uni.$on('isRefresh',function(data){
-				console.log(data);
 				that.user.username = data.title
 				that.user.id = data.id
 				that.user.type = data.key
 				that.falg = false
 			})
-			setTimeout(()=> {
-				// this.getCsmtr1()
-			},50)
 			if (this.falg) {
-				this.getPriQuoteList()
+				this.getDetail()
 			}
+			this.getPriQuoteList1()
+		},
+		onReachBottom() {
+			this.status = 'more';
+			this.getPriQuoteList()
 		},
 		methods: {
-			getPriQuoteList() {
+			getPriQuoteList1() {
 				let _this = this
-				let param = {curr:1,limit:16,dept_id: 0,user_id: 67}
+				_this.list = []
+				uni.showLoading({})
+				let param = {curr:1,limit:8,dept_id: 0,user_id: 67}
 				if (_this.user.type == 'user_id') {
-					param = {curr:1,limit:16,user_id: _this.user.id}
+					param = {curr:1,limit:8,user_id: _this.user.id}
 				} else if(_this.user.type == 'dept_id') {
-					param = {curr:1,limit:16,dept_id: _this.user.id}
+					param = {curr:1,limit:8,dept_id: _this.user.id}
 				} else {
-					param = {curr:1,limit:16}
+					param = {curr:1,limit:8}
 				}
 				uni.request({
 					url: `${_this.baseUrl}/priQuote/list/auth`,
@@ -89,8 +95,6 @@
 					data: param,
 					success(res) {
 						res = res.data
-						console.log(res);
-						// return
 						if (res.code === 200) {
 							for (let k of res.data.records) {
 								if (k.settle >= 2) {
@@ -101,8 +105,73 @@
 									k['bgcolor'] = 'color: #1e9cf0'
 								}
 							}
-							_this.list = res.data.records
+							let list = res.data.records
+							_this.list = _this.reload ? list : _this.list.concat(list);
+							if (res.data.records.length == 0) {
+								_this.status = 'noMore'
+							}
 						}
+					},
+					fail(result) {
+						uni.showToast({title: '璇锋眰澶辫触'})
+						setTimeout(() => {
+							uni.reLaunch({
+								url: '../../login/login'
+							});
+						}, 1000);
+					},
+					complete() {
+						uni.hideLoading()
+					}
+				})
+			},
+			getPriQuoteList() {
+				let _this = this
+				uni.showLoading({})
+				let param = {curr:this.curr,limit:8,dept_id: 0,user_id: 67}
+				if (this.user.type == 'user_id') {
+					param = {curr:this.curr,limit:8,user_id: this.user.id}
+				} else if(this.user.type == 'dept_id') {
+					param = {curr:this.curr,limit:8,dept_id: this.user.id}
+				} else {
+					param = {curr:this.curr,limit:8}
+				}
+				uni.request({
+					url: `${_this.baseUrl}/priQuote/list/auth`,
+					header: { 'token': uni.getStorageSync('token') },
+					data: param,
+					success(res) {
+						uni.hideLoading()
+						res = res.data
+						if (res.code === 200) {
+							for (let k of res.data.records) {
+								if (k.settle >= 2) {
+									k['bgcolor'] = 'color: #12d489'
+								} else if (k.settle == 1) {
+									k['bgcolor'] = 'color: #ffbd67'
+								} else if (k.settle == 0) {
+									k['bgcolor'] = 'color: #1e9cf0'
+								}
+							}
+							let list = res.data.records
+							_this.list = _this.reload ? list : _this.list.concat(list);
+							_this.curr = _this.curr + 1
+							if (res.data.records.length == 0) {
+								_this.status = 'noMore'
+							}
+						}
+					},
+					fail(result) {
+						uni.hideLoading()
+						uni.showToast({title: '璇锋眰澶辫触'})
+						setTimeout(() => {
+							uni.reLaunch({
+								url: '../../login/login'
+							});
+						}, 1000);
+					},
+					complete() {
+						uni.hideLoading()
 					}
 				})
 			},
@@ -118,7 +187,6 @@
 			},
 			async getDetail() {
 				let res = await user.getDetail()
-				console.log(res);
 				if (res.code === 200) {
 					this.user.username = res.data.username
 					this.user.id = res.data.id

--
Gitblit v1.9.1