From 1a0abf4788e8b1ee17d5a3a9834385bbc6b8f14b Mon Sep 17 00:00:00 2001
From: hailu <962012470@qq.com>
Date: 星期四, 07 十二月 2023 17:38:53 +0800
Subject: [PATCH] 备份
---
GoldC/pages/problemList/problemList.js | 86 +++++++++++++++++++++++++++++++++---------
1 files changed, 67 insertions(+), 19 deletions(-)
diff --git a/GoldC/pages/problemList/problemList.js b/GoldC/pages/problemList/problemList.js
index 6178d91..71df3db 100644
--- a/GoldC/pages/problemList/problemList.js
+++ b/GoldC/pages/problemList/problemList.js
@@ -47,7 +47,7 @@
info2: 0,
info3: 0,
info4: 0,
-
+ topNum:0,
},
lifetimes: {
// 鍦ㄧ粍浠跺疄渚嬭繘鍏ラ〉闈㈣妭鐐规爲鏃舵墽琛�
@@ -73,6 +73,12 @@
onLoad: function (options) {
+ },
+ goTop () { // 涓�閿洖鍒伴《閮�
+ wx.pageScrollTo({
+ scrollTop: 0,
+ duration: 300
+ });
},
// 璁剧疆寮傛璇锋眰涔嬪悗鐨勯〉闈€�佹�昏褰曟暟
setPage(index, total) {
@@ -110,31 +116,61 @@
},
//鏇存敼椤电爜鐐瑰嚮浜嬩欢
onChangePage: function (e) {
- //console.log("鏇存敼椤电爜浜嬩欢锛�",e);
+ console.log("鏇存敼椤电爜浜嬩欢锛�",e);
this.setData({
pageMask: false,
index: e.currentTarget.dataset.index //鐐瑰嚮鐨勯〉鏁�
})
this.getList()
// 鍏堝垽鏂綋鍓嶉〉鏁帮紝鏄惁闇�瑕佹洿鏂癲isabled鐨勭姸鎬�
- this.updateBtnDis();
this.triggerParent();
+ if (e.currentTarget.dataset.index <= 1) {
+ this.setData({
+ prevBtnDis: false,
+ })
+ }
+
},
//涓婁竴椤电偣鍑讳簨浠�
prevPage: function () {
- if (this.data.index <= 1) return;
+ console.log(this.data.index,this.data.total);
+ if (this.data.index <= 1) {
+ this.setData({
+ prevBtnDis: false,
+ })
+ return false
+ }
+ if (this.data.index <= this.data.total) {
+ this.setData({
+ nextBtnDis: false,
+ })
+ }
let num = this.data.index - 1;
this.setData({
- index: num
+ index: num,
+ prevBtnDis:true
})
this.getList()
this.triggerParent();
- 鏇存柊鎸夐挳鐘舵��
- this.updateBtnDis();
},
//涓嬩竴椤电偣鍑讳簨浠�
nextPage: function () {
- if (this.data.index >= this.data.total) return;
+ console.log(this.data.index,this.data.total);
+
+ if (this.data.index >= this.data.total) {
+ this.setData({
+ nextBtnDis: false,
+ })
+ return false
+ }
+ this.setData({
+ nextBtnDis: true,
+ })
+ if (this.data.index >= 1) {
+ this.setData({
+ prevBtnDis: false
+ })
+ }
let num = this.data.index + 1;
this.setData({
index: num
@@ -143,14 +179,14 @@
this.triggerParent();
// 鏇存柊鎸夐挳鐘舵��
- this.updateBtnDis();
},
changeActive1(e) {
console.log(e.detail.index);
this.setData({
state: e.detail.index,
active1: e.detail.index,
- nickName: wx.getStorageSync('nickName')
+ nickName: wx.getStorageSync('nickName'),
+ index:1
})
this.getList()
},
@@ -158,7 +194,8 @@
console.log(e.detail.index, this.data.erectoListLevel)
this.setData({
active2: e.detail.index,
- nextlevel: this.data.erectoListLevel[0].userId
+ nextlevel: this.data.erectoListLevel[0].userId,
+ index:1
})
this.getNumInfo()
this.getList()
@@ -167,7 +204,8 @@
console.log(e.detail.index);
this.setData({
active3: e.detail.index,
- nextlevel: this.data.erectoListLevel[e.detail.index].userId
+ nextlevel: this.data.erectoListLevel[e.detail.index].userId,
+ index:1
})
this.getNumInfo()
this.getList()
@@ -183,7 +221,7 @@
var roleKey = wx.getStorageSync('roleKey')
let data = {
pageNum: this.data.index,
- pageSize: 10,
+ pageSize: 5,
state: this.data.state,
orderType: 1,
}
@@ -212,25 +250,26 @@
data: data,
success: (res, header) => {
if (res.data.code == 200 && res.data.rows.length > 0) {
-
let data = res.data
- let total = Math.ceil(res.data.total / 10)
+ let total = Math.ceil(res.data.total / 5)
this.setData({
listdata: data.rows,
total: total,
showPage: true,
showNull: false
})
- console.log(this.data.listdata)
+ this.goTop()
wx.hideLoading()
-
} else {
this.setData({
listdata: [],
total: 0,
showPage: false,
- showNull: true
+ showNull: true,
+ prevBtnDis:true,
+ nextBtnDis:true,
})
+ this.goTop()
wx.hideLoading()
}
}
@@ -245,6 +284,7 @@
pageSize: 10000,
deptId: wx.getStorageSync('deptId'),
roleKey: 'tenanthelper',
+ isAuthentication: 1
}
console.log(data);
wx.request({
@@ -371,6 +411,12 @@
url: '/pages/problemReport/proRep?info=' + JSON.stringify(item),
})
},
+ yetstatements(e) {
+ let item = JSON.parse(JSON.stringify(e.currentTarget.dataset.base))
+ wx.navigateTo({
+ url: '/pages/yetAZ/yetAZ?info=' + JSON.stringify(item),
+ })
+ },
goAddress(e) {
var address = e.currentTarget.dataset.base.address
console.log(e.currentTarget.dataset);
@@ -448,6 +494,7 @@
index: 1,
modalHidden: true
})
+ this.getNumInfo()
this.getList()
} else {
this.setData({
@@ -475,7 +522,7 @@
},
DelChange() {
wx.request({
- url: `https://puyue.yhupai.com/prod-api/iot/deviceOrder/${this.data.form.id}`,
+ url: `https://puyue.yhupai.com/prod-api/iot/deviceOrder/${this.data.form.id}/${this.data.form.deviceId}`,
method: "DELETE",
header: {
"Access-Control-Allow-Headers": 'token',
@@ -487,6 +534,7 @@
index: 1,
delModal: true
})
+ this.getNumInfo()
this.getList()
} else {
this.setData({
--
Gitblit v1.8.0