diff --git a/pages/index/index.js b/pages/index/index.js index b43347f9..78ad52ed 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -9,7 +9,6 @@ Page({ duration: 1000, loadingHidden: false , // loading userInfo: {}, - images:[], swiperCurrent: 0, selectCurrent:0, categories: [], @@ -37,10 +36,12 @@ Page({ url:"/pages/goods-details/index?id="+e.currentTarget.dataset.id }) }, - bindViewTap: function() { - wx.navigateTo({ - url: '../logs/logs' - }) + tapBanner: function(e) { + if (e.currentTarget.dataset.id != 0) { + wx.navigateTo({ + url: "/pages/goods-details/index?id=" + e.currentTarget.dataset.id + }) + } }, bindTypeTap: function(e) { this.setData({ @@ -77,12 +78,8 @@ Page({ key: 'mallName' }, success: function(res) { - var images = []; - for(var i=0;i - + - + - + diff --git a/pages/order-details/index.js b/pages/order-details/index.js index 28257c21..c4fb0fdf 100644 --- a/pages/order-details/index.js +++ b/pages/order-details/index.js @@ -61,10 +61,11 @@ Page({ yunPrice: yunPrice }); }, - wuliuDetailsTap:function(){ - wx.navigateTo({ - url:"/pages/wuliu/index" - }) + wuliuDetailsTap:function(e){ + var orderId = e.currentTarget.dataset.id; + wx.navigateTo({ + url: "/pages/wuliu/index?id=" + orderId + }) }, confirmBtnTap:function(e){ var that = this; diff --git a/pages/order-details/index.wxml b/pages/order-details/index.wxml index a709ffde..ca9f0407 100644 --- a/pages/order-details/index.wxml +++ b/pages/order-details/index.wxml @@ -18,11 +18,11 @@ - + 快递单号:{{orderDetail.logistics.trackingNumber}} - - 快件离开 无锡中转部 已发往 杭州中部,操作员陈林娟杭州中部,操作员 陈林娟 - 2017/01/09 15:32:33 + + {{orderDetail.logisticsTraces[orderDetail.logisticsTraces.length-1].AcceptStation}} + {{orderDetail.logisticsTraces[orderDetail.logisticsTraces.length-1].AcceptTime}} diff --git a/pages/order-list/index.wxml b/pages/order-list/index.wxml index aa4bd276..ebb08761 100644 --- a/pages/order-list/index.wxml +++ b/pages/order-list/index.wxml @@ -15,9 +15,9 @@ 下单时间:{{item.dateAdd}} {{item.statusStr}} - + - 订单号:{{item.orderNumber}} + 订单号:{{item.orderNumber}} 备注: {{item.remark}} diff --git a/pages/wuliu/index.js b/pages/wuliu/index.js index a7c709c9..29d9ecb1 100644 --- a/pages/wuliu/index.js +++ b/pages/wuliu/index.js @@ -2,23 +2,34 @@ //获取应用实例 var app = getApp() Page({ - data: { - wuliu:[ - { - date:'2016-12-25 15:00:22', - info:'配送员开始配送,请您准备收货,配送员,罗启春手机号,13819935555' - }, - { - date:'2016-12-25 15:00:22', - info:'货物已分配,等待配送' + data: {}, + onLoad: function (e) { + var orderId = e.id; + this.data.orderId = orderId; + }, + onShow: function () { + var that = this; + wx.request({ + url: 'https://api.it120.cc/' + app.globalData.subDomain + '/order/detail', + data: { + token: app.globalData.token, + id: that.data.orderId }, - { - date:'2016-12-25 15:00:22', - info:'货物已到达 上海千阳站' + success: (res) => { + wx.hideLoading(); + if (res.data.code != 0) { + wx.showModal({ + title: '错误', + content: res.data.msg, + showCancel: false + }) + return; + } + that.setData({ + orderDetail: res.data.data, + logisticsTraces: res.data.data.logisticsTraces.reverse() + }); } - ] - }, - onLoad: function () { - console.log('onLoad') + }) } }) diff --git a/pages/wuliu/index.wxml b/pages/wuliu/index.wxml index ffcbd7d5..ea8ceeef 100644 --- a/pages/wuliu/index.wxml +++ b/pages/wuliu/index.wxml @@ -2,24 +2,24 @@ 物流单号 - 234892374972342034 + {{orderDetail.logistics.trackingNumber}} 物流公司 - 顺丰快递 + {{orderDetail.logistics.shipperName}} - + - {{item.date}} - {{item.info}} + {{item.AcceptTime}} + {{item.AcceptStation}}