bxs-tools-ui 3.2.0 → 3.3.0

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.
Files changed (148) hide show
  1. package/README.md +20 -20
  2. package/es/add-and-take/index.css +1 -1
  3. package/es/add-and-take/index.js +283 -64
  4. package/es/adjust-baoe/index.css +1 -1
  5. package/es/adjust-baoe/index.js +444 -195
  6. package/es/business-card/index.css +1 -1
  7. package/es/business-card/index.js +1 -0
  8. package/es/canvas-poster/index.css +1 -1
  9. package/es/canvas-poster/index.js +1 -0
  10. package/es/index.css +1 -1
  11. package/es/index.js +936 -824
  12. package/es/insure-calculate/index.css +1 -1
  13. package/es/insure-calculate/index.js +438 -265
  14. package/es/person-info/index.css +1 -1
  15. package/es/person-info/index.js +296 -1370
  16. package/es/product-info/index.css +1 -1
  17. package/es/product-info/index.js +644 -548
  18. package/es/share-sheet/index.css +1 -1
  19. package/es/share-sheet/index.js +313 -21
  20. package/es/utils/index.js +530 -429
  21. package/lib/add-and-take/index.css +1 -1
  22. package/lib/add-and-take/index.js +283 -64
  23. package/lib/adjust-baoe/index.css +1 -1
  24. package/lib/adjust-baoe/index.js +441 -194
  25. package/lib/business-card/index.css +1 -1
  26. package/lib/business-card/index.js +1 -0
  27. package/lib/canvas-poster/index.css +1 -1
  28. package/lib/canvas-poster/index.js +1 -0
  29. package/lib/index.css +1 -1
  30. package/lib/index.js +939 -826
  31. package/lib/insure-calculate/index.css +1 -1
  32. package/lib/insure-calculate/index.js +438 -268
  33. package/lib/person-info/index.css +1 -1
  34. package/lib/person-info/index.js +295 -1372
  35. package/lib/product-info/index.css +1 -1
  36. package/lib/product-info/index.js +645 -550
  37. package/lib/share-sheet/index.css +1 -1
  38. package/lib/share-sheet/index.js +313 -25
  39. package/lib/utils/index.js +531 -433
  40. package/package.json +9 -7
  41. package/packages/add-and-take/components/interest-form.less +144 -0
  42. package/packages/add-and-take/components/interest-form.vue +179 -179
  43. package/packages/add-and-take/components/interest-items.less +87 -0
  44. package/packages/add-and-take/components/interest-items.vue +67 -80
  45. package/packages/add-and-take/components/interest-table.less +111 -0
  46. package/packages/add-and-take/components/interest-table.vue +31 -31
  47. package/packages/add-and-take/constant.ts +2 -2
  48. package/packages/add-and-take/demo/index.vue +89 -86
  49. package/packages/add-and-take/handler.ts +52 -57
  50. package/packages/add-and-take/index.less +69 -0
  51. package/packages/add-and-take/index.vue +156 -156
  52. package/packages/add-and-take/readme.md +87 -98
  53. package/packages/adjust-baoe/demo/index.vue +37 -47
  54. package/packages/adjust-baoe/index.less +125 -0
  55. package/packages/adjust-baoe/index.vue +134 -147
  56. package/packages/adjust-baoe/readme.md +35 -45
  57. package/packages/business-card/demo/index.vue +7 -7
  58. package/packages/business-card/index.less +100 -0
  59. package/packages/business-card/index.vue +18 -21
  60. package/packages/business-card/readme.md +46 -53
  61. package/packages/bxs-utils/demo/index.vue +2 -2
  62. package/packages/bxs-utils/index.ts +5 -5
  63. package/packages/bxs-utils/planbook/common.ts +56 -92
  64. package/packages/bxs-utils/planbook/index.ts +4 -4
  65. package/packages/bxs-utils/planbook/insurance.ts +137 -127
  66. package/packages/bxs-utils/planbook/person.ts +143 -147
  67. package/packages/bxs-utils/planbook/product.ts +473 -509
  68. package/packages/bxs-utils/readme.md +94 -84
  69. package/packages/bxs-utils/trade/index.js +1 -1
  70. package/packages/bxs-utils/trade/insureCalculate.js +91 -204
  71. package/packages/canvas-poster/demo/index.vue +9 -13
  72. package/packages/canvas-poster/index.less +5 -0
  73. package/packages/canvas-poster/index.vue +68 -79
  74. package/packages/canvas-poster/readme.md +106 -109
  75. package/packages/index.ts +1 -1
  76. package/packages/insure-calculate/demo/index.vue +20 -20
  77. package/packages/insure-calculate/index.less +366 -0
  78. package/packages/insure-calculate/index.vue +305 -329
  79. package/packages/insure-calculate/readme.md +99 -106
  80. package/packages/person-info/crm-popup.vue +81 -80
  81. package/packages/person-info/demo/index.vue +25 -37
  82. package/packages/person-info/index-inline.less +11 -0
  83. package/packages/person-info/index.vue +53 -83
  84. package/packages/person-info/readme.md +109 -115
  85. package/packages/planbook-input/components/footer.less +54 -0
  86. package/packages/planbook-input/components/footer.vue +8 -64
  87. package/packages/planbook-input/components/handler.js +33 -44
  88. package/packages/planbook-input/components/product-table.less +235 -0
  89. package/packages/planbook-input/components/product-table.vue +114 -108
  90. package/packages/planbook-input/demo/index.vue +3 -3
  91. package/packages/planbook-input/helper.js +852 -465
  92. package/packages/planbook-input/index.less +30 -0
  93. package/packages/planbook-input/index.vue +86 -103
  94. package/packages/planbook-input/readme.md +72 -90
  95. package/packages/product-info/demo/constant.js +1 -1
  96. package/packages/product-info/demo/index.vue +31 -43
  97. package/packages/product-info/index.less +271 -0
  98. package/packages/product-info/index.vue +198 -210
  99. package/packages/product-info/readme.md +72 -75
  100. package/packages/share-sheet/constant.js +4 -4
  101. package/packages/share-sheet/demo/index.vue +10 -10
  102. package/packages/share-sheet/handler.js +14 -14
  103. package/packages/share-sheet/index.less +201 -0
  104. package/packages/share-sheet/index.vue +39 -39
  105. package/packages/share-sheet/readme.md +121 -127
  106. package/src/api/add-and-take.js +45 -0
  107. package/src/api/adjust-baoe.js +16 -0
  108. package/src/api/index.js +6 -0
  109. package/src/api/planbook.js +93 -0
  110. package/src/api/request.js +211 -0
  111. package/src/api/trade.js +56 -0
  112. package/src/api/user.js +18 -0
  113. package/src/components/common/common-age-birthday.less +66 -0
  114. package/src/components/common/common-age-birthday.vue +27 -95
  115. package/src/components/common/common-popup.less +81 -0
  116. package/src/components/common/common-popup.vue +12 -96
  117. package/src/components/common/common-radio.less +75 -0
  118. package/src/components/common/common-radio.vue +13 -91
  119. package/src/components/common/common-select.less +13 -0
  120. package/src/components/common/common-select.vue +21 -38
  121. package/src/components/common/common-title.less +115 -0
  122. package/src/components/common/common-title.vue +24 -24
  123. package/src/js/loading.js +6 -6
  124. package/src/js/md5Token.js +38 -44
  125. package/src/js/utils.js +45 -53
  126. package/src/js/variables.js +47 -25
  127. package/src/style/base.less +18 -0
  128. package/src/style/color.less +40 -0
  129. package/src/style/variables.less +21 -42
  130. package/packages/add-and-take/api.ts +0 -70
  131. package/packages/add-and-take/components/interest-form.css +0 -146
  132. package/packages/add-and-take/components/interest-items.css +0 -87
  133. package/packages/add-and-take/components/interest-table.css +0 -113
  134. package/packages/add-and-take/index.css +0 -70
  135. package/packages/adjust-baoe/index.css +0 -123
  136. package/packages/business-card/index.css +0 -101
  137. package/packages/canvas-poster/index.css +0 -5
  138. package/packages/insure-calculate/index.css +0 -368
  139. package/packages/planbook-input/api.js +0 -29
  140. package/packages/planbook-input/components/product-table.css +0 -236
  141. package/packages/planbook-input/index.css +0 -31
  142. package/packages/product-info/index.css +0 -264
  143. package/packages/share-sheet/index.css +0 -203
  144. package/src/components/common/common-title.css +0 -116
  145. package/src/js/request.js +0 -64
  146. package/src/style/apply.css +0 -25
  147. package/src/style/base.css +0 -36
  148. package/src/style/color.css +0 -74
