GAS+購物車開發
prog_line_bot.gs
- 搜尋:「管理關鍵字(@管理)」
- 當在 Line Bot 收到 「@管理」則會顯示 選單
- 預計出現
- 操作說明(message)
- 更新好友資料(uri)
- 商品訂購(uri)
- LineBot畫面編輯,請參考「GAS+LineBot開發 4-3 整理一個輪播樣板」
- 往下找到 let contents = [];
// 操作說明
contents.push({
"type": "button",
"style": 'secondary',
"margin": "md",
"height": "sm",
"action": {
"type": "message",
"label": `操作說明`,
"text": `請做一次「更新好友資料」
之後就可以執行「商品訂購」的選單。`
}
});
// 更新好友資料
uri = global.url + `?op=form_update_user&userId=${userData.userId}&replyToken=${userData.replyToken}`;
contents.push(
{
"type": "button",
"style": "primary",
"margin": "md",
"height": "sm",
"action": {
"type": "uri",
"label": "更新好友資料",
"uri": uri
}
});
// 商品訂購
uri = `${global.url}?&userId=${userData.userId}`;
contents.push(
{
"type": "button",
"style": "primary",
"margin": "md",
"height": "sm",
"action": {
"type": "uri",
"label": "商品訂購",
"uri": uri
}
});