1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

小程序商品列表页优化;添加我的订单页面

This commit is contained in:
2023-03-20 23:34:59 +08:00
parent 960280b11e
commit c9f171e5d5
17 changed files with 331 additions and 167 deletions

View File

@@ -0,0 +1,83 @@
// pages/shop/myOrder.js
const goodService = require("../../services/good")
const orderService = require("../../services/order")
Page({
/**
* 页面的初始数据
*/
data: {
orderList: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.loadPageData()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
loadPageData() {
(async () => {
let orderList = await orderService.listUserOrder()
console.log("orderList", orderList)
this.setData({
orderList: orderList.map(order => {
order.displayDate = order.orderDate.replace("T", " ")
return order
})
})
})();
}
})