|
@@ -15,20 +15,37 @@ Page({
|
|
enterpriseList: [],
|
|
enterpriseList: [],
|
|
isRefresh: true,
|
|
isRefresh: true,
|
|
total: 0,
|
|
total: 0,
|
|
- pageNum: 1 // 页码
|
|
|
|
|
|
+ pageNum: 1, // 页码
|
|
|
|
+ longitude: '',
|
|
|
|
+ latitude: ''
|
|
|
|
+
|
|
},
|
|
},
|
|
onLoad: function () {
|
|
onLoad: function () {
|
|
// wx.showLoading({
|
|
// wx.showLoading({
|
|
// title: '加载中'
|
|
// title: '加载中'
|
|
// })
|
|
// })
|
|
- this.loadData()
|
|
|
|
|
|
+ let that=this
|
|
|
|
+ wx.getLocation({
|
|
|
|
+ type: 'wgs84',
|
|
|
|
+ success: function (res) {
|
|
|
|
+ that.setData({
|
|
|
|
+ longitude: res.longitude,
|
|
|
|
+ latitude: res.latitude
|
|
|
|
+ })
|
|
|
|
+ that.loadData()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
},
|
|
},
|
|
//加载数据
|
|
//加载数据
|
|
loadData: function () {
|
|
loadData: function () {
|
|
let obj = new Object()
|
|
let obj = new Object()
|
|
obj.pageNum = this.data.pageNum
|
|
obj.pageNum = this.data.pageNum
|
|
obj.pageSize = 10
|
|
obj.pageSize = 10
|
|
- obj.reasonable= false
|
|
|
|
|
|
+ obj.reasonable = false
|
|
|
|
+ obj.longitude=this.data.longitude
|
|
|
|
+ obj.latitude=this.data.latitude
|
|
|
|
+ console.log("###",this.data.longitude)
|
|
http.send_get("/system/AppWarehouseController/getWarehouseList", obj, this.getQiyeEnterpriseListSuccess)
|
|
http.send_get("/system/AppWarehouseController/getWarehouseList", obj, this.getQiyeEnterpriseListSuccess)
|
|
|
|
|
|
|
|
|
|
@@ -36,61 +53,61 @@ Page({
|
|
|
|
|
|
getQiyeEnterpriseListSuccess(res) {
|
|
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"
|
|
|
|
- })
|
|
|
|
- wx.hideLoading()
|
|
|
|
- }
|
|
|
|
- if (this.data.isRefresh) {
|
|
|
|
- this.setData({
|
|
|
|
- enterpriseList: res.data.rows,
|
|
|
|
- total: res.data.total
|
|
|
|
|
|
+ console.log("@@@@", res)
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ // 显示加载图标
|
|
|
|
+ wx.showLoading({
|
|
|
|
+ title: '玩命加载中',
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+ var that = this
|
|
|
|
|
|
-
|
|
|
|
- // 隐藏导航栏加载框
|
|
|
|
- setTimeout(function () {
|
|
|
|
- that.setData({
|
|
|
|
- loadingData: false
|
|
|
|
- });
|
|
|
|
- wx.hideNavigationBarLoading();
|
|
|
|
- // 停止下拉动作
|
|
|
|
- wx.stopPullDownRefresh();
|
|
|
|
|
|
+ if (res.data.rows.length == 0) {
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '暂无更多数据',
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
wx.hideLoading()
|
|
wx.hideLoading()
|
|
-
|
|
|
|
- }, 1000)
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+ 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 {
|
|
} 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 () {
|
|
onPullDownRefresh: function () {
|
|
// 显示顶部刷新图标
|
|
// 显示顶部刷新图标
|
|
@@ -112,7 +129,7 @@ if(res.code==200){
|
|
onReachBottom: function () {
|
|
onReachBottom: function () {
|
|
let that = this
|
|
let that = this
|
|
var loadingData = that.data.loadingData
|
|
var loadingData = that.data.loadingData
|
|
-
|
|
|
|
|
|
+
|
|
var hidden = that.data.hidden
|
|
var hidden = that.data.hidden
|
|
// 页数+1
|
|
// 页数+1
|
|
that.setData({
|
|
that.setData({
|
|
@@ -133,13 +150,13 @@ if(res.code==200){
|
|
loadingData: true
|
|
loadingData: true
|
|
});
|
|
});
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
//console.log("@@@@"+Math.ceil(this.data.total/10))
|
|
//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{
|
|
// }else{
|
|
-
|
|
|
|
|
|
+
|
|
// setTimeout(function () {
|
|
// setTimeout(function () {
|
|
// that.setData({
|
|
// that.setData({
|
|
// hidden: true,
|
|
// hidden: true,
|
|
@@ -148,25 +165,25 @@ if(res.code==200){
|
|
// }, 2000)
|
|
// }, 2000)
|
|
// }
|
|
// }
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
bindViewDetails(e) {
|
|
bindViewDetails(e) {
|
|
let teamlist_details = e.currentTarget.dataset.index
|
|
let teamlist_details = e.currentTarget.dataset.index
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
- url: '../warehouselist/details/warehouse_details?details='+JSON.stringify(teamlist_details)
|
|
|
|
|
|
+ url: '../warehouselist/details/warehouse_details?details=' + JSON.stringify(teamlist_details)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 搜索结果跳页
|
|
|
|
- bindViewSearchEnd() {
|
|
|
|
|
|
+ // 搜索结果跳页
|
|
|
|
+ bindViewSearchEnd() {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
- url:'../warehouselist/serch/warehouse_serch'
|
|
|
|
-
|
|
|
|
|
|
+ url: '../warehouselist/serch/warehouse_serch'
|
|
|
|
+
|
|
})
|
|
})
|
|
},
|
|
},
|
|
})
|
|
})
|