@cpzxrobot/sdk 1.2.14 → 1.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,6 +25,19 @@ export class ContractGateway extends Object {
25
25
  });
26
26
  }
27
27
 
28
+
29
+ addForProject(args: any) {
30
+ return this.context.ready.then((axios) => {
31
+ return axios.post(`/api/v2/coremde-sale/contract/project/add`, args);
32
+ });
33
+ }
34
+
35
+ addForProduct(args: any) {
36
+ return this.context.ready.then((axios) => {
37
+ return axios.post(`/api/v2/coremde-sale/contract/product/add`, args);
38
+ });
39
+ }
40
+
28
41
  add(args: any) {
29
42
  return this.context.ready.then((axios) => {
30
43
  return axios.post(`/api/v2/coremde-sale/contract/add`, args);
@@ -16,6 +16,16 @@ class ContractGateway extends Object {
16
16
  return axios.get(`/api/v2/coremde-sale/contract/get?id=${id}`);
17
17
  });
18
18
  }
19
+ addForProject(args) {
20
+ return this.context.ready.then((axios) => {
21
+ return axios.post(`/api/v2/coremde-sale/contract/project/add`, args);
22
+ });
23
+ }
24
+ addForProduct(args) {
25
+ return this.context.ready.then((axios) => {
26
+ return axios.post(`/api/v2/coremde-sale/contract/product/add`, args);
27
+ });
28
+ }
19
29
  add(args) {
20
30
  return this.context.ready.then((axios) => {
21
31
  return axios.post(`/api/v2/coremde-sale/contract/add`, args);
package/dist/index.js CHANGED
@@ -164,6 +164,14 @@ class Cpzxrobot {
164
164
  this.saveBlob = this._saveBlobAsBase64;
165
165
  // @ts-ignore
166
166
  this.getGeo = window.miniapp.getGeo;
167
+ // @ts-ignore
168
+ this.setResult = window.miniapp.setResult;
169
+ // @ts-ignore
170
+ this.setResultAs = window.miniapp.setResultAs;
171
+ // @ts-ignore
172
+ this.setError = window.miniapp.setError;
173
+ // @ts-ignore
174
+ this.setProgress = window.miniapp.setProgress;
167
175
  }
168
176
  else if (domain == "appassets.androidplatform.net" ||
169
177
  this.isIosMiniApp(window.location)) {
@@ -206,6 +214,18 @@ class Cpzxrobot {
206
214
  this.reloadGroup = function (group) {
207
215
  return platform.callHandler("app.reloadGroup", group);
208
216
  };
217
+ this.setResult = function (name, value) {
218
+ return platform.callHandler("app.setResult", name, value);
219
+ };
220
+ this.setResultAs = function (name, value, type) {
221
+ return platform.callHandler("app.setResultAs", name, value, type);
222
+ };
223
+ this.setError = function (message) {
224
+ return platform.callHandler("app.setError", message);
225
+ };
226
+ this.setProgress = function (precentage) {
227
+ return platform.callHandler("app.setProgress", precentage);
228
+ };
209
229
  this.axios = {
210
230
  get: function (url, data) {
211
231
  return platform.callHandler("axios_get", url, data);
package/index.ts CHANGED
@@ -53,6 +53,10 @@ export class Cpzxrobot {
53
53
  lat: number;
54
54
  lng: number;
55
55
  }>;
56
+ setResult!: (name: string, value: any) => void;
57
+ setResultAs!: (name: string, value: any, type: string) => void;
58
+ setError!: (message: string) => void;
59
+ setProgress!: (precentage: number) => void;
56
60
  assistant: AssistantGateway;
57
61
  energy: EnergyGateway;
58
62
  camera: CameraGateway;
@@ -201,6 +205,14 @@ export class Cpzxrobot {
201
205
  this.saveBlob = this._saveBlobAsBase64;
202
206
  // @ts-ignore
203
207
  this.getGeo = window.miniapp.getGeo;
208
+ // @ts-ignore
209
+ this.setResult = window.miniapp.setResult;
210
+ // @ts-ignore
211
+ this.setResultAs = window.miniapp.setResultAs;
212
+ // @ts-ignore
213
+ this.setError = window.miniapp.setError;
214
+ // @ts-ignore
215
+ this.setProgress = window.miniapp.setProgress;
204
216
  } else if (
205
217
  domain == "appassets.androidplatform.net" ||
206
218
  this.isIosMiniApp(window.location)
@@ -246,6 +258,18 @@ export class Cpzxrobot {
246
258
  this.reloadGroup = function (group: string) {
247
259
  return platform.callHandler("app.reloadGroup", group);
248
260
  };
261
+ this.setResult = function (name: string, value: any) {
262
+ return platform.callHandler("app.setResult", name, value);
263
+ };
264
+ this.setResultAs = function (name: string, value: any, type: string) {
265
+ return platform.callHandler("app.setResultAs", name, value, type);
266
+ };
267
+ this.setError = function (message: string) {
268
+ return platform.callHandler("app.setError", message);
269
+ };
270
+ this.setProgress = function (precentage: number) {
271
+ return platform.callHandler("app.setProgress", precentage);
272
+ };
249
273
  this.axios = {
250
274
  get: function (url, data) {
251
275
  return platform.callHandler("axios_get", url, data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.14",
3
+ "version": "1.2.16",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {