| var util = require('../../utils/util.js'); | 
| var api = require('../../utils/service-api.js'); | 
| Page({ | 
|   data: { | 
|     userInfo: {}, | 
|     hasName: false, | 
|   }, | 
|   onLoad: function(options) { | 
|     var _this = this | 
|     var userInfo = getApp().userInfo; | 
|     this.setData({ | 
|       userInfo: userInfo, | 
|     }); | 
|   | 
|     //判断用户名称是否已经授权 | 
|     if (util.isNotBlank(userInfo.nickName)) { | 
|       this.setData({ | 
|         hasName: true, | 
|       }); | 
|     } | 
|   | 
|     this.getOrderStatusCount(); | 
|   | 
|   | 
|   }, | 
|   | 
|   | 
|   /** | 
|    * 获取订单数量 | 
|    */ | 
|   getOrderStatusCount(){ | 
|     var _this=this; | 
|     util.request({ | 
|       method:'GET', | 
|       api: api.order.getOrderStatusCount, | 
|       callback: function (data) { | 
|          let rows=data.rows; | 
|           | 
|          for(let i=0; i<rows.length ; i++){ | 
|             | 
|            if (rows[i].orderStatus==1){  | 
|              _this.setData({ 'WAIT_PAY': rows[i].count }); | 
|            } else if (rows[i].orderStatus == 2) { | 
|              _this.setData({ 'WAIT_SEND': rows[i].count }); | 
|            } else if (rows[i].orderStatus == 3) {  | 
|              _this.setData({ 'WAIT_RECEIVE': rows[i].count }); | 
|            } else if (rows[i].orderStatus == 6) {  | 
|              _this.setData({ 'APPLY_MONEYBACK': rows[i].count }); | 
|            } | 
|            | 
|          } | 
|   | 
|       }, | 
|     }); | 
|   | 
|   | 
|   }, | 
|   | 
|   onShow: function() { | 
|     var _this = this; | 
|   | 
|   | 
|   }, | 
|   | 
|   //登录 | 
|   login:function(){ | 
|     wx.navigateTo({ | 
|       url: '/pages/welcome/welcome?url=/pages/customerCenter/customerCenter', | 
|     }) | 
|   }, | 
|     myCollect(e){ | 
|         wx.navigateTo({ | 
|             url: '/pages/yuyue/order?status=0', | 
|         }) | 
|     }, | 
|   | 
|   onStatusEvent(e) { | 
|     var status = e.currentTarget.dataset.status; | 
|     wx.navigateTo({ | 
|       url: '../order/order?status=' + status, | 
|     }) | 
|   }, | 
|   addressJumpEvent(e) { | 
|     wx.navigateTo({ | 
|       url: '../editAddress/editAddress', | 
|     }) | 
|   }, | 
|   checkRecord(){ | 
|     wx.navigateTo({ | 
|       url: '/pages/checkRecord/recordList', | 
|     }) | 
|   }, | 
|   | 
|   | 
|   refundStatus(e) { | 
|     wx.navigateTo({ | 
|       url: '../refundOrder/refundOrder', | 
|     }) | 
|   }, | 
|   // 查看个人信息 | 
|   lookUserInfo() { | 
|     wx.navigateTo({ | 
|       url: '../personalInfo/personalInfo', | 
|     }) | 
|   }, | 
|   | 
|   | 
|   // 进入我的优惠券 | 
|   intoCoupon() { | 
|     wx.navigateTo({ | 
|       url: '../customerCoupons/customerCoupons', | 
|     }) | 
|   }, | 
|   | 
|    | 
|   | 
| }) |