|
@@ -10,13 +10,29 @@ Page({
|
|
|
data: {
|
|
|
showIndex: -1, //显示按钮的下标
|
|
|
cooperationList: [], //合作列表
|
|
|
+ condition: "", //模糊搜索条件
|
|
|
+ scrolltolowerThrottle: true, //下拉触底截流
|
|
|
+ pageNumber: 1, //请求分页
|
|
|
+ pageTotal: 1, //总页数
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
- onLoad: function (options) {
|
|
|
+ onLoad: function (options) {},
|
|
|
+ /* 搜索 */
|
|
|
+ searchQuery({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ if (this.data.condition == detail) return;
|
|
|
+ this.setData({
|
|
|
+ condition: detail,
|
|
|
+ pageNumber: 1,
|
|
|
+ pageTotal: 1
|
|
|
+ })
|
|
|
+ this.getList();
|
|
|
},
|
|
|
+ /* 点击item */
|
|
|
showBtnIndex(e) {
|
|
|
const {
|
|
|
index
|
|
@@ -43,27 +59,45 @@ Page({
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function () {
|
|
|
+ this.setData({
|
|
|
+ pageNumber: 1,
|
|
|
+ pageTotal: 1
|
|
|
+ });
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ scrolltolower() {
|
|
|
+ if (!this.data.scrolltolowerThrottle) return;
|
|
|
+ this.setData({
|
|
|
+ scrolltolowerThrottle: false
|
|
|
+ })
|
|
|
+ if (this.data.pageTotal > this.data.pageNumber) this.getList();
|
|
|
+ },
|
|
|
+ getList() {
|
|
|
_Http.basic({
|
|
|
"accesstoken": wx.getStorageSync('userData').token,
|
|
|
"classname": "customer.tagents.tagents",
|
|
|
"method": "query_cooperation",
|
|
|
"content": {
|
|
|
"getdatafromdbanyway": true,
|
|
|
- "pageNumber": 1,
|
|
|
+ "pageNumber": this.data.pageNumber,
|
|
|
"pageSize": 20,
|
|
|
"where": {
|
|
|
- "condition": "",
|
|
|
+ "condition": this.data.condition,
|
|
|
"ftype": "",
|
|
|
"fstatus": "合作"
|
|
|
}
|
|
|
}
|
|
|
}).then(res => {
|
|
|
+ console.log(res)
|
|
|
if (res.msg != '成功') return wx.showToast({
|
|
|
title: res.data,
|
|
|
icon: "none"
|
|
|
});
|
|
|
this.setData({
|
|
|
- cooperationList: res.data
|
|
|
+ cooperationList: res.data,
|
|
|
+ pageTotal: res.pageTotal,
|
|
|
+ pageNumber: this.data.pageNumber + 1,
|
|
|
+ scrolltolowerThrottle: true
|
|
|
})
|
|
|
})
|
|
|
},
|