@@ -7,62 +7,7 @@
7
7
  * @return {*} 试算结果
8
8
  */
9
9
 
10
- import fetch from '@src/js/request.js';
11
- import { IS_PRODUCT_ENV } from '@src/js/variables.js';
12
- const baseURL = `https://insurance2a-api.wyins.net${IS_PRODUCT_ENV ? '' : '.cn'}`;
13
-
14
- /**
15
- * **获取地址信息**
16
- * @ignore
17
- * @author watson
18
- * @date 2022-04-26
19
- * @param {string} fetchUrl api url
20
- * @param {object} data 接口传参
21
- * @returns {object} addressData
22
- */
23
- export function getAddress(fetchUrl, data) {
24
- return new Promise((resolve, reject) => {
25
- fetch({
26
- baseURL: fetchUrl,
27
- url: undefined,
28
- method: 'POST',
29
- urlParams: undefined,
30
- data
31
- })
32
- .then(res => {
33
- resolve(res);
34
- })
35
- .catch(err => {
36
- reject(err);
37
- });
38
- });
39
- }
40
-
41
- /**
42
- * **获取用户信息**
43
- * @ignore
44
- * @author watson
45
- * @date 2022-04-26
46
- * @param {string} fetchUrl api url
47
- * @returns {promise}
48
- */
49
- export function getUuid(fetchUrl) {
50
- return new Promise((resolve, reject) => {
51
- fetch({
52
- baseURL: fetchUrl,
53
- url: undefined,
54
- method: 'GET',
55
- urlParams: undefined,
56
- data: null
57
- })
58
- .then(res => {
59
- resolve(res);
60
- })
61
- .catch(err => {
62
- reject(err);
63
- });
64
- });
65
- }
10
+ import { postProductDataCalculate } from '../../../src/api/trade.js'
66
11
 
