小程序訂單提醒發貨
用于小(xiao)程(cheng)序的訂單提醒發貨操作
使用步驟
第一步:配置接口地址
在 config.js 文件中找到 config 設置(zhi)
第二步:檢查接口定義
搜索 order_remind 接口是否已經存在定(ding)義(有的小(xiao)程序模板已經定(ding)義)
如果沒有定義,在 config 底部新增以(yi)下代碼:
shopOrderRemindUrl: getApiUrl('order_remind'),并復(fu)制紅(hong)色部(bu)分待用(yong)。如果(guo)已經存在,則直接復(fu)制使用(yong)即可(ke)。
第三步:接口調用請求
如果定義名稱不同(tong),使用第二步(bu)復制的內容替(ti)換紅框部分(fen)
/**
* 提醒發(fa)貨(huo)
* 接收參數(shu)
* order_id:訂單ID
* 接口(kou)傳參
* order_id:訂單ID
*/
remind(e) {
let _this = this;
let order_id = e.currentTarget.dataset.id;
wx.showModal({
title: "友(you)情提示",
content: "需要提醒管理員發(fa)貨?",
success(o) {
if (o.confirm) {
App._requestPost(_this, App.globalData.config.shopOrderRemindUrl, {
order_id
}, result => {
App.showSuccess(result.msg);
});
}
}
});
},
接口傳值
order_id:訂單ID,必傳
文檔最后更新時間:2026-01-13 11:56:39
← 小程序訂單確認收貨
小程序商品加入購物車 →
未解決你的問題?請到「問答社區」反饋你遇到的問題
