- wx.chooseMedia 是否能监听 选择了 相机 还是从文件选择,点了哪个选项?
点击选择相机拍摄的时候有没 回调事件
2022-04-28 - 如何处理 微信服务器事件推送的发送方式 ?
使用场景 : 调用 创建携带参数的二维码接口 生成 公众号链接 进行 扫码关注 ,后台进行监听事件推送 并接受事件携带参数 ----------------------------------------------- 因为后台使用python写的, 框架不支持xml事件推送的请求 解析报错,使用在线接口调试工具 选择 json格式发送请求 ,后台能正常收到 问 能否采用json方式发送事件推送
2021-11-09 - 登录失败,项目之前改过 appid之后 改回来 为啥会登陆失败了?
[图片] [代码]session.wxlogin().then(res => {[代码][代码] [代码][代码]if[代码] [代码](utils.isEmptyObj(res.user)) {[代码] [代码] [代码][代码]app.globalData.needReg = [代码][代码]true[代码][代码] [代码][代码]$[代码][代码]this[代码][代码].showSplash()[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]try[代码][代码]{[代码][代码] [代码][代码]app.globalData.needReg = [代码][代码]false[代码][代码] [代码][代码]$[代码][代码]this[代码][代码].show()[代码] [代码] [代码][代码]let id = e.currentTarget.id[代码] [代码] [代码][代码]let path = [代码][代码]""[代码][代码];[代码][代码] [代码][代码]if[代码] [代码](id == [代码][代码]'chengzhong'[代码][代码]) {[代码][代码] [代码][代码]path = [代码][代码]'/pages/weight/weight'[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]if[代码] [代码](id == [代码][代码]'dianshu'[代码][代码]) {[代码][代码] [代码][代码]path = [代码][代码]'/pages/count/count'[代码][代码] [代码][代码]}[代码][代码] [代码][代码]wx.switchTab({[代码][代码] [代码][代码]url: path[代码][代码] [代码][代码]}) [代码][代码] [代码] [代码] [代码][代码]}[代码][代码]catch[代码][代码](e){[代码][代码] [代码][代码]//TODO handle the exception[代码][代码] [代码][代码]wx.showModal({[代码][代码] [代码][代码]title: [代码][代码]'TODO'[代码][代码],[代码][代码] [代码][代码]content: [代码][代码]'TODO,TODO'[代码][代码]+e[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]}[代码][代码]}).[代码][代码]catch[代码][代码](e => {[代码][代码] [代码][代码]console.log(e)[代码][代码] [代码][代码]wx.showModal({[代码][代码] [代码][代码]title: [代码][代码]'164'[代码][代码],[代码][代码] [代码][代码]content: [代码][代码]'164,e'[代码][代码]+e.toString()[代码][代码] [代码][代码]})[代码][代码]})[代码][代码]console.log([代码][代码]'------------'[代码][代码])[代码]
2019-11-26 - 关于界面跳转问题,在模拟器正常,手机必须点开调试才可以跳转,速救?
模拟器 点击正常 跳转。 手机的话 必须开调试模式才可以。 下面是界面两个点击事件的JS 函数 [代码]navtap(e) {[代码][代码] [代码][代码]session.getlocation([代码][代码]true[代码][代码]).then(res => {[代码][代码] [代码][代码]wx.openSetting({[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]console.log(res.authSetting)[代码][代码] [代码][代码]// res.authSetting = {[代码][代码] [代码][代码]// "scope.userInfo": true,[代码][代码] [代码][代码]// "scope.userLocation": true[代码][代码] [代码][代码]// }[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}).[代码][代码]catch[代码][代码](e => {[代码][代码] [代码] [代码] [代码][代码]wx.showModal({[代码][代码] [代码][代码]title: [代码][代码]'警告'[代码][代码],[代码][代码] [代码][代码]content: [代码][代码]'请检查是否开启定位'[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码] [代码] [代码][代码]session.getlocation([代码][代码]false[代码][代码]).then(res => {[代码] [代码] [代码][代码]//检查是否 注册过[代码][代码] [代码][代码]app.globalData.bid = 0[代码][代码] [代码][代码]var[代码] [代码]$[代码][代码]this[代码] [代码]= [代码][代码]this[代码] [代码] [代码] [代码] [代码][代码]session.wxlogin().then(res => {[代码][代码] [代码][代码]if[代码] [代码](utils.isEmptyObj(res.user)) {[代码][代码] [代码][代码]app.globalData.needReg = [代码][代码]true[代码][代码] [代码][代码]$[代码][代码]this[代码][代码].showSplash()[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]try[代码][代码]{[代码][代码] [代码][代码]app.globalData.needReg = [代码][代码]false[代码][代码] [代码][代码]$[代码][代码]this[代码][代码].show()[代码] [代码] [代码][代码]let id = e.currentTarget.id[代码] [代码] [代码][代码]let path = [代码][代码]""[代码][代码];[代码][代码] [代码][代码]if[代码] [代码](id == [代码][代码]'chengzhong'[代码][代码]) {[代码][代码] [代码][代码]path = [代码][代码]'/pages/weight/weight'[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]if[代码] [代码](id == [代码][代码]'dianshu'[代码][代码]) {[代码][代码] [代码][代码]path = [代码][代码]'/pages/count/count'[代码][代码] [代码][代码]}[代码][代码] [代码][代码]wx.switchTab({[代码][代码] [代码][代码]url: path[代码][代码] [代码][代码]}) [代码][代码] [代码] [代码] [代码][代码]}[代码][代码]catch[代码][代码](e){[代码][代码] [代码][代码]//TODO handle the exception[代码][代码] [代码][代码]wx.showModal({[代码][代码] [代码][代码]title: [代码][代码]'TODO'[代码][代码],[代码][代码] [代码][代码]content: [代码][代码]'TODO,TODO'[代码][代码]+e[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]}[代码][代码] [代码][代码]}).[代码][代码]catch[代码][代码](e => {[代码][代码] [代码][代码]console.log(e)[代码][代码] [代码][代码]wx.showModal({[代码][代码] [代码][代码]title: [代码][代码]'164 error'[代码][代码],[代码][代码] [代码][代码]content: [代码][代码]'164,164'[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码] [代码][代码]console.log([代码][代码]'------------'[代码][代码])[代码] [代码] [代码][代码]}).[代码][代码]catch[代码][代码](e => {[代码][代码] [代码][代码]wx.showModal({[代码][代码] [代码][代码]title: [代码][代码]'警告'[代码][代码],[代码][代码] [代码][代码]content: [代码][代码]'请求失败,请检查网络连接'[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码] [代码] [代码] [代码]}[代码] 这是。。提出来的登录 的函数 [代码]const wxlogin = () => {[代码][代码] [代码][代码]return[代码] [代码]new[代码] [代码]Promise((resolve, reject) => {[代码][代码] [代码][代码]wx.login({[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]let code = res.code[代码][代码] [代码][代码]api.get([代码][代码]'app/appletUser/openId'[代码][代码], {[代码][代码] [代码][代码]code: code,[代码][代码] [代码][代码]type:3[代码][代码] [代码][代码]}).then(r => {[代码][代码] [代码][代码]let app = getApp()[代码][代码] [代码][代码]app.globalData.userinfo = r[代码][代码] [代码][代码]if[代码] [代码](app.globalData.userinfo.user.name == undefined) {[代码][代码] [代码][代码]console.log([代码][代码]'空了'[代码][代码])[代码][代码] [代码][代码]//註冊[代码][代码] [代码][代码]wx.navigateTo({[代码][代码] [代码][代码]url: [代码][代码]'/pages/login/login'[代码][代码] [代码][代码]})[代码] [代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]console.log([代码][代码]'23'[代码] [代码]+ app.globalData.userinfo.user.name)[代码] [代码] [代码][代码]console.log([代码][代码]'23了'[代码] [代码]+ app.globalData.userinfo.mesg)[代码] [代码] [代码][代码]}[代码][代码] [代码][代码]resolve(r)[代码][代码] [代码][代码]}).[代码][代码]catch[代码][代码](e => {[代码][代码] [代码][代码]reject({[代码][代码] [代码][代码]code: errorcode.ERR_LOGIN_FAILED,[代码][代码] [代码][代码]msg: e[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码][代码](e) {[代码][代码] [代码][代码]reject({[代码][代码] [代码][代码]code: errorcode.ERR_WXLOGIN_FAILED,[代码][代码] [代码][代码]msg: e[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]complete: [代码][代码]function[代码][代码]() {[代码] [代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码]}[代码]
2019-11-18 - 网络异常或是网络不稳定的时候容易出现白屏、卡顿、卡死等情况,生命周期都没有 这时候应该怎么处理?
[图片]这时候 监听不到生命周期
2019-10-28