67
12
  /**
68
13
  * **计划书初始化参数**
@@ -78,14 +23,14 @@ export function getUuid(fetchUrl) {
78
23
  * @returns {boolean} 是否有计划书参数
79
24
  */
80
25
  export function hasPlanParams(planParams) {
81
- let type = false;
26
+ let type = false
82
27
  if (
83
28
  planParams &&
84
29
  (planParams.detail_age || planParams.detail_sex || planParams.detail_relation || planParams.detail_applicant_age || planParams.detail_applicant_sex)
85
30
  ) {
86
- type = true;
31
+ type = true
87
32
  }
88
- return type;
33
+ return type
89
34
  }
90
35
 
91
36
  /**
@@ -100,38 +45,38 @@ export function hasPlanParams(planParams) {
100
45
  */
101
46
  function translatePlanData(widgets, currentData, planParams) {
102
47
  widgets.forEach(item => {
103
- let current;
48
+ let current
104
49
  // 增加current字段,保存current_data的数据
105
50
  if (item.duty) {
106
- current = currentData.find(it => it.k === item.key && it.risk === item.riskCode && item.duty === it.d);
51
+ current = currentData.find(it => it.k === item.key && it.risk === item.riskCode && item.duty === it.d)
107
52
  } else {
108
- current = currentData.find(it => it.k === item.key && it.risk === item.riskCode);
53
+ current = currentData.find(it => it.k === item.key && it.risk === item.riskCode)
109
54
  }
110
55
  if (planParams) {
111
56
  // 被保人生日 / 年龄
112
57
  if (planParams.detail_age && item.key === 'detail_age') {
113
58
  if (/-/.test(planParams.detail_age)) {
114
59
  // 被保人生日
115
- item.type = 'v-text';
116
- item.name = planParams.detail_age;
117
- current.v = planParams.detail_age;
60
+ item.type = 'v-text'
61
+ item.name = planParams.detail_age
62
+ current.v = planParams.detail_age
118
63
  } else if (/岁/.test(planParams.detail_age)) {
119
64
  // 被保人年龄
120
- item.type = 'v-text';
121
- item.name = planParams.detail_age;
122
- item.label = item.label + '(年龄)';
65
+ item.type = 'v-text'
66
+ item.name = planParams.detail_age
67
+ item.label = item.label + '(年龄)'
123
68
  current.v =
124
69
  planParams.detail_age
125
70
  .replace('周', '')
126
71
  .replace('岁', '')
127
- .replace('Y', '') + 'Y';
72
+ .replace('Y', '') + 'Y'
128
73
  }
129
74
  }
130
75
  // 被保人性别
131
76
  if (planParams.detail_sex && item.key === 'detail_sex') {
132
- item.type = 'v-text';
133
- item.name = planParams.detail_sex === '1' ? '男' : '女';
134
- current.v = planParams.detail_sex;
77
+ item.type = 'v-text'
78
+ item.name = planParams.detail_sex === '1' ? '男' : '女'
79
+ current.v = planParams.detail_sex
135
80
  }
136
81
  // 投被保人关系
137
82
  // 初始化
@@ -169,55 +114,55 @@ function translatePlanData(widgets, currentData, planParams) {
169
114
  // 条件检索
170
115
  if (planParams.detail_relation === '-1' || planParams.detail_relation === -1) {
171
116
  // 非本人
172
- const temp = [];
117
+ const temp = []
173
118
  item.opts[item.key].forEach(i => {
174
119
  if (String(i.value) != '1') {
175
- temp.push(i);
120
+ temp.push(i)
176
121
  }
177
- });
178
- item.name = temp[0] && temp[0].name ? temp[0].name : '';
179
- item.opts[item.key] = temp;
122
+ })
123
+ item.name = temp[0] && temp[0].name ? temp[0].name : ''
124
+ item.opts[item.key] = temp
180
125
  } else if (planParams.detail_relation) {
181
126
  // 指定人 - 本人 其他人
182
- item.type = 'v-text';
183
- current.v = planParams.detail_relation;
184
- const temp = [];
127
+ item.type = 'v-text'
128
+ current.v = planParams.detail_relation
129
+ const temp = []
185
130
  item.opts[item.key].forEach(i => {
186
131
  if (String(i.value) === String(planParams.detail_relation)) {
187
- temp.push(i);
188
- item.name = i.name;
132
+ temp.push(i)
133
+ item.name = i.name
189
134
  }
190
- });
191
- item.opts[item.key] = temp;
135
+ })
136
+ item.opts[item.key] = temp
192
137
  }
193
138
  }
