终于发现问题了,其中一个变量是由页面传过来的,传过来的时候就是undefined,传值的时候写成+“&c”+,丢了个等号
关于字符拼接串的问题?let a="abc" let b="bcd" 如何让c="abc-bcd"????试验这样不行: let c=a+"-"+b 不行
2020-07-05这里不知道正确的格式是啥,我是根据更新数组的格式编的,index上面已经定义了呀
如何更新数据库动态下标数组的某个元素的值?[图片] 我想更新endtime, //res已经获取到 var index=res.data[0].ringtime.length-1 console.log('index',index) db.collection("usersRing").doc(res.data[0]._id).update({ data: { 'ringtime'.+[index].endtime:new Date(), }, success: resk =>{ wx.showToast({ title: '打卡成功', icon: 'success', }) console.log("创建数据成功", resk) }, fail: err => { wx.showToast({ title: '程序出错', icon: '', }) } }) 打印程序出错
2020-05-12[图片] 数据库里有users这个集合呀
云函数调用失败,不知道为啥?大神帮忙看看const cloud = require('wx-server-sdk') cloud.init({ // API 调用都保持和云函数当前所在环境一致 env: cloud.DYNAMIC_CURRENT_ENV, traceUser: true }) const db = cloud.database() // 云函数入口函数 exports.main = async (event, context) => { var docid = event.id var group = event.group var salaryperhour = event.salaryperhour if(group=="users"){ return await db.collection(group).doc(docid).update({ data: { salaryperhour:salaryperhour, } }) }} js: wx.cloud.callFunction({ name:"dataset", data:{ group:"users", id:that.data.id, salaryperhour:that.data.salaryperhour },success:function(){ wx.showToast({ title: '成功', icon: "none", }) } }) 日志: {"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"Error: errCode: -502005 database collection not exists | errMsg: [ResourceNotFound] Db or Table not exist. Please check your request, but if the problem cannot be solved, contact us.; \n at Object.returnAsCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6121:16)\n at Object.checkError (/var/user/node_modules/wx-server-sdk/index.js:1418:23)\n at Promise (/var/user/node_modules/wx-server-sdk/index.js:1335:33)\n at process._tickCallback (internal/process/next_tick.js:68:7)"}
2020-05-08单独打印code和getcode是一样的,但是打印code == getcode是false
wx.scancode 回调到的result 无法使用if判断?[图片]getscancode:function(){ var that=this db.collection("Ringscancode").where({admincompany:that.data.usercompany}).get({ success:function(res){ if(res.data.length>0){ console.log("Ringscancodedata",res.data) var code=res.data[0].code wx.scanCode({ onlyFromCamera: true, success (re) { let getcode=re.result console.log('getcode',re.result) console.log("code",code ) if( getcode==code ){ db.collection("usersRing").where({ today: util.formatDate(new Date()), _openid: that.data.openid }).get({ success: function (res) { console.log("查询有无打卡数据", res) if(res.data.length==0){ db.collection("usersRing").add({ data: { usernickName: that.data.usernickName, usercompany: that.data.usercompany, username: that.data.username, today: util.formatDate(new Date()), MRinguptime: new Date(0), MRingdowntime: new Date(0), ARinguptime: new Date(0), ARingdowntime: new Date(0), ERinguptime: new Date(0), ERingdowntime: new Date(0), URinguptime: new Date(0), URingdowntime: new Date(0) }, success: res =>{ wx.navigateTo({ url: '../userpage1-1/userpage1-1', }) ,console.log("创建数据成功", res) }, fail: err => { wx.showToast({ title: '程序出错', icon: '', }) } }) } else { console.log("直接跳转") wx.navigateTo({ url: '../userpage1-1/userpage1-1', }) } } }) }else{ wx.showToast({ title: '无效二维码', icon:"none" }) } } }) }else{ console.log("Ringscancodedata",res.data) wx.showToast({ title: '管理员未开启此功能', icon:"none", }) } }, }) }, code 和 getcode打印出来的是一样的,就是执行函数后不执行if(code==getcode)后的语句 打印code==getcode是false
2020-05-04已解决,不知道为啥,今天编译通过了,代码啥都没动。
wx.scancode返回值不执行判断语句?已经返回结果了getscancode:function(){ var that=this db.collection("Ringscancode").where({admincompany:that.data.usercompany}).get({ success:function(res){ if(res.data.length>0){ console.log("Ringscancodedata",res.data) var code=res.data[0].code wx.scanCode({ onlyFromCamera: true, success (re) { let getcode=re.result console.log('getcode',re.result) console.log("code",code ) if( getcode==code ){ db.collection("usersRing").where({ today: util.formatDate(new Date()), _openid: that.data.openid }).get({ success: function (res) { console.log("查询有无打卡数据", res) if(res.data.length==0){ db.collection("usersRing").add({ data: { usernickName: that.data.usernickName, usercompany: that.data.usercompany, username: that.data.username, today: util.formatDate(new Date()), MRinguptime: new Date(0), MRingdowntime: new Date(0), ARinguptime: new Date(0), ARingdowntime: new Date(0), ERinguptime: new Date(0), ERingdowntime: new Date(0), URinguptime: new Date(0), URingdowntime: new Date(0) }, success: res =>{ wx.navigateTo({ url: '../userpage1-1/userpage1-1', }) ,console.log("创建数据成功", res) }, fail: err => { wx.showToast({ title: '程序出错', icon: '', }) } }) } else { console.log("直接跳转") wx.navigateTo({ url: '../userpage1-1/userpage1-1', }) } } }) }else{ wx.showToast({ title: '无效二维码', icon:"none" }) } } }) }else{ console.log("Ringscancodedata",res.data) wx.showToast({ title: '管理员未开启此功能', icon:"none", }) } }, }) }, code 和 getcode打印出来的是一样的,就是执行函数后不执行if(code==getcode)后的语句
2020-05-01沃,搜到了,我再试一试吧,以前试了好几次收不到,感谢!
为什么小程序发布好几天了搜索里搜索不到?我的小程序发布好几天了,不知道为啥搜索栏里搜索不到,请教大神。。
2020-04-30好的
审核团队您好,今天凌晨提交了修复bug的审核申请,?一直没通过,,提供了开发者登录opeid,有时间帮忙看看,谢谢!
2020-04-26