@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,622 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="magiccube"
|
|
4
|
+
:style="{
|
|
5
|
+
'padding-left': datas.pageMargin + 'rpx',
|
|
6
|
+
'padding-right': datas.pageMargin + 'rpx',
|
|
7
|
+
background: datas.bgColor
|
|
8
|
+
}"
|
|
9
|
+
v-if="datas.imageTypeObj"
|
|
10
|
+
>
|
|
11
|
+
<!-- 一行最多6个 -->
|
|
12
|
+
<section class="buju buju0" v-if="datas.rubiksCubeType === 0">
|
|
13
|
+
<view
|
|
14
|
+
class="rubiksCubeType rubiksCubeType0"
|
|
15
|
+
v-for="(item, index) in datas.rowNum"
|
|
16
|
+
:key="index"
|
|
17
|
+
:style="{ width: 100 / datas.rowNum + '%' }"
|
|
18
|
+
>
|
|
19
|
+
<view
|
|
20
|
+
class="image"
|
|
21
|
+
v-if="
|
|
22
|
+
datas.imageTypeObj[datas.rubiksCubeType] &&
|
|
23
|
+
datas.imageTypeObj[datas.rubiksCubeType][index] &&
|
|
24
|
+
datas.imageTypeObj[datas.rubiksCubeType][index].length
|
|
25
|
+
"
|
|
26
|
+
:style="{ width: '100%', padding: `0 ${datas.imgMargin}rpx` }"
|
|
27
|
+
>
|
|
28
|
+
<pictureads
|
|
29
|
+
:datas="{
|
|
30
|
+
swiperType: 1,
|
|
31
|
+
height: datas.heights,
|
|
32
|
+
borderRadius: datas.borderRadius,
|
|
33
|
+
imageList: imageList(datas.imageTypeObj[datas.rubiksCubeType][index]),
|
|
34
|
+
interval: datas.interval
|
|
35
|
+
}"
|
|
36
|
+
></pictureads>
|
|
37
|
+
</view>
|
|
38
|
+
</view>
|
|
39
|
+
</section>
|
|
40
|
+
|
|
41
|
+
<!-- 二左二右 -->
|
|
42
|
+
<section class="buju buju0" v-if="datas.rubiksCubeType === 1">
|
|
43
|
+
<view class="rubiksCubeType rubiksCubeType1" v-for="(item, index) in 4" :key="index" :style="heightStyle">
|
|
44
|
+
<view
|
|
45
|
+
v-if="
|
|
46
|
+
datas.imageTypeObj[datas.rubiksCubeType] &&
|
|
47
|
+
datas.imageTypeObj[datas.rubiksCubeType][index] &&
|
|
48
|
+
datas.imageTypeObj[datas.rubiksCubeType][index].length
|
|
49
|
+
"
|
|
50
|
+
:style="{ width: '100%', padding: `0 ${datas.imgMargin}rpx` }"
|
|
51
|
+
>
|
|
52
|
+
<pictureads
|
|
53
|
+
:datas="{
|
|
54
|
+
swiperType: 1,
|
|
55
|
+
height: datas.heights,
|
|
56
|
+
borderRadius: datas.borderRadius,
|
|
57
|
+
imageList: imageList(datas.imageTypeObj[datas.rubiksCubeType][index]),
|
|
58
|
+
interval: datas.interval
|
|
59
|
+
}"
|
|
60
|
+
></pictureads>
|
|
61
|
+
</view>
|
|
62
|
+
</view>
|
|
63
|
+
</section>
|
|
64
|
+
|
|
65
|
+
<!-- 一左二右 -->
|
|
66
|
+
<view class="buju buju2" :style="[heightStyle]" v-if="datas.rubiksCubeType === 2">
|
|
67
|
+
<view class="rubiksCubeType rubiksCubeType2">
|
|
68
|
+
<view
|
|
69
|
+
v-if="
|
|
70
|
+
datas.imageTypeObj[datas.rubiksCubeType] &&
|
|
71
|
+
datas.imageTypeObj[datas.rubiksCubeType][0] &&
|
|
72
|
+
datas.imageTypeObj[datas.rubiksCubeType][0].length
|
|
73
|
+
"
|
|
74
|
+
:style="{ width: '100%', paddingRight: `${datas.imgMargin}rpx` }"
|
|
75
|
+
>
|
|
76
|
+
<pictureads
|
|
77
|
+
:datas="{
|
|
78
|
+
swiperType: 1,
|
|
79
|
+
height: datas.heights,
|
|
80
|
+
borderRadius: datas.borderRadius,
|
|
81
|
+
imageList: imageList(datas.imageTypeObj[datas.rubiksCubeType][0]),
|
|
82
|
+
interval: datas.interval
|
|
83
|
+
}"
|
|
84
|
+
></pictureads>
|
|
85
|
+
</view>
|
|
86
|
+
</view>
|
|
87
|
+
<view style="display: flex; flex-direction: column; justify-content: space-between; width: 100%">
|
|
88
|
+
<block v-for="(item, index) in 2" :key="index">
|
|
89
|
+
<view
|
|
90
|
+
v-if="
|
|
91
|
+
datas.imageTypeObj[datas.rubiksCubeType] &&
|
|
92
|
+
datas.imageTypeObj[datas.rubiksCubeType][index + 1] &&
|
|
93
|
+
datas.imageTypeObj[datas.rubiksCubeType][index + 1].length
|
|
94
|
+
"
|
|
95
|
+
>
|
|
96
|
+
<pictureads
|
|
97
|
+
:datas="{
|
|
98
|
+
swiperType: 1,
|
|
99
|
+
height: datas.heights / 2 - datas.imgMargin / 2,
|
|
100
|
+
borderRadius: datas.borderRadius,
|
|
101
|
+
imageList: imageList(datas.imageTypeObj[datas.rubiksCubeType][index + 1]),
|
|
102
|
+
interval: datas.interval
|
|
103
|
+
}"
|
|
104
|
+
></pictureads>
|
|
105
|
+
</view>
|
|
106
|
+
</block>
|
|
107
|
+
</view>
|
|
108
|
+
</view>
|
|
109
|
+
|
|
110
|
+
<!-- 一上二下 -->
|
|
111
|
+
<section class="buju buju5" v-if="datas.rubiksCubeType === 3" :style="[heightStyle]">
|
|
112
|
+
<view class="rubiksCubeType hw" :style="{ height: datas.topHeight + '%' }">
|
|
113
|
+
<view
|
|
114
|
+
v-if="
|
|
115
|
+
datas.imageTypeObj[datas.rubiksCubeType] &&
|
|
116
|
+
datas.imageTypeObj[datas.rubiksCubeType][0] &&
|
|
117
|
+
datas.imageTypeObj[datas.rubiksCubeType][0].length
|
|
118
|
+
"
|
|
119
|
+
:style="{ width: '100%', padding: `0 ${datas.imgMargin}rpx ${datas.imgMargin}rpx` }"
|
|
120
|
+
>
|
|
121
|
+
<pictureads
|
|
122
|
+
:datas="{
|
|
123
|
+
swiperType: 1,
|
|
124
|
+
height: datas.heights * (datas.topHeights / 100),
|
|
125
|
+
borderRadius: datas.borderRadius,
|
|
126
|
+
imageList: imageList(datas.imageTypeObj[datas.rubiksCubeType][0]),
|
|
127
|
+
interval: datas.interval
|
|
128
|
+
}"
|
|
129
|
+
></pictureads>
|
|
130
|
+
</view>
|
|
131
|
+
</view>
|
|
132
|
+
<view style="display: flex; width: 100%" :style="{ height: 100 - datas.topHeights + '%' }">
|
|
133
|
+
<view class="rubiksCubeType hw imgtow" v-for="(item, index) in 2" :key="index">
|
|
134
|
+
<view
|
|
135
|
+
v-if="
|
|
136
|
+
datas.imageTypeObj[datas.rubiksCubeType] &&
|
|
137
|
+
datas.imageTypeObj[datas.rubiksCubeType][index + 1] &&
|
|
138
|
+
datas.imageTypeObj[datas.rubiksCubeType][index + 1].length
|
|
139
|
+
"
|
|
140
|
+
:style="{ width: '100%', padding: `${datas.imgMargin}rpx ${datas.imgMargin}rpx 0` }"
|
|
141
|
+
>
|
|
142
|
+
<pictureads
|
|
143
|
+
:datas="{
|
|
144
|
+
swiperType: 1,
|
|
145
|
+
height: datas.heights * ((100 - datas.topHeights) / 100),
|
|
146
|
+
borderRadius: datas.borderRadius,
|
|
147
|
+
imageList: imageList(datas.imageTypeObj[datas.rubiksCubeType][index + 1]),
|
|
148
|
+
interval: datas.interval
|
|
149
|
+
}"
|
|
150
|
+
></pictureads>
|
|
151
|
+
</view>
|
|
152
|
+
</view>
|
|
153
|
+
</view>
|
|
154
|
+
</section>
|
|
155
|
+
|
|
156
|
+
<!-- 一左三右 -->
|
|
157
|
+
<section class="buju buju4" :style="heightStyle" v-if="datas.rubiksCubeType === 4">
|
|
158
|
+
<!-- 左侧 -->
|
|
159
|
+
<view class="rubiksCubeType hw">
|
|
160
|
+
<view
|
|
161
|
+
v-if="
|
|
162
|
+
datas.imageTypeObj[datas.rubiksCubeType] &&
|
|
163
|
+
datas.imageTypeObj[datas.rubiksCubeType][0] &&
|
|
164
|
+
datas.imageTypeObj[datas.rubiksCubeType][0].length
|
|
165
|
+
"
|
|
166
|
+
:style="{ width: '100%', paddingRight: `${datas.imgMargin}rpx` }"
|
|
167
|
+
>
|
|
168
|
+
<pictureads
|
|
169
|
+
:datas="{
|
|
170
|
+
swiperType: 1,
|
|
171
|
+
height: datas.heights,
|
|
172
|
+
borderRadius: datas.borderRadius,
|
|
173
|
+
imageList: imageList(datas.imageTypeObj[datas.rubiksCubeType][0]),
|
|
174
|
+
interval: datas.interval
|
|
175
|
+
}"
|
|
176
|
+
></pictureads>
|
|
177
|
+
</view>
|
|
178
|
+
</view>
|
|
179
|
+
<!-- 右侧 -->
|
|
180
|
+
<view style="display: flex; flex-direction: column; width: 100%">
|
|
181
|
+
<view class="rubiksCubeType hw" :style="{ height: datas.topHeights + '%' }">
|
|
182
|
+
<view
|
|
183
|
+
v-if="
|
|
184
|
+
datas.imageTypeObj[datas.rubiksCubeType] &&
|
|
185
|
+
datas.imageTypeObj[datas.rubiksCubeType][1] &&
|
|
186
|
+
datas.imageTypeObj[datas.rubiksCubeType][1].length
|
|
187
|
+
"
|
|
188
|
+
:style="{ width: '100%' }"
|
|
189
|
+
>
|
|
190
|
+
<pictureads
|
|
191
|
+
:datas="{
|
|
192
|
+
swiperType: 1,
|
|
193
|
+
height: (datas.heights - datas.imgMargin) * (datas.topHeights / 100),
|
|
194
|
+
borderRadius: datas.borderRadius,
|
|
195
|
+
imageList: imageList(datas.imageTypeObj[datas.rubiksCubeType][1]),
|
|
196
|
+
interval: datas.interval
|
|
197
|
+
}"
|
|
198
|
+
></pictureads>
|
|
199
|
+
</view>
|
|
200
|
+
</view>
|
|
201
|
+
<view class="rubiksCubeType">
|
|
202
|
+
<view
|
|
203
|
+
class="hw"
|
|
204
|
+
style="display: flex; align-items: center; justify-content: center"
|
|
205
|
+
v-for="(item, index) in 2"
|
|
206
|
+
:key="index"
|
|
207
|
+
>
|
|
208
|
+
<view
|
|
209
|
+
v-if="
|
|
210
|
+
datas.imageTypeObj[datas.rubiksCubeType] &&
|
|
211
|
+
datas.imageTypeObj[datas.rubiksCubeType][index + 2] &&
|
|
212
|
+
datas.imageTypeObj[datas.rubiksCubeType][index + 2].length
|
|
213
|
+
"
|
|
214
|
+
:style="{
|
|
215
|
+
width: '100%',
|
|
216
|
+
paddingTop: datas.imgMargin + 'rpx',
|
|
217
|
+
paddingRight: index == 0 ? datas.imgMargin + 'rpx' : 0
|
|
218
|
+
}"
|
|
219
|
+
>
|
|
220
|
+
<pictureads
|
|
221
|
+
:datas="{
|
|
222
|
+
swiperType: 1,
|
|
223
|
+
height: (datas.heights - datas.imgMargin) * ((100 - datas.topHeights) / 100),
|
|
224
|
+
borderRadius: datas.borderRadius,
|
|
225
|
+
imageList: imageList(datas.imageTypeObj[datas.rubiksCubeType][index + 2]),
|
|
226
|
+
interval: datas.interval
|
|
227
|
+
}"
|
|
228
|
+
></pictureads>
|
|
229
|
+
</view>
|
|
230
|
+
</view>
|
|
231
|
+
</view>
|
|
232
|
+
</view>
|
|
233
|
+
</section>
|
|
234
|
+
|
|
235
|
+
<!-- 二左一右 -->
|
|
236
|
+
<section class="buju buju4" v-if="datas.rubiksCubeType === 5">
|
|
237
|
+
<view style="display: inline-flex; flex-direction: column; width: 100%">
|
|
238
|
+
<view
|
|
239
|
+
class="hw imgone"
|
|
240
|
+
v-for="(item, index) in 2"
|
|
241
|
+
:key="index"
|
|
242
|
+
:style="{ height: datas.heights / 2 + 'rpx' }"
|
|
243
|
+
>
|
|
244
|
+
<view
|
|
245
|
+
v-if="
|
|
246
|
+
datas.imageTypeObj[datas.rubiksCubeType] &&
|
|
247
|
+
datas.imageTypeObj[datas.rubiksCubeType][index + 1] &&
|
|
248
|
+
datas.imageTypeObj[datas.rubiksCubeType][index + 1].length
|
|
249
|
+
"
|
|
250
|
+
:style="{ width: '100%', padding: `0 ${datas.imgMargin}rpx` }"
|
|
251
|
+
>
|
|
252
|
+
<pictureads
|
|
253
|
+
:datas="{
|
|
254
|
+
swiperType: 1,
|
|
255
|
+
height: datas.heights / 2,
|
|
256
|
+
borderRadius: datas.borderRadius,
|
|
257
|
+
imageList: imageList(datas.imageTypeObj[datas.rubiksCubeType][index + 1]),
|
|
258
|
+
interval: datas.interval
|
|
259
|
+
}"
|
|
260
|
+
></pictureads>
|
|
261
|
+
</view>
|
|
262
|
+
</view>
|
|
263
|
+
</view>
|
|
264
|
+
<view class="rubiksCubeType hw">
|
|
265
|
+
<!-- 左侧轮播 -->
|
|
266
|
+
<view
|
|
267
|
+
v-if="
|
|
268
|
+
datas.imageTypeObj[datas.rubiksCubeType] &&
|
|
269
|
+
datas.imageTypeObj[datas.rubiksCubeType][0] &&
|
|
270
|
+
datas.imageTypeObj[datas.rubiksCubeType][0].length
|
|
271
|
+
"
|
|
272
|
+
:style="{ width: '100%', padding: `0 ${datas.imgMargin}rpx` }"
|
|
273
|
+
>
|
|
274
|
+
<pictureads
|
|
275
|
+
:datas="{
|
|
276
|
+
swiperType: 1,
|
|
277
|
+
height: datas.heights,
|
|
278
|
+
borderRadius: datas.borderRadius,
|
|
279
|
+
imageList: imageList(datas.imageTypeObj[datas.rubiksCubeType][0]),
|
|
280
|
+
interval: datas.interval
|
|
281
|
+
}"
|
|
282
|
+
></pictureads>
|
|
283
|
+
</view>
|
|
284
|
+
</view>
|
|
285
|
+
</section>
|
|
286
|
+
|
|
287
|
+
<!-- 三左一右 -->
|
|
288
|
+
<section class="buju buju4" :style="heightStyle" v-if="datas.rubiksCubeType === 6">
|
|
289
|
+
<!-- 左侧 -->
|
|
290
|
+
<view style="display: flex; flex-direction: column; width: 100%" :style="heightStyle">
|
|
291
|
+
<view class="rubiksCubeType hw" :style="{ height: datas.topHeights + '%' }">
|
|
292
|
+
<view
|
|
293
|
+
v-if="
|
|
294
|
+
datas.imageTypeObj[datas.rubiksCubeType] &&
|
|
295
|
+
datas.imageTypeObj[datas.rubiksCubeType][1] &&
|
|
296
|
+
datas.imageTypeObj[datas.rubiksCubeType][1].length
|
|
297
|
+
"
|
|
298
|
+
:style="{ width: '100%' }"
|
|
299
|
+
>
|
|
300
|
+
<pictureads
|
|
301
|
+
:datas="{
|
|
302
|
+
swiperType: 1,
|
|
303
|
+
height: (datas.heights - datas.imgMargin) * (datas.topHeights / 100),
|
|
304
|
+
borderRadius: datas.borderRadius,
|
|
305
|
+
imageList: imageList(datas.imageTypeObj[datas.rubiksCubeType][1]),
|
|
306
|
+
interval: datas.interval
|
|
307
|
+
}"
|
|
308
|
+
></pictureads>
|
|
309
|
+
</view>
|
|
310
|
+
</view>
|
|
311
|
+
<view class="rubiksCubeType">
|
|
312
|
+
<view
|
|
313
|
+
class="hw"
|
|
314
|
+
style="display: inline-flex; align-items: center; justify-content: center"
|
|
315
|
+
v-for="(item, index) in 2"
|
|
316
|
+
:key="index"
|
|
317
|
+
>
|
|
318
|
+
<view
|
|
319
|
+
v-if="
|
|
320
|
+
datas.imageTypeObj[datas.rubiksCubeType] &&
|
|
321
|
+
datas.imageTypeObj[datas.rubiksCubeType][index + 2] &&
|
|
322
|
+
datas.imageTypeObj[datas.rubiksCubeType][index + 2].length
|
|
323
|
+
"
|
|
324
|
+
:style="{
|
|
325
|
+
width: '100%',
|
|
326
|
+
paddingTop: datas.imgMargin + 'rpx',
|
|
327
|
+
paddingRight: index == 0 ? datas.imgMargin + 'rpx' : 0
|
|
328
|
+
}"
|
|
329
|
+
>
|
|
330
|
+
<pictureads
|
|
331
|
+
:datas="{
|
|
332
|
+
swiperType: 1,
|
|
333
|
+
height: (datas.heights - datas.imgMargin) * ((100 - datas.topHeights) / 100),
|
|
334
|
+
borderRadius: datas.borderRadius,
|
|
335
|
+
imageList: imageList(datas.imageTypeObj[datas.rubiksCubeType][index + 2]),
|
|
336
|
+
interval: datas.interval
|
|
337
|
+
}"
|
|
338
|
+
></pictureads>
|
|
339
|
+
</view>
|
|
340
|
+
</view>
|
|
341
|
+
</view>
|
|
342
|
+
</view>
|
|
343
|
+
<!-- 右侧 -->
|
|
344
|
+
<view class="rubiksCubeType hw">
|
|
345
|
+
<view
|
|
346
|
+
v-if="
|
|
347
|
+
datas.imageTypeObj[datas.rubiksCubeType] &&
|
|
348
|
+
datas.imageTypeObj[datas.rubiksCubeType][0] &&
|
|
349
|
+
datas.imageTypeObj[datas.rubiksCubeType][0].length
|
|
350
|
+
"
|
|
351
|
+
:style="{ width: '100%', paddingLeft: `${datas.imgMargin}rpx` }"
|
|
352
|
+
>
|
|
353
|
+
<pictureads
|
|
354
|
+
:datas="{
|
|
355
|
+
swiperType: 1,
|
|
356
|
+
height: datas.heights,
|
|
357
|
+
borderRadius: datas.borderRadius,
|
|
358
|
+
imageList: imageList(datas.imageTypeObj[datas.rubiksCubeType][0]),
|
|
359
|
+
interval: datas.interval
|
|
360
|
+
}"
|
|
361
|
+
></pictureads>
|
|
362
|
+
</view>
|
|
363
|
+
</view>
|
|
364
|
+
</section>
|
|
365
|
+
</view>
|
|
366
|
+
</template>
|
|
367
|
+
|
|
368
|
+
<script>
|
|
369
|
+
/**
|
|
370
|
+
* @component MagicCube
|
|
371
|
+
* @description 按照预设类型将多张图片组合成 CMS 魔方区域,并支持按星期和每日时间段筛选素材。
|
|
372
|
+
*/
|
|
373
|
+
|
|
374
|
+
import PictureAds from '../snake-picture-ads/snake-picture-ads.vue';
|
|
375
|
+
import { pxToRpx } from '../../libs/function/unit';
|
|
376
|
+
|
|
377
|
+
export default {
|
|
378
|
+
name: 'snake-magic-cube',
|
|
379
|
+
options: { virtualHost: true, styleIsolation: 'shared' },
|
|
380
|
+
props: { datas: Object },
|
|
381
|
+
components: { pictureads: PictureAds },
|
|
382
|
+
computed: {
|
|
383
|
+
imageList() {
|
|
384
|
+
return images => {
|
|
385
|
+
const showImageList = [];
|
|
386
|
+
images
|
|
387
|
+
.filter(item => {
|
|
388
|
+
const weeksToShow = item.weeks || [7, 1, 2, 3, 4, 5, 6]; // 默认显示周日到周六
|
|
389
|
+
const currentWeekday = this.getWeekday(); // 获取当前是星期几
|
|
390
|
+
const weeksResult = weeksToShow.includes(currentWeekday); // 判断当前星期几是否在显示列表中;
|
|
391
|
+
return weeksResult;
|
|
392
|
+
})
|
|
393
|
+
.forEach(item => {
|
|
394
|
+
(item?.imageList || []).forEach(item2 => {
|
|
395
|
+
if (item2.startTime && item2.endTime) {
|
|
396
|
+
// 今天
|
|
397
|
+
const today = new Date();
|
|
398
|
+
// 当前时间戳
|
|
399
|
+
const currentTime = Date.now();
|
|
400
|
+
|
|
401
|
+
const startDate = new Date(item2.startTime);
|
|
402
|
+
const endDate = new Date(item2.endTime);
|
|
403
|
+
|
|
404
|
+
const startTime = new Date(
|
|
405
|
+
today.getFullYear(),
|
|
406
|
+
today.getMonth(),
|
|
407
|
+
today.getDate(),
|
|
408
|
+
startDate.getHours(),
|
|
409
|
+
startDate.getMinutes(),
|
|
410
|
+
startDate.getSeconds()
|
|
411
|
+
).getTime();
|
|
412
|
+
|
|
413
|
+
const endTime = new Date(
|
|
414
|
+
today.getFullYear(),
|
|
415
|
+
today.getMonth(),
|
|
416
|
+
today.getDate(),
|
|
417
|
+
endDate.getHours(),
|
|
418
|
+
endDate.getMinutes(),
|
|
419
|
+
endDate.getSeconds()
|
|
420
|
+
).getTime();
|
|
421
|
+
|
|
422
|
+
if (currentTime >= startTime && currentTime <= endTime) {
|
|
423
|
+
showImageList.push(item2);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
if (!item?.imageList && item?.imageList?.length === undefined) {
|
|
428
|
+
showImageList.push(item);
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
return showImageList;
|
|
432
|
+
};
|
|
433
|
+
},
|
|
434
|
+
heightStyle() {
|
|
435
|
+
const style = {};
|
|
436
|
+
style.height = pxToRpx(this.datas.heights);
|
|
437
|
+
return style;
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
methods: {
|
|
441
|
+
// 获取当前是星期几
|
|
442
|
+
getWeekday() {
|
|
443
|
+
const date = new Date();
|
|
444
|
+
// 星期天为7,星期一为1,依此类推
|
|
445
|
+
const weekdays = [7, 1, 2, 3, 4, 5, 6];
|
|
446
|
+
return weekdays[date.getDay()];
|
|
447
|
+
},
|
|
448
|
+
convertToTimestamp(timeStr) {
|
|
449
|
+
// 验证输入是否为有效的时间字符串(HH:mm:ss 格式)
|
|
450
|
+
const timeRegex = /^([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d))?$/;
|
|
451
|
+
if (!timeRegex.test(timeStr)) {
|
|
452
|
+
// 输入的时间字符串格式不正确
|
|
453
|
+
return null;
|
|
454
|
+
}
|
|
455
|
+
// 将时间字符串拆分为小时和分钟
|
|
456
|
+
const [hours, minutes, seconds = '0'] = timeStr.split(':').map(Number);
|
|
457
|
+
|
|
458
|
+
// 创建一个新的 Date 对象,默认使用当天的日期
|
|
459
|
+
const now = new Date();
|
|
460
|
+
|
|
461
|
+
// 设置 Date 对象的小时和分钟为输入的时间
|
|
462
|
+
now.setHours(hours, minutes, seconds, 0); // 参数依次为小时、分钟、秒、毫秒
|
|
463
|
+
|
|
464
|
+
// 获取时间戳
|
|
465
|
+
const timestamp = now.getTime();
|
|
466
|
+
return timestamp;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
</script>
|
|
471
|
+
|
|
472
|
+
<style scoped lang="scss">
|
|
473
|
+
.magiccube {
|
|
474
|
+
position: relative;
|
|
475
|
+
|
|
476
|
+
// 一左二右 布局
|
|
477
|
+
.imgone {
|
|
478
|
+
&:last-of-type {
|
|
479
|
+
.image {
|
|
480
|
+
padding-right: 0 !important;
|
|
481
|
+
padding-bottom: 0 !important;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
&:first-of-type {
|
|
486
|
+
.image {
|
|
487
|
+
padding-top: 0 !important;
|
|
488
|
+
padding-right: 0 !important;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.image {
|
|
493
|
+
box-sizing: border-box;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// 一上二下 布局
|
|
498
|
+
.imgtow {
|
|
499
|
+
&:first-of-type {
|
|
500
|
+
.image {
|
|
501
|
+
padding-bottom: 0 !important;
|
|
502
|
+
padding-left: 0 !important;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
&:last-of-type {
|
|
507
|
+
.image {
|
|
508
|
+
padding-right: 0 !important;
|
|
509
|
+
padding-bottom: 0 !important;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.hw {
|
|
515
|
+
position: relative;
|
|
516
|
+
width: 100%;
|
|
517
|
+
|
|
518
|
+
.image {
|
|
519
|
+
position: absolute;
|
|
520
|
+
top: 0;
|
|
521
|
+
left: 0;
|
|
522
|
+
box-sizing: border-box;
|
|
523
|
+
width: 100%;
|
|
524
|
+
height: 100%;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
.buju {
|
|
529
|
+
&.buju0 {
|
|
530
|
+
display: flex;
|
|
531
|
+
flex-wrap: wrap;
|
|
532
|
+
justify-content: space-around;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
&.buju2 {
|
|
536
|
+
display: flex;
|
|
537
|
+
flex-direction: row;
|
|
538
|
+
justify-content: space-around;
|
|
539
|
+
width: 100%;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
&.buju4 {
|
|
543
|
+
display: flex;
|
|
544
|
+
flex-direction: row;
|
|
545
|
+
justify-content: space-around;
|
|
546
|
+
width: 100%;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
.rubiksCubeType {
|
|
550
|
+
display: flex;
|
|
551
|
+
align-items: center;
|
|
552
|
+
justify-content: center;
|
|
553
|
+
// cursor: pointer;
|
|
554
|
+
|
|
555
|
+
// 一行多个
|
|
556
|
+
&.rubiksCubeType0 {
|
|
557
|
+
height: 100%;
|
|
558
|
+
|
|
559
|
+
&:first-of-type {
|
|
560
|
+
.image {
|
|
561
|
+
padding-left: 0 !important;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
.image {
|
|
566
|
+
box-sizing: border-box;
|
|
567
|
+
width: 100%;
|
|
568
|
+
height: 100%;
|
|
569
|
+
padding-right: 0 !important;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
// 二左二右
|
|
574
|
+
&.rubiksCubeType1 {
|
|
575
|
+
position: relative;
|
|
576
|
+
width: 50%;
|
|
577
|
+
|
|
578
|
+
&:nth-of-type(1) {
|
|
579
|
+
.image {
|
|
580
|
+
padding-top: 0 !important;
|
|
581
|
+
padding-left: 0 !important;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
&:nth-of-type(2) {
|
|
586
|
+
.image {
|
|
587
|
+
padding-top: 0 !important;
|
|
588
|
+
padding-right: 0 !important;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
&:nth-of-type(3) {
|
|
593
|
+
.image {
|
|
594
|
+
padding-bottom: 0 !important;
|
|
595
|
+
padding-left: 0 !important;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
&:nth-of-type(4) {
|
|
600
|
+
.image {
|
|
601
|
+
padding-right: 0 !important;
|
|
602
|
+
padding-bottom: 0 !important;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.image {
|
|
607
|
+
position: absolute;
|
|
608
|
+
top: 0;
|
|
609
|
+
left: 0;
|
|
610
|
+
box-sizing: border-box;
|
|
611
|
+
width: 100%;
|
|
612
|
+
height: 100%;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
&.rubiksCubeType2 {
|
|
617
|
+
width: 100%;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
</style>
|