|
@@ -28,7 +28,7 @@ Page({
|
|
|
let obj = new Object()
|
|
|
obj.pageNum = this.data.pageNum
|
|
|
obj.pageSize = 10
|
|
|
- obj.reasonable= false
|
|
|
+ obj.reasonable = false
|
|
|
http.send_get("/system/AppMaterialController/geMaterialList", obj, this.getQiyeEnterpriseListSuccess)
|
|
|
|
|
|
|
|
@@ -36,59 +36,59 @@ Page({
|
|
|
|
|
|
getQiyeEnterpriseListSuccess(res) {
|
|
|
|
|
|
-console.log("@@@@",res)
|
|
|
-if(res.code==200){
|
|
|
- // 显示加载图标
|
|
|
- wx.showLoading({
|
|
|
- title: '玩命加载中',
|
|
|
- })
|
|
|
- var that = this
|
|
|
-
|
|
|
- if(res.data.rows.length==0){
|
|
|
- wx.showToast({
|
|
|
- title: '暂无更多数据',
|
|
|
- icon:"none"
|
|
|
- })
|
|
|
- }
|
|
|
- if (this.data.isRefresh) {
|
|
|
- this.setData({
|
|
|
- enterpriseList: res.data.rows,
|
|
|
- total: res.data.total
|
|
|
+ console.log("@@@@", res)
|
|
|
+ if (res.code == 200) {
|
|
|
+ // 显示加载图标
|
|
|
+ wx.showLoading({
|
|
|
+ title: '玩命加载中',
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // 隐藏导航栏加载框
|
|
|
- setTimeout(function () {
|
|
|
- that.setData({
|
|
|
- loadingData: false
|
|
|
- });
|
|
|
- wx.hideNavigationBarLoading();
|
|
|
- // 停止下拉动作
|
|
|
- wx.stopPullDownRefresh();
|
|
|
- wx.hideLoading()
|
|
|
-
|
|
|
- }, 1000)
|
|
|
-
|
|
|
+ var that = this
|
|
|
+
|
|
|
+ if (res.data.rows.length == 0) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '暂无更多数据',
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.data.isRefresh) {
|
|
|
+ this.setData({
|
|
|
+ enterpriseList: res.data.rows,
|
|
|
+ total: res.data.total
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // 隐藏导航栏加载框
|
|
|
+ setTimeout(function () {
|
|
|
+ that.setData({
|
|
|
+ loadingData: false
|
|
|
+ });
|
|
|
+ wx.hideNavigationBarLoading();
|
|
|
+ // 停止下拉动作
|
|
|
+ wx.stopPullDownRefresh();
|
|
|
+ wx.hideLoading()
|
|
|
+
|
|
|
+ }, 1000)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ enterpriseList: this.data.enterpriseList.concat(res.data.rows)
|
|
|
+ })
|
|
|
+ // 隐藏加载框
|
|
|
+
|
|
|
+ setTimeout(function () {
|
|
|
+ that.setData({
|
|
|
+ hidden: true,
|
|
|
+ loadingData: false
|
|
|
+ });
|
|
|
+
|
|
|
+ wx.hideLoading();
|
|
|
+ }, 1000)
|
|
|
+
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.setData({
|
|
|
- enterpriseList: this.data.enterpriseList.concat(res.data.rows)
|
|
|
- })
|
|
|
- // 隐藏加载框
|
|
|
-
|
|
|
- setTimeout(function () {
|
|
|
- that.setData({
|
|
|
- hidden: true,
|
|
|
- loadingData: false
|
|
|
- });
|
|
|
-
|
|
|
- wx.hideLoading();
|
|
|
- }, 1000)
|
|
|
-
|
|
|
+ console.log("@@!", "请求失败")
|
|
|
}
|
|
|
- }else{
|
|
|
- console.log("@@!","请求失败")
|
|
|
- }
|
|
|
},
|
|
|
onPullDownRefresh: function () {
|
|
|
// 显示顶部刷新图标
|
|
@@ -110,7 +110,7 @@ if(res.code==200){
|
|
|
onReachBottom: function () {
|
|
|
let that = this
|
|
|
var loadingData = that.data.loadingData
|
|
|
-
|
|
|
+
|
|
|
var hidden = that.data.hidden
|
|
|
// 页数+1
|
|
|
that.setData({
|
|
@@ -131,13 +131,13 @@ if(res.code==200){
|
|
|
loadingData: true
|
|
|
});
|
|
|
|
|
|
-
|
|
|
+
|
|
|
//console.log("@@@@"+Math.ceil(this.data.total/10))
|
|
|
- // if(Math.ceil(that.data.total/10)>=that.data.pageNum){
|
|
|
- that.loadData();
|
|
|
-
|
|
|
+ // if(Math.ceil(that.data.total/10)>=that.data.pageNum){
|
|
|
+ that.loadData();
|
|
|
+
|
|
|
// }else{
|
|
|
-
|
|
|
+
|
|
|
// setTimeout(function () {
|
|
|
// that.setData({
|
|
|
// hidden: true,
|
|
@@ -146,18 +146,23 @@ if(res.code==200){
|
|
|
// }, 2000)
|
|
|
// }
|
|
|
|
|
|
-
|
|
|
- },
|
|
|
|
|
|
+ },
|
|
|
|
|
|
+ // 搜索结果跳页
|
|
|
+ bindViewSearchEnd() {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../material/serch/material_serch'
|
|
|
+ })
|
|
|
+ },
|
|
|
bindViewDetails(e) {
|
|
|
let material_details = e.currentTarget.dataset.index
|
|
|
-
|
|
|
-
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
wx.navigateTo({
|
|
|
- url: '../material/details/material_details?details='+JSON.stringify(material_details)
|
|
|
+ url: '../material/details/material_details?details=' + JSON.stringify(material_details)
|
|
|
})
|
|
|
}
|
|
|
})
|