@cloudbase/weda-ui 3.14.0 → 3.14.1
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/dist/configs/components/wd-store-product.d.ts +1 -0
- package/dist/configs/components/wd-store-product.js +1 -0
- package/dist/configs/index.d.ts +2 -0
- package/dist/style/index.css +11 -3
- package/dist/style/index.scss +1 -1
- package/dist/style/weda-ui.min.css +4 -4
- package/dist/web/components/form/location/common/mapChoose.js +27 -16
- package/dist/web/components/wd-store-home/index.css +3 -1
- package/dist/web/components/wd-store-product/index.d.ts +1 -1
- package/dist/web/components/wd-store-product/index.js +3 -2
- package/package.json +1 -1
|
@@ -54,7 +54,7 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
54
54
|
function loadScript() {
|
|
55
55
|
const script = document.createElement('script');
|
|
56
56
|
script.type = 'text/javascript';
|
|
57
|
-
script.src = `${tmapApiUrl}?v=2.exp&key=${APIKEY}&
|
|
57
|
+
script.src = `${tmapApiUrl}?v=2.exp&key=${APIKEY}&libraries=service`;
|
|
58
58
|
script.onload = () => {
|
|
59
59
|
initMap();
|
|
60
60
|
};
|
|
@@ -69,7 +69,6 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
69
69
|
else {
|
|
70
70
|
loadScript();
|
|
71
71
|
}
|
|
72
|
-
exploreNear('updateCenter');
|
|
73
72
|
return () => {
|
|
74
73
|
mapRef.current && mapRef.current.destroy();
|
|
75
74
|
};
|
|
@@ -80,16 +79,26 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
80
79
|
const initMap = () => {
|
|
81
80
|
if (!getTMap())
|
|
82
81
|
return;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
82
|
+
try {
|
|
83
|
+
const TMap = getTMap();
|
|
84
|
+
//定义地图中心点坐标
|
|
85
|
+
const center = new TMap.LatLng(lat, lng);
|
|
86
|
+
//定义map变量,调用 TMap.Map() 构造函数创建地图
|
|
87
|
+
mapRef.current = new TMap.Map(document.getElementById(`form-map-choose-${mapDomName.current}`), {
|
|
88
|
+
center,
|
|
89
|
+
zoom: 16, //设置地图缩放级别
|
|
90
|
+
});
|
|
91
|
+
initMarker(TMap, mapRef.current);
|
|
92
|
+
getRadius() && initCircle(TMap, mapRef.current);
|
|
93
|
+
exploreNear('updateCenter');
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
errorHandler({
|
|
97
|
+
code: 'WdLocation.initMap',
|
|
98
|
+
error,
|
|
99
|
+
message: `初始化地图失败,请检查APIKEY【${APIKEY}】是否正确,或者检查是否有配额`,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
93
102
|
};
|
|
94
103
|
const initMarker = (TMap, map) => {
|
|
95
104
|
const canLoad = lat && lng && TMap && map;
|
|
@@ -240,7 +249,9 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
240
249
|
errorHandler({
|
|
241
250
|
code: 'WdLocation.exploreNear',
|
|
242
251
|
error,
|
|
243
|
-
message: ((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('调用量已达到上限'))
|
|
252
|
+
message: ((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('调用量已达到上限'))
|
|
253
|
+
? `附近搜索失败,请检查APIKEY【${APIKEY}】是否正确,调整/ws/place/v1/explore配额`
|
|
254
|
+
: '',
|
|
244
255
|
});
|
|
245
256
|
});
|
|
246
257
|
}, 500);
|
|
@@ -277,7 +288,7 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
277
288
|
code: 'WdLocation.getAddress',
|
|
278
289
|
error,
|
|
279
290
|
message: ((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('调用量已达到上限'))
|
|
280
|
-
?
|
|
291
|
+
? `地址解析失败,请检查APIKEY【${APIKEY}】是否正确,调整/ws/geocoder/v1/?address=*配额`
|
|
281
292
|
: '',
|
|
282
293
|
});
|
|
283
294
|
let item = {
|
|
@@ -334,7 +345,7 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
334
345
|
code: 'WdLocation.getSuggestion',
|
|
335
346
|
error,
|
|
336
347
|
message: ((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('调用量已达到上限'))
|
|
337
|
-
?
|
|
348
|
+
? `关键词输入提示失败,请检查APIKEY【${APIKEY}】是否正确,调整/ws/place/v1/suggestion配额`
|
|
338
349
|
: '',
|
|
339
350
|
});
|
|
340
351
|
});
|
|
@@ -482,7 +493,7 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
482
493
|
code: 'WdLocation.getLatestLocation',
|
|
483
494
|
error: e,
|
|
484
495
|
message: ((_a = e === null || e === void 0 ? void 0 : e.message) === null || _a === void 0 ? void 0 : _a.includes('调用量已达到上限'))
|
|
485
|
-
?
|
|
496
|
+
? `坐标转换失败,请检查APIKEY【${APIKEY}】是否正确,调整/ws/geocoder/v1/?location=*配额`
|
|
486
497
|
: '',
|
|
487
498
|
});
|
|
488
499
|
resolve(null);
|
|
@@ -25,8 +25,10 @@
|
|
|
25
25
|
border-radius: 100%;
|
|
26
26
|
margin-right: 15px;
|
|
27
27
|
}
|
|
28
|
-
.wd-store-home__footer {
|
|
28
|
+
.wd-store-home__wrap .wd-store-home__footer {
|
|
29
29
|
border-top: 1px solid #f2f2f2;
|
|
30
|
+
}
|
|
31
|
+
.wd-store-home__footer {
|
|
30
32
|
font-size: 12px;
|
|
31
33
|
padding: 5px 0;
|
|
32
34
|
display: flex;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { CommonPropsType } from '../../types';
|
|
3
3
|
import type { DataType } from '../../../configs/components/wd-store-product';
|
|
4
4
|
import './style';
|
|
5
|
-
export default function WdStoreProduct(
|
|
5
|
+
export default function WdStoreProduct(props: WdStoreProductProps): JSX.Element;
|
|
6
6
|
interface WdStoreProductProps extends CommonPropsType, DataType {
|
|
7
7
|
}
|
|
8
8
|
export { type WdStoreProductProps };
|
|
@@ -4,10 +4,11 @@ import './style';
|
|
|
4
4
|
import WdButton from '../wd-button';
|
|
5
5
|
import { useCanPreview } from '../../utils/hooks/useCanPreview';
|
|
6
6
|
import { useConfig } from '../../utils/config-context';
|
|
7
|
-
export default function WdStoreProduct(
|
|
7
|
+
export default function WdStoreProduct(props) {
|
|
8
|
+
const { className, id, customContent, children } = props;
|
|
8
9
|
const { classPrefix } = useConfig();
|
|
9
10
|
const canPreview = useCanPreview();
|
|
10
11
|
if (!canPreview)
|
|
11
12
|
return null;
|
|
12
|
-
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsx(Bubble, { placement: "auto", openDelay: 300, content: _jsxs(_Fragment, { children: ["\u8BE5\u7EC4\u4EF6\u5FC5\u987B\u5728\u5C0F\u7A0B\u5E8F\u771F\u5B9E\u73AF\u5883\u4F7F\u7528\u624D\u80FD\u591F\u770B\u5230\u5B9E\u9645\u6548\u679C\u3002", _jsx("br", {}), _jsx("a", { href: "https://developers.weixin.qq.com/miniprogram/dev/component/store-product.html", target: "_blank", rel: "noreferrer", children: "\u67E5\u770B\u8BF4\u660E" })] }), children: _jsxs("div", { className: `${className} ${classPrefix
|
|
13
|
+
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsx(Bubble, { placement: "auto", openDelay: 300, content: _jsxs(_Fragment, { children: ["\u8BE5\u7EC4\u4EF6\u5FC5\u987B\u5728\u5C0F\u7A0B\u5E8F\u771F\u5B9E\u73AF\u5883\u4F7F\u7528\u624D\u80FD\u591F\u770B\u5230\u5B9E\u9645\u6548\u679C\u3002", _jsx("br", {}), _jsx("a", { href: "https://developers.weixin.qq.com/miniprogram/dev/component/store-product.html", target: "_blank", rel: "noreferrer", children: "\u67E5\u770B\u8BF4\u660E" })] }), children: _jsxs("div", { className: `${className} ${customContent ? '' : classPrefix + '-store-product__wrap'}`, id: id, children: [customContent ? (children) : (_jsx("div", { className: `${classPrefix}-store-home__content`, children: _jsxs(_Fragment, { children: [_jsx("img", { className: `${classPrefix}-store-product__img`, src: "https://qcloudimg.tencent-cloud.cn/raw/4a29d51b504f12b4933ce4490110b4dc.svg", alt: "" }), _jsxs("div", { className: `${classPrefix}-store-product__text`, children: [_jsxs("div", { children: [_jsx("p", { className: `${classPrefix}-store-home__title`, children: "\u5546\u54C1\u540D\u79F0" }), _jsx("span", { className: `${classPrefix}-store-home__label`, children: "\u5546\u54C1\u6807\u7B7E" })] }), _jsxs("div", { className: `${classPrefix}-store-product__text__footer`, children: [_jsx("p", { className: "price", children: "\u00A5\u4EF7\u683C \u8D77" }), " ", _jsx(WdButton, { text: "\u8D2D\u4E70" })] })] })] }) })), _jsxs("div", { className: `${classPrefix}-store-home__footer`, children: [_jsx("i", { className: `${classPrefix}-store-home__icon` }), "\u5C0F\u5E97\u540D\u79F0"] })] }) }) }));
|
|
13
14
|
}
|