n
This commit is contained in:
@@ -101,14 +101,21 @@ export default function Checkout() {
|
||||
|
||||
try {
|
||||
const orderPromises = items.map(item => {
|
||||
const orderData = {
|
||||
goodid: item.id,
|
||||
const type = params.type || 'config'
|
||||
const orderData: any = {
|
||||
quantity: item.quantity,
|
||||
customer_name: address.userName,
|
||||
phone_number: address.telNumber,
|
||||
shipping_address: `${address.provinceName}${address.cityName}${address.countyName}${address.detailInfo}`,
|
||||
type: params.type || 'config'
|
||||
ref_code: Taro.getStorageSync('ref_code') || ''
|
||||
}
|
||||
|
||||
if (type === 'course') {
|
||||
orderData.course = item.id
|
||||
} else {
|
||||
orderData.config = item.id
|
||||
}
|
||||
|
||||
return createOrder(orderData)
|
||||
})
|
||||
|
||||
@@ -123,7 +130,7 @@ export default function Checkout() {
|
||||
|
||||
if (results.length === 1) {
|
||||
// Single order, go to payment
|
||||
const orderId = results[0].order_id
|
||||
const orderId = results[0].id
|
||||
Taro.redirectTo({
|
||||
url: `/pages/order/payment?id=${orderId}`
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user