import { Injectable } from '@angular/core';
import { Observable, of } from 'rxjs';
import { delay } from 'rxjs/operators';

@Injectable({
  providedIn: 'root'
})
export class PromotionsService {

  constructor() {}

  getPromotions(): Observable<any[]> {
    return of([
      { title: '冬季健康检查优惠', description: '享受8折优惠...', date: '2024-12-20', popularity: 95, isFavorite: false, imageUrl: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.RNekCd1V3wbySaoh_3IY9wHaNK?rs=1&pid=ImgDetMain' },
      { title: '新用户注册礼', description: '首次注册即送价值100元的代金券...', date: '2024-12-15', popularity: 90, isFavorite: true, imageUrl: 'https://tse3-mm.cn.bing.net/th/id/OIP-C.knH8-tlKgbkF24-LuEkIrAHaJv?rs=1&pid=ImgDetMain' },
      { title: '圣诞特别折扣', description: '圣诞节期间全场商品7折...', date: '2024-12-25', popularity: 88, isFavorite: false, imageUrl: 'https://bpic.588ku.com/back_origin_min_pic/22/12/07/ccc1b40dbc57ed822228075a0dd855fc.jpg!/fw/750/quality/99/unsharp/true/compress/true' },
      { title: '元旦迎新特惠', description: '新年伊始，购物满300减100...', date: '2025-01-01', popularity: 85, isFavorite: false, imageUrl: 'https://bpic.588ku.com/back_origin_min_pic/20/12/05/c8df4c05abb7ff8aa553cd8943d243f9.jpg!/fw/750/quality/99/unsharp/true/compress/true' },
      { title: '情人节情侣套餐', description: '为爱的人准备一份浪漫的情人节礼物...', date: '2025-02-14', popularity: 92, isFavorite: false, imageUrl: 'https://img.tukuppt.com/preview/00/36/71/37/36713764c0c6d94615ashow.jpg' },
      { title: '春季大扫除促销', description: '换季必备，家居用品低至5折...', date: '2025-03-20', popularity: 80, isFavorite: false, imageUrl: 'https://bpic.588ku.com/back_origin_min_pic/22/12/12/6cd7b8165c2a4e80b52161c7608b0745.jpg!/fw/750/quality/99/unsharp/true/compress/true' },
      { title: '母亲节感恩回馈', description: '献给妈妈最好的礼物，精选商品限时特价...', date: '2025-05-14', popularity: 90, isFavorite: false, imageUrl: 'https://img95.699pic.com/desgin_photo/40191/7643_detail.jpg!detail860/fw/820/crop/0x1309a0a0/quality/90' },
      { title: '夏季清凉节', description: '夏日炎炎，空调、冷饮等清凉好物尽在掌握...', date: '2025-06-21', popularity: 87, isFavorite: false, imageUrl: 'https://img.tukuppt.com/ad_preview/00/17/11/5eba401223bc5.jpg!/fw/980' },
      { title: '开学季学生优惠', description: '迎接新学期，学习用品买一送一...', date: '2025-08-31', popularity: 85, isFavorite: false, imageUrl: 'https://img95.699pic.com/desgin_photo/40160/9118_detail.jpg!detail860/fw/820/crop/0x1309a0a0/quality/90' },
      { title: '国庆黄金周旅游特惠', description: '假期出游，机票酒店最低5折...', date: '2025-10-01', popularity: 93, isFavorite: false, imageUrl: 'https://ts1.cn.mm.bing.net/th/id/R-C.e3c23723d4ef239f15a66aeb600e3f23?rik=eLt0b%2fugAo39vQ&riu=http%3a%2f%2fdfiles.speiyou.com%2fimg%2f2016%2f09%2f18%2f175848_57de6558e97a0.jpg&ehk=23L%2bGGtjVLsAPf1cUFvYDnXMLKHYwRNIi2HAPzX2MV4%3d&risl=&pid=ImgRaw&r=0' },
      { title: '双十一购物狂欢', description: '年度最大购物盛宴，全场低至1折...', date: '2025-11-11', popularity: 98, isFavorite: false, imageUrl: 'https://ts1.cn.mm.bing.net/th/id/R-C.3b384955361d1a7d20be095ca2b85195?rik=9dmwSveAF7Y4xA&riu=http%3a%2f%2fimg.aiimg.com%2fuploads%2fallimg%2f201015%2f1-201015203250.jpg&ehk=6Utmh9aB2rWTBiYyR51UbmpViqGqrCyvfv5xoAk8eG0%3d&risl=&pid=ImgRaw&r=0' }
      // 更多活动...
    ]).pipe(
      delay(500) // 模拟1秒的网络延迟
    );
  }
}