Skip to content

Commit

Permalink
优化物流跟踪,banner增加商品链接
Browse files Browse the repository at this point in the history
  • Loading branch information
gooking committed May 24, 2017
1 parent 61b8ca0 commit 228be11
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 44 deletions.
17 changes: 7 additions & 10 deletions pages/index/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Page({
duration: 1000,
loadingHidden: false , // loading
userInfo: {},
images:[],
swiperCurrent: 0,
selectCurrent:0,
categories: [],
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -77,12 +78,8 @@ Page({
key: 'mallName'
},
success: function(res) {
var images = [];
for(var i=0;i<res.data.data.length;i++){
images.push(res.data.data[i].picUrl);
}
that.setData({
images:images
banners: res.data.data
});
}
})
Expand Down
6 changes: 3 additions & 3 deletions pages/index/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<view class="swiper-container">
<swiper class="swiper_box"
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperchange">
<block wx:for="{{images}}">
<block wx:for="{{banners}}">
<swiper-item>
<image src="{{item}}" class="slide-image" width="750rpx" height="562.5rpx"/>
<image bindtap="tapBanner" data-id="{{item.businessId}}" src="{{item.picUrl}}" class="slide-image" width="750rpx" height="562.5rpx"/>
</swiper-item>
</block>
</swiper>
<view class="dots">
<block wx:for="{{images}}" wx:key="unique">
<block wx:for="{{banners}}" wx:key="unique">
<view class="dot{{index == swiperCurrent ? ' active' : ''}}"></view>
</block>
</view>
Expand Down
9 changes: 5 additions & 4 deletions pages/order-details/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions pages/order-details/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
<view class="icon-box">
<image class="icon" src="/images/order-details/icon-wuliu.png"></image>
</view>
<view class="right-text" bindtap="wuliuDetailsTap">
<view class="right-text" bindtap="wuliuDetailsTap" data-id="{{orderDetail.orderInfo.id}}">
<view class="order-number">快递单号:{{orderDetail.logistics.trackingNumber}}</view>
<block wx:if="{{orderDetail.logistics.traces}}">
<view class="wuliu-text">快件离开 无锡中转部 已发往 杭州中部,操作员陈林娟杭州中部,操作员 陈林娟</view>
<view class="wuliu-date">2017/01/09 15:32:33</view>
<block wx:if="{{orderDetail.logisticsTraces}}">
<view class="wuliu-text">{{orderDetail.logisticsTraces[orderDetail.logisticsTraces.length-1].AcceptStation}}</view>
<view class="wuliu-date">{{orderDetail.logisticsTraces[orderDetail.logisticsTraces.length-1].AcceptTime}}</view>
</block>
</view>
<view class="arrow-right">
Expand Down
4 changes: 2 additions & 2 deletions pages/order-list/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<view class="date-box">下单时间:{{item.dateAdd}}</view>
<view class="status {{(item.status==-1 || item.status==4) ? '':'red'}}">{{item.statusStr}}</view>
</view>
<view class="goods-info">
<view class="goods-info" bindtap="orderDetail" data-id="{{item.id}}">
<view class="goods-des">
<view bindtap="orderDetail" data-id="{{item.id}}">订单号:{{item.orderNumber}} </view>
<view>订单号:{{item.orderNumber}} </view>
<view wx:if="{{item.remark && item.remark != ''}}">备注: {{item.remark}}</view>
</view>
</view>
Expand Down
43 changes: 27 additions & 16 deletions pages/wuliu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
}
})
10 changes: 5 additions & 5 deletions pages/wuliu/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
<view class="top-sec">
<view class="a-row">
<view class="label">物流单号</view>
<view class="text">234892374972342034</view>
<view class="text">{{orderDetail.logistics.trackingNumber}}</view>
</view>
<view class="a-row">
<view class="label">物流公司</view>
<view class="text">顺丰快递</view>
<view class="text">{{orderDetail.logistics.shipperName}}</view>
</view>
</view>
<view class="sec-wrap">
<view class="details-info">
<view class="line-box"></view>
<view class="a-row" wx:for-items="{{wuliu}}" wx:key="{{index}}">
<view class="a-row" wx:for-items="{{logisticsTraces}}" wx:key="{{index}}">
<view class="dot">
<view class="active-dot" hidden="{{index== 0 ? false : true}}"><view class="yuan-red"></view></view>
<view class="default-dot" hidden="{{index== 0 ? true : false}}"></view>
</view>
<view class="info">
<view class="date-box">{{item.date}}</view>
<view class="text">{{item.info}}</view>
<view class="date-box">{{item.AcceptTime}}</view>
<view class="text">{{item.AcceptStation}}</view>
</view>
</view>

Expand Down

0 comments on commit 228be11

Please sign in to comment.