Przeglądaj źródła

add api/apiPayment.js

wudebin 6 miesięcy temu
rodzic
commit
143c1fd494

+ 13 - 0
Strides-SPAPP/app/api/apiPayment.js

@@ -0,0 +1,13 @@
+import { get, post } from "./http";
+
+const prefix = 'devicesApi/dawn/api/v1/';
+
+export default apiPayment = {
+  /**
+   * 获取按次付费的提醒内容
+   * @returns Promise
+   */
+  getPayPerUseAlter() {
+    return get(prefix + "pay-per-use-alert-content")
+  }
+}

+ 25 - 0
Strides-SPAPP/app/api/apiStation.js

@@ -0,0 +1,25 @@
+import { get, post } from "./http";
+
+const prefix = 'devicesApi/site/';
+const userPrefix = 'devicesApi/user/sites/';
+
+export default {
+  getAllStation: (params) => {
+    return get(prefix + 'listSite', params);
+  },
+  searchStation: (params) => {
+    return get(prefix + 'searchSite', params);
+  },
+  getStationRate: (params) => {
+    return get(prefix + 'getSiteRate', params);
+  },
+  getNearestSite: (params) => {
+    return get(prefix + 'getNearestSite', params);
+  },
+  getBookmarkList: (params) => {
+    return get(userPrefix + 'bookmarks', params);
+  },
+  bookmarkSite: (id) => {
+    return get(userPrefix + 'favorite', {sitePk: id});
+  }
+}

+ 46 - 0
Strides-SPAPP/app/api/apiUpload.js

@@ -0,0 +1,46 @@
+import { get, upload } from "./http";
+
+const prefix = 'devicesApi/picture/upload';
+const prefixObs = 'devicesApi/picture/obs-upload';
+
+export default {
+  /**
+   * 上传图片(已过时)
+   * @param {*} uri 图片地址
+   * @param {*} mime 图片类型
+   * @param {*} type 图片分类 ↓
+   * USER_PROFILE 用户头像
+   * FEEDBACK 用户反馈
+   * SERVICE_LOGO 服务提供商logo
+   * SITE 站点
+   * PDVL 驾驶证
+   * @returns 服务器路径
+   */
+  uploadImageOld(uri, mime, type) {
+    let data = new FormData();
+    data.append('file', {
+      uri: uri,
+      type: mime,
+      name: getFileName(uri)
+    });
+    return upload(prefix, data, {photoSubDir: type});
+  },
+  uploadImage(uri, mime, type="") {
+    let data = new FormData();
+    data.append('file', {
+      uri: uri,
+      type: mime,
+      name: getFileName(uri)
+    });
+    return upload(prefixObs, data, {photoSubDir: type});
+  },
+  testNotification() {
+    return get('devicesApi/googleNotification/doNotification');
+  }
+}
+
+const getFileName = (path) => {
+  var pos = path.lastIndexOf("/");
+  var name = path.substring(pos+1);
+  return name;
+}