1 Star 0 Fork 20

兜里有糖/weimall

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
app.js 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
html580 提交于 2017-06-01 11:53 . 微信小程序商城
import polyfill from 'assets/plugins/polyfill'
import WxValidate from 'helpers/WxValidate'
import HttpResource from 'helpers/HttpResource'
import HttpService from 'helpers/HttpService'
import WxService from 'helpers/WxService'
import Tools from 'helpers/Tools'
import Config from 'etc/config'
App({
onLaunch() {
console.log('onLaunch')
},
onShow() {
console.log('onShow')
},
onHide() {
console.log('onHide')
},
getUserInfo() {
return this.WxService.login()
.then(data => {
console.log(data)
return this.WxService.getUserInfo()
})
.then(data => {
console.log(data)
this.globalData.userInfo = data.userInfo
return this.globalData.userInfo
})
},
globalData: {
userInfo: null
},
renderImage(path) {
if (!path) return ''
if (path.indexOf('http') !== -1) return path
return `${this.Config.fileBasePath}${path}`
},
WxValidate: (rules, messages) => new WxValidate(rules, messages),
HttpResource: (url, paramDefaults, actions, options) => new HttpResource(url, paramDefaults, actions, options).init(),
HttpService: new HttpService,
WxService: new WxService,
Tools: new Tools,
Config: Config,
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
微信
1
https://gitee.com/cdbozhi/weimall.git
git@gitee.com:cdbozhi/weimall.git
cdbozhi
weimall
weimall
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385