2021-02-06 09:25:18 +00:00
|
|
|
const arrTemp = ["beforePay","afterPay","refundApply", "beforeRecharge", "createBargain","pink"];
|
2020-08-13 08:12:57 +00:00
|
|
|
|
2020-09-15 08:13:25 +00:00
|
|
|
// export function auth() {
|
|
|
|
// let tmplIds = {};
|
|
|
|
// let messageTmplIds = uni.getStorageSync(SUBSCRIBE_MESSAGE);
|
|
|
|
// tmplIds = messageTmplIds ? JSON.parse(messageTmplIds) : {};
|
|
|
|
// return tmplIds;
|
|
|
|
// }
|
2020-08-13 08:12:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 支付成功后订阅消息id
|
|
|
|
* 订阅 确认收货通知 订单支付成功 新订单管理员提醒
|
|
|
|
*/
|
|
|
|
export function openPaySubscribe() {
|
2020-09-15 08:13:25 +00:00
|
|
|
let tmplIds = uni.getStorageSync('tempID' + arrTemp[0]);
|
|
|
|
return subscribe(tmplIds);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订单相关订阅消息
|
|
|
|
* 送货 发货 取消订单
|
|
|
|
*/
|
|
|
|
export function openOrderSubscribe() {
|
2020-09-15 08:13:25 +00:00
|
|
|
let tmplIds = uni.getStorageSync('tempID' + arrTemp[1]);
|
|
|
|
return subscribe(tmplIds);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 提现消息订阅
|
|
|
|
* 成功 和 失败 消息
|
|
|
|
*/
|
2021-02-06 09:25:18 +00:00
|
|
|
// export function openExtrctSubscribe() {
|
|
|
|
// let tmplIds = uni.getStorageSync('tempID' + arrTemp[2]);
|
|
|
|
// return subscribe(tmplIds);
|
|
|
|
// }
|
2020-08-13 08:12:57 +00:00
|
|
|
|
|
|
|
/**
|
2020-12-23 07:56:45 +00:00
|
|
|
* 订单退款
|
2020-08-13 08:12:57 +00:00
|
|
|
*/
|
2020-12-23 07:56:45 +00:00
|
|
|
export function openOrderRefundSubscribe() {
|
2021-02-06 09:25:18 +00:00
|
|
|
let tmplIds = uni.getStorageSync('tempID' + arrTemp[2]);
|
2020-12-23 07:56:45 +00:00
|
|
|
return subscribe(tmplIds);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2020-12-23 07:56:45 +00:00
|
|
|
* 充值成功
|
2020-08-13 08:12:57 +00:00
|
|
|
*/
|
2020-12-23 07:56:45 +00:00
|
|
|
export function openRechargeSubscribe() {
|
2021-02-06 09:25:18 +00:00
|
|
|
let tmplIds = uni.getStorageSync('tempID' + arrTemp[3]);
|
2020-12-23 07:56:45 +00:00
|
|
|
return subscribe(tmplIds);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-02-06 09:25:18 +00:00
|
|
|
* 砍价成功
|
2020-08-13 08:12:57 +00:00
|
|
|
*/
|
2021-02-06 09:25:18 +00:00
|
|
|
export function openBargainSubscribe() {
|
|
|
|
let tmplIds = uni.getStorageSync('tempID' + arrTemp[4]);
|
2020-09-15 08:13:25 +00:00
|
|
|
return subscribe(tmplIds);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
2021-02-06 09:25:18 +00:00
|
|
|
|
2020-08-13 08:12:57 +00:00
|
|
|
/**
|
2021-02-06 09:25:18 +00:00
|
|
|
* 拼团成功
|
2020-08-13 08:12:57 +00:00
|
|
|
*/
|
2021-02-06 09:25:18 +00:00
|
|
|
export function openPinkSubscribe() {
|
|
|
|
let tmplIds = uni.getStorageSync('tempID' + arrTemp[5]);
|
2020-09-15 08:13:25 +00:00
|
|
|
return subscribe(tmplIds);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
2020-09-15 08:13:25 +00:00
|
|
|
// /**
|
|
|
|
// * 提现
|
|
|
|
// */
|
|
|
|
// export function openEextractSubscribe() {
|
|
|
|
// let tmplIds = JSON.parse(uni.getStorageSync('tempID' + paySubscribe));
|
|
|
|
// return subscribe(tmplIds);
|
|
|
|
// }
|
2020-08-13 08:12:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 调起订阅界面
|
|
|
|
* array tmplIds 模板id
|
|
|
|
*/
|
|
|
|
export function subscribe(tmplIds) {
|
|
|
|
let wecaht = wx;
|
|
|
|
return new Promise((reslove, reject) => {
|
|
|
|
wecaht.requestSubscribeMessage({
|
|
|
|
tmplIds: tmplIds,
|
|
|
|
success(res) {
|
|
|
|
return reslove(res);
|
|
|
|
},
|
|
|
|
fail(res) {
|
|
|
|
return reslove(res);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|