promotion.js 608 B

123456789101112131415161718192021
  1. import { getGoodsList } from './goods';
  2. export function getPromotion(baseID = 0, length = 10) {
  3. return {
  4. list: getGoodsList(baseID, length).map((item) => {
  5. return {
  6. spuId: item.spuId,
  7. thumb: item.primaryImage,
  8. title: item.title,
  9. price: item.minSalePrice,
  10. originPrice: item.maxLinePrice,
  11. tags: item.spuTagList.map((tag) => ({ title: tag.title })),
  12. };
  13. }),
  14. banner:
  15. 'https://cdn-we-retail.ym.tencent.com/tsr/promotion/banner-promotion.png',
  16. time: 1000 * 60 * 60 * 20,
  17. showBannerDesc: true,
  18. statusTag: 'running',
  19. };
  20. }