这是本文档旧的修订版!
<web-view src="https://你的C2页面地址/index.html?参数=值"></web-view>
onShareAppMessage: function (res) {
return {
title: '分享标题',
desc: '分享描述',
imageUrl: '分享用图片', //长宽比5:4,可以拷贝到index目录下 比如'/pages/index/share.png'
path: '分享路径' //如果没有别的选项就是'/pages/index/index'
}
}
找到 app.json 在“window”下加上
"navigationStyle": "custom"
注意JSON格式,即可实现全屏,另外注意,调试基础库版本需高于1.9.4,此命令才有效
微信登录需要后端支持 在默认模板的 app.js 中有示例代码
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
改成
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
if (res.code) {
var that = this
wx.request({
url: 'https://LOGIN_REQUEST_URL/',
data: {
code: res.code
},
success: function (result) {
let openId = result.data.openid;
wx.setStorageSync('openid', openId)
if (this.userOpenidCallback) {
this.userOpenidCallback(result)
}
}
})
} else {
console.log('ERR' + res.errMsg);
}
}
})
这样之后就可以在本地缓存中取openid出来