omi-cloud - add loading

This commit is contained in:
dntzhang 2019-03-21 19:44:26 +08:00
parent af2404ba8b
commit ad9020ac64
3 changed files with 11 additions and 6 deletions

View File

@ -18,10 +18,13 @@ define('page-about', class extends WeElement {
}
install(options) {
wx.showLoading({
title: '加载中'
})
app.globalData.db.collection('article').doc(options.id).get().then(res=>{
const article = md.render(res.data.md)
WxParse.wxParse('article', 'html', article, this._weappRef, 5)
wx.hideLoading()
})
}
@ -34,4 +37,4 @@ define('page-about', class extends WeElement {
</view>
)
}
})
})

View File

@ -14,7 +14,7 @@ define('page-index', class extends WeElement {
backgroundColor: '#eeeeee',
backgroundTextStyle: 'light'
}
data = {
todo: [],
inputText: '',
@ -93,7 +93,7 @@ define('page-index', class extends WeElement {
wx.showLoading({
title: '中'
title: '加中'
})
app.globalData.db.collection('todo').add({
// data 字段表示需新增的 JSON 数据

View File

@ -20,7 +20,9 @@ define('page-about', class extends WeElement {
}
installed() {
wx.showLoading()
wx.showLoading({
title: '加载中'
})
wx.cloud.callFunction({
name: 'login',
data: {},
@ -86,4 +88,4 @@ define('page-about', class extends WeElement {
)
}
})
})