apiType 欄目信息
獲取欄目列表數(shù)據(jù)
快速開始(復(fù)制即用)
微信原生版
let that = this;
app.globalData._requestApi(
that,
app.globalData.config.apiIndexUrl,
{
apiType_1: `ekey=1`
},
function(res) {
that.setData({
type_1: res.data.apiType[1]
});
}
);uni-app 版
let that = this;
app.globalData._requestApi(
that,
app.globalData.config.apiIndexUrl,
{
apiType_1: `ekey=1`
},
function(res) {
that.type_1 = res.data.apiType[1];
}
);?? ekey=1 必須對(duì)應(yīng) apiType[1],數(shù)字要一致!
全部參數(shù)
基礎(chǔ)參數(shù)
| 參數(shù) | 說(shuō)明 | 示例 |
|---|---|---|
ekey | 必填,唯一標(biāo)識(shí),數(shù)字必須與返回的 apiType[數(shù)字] 對(duì)應(yīng) | ekey=1 |
typeid | 指定欄目ID,如果沒(méi)有指定則獲取當(dāng)前列表頁(yè)的欄目ID | typeid=1 |
type | 'self' 表示當(dāng)前欄目,'top' 表示當(dāng)前欄目最頂級(jí)的一級(jí)欄目 | type=self |
addfields | 自定義字段名,多個(gè)字段以逗號(hào)隔開 | addfields=content |
infolen | 截取content、seo_description字段內(nèi)容長(zhǎng)度 | infolen=50 |
suffix | 結(jié)合infolen使用,截取addfields字段后顯示內(nèi)容后面是否加上'...',默認(rèn)為true | suffix=true |
常用場(chǎng)景(直接復(fù)制)
獲取指定欄目:ekey=1&typeid=1 獲取當(dāng)前欄目:ekey=1&type=self 獲取頂級(jí)欄目:ekey=1&type=top 獲取欄目含自定義字段:ekey=1&typeid=1&addfields=content&infolen=50
文檔最后更新時(shí)間:2026-01-09 15:43:10
未解決你的問(wèn)題?請(qǐng)到「問(wèn)答社區(qū)」反饋你遇到的問(wèn)題
