cyywl_server/yudao-ui-app/libs/order.js

56 lines
1.4 KiB
JavaScript
Raw Permalink Normal View History

2023-05-15 10:12:22 +08:00
import {
preOrderApi
} from '@/api/order.js';
import util from 'utils/util'
/**
* 去商品详情
*/
export function goShopDetail(item, uid) {
2023-05-26 11:39:43 +08:00
console.log(item,'indexItem哇')
2023-05-15 10:12:22 +08:00
return new Promise(resolve => {
if (item.activityH5 && item.activityH5.type === "1") {
uni.navigateTo({
url: `/pages/activity/goods_seckill_details/index?id=${item.activityH5.id}`
})
} else if (item.activityH5 && item.activityH5.type === "2") {
uni.navigateTo({
url: `/pages/activity/goods_bargain_details/index?id=${item.activityH5.id}&startBargainUid=${uid}`
})
} else if (item.activityH5 && item.activityH5.type === "3") {
uni.navigateTo({
url: `/pages/activity/goods_combination_details/index?id=${item.activityH5.id}`
})
} else {
resolve(item);
}
});
}
2023-05-26 11:39:43 +08:00
export function goShopDetailCart(item, uid) {
console.log(item,'itemWWw阿')
return new Promise(resolve => {
resolve(item);
});
}
2023-05-15 10:12:22 +08:00
/**
* 活动商品普通商品购物车再次购买预下单
*/
export function getPreOrder(preOrderType, orderDetails) {
return new Promise((resolve, reject) => {
preOrderApi({
"preOrderType": preOrderType,
"orderDetails": orderDetails
}).then(res => {
2023-05-24 17:08:06 +08:00
// console.log(res.data.columns.preOrderNo,'preOrder')
2023-05-15 10:12:22 +08:00
uni.navigateTo({
2023-05-24 17:08:06 +08:00
url: '/pages/users/order_confirm/index?preOrderNo=' + res.data.columns.preOrderNo
2023-05-15 10:12:22 +08:00
});
}).catch(err => {
return util.Tips({
title: err
});
})
});
}