feat(M03-C): 完成地图选店与距离排序

This commit is contained in:
Codex
2026-06-18 15:15:39 +08:00
parent 9417064e61
commit df373faa82
24 changed files with 614 additions and 132 deletions
+25
View File
@@ -0,0 +1,25 @@
const { APP_API_BASE_URL, WECHAT_APP_ID } = require('../config/env.js')
function request(path, options = {}) {
return new Promise((resolve, reject) => {
wx.request({
url: `${APP_API_BASE_URL}${path}`,
method: options.method || 'GET',
data: options.data,
header: {
'x-wechat-appid': WECHAT_APP_ID,
...(options.headers || {}),
},
success(response) {
if (response.statusCode >= 200 && response.statusCode < 300) {
resolve(response.data)
return
}
reject(new Error(response.data?.message || `请求失败:${response.statusCode}`))
},
fail: reject,
})
})
}
module.exports = { request }