- checksession的完整流程是这样吗?
[代码]wx.checkSession({[代码][代码] [代码][代码]success() {[代码][代码] [代码][代码]console.log([代码][代码]"checksession success"[代码][代码])[代码][代码] [代码][代码]wx.getStorage({[代码][代码] [代码][代码]key: [代码][代码]'3rd_session'[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log(res)[代码][代码] [代码][代码]var[代码] [代码]url = [代码][代码]"url"[代码][代码];[代码][代码] [代码][代码]var[代码] [代码]data = res.data;[代码][代码] [代码][代码]var[代码] [代码]method = [代码][代码]"POST"[代码][代码];[代码][代码] [代码][代码]var[代码] [代码]header = { [代码][代码]'content-type'[代码][代码]: [代码][代码]'application/json'[代码] [代码]}[代码][代码] [代码][代码]http.ajax(url, method, data, header)[代码][代码] [代码][代码].then([代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log(res)[代码] [代码] [代码][代码]})[代码][代码] [代码][代码].[代码][代码]catch[代码][代码]([代码][代码]function[代码] [代码](err) {[代码] [代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]// 检查3rd_session失败[代码][代码] [代码][代码]fail() {[代码][代码] [代码][代码]// 登陆[代码][代码] [代码][代码]wx.login({[代码][代码] [代码][代码]success: res => {[代码][代码] [代码][代码]// 发送 res.code 到后台换取 openId, sessionKey, unionId[代码][代码] [代码][代码]console.log(res.code);[代码][代码] [代码][代码]var[代码] [代码]url = [代码][代码]"url[代码][代码]"[代码][代码];[代码] [代码] [代码][代码]var[代码] [代码]method = [代码][代码]"POST"[代码][代码] [代码][代码]var[代码] [代码]data = {[代码][代码] [代码][代码]code: res.code,[代码][代码] [代码][代码]nickName: nick,[代码][代码] [代码][代码]avatarUrl: avatar[代码][代码] [代码][代码]};[代码][代码] [代码][代码]var[代码] [代码]header = { [代码][代码]'content-type'[代码][代码]: [代码][代码]'application/json'[代码] [代码]};[代码][代码] [代码][代码]http.ajax(url, method, data, header)[代码][代码] [代码][代码].then([代码][代码]function[代码] [代码](response) {[代码][代码] [代码][代码]console.log(response.data.token)[代码][代码] [代码][代码]wx.setStorage({[代码][代码] [代码][代码]key: [代码][代码]'3rd_session'[代码][代码],[代码][代码] [代码][代码]data: response.data.token,[代码][代码] [代码][代码]});[代码][代码] [代码] [代码] [代码][代码]})[代码][代码] [代码][代码].[代码][代码]catch[代码][代码]([代码][代码]function[代码] [代码](error) {[代码][代码] [代码][代码]console.log(error)[代码][代码] [代码][代码]})[代码] [代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码]请问一下是否是这样的?
2017-11-16 - 用rpx,以iPhone6的分辨率开发,在iPhone5下显示有问题
所有的单位都用的是rpx,在大屏的安卓机和iphone6上,某个view的显示高度是正确的,但是在iPhone5手机上,显示会超高,应该怎么处理?
2017-11-14 - 关于wx.login和wx.requestPayment的流程的问题
打开小程序,使用wx.login,有提示吗? 还是说这个登录用户完全不知道? 然后我发起request请求,发送获取到的code,然后服务器和微信交互得到openID和session_key,然后后台生成3rd_session,和openID和session_key一起保存,最后发送3rd_session给小程序,然后小程序保存3rd_session,每次打开都请求服务器,用3rd_session查找open ID和session_key. -------------------------------------------------------------------------------------------- 然后是支付,小程序发起支付的时候,需要传什么参数给服务器? 然后服务器会返回什么参数? requestPayment是再request的回调函数内写吗? 能说一下实际在小程序上使用时,对应的请求操作流程吗? 十分感激!!!
2017-11-08