question 1:
the wepy document says that in the Page page instance, the App instance can be accessed through this.$parent. What should I do if I want to access an app instance in a js?
wepy.login({
success: function({ code }) {
ajax("user/login", {
code
}).then(res => {
if (res) {
wx.setStorageSync("user_id", res.user_id)
wx.setStorageSync("auth_token", res.auth_token)
}
// res.store_id res.store_nameapp.globalData
getDefaultStore().then(res => {
fn()
})
})
}
})
question 2:
wepy document says:
/ / how to use WePY, you need to enable Promise support. Refer to the development specification section
wepy.request ("xxxx"). Then ((d) = > console.log (d));
1). How to enable Promise support?
2. Can all native Wechat api be called in the way of wepy.apiName. For example, wx.login can use wepy.login, wx.setNavigationBarTitle can use wepy.setNavigationBarTitle