@conecli/cone-render 0.10.1-shop3.124 → 0.10.1-shop3.126

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.
@@ -1 +1 @@
1
- import React, { useEffect, useMemo, useState } from 'react';
2
1
  const getThisLeGaoTagKey = `${tagId}-${tagText}}`;
3
2
  const getLeGaoTagCacheNode = shopLeGaoTagNodeMap.get(getThisLeGaoTagKey) || false;
4
3
  return getLeGaoTagCacheNode
5
4
  ? getLeGaoTagCacheNode
6
5
  : useMemo(() => {
7
6
  const createCanVasTag = (
8
7
  <canvas-tag
9
8
  className={classNames(shopTagStyle['d-tag-item-canvas'])}
10
9
  tagId={tagId}
11
10
  text={tagText}
12
11
  appVersion={getJdAppVersionStr}
13
12
  lang={languageNowType}
14
13
  />
15
14
  );
16
15
  shopLeGaoTagNodeMap.set(getThisLeGaoTagKey, createCanVasTag);
17
16
  return createCanVasTag;
18
17
  }, [tagId, tagText]);
19
18
  const {
20
19
  tagInfoList = [],
21
20
  className,
22
21
  itemClassName,
23
22
  isSkuBaseTag = false,
24
23
  itemClickCallback,
25
24
  } = props;
26
25
  const getTagInfoList = Array.isArray(tagInfoList) ? tagInfoList : [];
27
26
  const getTagInfoListNum = getTagInfoList.length;
28
27
  const isCallBackFn = typeof itemClickCallback === 'function';
29
28
  const needAsyncLoad = useMemo(() => {
30
29
  if (window.CanvasTag) return false;
31
30
  const h5TagJs = taroJdBaseInfo.loadJsSdkList.find((e) => e.fileName === 'h5TagJs');
32
31
  return !!(h5TagJs && h5TagJs.initTriggerType === LoadJsInitTriggerType.NRXT_TICK);
33
32
  }, []);
34
33
  const [loadOver, setLoadOver] = useState(!needAsyncLoad);
35
34
  useEffect(() => {
36
35
  async function loadTagSdk() {
37
36
  try {
38
37
  await taroJdBaseInfo.loadH5tagReayPromise();
39
38
  } catch (error) {}
40
39
  setLoadOver(true);
41
40
  }
42
41
  needAsyncLoad && loadTagSdk();
43
42
  }, []);
44
43
  if (!loadOver) return null;
45
44
  return getTagInfoListNum > 0 ? (
46
45
  <View
47
46
  className={classNames(
48
47
  shopTagStyle['d-shop-tag-list'],
49
48
  {
50
49
  [shopTagStyle['d-shop-sku-tag-list']]: isSkuBaseTag,
51
50
  },
52
51
  className,
53
52
  )}
54
53
  >
55
54
  {}
56
55
  <View style={{ width: '1px', height: '100%' }} className="d-shop-tag-hide" />
57
56
  {getTagInfoList.map((item, index) => {
58
57
  const { tagId, tabIconId, tagText, type, tabIconType, tabText } = item;
59
58
  const getTagId = tagId || tabIconId;
60
59
  const getTagType = type || tabIconType;
61
60
  const getTagText = tagText || tabText;
62
61
  return getTagId ? (
63
62
  <View
64
63
  role="text"
65
64
  tabindex="0"
66
65
  aria-label={getTagText}
67
66
  key={getTagId + getTagType + index}
68
67
  className={classNames(shopTagStyle['d-tag-item'], itemClassName)}
69
68
  onClick={isCallBackFn && itemClickCallback.bind(this, item, index)}
70
69
  >
71
70
  <LeGaoTagComponent tagId={getTagId} tagText={getTagText} />
72
71
  </View>
73
72
  ) : null;
74
73
  })}
75
74
  </View>
76
75
  ) : null;
76
+ import React, { useEffect, useMemo, useState } from 'react';
77
77
  const getThisLeGaoTagKey = `${tagId}-${tagText}}`;
78
78
  const getLeGaoTagCacheNode = shopLeGaoTagNodeMap.get(getThisLeGaoTagKey) || false;
79
79
  return getLeGaoTagCacheNode
80
80
  ? getLeGaoTagCacheNode
