| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- var app = getApp();
- // pages/promotion-order/promotion-order.js
- Page({
- data: {
- url: app.globalData.urlImages,
- currentTab:"",
- hiddens:true,
- icondui:0,
- icondui2: 0,
- alloeder: ['全部订单', '已评价', '已发货'],
- allOrder:"全部订单",
- promoter:"推广粉丝",
- promoterList: [],
- orderlist:[],
- orderconut:'',
- ordermoney:''
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- app.setBarColor();
- app.setUserInfo();
- var header = {
- 'content-type': 'application/x-www-form-urlencoded',
- };
- this.orderlist();
- this.extension(header);
- this.orderlistmoney();
-
- },
- extension: function (header){
- var that = this;
- wx.request({
- url: app.globalData.url + '/routine/auth_api/get_spread_list?uid=' + app.globalData.uid,
- method: 'POST',
- header: header,
- success: function (res) {
- // console.log(res.data.data);
- if (res.data.code==200){
- that.setData({
- promoterList: res.data.data.list
- })
- }else{
- that.setData({
- promoterList: []
- })
- }
- }
- });
- },
- spread: function () {
- wx.navigateTo({
- url: '../../pages/spread/spread',
- success: function (res) { },
- fail: function (res) { },
- complete: function (res) { },
- })
- },
-
- ordertap:function(e){
- var currentTab = e.target.dataset.index;
- this.setData({
- currentTab:currentTab,
- hiddens:false
- })
- console.log(this.data.currentTab)
- },
- icondui:function(e){
- var that=this;
- var icondui = e.target.dataset.ider;
- that.setData({
- icondui: icondui,
- hiddens: true,
- allOrder: that.data.alloeder[icondui],
- currentTab: -1
- })
- that.orderlist();
- this.orderlistmoney();
- },
- icondui2:function(e){
- var that = this;
- var icondui2 = e.target.dataset.ider;
- var promoterLists = that.data.promoterList;
- var len = promoterLists.length;
- for (var index in promoterLists){
- if (promoterLists[index]['uid'] == icondui2){
- var promoter = promoterLists[index]['nickname'];
- }
- }
- that.setData({
- icondui2: icondui2,
- hiddens: true,
- promoter: promoter,
- currentTab: -1
- })
- that.orderlist();
- },
- zhaoguan:function(e){
- this.setData({
- hiddens: true,
- currentTab: -1
- })
- },
- orderlist: function (){
- var header = {
- 'content-type': 'application/x-www-form-urlencoded',
- };
- var that = this;
- var icondui = that.data.icondui;
- var icondui2 = that.data.icondui2;
- wx.request({
- url: app.globalData.url + '/routine/auth_api/subordinateOrderlist?uid=' + app.globalData.uid,
- data: { uid: icondui2, status: icondui},
- method: 'POST',
- header: header,
- success: function (res) {
- if (res.data.code==200){
- that.setData({
- orderlist: res.data.data
- })
- }else{
- that.setData({
- orderlist: []
- })
- }
- }
- })
- },
- orderlistmoney: function () {
- var that = this;
- wx.request({
- url: app.globalData.url + '/routine/auth_api/subordinateOrderlistmoney?uid=' + app.globalData.uid,
- data: { status: that.data.icondui},
- method: 'POST',
- success: function (res) {
- if (res.data.code == 200) {
- that.setData({
- ordermoney: res.data.data.sum,
- orderconut: res.data.data.cont
- })
- } else {
- that.setData({
- ordermoney:'',
- orderconut:''
- })
- }
- }
- })
- }
-
- })
|