|
@@ -6,19 +6,48 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
- content:[]
|
|
|
+ typeid: 0,
|
|
|
+ typelist:['未取','已取'],
|
|
|
+ selectitem: '',
|
|
|
+ selectInfo: [],
|
|
|
+ content:[]
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
- this.getData()
|
|
|
+ this.getinfo()
|
|
|
+ this.getdata()
|
|
|
},
|
|
|
- getData:function(){
|
|
|
+ changeisselect(){
|
|
|
+ this.setData({isselect: !this.data.isselect})
|
|
|
+ },
|
|
|
+ chooseselect(e){
|
|
|
+ this.setData({selectitem: e.currentTarget.dataset.item})
|
|
|
+ this.changeisselect()
|
|
|
+ this.getdata()
|
|
|
+ },
|
|
|
+ getinfo(){
|
|
|
+ let that = this
|
|
|
+ app.api.useApi(app.globalData.baseAppUrl + "api/admin/shop_list", {}, "get").then(function (res) {
|
|
|
+ wx.hideLoading();
|
|
|
+ if (res.code== 200) {
|
|
|
+ that.setData({selectInfo:res.message.data})
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+ }).catch(function (err) {
|
|
|
+ console.log(222);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getdata(){
|
|
|
var that=this
|
|
|
- app.api.useApi(app.globalData.baseAppUrl + "api/admin/SignFor", {
|
|
|
-
|
|
|
+ wx.showLoading()
|
|
|
+ app.api.useApi(app.globalData.baseAppUrl + "api/admin/temporary_list", {
|
|
|
+ status: that.data.typeid,
|
|
|
+ network_id: that.data.selectitem.id || 0,
|
|
|
+ created_at: ''
|
|
|
}, "get").then(function (res) {
|
|
|
console.log(res);
|
|
|
if (res.code != 200) {
|
|
@@ -30,10 +59,15 @@ Page({
|
|
|
}, 1000);
|
|
|
|
|
|
} else {
|
|
|
- wx.hideLoading();
|
|
|
- that.setData({
|
|
|
- content:res.message.data
|
|
|
- })
|
|
|
+ wx.hideLoading()
|
|
|
+ if (that.data.pageindex == 1) {
|
|
|
+ that.setData({content: []})
|
|
|
+ }
|
|
|
+ if (res.message.data.length > 0) {
|
|
|
+ that.setData({content: that.data.content.concat(res.message.data)})
|
|
|
+ } else {
|
|
|
+ that.setData({pageindex: that.data.pageindex -= 1})
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}).catch(function (err) {
|
|
@@ -42,6 +76,16 @@ Page({
|
|
|
})
|
|
|
|
|
|
},
|
|
|
+ changetype(){
|
|
|
+ let that = this
|
|
|
+ wx.showActionSheet({
|
|
|
+ itemList: that.data.typelist,
|
|
|
+ success (res) {
|
|
|
+ that.setData({typeid: res.tapIndex})
|
|
|
+ that.getdata()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
|
@@ -81,7 +125,8 @@ Page({
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
*/
|
|
|
onReachBottom: function () {
|
|
|
-
|
|
|
+ this.setData({pageindex:this.data.pageindex+=1})
|
|
|
+ this.getdata()
|
|
|
},
|
|
|
|
|
|
/**
|