194
139
  // 投保人出生日期
195
140
  if (planParams.detail_applicant_age && item.key === 'detail_applicant_age') {
196
141
  if (/-/.test(planParams.detail_applicant_age)) {
197
142
  // 被保人生日
198
- item.type = 'v-text';
199
- item.name = planParams.detail_applicant_age;
200
- current.v = planParams.detail_applicant_age;
143
+ item.type = 'v-text'
144
+ item.name = planParams.detail_applicant_age
145
+ current.v = planParams.detail_applicant_age
201
146
  } else if (/岁/.test(planParams.detail_applicant_age)) {
202
147
  // 被保人年龄
203
- item.type = 'v-text';
204
- item.name = planParams.detail_applicant_age;
205
- item.label = item.label + '(年龄)';
148
+ item.type = 'v-text'
149
+ item.name = planParams.detail_applicant_age
150
+ item.label = item.label + '(年龄)'
206
151
  current.v =
207
152
  planParams.detail_applicant_age
208
153
  .replace('周', '')
209
154
  .replace('岁', '')
210
- .replace('Y', '') + 'Y';
155
+ .replace('Y', '') + 'Y'
211
156
  }
212
157
  }
213
158
  // 投保人性别
214
159
  if (planParams.detail_applicant_sex && item.key === 'detail_applicant_sex') {
215
- item.type = 'v-text';
216
- item.name = planParams.detail_applicant_sex === '1' ? '男' : '女';
217
- current.v = planParams.detail_applicant_sex;
160
+ item.type = 'v-text'
161
+ item.name = planParams.detail_applicant_sex === '1' ? '男' : '女'
162
+ current.v = planParams.detail_applicant_sex
218
163
  }
219
164
  }
220
- });
165
+ })
221
166
  }
222
167
 
223
168
  /**
@@ -230,54 +175,54 @@ function translatePlanData(widgets, currentData, planParams) {
230
175
  * @returns {object}
231
176
  */
