微信小程序報錯:Uncaught (in promise) ReferenceError: _ is not defined
解決辦法:在你的代碼中添加如下代碼中 紅色部分
//保存授權信息shouquan_type: ture 增加1 false 減少1save_shouquan_info(openid,shouquan_type,callback){const _ = wx.cloud.database().command;let dt = shouquan_type ? {shouquan_num:_.inc(1)} : {shouquan_num:_.inc(-1)};let dingyue = wx.cloud.database().collection('dingyue');dingyue.where( {_openid:openid} ).update({data:dt,success(res){callback(true);},//保存授權信息成功fail(res){callback(false);}//保存授權信息失敗})} |