微信小程式留言回覆後下發訂閱訊息

2021-10-04 16:56:05 字數 875 閱讀 9020

訂閱訊息模板先到後台去找,根據註冊類別有預設的。

js裡處理沒授權會調取授權使用者名稱,然後寫入資料庫,這裡有坑,注意用提示框觸發訂閱許可權,不能自然觸發。

const db = wx.cloud.database()

const liuyan = db.collection('liuyan')

ongetuserinfo: function (e) ,

success: function (res) ,

fail(res)

})} else if (res.cancel)

}})

click: function () 

}).then(res => ).catch(err => )

// 雲呼叫

wx.cloud.callfunction(

}).then(res => ).catch(err => )

雲函式update的**

/ 雲函式入口函式

exports.main = async (event, context) => ).update(

})} catch (e)

}

雲函式send的**

// 雲函式入口檔案

const cloud = require('wx-server-sdk')

cloud.init()

// 雲函式入口函式

exports.main = async (event, context) => ,

time2: ,}})

return sendresult

}

微信小程式訂閱

主要運用api requestsubscribemessage getsetting opensetting 主要功能 使用者強制訂閱,無論怎麼取消都能訂閱,總 在下方,具體流程思路有耐心可以往下看.可以拷貝直接用。引入即可,當然我比較菜,大家可以再改改。desc 小程式訂閱功能 param tmp...

微信小程式留言功能實現

index.wxml bindtap llzanchange view class zhegai hide bindtap llbquxiao view view class liuyanban hide view class view textarea class shuruk value bin...

微信小程式客服自動回覆訊息後端實現

註冊賬號並授權 ngrok authtoken yourtoken 如果不註冊就會過期 8h之後生成的鏈結即會失效 本地埠內網穿透 ngrok http 8553 訪問 重新啟動之後更新網域名稱 可 ngrok http 8553 subdomain 4c4e91f7 如何使用ngrok生成固定的u...