apiChannel 欄目列表
apiChannel 欄目列表
獲取欄目列表數(shù)據(jù)。
快速開始(復(fù)制即用)
微信原生版
let that = this;
app.globalData._requestApi(
that,
app.globalData.config.apiIndexUrl,
{
apiChannel_1: `ekey=1&type=sonself¤tstyle=active&showalltext=on`
},
function(res) {
that.setData({
channel_1: res.data.apiChannel[1].data
});
}
);<view wx:for="{{channel_1}}" wx:key="id">
<text>{{item.typename}}</text>
</view>uni-app 版
let that = this;
app.globalData._requestApi(
that,
app.globalData.config.apiIndexUrl,
{
apiChannel_1: `ekey=1&type=sonself¤tstyle=active&showalltext=on`
},
function(res) {
that.channel_1 = res.data.apiChannel[1].data;
}
);<view v-for="item in channel_1" :key="item.id">
<text>{{item.typename}}</text>
</view>?? ekey=1 必須對應(yīng) apiChannel[1],數(shù)字要一致!
全部參數(shù)
基礎(chǔ)參數(shù)
| 參數(shù) | 說明 | 示例 |
|---|---|---|
ekey | 必填,唯一標(biāo)識,數(shù)字必須與返回的 apiChannel[數(shù)字] 對應(yīng) | ekey=1 |
typeid | 欄目ID(0表示頂級欄目) | typeid=0 |
channelid | 模型ID 在文檔列表頁使用時(shí)可以此參數(shù)可以不用拼接url | channelid=1 |
limit | '起始ID,記錄數(shù)'(起始ID從0開始)表示限定的記錄范圍(如:limit='1,2' 表示從ID為1的記錄開始,取2條記錄) | limit=0,10 |
currentstyle | 應(yīng)用樣式class類名 | currentstyle=active |
showalltext | on或者off,等于on時(shí)效果如下,返回一個(gè)全部,等于off則不返回'全部' | showalltext=on |
type 可選值:
son- 表示下級欄目self- 表示同級欄目top- 表示頂級欄目sonself- 表示當(dāng)前下級欄目以及同級欄目first- 表示當(dāng)前欄目ID的最頂級欄目下的第一級全部欄目
常用場景(直接復(fù)制)
頂級欄目列表:ekey=1&typeid=1&limit=0,10 指定模型欄目:ekey=1&channelid=1&limit=0,5 帶全部選項(xiàng):ekey=1&typeid=0&showalltext=on
底層字段: 查閱易優(yōu)數(shù)據(jù)字典,表名 ey_arctype
(注:在沒有指定typeid的情況下,type標(biāo)記與模板的環(huán)境有關(guān),如:模板生成到欄目一,那么type='son'就表示欄目一的所有子欄目)
文檔最后更新時(shí)間:2026-01-08 16:32:57
未解決你的問題?請到「問答社區(qū)」反饋你遇到的問題

