dolphin-weex-bc 0.0.30 → 0.0.33
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.
- package/CHANGELOG.md +15 -0
- package/dist/index.native.js +89 -36
- package/dist/index.native.js.map +1 -1
- package/dist/index.web.js +89 -36
- package/dist/index.web.js.map +1 -1
- package/package.json +1 -1
- package/packages/material-event/index.js +80 -14
package/dist/index.web.js
CHANGED
|
@@ -3399,6 +3399,8 @@ var MaterialEvent = {
|
|
|
3399
3399
|
|
|
3400
3400
|
productCodeList: [], //存储的商品code
|
|
3401
3401
|
|
|
3402
|
+
insufficientArr: [], //不足的耗材
|
|
3403
|
+
|
|
3402
3404
|
sort: 'hierarchical',
|
|
3403
3405
|
|
|
3404
3406
|
//批量查询耗材的情况
|
|
@@ -3416,8 +3418,9 @@ var MaterialEvent = {
|
|
|
3416
3418
|
_this6.needBackground = options.needBackground;
|
|
3417
3419
|
_this6.needOptimize = options.needOptimize;
|
|
3418
3420
|
_this6.deviceMaterialList = [];
|
|
3421
|
+
_this6.insufficientArr = [];
|
|
3419
3422
|
_this6.sort = options.sort;
|
|
3420
|
-
isColmo = params.appId == 12017;
|
|
3423
|
+
if (!isColmo) isColmo = params.appId == 12017;
|
|
3421
3424
|
return _context2.abrupt('return', new Promise(function () {
|
|
3422
3425
|
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(resolve, reject) {
|
|
3423
3426
|
var homeGroupId, deviceList;
|
|
@@ -3467,7 +3470,7 @@ var MaterialEvent = {
|
|
|
3467
3470
|
};
|
|
3468
3471
|
}()));
|
|
3469
3472
|
|
|
3470
|
-
case
|
|
3473
|
+
case 9:
|
|
3471
3474
|
case 'end':
|
|
3472
3475
|
return _context2.stop();
|
|
3473
3476
|
}
|
|
@@ -3489,7 +3492,7 @@ var MaterialEvent = {
|
|
|
3489
3492
|
_this7.needBackground = options.needBackground;
|
|
3490
3493
|
_this7.deviceMaterialList = [];
|
|
3491
3494
|
_this7.sort = options.sort;
|
|
3492
|
-
isColmo = params.appId == 12017;
|
|
3495
|
+
if (!isColmo) isColmo = params.appId == 12017;
|
|
3493
3496
|
return _context4.abrupt('return', new Promise(function () {
|
|
3494
3497
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(resolve, reject) {
|
|
3495
3498
|
var deviceList, res;
|
|
@@ -4045,6 +4048,7 @@ var MaterialEvent = {
|
|
|
4045
4048
|
var it = _step.value;
|
|
4046
4049
|
|
|
4047
4050
|
console.log('consumables===it:1' + JSON.stringify(it));
|
|
4051
|
+
if (it.model === 'null' || it.model === '/') it.model = ''; //兜底某些数据返回异常字符串
|
|
4048
4052
|
if (isColmo) {
|
|
4049
4053
|
it.chartData = _this15.setChartDataColmo(it);
|
|
4050
4054
|
continue;
|
|
@@ -4098,7 +4102,7 @@ var MaterialEvent = {
|
|
|
4098
4102
|
break;
|
|
4099
4103
|
}
|
|
4100
4104
|
|
|
4101
|
-
return _context13.abrupt('return', _this15.
|
|
4105
|
+
return _context13.abrupt('return', _this15.handleMaterialSeviceTypeColmo());
|
|
4102
4106
|
|
|
4103
4107
|
case 5:
|
|
4104
4108
|
|
|
@@ -4127,7 +4131,8 @@ var MaterialEvent = {
|
|
|
4127
4131
|
var _this16 = this;
|
|
4128
4132
|
|
|
4129
4133
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14() {
|
|
4130
|
-
var codeList, skuinfolist, groupNum, index,
|
|
4134
|
+
var codeList, skuinfolist, groupNum, index, resSuccessMap, _resSuccessMap;
|
|
4135
|
+
|
|
4131
4136
|
return regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
4132
4137
|
while (1) {
|
|
4133
4138
|
switch (_context14.prev = _context14.next) {
|
|
@@ -4145,6 +4150,21 @@ var MaterialEvent = {
|
|
|
4145
4150
|
|
|
4146
4151
|
case 4:
|
|
4147
4152
|
skuinfolist = [];
|
|
4153
|
+
// if (codeList && codeList.length > 20) {
|
|
4154
|
+
// let groupNum = Math.ceil(codeList.length / 20)
|
|
4155
|
+
// for (let index = 0; index < groupNum; index++) {
|
|
4156
|
+
// try {
|
|
4157
|
+
// const shopList = await this.getUpkeepShopInfo(codeList.slice(index * 20, (index + 1) * 20))
|
|
4158
|
+
// skuinfolist = skuinfolist.concat(shopList)
|
|
4159
|
+
// } catch (error) {
|
|
4160
|
+
// continue
|
|
4161
|
+
// }
|
|
4162
|
+
// }
|
|
4163
|
+
// } else {
|
|
4164
|
+
// try {
|
|
4165
|
+
// skuinfolist = await this.getUpkeepShopInfo(codeList)
|
|
4166
|
+
// } catch (error) {}
|
|
4167
|
+
// }
|
|
4148
4168
|
|
|
4149
4169
|
if (!(codeList && codeList.length > 20)) {
|
|
4150
4170
|
_context14.next = 24;
|
|
@@ -4162,12 +4182,12 @@ var MaterialEvent = {
|
|
|
4162
4182
|
|
|
4163
4183
|
_context14.prev = 9;
|
|
4164
4184
|
_context14.next = 12;
|
|
4165
|
-
return _this16.
|
|
4185
|
+
return _this16.querySkuIdByItemCodes(codeList.slice(index * 20, (index + 1) * 20));
|
|
4166
4186
|
|
|
4167
4187
|
case 12:
|
|
4168
|
-
|
|
4188
|
+
resSuccessMap = _context14.sent;
|
|
4169
4189
|
|
|
4170
|
-
skuinfolist
|
|
4190
|
+
_this16.handleSkuinfolist(skuinfolist, resSuccessMap, codeList);
|
|
4171
4191
|
_context14.next = 19;
|
|
4172
4192
|
break;
|
|
4173
4193
|
|
|
@@ -4182,60 +4202,72 @@ var MaterialEvent = {
|
|
|
4182
4202
|
break;
|
|
4183
4203
|
|
|
4184
4204
|
case 22:
|
|
4185
|
-
_context14.next =
|
|
4205
|
+
_context14.next = 33;
|
|
4186
4206
|
break;
|
|
4187
4207
|
|
|
4188
4208
|
case 24:
|
|
4189
4209
|
_context14.prev = 24;
|
|
4190
4210
|
_context14.next = 27;
|
|
4191
|
-
return _this16.
|
|
4211
|
+
return _this16.querySkuIdByItemCodes(codeList);
|
|
4192
4212
|
|
|
4193
4213
|
case 27:
|
|
4194
|
-
|
|
4195
|
-
|
|
4214
|
+
_resSuccessMap = _context14.sent;
|
|
4215
|
+
|
|
4216
|
+
_this16.handleSkuinfolist(skuinfolist, _resSuccessMap, codeList);
|
|
4217
|
+
_context14.next = 33;
|
|
4196
4218
|
break;
|
|
4197
4219
|
|
|
4198
|
-
case
|
|
4199
|
-
_context14.prev =
|
|
4220
|
+
case 31:
|
|
4221
|
+
_context14.prev = 31;
|
|
4200
4222
|
_context14.t1 = _context14['catch'](24);
|
|
4201
4223
|
|
|
4202
|
-
case
|
|
4224
|
+
case 33:
|
|
4203
4225
|
|
|
4204
4226
|
console.log('获取到的商品信息:' + JSON.stringify(skuinfolist));
|
|
4205
4227
|
|
|
4206
4228
|
if (!(skuinfolist.length > 0)) {
|
|
4207
|
-
_context14.next =
|
|
4229
|
+
_context14.next = 38;
|
|
4208
4230
|
break;
|
|
4209
4231
|
}
|
|
4210
4232
|
|
|
4211
|
-
_context14.prev = 34;
|
|
4212
|
-
_context14.next = 37;
|
|
4213
|
-
return _this16.handleGoodsInfoNewSkuId(skuinfolist);
|
|
4214
|
-
|
|
4215
|
-
case 37:
|
|
4216
|
-
_context14.next = 41;
|
|
4217
|
-
break;
|
|
4218
|
-
|
|
4219
|
-
case 39:
|
|
4220
|
-
_context14.prev = 39;
|
|
4221
|
-
_context14.t2 = _context14['catch'](34);
|
|
4222
|
-
|
|
4223
|
-
case 41:
|
|
4224
4233
|
return _context14.abrupt('return', _this16.setMaterialGoodInfo(skuinfolist));
|
|
4225
4234
|
|
|
4226
|
-
case
|
|
4235
|
+
case 38:
|
|
4227
4236
|
return _context14.abrupt('return', _this16.handleMaterialSeviceType());
|
|
4228
4237
|
|
|
4229
|
-
case
|
|
4238
|
+
case 39:
|
|
4230
4239
|
case 'end':
|
|
4231
4240
|
return _context14.stop();
|
|
4232
4241
|
}
|
|
4233
4242
|
}
|
|
4234
|
-
}, _callee14, _this16, [[9, 16], [24,
|
|
4243
|
+
}, _callee14, _this16, [[9, 16], [24, 31]]);
|
|
4235
4244
|
}))();
|
|
4236
4245
|
},
|
|
4237
4246
|
|
|
4238
4247
|
|
|
4248
|
+
//处理商品信息
|
|
4249
|
+
handleSkuinfolist: function handleSkuinfolist(skuinfolist, resSuccessMap, codeList) {
|
|
4250
|
+
if (resSuccessMap.code == '000000') {
|
|
4251
|
+
codeList.forEach(function (item) {
|
|
4252
|
+
if (resSuccessMap.data && resSuccessMap.data.successMap) {
|
|
4253
|
+
if (resSuccessMap.data.successMap[item] && resSuccessMap.data.successMap[item].skuId) {
|
|
4254
|
+
console.log('获取到的图片信息:' + JSON.stringify(resSuccessMap.data.successMap[item].mainPicList));
|
|
4255
|
+
if (resSuccessMap.data.successMap[item].mainPicList && resSuccessMap.data.successMap[item].mainPicList.length > 0) {
|
|
4256
|
+
resSuccessMap.data.successMap[item].mainPicList.forEach(function (item1) {
|
|
4257
|
+
console.log('获取到的图片信息:' + JSON.stringify(item1));
|
|
4258
|
+
if (item1.imageSort == 1) {
|
|
4259
|
+
resSuccessMap.data.successMap[item].picInfo = item1.imageUrl;
|
|
4260
|
+
}
|
|
4261
|
+
});
|
|
4262
|
+
}
|
|
4263
|
+
skuinfolist.push(resSuccessMap.data.successMap[item]);
|
|
4264
|
+
}
|
|
4265
|
+
}
|
|
4266
|
+
});
|
|
4267
|
+
}
|
|
4268
|
+
},
|
|
4269
|
+
|
|
4270
|
+
|
|
4239
4271
|
//给商品信息增加新sku
|
|
4240
4272
|
handleGoodsInfoNewSkuId: function handleGoodsInfoNewSkuId(skuinfolist) {
|
|
4241
4273
|
var _this17 = this;
|
|
@@ -4247,7 +4279,7 @@ var MaterialEvent = {
|
|
|
4247
4279
|
switch (_context15.prev = _context15.next) {
|
|
4248
4280
|
case 0:
|
|
4249
4281
|
itemCodeList = skuinfolist.map(function (item) {
|
|
4250
|
-
return item.
|
|
4282
|
+
return item.itemCode;
|
|
4251
4283
|
});
|
|
4252
4284
|
_context15.prev = 1;
|
|
4253
4285
|
_context15.next = 4;
|
|
@@ -4259,7 +4291,7 @@ var MaterialEvent = {
|
|
|
4259
4291
|
if (res.code == '000000') {
|
|
4260
4292
|
skuinfolist.forEach(function (item) {
|
|
4261
4293
|
if (res.data && res.data.successMap) {
|
|
4262
|
-
item.skuId = res.data.successMap[item.
|
|
4294
|
+
item.skuId = res.data.successMap[item.itemCode] ? res.data.successMap[item.itemCode].skuId : '';
|
|
4263
4295
|
}
|
|
4264
4296
|
});
|
|
4265
4297
|
}
|
|
@@ -4422,11 +4454,11 @@ var MaterialEvent = {
|
|
|
4422
4454
|
console.log('\u5546\u54C1item==' + index + '==1' + JSON.stringify(item));
|
|
4423
4455
|
_this20.deviceMaterialList.forEach(function (it, i) {
|
|
4424
4456
|
it.consumables.forEach(function (itt, index) {
|
|
4425
|
-
if (itt.productCode == item.
|
|
4457
|
+
if (itt.productCode == item.itemCode) {
|
|
4426
4458
|
itt.goodsInfo = item;
|
|
4427
4459
|
}
|
|
4428
4460
|
//对于清洗服务里面的productCode单独处理
|
|
4429
|
-
if (itt.serviceSupport && itt.serviceSupport.washingService && itt.serviceSupport.washingService.productCode == item.
|
|
4461
|
+
if (itt.serviceSupport && itt.serviceSupport.washingService && itt.serviceSupport.washingService.productCode == item.itemCode) {
|
|
4430
4462
|
console.log('清洗的哦哦:1' + i + '---' + index);
|
|
4431
4463
|
itt.washingServiceGoodsInfo = item;
|
|
4432
4464
|
}
|
|
@@ -4474,6 +4506,25 @@ var MaterialEvent = {
|
|
|
4474
4506
|
},
|
|
4475
4507
|
|
|
4476
4508
|
|
|
4509
|
+
// COLMO按钮类型 2保养换芯 3售后维修 4清洗服务
|
|
4510
|
+
handleMaterialSeviceTypeColmo: function handleMaterialSeviceTypeColmo() {
|
|
4511
|
+
this.deviceMaterialList.forEach(function (item, index) {
|
|
4512
|
+
item.consumables.forEach(function (it) {
|
|
4513
|
+
if (it.serviceSupport) {
|
|
4514
|
+
if (it.serviceSupport && it.serviceSupport.bookingService && it.serviceSupport.bookingService.enable) {
|
|
4515
|
+
it.btnType = 2;
|
|
4516
|
+
if (it.serviceSupport.bookingService && it.serviceSupport.bookingService.serviceType == 2) {
|
|
4517
|
+
it.btnType = 3;
|
|
4518
|
+
}
|
|
4519
|
+
} else if (it.serviceSupport && it.serviceSupport.washingService && it.serviceSupport.washingService.enable) {
|
|
4520
|
+
it.btnType = 4;
|
|
4521
|
+
}
|
|
4522
|
+
}
|
|
4523
|
+
});
|
|
4524
|
+
});
|
|
4525
|
+
},
|
|
4526
|
+
|
|
4527
|
+
|
|
4477
4528
|
// 对每一种设备按照consumables中余量从最少到多排列
|
|
4478
4529
|
// 排序函数 - 处理 remainingValueType=4的情况
|
|
4479
4530
|
sortByRemainingValue: function sortByRemainingValue(a, b) {
|
|
@@ -4734,6 +4785,8 @@ var MaterialEvent = {
|
|
|
4734
4785
|
// 合并三个数组
|
|
4735
4786
|
var sortedDeviceMaterialList = [].concat(_toConsumableArray(categorizedDeviceMaterialList.insufficient), _toConsumableArray(categorizedDeviceMaterialList.unknown), _toConsumableArray(categorizedDeviceMaterialList.sufficient));
|
|
4736
4787
|
|
|
4788
|
+
this.insufficientArr = categorizedDeviceMaterialList.insufficient;
|
|
4789
|
+
|
|
4737
4790
|
//记录每一种情况下的设备数量
|
|
4738
4791
|
this.deviceTotal = [categorizedDeviceMaterialList.insufficient.length, categorizedDeviceMaterialList.unknown.length, categorizedDeviceMaterialList.sufficient.length];
|
|
4739
4792
|
//记录每一种情况下的耗材数量
|