英語詞典小程式

基於英語詞典小程式外掛 - 提供開源地址

專案地址

英語詞典小程式外掛: 微信小程式 詞典 真題基礎服務外掛(gitee.com)

功能特色

  • [x] 全面詳實的經典詞庫,詳細釋義覆蓋約1.2w詞,精簡釋義覆蓋基本全部詞彙
  • [x] 提供多語言識別翻譯功能介面
  • [x] 不斷完善的例句庫,涵蓋四六級和考研英語例句
  • [x] 詳實的單詞分類,針對不同需求,提供單詞記背需要
  • [x] 單詞例句以元件形式呈現,方便小程式引入使用
  • [x] 提供第三方外掛API供呼叫,可自定義展現形式

功能預覽

外掛提供部分可以直接呼叫的元件或功能頁

單詞冊 & 單詞詳情

頂部欄查片語件 & 英漢互譯功能

外掛使用文件


申請許可權

  • 請在小程式後臺搜尋本外掛(AppID=wx2facb7b57eedf7e6) 設定-第三方服務-新增外掛英語詞典

呼叫限制

呼叫方式

外掛最新版本為 1.8.1

全域性app.json配置

"plugins": {
"edict-plugin": {
"version": "1.8.1",
"provider": "wx2facb7b57eedf7e6"
}
}

功能頁

單詞冊

需要攜帶引數userId,一般為使用者openid

wx.navigateTo({
url: 'plugin://edict-plugin/index?userId=xxxxxxxxx',
})

詞句詳情頁

需要攜帶引數word

wx.navigateTo({
url: 'plugin://edict-plugin/word?word=xxxxxxx',
})

英漢互譯頁

wx.navigateTo({
url: 'plugin://edict-plugin/en-zh',
})

元件

外掛提供了對外暴露的元件,可以由外部頁面直接引入使用

頂部查詞欄

引入方式

{
"usingComponents": {
"nav-search":"plugin://edict-plugin/nav-search"
}
}

使用方式

  • Props
引數 說明 型別
navshow 是否展示該元件 Boolean
  • Events
引數 說明 型別
wordselect 單詞選擇事件,可與詞句功能頁組合使用 Event
<nav-search navshow="true" bind:wordselect="wordselect"></nav-search>

單詞盒子

引入方式

{
"usingComponents": {
"word-box":"plugin://edict-plugin/word-box"
}
}

使用方式

引數 說明 型別
word 傳入單詞 string
<word-box word="equal"></word-box>

例句盒子

引入方式

{
"usingComponents": {
"sentence-box":"plugin://edict-plugin/sentence-box"
}
}

使用方式

引數 說明 型別
word 傳入單詞 string
<sentence-box word="mindful"></sentence-box>

介面

使用外掛內部介面需要在頁面引入外掛

var plugin = requirePlugin("edict-plugin");

單詞字首匹配

引數 說明 型別
prefix 單詞字首 string
plugin.preMatchWord(prefix).then(res=>{
console.log(res)
})

英漢互譯(自動檢測)

引數 說明 型別
sentence 待翻譯句子 string
plugin.translationEnZh(sentence).then(res=>{
console.log(res)
})

定向翻譯(自動檢測源語言)

引數 說明 型別
target 目標語言程式碼,詳見底部附錄語言對照表Code string
sentence 待翻譯句子 string
plugin.translationTo(target, sentence).then(res=>{
console.log(res)
})

單詞查詢

引數 說明 型別
word 待查詢單詞 string
plugin.wordQuery(word).then(res=>{
console.log(res)
})

例句查詢

引數 說明 型別
word 待查詢單詞 string
plugin.sentenceQuery(word).then(res=>{
console.log(res)
})

獲取使用者收藏列表

引數 說明 型別
openId 使用者唯一openId string
plugin.getFavorWord(openId).then(res=>{
console.log(res)
})

判斷使用者是否收藏單詞

引數 說明 型別
openId 使用者唯一openId string
word 待查詢單詞 string
plugin.isFavor(openId,word).then(res=>{
console.log(res)
})

使用者新增收藏單詞

引數 說明 型別
openId 使用者唯一openId string
word 待查詢單詞 string
plugin.addFavor(openId,word).then(res=>{
console.log(res)
})

使用者移除收藏單詞

引數 說明 型別
openId 使用者唯一openId string
word 待查詢單詞 string
plugin.pullFavor(openId,word).then(res=>{
console.log(res)
})

更新日誌

1.8.1

釋出時間:2021-07-26

  1. 使用雲開發CloudBase 重構專案
  2. 提供第三方訪問API

1.7.0

釋出時間: 2021-04-20

  1. 請求重定向整合,優化了資料獲取速度
  2. 快取資料獲取 bug fixed
  3. 提供了幾個可供小程式呼叫的介面

1.6.1

釋出時間:2021-03-15

  1. 部分單詞查詢 404 情況的處理 bug fixed
  2. 調整了API介面規則

1.6.0

釋出時間:2021-03-08

  1. 此後的介面地址為長期維護,不會廢棄(LTS)

1.5.2(介面已廢棄)

釋出時間:2021-03-02

1.5.1(介面已廢棄)

釋出時間:2021-03-01

  1. 初始版本

交流群

小程式開發/外掛開發交流群: 625756936

附錄

語言引數對照表

Language Code
Afrikaans af
Albanian sq
Amharic am
Arabic ar
Armenian hy
Azeerbaijani az
Basque eu
Belarusian be
Bengali bn
Bosnian bs
Bulgarian bg
Catalan ca
Cebuano ceb
Chinese (Simplified) zh-CN
Chinese (Traditional) zh-TW
Corsican co
Croatian hr
Czech cs
Danish da
Dutch nl
English en
Esperanto eo
Estonian et
Finnish fi
French fr
Frisian fy
Galician gl
Georgian ka
German de
Greek el
Gujarati gu
Haitian Creole ht
Hausa ha
Hawaiian haw (ISO-639-2)
Hebrew iw
Hindi hi
Hmong hmn (ISO-639-2)
Hungarian hu
Icelandic is
Igbo ig
Indonesian id
Irish ga
Italian it
Japanese ja
Javanese jw
Kannada kn
Kazakh kk
Khmer km
Korean ko
Kurdish ku
Kyrgyz ky
Lao lo
Latin la
Latvian lv
Lithuanian lt
Luxembourgish lb
Macedonian mk
Malagasy mg
Malay ms
Malayalam ml
Maltese mt
Maori mi
Marathi mr
Mongolian mn
Myanmar (Burmese) my
Nepali ne
Norwegian no
Nyanja (Chichewa) ny
Pashto ps
Persian fa
Polish pl
Portuguese (Portugal, Brazil) pt
Punjabi pa
Romanian ro
Russian ru
Samoan sm
Scots Gaelic gd
Serbian sr
Sesotho st
Shona sn
Sindhi sd
Sinhala (Sinhalese) si
Slovak sk
Slovenian sl
Somali so
Spanish es
Sundanese su
Swahili sw
Swedish sv
Tagalog (Filipino) tl
Tajik tg
Tamil ta
Telugu te
Thai th
Turkish tr
Ukrainian uk
Urdu ur
Uzbek uz
Vietnamese vi
Welsh cy
Xhosa xh
Yiddish yi
Yoruba yo
Zulu zu