myorder.js 3.9 KB
// pages/myorder/myorder.js
// const app = getApp();
// import menu from '../template/template'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    navbar: [{
      name: '全部'
    },
    {
      name: '未付款'
    },
    {
      name: '已付款'
    },
    {
      name: '已完成'
    },
    ],
    currentTab:0,
    myorder:false,
    class:1,
    num:4,
    navbarjingxiao: [{
      name: '全部'
    },
    {
      name: '已提交'
    },
    {
      name: '已完成'
    },
    
    ],
    jingxiaocurrentTab:0
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // if(options.current!=undefined){
    //   this.setData({
    //     currentTab:options.current,
    //     jingxiaocurrentTab:options.current,
    //     class: options.kind
    //   })
    // }
    // if(options.kind!=undefined){
    //   this.setData({
        
    //     class: options.kind
    //   })
    // }
    
  },
  //底部导航跳转
  jump(e) {
    console.log(e)
    var that = this;
    wx.setStorageSync('num', e.currentTarget.dataset.num)
    let number = e.currentTarget.dataset.num
    console.log(number)
    if (number == 1) {
      wx.reLaunch({
        url: '/pages/homeindex/homeindex',
      })

    } else if (number == 2) {
      wx.redirectTo({
        url: '/pages/shopgoods/shopgoods',
      })
    } else if (number == 3) {

      wx.reLaunch({
        url: '/pages/shopcar/shopcar',
      })
    } else if (number == 4) {
      wx.reLaunch({
        url: '/pages/myorder/myorder',
      })
    } else if (number == 5) {
      let type = e.currentTarget.dataset.type;
      if (type == 1) {
        wx.reLaunch({
          //url: '/pages/visitormine/visitormine',
          url: '/pages/guidemine/guidemine'
        })
      }

    }
  },
  navbarTap: function (e) {
    let that = this;
    this.setData({
      currentTab: e.currentTarget.dataset.idx,
    })
  },

  jingxiaonavbarTap: function (e) {
    let that = this;
    console.log(e)
    this.setData({
      jingxiaocurrentTab: e.currentTarget.dataset.idx,
    })
  },

  //立即支付
  paynow(){
    wx.navigateTo({
      //url: '/pages/shop/goodtail/goodtail',
      url:'/pages/ordercontainer/sureorderone/sureorderone'
    })
  },

  buyagain(){
    wx.navigateTo({
      url: '/pages/ordercontainer/sureorderone/sureorderone',
    })
  },

  //订单详情

  //kind 订单身份 1普通客户  2 导购  type 订单状态  1 未付款 2已付款 3 已完成
  
  ordertail(e){
    console.log(e)
    let type=e.currentTarget.dataset.type;

    let kind =e.currentTarget.dataset.kind
    
      wx.navigateTo({
        url: '/pages/ordercontainer/orderdetail/orderdetail?kind='+kind+'&type='+type,
      })
   
  },
  //经销商订单详情
  jingxiaoordertail(e){
    let type = e.currentTarget.dataset.type;
    wx.navigateTo({
      url: '/pages/ordercontainer/jingxiaoorderdetail/jingxiaoorderdetail?type=' + type,
    })
  },

// 提交
  submitbtn(){
    wx.navigateTo({
      url: '/pages/ordercontainer/shopsureorder/shopsureorder',
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    let current = wx.getStorageSync('current');
    let kind = wx.getStorageSync('kind')
    this.setData({
      currentTab: current,
      jingxiaocurrentTab:current,
      class: kind
    })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})