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

小程序(及后端)订单详情页完成;后端获取用户订单列表接口完成

This commit is contained in:
2023-03-20 00:24:19 +08:00
parent 90a17c926e
commit 960280b11e
29 changed files with 838 additions and 53 deletions

View File

@@ -1,6 +1,7 @@
// pages/shop/goodDetail.js
const goodService = require("../../services/good")
const orderService = require("../../services/order")
Page({
@@ -73,6 +74,25 @@ Page({
},
// 立即下单
btnBuyTap() {
(async () => {
// 创建订单
let orderList = [{
goodId: this.data.goodId,
count: 1,
}]
let orderId = await orderService.createOrder(orderList)
console.log("orderId", orderId)
// 跳转订单查看页面(携带订单号)
wx.navigateTo({
// url: "/pages/scan/entrance?a=1"
url: "/pages/shop/orderConfirm?orderId=" + orderId
})
})();
},
loadPageData() {
(async () => {
let goodDetail = await goodService.getGoodDetail(this.data.goodId)