1 line
2.6 KiB
Plaintext
1 line
2.6 KiB
Plaintext
{"version":3,"file":"personalService.js","sources":["../../../../src/service/personalService.js"],"sourcesContent":["import { httpGet } from '@/utils/http'\r\n\r\n/**\r\n * 获取附近服务\r\n *\r\n * @param {number} latitude 用户当前位置的纬度\r\n * @param {number} longitude 用户当前位置的经度\r\n * @param {Object} [options] 可选的查询参数\r\n * @param {string} [options.serviceName] 服务名称,用于模糊查询\r\n * @param {number} [options.minPrice] 最低服务价格\r\n * @param {number} [options.maxPrice] 最高服务价格\r\n * @param {string} [options.priceOrder] 价格排序方式(\"asc\" 或 \"desc\")\r\n * @param {string} [options.distanceOrder] 距离排序方式(\"asc\" 或 \"desc\")\r\n * @param {number} [options.current] 当前页码\r\n * @param {number} [options.size] 每页显示的记录数\r\n * @returns {Promise} 返回一个 Promise,resolve 包含附近服务的分页结果,reject 包含错误信息\r\n */\r\nexport function getNearbyServices(latitude, longitude, options = {}) {\r\n const query = {\r\n latitude,\r\n longitude,\r\n serviceName: options.serviceName,\r\n minPrice: options.minPrice,\r\n maxPrice: options.maxPrice,\r\n priceOrder: options.priceOrder,\r\n distanceOrder: options.distanceOrder,\r\n current: options.current || 1,\r\n size: options.size || 10,\r\n }\r\n\r\n return httpGet('/personal-service/referralServices', query)\r\n .then((response) => {\r\n if (response.code === 200) {\r\n // 成功处理响应数据\r\n return response.records\r\n } else {\r\n // 处理响应中的错误\r\n return Promise.reject(response.message || '获取服务列表失败')\r\n }\r\n })\r\n .catch((error) => {\r\n console.error('请求失败:', error)\r\n uni.showToast({\r\n icon: 'none',\r\n title: '获取服务列表失败,请稍后重试',\r\n })\r\n return Promise.reject(error)\r\n })\r\n}\r\n"],"names":["httpGet","uni"],"mappings":";;;AAiBO,SAAS,kBAAkB,UAAU,WAAW,UAAU,CAAA,GAAI;AACnE,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA,aAAa,QAAQ;AAAA,IACrB,UAAU,QAAQ;AAAA,IAClB,UAAU,QAAQ;AAAA,IAClB,YAAY,QAAQ;AAAA,IACpB,eAAe,QAAQ;AAAA,IACvB,SAAS,QAAQ,WAAW;AAAA,IAC5B,MAAM,QAAQ,QAAQ;AAAA,EACvB;AAED,SAAOA,WAAO,QAAC,sCAAsC,KAAK,EACvD,KAAK,CAAC,aAAa;AAClB,QAAI,SAAS,SAAS,KAAK;AAEzB,aAAO,SAAS;AAAA,IACxB,OAAa;AAEL,aAAO,QAAQ,OAAO,SAAS,WAAW,UAAU;AAAA,IACrD;AAAA,EACP,CAAK,EACA,MAAM,CAAC,UAAU;AAChB,YAAQ,MAAM,SAAS,KAAK;AAC5BC,kBAAAA,MAAI,UAAU;AAAA,MACZ,MAAM;AAAA,MACN,OAAO;AAAA,IACf,CAAO;AACD,WAAO,QAAQ,OAAO,KAAK;AAAA,EACjC,CAAK;AACL;;"} |