dolphin-weex-bc 0.0.22 → 0.0.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dolphin-weex-bc",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -2,7 +2,7 @@
2
2
  <div class="material-wrapper" :style="{ width: width + 'px' }" ref="materialBox">
3
3
  <template v-for="(item, index) in deviceMaterialList">
4
4
  <!-- 展示不同模式下的样式 -->
5
- <template v-if="isFilterShow">
5
+ <!-- <template v-if="isFilterShow">
6
6
  <div
7
7
  class="l-tittle-insufficient-box"
8
8
  v-if="index == 0 && (deviceTotal[0] > 0 || deviceTotal[0] === ' ')"
@@ -23,6 +23,28 @@
23
23
  :key="index"
24
24
  >耗材充足({{ materialTotal[2] }})</text
25
25
  >
26
+ </template> -->
27
+ <template v-if="isFilterShow">
28
+ <div
29
+ class="l-tittle-insufficient-box"
30
+ v-if="item.categorySort === 'insufficient' && item.categoryNum"
31
+ :key="item.applianceCode"
32
+ >
33
+ <text :class="['l-tittle', isDiablo && 'l-tittle-isDiablo']">耗材不足({{ item.categoryNum }})</text>
34
+ <slot name="filterShowAddCar"></slot>
35
+ </div>
36
+ <text
37
+ :key="item.applianceCode"
38
+ :class="['l-tittle', isDiablo && 'l-tittle-isDiablo']"
39
+ v-if="item.categorySort === 'unknown' && item.categoryNum"
40
+ >耗材数据未知({{ item.categoryNum }})</text
41
+ >
42
+ <text
43
+ :key="item.applianceCode"
44
+ :class="['l-tittle', isDiablo && 'l-tittle-isDiablo']"
45
+ v-if="item.categorySort === 'sufficient' && item.categoryNum"
46
+ >耗材充足({{ item.categoryNum }})</text
47
+ >
26
48
  </template>
27
49
  <div
28
50
  class="material-list"
@@ -297,18 +319,6 @@ export default {
297
319
  type: Boolean,
298
320
  default: false
299
321
  },
