You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.8 KiB

3 months ago
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  5. // +----------------------------------------------------------------------
  6. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  7. // +----------------------------------------------------------------------
  8. // | Author: CRMEB Team <admin@crmeb.com>
  9. // +----------------------------------------------------------------------
  10. import {preOrderApi} from '@/api/order.js';
  11. import util from 'utils/util'
  12. import animationType from '@/utils/animationType.js'
  13. /**
  14. * 去商品详情
  15. */
  16. export function goShopDetail(item, uid) {
  17. return new Promise(resolve => {
  18. if (item.activityH5 && item.activityH5.type === "1") {
  19. uni.navigateTo({
  20. url: `/pages/activity/goods_seckill_details/index?id=${item.activityH5.id}`
  21. })
  22. } else if (item.activityH5 && item.activityH5.type === "2") {
  23. uni.navigateTo({
  24. url: `/pages/activity/goods_bargain_details/index?id=${item.activityH5.id}&startBargainUid=${uid}`
  25. })
  26. } else if (item.activityH5 && item.activityH5.type === "3") {
  27. uni.navigateTo({
  28. url: `/pages/activity/goods_combination_details/index?id=${item.activityH5.id}`
  29. })
  30. } else {
  31. resolve(item);
  32. }
  33. });
  34. }
  35. /**
  36. * 活动商品普通商品购物车再次购买预下单
  37. */
  38. export function getPreOrder(preOrderType, orderDetails) {
  39. return new Promise((resolve, reject) => {
  40. preOrderApi({
  41. "preOrderType": preOrderType,
  42. "orderDetails": orderDetails
  43. }).then(res => {
  44. uni.navigateTo({
  45. url: '/pages/order/order_confirm/index?preOrderNo=' + res.data.preOrderNo
  46. });
  47. }).catch(err => {
  48. return util.Tips({
  49. title: err
  50. });
  51. })
  52. });
  53. }