index.js
4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
* @Date: 2023-08-24 09:42:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-11-12 14:53:22
* @FilePath: /stdj_h5/src/api/index.js
* @Description: 文件描述
*/
import { fn, fetch } from '@/api/fn';
const Api = {
GET_HOME: '/srv/?a=home',
GET_ARTICLE: '/srv/?a=get_article',
GET_ARTICLE_FILE: '/srv/?a=get_article&t=file',
POST_LOGIN: '/srv/?a=user',
GET_USER_INFO: '/srv/?a=user',
};
/**
* @description: 首页数据
* @returns {Object} list
* @property [Object] list.STDJSSQZ 三师七证
* @property integer list.STDJSSQZ.id 分类id
* @property string list.STDJSSQZ.category_name 分类名称
* @property string list.STDJSSQZ.cover 封面图
* @property string list.STDJSSQZ.parent_sn 父分类id
* @property [Object] list.STDJFHLC 法会流程
* @property integer list.STDJFHLC.id 分类id
* @property string list.STDJFHLC.category_name 分类名称
* @property string list.STDJFHLC.cover 封面图
* @property string list.STDJFHLC.parent_sn 父分类id
* @property [Object] list.STDJXGXW 新闻
* @property integer list.STDJXGXW.id 分类id
* @property string list.STDJXGXW.post_title 新闻标题
* @property string list.STDJXGXW.post_date 发布日期
* @property string list.STDJXGXW.photo 封面图
*/
export const homePageAPI = (params) => fn(fetch.get(Api.GET_HOME, params));
/**
* @description: 三師七證数据
* @param {String} pid 分类id
* @returns {Object} list
* @property integer list.id 分类id
* @property string list.category_name 分类名称
* @property string list.category_seq 分类顺序
* @property [Object] list.list 子分类列表
* @property integer list.list.id 子分类id
* @property string list.list.post_title 标题/名称
* @property string list.list.post_date 发布日期
* @property string list.list.post_excerpt 简介
* @property string list.list.post_content 内容/描述
* @property string list.list.photo 封面图
* @property string list.list.category_id 分类id
*/
export const getSSQZAPI = (params) => fn(fetch.get(Api.GET_ARTICLE, params));
/**
* @description: 图片流媒体数据
* @param {String} i 分类id
* @param {String} page 页码,默认0
* @param {String} limit 每页数量,默认10
* @returns {Object} data
* @property integer data.id 分类id
* @property string data.post_title 标题/名称
* @property [object] data.list 封面图列表
* @property string data.list.value 封面图地址
*/
/**
* 忽略全局Loading的图片流媒体接口
* @description 调用该接口时不显示全局loading蒙版
*/
export const getImgStreamAPI = (params) => fn(fetch.get(Api.GET_ARTICLE_FILE, params, { ignore_loading: true }));
/**
* @description: 文章详情数据
* @param {String} i 文章id
* @returns {Object} data
* @property integer data.post_author 作者
* @property string data.post_title 标题/名称
* @property string data.post_date 发布日期
* @property string data.post_excerpt 简介
* @property string data.post_content 内容/描述
* @property string data.post_modified 修改日期
* @property string data.post_status 状态
* @property string data.post_type 类型
* @property object data.file_list 文件列表
* @property object data.file_list.photo 照片
* @property string data.file_list.photo.value 照片地址
*/
export const getArticleDetailAPI = (params) => fn(fetch.get(Api.GET_ARTICLE, params));
/**
* @description: 登录接口
* @param {String} mobile 手机号
* @param {String} mobile_code 验证码
* @param {String} idcard 身份证号
* @returns {Object} data
* @property string data.id 用户id(后续接口要转的值)
* @property string data.nickname 法名
*/
export const loginAPI = (params) => fn(fetch.post(Api.POST_LOGIN, params));
/**
* @description: 戒子信息查询
* @param {String} i 用户id
* @returns {Object} data
* @property string data.id 用户id
* @property string data.name 姓名
* @property string data.nickname 法名
* @property string data.courtesy_name 字号
* @property string data.introduction 简介
* @property string data.group_title 堂口
* @property string data.avatar[{name,url}] 证件照
* @property string data.photo[{name,url}] 其它照片
*/
export const getUserInfoAPI = (params) => fn(fetch.get(Api.GET_USER_INFO, params));