123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- // pages/yichang/index.js
- const app = getApp();
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- labelid: 1,
- labellist:[{
- id:1,name:'需用户确认'
- },{
- id:0,name:'需人工结算'
- },{
- id:2,name:'处理完成'
- }],
- keyword: '',
- pageindex: 1,
- data: []
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- this.setData({pageindex: 1})
- this.getdata()
- },
- getdata() {
- var that = this;
- app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/entry/abnormal", {
- status: that.data.labelid,
- key: that.data.keyword,
- page: that.data.pageindex
- }, "get").then(function (res) {
- console.log(res);
- if (res.code != 200) {
- wx.showLoading({
- title: res.message.msg,
- })
- that.setData({pageindex: that.data.pageindex -= 1})
- setTimeout(function () {
- wx.hideLoading();
- }, 1000);
-
- } else {
- wx.hideLoading();
- if (that.data.pageindex == 1) {
- that.setData({data: []})
- }
- if (res.message.data.data.length > 0) {
- that.setData({data: that.data.data.concat(res.message.data.data)})
- } else {
- that.setData({pageindex: that.data.pageindex -= 1})
- }
-
- }
- }).catch(function (err) {
-
- console.log(222);
- })
- },
- changkeyword(e) {
- this.setData({
- keyword: e.detail.value
- })
- },
- changelabel(e){
- let id = e.currentTarget.dataset.id
-
- this.setData({labelid:id,pageindex: 1})
- this.getdata()
- },
- gosearch(){
- this.setData({pageindex: 1})
- this.getdata()
- },
- goinfo(e){
- let id = e.currentTarget.dataset.id;
- let order_id=e.currentTarget.dataset.order_id;
- console.log(e.currentTarget.dataset)
- if(this.data.labelid==1){
- wx.navigateTo({
- url:'/pages/error/yichangchuli/index?id='+id+"&order_id="+order_id,
- })
- }else if(this.data.labelid==0){
- wx.navigateTo({
- url:'/pages/error/jiesuan/index?id='+id+"&order_id="+order_id,
- })
- }
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh:function(){
- this.setData({pageindex: 1})
- this.getdata()
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- this.setData({pageindex:this.data.pageindex+=1})
- this.getdata()
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- }
- })
|