健康同学微信公众号h5项目
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

356 lines
8.1KB

  1. import request from '@/config/request';
  2. export const APIDevice = {
  3. addPolygonFence,
  4. editPolygonFence,
  5. delPolygonFence,
  6. getPolygonFence,
  7. deleteGeofence, //删除围栏
  8. getAllFence, //获取全部围栏列表
  9. geofenceList, //围栏列表
  10. editGeofence, //编辑围栏
  11. addGeofence, //增加围栏
  12. getPersonInfo, //获取宝贝信息
  13. deviceTimeRelatedParam, //查看设备激活时间,有效时间
  14. updatePersonInfo, //编辑宝贝信息
  15. bindingScan, //设备绑定-扫码
  16. bindingInput, //设备绑定-输入
  17. deviceList, //获取设备列表
  18. locateInstance, //立即定位设备
  19. sendCommand, //发送一个指令给设备
  20. unbindDevice, //解绑设备
  21. getCallLogList, //通话清单
  22. setSMSLog, //短信代收
  23. getDeviceStep, //健康计步
  24. temperatureInfoList, //健康温度
  25. historyDetailList, //查询设备历史轨迹
  26. historyDetailListByIMEI, //根据时间段查看设备历史轨迹
  27. history, //历史轨迹
  28. bindDevice, //绑定设备
  29. bindDeviceSsjl, //设备绑定, 只接受
  30. bindDeviceResult, //设备绑定结果
  31. addVoiceMessage, //上传录音文件
  32. queryVoicePage, //获取分页
  33. decodeSerialNo, //通过密文解析获取imei
  34. LckjCreateOrderPackage, //零川物联网卡加油包订购
  35. LckjGetOrderPackageShow, //查询零川物联网卡加油包订购记录
  36. checkWxPayResult, //查询微信支付状态
  37. updateDrownReportAiStatus, //修改溺水告警状态(ai-呼叫)
  38. psychQuestionAutoCommit //自动提交心里问卷调查答案
  39. };
  40. const baseUrl =
  41. process.env.NODE_ENV === 'production'
  42. ? 'https://ai.ssjlai.com/telpopay/api/wx/order/callback'
  43. : 'https://id.ssjlai.com/telpopay/api/wx/order/callback';
  44. export default APIDevice;
  45. // 增加多边形围栏
  46. function addPolygonFence({ fencePoints, fenceName, serialNo, appType, address }) {
  47. return request({
  48. url: '/api/Geofence/AddPolygonFence',
  49. method: 'post',
  50. headers: { AuthKey: 'key1' },
  51. data: { fencePoints, fenceName, serialNo, appType, address }
  52. });
  53. }
  54. // 修改多边形围栏
  55. function editPolygonFence({ fenceId, fencePoints, fenceName, serialNo, address }) {
  56. return request({
  57. url: '/api/Geofence/EditPolygonFence',
  58. method: 'post',
  59. headers: { AuthKey: 'key1' },
  60. data: { fenceId, fencePoints, fenceName, serialNo, address }
  61. });
  62. }
  63. // 删除多边形围栏
  64. function delPolygonFence({ geofenceId }) {
  65. return request({
  66. url: '/api/Geofence/DeletePolygonFence',
  67. method: 'post',
  68. headers: { AuthKey: 'key1' },
  69. data: { geofenceId }
  70. });
  71. }
  72. // 删除围栏
  73. function deleteGeofence(params) {
  74. return request({
  75. url: '/api/Geofence/Delete',
  76. method: 'post',
  77. data: params
  78. });
  79. }
  80. // 获取全部围栏:包括圆形和多边形
  81. function getPolygonFence(serialNo) {
  82. return request({
  83. url: '/api/Geofence/GetPolygonFence',
  84. method: 'get',
  85. headers: { AuthKey: 'key1' },
  86. params: { serialNo }
  87. });
  88. }
  89. // 获取全部围栏:包括圆形和多边形
  90. function getAllFence(deviceId) {
  91. return request({
  92. url: '/api/Geofence/GeofenceList',
  93. method: 'post',
  94. data: { deviceId }
  95. });
  96. }
  97. // 围栏列表
  98. function geofenceList(params) {
  99. return request({
  100. url: '/api/Geofence/GeofenceList',
  101. method: 'post',
  102. data: params
  103. });
  104. }
  105. // 编辑围栏
  106. function editGeofence(params) {
  107. return request({
  108. url: '/api/Geofence/Edit',
  109. method: 'post',
  110. data: params
  111. });
  112. }
  113. // 增加围栏
  114. function addGeofence(params) {
  115. return request({
  116. url: '/api/Geofence/Add',
  117. method: 'post',
  118. data: params
  119. });
  120. }
  121. // 获取宝贝信息
  122. function getPersonInfo(params) {
  123. return request({
  124. url: '/api/Device/GetPersonInfo',
  125. method: 'post',
  126. data: params
  127. });
  128. }
  129. //查看设备激活时间,有效时间
  130. function deviceTimeRelatedParam(sn) {
  131. return request({
  132. url: '/api/DeviceFeatures/DeviceTimeRelatedParam',
  133. method: 'get',
  134. headers: { AuthKey: 'key1' },
  135. params: { sn }
  136. });
  137. }
  138. // 编辑宝贝信息
  139. function updatePersonInfo(params) {
  140. return request({
  141. url: '/api/Device/UpdatePersonInfo',
  142. method: 'post',
  143. data: params
  144. });
  145. }
  146. // 设备绑定-扫码
  147. function bindingScan({ url }) {
  148. return request({
  149. url: '/api/Device/BindingScan',
  150. method: 'post',
  151. data: { url }
  152. });
  153. }
  154. // 通过密文解析获取imei
  155. function decodeSerialNo({ code }) {
  156. return request({
  157. url: '/api/Device/DecodeImei',
  158. method: 'post',
  159. headers: { authKey: 'key1' },
  160. data: { code }
  161. });
  162. }
  163. // 设备绑定-输入
  164. function bindingInput({ serialNo }) {
  165. return request({
  166. url: '/api/Device/BindingInput',
  167. method: 'post',
  168. data: { serialNo }
  169. });
  170. }
  171. // 获取设备列表
  172. function deviceList(params) {
  173. return request({
  174. url: '/api/Location/DeviceList',
  175. method: 'post',
  176. data: params
  177. });
  178. }
  179. //立即定位设备
  180. function locateInstance(params) {
  181. return request({
  182. url: '/api/Command/LocateInstance',
  183. method: 'post',
  184. data: params
  185. });
  186. }
  187. //发送一个指令给设备
  188. function sendCommand(params) {
  189. return request({
  190. url: '/api/Command/SendCommand',
  191. method: 'post',
  192. data: params
  193. });
  194. }
  195. //解绑设备
  196. function unbindDevice(params) {
  197. return request({
  198. url: '/api/Device/UnbindDevice',
  199. method: 'post',
  200. data: params
  201. });
  202. }
  203. //通话清单
  204. function getCallLogList(params) {
  205. return request({
  206. url: '/api/DeviceCommunication/GetCallLogList',
  207. method: 'post',
  208. data: params
  209. });
  210. }
  211. //短信代收
  212. function setSMSLog(params) {
  213. return request({
  214. url: '/api/DeviceCommunication/SetSMSLog',
  215. method: 'post',
  216. data: params
  217. });
  218. }
  219. //健康计步
  220. function getDeviceStep(params) {
  221. return request({
  222. url: '/api/DeviceFeatures/GetDeviceStep',
  223. method: 'post',
  224. data: params
  225. });
  226. }
  227. //健康温度
  228. function temperatureInfoList({ sn, c }) {
  229. return request({
  230. url: '/api/DeviceFeatures/TemperatureInfoList',
  231. method: 'get',
  232. headers: { authKey: 'key1' },
  233. params: { sn, c }
  234. });
  235. }
  236. //查询设备历史轨迹
  237. function historyDetailList({ imei, queryDate }) {
  238. return request({
  239. url: '/api/Location/HistoryDetailList',
  240. method: 'get',
  241. params: { imei, queryDate }
  242. });
  243. }
  244. //根据时间段查询设备历史轨迹
  245. function historyDetailListByIMEI(params) {
  246. return request({
  247. url: '/api/Location/HistoryListByIMEI',
  248. method: 'post',
  249. data: params
  250. });
  251. }
  252. //历史轨迹
  253. function history(params) {
  254. return request({
  255. url: '/api/Location/History',
  256. method: 'post',
  257. data: params
  258. });
  259. }
  260. // 设备绑定
  261. function bindDevice({ headers, body }) {
  262. return request({
  263. url: '/api/Device/BindDevice',
  264. method: 'post',
  265. headers: headers,
  266. data: body
  267. });
  268. }
  269. // 设备绑定,只接收
  270. function bindDeviceSsjl({ headers, body }) {
  271. return request({
  272. url: '/api/Device/BindDeviceSsjl',
  273. method: 'post',
  274. headers: headers,
  275. data: body
  276. });
  277. }
  278. // 设备绑定结果
  279. function bindDeviceResult({ headers, body }) {
  280. return request({
  281. url: '/api/Device/BindDeviceResult',
  282. method: 'post',
  283. headers: headers,
  284. data: body
  285. });
  286. }
  287. // 上传录音文件
  288. function addVoiceMessage(params) {
  289. return request({
  290. url: '/voicemessage/voiceMessage/addVoiceMessage',
  291. method: 'post',
  292. data: params
  293. });
  294. }
  295. // 获取录音文件和文字留言分页
  296. function queryVoicePage({ gpsUserId, pageNum, pageSize }) {
  297. return request({
  298. url: '/voicemessage/voiceMessage/queryVoicePage',
  299. method: 'get',
  300. params: { gpsUserId, pageNum, pageSize }
  301. });
  302. }
  303. // 随手精灵(零川物联卡加油包套餐订购)
  304. function LckjCreateOrderPackage(params) {
  305. return request({
  306. url: 'api/IOTCard/LckjCreateOrderPackage',
  307. method: 'post',
  308. data: params
  309. });
  310. }
  311. // 随手精灵(查询零川物联卡加油包已订购套餐)
  312. function LckjGetOrderPackageShow({ iccid, imei }) {
  313. return request({
  314. url: '/api/IOTCard/LckjGetOrderPackageShow',
  315. method: 'get',
  316. params: { iccid, imei }
  317. });
  318. }
  319. function checkWxPayResult(params) {
  320. return request({
  321. url: `${baseUrl}`,
  322. method: 'post',
  323. data: params
  324. });
  325. }
  326. function updateDrownReportAiStatus(data) {
  327. return request({
  328. url: '/api/Device/UpdateDrownReportAiStatus',
  329. method: 'get',
  330. params: data
  331. });
  332. }
  333. function psychQuestionAutoCommit(data) {
  334. return request({
  335. url: '/api/Device/PsychQuestionAutoCommit',
  336. method: 'get',
  337. params: data
  338. });
  339. }