s-material-react 0.0.7 → 0.0.8
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.
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo, useEffect, useState } from 'react';
|
|
3
3
|
import { useComponent } from '@brushes/qj-simulate-component';
|
|
4
4
|
import { _ } from '@brushes/tools';
|
|
5
|
-
import { getEnv } from '@brushes/api';
|
|
6
5
|
const { isUndefined, isEmpty } = _;
|
|
7
6
|
const ClassifyNavJsx = ({ defaultValue, borderRadius, marginTop, marginBottom, selectClassifyNav }) => {
|
|
8
7
|
const [list, setList] = useState(defaultValue);
|
|
@@ -18,17 +17,8 @@ const ClassifyNavJsx = ({ defaultValue, borderRadius, marginTop, marginBottom, s
|
|
|
18
17
|
}
|
|
19
18
|
setList(arr);
|
|
20
19
|
}, [selectClassifyNav]);
|
|
21
|
-
const switchImpl = () => {
|
|
22
|
-
const isTaro = getEnv();
|
|
23
|
-
console.log(45, isTaro);
|
|
24
|
-
if (isTaro) {
|
|
25
|
-
Taro.navigateTo({
|
|
26
|
-
url: '/subpackage/goods/index'
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
20
|
return (_jsx(View, Object.assign({ className: 'classifyNav' }, { children: list.map((item, index) => {
|
|
31
|
-
return (_jsxs(View, Object.assign({
|
|
21
|
+
return (_jsxs(View, Object.assign({ className: 'classifyNavItem' }, { children: [_jsx("img", { src: item.imgUrl, alt: "", className: 'img' }), _jsx(Text, Object.assign({ className: 'label' }, { children: item.title }))] }), index));
|
|
32
22
|
}) })));
|
|
33
23
|
};
|
|
34
24
|
export const ClassifyNav = memo(ClassifyNavJsx);
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useComponent } from '@brushes/qj-simulate-component';
|
|
3
|
+
import { getEnv } from '../../../../../../../lerna-repo/packages/api';
|
|
3
4
|
export const ClassifyFloor = ({ navList, activeKey }) => {
|
|
4
5
|
const { View, Text } = useComponent();
|
|
5
6
|
console.log(4, navList);
|
|
7
|
+
const switchImpl = () => {
|
|
8
|
+
const isTaro = getEnv();
|
|
9
|
+
console.log(45, isTaro);
|
|
10
|
+
if (isTaro) {
|
|
11
|
+
console.log(Taro);
|
|
12
|
+
Taro.navigateTo({
|
|
13
|
+
url: '/subpackage/goods/index'
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
};
|
|
6
17
|
return navList.map((item) => (_jsx(View, Object.assign({ className: ['content', activeKey === `${item.goodsClassCode}` ? ' active' : ''].join('') }, { children: item === null || item === void 0 ? void 0 : item.childList.map((classifyItem) => {
|
|
7
18
|
return (_jsxs(View, Object.assign({ className: 'classifyFloor' }, { children: [_jsxs(View, Object.assign({ className: 'titleWrap' }, { children: [_jsx(Text, Object.assign({ className: 'title' }, { children: classifyItem.goodsClassName })), _jsx(Text, { className: 'line' })] })), _jsx(View, Object.assign({ className: 'container' }, { children: classifyItem.childList.map((goodsItem) => {
|
|
8
|
-
return (_jsxs(View, Object.assign({ className: 'classifyFloorGoodsItem' }, { children: [_jsx("img", { src: goodsItem.goodsClassLogo, className: 'logo' }), _jsx(Text, Object.assign({ className: 'title' }, { children: goodsItem.goodsClassName }))] }), goodsItem.goodsClassCode));
|
|
19
|
+
return (_jsxs(View, Object.assign({ onClick: switchImpl, className: 'classifyFloorGoodsItem' }, { children: [_jsx("img", { src: goodsItem.goodsClassLogo, className: 'logo' }), _jsx(Text, Object.assign({ className: 'title' }, { children: goodsItem.goodsClassName }))] }), goodsItem.goodsClassCode));
|
|
9
20
|
}) }))] }), classifyItem.goodsClassCode));
|
|
10
21
|
}) }), item.goodsClassCode)));
|
|
11
22
|
};
|