@puresnake/snake-ui 0.0.0-stage → 0.0.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/LICENSE +21 -0
- package/changelog.md +1 -0
- package/components/snake-activity-list/snake-activity-list.vue +365 -0
- package/components/snake-activity-list/types.ts +29 -0
- package/components/snake-auxiliary-segmentation/snake-auxiliary-segmentation.vue +44 -0
- package/components/snake-auxiliary-segmentation/types.ts +5 -0
- package/components/snake-button/snake-button.vue +357 -0
- package/components/snake-button/types.ts +103 -0
- package/components/snake-button-sort/snake-button-sort.vue +72 -0
- package/components/snake-button-sort/types.ts +22 -0
- package/components/snake-calendar/snake-calendar.vue +998 -0
- package/components/snake-calendar/types.ts +189 -0
- package/components/snake-cell-group/snake-cell-group.vue +55 -0
- package/components/snake-cell-group/types.ts +19 -0
- package/components/snake-cell-item/snake-cell-item.vue +159 -0
- package/components/snake-cell-item/types.ts +66 -0
- package/components/snake-checkbox/snake-checkbox.vue +264 -0
- package/components/snake-checkbox/types.ts +70 -0
- package/components/snake-checkbox-group/snake-checkbox-group.vue +154 -0
- package/components/snake-checkbox-group/types.ts +52 -0
- package/components/snake-cms/blocks/v2/cms-v2-carousel.vue +87 -0
- package/components/snake-cms/blocks/v2/cms-v2-coupon.vue +25 -0
- package/components/snake-cms/blocks/v2/cms-v2-custom.vue +12 -0
- package/components/snake-cms/blocks/v2/cms-v2-divider.vue +33 -0
- package/components/snake-cms/blocks/v2/cms-v2-floatbutton.vue +28 -0
- package/components/snake-cms/blocks/v2/cms-v2-goods-list.vue +150 -0
- package/components/snake-cms/blocks/v2/cms-v2-hotzone.vue +41 -0
- package/components/snake-cms/blocks/v2/cms-v2-images.vue +41 -0
- package/components/snake-cms/blocks/v2/cms-v2-magiccube.vue +93 -0
- package/components/snake-cms/blocks/v2/cms-v2-notice.vue +80 -0
- package/components/snake-cms/blocks/v2/cms-v2-popup.vue +46 -0
- package/components/snake-cms/blocks/v2/cms-v2-richtext.vue +18 -0
- package/components/snake-cms/blocks/v2/cms-v2-search.vue +115 -0
- package/components/snake-cms/blocks/v2/cms-v2-video.vue +25 -0
- package/components/snake-cms/blocks/v2/shared.ts +84 -0
- package/components/snake-cms/snake-cms.vue +409 -0
- package/components/snake-cms/types.ts +50 -0
- package/components/snake-commodity-search/snake-commodity-search.vue +234 -0
- package/components/snake-commodity-search/types.ts +11 -0
- package/components/snake-config-provider/snake-config-provider.vue +61 -0
- package/components/snake-config-provider/types.ts +22 -0
- package/components/snake-count-down/snake-count-down.vue +231 -0
- package/components/snake-count-down/types.ts +103 -0
- package/components/snake-coupon/snake-coupon.vue +209 -0
- package/components/snake-coupon/types.ts +21 -0
- package/components/snake-custom-module/snake-custom-module.vue +25 -0
- package/components/snake-custom-module/types.ts +11 -0
- package/components/snake-drop-menu/snake-drop-menu.vue +123 -0
- package/components/snake-drop-menu/types.ts +95 -0
- package/components/snake-drop-menu-item/snake-drop-menu-item.vue +181 -0
- package/components/snake-drop-menu-item/types.ts +48 -0
- package/components/snake-empty/snake-empty.vue +100 -0
- package/components/snake-empty/types.ts +48 -0
- package/components/snake-filter-sorts/filter-page.vue +695 -0
- package/components/snake-filter-sorts/snake-filter-sorts.vue +185 -0
- package/components/snake-filter-sorts/types.ts +57 -0
- package/components/snake-floating-bubble/snake-floating-bubble.vue +157 -0
- package/components/snake-floating-bubble/types.ts +43 -0
- package/components/snake-follow/snake-follow.vue +18 -0
- package/components/snake-follow/types.ts +2 -0
- package/components/snake-form/snake-form.vue +124 -0
- package/components/snake-form/types.ts +96 -0
- package/components/snake-form-item/snake-form-item.vue +331 -0
- package/components/snake-form-item/types.ts +70 -0
- package/components/snake-goods-list/snake-goods-list.vue +792 -0
- package/components/snake-goods-list/types.ts +55 -0
- package/components/snake-graphic-navigation/snake-graphic-navigation.vue +198 -0
- package/components/snake-graphic-navigation/types.ts +43 -0
- package/components/snake-icon/icon-names.ts +222 -0
- package/components/snake-icon/snake-icon.vue +220 -0
- package/components/snake-icon/types.ts +45 -0
- package/components/snake-image/snake-image.vue +230 -0
- package/components/snake-image/types.ts +70 -0
- package/components/snake-images/snake-images.vue +80 -0
- package/components/snake-images/types.ts +5 -0
- package/components/snake-index-anchor/snake-index-anchor.vue +83 -0
- package/components/snake-index-anchor/types.ts +14 -0
- package/components/snake-index-list/anchor-registry.ts +80 -0
- package/components/snake-index-list/snake-index-list.vue +259 -0
- package/components/snake-index-list/types.ts +115 -0
- package/components/snake-index-list-panel/snake-index-list-panel.vue +277 -0
- package/components/snake-index-list-panel/types.ts +10 -0
- package/components/snake-input/snake-input.vue +225 -0
- package/components/snake-input/types.ts +99 -0
- package/components/snake-jump-applet/snake-jump-applet.vue +99 -0
- package/components/snake-jump-applet/types.ts +17 -0
- package/components/snake-line/snake-line.vue +42 -0
- package/components/snake-line/types.ts +30 -0
- package/components/snake-line-progress/snake-line-progress.vue +105 -0
- package/components/snake-line-progress/types.ts +26 -0
- package/components/snake-link/snake-link.vue +74 -0
- package/components/snake-link/types.ts +30 -0
- package/components/snake-list-switching/components/tree-select/index.vue +156 -0
- package/components/snake-list-switching/snake-list-switching.vue +1285 -0
- package/components/snake-list-switching/types.ts +11 -0
- package/components/snake-loading/snake-loading.vue +241 -0
- package/components/snake-loading/types.ts +34 -0
- package/components/snake-loadmore/snake-loadmore.vue +103 -0
- package/components/snake-loadmore/types.ts +56 -0
- package/components/snake-magic-cube/snake-magic-cube.vue +622 -0
- package/components/snake-magic-cube/types.ts +5 -0
- package/components/snake-modal/snake-modal.vue +434 -0
- package/components/snake-modal/types.ts +71 -0
- package/components/snake-navbar/snake-navbar.vue +194 -0
- package/components/snake-navbar/types.ts +54 -0
- package/components/snake-no-network/snake-no-network.vue +125 -0
- package/components/snake-no-network/types.ts +27 -0
- package/components/snake-notice/snake-notice.vue +44 -0
- package/components/snake-notice/types.ts +5 -0
- package/components/snake-notice-bar/snake-notice-bar.vue +336 -0
- package/components/snake-notice-bar/types.ts +82 -0
- package/components/snake-overlay/snake-overlay.vue +73 -0
- package/components/snake-overlay/types.ts +35 -0
- package/components/snake-page-popup/snake-page-popup.vue +146 -0
- package/components/snake-page-popup/types.ts +28 -0
- package/components/snake-parse/audio/audio.vue +286 -0
- package/components/snake-parse/audio/context.js +11 -0
- package/components/snake-parse/audio/index.js +34 -0
- package/components/snake-parse/node/node.vue +830 -0
- package/components/snake-parse/parser.js +1480 -0
- package/components/snake-parse/snake-parse.vue +548 -0
- package/components/snake-parse/static/app-plus/snake-parse/js/handler.js +109 -0
- package/components/snake-parse/static/app-plus/snake-parse/js/uni.webview.js +0 -0
- package/components/snake-parse/static/app-plus/snake-parse/js/uni.webview.min.js +1 -0
- package/components/snake-parse/static/app-plus/snake-parse/local.html +3 -0
- package/components/snake-parse/style/index.js +132 -0
- package/components/snake-parse/style/parser.js +175 -0
- package/components/snake-parse/types.ts +49 -0
- package/components/snake-picture-ads/snake-picture-ads.vue +292 -0
- package/components/snake-picture-ads/types.ts +5 -0
- package/components/snake-popup/snake-popup.vue +348 -0
- package/components/snake-popup/types.ts +88 -0
- package/components/snake-qr-code/qrcode.ts +1214 -0
- package/components/snake-qr-code/snake-qr-code.vue +408 -0
- package/components/snake-qr-code/types.ts +78 -0
- package/components/snake-radio/snake-radio.vue +271 -0
- package/components/snake-radio/types.ts +64 -0
- package/components/snake-radio-group/snake-radio-group.vue +98 -0
- package/components/snake-radio-group/types.ts +48 -0
- package/components/snake-read-more/snake-read-more.vue +140 -0
- package/components/snake-read-more/types.ts +53 -0
- package/components/snake-rich-text/snake-rich-text.vue +24 -0
- package/components/snake-rich-text/types.ts +5 -0
- package/components/snake-root-portal/snake-root-portal.vue +92 -0
- package/components/snake-root-portal/types.ts +9 -0
- package/components/snake-search/snake-search.vue +202 -0
- package/components/snake-search/types.ts +84 -0
- package/components/snake-select/snake-select.vue +371 -0
- package/components/snake-select/types.ts +75 -0
- package/components/snake-skeleton/snake-skeleton.vue +104 -0
- package/components/snake-skeleton/types.ts +32 -0
- package/components/snake-skeleton-item/snake-skeleton-item.vue +90 -0
- package/components/snake-skeleton-item/types.ts +30 -0
- package/components/snake-slider/snake-slider.vue +249 -0
- package/components/snake-slider/types.ts +59 -0
- package/components/snake-sticky/snake-sticky.vue +178 -0
- package/components/snake-sticky/types.ts +48 -0
- package/components/snake-subsection/snake-subsection.vue +188 -0
- package/components/snake-subsection/types.ts +54 -0
- package/components/snake-swiper/snake-swiper.vue +229 -0
- package/components/snake-swiper/types.ts +79 -0
- package/components/snake-switch/snake-switch.vue +100 -0
- package/components/snake-switch/types.ts +41 -0
- package/components/snake-tabbar/snake-tabbar.vue +306 -0
- package/components/snake-tabbar/types.ts +93 -0
- package/components/snake-tabs/snake-tabs.vue +305 -0
- package/components/snake-tabs/types.ts +79 -0
- package/components/snake-text/snake-text.vue +292 -0
- package/components/snake-text/types.ts +100 -0
- package/components/snake-textarea/snake-textarea.vue +171 -0
- package/components/snake-textarea/types.ts +79 -0
- package/components/snake-toast/snake-toast.vue +330 -0
- package/components/snake-toast/types.ts +55 -0
- package/components/snake-tooltip/position.ts +33 -0
- package/components/snake-tooltip/snake-tooltip.vue +339 -0
- package/components/snake-tooltip/types.ts +80 -0
- package/components/snake-transition/snake-transition.vue +315 -0
- package/components/snake-transition/types.ts +65 -0
- package/components/snake-upload/snake-upload.vue +1801 -0
- package/components/snake-upload/types.ts +256 -0
- package/components/snake-videos/snake-videos.vue +122 -0
- package/components/snake-videos/types.ts +7 -0
- package/iconfont.css +881 -0
- package/index.d.ts +7 -0
- package/index.scss +26 -0
- package/index.ts +94 -0
- package/libs/cms/blocks.ts +103 -0
- package/libs/cms/config.ts +25 -0
- package/libs/cms/index.ts +7 -0
- package/libs/cms/normalize.ts +135 -0
- package/libs/cms/resolve.ts +12 -0
- package/libs/cms/types.ts +164 -0
- package/libs/cms/use-commerce.ts +385 -0
- package/libs/cms/v2.ts +193 -0
- package/libs/config/index.ts +4 -0
- package/libs/config/modal.ts +93 -0
- package/libs/config/state.ts +33 -0
- package/libs/config/theme.ts +351 -0
- package/libs/config/toast.ts +71 -0
- package/libs/config/types.ts +135 -0
- package/libs/config/zIndex.ts +44 -0
- package/libs/css/color.scss +105 -0
- package/libs/css/common.scss +171 -0
- package/libs/css/style.h5.scss +7 -0
- package/libs/css/style.mp.scss +7 -0
- package/libs/css/style.theme.scss +70 -0
- package/libs/css/style.vue.scss +140 -0
- package/libs/form/async-validator.min.d.ts +75 -0
- package/libs/form/async-validator.min.js +3 -0
- package/libs/form/index.ts +3 -0
- package/libs/form/path.ts +40 -0
- package/libs/form/types.ts +51 -0
- package/libs/form/validate.ts +149 -0
- package/libs/foundation.ts +96 -0
- package/libs/function/$parent.ts +33 -0
- package/libs/function/clipboard.ts +13 -0
- package/libs/function/color.ts +55 -0
- package/libs/function/debounce.ts +34 -0
- package/libs/function/deepClone.ts +30 -0
- package/libs/function/deepMerge.ts +25 -0
- package/libs/function/emitter.ts +30 -0
- package/libs/function/format.ts +27 -0
- package/libs/function/getParent.ts +53 -0
- package/libs/function/getRect.ts +29 -0
- package/libs/function/guid.ts +11 -0
- package/libs/function/index.ts +31 -0
- package/libs/function/queryParams.ts +73 -0
- package/libs/function/random.ts +6 -0
- package/libs/function/randomArray.ts +14 -0
- package/libs/function/route.ts +155 -0
- package/libs/function/sleep.ts +7 -0
- package/libs/function/style.ts +58 -0
- package/libs/function/styleUtils.ts +83 -0
- package/libs/function/system.ts +14 -0
- package/libs/function/test.ts +202 -0
- package/libs/function/throttle.ts +36 -0
- package/libs/function/timeFormat.ts +27 -0
- package/libs/function/timeFrom.ts +27 -0
- package/libs/function/toast.ts +10 -0
- package/libs/function/trim.ts +11 -0
- package/libs/function/type2icon.ts +11 -0
- package/libs/function/unit.ts +45 -0
- package/libs/hooks/index.ts +11 -0
- package/libs/hooks/useChildren.ts +125 -0
- package/libs/hooks/useColor.ts +5 -0
- package/libs/hooks/useDebounce.ts +5 -0
- package/libs/hooks/useLocale.ts +13 -0
- package/libs/hooks/useModal.ts +131 -0
- package/libs/hooks/useParent.ts +62 -0
- package/libs/hooks/useRect.ts +44 -0
- package/libs/hooks/useRouter.ts +5 -0
- package/libs/hooks/useTheme.ts +31 -0
- package/libs/hooks/useThrottle.ts +5 -0
- package/libs/hooks/useToast.ts +116 -0
- package/libs/index.ts +18 -0
- package/libs/request/auto-http.ts +1 -0
- package/libs/request/index.ts +343 -0
- package/libs/runtime/accessors.ts +55 -0
- package/libs/runtime/context.ts +40 -0
- package/libs/runtime/index.ts +18 -0
- package/libs/runtime/types.ts +49 -0
- package/libs/util/calendar.ts +6 -0
- package/locale/index.ts +130 -0
- package/locale/lang/en-US.ts +67 -0
- package/locale/lang/zh-CN.ts +67 -0
- package/package.json +130 -5
- package/plugins/index.ts +1 -0
- package/plugins/root/README.md +86 -0
- package/plugins/root/index.ts +123 -0
- package/plugins/root/page.ts +77 -0
- package/plugins/root/root.ts +53 -0
- package/plugins/root/utils.ts +137 -0
- package/readme.md +79 -0
- package/theme.scss +118 -0
- package/types/components.d.ts +236 -0
- package/types/global.d.ts +21 -0
- package/types/index.d.ts +6 -0
- package/types/uni-app.d.ts +16 -0
- package/README.md +0 -3
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** GoodsList 数据项。 */
|
|
2
|
+
export interface GoodsListItem extends Record<string, any> {
|
|
3
|
+
/** 数据唯一标识。 */
|
|
4
|
+
id?: string | number;
|
|
5
|
+
/** 图片地址。 */
|
|
6
|
+
image?: string;
|
|
7
|
+
/** 数据项名称或唯一标识。 */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** 商品名称。 */
|
|
10
|
+
goodsName?: string;
|
|
11
|
+
/** 商品价格。 */
|
|
12
|
+
price?: string | number;
|
|
13
|
+
/** 商品折扣价格。 */
|
|
14
|
+
discountPrice?: string | number;
|
|
15
|
+
/** 商品数量或库存。 */
|
|
16
|
+
amount?: number;
|
|
17
|
+
/** 当前状态。 */
|
|
18
|
+
status?: string | number;
|
|
19
|
+
/** 商品关联的活动信息。 */
|
|
20
|
+
activityInfo?: Record<string, any>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** GoodsList 组件的公开属性。 */
|
|
24
|
+
export interface GoodsListProps<Item extends GoodsListItem = GoodsListItem> {
|
|
25
|
+
/** 商品数据列表。 */
|
|
26
|
+
goodsList?: Item[];
|
|
27
|
+
/** 背景颜色。 */
|
|
28
|
+
bgColor?: string;
|
|
29
|
+
/** 商品列表展示类型。 */
|
|
30
|
+
listType?: string;
|
|
31
|
+
/** 列表与页面边缘的间距。 */
|
|
32
|
+
pageMargin?: number;
|
|
33
|
+
/** 商品卡片之间的间距。 */
|
|
34
|
+
imageMargin?: number;
|
|
35
|
+
/** 商品卡片布局类型。 */
|
|
36
|
+
commodityType?: number;
|
|
37
|
+
/** 是否显示拍卖参与人数。 */
|
|
38
|
+
attendanceShow?: boolean;
|
|
39
|
+
/** 组件使用的可替换资源地址。 */
|
|
40
|
+
assets?: Record<string, string>;
|
|
41
|
+
/** 商品排列方式。 */
|
|
42
|
+
layout?: 'grid' | 'swipe';
|
|
43
|
+
/** 商品卡片圆角,单位 rpx。 */
|
|
44
|
+
cardRadius?: number;
|
|
45
|
+
/** 是否显示营销标签。 */
|
|
46
|
+
showTag?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** GoodsList 组件的事件契约。 */
|
|
50
|
+
export type GoodsListEmits<Item extends GoodsListItem = GoodsListItem> = {
|
|
51
|
+
/** item-click 事件携带的参数。 */
|
|
52
|
+
'item-click': [item: Item, index: number];
|
|
53
|
+
/** handlerOffer 事件携带的参数。 */
|
|
54
|
+
handlerOffer: [item: Item, index: number];
|
|
55
|
+
};
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view v-if="imageList.length" class="graphicnavigation">
|
|
3
|
+
<!-- 鍥哄畾鍒楄〃 -->
|
|
4
|
+
<block v-if="datas.imgStyle === 0">
|
|
5
|
+
<view class="defaultNavigation" :style="{ backgroundColor: datas.backgroundColor, flexWrap: 'wrap' }">
|
|
6
|
+
<view
|
|
7
|
+
class="navigationList__item"
|
|
8
|
+
v-for="(item, index) in imageList"
|
|
9
|
+
:key="index"
|
|
10
|
+
:style="{ padding: ` 0 ${datas.imgMargin}rpx`, width: 100 / imageList.length + '%' }"
|
|
11
|
+
@click="handleClick(item, index)"
|
|
12
|
+
>
|
|
13
|
+
<image
|
|
14
|
+
class="image-warp"
|
|
15
|
+
:src="item.src"
|
|
16
|
+
:style="{ borderRadius: pxToRpx(datas.borderRadius) }"
|
|
17
|
+
mode="widthFix"
|
|
18
|
+
v-if="datas.navigationType === 0"
|
|
19
|
+
></image>
|
|
20
|
+
<text class="text" :style="[textStyle]" v-if="item.text">{{ item.text }}</text>
|
|
21
|
+
</view>
|
|
22
|
+
</view>
|
|
23
|
+
</block>
|
|
24
|
+
<!-- 妯悜婊戝姩鍒楄〃 -->
|
|
25
|
+
<block v-if="datas.imgStyle === 1">
|
|
26
|
+
<view
|
|
27
|
+
class="scrollList-box"
|
|
28
|
+
:style="{
|
|
29
|
+
backgroundColor: datas.backgroundColor
|
|
30
|
+
}"
|
|
31
|
+
>
|
|
32
|
+
<!-- <snake-scroll-list
|
|
33
|
+
:indicatorWidth="50"
|
|
34
|
+
:indicatorBarWidth="25"
|
|
35
|
+
:indicator="datas.showSlider && datas.imageList.length > datas.showSize"
|
|
36
|
+
indicatorColor="var(--snake-color-border, #cccccc)"
|
|
37
|
+
indicatorActiveColor="var(--snake-color-text, #606266)">
|
|
38
|
+
<view class="scroll-list">
|
|
39
|
+
<view class="scroll-list__line" v-for="(scrollItem, scrollIndex) in scrollList" :key="scrollIndex">
|
|
40
|
+
<view
|
|
41
|
+
class="scroll-list__line__item"
|
|
42
|
+
v-for="(item, index) in scrollItem.data"
|
|
43
|
+
:key="index"
|
|
44
|
+
:class="[index === item.length - 1 && 'scroll-list__line__item--no-margin-right']"
|
|
45
|
+
:style="{
|
|
46
|
+
minWidth: 100 / datas.showSize + '%',
|
|
47
|
+
}">
|
|
48
|
+
<image class="scroll-list__line__item__image" :src="item.src" mode="widthFix"></image>
|
|
49
|
+
<text class="scroll-list__line__item__text">{{ item.text }}</text>
|
|
50
|
+
</view>
|
|
51
|
+
</view>
|
|
52
|
+
</view>
|
|
53
|
+
</snake-scroll-list> -->
|
|
54
|
+
</view>
|
|
55
|
+
</block>
|
|
56
|
+
</view>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<script>
|
|
60
|
+
/**
|
|
61
|
+
* @component GraphicNavigation
|
|
62
|
+
* @description 使用图片与文字组成入口导航,并根据小程序审核状态过滤特定入口。
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
import { pxToRpx } from '../../libs/function/unit';
|
|
66
|
+
|
|
67
|
+
export default {
|
|
68
|
+
name: 'snake-graphic-navigation',
|
|
69
|
+
options: { virtualHost: true, styleIsolation: 'shared' },
|
|
70
|
+
props: { datas: Object },
|
|
71
|
+
emits: ['click'],
|
|
72
|
+
data() {
|
|
73
|
+
return {};
|
|
74
|
+
},
|
|
75
|
+
methods: {
|
|
76
|
+
pxToRpx,
|
|
77
|
+
handleClick(item, index) {
|
|
78
|
+
this.$emit('click', { item, index });
|
|
79
|
+
if (item.url) uni.$snake.navTo(item.url);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
computed: {
|
|
83
|
+
imageList() {
|
|
84
|
+
return this.datas?.imageList || [];
|
|
85
|
+
},
|
|
86
|
+
// 鏂囧瓧鏍峰紡
|
|
87
|
+
textStyle() {
|
|
88
|
+
const style = {};
|
|
89
|
+
style.color = this.datas.textColor;
|
|
90
|
+
style.fontSize = pxToRpx(this.datas.textSize);
|
|
91
|
+
style.lineHeight = `${this.datas.textHeight}px`;
|
|
92
|
+
return style;
|
|
93
|
+
},
|
|
94
|
+
// 妯悜婊戝姩鍒楄〃
|
|
95
|
+
scrollList() {
|
|
96
|
+
// 鎷疯礉鍘熸暟缁?闃叉splice鏂规硶褰卞搷浜嗗師鏁扮粍
|
|
97
|
+
const copyList = [...this.datas.imageList];
|
|
98
|
+
const list = [];
|
|
99
|
+
if (this.datas.imageList.length <= 5) {
|
|
100
|
+
list.push({ data: this.datas.imageList });
|
|
101
|
+
} else {
|
|
102
|
+
// 鏁扮粍闀垮害澶т簬绛変簬20骞崇瓑鍒?浠斤紝鍚﹀垯鍒嗘垚涓や唤
|
|
103
|
+
const row = 2;
|
|
104
|
+
// if (this.datas.imageList.length >= 20) {
|
|
105
|
+
// row = 3
|
|
106
|
+
// }
|
|
107
|
+
const middleIndex = Math.ceil(this.datas.imageList.length / row);
|
|
108
|
+
list.push({ data: copyList.splice(0, middleIndex) });
|
|
109
|
+
list.push({ data: copyList.splice(-middleIndex) });
|
|
110
|
+
// if (row == 3) {
|
|
111
|
+
// list.push({ data: copyList })
|
|
112
|
+
// }
|
|
113
|
+
}
|
|
114
|
+
return list;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<style scoped lang="scss">
|
|
121
|
+
.graphicnavigation {
|
|
122
|
+
width: 100%;
|
|
123
|
+
|
|
124
|
+
.defaultNavigation {
|
|
125
|
+
box-sizing: border-box;
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: row;
|
|
128
|
+
align-items: center;
|
|
129
|
+
width: 100%;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.navigationList__item {
|
|
133
|
+
box-sizing: border-box;
|
|
134
|
+
display: flex;
|
|
135
|
+
flex-direction: column;
|
|
136
|
+
align-items: center;
|
|
137
|
+
|
|
138
|
+
.image-warp {
|
|
139
|
+
box-sizing: border-box;
|
|
140
|
+
width: 100%;
|
|
141
|
+
height: 100%;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.text {
|
|
145
|
+
box-sizing: border-box;
|
|
146
|
+
width: 100%;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
text-overflow: ellipsis;
|
|
149
|
+
font-size: 12px;
|
|
150
|
+
text-align: center;
|
|
151
|
+
white-space: nowrap;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// 妯悜婊戝姩鍒楄〃
|
|
157
|
+
.scrollList-box {
|
|
158
|
+
box-sizing: border-box;
|
|
159
|
+
width: 100%;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.scroll-list {
|
|
163
|
+
display: flex;
|
|
164
|
+
flex-direction: column;
|
|
165
|
+
width: 100%;
|
|
166
|
+
|
|
167
|
+
&__line {
|
|
168
|
+
display: flex;
|
|
169
|
+
margin-top: 10px;
|
|
170
|
+
|
|
171
|
+
&__item {
|
|
172
|
+
text-align: center;
|
|
173
|
+
// display: flex;
|
|
174
|
+
// align-items: center;
|
|
175
|
+
// flex-direction: column;
|
|
176
|
+
// margin-right: 15px;
|
|
177
|
+
|
|
178
|
+
&__image {
|
|
179
|
+
width: 61px;
|
|
180
|
+
height: 48px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&__text {
|
|
184
|
+
// text-align: center;
|
|
185
|
+
display: flex;
|
|
186
|
+
justify-content: center;
|
|
187
|
+
font-size: 12px;
|
|
188
|
+
// margin-top: 5px;
|
|
189
|
+
color: var(--snake-color-text-secondary, #666666);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&--no-margin-right {
|
|
193
|
+
margin-right: 0;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
</style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** GraphicNavigation 数据项。 */
|
|
2
|
+
export interface GraphicNavigationItem {
|
|
3
|
+
/** 资源地址。 */
|
|
4
|
+
src?: string;
|
|
5
|
+
/** 展示文本。 */
|
|
6
|
+
text?: string;
|
|
7
|
+
/** 点击后跳转地址。 */
|
|
8
|
+
url?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** GraphicNavigation 配置数据。 */
|
|
12
|
+
export interface GraphicNavigationData {
|
|
13
|
+
/** img style 配置。 */
|
|
14
|
+
imgStyle?: 0 | 1;
|
|
15
|
+
/** image list 配置。 */
|
|
16
|
+
imageList?: GraphicNavigationItem[];
|
|
17
|
+
/** background color 配置。 */
|
|
18
|
+
backgroundColor?: string;
|
|
19
|
+
/** img margin 配置。 */
|
|
20
|
+
imgMargin?: number;
|
|
21
|
+
/** 圆角尺寸。 */
|
|
22
|
+
borderRadius?: number;
|
|
23
|
+
/** navigation type 配置。 */
|
|
24
|
+
navigationType?: number;
|
|
25
|
+
/** 文字颜色。 */
|
|
26
|
+
textColor?: string;
|
|
27
|
+
/** text size 配置。 */
|
|
28
|
+
textSize?: number;
|
|
29
|
+
/** text height 配置。 */
|
|
30
|
+
textHeight?: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** GraphicNavigation 组件的公开属性。 */
|
|
34
|
+
export interface GraphicNavigationProps {
|
|
35
|
+
/** CMS 装修组件配置数据。 */
|
|
36
|
+
datas?: GraphicNavigationData;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** GraphicNavigation 点击入口时发出的事件。 */
|
|
40
|
+
export interface GraphicNavigationEmits {
|
|
41
|
+
/** 被点击的入口及其下标。 */
|
|
42
|
+
click: [payload: { item: GraphicNavigationItem; index: number }];
|
|
43
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/** 内置字体图标名称,与 iconfont.css 中的 sicon-* 规则保持一致。 */
|
|
2
|
+
export const iconNames = [
|
|
3
|
+
'wifi-off',
|
|
4
|
+
'wifi',
|
|
5
|
+
'woman',
|
|
6
|
+
'zh',
|
|
7
|
+
'zhifubao',
|
|
8
|
+
'zhifubao-circle-fill',
|
|
9
|
+
'zhihu-circle-fill',
|
|
10
|
+
'zhihu',
|
|
11
|
+
'zhuanfa',
|
|
12
|
+
'account',
|
|
13
|
+
'arrow-down-fill',
|
|
14
|
+
'arrow-down',
|
|
15
|
+
'account-fill',
|
|
16
|
+
'arrow-downward',
|
|
17
|
+
'apple-fill',
|
|
18
|
+
'android-fill',
|
|
19
|
+
'android-circle-fill',
|
|
20
|
+
'arrow-left',
|
|
21
|
+
'arrow-leftward',
|
|
22
|
+
'arrow-left-double',
|
|
23
|
+
'arrow-right',
|
|
24
|
+
'arrow-rightward',
|
|
25
|
+
'arrow-up',
|
|
26
|
+
'arrow-right-double',
|
|
27
|
+
'arrow-upward',
|
|
28
|
+
'arrow-up-fill',
|
|
29
|
+
'bag-fill',
|
|
30
|
+
'attach',
|
|
31
|
+
'backspace',
|
|
32
|
+
'bag',
|
|
33
|
+
'baidu',
|
|
34
|
+
'bell',
|
|
35
|
+
'baidu-circle-fill',
|
|
36
|
+
'bell-fill',
|
|
37
|
+
'bookmark',
|
|
38
|
+
'bookmark-fill',
|
|
39
|
+
'calendar',
|
|
40
|
+
'calendar-fill',
|
|
41
|
+
'camera',
|
|
42
|
+
'car',
|
|
43
|
+
'camera-fill',
|
|
44
|
+
'car-fill',
|
|
45
|
+
'chat',
|
|
46
|
+
'checkbox-mark',
|
|
47
|
+
'chat-fill',
|
|
48
|
+
'checkmark',
|
|
49
|
+
'clock-fill',
|
|
50
|
+
'chrome-circle-fill',
|
|
51
|
+
'checkmark-circle-fill',
|
|
52
|
+
'clock',
|
|
53
|
+
'checkmark-circle',
|
|
54
|
+
'close',
|
|
55
|
+
'close-circle',
|
|
56
|
+
'column-line',
|
|
57
|
+
'coupon',
|
|
58
|
+
'close-circle-fill',
|
|
59
|
+
'coupon-fill',
|
|
60
|
+
'cut',
|
|
61
|
+
'edit-pen',
|
|
62
|
+
'download',
|
|
63
|
+
'edit-pen-fill',
|
|
64
|
+
'email-fill',
|
|
65
|
+
'email',
|
|
66
|
+
'empty-address',
|
|
67
|
+
'empty-car',
|
|
68
|
+
'empty-data',
|
|
69
|
+
'empty-favor',
|
|
70
|
+
'empty-coupon',
|
|
71
|
+
'empty-history',
|
|
72
|
+
'empty-message',
|
|
73
|
+
'empty-list',
|
|
74
|
+
'empty-news',
|
|
75
|
+
'empty-order',
|
|
76
|
+
'empty-page',
|
|
77
|
+
'empty-permission',
|
|
78
|
+
'empty-wifi',
|
|
79
|
+
'empty-search',
|
|
80
|
+
'en',
|
|
81
|
+
'error',
|
|
82
|
+
'error-circle',
|
|
83
|
+
'error-circle-fill',
|
|
84
|
+
'eye-off',
|
|
85
|
+
'eye-fill',
|
|
86
|
+
'eye',
|
|
87
|
+
'facebook',
|
|
88
|
+
'eye-off-outline',
|
|
89
|
+
'file-text-fill',
|
|
90
|
+
'facebook-circle-fill',
|
|
91
|
+
'file-text',
|
|
92
|
+
'fingerprint',
|
|
93
|
+
'gift',
|
|
94
|
+
'google',
|
|
95
|
+
'github-circle-fill',
|
|
96
|
+
'gift-fill',
|
|
97
|
+
'heart-fill',
|
|
98
|
+
'google-circle-fill',
|
|
99
|
+
'heart',
|
|
100
|
+
'grid',
|
|
101
|
+
'grid-fill',
|
|
102
|
+
'home-fill',
|
|
103
|
+
'home',
|
|
104
|
+
'hourglass',
|
|
105
|
+
'hourglass-half-fill',
|
|
106
|
+
'ie',
|
|
107
|
+
'info',
|
|
108
|
+
'IE-circle-fill',
|
|
109
|
+
'integral',
|
|
110
|
+
'info-circle-fill',
|
|
111
|
+
'info-circle',
|
|
112
|
+
'integral-fill',
|
|
113
|
+
'level',
|
|
114
|
+
'list',
|
|
115
|
+
'kefu-ermai',
|
|
116
|
+
'lock',
|
|
117
|
+
'list-dot',
|
|
118
|
+
'lock-fill',
|
|
119
|
+
'lock-open',
|
|
120
|
+
'man',
|
|
121
|
+
'man-add',
|
|
122
|
+
'lock-opened-fill',
|
|
123
|
+
'man-add-fill',
|
|
124
|
+
'map',
|
|
125
|
+
'man-delete',
|
|
126
|
+
'map-fill',
|
|
127
|
+
'md-person-add',
|
|
128
|
+
'mic',
|
|
129
|
+
'md-person-fill',
|
|
130
|
+
'minus',
|
|
131
|
+
'mic-off',
|
|
132
|
+
'minus-circle',
|
|
133
|
+
'minus-circle-fill',
|
|
134
|
+
'minus-people-fill',
|
|
135
|
+
'moments',
|
|
136
|
+
'minus-square-fill',
|
|
137
|
+
'moments-circel-fill',
|
|
138
|
+
'more-dot-fill',
|
|
139
|
+
'more-circle-fill',
|
|
140
|
+
'more-circle',
|
|
141
|
+
'nav-back',
|
|
142
|
+
'nav-back-arrow',
|
|
143
|
+
'pause',
|
|
144
|
+
'order',
|
|
145
|
+
'pause-circle',
|
|
146
|
+
'phone',
|
|
147
|
+
'pause-circle-fill',
|
|
148
|
+
'person-delete-fill',
|
|
149
|
+
'phone-fill',
|
|
150
|
+
'photo-fill',
|
|
151
|
+
'photo',
|
|
152
|
+
'play-left',
|
|
153
|
+
'play-right',
|
|
154
|
+
'play-circle-fill',
|
|
155
|
+
'play-circle',
|
|
156
|
+
'play-right-fill',
|
|
157
|
+
'plus',
|
|
158
|
+
'plus-circle',
|
|
159
|
+
'plus-circle-fill',
|
|
160
|
+
'plus-people-fill',
|
|
161
|
+
'qq-circle-fill',
|
|
162
|
+
'pushpin-fill',
|
|
163
|
+
'pushpin',
|
|
164
|
+
'question-circle-fill',
|
|
165
|
+
'question',
|
|
166
|
+
'rewind-left-fill',
|
|
167
|
+
'qq-fill',
|
|
168
|
+
'qzone',
|
|
169
|
+
'qzone-circle-fill',
|
|
170
|
+
'red-packet',
|
|
171
|
+
'rewind-right-fill',
|
|
172
|
+
'rmb',
|
|
173
|
+
'rewind-right',
|
|
174
|
+
'search',
|
|
175
|
+
'server-fill',
|
|
176
|
+
'setting-fill',
|
|
177
|
+
'setting',
|
|
178
|
+
'shopping-cart',
|
|
179
|
+
'shopping-cart-fill',
|
|
180
|
+
'share-fill',
|
|
181
|
+
'share',
|
|
182
|
+
'thumb-up',
|
|
183
|
+
'thumb-up-fill',
|
|
184
|
+
'trash',
|
|
185
|
+
'volume-fill',
|
|
186
|
+
'trash-fill',
|
|
187
|
+
'volume',
|
|
188
|
+
'twitter-circle-fill',
|
|
189
|
+
'volume-off-fill',
|
|
190
|
+
'warning',
|
|
191
|
+
'volume-up',
|
|
192
|
+
'warning-fill',
|
|
193
|
+
'weibo',
|
|
194
|
+
'weixin-fill',
|
|
195
|
+
'weixin-circle-fill',
|
|
196
|
+
'weibo-circle-fill',
|
|
197
|
+
'plus-square-fill',
|
|
198
|
+
'rmb-circle-fill',
|
|
199
|
+
'rmb-circle',
|
|
200
|
+
'reload',
|
|
201
|
+
'rewind-left',
|
|
202
|
+
'red-packet-fill',
|
|
203
|
+
'scan',
|
|
204
|
+
'server-man',
|
|
205
|
+
'skip-back-left',
|
|
206
|
+
'skip-forward-right',
|
|
207
|
+
'star',
|
|
208
|
+
'taobao-circle-fill',
|
|
209
|
+
'taobao',
|
|
210
|
+
'thumb-down-fill',
|
|
211
|
+
'thumb-down',
|
|
212
|
+
'twitter',
|
|
213
|
+
'volume-off',
|
|
214
|
+
'volume-up-fill',
|
|
215
|
+
'play-left-fill',
|
|
216
|
+
'question-circle',
|
|
217
|
+
'tags-fill',
|
|
218
|
+
'tags',
|
|
219
|
+
'star-fill'
|
|
220
|
+
] as const;
|
|
221
|
+
|
|
222
|
+
export type IconName = (typeof iconNames)[number];
|