- 新增地址选择插件,支持地图位置选择并返回地址和经纬度 - 新增微信订阅消息发送功能,支持审核结果、提现通知等场景 - 新增订单支付状态查询、提现收款人姓名保存等接口 - 新增服务区域管理,支持按省市区划分并同步到信息发布 - 新增资金流水和营收报表导出功能 - 新增可用优惠券查询、订单退款拆分处理等功能 - 优化后台角标显示、首页数据统计、UI配置下发等 - 修复订单支付并发问题、地区管理逻辑等
31 行
944 B
JavaScript
31 行
944 B
JavaScript
/**
|
|
* 微信订阅消息授权
|
|
*
|
|
* 模板 ID 由后台「系统配置 → 小程序配置」下发(/setting/ui 的 subscribe 字段)。
|
|
* 未配置 / 非小程序环境时静默跳过,不阻断业务。
|
|
*/
|
|
import { uiState } from '../store/ui.js'
|
|
|
|
/**
|
|
* 请求订阅授权(需在用户点击事件中调用)
|
|
* @param {'audit'|'transfer'} scene
|
|
* @returns {Promise<string>} accepted | reject | none | unsupported
|
|
*/
|
|
export function requestSubscribe(scene) {
|
|
const id = (uiState.subscribe && uiState.subscribe[scene]) || ''
|
|
if (!id) return Promise.resolve('none')
|
|
if (typeof uni === 'undefined' || !uni.requestSubscribeMessage) {
|
|
return Promise.resolve('unsupported')
|
|
}
|
|
|
|
return new Promise((resolve) => {
|
|
uni.requestSubscribeMessage({
|
|
tmplIds: [id],
|
|
success: (res) => resolve((res && res[id]) || 'accepted'),
|
|
fail: () => resolve('reject'),
|
|
})
|
|
})
|
|
}
|
|
|
|
export default { requestSubscribe }
|