近期全國多地疫情出現反覆態勢,春運將至,各地疫情期間出行政策不一。這對很多用戶出行造成困擾:能返鄉嗎?到當地會被隔離嗎?需要做核酸檢測嗎? 如何快速搭建一套H5應用,提供“出行防疫政策查詢”功能,便於用戶實時查詢各地出行政策,做好疫情防控準備,安全便利出行。
下載開源代碼
使用github上面開源的項目代碼,省去開發、設計工作,下載代碼簡單配置即可上線使用。
H5源碼下載地址:https://github.com/JUHEAPI/sftr
使用說明
項目裏面使用的數據由
聚合數據
提供的免費接口(2021春運防疫政策查詢API),新增支持:核酸檢測機構查詢接口申請地址:https://www.juhe.cn/docs/api/id/566
接口每天免費次數100次,根據和官方溝通,等項目正式上線。可以和合作,免費獲得更高的免費次數。
開通聚合API接口後,將會獲得一個API的請求Key,只需要將文件
epidemic.js
第19行的key換成你申請到的key,就可以使用啦。
// "http:"===window.location.protocol&&(window.location="https://"+window.location.host+window.location.pathname)
var fromCity = document.getElementById('fromCity')
toCity = document.getElementById('toCity')
fromVal = ''
toVal = ''
outFrom = document.getElementById('outFrom')
inFrom = document.getElementById('inFrom')
inTo = document.getElementById('inTo')
outTo = document.getElementById('outTo')
fromCode = document.getElementById('fromCode')
ToCode = document.getElementById('ToCode')
from_info = ''
to_info = ''
fromCodeDes = ''
fromCodeImg = ''
toCodeDes = ''
toCodeImg = ''
appKey = 'fa7914d4eec67d44499d2eca5eaea6e1'
運行效果
~喜歡就給個 star 鼓勵下吧~