81
81
  : useMemo(() => {
82
82
  const createCanVasTag = (
83
83
  <canvas-tag
84
84
  className={classNames(shopTagStyle['d-tag-item-canvas'])}
85
85
  tagId={tagId}
86
86
  text={tagText}
87
87
  appVersion={getJdAppVersionStr}
88
88
  lang={languageNowType}
89
89
  />
90
90
  );
91
91
  shopLeGaoTagNodeMap.set(getThisLeGaoTagKey, createCanVasTag);
92
92
  return createCanVasTag;
93
93
  }, [tagId, tagText]);
94
94
  const {
95
95
  tagInfoList = [],
96
96
  className,
97
97
  itemClassName,
98
98
  isSkuBaseTag = false,
99
99
  itemClickCallback,
100
100
  nativeProps,
101
101
  } = props;
102
102
  const getTagInfoList = Array.isArray(tagInfoList) ? tagInfoList : [];
103
103
  const getTagInfoListNum = getTagInfoList.length;
104
104
  const isCallBackFn = typeof itemClickCallback === 'function';
105
105
  const needAsyncLoad = useMemo(() => {
106
106
  if (window.CanvasTag) return false;
107
107
  const h5TagJs = taroJdBaseInfo.loadJsSdkList.find((e) => e.fileName === 'h5TagJs');
108
108
  return !!(h5TagJs && h5TagJs.initTriggerType === LoadJsInitTriggerType.NRXT_TICK);
109
109
  }, []);
110
110
  const [loadOver, setLoadOver] = useState(!needAsyncLoad);
111
111
  useEffect(() => {
112
112
  async function loadTagSdk() {
113
113
  try {
114
114
  await taroJdBaseInfo.loadH5tagReayPromise();
115
115
  } catch (error) {}
116
116
  setLoadOver(true);
117
117
  }
118
118
  needAsyncLoad && loadTagSdk();
119
119
  }, []);
120
120
  if (!loadOver) return null;
121
121
  return getTagInfoListNum > 0 ? (
122
122
  <View
123
123
  className={classNames(
124
124
  shopTagStyle['d-shop-tag-list'],
125
125
  {
126
126
  [shopTagStyle['d-shop-sku-tag-list']]: isSkuBaseTag,
127
127
  },
128
128
  className,
129
129
  )}
130
130
  {...nativeProps}
131
131
  >
132
132
  {}
133
133
  <View style={{ width: '1px', height: '100%' }} className="d-shop-tag-hide" />
134
134
  {getTagInfoList.map((item, index) => {
135
135
  const { tagId, tabIconId, tagText, type, tabIconType, tabText } = item;
136
136
  const getTagId = tagId || tabIconId;
137
137
  const getTagType = type || tabIconType;
138
138
  const getTagText = tagText || tabText;
139
139
  return getTagId ? (
140
140
  <View
141
141
  role="text"
142
142
  tabindex="0"
143
143
  aria-label={getTagText}
144
144
  key={getTagId + getTagType + index}
145
145
  className={classNames(shopTagStyle['d-tag-item'], itemClassName)}
146
146
  onClick={isCallBackFn && itemClickCallback.bind(this, item, index)}
147
147
  >
148
148
  <LeGaoTagComponent tagId={getTagId} tagText={getTagText} />
149
149
  </View>
150
150
  ) : null;
151
151
  })}
152
152
  </View>
153
153
  ) : null;
@@ -270,6 +270,7 @@
270
270
  "selectAll": "全选",
271
271
  "receiveMemberOnlyExclusiveCoupon": "获得会员限量专属神券",
272
272
  "noShopTip": "No shop available",
273
+ "memberGiftLimitDesc": "Membership fees will be determined based on actual disbursement.",
273
274
  "openCardNow": "立即开卡",
274
275
  "sprintLimitedUnit": "pcs",
275
276
  "successSubscribe": "Success",
@@ -270,6 +270,7 @@
270
270
  "selectAll": "全选",
271
271
  "receiveMemberOnlyExclusiveCoupon": "获得会员限量专属神券",
272
272
  "noShopTip": "暂无店铺",
273
+ "memberGiftLimitDesc": "入会礼以实际发放为准",
273
274
  "openCardNow": "立即开卡",
274
275
  "sprintLimitedUnit": "份",
275
276
  "successSubscribe": "订阅成功",
@@ -270,6 +270,7 @@
270
270
  "selectAll": "全選",
271
271
  "receiveMemberOnlyExclusiveCoupon": "獲得會員限量專屬神券",
272
272
  "noShopTip": "暫無店鋪",
273
+ "memberGiftLimitDesc": "入會禮以實際發放爲準",
273
274
  "openCardNow": "立即開卡",
274
275
  "sprintLimitedUnit": "份",
275
276
  "successSubscribe": "訂閱成功",