123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- // pages/tabber/news/index.js
- const app=getApp();
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- selectInfo: {},
- inputValue:"",
- show:false,
- vtype:"订单号",
- ktype:0,
- columns: ['订单号', '物流单号', '水洗码', '封签号', '手机号','用户姓名'],
- pageindex: 1,
- order_count: 0,
- shopsind: 0,
- shopslist: [{
- id:0,title:'全部'
- }],
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- class Select {
- in = 1
- getSelet(){
- console.log(2);
- return 10
- }
- }
- var b = new Select();
- console.log(b.getSelet());
- this.serch();
- this.getshopslist()
- },
- onPullDownRefresh:function(){
- this.setData({pageindex: 1})
- this.serch();
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- this.setData({pageindex:this.data.pageindex+=1})
- this.serch()
- },
- getshopslist(){
- let that = this
- wx.showLoading()
- app.api.useApi(app.globalData.baseAppUrl + "api/admin/SearchOrder", {
- key: '',
- logistics_status:0,
- network_id:"",
- created_at:"",
- page: 1
- }, "post").then(function (res) {
- wx.hideLoading()
- if(res.code==200){
- that.setData({
- shopslist:that.data.shopslist.concat(res.message.data.networker)
- })
- }
- }).catch(function (err) {
- console.log(222);
- })
- },
- click(){
- this.setData({
- show:!this.data.show
- })
- },
- onChange(event) {
- const { picker, value, index } = event.detail;
- this.setData({
- vtype:value,
- show:!this.data.show,
- ktype:index
- })
- console.log(`当前值:${value}, 当前索引:${index}`);
- },
-
- onCancel() {
- Toast('取消');
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
-
- },
- goto:function(e){
- wx.navigateTo({
- url: "/pages/serah/detal?id="+e.currentTarget.dataset.id
- })
- },
- bindinput(e){
- this.setData({
- inputValue: e.detail.value
- })
- },
- shopschange(e){
- this.setData({shopsind: e.detail.value})
- this.serch()
- },
- serch(){
- var that=this;
- app.api.useApi(app.globalData.baseAppUrl + "api/admin/SearchOrder", {
- key: that.data.inputValue,
- logistics_status:0,
- network_id:that.data.shopsind!=0?that.data.shopslist[that.data.shopsind].id:'',
- created_at:"",
- page: that.data.pageindex
- }, "post").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();
- that.setData({order_count:res.message.data.order_count})
- if (that.data.pageindex == 1) {
- that.setData({selectInfo: []})
- }
- if (res.message.data.list.length > 0) {
- that.setData({selectInfo: that.data.selectInfo.concat(res.message.data.list)})
- } else {
- that.setData({pageindex: that.data.pageindex -= 1})
- }
- }
- }).catch(function (err) {
-
- console.log(222);
- })
- }
- })
|