小程序(及后端)订单详情页完成;后端获取用户订单列表接口完成
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user