- 小程序 同一个js文件,两个不同的funtion如何传递数值?
小程序 同一个JS页面,不同funtion如何传值 [代码]const app = getApp()[代码] [代码]Page({[代码] [代码] [代码][代码]data: {[代码][代码] [代码][代码]key1:[代码][代码]''[代码][代码],[代码][代码] [代码][代码]key2: [代码][代码]''[代码][代码],[代码][代码] [代码][代码]testid:[代码][代码]''[代码][代码] [代码][代码]},[代码][代码] [代码][代码]bindTextAreaChange: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]const db = wx.cloud.database({});[代码][代码] [代码][代码]const cont = db.collection([代码][代码]'test'[代码][代码]);[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]db.collection([代码][代码]'test'[代码][代码]).add({[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]key1: [代码][代码]'2'[代码][代码],[代码][代码] [代码][代码]key2: [代码][代码]'dasjjfksfksjdhkjfhkdfhj'[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log(res)[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]testid: res._id[代码][代码] [代码] [代码] [代码][代码]})[代码][代码] [代码][代码]return[代码] [代码]testid[代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]})[代码][代码] [代码] [代码] [代码][代码]},[代码][代码] [代码][代码]queryData: [代码][代码]function[代码] [代码]() {[代码] [代码] [代码][代码]console.log(testid)[代码] [代码] [代码][代码]const db = wx.cloud.database({});[代码][代码] [代码][代码]const cont = db.collection([代码][代码]'test'[代码][代码]);[代码][代码] [代码][代码]cont.doc([代码][代码]" "[代码][代码]).get({[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log(res.data)[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]key2: res.data.key2[代码][代码] [代码][代码]})[代码] [代码] [代码][代码]}[代码] [代码] [代码][代码]})[代码][代码] [代码][代码]}[代码] [代码]})[代码]
2019-08-30 - 已经读取图片中的文字数据(控制台),怎么把它传入我设置的参数里呢?
读取文字的函数在page3中,按钮跳转page4,怎么把words_result传递到page4 [图片]
2019-08-26 - 模板消息一定要有form么
- 需求的场景描述(希望解决的问题) 目前想实现一个积分兑换的消息,就是在弹出的modal框的确认按钮的点击事件里面完成代码逻辑,然后发个消息给用户,可是模板消息需要formid,这modal又没有form,请问怎么实现这样的功能 - 希望提供的能力 [图片] [图片]
2019-02-28