wxml文件:<form bind:submit="testSubmit" report-submit="true" hidden="{{emptyprompt}}"><button formType="submit">发送模板消息</button></form>js文件:testSubmit: function (e) {var self = this;//获取access_token :APPID为小程序appid,app_secret为小程序密钥wx.request({url: 'https://api./cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APP_SECRETmethod: 'GET',success: function (res) {self.setData({access_token: res.data.access_token})//发送模板消息 需要注意的是openid需为触发当前事件人的openid,不然收不到推送消息wx.request({url: 'https://api./cgi-bin/message/wxopen/template/uniform_send? access_token=access_token',data: {"touser": self.data.openid, //接收者(用户)的"template_id": template_id, //所调用的小程序模板id"page": "pages/index/index","form_id": self.data.payid,//支付场景下为本次支付的prepay_id//"form_id": e.detail.formId,// 表单提交场景下为 submit 事件带上的formId"data": {"keyword1": {"value": "339208499"},"keyword2": {"value": "01月05日 12:30"},"keyword3": {"value": "腾讯微信总部"},"keyword4": {"value": "广州市海珠区新港中路397号"}},"emphasis_keyword": "keyword1.DATA" //要放大的数据},method: 'POST',header: {'content-type': 'application/json'},success: function (res) {console.log(res)},fail: function (err) {console.log('request fail ', err);}})}