Authored by 肖亚东

物流信息为空时显示无数据页面 — review by 李其昌

@@ -7,7 +7,6 @@ Page({ @@ -7,7 +7,6 @@ Page({
7 */ 7 */
8 data: { 8 data: {
9 expressSender: '', 9 expressSender: '',
10 - // logisticsList: [ {'content':'南京市正在派送中,请准备签收(派件人:小明 电话:18323458818)', 'time': '2018.09.15 19:23:59'}, {'content':'南京市正在派送中,请准备签收(派件人:小明 电话:18323458818)', 'time': '2018.09.15 19:23:59'}, {'content':'南京市正在派送中,请准备签收(派件人:小明 电话:18323458818)', 'time': '2018.09.15 19:23:59'}],  
11 expressCompanyName: '', 10 expressCompanyName: '',
12 wayBillCode: '', 11 wayBillCode: '',
13 expressInfoDetailList: [], 12 expressInfoDetailList: [],
@@ -18,18 +17,16 @@ Page({ @@ -18,18 +17,16 @@ Page({
18 */ 17 */
19 onLoad: function (options) { 18 onLoad: function (options) {
20 // let orderCode = '9790272561152'; 19 // let orderCode = '9790272561152';
21 - let orderCode = options.orderCode; 20 + let orderCode = options.orderCode ? options.orderCode : '';
22 this.fetchLogisticsInfo(orderCode); 21 this.fetchLogisticsInfo(orderCode);
23 }, 22 },
24 23
25 fetchLogisticsInfo: function (orderCode) { 24 fetchLogisticsInfo: function (orderCode) {
26 let that = this; 25 let that = this;
27 - // let params = {  
28 - // orderCode,  
29 - // debug: 'XYZ'  
30 - // }  
31 let params = { 26 let params = {
32 - orderCode 27 + orderCode,
  28 + uid: '500031132',
  29 + debug: 'XYZ'
33 } 30 }
34 31
35 let api = new logisticsService(); 32 let api = new logisticsService();
1 -{}  
  1 +{
  2 + "navigationBarBackgroundColor": "#ffffff",
  3 + "usingComponents": {
  4 + "no-data-show-view": "../../../components/no-data-show-view/no-data-show-view"
  5 + }
  6 +}
1 <!--dist/pages/logistics.wxml--> 1 <!--dist/pages/logistics.wxml-->
2 <view class="container"> 2 <view class="container">
3 - <text class="message-title">{{expressSender}}</text> 3 + <view wx:if="{{expressInfoDetailList.length}}">
  4 + <text class="message-title">{{expressSender}}</text>
4 5
5 - <view class="header-detail">  
6 - <image src="../../../assets/images/express_info@2x.png" class="express-icon" mode="aspectFill" />  
7 - <view class="header-content">  
8 - <view class="company">  
9 - <text class="tips">快递公司:</text>  
10 - <text class="express-content">{{expressCompanyName}}</text>  
11 - </view>  
12 - <view class="number">  
13 - <text class="tips">快递单号:</text>  
14 - <text class="express-content">{{wayBillCode}}</text>  
15 - </view>  
16 - </view>  
17 - </view> 6 + <view class="header-detail">
  7 + <image src="../../../assets/images/express_info@2x.png" class="express-icon" mode="aspectFill" />
  8 + <view class="header-content">
  9 + <view class="company">
  10 + <text class="tips">快递公司:</text>
  11 + <text class="express-content">{{expressCompanyName}}</text>
  12 + </view>
  13 + <view class="number">
  14 + <text class="tips">快递单号:</text>
  15 + <text class="express-content">{{wayBillCode}}</text>
  16 + </view>
  17 + </view>
  18 + </view>
18 19
19 - <view class="space-line"></view> 20 + <view class="space-line"></view>
20 21
21 - <view class='logistics-list'>  
22 - <block wx:for="{{expressInfoDetailList}}" wx:key="{{index}}">  
23 - <view class='cell'>  
24 - <view class="left-view">  
25 - <view wx:if="{{index==0}}" class="black-view">  
26 - <image class="icon" src="../../../assets/images/xuanze@2x.png"></image>  
27 - <view class="first-line"></view> 22 + <view class='logistics-list'>
  23 + <block wx:for="{{expressInfoDetailList}}" wx:key="{{index}}">
  24 + <view class='cell'>
  25 + <view class="left-view">
  26 + <view wx:if="{{index==0}}" class="black-view">
  27 + <image class="icon" src="../../../assets/images/xuanze@2x.png"></image>
  28 + <view class="first-line"></view>
  29 + </view>
  30 + <view wx:else class="gray-view">
  31 + <view class="circle"></view>
  32 + <view class="line"></view>
  33 + </view>
28 </view> 34 </view>
29 - <view wx:else class="gray-view">  
30 - <view class="circle"></view>  
31 - <view class="line"></view> 35 + <view class="right-view">
  36 + <view class="content {{index==0?'black':''}}">{{item.acceptRemark}}</view>
  37 + <view class="time {{index==0?'black':''}}">{{item.createTimeStr}}</view>
32 </view> 38 </view>
33 </view> 39 </view>
34 - <view class="right-view">  
35 - <view class="content {{index==0?'black':''}}">{{item.acceptRemark}}</view>  
36 - <view class="time {{index==0?'black':''}}">{{item.createTimeStr}}</view>  
37 - </view> 40 + </block>
38 </view> 41 </view>
39 - </block>  
40 </view> 42 </view>
41 - 43 + <view wx:else class='empty'>
  44 + <no-data-show-view emptyText="暂无物流"></no-data-show-view>
  45 + </view>
  46 +
42 </view> 47 </view>
@@ -112,3 +112,12 @@ @@ -112,3 +112,12 @@
112 color: #000000; 112 color: #000000;
113 } 113 }
114 114
  115 +.empty {
  116 + display: flex;
  117 + justify-content: center;
  118 + font-family: PingFang-SC-Regular;
  119 + color: #999;
  120 + font-size: 30rpx;
  121 + letter-spacing: 0.8px;
  122 + margin-top: 200rpx;
  123 +}