1 Star 0 Fork 4

Ive4/cloud-doc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
app.js 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
SmallRuralDog 提交于 2017-07-31 16:20 . 项目代码上传
//app.js
const Towxml = require('/towxml/main');
const HOST = "https://cloud-doc.leyix.com";
App({
onLaunch: function () {
//调用API从本地缓存中获取数据
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
},
towxml: new Towxml(),
getUserInfo: function (cb) {
var that = this
if (this.globalData.userInfo) {
typeof cb == "function" && cb(this.globalData.userInfo)
} else {
//调用登录接口
wx.getUserInfo({
withCredentials: false,
success: function (res) {
that.globalData.userInfo = res.userInfo
typeof cb == "function" && cb(that.globalData.userInfo)
}
})
}
},
globalData: {
userInfo: null
},
set_page_more(tis, res) {
if (res.data.total <= 0) {
tis.setData({
no_data: true,
no_more: false,
more: false,
})
}
if (res.data.last_page == tis.data.page) {
tis.setData({
no_more: true,
more: false,
more_data: "没有更多了"
})
} else if (res.data.last_page > tis.data.page) {
tis.setData({
more: true,
})
}
tis.setData({
is_load: false
})
},
api: {
get_list: HOST + "/api/list",
get_info: HOST + "/api/info",
get_menu: HOST + "/api/menu",
get_page: HOST + "/api/page",
get_v2_index: HOST + "/api/v2/index",
get_v2_class: HOST + "/api/v2/class-list",
get_v2_class_doc: HOST + "/api/v2/list",
get_v2_doc_page: HOST + "/api/v2/doc-page",
get_v2_page: HOST + "/api/v2/page",
get_v2_my_doc: HOST + "/api/v2/get-my-doc",
get_v2_search: HOST + "/api/v2/search",
get_v2_search_index: HOST + "/api/v2/search-index",
get_v2_search_tip: HOST + "/api/v2/title-tip",
}
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ive4/cloud-doc.git
git@gitee.com:ive4/cloud-doc.git
ive4
cloud-doc
cloud-doc
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385