- canvas 划线报错TypeError: ctx.draw is not a function?
代码如下: 页面/consva/consva.js ; 页({ : { : '' }, onLoad() { }, ClearCon 公司() { ; ); }, 卓尔线() { ; ==''){ ; } '; ; (); ); ); (); // ctx.drow(); (); }, ) { ; ==''){ ; } '; ; (); ; ; ); }, ) { ; ==''){ ; } '; ; ; ; ); (); (); }, ) { ; (); }, onReady() { (); ') }) ) => { ; ; ; ; ); ; ({ : ctx }); ) }); }, onShareAppMessage() {} });
10-05 - 1548351971 商户号no=20, errMSg=FAIL此商家的收款功能已被限制,暂无法支付
请问该怎么解决,这个账号之前被停用过,22年的时候,现在在哪里启用 [图片]
2023-04-01 - 订阅消息 ,已经选择‘总是保持以上选择, 不再询问"后,但是消息仍然只能发一条,还是43101错误?
代码如下,再去点订阅提示已经订阅,然而信息依然推送不过去 // pages/wxmes/ordmes.js import requestb from '../../utils/requs'; var api=require('../../config/api'); var util=require('../../utils/util'); const SUBSCRIBE_ID = 'mIgZEdR6apP3g3ndPsNjB2RKi78vsGxw38oH7hdkC9o' // 模板ID Page({ /** * 页面的初始数据 */ data: { ifdinyue:'0', isdinye:true }, goCollectSet() { let that = this; var tmplIds='mIgZEdR6apP3g3ndPsNjB2RKi78vsGxw38oH7hdkC9o' ; var wxid=wx.getStorageSync("wxid"); if (wx.requestSubscribeMessage) { wx.requestSubscribeMessage({ tmplIds: [SUBSCRIBE_ID], success(res) { // console.log(res) if (res[SUBSCRIBE_ID] === 'accept') { // 用户主动点击同意...do something // console.log(res[SUBSCRIBE_ID]); // console.log(wxid+"/"+res) that.upd_userts(wxid,"Y"); that.setData({ isdinye: false }) wx.showToast({ title: '您订阅成功了,以后每天会提醒您填报', icon: 'none' }) } else if (res[SUBSCRIBE_ID] === 'reject') { // 用户主动点击拒绝...do something // console.log(res[SUBSCRIBE_ID]); that.dingyueComfirm(tmplIds); wx.showToast({ title: '您拒绝订阅了,以后就不推送', icon: 'none' }) } else { wx.showToast({ title: '授权订阅消息有误', icon: 'none' }) } }, fail(res) { // 20004:用户关闭了主开关,无法进行订阅,引导开启 if (res.errCode == 20004) { // 显示引导设置弹窗 that.setData({ isShowSetModel: true }) }else{ // 其他错误信息码,对应文档找出原因 wx.showModal({ title: '提示', content: res.errMsg, showCancel: false }) } } }); } else { wx.showModal({ title: '提示', content: '请更新您微信版本,来获取订阅消息功能', showCancel: false }) } } , dingyue: function (SUBSCRIBE_ID){ let that = this let tmplId=SUBSCRIBE_ID; tmplId='mIgZEdR6apP3g3ndPsNjB2RKi78vsGxw38oH7hdkC9o'; var wxid=wx.getStorageSync("wxid"); wx.getSetting({ withSubscriptions: true, success(res) { // console.log(res) if (res.subscriptionsSetting && res.subscriptionsSetting.mainSwitch) { // console.log("abdd"+res) that.goCollectSet(); } else { that.dingyueComfirm(tmplId) } } }) }, dingyue_old: function (SUBSCRIBE_ID){ let that = this let tmplId=SUBSCRIBE_ID; tmplId='mIgZEdR6apP3g3ndPsNjB2RKi78vsGxw38oH7hdkC9o'; var wxid=wx.getStorageSync("wxid"); wx.getSetting({ withSubscriptions: true, success(res) { console.log(res) if (res.subscriptionsSetting && res.subscriptionsSetting.mainSwitch) { if (res.subscriptionsSetting.itemSettings && res.subscriptionsSetting.itemSettings[tmplId]) { let item = res.subscriptionsSetting.itemSettings[tmplId] if (item == "reject") { that.dingyueComfirm(tmplId) } else if (item == "accept") { that.setData({ ifdinyue:1, isdinye:false }) that.upd_userts(wxid,"Y"); wx.showModal({ title: '订阅消息', content: '您已经开启订阅消息,以后我们定时提醒您填报信息' }) console.log('提示:您已经开启订阅消息') } else if (item == "ban") { console.log('提示:您已经被后台封禁') wx.showModal({ title: '订阅消息', content: '提示:您已经被后台封禁' }) } }else{ that.dingyueComfirm(tmplId) } } else { that.dingyueComfirm(tmplId) } } }) }, dingyueComfirm: function (tmplId){ var wxid=wx.getStorageSync("wxid"); let that=this; wx.showModal({ title: '订阅消息', content: '订阅后,有消息会通过微信通知您', success: (res) => { if (res.confirm) { wx.requestSubscribeMessage({ tmplIds: [tmplId], success: (res) => { if (res[tmplId] === 'accept') { that.upd_userts(wxid,"Y"); wx.showToast({ title: '订阅成功,后续每日定时提醒!', duration: 1000 // success(data) { // //成功 // console.error(data); // } }) } else if (res[tmplId] == "reject") { //引导用户,手动引导用户点击按钮,去设置页开启,## Modals是自定义组件 wx.showModal({ title: '订阅消息', content: '您当前拒绝接受消息通知,是否去开启', confirmText: '开启授权', confirmColor: '#345391', cancelText: '仍然拒绝', cancelColor: '#999999', success: res => { this.globalData.isUpload = true wx.openSetting({ success(res) { console.log(res.authSetting) // res.authSetting = { // "scope.userInfo": true, // "scope.userLocation": true // } }, fail(err) { //失败 console.error(err); } }) } }) } }, fail(err) { //失败 console.error(err); } }) } } }) }, upd_userts:function(userid,res){ // console.log("cs:"+userid+"/"+res); let usercode=userid; let yorn=res; requestb({ url: api.dinyue, data:{userid:usercode, zt:yorn}, method: 'get', dataType: 'json', header: 'application/json' }) .then(res =>{ console.log( res); }) }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })
2021-08-08 - 小程序授权微信登录,出现个别帐号点了授权没反馈,不知道是什原因?
开发了个小程序,出现很奇怪事情,几十个人都能正常使用,但就有2个无法通过授权,点授权,跳开,但是后台获取不到信息,不知道是什么原因,代码如下: import requestb from '../../../utils/requs.js' var api=require('../../../config/api.js'); const app = getApp() Page({ data:{ navUrl: '', userInfo: {}, hasUserInfo: false, canIUseGetUserProfile: true, code: '', token:'' }, getUserProfile() { // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认 // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 let that=this; wx.getUserProfile({ desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 success: (res) => { that.setData({ userInfo: res.userInfo, hasUserInfo: true }) console.log("useif:",res.userInfo) this.bindgetuser(); } }); }, bindgetuser:function () { let that = this; var codeab=that.data.code; if(codeab ){ console.log("code:", that.data.code); console.log("usde",that.data.userInfo) requestb({ url:api.AuthLoginByWeixin, data:{ code: that.data.code, userInfo: that.data.userInfo }, method: 'POST', header:'application/json' }) .then(res => { // console.log("df:"+res.data.token); if (res.respCode == 0 ) { //存储用户信息 // console.log(res); wx.setStorageSync('userInfo', that.data.userInfo); wx.setStorageSync('token', res.data.token); wx.setStorageSync('userId', res.data.userId); wx.setStorageSync('wxid', res.data.wxid); console.log(wx.getStorageSync("userInfo")); console.log(wx.getStorageSync("token")); } if (res.respCode != 0 ) { wx.showModal({ title: '提示', content: res.data.errmsg, showCancel: false }); } }) } if (that.data.navUrl && that.data.navUrl == '/pages/index/index') { wx.switchTab({ url: that.data.navUrl, }) } else if (that.data.navUrl) { wx.redirectTo({ url: that.data.navUrl, }) } }, // onload begin onLoad: function(options) { var tokena=wx.getSystemInfoSync("token"); let that = this; this.setData({ hasUserInfo: false }) // console.log("toke"+ tokena+"/"+that.data.hasUserInfo +"/"+that.data.canIUseGetUserProfile) //---index huoqu end if (wx.getStorageSync("navUrl")) { that.setData({ navUrl: wx.getStorageSync("navUrl") }) } else { that.setData({ navUrl: '/pages/index/index' }) } wx.login({ success: function(res) { if (res.code) { that.setData({ code: res.code }) } } }); } })
2021-08-04