300
- deviceTotal: {
301
- type: Array,
302
- default: () => {
303
- return []
304
- }
305
- },
306
- materialTotal: {
307
- type: Array,
308
- default: () => {
309
- return []
310
- }
311
- },
312
322
  isFilterShow: {
313
323
  type: Boolean,
314
324
  default: false // 是否是分层模式
@@ -464,12 +474,12 @@ export default {
464
474
  // 1购买
465
475
  if (it.btnType == 1) {
466
476
  let activeUrl = it.purchaseInfo ? it.purchaseInfo.linkUrl : ''
467
- let searchPage = it.purchaseInfo ? it.purchaseInfo.searchPage : ''
468
- if (searchPage) {
469
- searchPage = searchPage.includes('?')
470
- ? `${searchPage}&entrance=consumables`
471
- : `${searchPage}?entrance=consumables`
472
- this.goodsjumpWebViewNew(searchPage)
477
+ let searchLinkUrl = it.purchaseInfo ? it.purchaseInfo.searchLinkUrl : ''
478
+ if (searchLinkUrl) {
479
+ searchLinkUrl = searchLinkUrl.includes('?')
480
+ ? `${searchLinkUrl}&entrance=consumables`
481
+ : `${searchLinkUrl}?entrance=consumables`
482
+ this.goodsjumpWebViewNew(searchLinkUrl)
473
483
  } else if (it.purchaseInfo && it.purchaseInfo.skuId) {
474
484
  this.goToGoodsDetail(it.purchaseInfo)
475
485
  } else if (it.goodsInfo && (it.goodsInfo.skulink || it.goodsInfo.skuId)) {
@@ -564,12 +574,12 @@ export default {
564
574
 
565
575
  if (it.serviceSupport && it.serviceSupport.washingService && it.serviceSupport.washingService.enable) {
566
576
  let activeUrl = it.serviceSupport.washingService.serviceUrl
567
- let searchPage = it.serviceSupport.washingService.searchPage
568
- if (searchPage) {
569
- searchPage = searchPage.includes('?')
570
- ? `${searchPage}&entrance=consumables`
571
- : `${searchPage}?entrance=consumables`
572
- this.goodsjumpWebViewNew(searchPage)
577
+ let searchLinkUrl = it.serviceSupport.washingService.searchLinkUrl
578
+ if (searchLinkUrl) {
579
+ searchLinkUrl = searchLinkUrl.includes('?')
580
+ ? `${searchLinkUrl}&entrance=consumables`
581
+ : `${searchLinkUrl}?entrance=consumables`
582
+ this.goodsjumpWebViewNew(searchLinkUrl)
573
583
  } else if (it.serviceSupport.washingService.skuId) {
574
584
  this.goToGoodsDetail(it.serviceSupport.washingService)
575
585
  } else if (
@@ -791,14 +791,26 @@ const MaterialEvent = {
791
791
  it.chartData = this.setChartDataColmo(it)
792
792
  continue
793
793
  }
794
- if (it.productCode && it.productCode != 0) tmpcodeList.push(it.productCode)
794
+ //这里需要对有skuid的耗材进行处理
795
+ let purchaseInfoPurchaseEnable = it.purchaseInfo && it.purchaseInfo.purchaseEnable
796
+ if (purchaseInfoPurchaseEnable && it.purchaseInfo.purchaseInfo.skuId) {
797
+ }
798
+
799
+ if (purchaseInfoPurchaseEnable && it.purchaseInfo.purchaseInfo.searchLinkUrl) {
800
+ //去掉有搜索列表的(优先级最高)
801
+ } else if (it.productCode && it.productCode != 0) {
802
+ tmpcodeList.push(it.productCode)
803
+ }
804
+
805
+ //这里需要对有skuid的耗材进行处理
806
+ let washingServiceEnable =
807
+ it.serviceSupport && it.serviceSupport.washingService && it.serviceSupport.washingService.enable
808
+ if (washingServiceEnable && it.serviceSupport.washingService.skuId) {
809
+ }
795
810
  //对清洗服务里面有productCode的,也需要请求商城那边接口
796
- if (
797
- it.serviceSupport &&
798
- it.serviceSupport.washingService &&
799
- it.serviceSupport.washingService.enable &&
800
- it.serviceSupport.washingService.productCode
801
- ) {
811
+ if (washingServiceEnable && it.serviceSupport.washingService.searchLinkUrl) {
812
+ //去掉有搜索列表的(优先级最高)
813
+ } else if (washingServiceEnable && it.serviceSupport.washingService.productCode) {
802
814
  tmpcodeList.push(it.serviceSupport.washingService.productCode)
803
815
  }
804
816
  it.chartData = this.setChartData(it)
@@ -968,7 +980,8 @@ const MaterialEvent = {
968
980
  item.consumables.forEach((it, i) => {
969
981
  if (
970
982
  (it.goodsInfo && (it.goodsInfo.skulink || it.goodsInfo.skuId)) ||
971
- (it.purchaseInfo && it.purchaseInfo.linkUrl)
983
+ (it.purchaseInfo && it.purchaseInfo.linkUrl) ||
984
+ (it.purchaseInfo && it.purchaseInfo.searchLinkUrl)
972
985
  ) {
973
986
  it.btnType = 1
974
987
  it.btnText = '购买'
@@ -991,7 +1004,8 @@ const MaterialEvent = {
991
1004
  it.serviceSupport.washingService.enable &&
992
1005
  (it.serviceSupport.washingService.serviceUrl ||
993
1006
  (it.washingServiceGoodsInfo &&
994
- (it.washingServiceGoodsInfo.skulink || it.washingServiceGoodsInfo.skuId)))
1007
+ (it.washingServiceGoodsInfo.skulink || it.washingServiceGoodsInfo.skuId)) ||
1008
+ it.serviceSupport.washingService.searchLinkUrl)
995
1009
  ) {
996
1010
  it.btnType = 4
997
1011
  it.btnText = '清洗'
@@ -1027,109 +1041,6 @@ const MaterialEvent = {
1027
1041
  return 0
1028
1042
  },
1029
1043
 
1030
- //对材料进行分层排序
1031
- getMaterialSort(tempList) {
1032
- const categorizedDeviceMaterialList = {
1033
- insufficient: [],
1034
- unknown: [],
1035
- sufficient: []
1036
- }
1037
- let insufficientMaterialLength = 0
1038
- let unknownMaterialLength = 0
1039
- let sufficientMaterialLength = 0
1040
-
1041
- let dsposeList = tempList || this.deviceMaterialList
1042
- dsposeList.forEach(device => {
1043
- const categorizedConsumables = {
1044
- insufficient: [],
1045
- unknown: [],
1046
- sufficient: []
1047
- }
1048
-
1049
- device.consumables.forEach(consumable => {
1050
- if (
1051
- (consumable.remainingStatus == 1 || consumable.remainingStatus == 0) &&
1052
- consumable.remainingValue != null &&
1053
- device.deviceInfo.isOnline == 1 &&
1054
- consumable.remainingValueType != 5
1055
- ) {
1056
- categorizedConsumables.insufficient.push(consumable)
1057
- insufficientMaterialLength++
1058
- } else if (
1059
- consumable.remainingStatus == 2 &&
1060
- consumable.remainingValue != null &&
1061
- device.deviceInfo.isOnline == 1 &&
1062
- consumable.remainingValueType != 5
1063
- ) {
1064
- categorizedConsumables.sufficient.push(consumable)
1065
- sufficientMaterialLength++
1066
- } else {
1067
- categorizedConsumables.unknown.push(consumable)
1068
- unknownMaterialLength++
1069
- }
1070
- })
1071
-
1072
- if (categorizedConsumables.insufficient.length > 0) {
1073
- categorizedDeviceMaterialList.insufficient.push({
1074
- ...device,
1075
- consumables: this.sortConsumables(categorizedConsumables.insufficient)
1076
- })
1077
- }
1078
-
1079
- if (categorizedConsumables.unknown.length > 0) {
1080
- categorizedDeviceMaterialList.unknown.push({
1081
- ...device,
1082
- consumables: categorizedConsumables.unknown
1083
- })
1084
- }
1085
-
1086
- if (categorizedConsumables.sufficient.length > 0) {
1087
- categorizedDeviceMaterialList.sufficient.push({
1088
- ...device,
1089
- consumables: this.sortConsumables(categorizedConsumables.sufficient)
1090
- })
1091
- }
1092
- })
1093
-
1094
- // 对每个分类进行排序
1095
- categorizedDeviceMaterialList.insufficient.sort(this.sortByRemainingValue)
1096
- categorizedDeviceMaterialList.sufficient.sort(this.sortByRemainingValue)
1097
-
1098
- // 合并三个数组
1099
- const sortedDeviceMaterialList = [
1100
- ...categorizedDeviceMaterialList.insufficient,
1101
- ...categorizedDeviceMaterialList.unknown,
1102
- ...categorizedDeviceMaterialList.sufficient
1103
- ]
1104
-
1105
- //记录每一种情况下的设备数量
1106
- this.deviceTotal = [
1107
- categorizedDeviceMaterialList.insufficient.length,
1108
- categorizedDeviceMaterialList.unknown.length,
1109
- categorizedDeviceMaterialList.sufficient.length
1110
- ]
1111
- //记录每一种情况下的耗材数量
1112
- this.materialTotal = [insufficientMaterialLength, unknownMaterialLength, sufficientMaterialLength]
1113
- console.log(
1114
- '设备数量哦:' +
1115
- categorizedDeviceMaterialList.insufficient.length +
1116
- '---' +
1117
- categorizedDeviceMaterialList.unknown.length +
1118
- '---' +
1119
- categorizedDeviceMaterialList.sufficient.length
1120
- )
1121
- console.log(
1122
- '耗材数量哦:' + insufficientMaterialLength + '---' + unknownMaterialLength + '---' + sufficientMaterialLength
1123
- )
1124
-
1125
- return {
1126
- sortedDeviceMaterialList,
1127
- materialTotal,
1128
- deviceTotal,
1129
- insufficientList
1130
- }
1131
- },
1132
-
1133
1044
  setChartData(it, options = {}) {
1134
1045
  let isDiablo = this.isDiablo
1135
1046
  let needBackground = this.needBackground