51 lines
923 B
JavaScript
51 lines
923 B
JavaScript
const app = getApp()
|
|
const baseUrl = app.globalData.baseUrl
|
|
// page/component/orders/orders.js
|
|
Page({
|
|
// onLoad: function (options) {
|
|
// this.setData({
|
|
// orders: [...this.data.orders, options]
|
|
// });
|
|
// },
|
|
data: {
|
|
address: {},
|
|
hasAddress: false,
|
|
total: 0,
|
|
orders: [],
|
|
},
|
|
onLoad() {
|
|
var self = this
|
|
// 获取statu为2的待收货订单
|
|
wx.request({
|
|
url: baseUrl + "/order/loadData",
|
|
method: "POST",
|
|
data: {
|
|
userId: 1,
|
|
statu: 2
|
|
},
|
|
success(res) {
|
|
self.setData({
|
|
orders: res.data.data,
|
|
})
|
|
console.log('orders',self.data.orders)
|
|
},
|
|
})
|
|
},
|
|
onReady() {
|
|
},
|
|
|
|
onShow: function () {
|
|
const self = this
|
|
wx.getStorage({
|
|
key: "address",
|
|
success(res) {
|
|
self.setData({
|
|
address: res.data,
|
|
hasAddress: true,
|
|
})
|
|
},
|
|
})
|
|
},
|
|
|
|
})
|