2 Star 10 Fork 11

ganshisheng / 52_社区团购小程序模板

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
app.js 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
ganshisheng 提交于 2020-05-27 11:56 . first commit
const { $Message } = require('dist/base/index');
App({
onLaunch: function () {
this.getmobile()
},
globalData: {
userInfo: null,
PhoneHeight: '',
},
globalUrl:{
zxUrl: "https://app.zhiwuxuanlv.com/"
},
openId: "",
request: function (method, Suffix, data, callback, error,) {
var that = this;
wx.request({
method,
url: that.globalUrl.zxUrl + Suffix,
data,
header: {
// 'content-type': 'application/x-www-form-urlencoded',
'token': that.openId
// "Accept": "*/*"
},
success: function (res) {
callback(res);
if(res.data.code == 500){
$Message({
content: res.data.msg,
type: 'error'
});;
}
},
fail: function (err) {
$Message({
content: '请检查您的手机是否联网!',
type: 'error'
});
error(err);
}
})
},
getmobile: function (e) {
wx.getSystemInfo({
success: res => {
console.log(res)
this.globalData.PhoneHeight = res.windowHeight * (750 / res.windowWidth);
this.globalData.bili = 750 / res.windowWidth;
},
})
},
})
微信
1
https://gitee.com/ganshisheng/wxapp_52.git
git@gitee.com:ganshisheng/wxapp_52.git
ganshisheng
wxapp_52
52_社区团购小程序模板
master

搜索帮助