232
177
  function tranlateCurrentData(currentData, planParams) {
233
- const currentDataCopy = JSON.parse(JSON.stringify(currentData));
178
+ const currentDataCopy = JSON.parse(JSON.stringify(currentData))
234
179
  currentDataCopy.forEach(item => {
235
- const current = item;
180
+ const current = item
236
181
  if (planParams) {
237
182
  if (planParams.detail_age && item.k === 'detail_age') {
238
183
  if (/-/.test(planParams.detail_age)) {
239
184
  // 被保人生日
240
- current.v = planParams.detail_age;
185
+ current.v = planParams.detail_age
241
186
  } else if (/岁/.test(planParams.detail_age)) {
242
187
  // 被保人年龄
243
188
  current.v =
244
189
  planParams.detail_age
245
190
  .replace('周', '')
246
191
  .replace('岁', '')
247
- .replace('Y', '') + 'Y';
192
+ .replace('Y', '') + 'Y'
248
193
  }
249
194
  }
250
195
  // 被保人性别
251
196
  if (planParams.detail_sex && item.k === 'detail_sex') {
252
- current.v = planParams.detail_sex;
197
+ current.v = planParams.detail_sex
253
198
  }
254
199
  // 投被保人关系
255
200
  if (planParams.detail_relation && item.k === 'detail_relation') {
256
201
  if (planParams.detail_relation != -1 || planParams.detail_relation != '-1') {
257
- current.v = planParams.detail_relation;
202
+ current.v = planParams.detail_relation
258
203
  }
259
204
  }
260
205
  // 投保人出生日期
261
206
  if (planParams.detail_applicant_age && item.k === 'detail_applicant_age') {
262
207
  if (/-/.test(planParams.detail_applicant_age)) {
263
208
  // 被保人生日
264
- current.v = planParams.detail_applicant_age;
209
+ current.v = planParams.detail_applicant_age
265
210
  } else if (/岁/.test(planParams.detail_applicant_age)) {
266
211
  // 被保人年龄
267
212
  current.v =
268
213
  planParams.detail_applicant_age
269
214
  .replace('周', '')
270
215
  .replace('岁', '')
271
- .replace('Y', '') + 'Y';
216
+ .replace('Y', '') + 'Y'
272
217
  }
273
218
  }
274
219
  // 投保人性别
275
220
  if (planParams.detail_applicant_sex && item.k === 'detail_applicant_sex') {
276
- current.v = planParams.detail_applicant_sex;
221
+ current.v = planParams.detail_applicant_sex
277
222
  }
278
223
  }
279
- });
280
- return currentDataCopy;
224
+ })
225
+ return currentDataCopy
281
226
  }
282
227
 
283
228
  /**
@@ -291,60 +236,34 @@ function tranlateCurrentData(currentData, planParams) {
291
236
  */
292
237
  export function insureCalculate(urlParams, postParams, planParams) {
293
238
  if (!postParams || typeof postParams !== 'object' || !postParams.product_id) {
294
- return postParams;
239
+ return postParams
295
240
  }
296
241
  if (postParams && !postParams.scenario) {
297
- postParams.scenario = 'h5Widget';
298
- }
299
- let url = '/api/product/data/calculate';
300
- if (urlParams && urlParams.uuid) {
301
- url += `?userUuid=${urlParams.uuid}`;
302
- } else if (urlParams && urlParams.openId) {
303
- url += `?userUuid=${urlParams.openId}`;
304
- }
305
- if (urlParams && urlParams.appid) {
306
- if (url.indexOf('?') > -1) {
307
- url += `&appId=${urlParams.appid}`;
308
- } else {
309
- url += `?appId=${urlParams.appid}`;
310
- }
242
+ postParams.scenario = 'h5Widget'
311
243
  }
312
244
  if (hasPlanParams(planParams) && postParams.current_data) {
313
- postParams.current_data = tranlateCurrentData(postParams.current_data, planParams);
245
+ postParams.current_data = tranlateCurrentData(postParams.current_data, planParams)
314
246
  }
315
- return new Promise((resolve, reject) => {
316
- fetch({
317
- baseURL,
318
- url,
319
- method: 'POST',
320
- urlParams,
321
- data: postParams
322
- })
323
- .then(res => {
324
- if (res.code === 200) {
325
- let data = JSON.parse(JSON.stringify(res.data));
326
- if (hasPlanParams(planParams)) {
327
- const widgets = data.widgets;
328
- const currentData = data.current_data;
329
- translatePlanData(widgets, currentData, planParams);
330
- }
331
- const cData = {
332
- widgets: data.widgets,
333
- total_premium: data.total_premium,
334
- terms: data.terms,
335
- product_id: data.product_id,
336
- current_data: data.current_data,
337
- risk_premiums: data.risk_premiums
338
- };
339
- resolve({ code: 200, data: cData });
340
- } else {
341
- reject(res);
342
- }
343
- })
344
- .catch(err => {
345
- reject(err);
346
- });
347
- });
247
+ return postProductDataCalculate(urlParams, postParams).then(res => {
248
+ if (res.code === 200) {
249
+ let data = JSON.parse(JSON.stringify(res.data))
250
+ if (hasPlanParams(planParams)) {
251
+ const widgets = data.widgets
252
+ const currentData = data.current_data
253
+ translatePlanData(widgets, currentData, planParams)
254
+ }
255
+ const cData = {
256
+ widgets: data.widgets,
257
+ total_premium: data.total_premium,
258
+ terms: data.terms,
259
+ product_id: data.product_id,
260
+ current_data: data.current_data,
261
+ risk_premiums: data.risk_premiums
262
+ }
263
+ return { code: 200, data: cData }
264
+ }
265
+ return Promise.reject(res)
266
+ })
348
267
  }
