@cpzxrobot/sdk 1.1.40 → 1.1.42

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.
@@ -43,17 +43,44 @@ export class CompanyGateway extends Object {
43
43
  }
44
44
  }
45
45
 
46
+ get enterprise() {
47
+ return {
48
+ userCount: async (companyId: number) => {
49
+ var axios = await this.context.ready;
50
+ return axios.get(`/api/v2/coremde-sale/company/enterprise/count/user`);
51
+ },
52
+ revenue: async () => {
53
+ var axios = await this.context.ready;
54
+ return axios.get(`/api/v2/coremde-sale/company/enterprise/revenue/get`);
55
+ }
56
+ }
57
+ }
58
+
46
59
  get revenue() {
47
60
  return {
48
61
  //按类型统计
49
62
  groupSummary: {
50
- byMonth: async (companyId: number, pageNo: number, pageSize: number) => {
63
+ byMonth: async (companyId: number, pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) => {
51
64
  var axios = await this.context.ready;
52
- return axios.get(`/api/v2/coremde-sale/company/revenue/month/list?pageNo=${pageNo}&pageSize=${pageSize}&companyId=${companyId}`);
65
+ var params = {
66
+ pageNo: pageNo,
67
+ pageSize: pageSize,
68
+ companyId: companyId
69
+ }
70
+ return axios.get(`/api/v2/coremde-sale/company/revenue/month/list`, {
71
+ params: params
72
+ });
53
73
  },
54
- byYear: async (companyId: number, pageNo: number, pageSize: number) => {
74
+ byYear: async (companyId: number, pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) => {
55
75
  var axios = await this.context.ready;
56
- return axios.get(`/api/v2/coremde-sale/company/revenue/year/list?pageNo=${pageNo}&pageSize=${pageSize}&companyId=${companyId}`);
76
+ var params = {
77
+ pageNo: pageNo,
78
+ pageSize: pageSize,
79
+ companyId: companyId
80
+ }
81
+ return axios.get(`/api/v2/coremde-sale/company/revenue/year/list`, {
82
+ params: params
83
+ });
57
84
  },
58
85
  },
59
86
  //最新情况统计,最近一个月,最近十天,最近一天
@@ -71,9 +98,16 @@ export class CompanyGateway extends Object {
71
98
  return axios.get(`/api/v2/coremde-sale/company/revenue/month/get?companyId=${companyId}`);
72
99
  },
73
100
  },
74
- list: async (companyId: number, pageNo: number, pageSize: number) => {
101
+ list: async (companyId: number, pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) => {
75
102
  var axios = await this.context.ready;
76
- return axios.get(`/api/v2/coremde-sale/company/revenue/list?pageNo=${pageNo}&pageSize=${pageSize}`);
103
+ var params = {
104
+ pageNo: pageNo,
105
+ pageSize: pageSize,
106
+ companyId: companyId
107
+ }
108
+ return axios.get(`/api/v2/coremde-sale/company/revenue/list`, {
109
+ params: params
110
+ });
77
111
  },
78
112
  enterprise: async () => {
79
113
  var axios = await this.context.ready;
@@ -39,17 +39,43 @@ class CompanyGateway extends Object {
39
39
  }
40
40
  };
41
41
  }
42
+ get enterprise() {
43
+ return {
44
+ userCount: async (companyId) => {
45
+ var axios = await this.context.ready;
46
+ return axios.get(`/api/v2/coremde-sale/company/enterprise/count/user`);
47
+ },
48
+ revenue: async () => {
49
+ var axios = await this.context.ready;
50
+ return axios.get(`/api/v2/coremde-sale/company/enterprise/revenue/get`);
51
+ }
52
+ };
53
+ }
42
54
  get revenue() {
43
55
  return {
44
56
  //按类型统计
45
57
  groupSummary: {
46
- byMonth: async (companyId, pageNo, pageSize) => {
58
+ byMonth: async (companyId, pageNo = undefined, pageSize = undefined) => {
47
59
  var axios = await this.context.ready;
48
- return axios.get(`/api/v2/coremde-sale/company/revenue/month/list?pageNo=${pageNo}&pageSize=${pageSize}&companyId=${companyId}`);
60
+ var params = {
61
+ pageNo: pageNo,
62
+ pageSize: pageSize,
63
+ companyId: companyId
64
+ };
65
+ return axios.get(`/api/v2/coremde-sale/company/revenue/month/list`, {
66
+ params: params
67
+ });
49
68
  },
50
- byYear: async (companyId, pageNo, pageSize) => {
69
+ byYear: async (companyId, pageNo = undefined, pageSize = undefined) => {
51
70
  var axios = await this.context.ready;
52
- return axios.get(`/api/v2/coremde-sale/company/revenue/year/list?pageNo=${pageNo}&pageSize=${pageSize}&companyId=${companyId}`);
71
+ var params = {
72
+ pageNo: pageNo,
73
+ pageSize: pageSize,
74
+ companyId: companyId
75
+ };
76
+ return axios.get(`/api/v2/coremde-sale/company/revenue/year/list`, {
77
+ params: params
78
+ });
53
79
  },
54
80
  },
55
81
  //最新情况统计,最近一个月,最近十天,最近一天
@@ -67,9 +93,16 @@ class CompanyGateway extends Object {
67
93
  return axios.get(`/api/v2/coremde-sale/company/revenue/month/get?companyId=${companyId}`);
68
94
  },
69
95
  },
70
- list: async (companyId, pageNo, pageSize) => {
96
+ list: async (companyId, pageNo = undefined, pageSize = undefined) => {
71
97
  var axios = await this.context.ready;
72
- return axios.get(`/api/v2/coremde-sale/company/revenue/list?pageNo=${pageNo}&pageSize=${pageSize}`);
98
+ var params = {
99
+ pageNo: pageNo,
100
+ pageSize: pageSize,
101
+ companyId: companyId
102
+ };
103
+ return axios.get(`/api/v2/coremde-sale/company/revenue/list`, {
104
+ params: params
105
+ });
73
106
  },
74
107
  enterprise: async () => {
75
108
  var axios = await this.context.ready;
package/dist/index.js CHANGED
@@ -127,6 +127,8 @@ class Cpzxrobot {
127
127
  // @ts-ignore
128
128
  this.vibrate = window.miniapp.vibrate;
129
129
  this.saveBlob = this._saveBlobAsBase64;
130
+ // @ts-ignore
131
+ this.getGeo = window.miniapp.getGeo;
130
132
  }
131
133
  else if (domain == "appassets.androidplatform.net" ||
132
134
  this.isIosMiniApp(window.location)) {
@@ -146,6 +148,16 @@ class Cpzxrobot {
146
148
  this.scanQrcode = function () {
147
149
  return platform.callHandler("app.scanQrcode");
148
150
  };
151
+ this.getGeo = function () {
152
+ var result = platform.callHandler("app.getGeo");
153
+ if (result.error) {
154
+ throw result.error;
155
+ }
156
+ return {
157
+ lat: result.lat,
158
+ lng: result.lng
159
+ };
160
+ };
149
161
  this.setTitle = function (title) {
150
162
  platform.callHandler("app.setTitle", title);
151
163
  };
@@ -77,12 +77,16 @@ class ProjectGateway extends Object {
77
77
  },
78
78
  };
79
79
  }
80
- get meterial() {
80
+ get material() {
81
81
  return {
82
82
  // 获取材料列表
83
- list: (args) => {
83
+ list: (pageNo = undefined, pageSize = undefined) => {
84
84
  return this.context.ready.then((axios) => {
85
- return axios.post(`/api/v2/coremde-sale/project/meterial/list`, args);
85
+ var params = {
86
+ pageNo,
87
+ pageSize
88
+ };
89
+ return axios.post(`/api/v2/coremde-sale/project/material/list`, params);
86
90
  });
87
91
  }
88
92
  };
package/index.ts CHANGED
@@ -46,6 +46,10 @@ export class Cpzxrobot {
46
46
  saveBlob!: (blob: Blob, filename: string) => void;
47
47
  scanQrcode!: () => Promise<string>;
48
48
  vibrate!: (time?: number) => void;
49
+ getGeo!: () => {
50
+ lat: number;
51
+ lng: number;
52
+ };
49
53
  assistant: AssistantGateway;
50
54
  energy: EnergyGateway;
51
55
  camera: CameraGateway;
@@ -58,6 +62,7 @@ export class Cpzxrobot {
58
62
  company: CompanyGateway = new CompanyGateway(this);
59
63
  news: NewsGateway = new NewsGateway(this);
60
64
 
65
+
61
66
  constructor(appCode: string) {
62
67
  //获取当前浏览器的域名
63
68
  this.ready = new Promise<MyAxiosInstance>((resolve, reject) => {
@@ -156,6 +161,8 @@ export class Cpzxrobot {
156
161
  // @ts-ignore
157
162
  this.vibrate = window.miniapp.vibrate;
158
163
  this.saveBlob = this._saveBlobAsBase64;
164
+ // @ts-ignore
165
+ this.getGeo = window.miniapp.getGeo;
159
166
  } else if (
160
167
  domain == "appassets.androidplatform.net" ||
161
168
  this.isIosMiniApp(window.location)
@@ -178,6 +185,16 @@ export class Cpzxrobot {
178
185
  this.scanQrcode = function () {
179
186
  return platform.callHandler("app.scanQrcode");
180
187
  }
188
+ this.getGeo = function () {
189
+ var result = platform.callHandler("app.getGeo");
190
+ if (result.error) {
191
+ throw result.error;
192
+ }
193
+ return {
194
+ lat: result.lat,
195
+ lng: result.lng
196
+ }
197
+ };
181
198
  this.setTitle = function (title: string) {
182
199
  platform.callHandler("app.setTitle", title);
183
200
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.40",
3
+ "version": "1.1.42",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -109,16 +109,16 @@ export class ProjectGateway extends Object {
109
109
  }
110
110
 
111
111
 
112
- get meterial() {
112
+ get material() {
113
113
  return {
114
114
  // 获取材料列表
115
- list: (args: {
116
- pageNo: number;
117
- pageSize: number;
118
- projectId: number;
119
- }) => {
115
+ list: (pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) => {
120
116
  return this.context.ready.then((axios) => {
121
- return axios.post(`/api/v2/coremde-sale/project/meterial/list`, args);
117
+ var params = {
118
+ pageNo,
119
+ pageSize
120
+ }
121
+ return axios.post(`/api/v2/coremde-sale/project/material/list`,params);
122
122
  });
123
123
  }
124
124
  }
package/readme.md CHANGED
@@ -197,7 +197,8 @@ baseURL: "/"
197
197
  | cpzxrobot().company.revenue.recentSummary.byDay | 按公司当日营收统计 |
198
198
  | cpzxrobot().company.revenue.recentSummary.byDecade | 按公司按旬营收统计 |
199
199
  | cpzxrobot().company.revenue.list | 获得公司营收列表,传入必要的分页参数 |
200
- | cpzxrobot().company.revenue.enterprise | 获得集团整体营收统计 |
200
+ | cpzxrobot().company.enterprise.revenue | 获得集团整体营收统计 |
201
+ | cpzxrobot().company.enterprise.userCount | 获得集团整体用户统计 |
201
202
  | cpzxrobot().car.stat.china | 获得车辆在全国的统计信息 |
202
203
  | cpzxrobot().car.listByProvince | 获得车辆在某个省的统计信息,传入province参数 |
203
204
  | cpzxrobot().car.listByCity | 获得车辆在某个市的统计信息,传入city参数 |
@@ -205,6 +206,7 @@ baseURL: "/"
205
206
  | cpzxrobot().news.list | 获得新闻列表,传入必要的分页参数 |
206
207
  | cpzxrobot().news.alarm.add | 添加报警信息 |
207
208
  | cpzxrobot().news.alarm.list | 获得报警列表,传入必要的分页参数 |
209
+ | cpzxrobot().getGeo | 获得地理位置信息 |
208
210
 
209
211
  ### 工厂信息接口
210
212