component-sanzhizhou 1.2.8 → 1.2.10
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/index.d.ts
CHANGED
|
@@ -20,4 +20,4 @@ export { default as PayQr } from './pay/qr';
|
|
|
20
20
|
export { default as PayChannel } from './pay/pay-channel';
|
|
21
21
|
export { default as IdTag } from './UI/id-tag';
|
|
22
22
|
export { default as CollectConfigPrice } from './collect-price';
|
|
23
|
-
export { default as ProductDetailLink } from './lib/product-detail-link';
|
|
23
|
+
export { default as ProductDetailLink, getProductDetailUrl } from './lib/product-detail-link';
|
package/dist/index.js
CHANGED
|
@@ -20,4 +20,4 @@ export { default as PayQr } from "./pay/qr";
|
|
|
20
20
|
export { default as PayChannel } from "./pay/pay-channel";
|
|
21
21
|
export { default as IdTag } from "./UI/id-tag";
|
|
22
22
|
export { default as CollectConfigPrice } from "./collect-price";
|
|
23
|
-
export { default as ProductDetailLink } from "./lib/product-detail-link";
|
|
23
|
+
export { default as ProductDetailLink, getProductDetailUrl } from "./lib/product-detail-link";
|
|
@@ -3,8 +3,11 @@ interface Props {
|
|
|
3
3
|
commercePlatformId?: number;
|
|
4
4
|
skuId?: number;
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
-
|
|
6
|
+
className?: string;
|
|
7
|
+
linkTitle?: string;
|
|
7
8
|
}
|
|
8
|
-
export
|
|
9
|
+
export interface ProductDetailUrlOptions {
|
|
10
|
+
}
|
|
11
|
+
export declare const getProductDetailUrl: (commercePlatformId?: number, skuId?: number | string, options?: ProductDetailUrlOptions) => string;
|
|
9
12
|
declare const ProductDetailLink: React.FC<Props>;
|
|
10
13
|
export default ProductDetailLink;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
// 平台商品详情页地址:目前仅 OZON 支持,WB 待补充
|
|
3
2
|
export var getProductDetailUrl = function getProductDetailUrl(commercePlatformId, skuId) {
|
|
4
3
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
5
4
|
if (!skuId) {
|
|
@@ -19,6 +18,8 @@ export var getProductDetailUrl = function getProductDetailUrl(commercePlatformId
|
|
|
19
18
|
var ProductDetailLink = function ProductDetailLink(_ref) {
|
|
20
19
|
var commercePlatformId = _ref.commercePlatformId,
|
|
21
20
|
skuId = _ref.skuId,
|
|
21
|
+
className = _ref.className,
|
|
22
|
+
linkTitle = _ref.linkTitle,
|
|
22
23
|
children = _ref.children;
|
|
23
24
|
var href = getProductDetailUrl(commercePlatformId, skuId);
|
|
24
25
|
if (!href) {
|
|
@@ -26,9 +27,10 @@ var ProductDetailLink = function ProductDetailLink(_ref) {
|
|
|
26
27
|
}
|
|
27
28
|
return /*#__PURE__*/React.createElement("a", {
|
|
28
29
|
href: href,
|
|
30
|
+
title: linkTitle,
|
|
29
31
|
target: "_blank",
|
|
30
|
-
rel: "noreferrer"
|
|
31
|
-
|
|
32
|
+
rel: "noreferrer",
|
|
33
|
+
className: className
|
|
32
34
|
}, children);
|
|
33
35
|
};
|
|
34
36
|
export default ProductDetailLink;
|