349
268
 
350
269
  /**
@@ -357,22 +276,22 @@ export function insureCalculate(urlParams, postParams, planParams) {
357
276
  * @returns {promise} 试算结果
358
277
  */
359
278
  export async function checkInsureCalculate(urlParams, postParams, planParams) {
360
- let res;
361
- res = await checkInsureCalculateIn(urlParams, postParams, planParams);
279
+ let res
280
+ res = await checkInsureCalculateIn(urlParams, postParams, planParams)
362
281
  if (postParams && !postParams.current_data) {
363
- let data = JSON.parse(JSON.stringify(res.data));
364
- postParams.current_data = data.current_data;
282
+ let data = JSON.parse(JSON.stringify(res.data))
283
+ postParams.current_data = data.current_data
365
284
  // 重新试算
366
285
  try {
367
- res = await checkInsureCalculateIn(urlParams, postParams, planParams);
286
+ res = await checkInsureCalculateIn(urlParams, postParams, planParams)
368
287
  } catch (error) {
369
- res = error;
288
+ res = error
370
289
  }
371
290
  }
372
291
  if (res && res.code === 200) {
373
- return res;
292
+ return res
374
293
  } else {
375
- return Promise.reject(res);
294
+ return Promise.reject(res)
376
295
  }
377
296
  }
378
297
 
