123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- import { http, httpGet, httpPost } from '@/utils/http'
- import { Schedule } from '../models/schedule'
- import { Moment } from '../models/moment'
- import dayjs from 'dayjs'
- export const getUserInfo = () =>
- httpGetMock<any>({
- avatar: 'https://via.placeholder.com/21x21',
- nickname: '苏小萌',
- })
- export const getSchedule = () =>
- httpGetMock<Schedule>({
- name: '东京艺术设计研习营',
- cover: 'https://via.placeholder.com/375x297',
- items: [
- {
- title: '早稻田大学课程',
- time: '9:00',
- content:
- '是位于日本东京都新宿区的一所著名的私立大学。它由早稻田大学的创始人大隈重信于1882年创立,是日本超级国际化大学计划(Top Global University Project)选定的大学之一,也是日本顶尖的高等教育机构之一。',
- momentExample: 'https://via.placeholder.com/285x157',
- monentHint: '*说明:打卡地XX,收集上课素材',
- },
- {
- title: '早稻田大学博物馆参观',
- time: '11:00',
- content:
- '早稻田大学拥有多座博物馆,其中最著名的是早稻田大学历史馆。早稻田大学历史馆收藏、展示着著名校友在运动方面的杰出表现和成就,馆内的解说牌以日语和英语标示,展现了传统样式风格的建筑。',
- momentExample: 'https://via.placeholder.com/285x157',
- monentHint: '*说明:打卡地XX,收集上课素材',
- },
- ],
- })
- export const getMoment = () =>
- httpGetMock<Moment>({
- author: {
- avatar: 'https://via.placeholder.com/35x35',
- nickname: '苏小萌',
- level: '0',
- },
- content: '用心做好设计,为客户创造美好家居环境',
- images: [
- 'https://via.placeholder.com/165x220',
- 'https://via.placeholder.com/220x220',
- 'https://via.placeholder.com/165x220',
- ],
- tags: ['意大利游学设计班'],
- shares: 0,
- comments: 0,
- likes: 0,
- createdAt: dayjs('2024-07-15').toDate(),
- commentList: [
- {
- id: 1,
- author: {
- avatar: 'https://via.placeholder.com/28x28',
- nickname: '李一鸣设计师',
- level: '',
- },
- content: '哇~你真的好厉害,棒棒棒',
- createdAt: dayjs('2024-07-15').toDate(),
- childrens: [
- {
- id: 3,
- parentId: 1,
- author: {
- avatar: 'https://via.placeholder.com/28x28',
- nickname: '李一鸣设计师',
- level: '',
- },
- content: '这个是去参加了意大利游学活动',
- createdAt: undefined,
- },
- ],
- },
- {
- id: 2,
- author: {
- avatar: 'https://via.placeholder.com/28x28',
- nickname: '王莉莎',
- level: '',
- },
- content: '这个活动怎么参加呢?',
- createdAt: undefined,
- },
- ],
- })
- export const getClassmates = () =>
- httpGetMock<any[]>([
- {
- avatar: 'https://via.placeholder.com/35x35',
- nickname: '苏小萌',
- level: '0',
- },
- {
- avatar: 'https://via.placeholder.com/35x35',
- nickname: '苏小萌',
- level: '0',
- },
- {
- avatar: 'https://via.placeholder.com/35x35',
- },
- ])
- export const getClassmate = () =>
- httpGetMock<any>({
- title: '2023同学荟|清华空间环境艺术设计研修班 阔步向未来',
- author: {
- avatar: 'https://via.placeholder.com/35x35',
- nickname: '苏小萌',
- level: '0',
- },
- viewNum: 125,
- createdAt: dayjs('2024-07-15').toDate(),
- content: '<div>111111</div>',
- })
- export const getStudyTours = () =>
- httpGetMock<any[]>([
- {
- title: '东京艺术大学设计游学',
- createdAt: dayjs('2024-07-15').toDate(),
- startedAt: dayjs('2024-07-15').toDate(),
- endedAt: dayjs('2024-08-15').toDate(),
- amount: 16000,
- },
- ])
- export const getMaterialDealers = () =>
- httpGetMock<any[]>([
- {
- name: 'IMOLA瓷砖',
- icon: 'https://via.placeholder.com/78x78',
- brandType: '进口品牌',
- type: '瓷砖',
- views: 1000,
- createdAt: dayjs('2024-07-15').toDate(),
- },
- {
- name: 'IMOLA瓷砖',
- icon: 'https://via.placeholder.com/78x78',
- brandType: '进口品牌',
- type: '瓷砖',
- views: 1000,
- createdAt: dayjs('2024-07-15').toDate(),
- },
- ])
- export const weixinMiniAppLogin = (phoneCode: string, loginCode: string, state: string) =>
- httpPost<any>('/app-api/member/auth/weixin-mini-app-login', {
- phoneCode,
- loginCode,
- state,
- })
- export const getMemberUserInfo = () => httpGet<any>('/app-api/member/user/get')
- export const httpGetMock = <T>(data: T) =>
- new Promise<IResData<T>>((resolve) => resolve({ code: 1, msg: '', data } as IResData<T>))
|