- 触发器功能不能实现?
1、云函数config.json { "triggers": [ { "name": "myTrigger", "type": "timer", "config": "0 */5 9-10 * * * *" } ] } 2、云函数index.js const cloud = require('wx-server-sdk') cloud.init({ env: 'xxxxxxx' }) const db= cloud.database() exports.main = async (event, context) => { try { db.collection("txxx").where( { } ) .count() .then(res => { console.log(res); var le=res.total cloud.openapi.subscribeMessage.send({ touser:'xxxxxxxx', data: { thing4: { value:le }, date3: { value: '2020年11月27日' }, }, templateId: 'xxxxxxxxxxxxxxxxxxxxxx', miniprogramState: 'developer' }) }) } catch (err) { return err } } -------------------------------------- 可以用按键点击发送订阅信息,但是不能用触发器触发?
2020-11-27 - 微信小程序实现云数据更新发订阅消息怎样实现?
怎样把查询出来的数据,写到subscribeMessage.send中? const cloud = require('wx-server-sdk') cloud.init({ env: }) const db= cloud.database() const conm = db.command exports.main = async (event, context) => { try { db.collection("xxxx1").where( conm.and([ { ff:2222 }, { zz:1111 }, ]) ) .count() .then(res => { console.log(res); var leng=res.total const result = await cloud.openapi.subscribeMessage.send({ touser:'xxxxxxxxxxxxxxxxxxxxxx', data: { thing4: { value:leng //不能用-----------leng获取不了 }, date3: { value: '456' }, }, templateId: 'INxxxxxxxxxxxxxxxxxxxxxxxxxY', miniprogramState: 'developer' }) return result } catch (err) { return err } }) } }
2020-11-26 - 微信小程序非正常退出程序,怎样检测到?
在onload中写了些代码,非正常退出,触发不了?正常退出可以触发,怎样解决?
2020-11-21 - 已解决?
已解决
2020-11-21 - 手机预览第一次正常,第二次不正常,以后都不正常,真机调试一直正常,不知道为啥?
db.collection('xxxxx').where({}) .watch({ onChange: snapshot=> { console.log('docs\'s changed events', snapshot.docChanges) console.log('is init data', snapshot.type === 'init') var pCount=snapshot.docChanges.length } }
2020-11-20 - 微信小程序怎样让文本内容朗诵出来?
微信小程序怎样让文本内容朗诵出来,不用自己单独架设服务器
2020-11-17 - 微信小程序订阅消息怎样发送消息给客户?
一、云函数message 1、index.js const cloud = require('wx-server-sdk') cloud.init('xxxxxxxxxxxx') exports.main = async (event, context) => { try { const result = await cloud.openapi.customerServiceMessage.send({ touser: 'OPENID', msgtype: 'text', text: { content: 'Hello World' } }) return result } catch (err) { return err } } 2、config.json { "permissions": { "openapi": [ "templateMessage.send" ] } } 二、页面 1、index.js Page({ onCon:function() { wx.cloud.callFunction({ name: 'message', complete: res => { console.log('云函数 ', res) } }) } }) 2、index.wxml 测试 ------------------------------------------------------------------------------ 运行后提示错误:errCode: 45015, errMsg: "openapi.customerServiceMessage.send:fail response …ption is canceled rid: xxxxxx-xxxxxxaa-xxxxxxxxx
2020-11-16 - 问题已解决?
问题已解决
2020-11-04 - 微信小程序改名 提示 系统错误?
微信小程序改名 提示 系统错误?
2020-10-29 - 微信小程序可以通过编程实现添加好友功能吗?
微信小程序可以通过编程实现添加好友功能吗?
2020-10-26