- 为什么小程序接收到服务端的信息全是字符串?
[图片][图片] 为什么wx.requery返回的还有script这些的东西 我就只传了这两个字符串啊
2019-06-25 - 微信运动云开发有一个.cloudID,这个怎么获取!
[代码]wx.getWeRunData({[代码][代码] [代码][代码]success (res) {[代码][代码] [代码][代码]// 拿 encryptedData 到开发者后台解密开放数据[代码][代码] [代码][代码]const encryptedData = res.encryptedData[代码][代码] [代码][代码]// 或拿 cloudID 通过云调用直接获取开放数据[代码][代码] [代码][代码]const cloudID = res.cloudID[代码][代码] [代码][代码]}[代码][代码]})[代码]这段代码放在云函数端吗?
2019-06-21 - 小程序微信步数云开发,解步数,怎么解?
[代码]wx.login({ success(resLogin) { [代码][代码]if[代码] [代码](resLogin.code) { [代码][代码]// wx.cloud.database().collection('blog').add({ // data: { // code: resLogin.code // }, // success: resresSession => { // this.setData({ // code: resLogin.code // }) // wx.showToast({ // title: '新增记录成功', // }) // console.log('[数据库] [新增记录] 成功,记录 _id: ', res._id) wx.getWeRunData({ success: resRun => { // const encryptedData = resRun // console.info(resRun); wx.cloud.database().collection('counters').add({ data: { encryptedData: resRun.encryptedData, iv: resRun.iv, code: resLogin.code }, success: resresSession=>{ wx.showToast({ title: '新增记录成功', }) console.log('[数据库] 新增 ', resresSession) } }) } }) // } // }) } } })[代码] 我用上面的代码得到了一个值: encryptedData={ fXiH+1XI0DZT7zjiX/eqFIwJsIy0fS7xSS8tsalGMf0ykxEriKWYJ2D7a7R3VV+cP3BrLcl0VcuP7iERJ0u9SOuZlclisajhpeuH36CWu193fR8vv5dWoT5xO2YKhdKEQtcIcAV69BZA4ZMPz+4FnWP/gciuK12psH9WGrPY1/2cUE8l4VyG9FdaNt5sFfprhHZtGePNwVaiXTs1w21T1v1EWJ7H2hWHOZWp3HX0qgzmOSqlvD4LjI4q97qmXN6f/U+SFS9nNrAJOk+UzQa/e3tymYrxfYihIgD3bcYEg
2019-06-19 - 求问为什么我点击相同的组件一个有数据一个没有数据!
[代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"scontainer"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"bg"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"choose_user"[代码] [代码]style[代码][代码]=[代码][代码]"border-bottom:1rpx solid #e6e6e6;"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"choose_user_item"[代码] [代码]style[代码][代码]=[代码][代码]"color:#{{tradeType==0?'fff':'118fff'}};background:#{{tradeType==0?'118fff':'fff'}};"[代码] [代码]bindtap[代码][代码]=[代码][代码]"chosewhole"[代码] [代码]data-[代码][代码]=[代码][代码]''[代码] [代码]>全部</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"choose_user_item"[代码] [代码]style[代码][代码]=[代码][代码]"color:#{{tradeType==1?'fff':'118fff'}};background:#{{tradeType==1?'118fff':'fff'}};"[代码] [代码]bindtap[代码][代码]=[代码][代码]"choseoneType"[代码] [代码]id[代码][代码]=[代码][代码]"1"[代码][代码]>运动</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"choose_user_item"[代码] [代码]style[代码][代码]=[代码][代码]"color:#{{tradeType==2?'fff':'118fff'}};background:#{{tradeType==2?'118fff':'fff'}};"[代码] [代码]bindtap[代码][代码]=[代码][代码]"choseTradeType"[代码] [代码]id[代码][代码]=[代码][代码]"2"[代码][代码]>游戏</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"choose_user_item"[代码] [代码]style[代码][代码]=[代码][代码]"color:#{{tradeType==3?'fff':'118fff'}};background:#{{tradeType==3?'118fff':'fff'}};"[代码] [代码]bindtap[代码][代码]=[代码][代码]"choseTradeType"[代码] [代码]id[代码][代码]=[代码][代码]"3"[代码][代码]>交友</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"choose_user_item"[代码] [代码]style[代码][代码]=[代码][代码]"color:#{{tradeType==4?'fff':'118fff'}};background:#{{tradeType==4?'118fff':'fff'}};"[代码] [代码]bindtap[代码][代码]=[代码][代码]"choseTradeType"[代码] [代码]id[代码][代码]=[代码][代码]"4"[代码][代码]>旅行</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"choose_user_item"[代码] [代码]style[代码][代码]=[代码][代码]"color:#{{tradeType==5?'fff':'118fff'}};background:#{{tradeType==5?'118fff':'fff'}};"[代码] [代码]bindtap[代码][代码]=[代码][代码]"choseTradeType"[代码] [代码]id[代码][代码]=[代码][代码]"5"[代码][代码]>读书</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"choose_user_item"[代码] [代码]style[代码][代码]=[代码][代码]"color:#{{tradeType==6?'fff':'118fff'}};background:#{{tradeType==6?'118fff':'fff'}};"[代码] [代码]bindtap[代码][代码]=[代码][代码]"choseTradeType"[代码] [代码]id[代码][代码]=[代码][代码]"6"[代码][代码]>竞赛</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"choose_user_item"[代码] [代码]style[代码][代码]=[代码][代码]"color:#{{tradeType==7?'fff':'118fff'}};background:#{{tradeType==7?'118fff':'fff'}};"[代码] [代码]bindtap[代码][代码]=[代码][代码]"choseTradeType"[代码] [代码]id[代码][代码]=[代码][代码]"7"[代码][代码]>电影</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"choose_user_item"[代码] [代码]style[代码][代码]=[代码][代码]"color:#{{tradeType==8?'fff':'118fff'}};background:#{{tradeType==8?'118fff':'fff'}};"[代码] [代码]bindtap[代码][代码]=[代码][代码]"choseTradeType"[代码] [代码]id[代码][代码]=[代码][代码]"8"[代码][代码]>音乐</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"choose_user_item"[代码] [代码]style[代码][代码]=[代码][代码]"color:#{{tradeType==9?'fff':'118fff'}};background:#{{tradeType==9?'118fff':'fff'}};"[代码] [代码]bindtap[代码][代码]=[代码][代码]"choseTradeType"[代码] [代码]id[代码][代码]=[代码][代码]"9"[代码][代码]>其他</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码] 我想做这样一个点击以后就可以显示不同数据库内容的操作,可是为什么我点击全部的时候有数据,点击运动的时候没有数据![图片][图片] [代码]choseoneType:[代码][代码]function[代码][代码](e){[代码] [代码] [代码][代码]var[代码] [代码]tradeUype = e.currentTarget.id;[代码][代码] [代码][代码]if[代码] [代码](tradeUype == 0) [代码][代码]this[代码][代码].onShow();[代码][代码] [代码][代码]else[代码] [代码]if[代码] [代码](tradeUype == 1)[代码][代码] [代码][代码]this[代码][代码].setData({ moodList: [代码][代码]this[代码][代码].data.gameList });[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]tradeType: tradeUype,[代码][代码] [代码] [代码] [代码][代码]})[代码][代码] [代码] [代码] [代码][代码]// // 查询当前用户所有的 counters[代码][代码] [代码][代码]db.collection([代码][代码]'users'[代码][代码]).where({[代码][代码] [代码] [代码] [代码][代码]}).get({[代码][代码] [代码][代码]success: res => {[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]moodList: res.data[代码][代码] [代码][代码]})[代码][代码] [代码][代码]console.log([代码][代码]'[数据库] [查询记录] 成功: '[代码][代码], res)[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: err => {[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]icon: [代码][代码]'none'[代码][代码],[代码][代码] [代码][代码]title: [代码][代码]'查询记录失败'[代码][代码] [代码][代码]})[代码][代码] [代码][代码]console.error([代码][代码]'[数据库] [查询记录] 失败:'[代码][代码], err)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]chosewhole:[代码][代码]function[代码][代码](e){[代码][代码] [代码][代码]var[代码] [代码]tradeType = e.currentTarget.id;[代码][代码] [代码][代码]if[代码] [代码](tradeType == 0) [代码][代码]this[代码][代码].onShow();[代码][代码] [代码][代码]else[代码] [代码]if[代码] [代码](tradeType == 1) [代码][代码]this[代码][代码].setData({ moodList: [代码][代码]this[代码][代码].data.sportList });[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]tradeType: tradeType[代码][代码] [代码][代码]})[代码][代码] [代码][代码]wx.cloud.callFunction({[代码][代码] [代码][代码]name: [代码][代码]'addData'[代码][代码],[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]screen: [代码][代码]'0'[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}).then(res => {[代码] [代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]moodList: res.result.data[代码][代码] [代码] [代码] [代码][代码]})[代码][代码] [代码][代码]console.log([代码][代码]"正确的数据是:"[代码][代码], res)[代码] [代码] [代码][代码]})[代码][代码] [代码] [代码] [代码][代码]},[代码]
2019-04-30 - 微信步数怎么用云开发获取?
[图片] 我用以下的代码获取不了,获取到的数据如上: [代码]wx.login({[代码] [代码] [代码][代码]success(resLogin) {[代码] [代码] [代码][代码]if[代码] [代码](resLogin.code) {[代码][代码] [代码][代码]// wx.cloud.database().collection('blog').add({[代码] [代码] [代码][代码]// data: {[代码][代码] [代码][代码]// code: resLogin.code[代码][代码] [代码][代码]// },[代码][代码] [代码][代码]// success: resresSession => {[代码][代码] [代码][代码]// this.setData({[代码][代码] [代码][代码]// code: resLogin.code[代码][代码] [代码][代码]// })[代码][代码] [代码][代码]// wx.showToast({[代码][代码] [代码][代码]// title: '新增记录成功',[代码][代码] [代码][代码]// })[代码][代码] [代码][代码]// console.log('[数据库] [新增记录] 成功,记录 _id: ', res._id)[代码][代码] [代码][代码]wx.getWeRunData({[代码] [代码] [代码][代码]success:resRun=> {[代码] [代码] [代码][代码]// const encryptedData = resRun[代码][代码] [代码][代码]// console.info(resRun);[代码] [代码] [代码][代码]wx.cloud.database().collection([代码][代码]'counters'[代码][代码]).add({[代码] [代码] [代码][代码]data: {[代码][代码] [代码][代码]encryptedData: resRun.encryptedData,[代码][代码] [代码][代码]iv: resRun.iv,[代码][代码] [代码][代码]code: resLogin.code[代码][代码] [代码][代码]},[代码][代码] [代码][代码]})[代码] [代码] [代码][代码]}[代码] [代码] [代码][代码]})[代码] [代码] [代码][代码]// }[代码] [代码] [代码][代码]// })[代码] [代码] [代码][代码]}[代码] [代码] [代码][代码]}[代码] [代码] [代码][代码]})[代码]
2019-04-28 - 为什么加载userinfo会报错,之前一直都可以的!难道跟云函数有关?
[代码]VM61:1 thirdScriptError[代码][代码]app.getUserInfo is not a [代码][代码]function[代码][代码];at pages/index/index page lifeCycleMethod onShow [代码][代码]function[代码][代码]TypeError: app.getUserInfo is not a [代码][代码]function[代码][代码] [代码][代码]at t.onShow (http:[代码][代码]//127.0.0.1:15828/appservice/pages/index/index.js:104:9)[代码][代码] [代码][代码]at t.<anonymous> (http:[代码][代码]//127.0.0.1:15828/appservice/__dev__/WAService.js:19:13907)[代码][代码] [代码][代码]at $t (http:[代码][代码]//127.0.0.1:15828/appservice/__dev__/WAService.js:19:30381)[代码][代码] [代码][代码]at on (http:[代码][代码]//127.0.0.1:15828/appservice/__dev__/WAService.js:20:235)[代码][代码] [代码][代码]at sn (http:[代码][代码]//127.0.0.1:15828/appservice/__dev__/WAService.js:20:573)[代码][代码] [代码][代码]at Function.<anonymous> (http:[代码][代码]//127.0.0.1:15828/appservice/__dev__/WAService.js:20:3006)[代码][代码] [代码][代码]at L.<anonymous> (http:[代码][代码]//127.0.0.1:15828/appservice/__dev__/WAService.js:19:1500)[代码][代码] [代码][代码]at L.emit (http:[代码][代码]//127.0.0.1:15828/appservice/__dev__/WAService.js:8:15814)[代码][代码] [代码][代码]at Object.emit (http:[代码][代码]//127.0.0.1:15828/appservice/__dev__/WAService.js:6:14059)[代码][代码] [代码][代码]at Function.<anonymous> (http:[代码][代码]//127.0.0.1:15828/appservice/__dev__/WAService.js:9:16174)[代码][代码]console.error @ VM61:1[代码][代码]errorReport @ WAService.js:4[代码][代码]thirdErrorReport @ WAService.js:4[代码][代码](anonymous) @ WAService.js:4[代码][代码](anonymous) @ WAService.js:19[代码][代码]$t @ WAService.js:19[代码][代码]on @ WAService.js:20[代码][代码]sn @ WAService.js:20[代码][代码](anonymous) @ WAService.js:20[代码][代码](anonymous) @ WAService.js:19[代码][代码]L.emit @ WAService.js:8[代码][代码]emit @ WAService.js:6[代码][代码](anonymous) @ WAService.js:9[代码][代码](anonymous) @ WAService.js:6[代码][代码]e @ appservice?t=1556118374729:2874[代码][代码]n.registerCallback.t @ appservice?t=1556118374729:2874[代码][代码]l.forEach.t @ appservice?t=1556118374729:2874[代码][代码](anonymous) @ appservice?t=1556118374729:2874[代码][代码]s.onmessage @ appservice?t=1556118374729:2874[代码][代码]app.js? [sm]:39[代码]为什么加载userinfo会报错,之前一直都可以的!难道跟云函数有关? [代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码] [代码] [代码][代码]app.getUserInfo([代码][代码]function[代码] [代码](userInfo) {[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]userInfo: userInfo[代码][代码] [代码][代码]})[代码][代码] [代码][代码]console.log([代码][代码]"user的值:"[代码][代码], userInfo)[代码][代码] [代码][代码]})[代码][代码] [代码][代码]wx.getSystemInfo({[代码][代码] [代码][代码]success: (res) => {[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]windowHeight1: res.windowHeight,[代码][代码] [代码][代码]windowWidth1: res.windowWidth,[代码][代码] [代码][代码]autoplay: [代码][代码]true[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码]为什么加载userinfo会报错,之前一直都可以的!难道跟云函数有关?
2019-04-24 - 下面这情况,为什么获取不到数据了!
[图片][图片] 下面这情况,为什么获取不到数据了!
2019-04-20 - 我用web开发工具获取到我的微信名,但是为什么到客户端就获取不到他们各自微信名
[图片][图片][图片] 我用web开发工具获取到我的微信名,但是为什么到客户端就获取不到他们各自微信名!都有弹出登录窗口,而且都有点击登录的!
2019-03-14 - data取值为空,为什么呢
[图片] [图片] [图片] [图片] [图片] 为什么在 wx.getUserInfo({ success: res => {里面可以得到值,但是在data里面得不到值
2019-03-14 - 怎么把数据库的数据存在一个数组里
[图片] [图片] 想要数据库的数据传到data的car_gequ里面,让他可以循环出效果,怎么做?
2019-03-13