Browse Source

user order

wangyong 6 years ago
parent
commit
32c3699604

+ 5 - 3
customized/pages/order/order.js

@@ -7,14 +7,16 @@ Page({
    * 页面的初始数据
    */
   data: {
-
+    state:null, // 请求状态
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    this.setData({
+      state:options.state
+    })
   },
 
   /**
@@ -76,7 +78,7 @@ Page({
         'content-type': 'application/x-www-form-urlencoded'
       },
       data:{
-        userId:app.globalData.userId,
+        userId:app.globalData.user_id,
         orderStatus: state, //订单状态  0未支付\\1: 待定制\\2: 待发货\\3: 已发货\\4: 已完成\\5: 取消'
         limit:10,
         offset:page,

+ 6 - 0
customized/pages/user/user.js

@@ -67,5 +67,11 @@ Page({
    */
   onShareAppMessage: function () {
 
+  },
+  orderInfor(e){
+    let state = e.currentTarget.dataset.state;
+    wx.navigateTo({
+      url: '/customized/pages/order/order?state='+ state,
+    })
   }
 })

+ 3 - 3
customized/pages/user/user.wxml

@@ -12,15 +12,15 @@
 <view class='user-order'>
     <view class="mar-t20 pad-t20 pad-b20 mar-r20 f-s30 mar-l20 order-title">我的订单</view>
     <view class='f-box order-list f-justify-content-center mar-l20 mar-r20 f-s28'>
-      <view class='f-item'>
+      <view class='f-item' data-state="0" bindtap='orderInfor'>
         <icon class='iconfont icon-icon-test c-orange'></icon>
         <view>待付款</view>
       </view>
-      <view class='f-item'>
+      <view class='f-item' data-state="2" bindtap='orderInfor'>
         <icon class='iconfont icon-daifahuo1 c-orange'></icon>
         <view>待发货</view>
       </view>
-      <view class='f-item'>
+      <view class='f-item' data-state="3" bindtap='orderInfor'>
         <icon class='iconfont icon-daishouhuo c-orange'></icon>
         <view>待收货</view>
       </view>