@@ -388,50 +307,18 @@ export async function checkInsureCalculate(urlParams, postParams, planParams) {
388
307
  */
389
308
  export function checkInsureCalculateIn(urlParams, postParams, planParams) {
390
309
  if (!postParams || typeof postParams !== 'object' || !postParams.product_id) {
391
- return Promise.reject({ code: 400, msg: 'postParams参数非法' });
310
+ return Promise.reject({ code: 400, msg: 'postParams参数非法' })
392
311
  }
393
312
  if (postParams && !postParams.scenario) {
394
- postParams.scenario = 'h5Widget';
395
- }
396
- let url = '/api/product/data/calculate';
397
- if (urlParams && urlParams.uuid) {
398
- url += `?userUuid=${urlParams.uuid}`;
399
- } else if (urlParams && urlParams.openId) {
400
- url += `?userUuid=${urlParams.openId}`;
401
- }
402
- if (urlParams && urlParams.appid) {
403
- if (url.indexOf('?') > -1) {
404
- url += `&appId=${urlParams.appid}`;
405
- } else {
406
- url += `?appId=${urlParams.appid}`;
407
- }
313
+ postParams.scenario = 'h5Widget'
408
314
  }
409
315
  if (hasPlanParams(planParams) && postParams.current_data) {
410
- postParams.current_data = tranlateCurrentData(postParams.current_data, planParams);
316
+ postParams.current_data = tranlateCurrentData(postParams.current_data, planParams)
411
317
  }
412
- return new Promise((resolve, reject) => {
413
- fetch({
414
- baseURL,
415
- url,
416
- method: 'POST',
417
- urlParams,
418
- data: postParams
419
- })
420
- .then(res => {
421
- if (res.code === 200) {
422
- // if (postParams && !postParams.current_data) {
423
- // let data = JSON.parse(JSON.stringify(res.data));
424
- // postParams.current_data = data.current_data
425
- // // 重新试算
426
- // checkInsureCalculate(urlParams, postParams, planParams)
427
- // }
428
- resolve({ code: 200, data: res.data });
429
- } else {
430
- reject(res);
431
- }
432
- })
433
- .catch(err => {
434
- reject(err);
435
- });
436
- });
318
+ return postProductDataCalculate(urlParams, postParams).then(res => {
319
+ if (res.code === 200) {
320
+ return { code: 200, data: res.data }
321
+ }
322
+ return Promise.reject(res)
323
+ })
437
324
  }
@@ -12,9 +12,9 @@
12
12
  </div>
13
13
  </template>
14
14
  <script lang="ts">
15
- import Vue from 'vue';
16
- import { Component } from 'vue-property-decorator';
17
- import CanvasPoster from '../index.vue';
15
+ import Vue from 'vue'
16
+ import { Component } from 'vue-property-decorator'
17
+ import CanvasPoster from '../index.vue'
18
18
 
19
19
  @Component({
20
20
  components: {
@@ -22,20 +22,18 @@ import CanvasPoster from '../index.vue';
22
22
  }
23
23
  })
24
24
  export default class CanvasPosterDemo extends Vue {
25
- window: any = window;
25
+ window: any = window
26
26
  posterData: any[] = [
27
27
  {
28
28
  type: 'image',
29
- url:
30
- 'https://media.winbaoxian.com/autoUpload/planbook/712d0f9ecd593a33029b5ea1b6ab419f2e014e5029e1a-MTGQfr_fw658_7f99c5bc34a5ef5.jpeg',
29
+ url: 'https://media.winbaoxian.com/autoUpload/planbook/712d0f9ecd593a33029b5ea1b6ab419f2e014e5029e1a-MTGQfr_fw658_7f99c5bc34a5ef5.jpeg',
31
30
  crossOrigin: 'anonymous',
32
31
  width: window.innerWidth,
33
32
  height: window.innerHeight
34
33
  },
35
34
  {
36
35
  type: 'image',
37
- url:
38
- 'https://media.winbaoxian.com/autoUpload/planbook/712d0f9ecd593a33029b5ea1b6ab419f2e014e5029e1a-MTGQfr_fw658_7f99c5bc34a5ef5.jpeg',
36
+ url: 'https://media.winbaoxian.com/autoUpload/planbook/712d0f9ecd593a33029b5ea1b6ab419f2e014e5029e1a-MTGQfr_fw658_7f99c5bc34a5ef5.jpeg',
39
37
  crossOrigin: 'anonymous',
40
38
  point: [200, 250],
41
39
  width: 100,
@@ -44,8 +42,7 @@ export default class CanvasPosterDemo extends Vue {
44
42
  },
45
43
  {
46
44
  type: 'image',
47
- url:
48
- 'https://media.winbaoxian.com/autoUpload/planbook/712d0f9ecd593a33029b5ea1b6ab419f2e014e5029e1a-MTGQfr_fw658_7f99c5bc34a5ef5.jpeg',
45
+ url: 'https://media.winbaoxian.com/autoUpload/planbook/712d0f9ecd593a33029b5ea1b6ab419f2e014e5029e1a-MTGQfr_fw658_7f99c5bc34a5ef5.jpeg',
49
46
  crossOrigin: 'anonymous',
50
47
  point: [250, 300],
51
48
  width: 100,
@@ -59,8 +56,7 @@ export default class CanvasPosterDemo extends Vue {
59
56
  },
60
57
  {
61
58
  type: 'text',
62
- tx:
63
- '文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行',
59
+ tx: '文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行文本自动换行',
64
60
  color: '#fff',
65
61
  fontWeight: 'bold',
66
62
  fontSize: 18,
@@ -95,7 +91,7 @@ export default class CanvasPosterDemo extends Vue {
95
91
  height: 100,
96
92
  radius: 5
97
93
  }
98
- ];
94
+ ]
99
95
  created() {}
100
96
  }
101
97
  </script>
@@ -0,0 +1,5 @@
1
+ .bxt-canvas-poster {
2
+ & .bxt-canvas {
3
+ display: block;
4
+ }
5
+ }