@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.
Files changed (279) hide show
  1. package/LICENSE +21 -0
  2. package/changelog.md +1 -0
  3. package/components/snake-activity-list/snake-activity-list.vue +365 -0
  4. package/components/snake-activity-list/types.ts +29 -0
  5. package/components/snake-auxiliary-segmentation/snake-auxiliary-segmentation.vue +44 -0
  6. package/components/snake-auxiliary-segmentation/types.ts +5 -0
  7. package/components/snake-button/snake-button.vue +357 -0
  8. package/components/snake-button/types.ts +103 -0
  9. package/components/snake-button-sort/snake-button-sort.vue +72 -0
  10. package/components/snake-button-sort/types.ts +22 -0
  11. package/components/snake-calendar/snake-calendar.vue +998 -0
  12. package/components/snake-calendar/types.ts +189 -0
  13. package/components/snake-cell-group/snake-cell-group.vue +55 -0
  14. package/components/snake-cell-group/types.ts +19 -0
  15. package/components/snake-cell-item/snake-cell-item.vue +159 -0
  16. package/components/snake-cell-item/types.ts +66 -0
  17. package/components/snake-checkbox/snake-checkbox.vue +264 -0
  18. package/components/snake-checkbox/types.ts +70 -0
  19. package/components/snake-checkbox-group/snake-checkbox-group.vue +154 -0
  20. package/components/snake-checkbox-group/types.ts +52 -0
  21. package/components/snake-cms/blocks/v2/cms-v2-carousel.vue +87 -0
  22. package/components/snake-cms/blocks/v2/cms-v2-coupon.vue +25 -0
  23. package/components/snake-cms/blocks/v2/cms-v2-custom.vue +12 -0
  24. package/components/snake-cms/blocks/v2/cms-v2-divider.vue +33 -0
  25. package/components/snake-cms/blocks/v2/cms-v2-floatbutton.vue +28 -0
  26. package/components/snake-cms/blocks/v2/cms-v2-goods-list.vue +150 -0
  27. package/components/snake-cms/blocks/v2/cms-v2-hotzone.vue +41 -0
  28. package/components/snake-cms/blocks/v2/cms-v2-images.vue +41 -0
  29. package/components/snake-cms/blocks/v2/cms-v2-magiccube.vue +93 -0
  30. package/components/snake-cms/blocks/v2/cms-v2-notice.vue +80 -0
  31. package/components/snake-cms/blocks/v2/cms-v2-popup.vue +46 -0
  32. package/components/snake-cms/blocks/v2/cms-v2-richtext.vue +18 -0
  33. package/components/snake-cms/blocks/v2/cms-v2-search.vue +115 -0
  34. package/components/snake-cms/blocks/v2/cms-v2-video.vue +25 -0
  35. package/components/snake-cms/blocks/v2/shared.ts +84 -0
  36. package/components/snake-cms/snake-cms.vue +409 -0
  37. package/components/snake-cms/types.ts +50 -0
  38. package/components/snake-commodity-search/snake-commodity-search.vue +234 -0
  39. package/components/snake-commodity-search/types.ts +11 -0
  40. package/components/snake-config-provider/snake-config-provider.vue +61 -0
  41. package/components/snake-config-provider/types.ts +22 -0
  42. package/components/snake-count-down/snake-count-down.vue +231 -0
  43. package/components/snake-count-down/types.ts +103 -0
  44. package/components/snake-coupon/snake-coupon.vue +209 -0
  45. package/components/snake-coupon/types.ts +21 -0
  46. package/components/snake-custom-module/snake-custom-module.vue +25 -0
  47. package/components/snake-custom-module/types.ts +11 -0
  48. package/components/snake-drop-menu/snake-drop-menu.vue +123 -0
  49. package/components/snake-drop-menu/types.ts +95 -0
  50. package/components/snake-drop-menu-item/snake-drop-menu-item.vue +181 -0
  51. package/components/snake-drop-menu-item/types.ts +48 -0
  52. package/components/snake-empty/snake-empty.vue +100 -0
  53. package/components/snake-empty/types.ts +48 -0
  54. package/components/snake-filter-sorts/filter-page.vue +695 -0
  55. package/components/snake-filter-sorts/snake-filter-sorts.vue +185 -0
  56. package/components/snake-filter-sorts/types.ts +57 -0
  57. package/components/snake-floating-bubble/snake-floating-bubble.vue +157 -0
  58. package/components/snake-floating-bubble/types.ts +43 -0
  59. package/components/snake-follow/snake-follow.vue +18 -0
  60. package/components/snake-follow/types.ts +2 -0
  61. package/components/snake-form/snake-form.vue +124 -0
  62. package/components/snake-form/types.ts +96 -0
  63. package/components/snake-form-item/snake-form-item.vue +331 -0
  64. package/components/snake-form-item/types.ts +70 -0
  65. package/components/snake-goods-list/snake-goods-list.vue +792 -0
  66. package/components/snake-goods-list/types.ts +55 -0
  67. package/components/snake-graphic-navigation/snake-graphic-navigation.vue +198 -0
  68. package/components/snake-graphic-navigation/types.ts +43 -0
  69. package/components/snake-icon/icon-names.ts +222 -0
  70. package/components/snake-icon/snake-icon.vue +220 -0
  71. package/components/snake-icon/types.ts +45 -0
  72. package/components/snake-image/snake-image.vue +230 -0
  73. package/components/snake-image/types.ts +70 -0
  74. package/components/snake-images/snake-images.vue +80 -0
  75. package/components/snake-images/types.ts +5 -0
  76. package/components/snake-index-anchor/snake-index-anchor.vue +83 -0
  77. package/components/snake-index-anchor/types.ts +14 -0
  78. package/components/snake-index-list/anchor-registry.ts +80 -0
  79. package/components/snake-index-list/snake-index-list.vue +259 -0
  80. package/components/snake-index-list/types.ts +115 -0
  81. package/components/snake-index-list-panel/snake-index-list-panel.vue +277 -0
  82. package/components/snake-index-list-panel/types.ts +10 -0
  83. package/components/snake-input/snake-input.vue +225 -0
  84. package/components/snake-input/types.ts +99 -0
  85. package/components/snake-jump-applet/snake-jump-applet.vue +99 -0
  86. package/components/snake-jump-applet/types.ts +17 -0
  87. package/components/snake-line/snake-line.vue +42 -0
  88. package/components/snake-line/types.ts +30 -0
  89. package/components/snake-line-progress/snake-line-progress.vue +105 -0
  90. package/components/snake-line-progress/types.ts +26 -0
  91. package/components/snake-link/snake-link.vue +74 -0
  92. package/components/snake-link/types.ts +30 -0
  93. package/components/snake-list-switching/components/tree-select/index.vue +156 -0
  94. package/components/snake-list-switching/snake-list-switching.vue +1285 -0
  95. package/components/snake-list-switching/types.ts +11 -0
  96. package/components/snake-loading/snake-loading.vue +241 -0
  97. package/components/snake-loading/types.ts +34 -0
  98. package/components/snake-loadmore/snake-loadmore.vue +103 -0
  99. package/components/snake-loadmore/types.ts +56 -0
  100. package/components/snake-magic-cube/snake-magic-cube.vue +622 -0
  101. package/components/snake-magic-cube/types.ts +5 -0
  102. package/components/snake-modal/snake-modal.vue +434 -0
  103. package/components/snake-modal/types.ts +71 -0
  104. package/components/snake-navbar/snake-navbar.vue +194 -0
  105. package/components/snake-navbar/types.ts +54 -0
  106. package/components/snake-no-network/snake-no-network.vue +125 -0
  107. package/components/snake-no-network/types.ts +27 -0
  108. package/components/snake-notice/snake-notice.vue +44 -0
  109. package/components/snake-notice/types.ts +5 -0
  110. package/components/snake-notice-bar/snake-notice-bar.vue +336 -0
  111. package/components/snake-notice-bar/types.ts +82 -0
  112. package/components/snake-overlay/snake-overlay.vue +73 -0
  113. package/components/snake-overlay/types.ts +35 -0
  114. package/components/snake-page-popup/snake-page-popup.vue +146 -0
  115. package/components/snake-page-popup/types.ts +28 -0
  116. package/components/snake-parse/audio/audio.vue +286 -0
  117. package/components/snake-parse/audio/context.js +11 -0
  118. package/components/snake-parse/audio/index.js +34 -0
  119. package/components/snake-parse/node/node.vue +830 -0
  120. package/components/snake-parse/parser.js +1480 -0
  121. package/components/snake-parse/snake-parse.vue +548 -0
  122. package/components/snake-parse/static/app-plus/snake-parse/js/handler.js +109 -0
  123. package/components/snake-parse/static/app-plus/snake-parse/js/uni.webview.js +0 -0
  124. package/components/snake-parse/static/app-plus/snake-parse/js/uni.webview.min.js +1 -0
  125. package/components/snake-parse/static/app-plus/snake-parse/local.html +3 -0
  126. package/components/snake-parse/style/index.js +132 -0
  127. package/components/snake-parse/style/parser.js +175 -0
  128. package/components/snake-parse/types.ts +49 -0
  129. package/components/snake-picture-ads/snake-picture-ads.vue +292 -0
  130. package/components/snake-picture-ads/types.ts +5 -0
  131. package/components/snake-popup/snake-popup.vue +348 -0
  132. package/components/snake-popup/types.ts +88 -0
  133. package/components/snake-qr-code/qrcode.ts +1214 -0
  134. package/components/snake-qr-code/snake-qr-code.vue +408 -0
  135. package/components/snake-qr-code/types.ts +78 -0
  136. package/components/snake-radio/snake-radio.vue +271 -0
  137. package/components/snake-radio/types.ts +64 -0
  138. package/components/snake-radio-group/snake-radio-group.vue +98 -0
  139. package/components/snake-radio-group/types.ts +48 -0
  140. package/components/snake-read-more/snake-read-more.vue +140 -0
  141. package/components/snake-read-more/types.ts +53 -0
  142. package/components/snake-rich-text/snake-rich-text.vue +24 -0
  143. package/components/snake-rich-text/types.ts +5 -0
  144. package/components/snake-root-portal/snake-root-portal.vue +92 -0
  145. package/components/snake-root-portal/types.ts +9 -0
  146. package/components/snake-search/snake-search.vue +202 -0
  147. package/components/snake-search/types.ts +84 -0
  148. package/components/snake-select/snake-select.vue +371 -0
  149. package/components/snake-select/types.ts +75 -0
  150. package/components/snake-skeleton/snake-skeleton.vue +104 -0
  151. package/components/snake-skeleton/types.ts +32 -0
  152. package/components/snake-skeleton-item/snake-skeleton-item.vue +90 -0
  153. package/components/snake-skeleton-item/types.ts +30 -0
  154. package/components/snake-slider/snake-slider.vue +249 -0
  155. package/components/snake-slider/types.ts +59 -0
  156. package/components/snake-sticky/snake-sticky.vue +178 -0
  157. package/components/snake-sticky/types.ts +48 -0
  158. package/components/snake-subsection/snake-subsection.vue +188 -0
  159. package/components/snake-subsection/types.ts +54 -0
  160. package/components/snake-swiper/snake-swiper.vue +229 -0
  161. package/components/snake-swiper/types.ts +79 -0
  162. package/components/snake-switch/snake-switch.vue +100 -0
  163. package/components/snake-switch/types.ts +41 -0
  164. package/components/snake-tabbar/snake-tabbar.vue +306 -0
  165. package/components/snake-tabbar/types.ts +93 -0
  166. package/components/snake-tabs/snake-tabs.vue +305 -0
  167. package/components/snake-tabs/types.ts +79 -0
  168. package/components/snake-text/snake-text.vue +292 -0
  169. package/components/snake-text/types.ts +100 -0
  170. package/components/snake-textarea/snake-textarea.vue +171 -0
  171. package/components/snake-textarea/types.ts +79 -0
  172. package/components/snake-toast/snake-toast.vue +330 -0
  173. package/components/snake-toast/types.ts +55 -0
  174. package/components/snake-tooltip/position.ts +33 -0
  175. package/components/snake-tooltip/snake-tooltip.vue +339 -0
  176. package/components/snake-tooltip/types.ts +80 -0
  177. package/components/snake-transition/snake-transition.vue +315 -0
  178. package/components/snake-transition/types.ts +65 -0
  179. package/components/snake-upload/snake-upload.vue +1801 -0
  180. package/components/snake-upload/types.ts +256 -0
  181. package/components/snake-videos/snake-videos.vue +122 -0
  182. package/components/snake-videos/types.ts +7 -0
  183. package/iconfont.css +881 -0
  184. package/index.d.ts +7 -0
  185. package/index.scss +26 -0
  186. package/index.ts +94 -0
  187. package/libs/cms/blocks.ts +103 -0
  188. package/libs/cms/config.ts +25 -0
  189. package/libs/cms/index.ts +7 -0
  190. package/libs/cms/normalize.ts +135 -0
  191. package/libs/cms/resolve.ts +12 -0
  192. package/libs/cms/types.ts +164 -0
  193. package/libs/cms/use-commerce.ts +385 -0
  194. package/libs/cms/v2.ts +193 -0
  195. package/libs/config/index.ts +4 -0
  196. package/libs/config/modal.ts +93 -0
  197. package/libs/config/state.ts +33 -0
  198. package/libs/config/theme.ts +351 -0
  199. package/libs/config/toast.ts +71 -0
  200. package/libs/config/types.ts +135 -0
  201. package/libs/config/zIndex.ts +44 -0
  202. package/libs/css/color.scss +105 -0
  203. package/libs/css/common.scss +171 -0
  204. package/libs/css/style.h5.scss +7 -0
  205. package/libs/css/style.mp.scss +7 -0
  206. package/libs/css/style.theme.scss +70 -0
  207. package/libs/css/style.vue.scss +140 -0
  208. package/libs/form/async-validator.min.d.ts +75 -0
  209. package/libs/form/async-validator.min.js +3 -0
  210. package/libs/form/index.ts +3 -0
  211. package/libs/form/path.ts +40 -0
  212. package/libs/form/types.ts +51 -0
  213. package/libs/form/validate.ts +149 -0
  214. package/libs/foundation.ts +96 -0
  215. package/libs/function/$parent.ts +33 -0
  216. package/libs/function/clipboard.ts +13 -0
  217. package/libs/function/color.ts +55 -0
  218. package/libs/function/debounce.ts +34 -0
  219. package/libs/function/deepClone.ts +30 -0
  220. package/libs/function/deepMerge.ts +25 -0
  221. package/libs/function/emitter.ts +30 -0
  222. package/libs/function/format.ts +27 -0
  223. package/libs/function/getParent.ts +53 -0
  224. package/libs/function/getRect.ts +29 -0
  225. package/libs/function/guid.ts +11 -0
  226. package/libs/function/index.ts +31 -0
  227. package/libs/function/queryParams.ts +73 -0
  228. package/libs/function/random.ts +6 -0
  229. package/libs/function/randomArray.ts +14 -0
  230. package/libs/function/route.ts +155 -0
  231. package/libs/function/sleep.ts +7 -0
  232. package/libs/function/style.ts +58 -0
  233. package/libs/function/styleUtils.ts +83 -0
  234. package/libs/function/system.ts +14 -0
  235. package/libs/function/test.ts +202 -0
  236. package/libs/function/throttle.ts +36 -0
  237. package/libs/function/timeFormat.ts +27 -0
  238. package/libs/function/timeFrom.ts +27 -0
  239. package/libs/function/toast.ts +10 -0
  240. package/libs/function/trim.ts +11 -0
  241. package/libs/function/type2icon.ts +11 -0
  242. package/libs/function/unit.ts +45 -0
  243. package/libs/hooks/index.ts +11 -0
  244. package/libs/hooks/useChildren.ts +125 -0
  245. package/libs/hooks/useColor.ts +5 -0
  246. package/libs/hooks/useDebounce.ts +5 -0
  247. package/libs/hooks/useLocale.ts +13 -0
  248. package/libs/hooks/useModal.ts +131 -0
  249. package/libs/hooks/useParent.ts +62 -0
  250. package/libs/hooks/useRect.ts +44 -0
  251. package/libs/hooks/useRouter.ts +5 -0
  252. package/libs/hooks/useTheme.ts +31 -0
  253. package/libs/hooks/useThrottle.ts +5 -0
  254. package/libs/hooks/useToast.ts +116 -0
  255. package/libs/index.ts +18 -0
  256. package/libs/request/auto-http.ts +1 -0
  257. package/libs/request/index.ts +343 -0
  258. package/libs/runtime/accessors.ts +55 -0
  259. package/libs/runtime/context.ts +40 -0
  260. package/libs/runtime/index.ts +18 -0
  261. package/libs/runtime/types.ts +49 -0
  262. package/libs/util/calendar.ts +6 -0
  263. package/locale/index.ts +130 -0
  264. package/locale/lang/en-US.ts +67 -0
  265. package/locale/lang/zh-CN.ts +67 -0
  266. package/package.json +130 -5
  267. package/plugins/index.ts +1 -0
  268. package/plugins/root/README.md +86 -0
  269. package/plugins/root/index.ts +123 -0
  270. package/plugins/root/page.ts +77 -0
  271. package/plugins/root/root.ts +53 -0
  272. package/plugins/root/utils.ts +137 -0
  273. package/readme.md +79 -0
  274. package/theme.scss +118 -0
  275. package/types/components.d.ts +236 -0
  276. package/types/global.d.ts +21 -0
  277. package/types/index.d.ts +6 -0
  278. package/types/uni-app.d.ts +16 -0
  279. package/README.md +0 -3
@@ -0,0 +1,1285 @@
1
+ <template>
2
+ <view class="listswitching" :ref="listSwitchName" :style="{ backgroundImage: 'url(' + datas.bgImg + ')' }">
3
+ <!-- 类型一 -->
4
+ <!-- 没有数据展示默认 -->
5
+ <view
6
+ v-if="!datas.imageList[0] && datas.commoditylisttype === 0"
7
+ :class="[
8
+ datas.commodityType === 5 ? 'defaultcommodityList5' : '',
9
+ datas.commodityType === 1 ? 'defaultcommodityListFlex' : ''
10
+ ]"
11
+ class="commodity-section defaultcommodity"
12
+ :style="{
13
+ 'padding-top': datas.commodityMargin + 'px',
14
+ 'padding-left': datas.pageMargin + 'px',
15
+ 'padding-right': datas.pageMargin + 'px'
16
+ }"
17
+ >
18
+ <view
19
+ v-for="index in 4"
20
+ :key="index"
21
+ class="defaultcommodityList"
22
+ :class="[
23
+ datas.commodityType === 0 ? 'defaultcommodityList0' : '',
24
+ datas.commodityType === 1 ? 'defaultcommodityList1' : '',
25
+ datas.commodityType === 2 ? 'defaultcommodityList2' : '',
26
+ datas.commodityType === 3 ? 'defaultcommodityList3' : '',
27
+ datas.commodityType === 4 ? 'defaultcommodityList4' : '',
28
+ datas.commodityType === 5 ? 'defaultcommodityList5' : ''
29
+ ]"
30
+ :style="{
31
+ border: datas.moditystyle === 2 ? '1px solid rgba(50,50,51,0.1)' : '',
32
+ 'box-shadow': datas.moditystyle === 1 ? '0 2px 8px rgba(93,113,127,0.08)' : '',
33
+ margin: datas.commodityMargin + 'px',
34
+ width:
35
+ datas.commodityType === 1
36
+ ? 50 - datas.commodityMargin / 6.5 + '%'
37
+ : datas.commodityType === 2
38
+ ? 33 - datas.commodityMargin / 5 + '%'
39
+ : datas.commodityType === 4
40
+ ? 50 - datas.commodityMargin / 5 + '%'
41
+ : '',
42
+ 'border-radius': datas.borderRadius + 'px'
43
+ }"
44
+ >
45
+ <!-- 图片 -->
46
+ <view class="bg-pic">
47
+ <image
48
+ class="commodity-image"
49
+ src="https://s.qiuxietang.com/images/1672886064118/CdkQmBXNCs.png"
50
+ :style="[radiusStyle('img')]"
51
+ mode="aspectFill"
52
+ ></image>
53
+ <!-- 标签 -->
54
+ <view
55
+ mark
56
+ :style="[styleString]"
57
+ class="marks"
58
+ v-show="datas.commoditycorner && datas.commoditycornertype === 0"
59
+ >
60
+ 新品
61
+ </view>
62
+ <view
63
+ :color="datas.commodityTagColor || tagColor"
64
+ :style="[styleString]"
65
+ class="marks"
66
+ v-show="datas.commoditycorner && datas.commoditycornertype === 1"
67
+ >
68
+ 热
69
+ <br />
70
+ 卖
71
+ </view>
72
+ <view
73
+ :color="datas.commodityTagColor || tagColor"
74
+ :style="[styleString]"
75
+ class="marks"
76
+ v-show="datas.commoditycorner && datas.commoditycornertype === 2"
77
+ >
78
+ NEW
79
+ </view>
80
+ <view
81
+ plain
82
+ :color="datas.commodityTagColor || tagColor"
83
+ :style="[styleString]"
84
+ class="marks"
85
+ v-show="datas.commoditycorner && datas.commoditycornertype === 3"
86
+ >
87
+ HOT
88
+ </view>
89
+ </view>
90
+
91
+ <!-- 文字内容 -->
92
+ <view
93
+ class="text"
94
+ :style="[
95
+ { background: datas.moditystyle !== 3 ? 'var(--snake-color-surface, #fff)' : 'none' },
96
+ radiusStyle()
97
+ ]"
98
+ >
99
+ <!-- 视频名称 -->
100
+ <text
101
+ class="commodity-title"
102
+ :style="{
103
+ 'font-weight': datas.textWeight,
104
+ 'text-align': datas.positions === 'center' ? 'center' : ''
105
+ }"
106
+ >
107
+ 这里显示商品名称,最多显示1行
108
+ </text>
109
+ <!-- 视频描述 -->
110
+ <text
111
+ class="commodity-description"
112
+ :style="{ 'text-align': datas.positions === 'center' ? 'center' : '' }"
113
+ >
114
+ 这里显示商品描述,最多显示1行
115
+ </text>
116
+ <view class="mony">
117
+ <text class="commodity-price" v-show="datas.priceofcommodity">
118
+ <text class="commodity-currency">¥</text>
119
+ 99
120
+ </text>
121
+ <view class="commodity-action-wrap" v-show="datas.purchasebutton">
122
+ <!-- <snake-icon name="" size="23" v-show="datas.purchasebuttonType === 0" />
123
+ <snake-icon name="" size="23" v-show="datas.purchasebuttonType === 1" />
124
+ <snake-icon name="" size="23" v-show="datas.purchasebuttonType === 2" />
125
+ <snake-icon name="" size="23" v-show="datas.purchasebuttonType === 3" /> -->
126
+ <text class="commodity-action" v-if="[4, 5, 6, 7].includes(datas.purchasebuttonType)">
127
+ {{ datas.purchase }}
128
+ </text>
129
+ </view>
130
+ </view>
131
+ </view>
132
+ </view>
133
+ </view>
134
+ <view
135
+ v-show="datas.imageList[0] && datas.commoditylisttype === 0"
136
+ :class="[
137
+ datas.commodityType === 5 ? 'defaultcommodityList5' : '',
138
+ datas.commodityType === 1 ? 'defaultcommodityListFlex' : ''
139
+ ]"
140
+ class="commodity-section defaultcommodity defaultcommodityListFlex"
141
+ :style="{
142
+ 'padding-top': datas.commodityMargin + 'px',
143
+ 'padding-left': datas.pageMargin + 'px',
144
+ 'padding-right': datas.pageMargin + 'px'
145
+ }"
146
+ >
147
+ <view
148
+ v-for="(item, index) in datas.imageList"
149
+ :key="index"
150
+ class="defaultcommodityList"
151
+ :class="[
152
+ datas.commodityType === 0 ? 'defaultcommodityList0' : '',
153
+ datas.commodityType === 1 ? 'defaultcommodityList1' : '',
154
+ datas.commodityType === 2 ? 'defaultcommodityList2' : '',
155
+ datas.commodityType === 3 ? 'defaultcommodityList3' : '',
156
+ datas.commodityType === 4 ? 'defaultcommodityList4' : '',
157
+ datas.commodityType === 5 ? 'defaultcommodityList5' : ''
158
+ ]"
159
+ :style="{
160
+ border: datas.moditystyle === 2 ? '1px solid rgba(50,50,51,0.1)' : '',
161
+ 'box-shadow': datas.moditystyle === 1 ? '0 2px 8px rgba(93,113,127,0.08)' : '',
162
+ margin: datas.commodityMargin + 'px',
163
+ width:
164
+ datas.commodityType === 1
165
+ ? 50 - datas.commodityMargin / 6.5 + '%'
166
+ : datas.commodityType === 2
167
+ ? 33 - datas.commodityMargin / 5 + '%'
168
+ : datas.commodityType === 4
169
+ ? 50 - datas.commodityMargin / 5 + '%'
170
+ : '',
171
+ 'border-radius': datas.borderRadius + 'px'
172
+ }"
173
+ @click="habdleToDetails(item)"
174
+ >
175
+ <!-- 图片 -->
176
+ <view class="bg-pic">
177
+ <image
178
+ class="commodity-image"
179
+ :src="imageFilter(item)"
180
+ mode="aspectFit"
181
+ :style="[radiusStyle('img')]"
182
+ ></image>
183
+ <!-- 标签 -->
184
+ <view
185
+ :style="[styleString]"
186
+ class="marks"
187
+ v-if="datas.commoditycorner && datas.commoditycornertype === 0"
188
+ >
189
+ 新品
190
+ </view>
191
+ <view
192
+ :style="[styleString]"
193
+ class="marks"
194
+ v-if="datas.commoditycorner && datas.commoditycornertype === 1"
195
+ >
196
+ 热
197
+ <br />
198
+ 卖
199
+ </view>
200
+ <view
201
+ :style="[styleString]"
202
+ class="marks"
203
+ v-if="datas.commoditycorner && datas.commoditycornertype === 2"
204
+ >
205
+ NEW
206
+ </view>
207
+ <view
208
+ :style="[styleString]"
209
+ class="marks"
210
+ v-if="datas.commoditycorner && datas.commoditycornertype === 3"
211
+ >
212
+ HOT
213
+ </view>
214
+ </view>
215
+
216
+ <!-- 文字内容 -->
217
+ <view
218
+ class="text"
219
+ :style="[
220
+ { background: datas.moditystyle !== 3 ? 'var(--snake-color-surface, #fff)' : 'none' },
221
+ radiusStyle()
222
+ ]"
223
+ >
224
+ <!-- 商品名称 -->
225
+ <text
226
+ class="commodity-title"
227
+ :style="{
228
+ 'font-weight': datas.textWeight,
229
+ 'text-align': datas.positions === 'center' ? 'center' : ''
230
+ }"
231
+ >
232
+ {{ item.name }}
233
+ </text>
234
+ <!-- 商品描述 -->
235
+ <text
236
+ class="commodity-description"
237
+ :style="{ 'text-align': datas.positions === 'center' ? 'center' : '' }"
238
+ v-if="item.introduce"
239
+ >
240
+ {{ item.introduce }}
241
+ </text>
242
+ <view class="mony" v-if="datas.priceofcommodity || datas.purchasebutton">
243
+ <view class="commodity-price-wrap" v-if="datas.priceofcommodity">
244
+ <text>¥</text>
245
+ {{ item.price }}
246
+ </view>
247
+ <view class="commodity-action-wrap" v-if="datas.purchasebutton">
248
+ <!-- <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 0" />
249
+ <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 1" />
250
+ <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 2" />
251
+ <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 3" /> -->
252
+ <text class="commodity-action" v-if="[4, 5, 6, 7].includes(datas.purchasebuttonType)">
253
+ {{ datas.purchase }}
254
+ </text>
255
+ </view>
256
+ </view>
257
+ </view>
258
+ </view>
259
+ </view>
260
+
261
+ <!-- 类型二 -->
262
+ <view class="tab-type2" v-if="datas.commoditylisttype == 1">
263
+ <snake-tabs
264
+ :list="datas.commoditylisttypetab"
265
+ :current="active1"
266
+ :active-color="datas.tabColor"
267
+ @change="changeTabs"
268
+ ></snake-tabs>
269
+ <!-- 无数据默认展示 -->
270
+ <view
271
+ v-show="!datas.commoditylisttypetab[active1].imageList[0] && datas.commoditylisttype === 1"
272
+ :class="[datas.commodityType === 5 ? 'defaultcommodityList5' : '']"
273
+ class="commodity-section defaultcommodity defaultcommodityListFlex"
274
+ :style="{
275
+ 'padding-top': datas.commodityMargin + 'px',
276
+ 'padding-left': datas.pageMargin + 'px',
277
+ 'padding-right': datas.pageMargin + 'px'
278
+ }"
279
+ >
280
+ <view
281
+ v-for="index in 4"
282
+ :key="index"
283
+ class="defaultcommodityList"
284
+ :class="[
285
+ datas.commodityType === 0 ? 'defaultcommodityList0' : '',
286
+ datas.commodityType === 1 ? 'defaultcommodityList1' : '',
287
+ datas.commodityType === 2 ? 'defaultcommodityList2' : '',
288
+ datas.commodityType === 3 ? 'defaultcommodityList3' : '',
289
+ datas.commodityType === 4 ? 'defaultcommodityList4' : '',
290
+ datas.commodityType === 5 ? 'defaultcommodityList5' : ''
291
+ ]"
292
+ :style="{
293
+ border: datas.moditystyle === 2 ? '1px solid rgba(50,50,51,0.1)' : '',
294
+ 'box-shadow': datas.moditystyle === 1 ? '0 2px 8px rgba(93,113,127,0.08)' : '',
295
+ margin: datas.commodityMargin + 'px',
296
+ width:
297
+ datas.commodityType === 1
298
+ ? 50 - datas.commodityMargin / 6.5 + '%'
299
+ : datas.commodityType === 2
300
+ ? 33 - datas.commodityMargin / 5 + '%'
301
+ : datas.commodityType === 4
302
+ ? 50 - datas.commodityMargin / 5 + '%'
303
+ : '',
304
+ 'border-radius': datas.borderRadius + 'px'
305
+ }"
306
+ >
307
+ <!-- 视频图片 -->
308
+ <view class="bg-pic">
309
+ <image
310
+ class="commodity-image"
311
+ src="https://s.qiuxietang.com/images/1672886064118/CdkQmBXNCs.png"
312
+ :style="[radiusStyle('img')]"
313
+ ></image>
314
+ <!-- 标签 -->
315
+ <view
316
+ :style="[styleString]"
317
+ class="marks"
318
+ v-show="datas.commoditycorner && datas.commoditycornertype === 0"
319
+ >
320
+ 新品
321
+ </view>
322
+ <view
323
+ :style="[styleString]"
324
+ class="marks"
325
+ v-show="datas.commoditycorner && datas.commoditycornertype === 1"
326
+ >
327
+ 热
328
+ <br />
329
+ 卖
330
+ </view>
331
+ <view
332
+ :style="[styleString]"
333
+ class="marks"
334
+ v-show="datas.commoditycorner && datas.commoditycornertype === 2"
335
+ >
336
+ NEW
337
+ </view>
338
+ <view
339
+ :style="[styleString]"
340
+ class="marks"
341
+ v-show="datas.commoditycorner && datas.commoditycornertype === 3"
342
+ >
343
+ HOT
344
+ </view>
345
+ </view>
346
+
347
+ <!-- 文字内容 -->
348
+ <view
349
+ class="text"
350
+ :style="[
351
+ { background: datas.moditystyle !== 3 ? 'var(--snake-color-surface, #fff)' : 'none' },
352
+ radiusStyle()
353
+ ]"
354
+ >
355
+ <!-- 视频名称 -->
356
+ <text
357
+ class="commodity-title"
358
+ :style="{
359
+ 'font-weight': datas.textWeight,
360
+ 'text-align': datas.positions === 'center' ? 'center' : ''
361
+ }"
362
+ >
363
+ 这里显示商品名称,最多显示1行
364
+ </text>
365
+ <!-- 视频描述 -->
366
+ <text
367
+ class="commodity-description"
368
+ :style="{ 'text-align': datas.positions === 'center' ? 'center' : '' }"
369
+ >
370
+ 这里显示商品描述,最多显示1行
371
+ </text>
372
+ <view class="mony">
373
+ <text class="commodity-price" v-if="datas.priceofcommodity">
374
+ <text class="commodity-currency">¥</text>
375
+ 99
376
+ </text>
377
+ <view class="commodity-action-wrap" v-if="datas.purchasebutton">
378
+ <!-- <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 0" />
379
+ <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 1" />
380
+ <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 2" />
381
+ <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 3" /> -->
382
+ <text class="commodity-action" v-if="[4, 5, 6, 7].includes(datas.purchasebuttonType)">
383
+ {{ datas.purchase }}
384
+ </text>
385
+ </view>
386
+ </view>
387
+ </view>
388
+ </view>
389
+ </view>
390
+ <view
391
+ v-show="datas.commoditylisttypetab[active1].imageList[0] && datas.commoditylisttype === 1"
392
+ :class="[datas.commodityType === 5 ? 'defaultcommodityList5' : '']"
393
+ class="commodity-section defaultcommodity"
394
+ :style="{
395
+ 'padding-top': datas.commodityMargin + 'px',
396
+ 'padding-left': datas.pageMargin + 'px',
397
+ 'padding-right': datas.pageMargin + 'px'
398
+ }"
399
+ >
400
+ <view
401
+ v-for="(item, index) in datas.commoditylisttypetab[active1].imageList"
402
+ :key="index"
403
+ class="defaultcommodityList"
404
+ :class="[
405
+ datas.commodityType === 0 ? 'defaultcommodityList0' : '',
406
+ datas.commodityType === 1 ? 'defaultcommodityList1' : '',
407
+ datas.commodityType === 2 ? 'defaultcommodityList2' : '',
408
+ datas.commodityType === 3 ? 'defaultcommodityList3' : '',
409
+ datas.commodityType === 4 ? 'defaultcommodityList4' : '',
410
+ datas.commodityType === 5 ? 'defaultcommodityList5' : ''
411
+ ]"
412
+ :style="{
413
+ border: datas.moditystyle === 2 ? '1px solid rgba(50,50,51,0.1)' : '',
414
+ 'box-shadow': datas.moditystyle === 1 ? '0 2px 8px rgba(93,113,127,0.08)' : '',
415
+ margin: datas.commodityMargin + 'px',
416
+ width:
417
+ datas.commodityType === 1
418
+ ? 50 - datas.commodityMargin / 6.5 + '%'
419
+ : datas.commodityType === 2
420
+ ? 33 - datas.commodityMargin / 5 + '%'
421
+ : datas.commodityType === 4
422
+ ? 50 - datas.commodityMargin / 5 + '%'
423
+ : '',
424
+ 'border-radius': datas.borderRadius + 'px'
425
+ }"
426
+ @click="habdleToDetails(item)"
427
+ >
428
+ <!-- 视频图片 -->
429
+ <view class="bg-pic">
430
+ <image
431
+ class="commodity-image"
432
+ :src="item.image"
433
+ mode="aspectFit"
434
+ :style="[radiusStyle('img')]"
435
+ ></image>
436
+ <!-- 标签 -->
437
+ <view
438
+ :style="[styleString]"
439
+ class="marks"
440
+ v-show="datas.commoditycorner && datas.commoditycornertype === 0"
441
+ >
442
+ 新品
443
+ </view>
444
+ <view
445
+ :style="[styleString]"
446
+ class="marks"
447
+ v-show="datas.commoditycorner && datas.commoditycornertype === 1"
448
+ >
449
+ 热
450
+ <br />
451
+ 卖
452
+ </view>
453
+ <view
454
+ :style="[styleString]"
455
+ class="marks"
456
+ v-show="datas.commoditycorner && datas.commoditycornertype === 2"
457
+ >
458
+ NEW
459
+ </view>
460
+ <view
461
+ :style="[styleString]"
462
+ class="marks"
463
+ v-show="datas.commoditycorner && datas.commoditycornertype === 3"
464
+ >
465
+ HOT
466
+ </view>
467
+ </view>
468
+
469
+ <!-- 文字内容 -->
470
+ <view
471
+ class="text"
472
+ :style="[
473
+ { background: datas.moditystyle !== 3 ? 'var(--snake-color-surface, #fff)' : 'none' },
474
+ radiusStyle()
475
+ ]"
476
+ >
477
+ <!-- 视频名称 -->
478
+ <text
479
+ class="commodity-title"
480
+ :style="{
481
+ 'font-weight': datas.textWeight,
482
+ 'text-align': datas.positions === 'center' ? 'center' : ''
483
+ }"
484
+ >
485
+ {{ item.name }}
486
+ </text>
487
+ <!-- 视频描述 -->
488
+ <text
489
+ class="commodity-description"
490
+ :style="{ 'text-align': datas.positions === 'center' ? 'center' : '' }"
491
+ >
492
+ {{ item.introduce }}
493
+ </text>
494
+ <view class="mony" v-if="datas.priceofcommodity || datas.purchasebutton">
495
+ <text class="commodity-price" v-if="datas.priceofcommodity">
496
+ <text class="commodity-currency">¥</text>
497
+ {{ item.price }}
498
+ </text>
499
+ <view class="commodity-action-wrap" v-if="datas.purchasebutton">
500
+ <!-- <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 0" />
501
+ <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 1" />
502
+ <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 2" />
503
+ <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 3" /> -->
504
+ <text class="commodity-action" v-if="[4, 5, 6, 7].includes(datas.purchasebuttonType)">
505
+ {{ datas.purchase }}
506
+ </text>
507
+ </view>
508
+ </view>
509
+ </view>
510
+ </view>
511
+ </view>
512
+ </view>
513
+
514
+ <!-- 类型三 -->
515
+ <view v-if="datas.commoditylisttype === 2">
516
+ <!-- <view class="more" v-show="datas.showMore"
517
+ :style="{ 'margin-right': datas.pageMargin + 'px', 'margin-top': '0px', }">
518
+ 更多》
519
+ </view> -->
520
+ <tree-select :items="datas.commoditylisttypetab" :current="active" @click-nav="treeSelect" class="type3">
521
+ <template #content>
522
+ <view style="width: 100%">
523
+ <view
524
+ v-if="!datas.commoditylisttypetab[active].imageList[0]"
525
+ class="commodity-section defaultcommodity"
526
+ :style="{
527
+ 'padding-top': datas.commodityMargin + 'px',
528
+ 'padding-left': datas.pageMargin + 'px',
529
+ 'padding-right': datas.pageMargin + 'px'
530
+ }"
531
+ >
532
+ <view
533
+ v-for="index in 4"
534
+ :key="index"
535
+ class="defaultcommodityList defaultcommodityList3"
536
+ :style="{
537
+ border: datas.moditystyle === 2 ? '1px solid rgba(50,50,51,0.1)' : '',
538
+ 'box-shadow': datas.moditystyle === 1 ? '0 2px 8px rgba(93,113,127,0.08)' : '',
539
+ margin: datas.commodityMargin + 'px',
540
+ 'border-radius': datas.borderRadius + 'px'
541
+ }"
542
+ >
543
+ <!-- 视频图片 -->
544
+ <view class="bg-pic">
545
+ <image
546
+ class="commodity-image"
547
+ src="https://s.qiuxietang.com/images/1672886064118/CdkQmBXNCs.png"
548
+ :style="[radiusStyle('img')]"
549
+ ></image>
550
+ <!-- 标签 -->
551
+ <view
552
+ :style="[styleString]"
553
+ class="marks"
554
+ v-show="datas.commoditycorner && datas.commoditycornertype === 0"
555
+ >
556
+ 新品
557
+ </view>
558
+ <view
559
+ :style="[styleString]"
560
+ class="marks"
561
+ v-show="datas.commoditycorner && datas.commoditycornertype === 1"
562
+ >
563
+ 热
564
+ <br />
565
+ 卖
566
+ </view>
567
+ <view
568
+ :style="[styleString]"
569
+ class="marks"
570
+ v-show="datas.commoditycorner && datas.commoditycornertype === 2"
571
+ >
572
+ NEW
573
+ </view>
574
+ <view
575
+ :style="[styleString]"
576
+ class="marks"
577
+ v-show="datas.commoditycorner && datas.commoditycornertype === 3"
578
+ >
579
+ HOT
580
+ </view>
581
+ </view>
582
+
583
+ <!-- 文字内容 -->
584
+ <view
585
+ class="text"
586
+ :style="[
587
+ {
588
+ background:
589
+ datas.moditystyle !== 3 ? 'var(--snake-color-surface, #fff)' : 'none'
590
+ },
591
+ radiusStyle()
592
+ ]"
593
+ >
594
+ <!-- 视频名称 -->
595
+ <text
596
+ class="commodity-title"
597
+ :style="{
598
+ 'font-weight': datas.textWeight,
599
+ 'text-align': datas.positions === 'center' ? 'center' : ''
600
+ }"
601
+ >
602
+ 这里显示商品名称,最多显示1行
603
+ </text>
604
+ <!-- 视频描述 -->
605
+ <text
606
+ class="commodity-description"
607
+ :style="{ 'text-align': datas.positions === 'center' ? 'center' : '' }"
608
+ >
609
+ 这里显示商品描述,最多显示1行
610
+ </text>
611
+ <view class="mony">
612
+ <text class="commodity-price" v-if="datas.priceofcommodity">
613
+ <text class="commodity-currency">¥</text>
614
+ 99
615
+ </text>
616
+ <view class="commodity-action-wrap" v-if="datas.purchasebutton">
617
+ <!-- <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 0" />
618
+ <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 1" />
619
+ <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 2" />
620
+ <snake-icon name="" size="23" v-if="datas.purchasebuttonType === 3" /> -->
621
+ <text
622
+ class="commodity-action"
623
+ v-if="[4, 5, 6, 7].includes(datas.purchasebuttonType)"
624
+ >
625
+ {{ datas.purchase }}
626
+ </text>
627
+ </view>
628
+ </view>
629
+ </view>
630
+ </view>
631
+ </view>
632
+ <view
633
+ v-if="datas.commoditylisttypetab[active].imageList[0]"
634
+ class="commodity-section defaultcommodity"
635
+ :style="{
636
+ 'padding-top': datas.commodityMargin + 'px',
637
+ 'padding-left': datas.pageMargin + 'px',
638
+ 'padding-right': datas.pageMargin + 'px'
639
+ }"
640
+ >
641
+ <view
642
+ v-for="(item, index) in datas.commoditylisttypetab[active].imageList"
643
+ :key="index"
644
+ class="defaultcommodityList defaultcommodityList3"
645
+ :style="{
646
+ border: datas.moditystyle === 2 ? '1px solid rgba(50,50,51,0.1)' : '',
647
+ 'box-shadow': datas.moditystyle === 1 ? '0 2px 8px rgba(93,113,127,0.08)' : '',
648
+ margin: datas.commodityMargin + 'px',
649
+ 'border-radius': datas.borderRadius + 'px'
650
+ }"
651
+ @click="habdleToDetails(item)"
652
+ >
653
+ <!-- 图片 -->
654
+ <view class="bg-pic">
655
+ <image
656
+ class="commodity-image"
657
+ :src="item.image"
658
+ :style="[radiusStyle('img')]"
659
+ ></image>
660
+ <!-- 标签 -->
661
+ <view
662
+ class="marks"
663
+ :style="[styleString]"
664
+ v-if="datas.commoditycorner && datas.commoditycornertype === 0"
665
+ >
666
+ 新品
667
+ </view>
668
+ <view
669
+ :style="[styleString]"
670
+ class="marks"
671
+ v-if="datas.commoditycorner && datas.commoditycornertype === 1"
672
+ >
673
+ 热
674
+ <br />
675
+ 卖
676
+ </view>
677
+ <view
678
+ class="marks"
679
+ :style="[styleString]"
680
+ v-if="datas.commoditycorner && datas.commoditycornertype === 2"
681
+ >
682
+ NEW
683
+ </view>
684
+ <view
685
+ class="marks"
686
+ :style="[styleString]"
687
+ v-if="datas.commoditycorner && datas.commoditycornertype === 3"
688
+ >
689
+ HOT
690
+ </view>
691
+ </view>
692
+
693
+ <!-- 文字内容 -->
694
+ <view
695
+ class="text"
696
+ :style="[
697
+ {
698
+ background:
699
+ datas.moditystyle !== 3 ? 'var(--snake-color-surface, #fff)' : 'none'
700
+ },
701
+ radiusStyle()
702
+ ]"
703
+ >
704
+ <!-- 视频名称 -->
705
+ <text
706
+ class="commodity-title"
707
+ :style="{
708
+ 'font-weight': datas.textWeight,
709
+ 'text-align': datas.positions === 'center' ? 'center' : ''
710
+ }"
711
+ >
712
+ {{ item.name }}
713
+ </text>
714
+ <!-- 视频描述 -->
715
+ <text
716
+ class="commodity-description"
717
+ :style="{ 'text-align': datas.positions === 'center' ? 'center' : '' }"
718
+ v-if="item.introduce"
719
+ >
720
+ {{ item.introduce }}
721
+ </text>
722
+ <view class="mony" v-if="datas.priceofcommodity || datas.purchasebutton">
723
+ <text class="commodity-price" v-show="datas.priceofcommodity">
724
+ <text class="commodity-currency">¥</text>
725
+ {{ item.price }}
726
+ </text>
727
+ <view class="commodity-action-wrap" v-show="datas.purchasebutton">
728
+ <!-- <snake-icon name="" size="23" v-show="datas.purchasebuttonType === 0" />
729
+ <snake-icon name="" size="23" v-show="datas.purchasebuttonType === 1" />
730
+ <snake-icon name="" size="23" v-show="datas.purchasebuttonType === 2" />
731
+ <snake-icon name="" size="23" v-show="datas.purchasebuttonType === 3" /> -->
732
+ <text
733
+ class="commodity-action"
734
+ v-if="[4, 5, 6, 7].includes(datas.purchasebuttonType)"
735
+ >
736
+ {{ datas.purchase }}
737
+ </text>
738
+ </view>
739
+ </view>
740
+ </view>
741
+ </view>
742
+ </view>
743
+ </view>
744
+ </template>
745
+ </tree-select>
746
+ </view>
747
+ </view>
748
+ </template>
749
+
750
+ <script>
751
+ /**
752
+ * @component ListSwitching
753
+ * @description 提供多种商品列表布局、分类切换、角标和购买按钮样式,是一个配置面较大的复合展示组件。
754
+ */
755
+
756
+ import treeSelect from './components/tree-select/index.vue';
757
+ export default {
758
+ name: 'listswitching',
759
+ options: { virtualHost: true, styleIsolation: 'shared' },
760
+ emits: ['item-click'],
761
+ components: {
762
+ treeSelect
763
+ },
764
+ props: {
765
+ datas: Object
766
+ },
767
+ data() {
768
+ return {
769
+ active1: 0,
770
+ active: 0,
771
+ listSwitchName: null,
772
+ tagColor: 'var(--snake-color-primary, #06D290)',
773
+ styleString: {},
774
+ scrollTop: 0 //tab标题的滚动条位置
775
+ };
776
+ },
777
+ computed: {
778
+ radiusStyle() {
779
+ return (type = 'text') => {
780
+ const style = {};
781
+ switch (this.datas.commodityType) {
782
+ case 0:
783
+ case 1:
784
+ case 2:
785
+ case 4:
786
+ case 5:
787
+ if (type === 'img') {
788
+ style['border-top-left-radius'] = this.datas.borderRadius + 'px';
789
+ style['border-top-right-radius'] = this.datas.borderRadius + 'px';
790
+ } else {
791
+ style['border-bottom-left-radius'] = this.datas.borderRadius + 'px';
792
+ style['border-bottom-right-radius'] = this.datas.borderRadius + 'px';
793
+ }
794
+ break;
795
+ case 3:
796
+ if (type === 'img') {
797
+ style['border-top-left-radius'] = this.datas.borderRadius + 'px';
798
+ style['border-bottom-left-radius'] = this.datas.borderRadius + 'px';
799
+ } else {
800
+ style['border-top-right-radius'] = this.datas.borderRadius + 'px';
801
+ style['border-bottom-right-radius'] = this.datas.borderRadius + 'px';
802
+ }
803
+ break;
804
+ }
805
+ return style;
806
+ };
807
+ }
808
+ },
809
+ created() {
810
+ // console.log(this.datas, '--------------listswitching datas')
811
+ },
812
+ mounted() {
813
+ this.$nextTick(() => {
814
+ this.tagPositionStyle();
815
+ });
816
+ },
817
+ methods: {
818
+ imageFilter(item) {
819
+ if (item.name && item.name.includes('潮服')) {
820
+ return `${item.image}?x-oss-process=style/ys`;
821
+ } else {
822
+ return `${item.image}?x-oss-process=style/baidi`;
823
+ }
824
+ },
825
+ habdleToDetails(item) {
826
+ this.$emit('item-click', item);
827
+ },
828
+ // 类型二
829
+ changeTabs(index) {
830
+ this.active1 = index;
831
+ },
832
+ // 类型三
833
+ treeSelect(item, index) {
834
+ this.active = index;
835
+ },
836
+ // 处理标记位置
837
+ tagPositionStyle() {
838
+ this.styleString = {
839
+ position: 'absolute',
840
+ color: '#fff',
841
+ padding: '0 8rpx',
842
+ fontSize: '24rpx',
843
+ borderRadius: '2px',
844
+ backgroundColor: this.datas.commodityTagColor || this.datastagColor
845
+ };
846
+ if (this.datas.commoditycornertype === 3) {
847
+ this.styleString.backgroundColor = '';
848
+ this.styleString.border = `1rpx solid ${this.datas.commodityTagColor || this.datastagColor}`;
849
+ this.styleString.color = this.datas.commodityTagColor || this.datastagColor;
850
+ }
851
+ /* '左上',
852
+ '左下',
853
+ '又上',
854
+ '又下' */
855
+ switch (this.datas.tagPosition) {
856
+ case 0: // 左上
857
+ this.styleString.top = '5px';
858
+ this.styleString.left = '0px';
859
+ if (this.datas.commoditycornertype === 0) {
860
+ this.styleString.borderRadius = '0 10px 10px 0 !important';
861
+ }
862
+ break;
863
+ case 1: // 左下
864
+ this.styleString.bottom = '5px';
865
+ this.styleString.left = '0px';
866
+ if (this.datas.commoditycornertype === 0) {
867
+ this.styleString.borderRadius = '0 10px 10px 0 !important';
868
+ }
869
+ break;
870
+ case 2: // 右上
871
+ this.styleString.top = '5px';
872
+ this.styleString.right = '0px';
873
+ if (this.datas.commoditycornertype === 0) {
874
+ this.styleString.borderRadius = '10px 0px 0px 10px !important';
875
+ }
876
+ break;
877
+ case 3: // 右下
878
+ this.styleString.bottom = '5px';
879
+ this.styleString.right = '0px';
880
+ if (this.datas.commoditycornertype === 0) {
881
+ this.styleString.borderRadius = '0px 10px 10px 0px !important';
882
+ }
883
+ break;
884
+ }
885
+ }
886
+ },
887
+ watch: {
888
+ 'datas.tagPosition': function () {
889
+ this.tagPositionStyle();
890
+ },
891
+ 'datas.commoditycornertype': function () {
892
+ this.tagPositionStyle();
893
+ }
894
+ }
895
+ };
896
+ </script>
897
+
898
+ <style scoped lang="scss">
899
+ .listswitching {
900
+ position: relative;
901
+ padding: 10px 0;
902
+ background-repeat: no-repeat;
903
+ background-size: 100% 100%;
904
+
905
+ .more {
906
+ height: 25px;
907
+ margin-top: 10px;
908
+ font-size: 12px;
909
+ line-height: 25px;
910
+ color: var(--snake-color-text-muted, #999);
911
+ text-align: right;
912
+ cursor: pointer;
913
+ }
914
+
915
+ /* 默认商品 */
916
+ .defaultcommodity {
917
+ box-sizing: border-box;
918
+
919
+ &.defaultcommodityList5 {
920
+ display: flex;
921
+ flex-wrap: nowrap;
922
+ overflow-x: scroll;
923
+
924
+ /* 滚动条 */
925
+ &::-webkit-scrollbar {
926
+ height: 1px;
927
+ }
928
+
929
+ &::-webkit-scrollbar-thumb {
930
+ background-color: #155bd4;
931
+ }
932
+ }
933
+
934
+ .bg-pic {
935
+ position: relative;
936
+ width: 100%;
937
+ height: 240px;
938
+ }
939
+
940
+ .defaultcommodityList {
941
+ position: relative;
942
+ display: flex;
943
+ flex-direction: column;
944
+ background-color: var(--snake-color-surface, #fff);
945
+
946
+ &.defaultcommodityList0 {
947
+ width: 100%;
948
+ margin-top: 0 !important;
949
+ margin-right: 0 !important;
950
+ // height: 340px;
951
+ margin-left: 0 !important;
952
+
953
+ &:nth-of-type(1) {
954
+ margin-top: 0 !important;
955
+ }
956
+
957
+ .bg-pic {
958
+ width: 100%;
959
+ height: 240px;
960
+ }
961
+ }
962
+
963
+ &.defaultcommodityList1 {
964
+ box-sizing: border-box;
965
+ // border: none !important;
966
+ margin-top: 0 !important;
967
+
968
+ &:nth-of-type(even) {
969
+ margin-right: 0 !important;
970
+ margin-left: 0 !important;
971
+ }
972
+
973
+ &:nth-of-type(odd) {
974
+ margin-left: 0 !important;
975
+ }
976
+
977
+ .bg-pic {
978
+ width: 100%;
979
+ height: 360rpx;
980
+ }
981
+
982
+ .text {
983
+ padding: 12rpx 8rpx 20rpx;
984
+ }
985
+ }
986
+
987
+ &.defaultcommodityList2 {
988
+ max-width: 33%;
989
+ margin-top: 0 !important;
990
+ margin-left: 0 !important;
991
+
992
+ &:nth-of-type(3n) {
993
+ margin-right: 0 !important;
994
+ }
995
+
996
+ .text {
997
+ .commodity-title {
998
+ font-size: 12px !important;
999
+ }
1000
+
1001
+ .commodity-description {
1002
+ font-size: 10px !important;
1003
+ }
1004
+
1005
+ .mony {
1006
+ .commodity-price {
1007
+ display: flex;
1008
+ flex-direction: row;
1009
+ font-size: 12px !important;
1010
+
1011
+ .commodity-currency {
1012
+ font-size: 12px !important;
1013
+ }
1014
+ }
1015
+
1016
+ .commodity-currency {
1017
+ font-size: 14px !important;
1018
+ }
1019
+
1020
+ .commodity-action {
1021
+ padding: 1px 5px !important;
1022
+ font-size: 5px !important;
1023
+ }
1024
+ }
1025
+ }
1026
+
1027
+ .bg-pic {
1028
+ width: 100%;
1029
+ height: 70px;
1030
+ }
1031
+ }
1032
+
1033
+ &.defaultcommodityList3 {
1034
+ display: flex !important;
1035
+ flex-direction: row !important;
1036
+ width: 100%;
1037
+ height: 240rpx;
1038
+ margin-top: 0 !important;
1039
+ margin-right: 0 !important;
1040
+ margin-left: 0 !important;
1041
+
1042
+ .bg-pic {
1043
+ max-width: 240rpx !important;
1044
+ height: 240rpx !important;
1045
+ }
1046
+
1047
+ .text {
1048
+ width: 100%;
1049
+ height: 100%;
1050
+ }
1051
+ }
1052
+
1053
+ &.defaultcommodityList4 {
1054
+ &:nth-of-type(3n-2) {
1055
+ width: 100% !important;
1056
+ margin-right: 0px !important;
1057
+ margin-left: 0px !important;
1058
+
1059
+ .bg-pic {
1060
+ width: 100%;
1061
+ height: 240px;
1062
+ }
1063
+ }
1064
+
1065
+ &:nth-of-type(3n-1) {
1066
+ margin-left: 0px !important;
1067
+
1068
+ .bg-pic {
1069
+ width: 100%;
1070
+ height: 120px;
1071
+ }
1072
+ }
1073
+
1074
+ &:nth-of-type(3n) {
1075
+ margin-right: 0px !important;
1076
+ margin-left: 0px !important;
1077
+
1078
+ .bg-pic {
1079
+ width: 100%;
1080
+ height: 120px;
1081
+ }
1082
+ }
1083
+ }
1084
+
1085
+ &.defaultcommodityList5 {
1086
+ width: 100px;
1087
+ // height: 160px;
1088
+ margin-top: 0 !important;
1089
+ margin-right: 0px !important;
1090
+
1091
+ &:first-of-type {
1092
+ margin-left: 0px !important;
1093
+ }
1094
+
1095
+ .text {
1096
+ .commodity-title {
1097
+ font-size: 12px !important;
1098
+ }
1099
+
1100
+ .commodity-description {
1101
+ font-size: 10px !important;
1102
+ }
1103
+
1104
+ .mony {
1105
+ .commodity-price {
1106
+ display: flex;
1107
+ flex-direction: row;
1108
+ font-size: 12px !important;
1109
+
1110
+ .commodity-currency {
1111
+ font-size: 12px !important;
1112
+ }
1113
+ }
1114
+
1115
+ .commodity-currency {
1116
+ font-size: 14px !important;
1117
+ }
1118
+
1119
+ .commodity-action {
1120
+ padding: 1px 5px !important;
1121
+ font-size: 5px !important;
1122
+ }
1123
+ }
1124
+ }
1125
+
1126
+ .bg-pic {
1127
+ width: 100px;
1128
+ height: 70px;
1129
+ }
1130
+ }
1131
+
1132
+ .bg-pic > .commodity-image {
1133
+ width: 100%;
1134
+ height: 100%;
1135
+ }
1136
+
1137
+ /* 文字 */
1138
+ .text {
1139
+ box-sizing: border-box;
1140
+ width: 100%;
1141
+ padding: 36rpx 24rpx 43rpx;
1142
+ // height: 100%;
1143
+
1144
+ /* 商品名称 */
1145
+ .commodity-title {
1146
+ display: -webkit-box;
1147
+ margin: 0 0 5px;
1148
+ overflow: hidden;
1149
+ text-overflow: ellipsis;
1150
+ -webkit-line-clamp: 2;
1151
+ font-size: 22rpx;
1152
+ color: var(--snake-color-text, #303133);
1153
+ word-break: break-all;
1154
+ white-space: normal;
1155
+ -webkit-box-orient: vertical;
1156
+ }
1157
+
1158
+ /* 商品描述 */
1159
+ .commodity-description {
1160
+ height: 16px;
1161
+ overflow: hidden;
1162
+ text-overflow: ellipsis;
1163
+ font-size: 12px;
1164
+ line-height: 16px;
1165
+ color: var(--snake-color-text-muted, #999);
1166
+ white-space: nowrap;
1167
+ }
1168
+
1169
+ /* 视频价格 */
1170
+ .mony {
1171
+ display: flex;
1172
+ align-items: center;
1173
+ justify-content: space-between;
1174
+ // height: 44px;
1175
+ width: 100%;
1176
+
1177
+ > .commodity-price-wrap,
1178
+ > .commodity-action-wrap {
1179
+ display: flex;
1180
+ align-items: center;
1181
+ font-size: 16px;
1182
+ color: var(--snake-color-primary, #65c4aa);
1183
+ }
1184
+
1185
+ .commodity-price {
1186
+ display: flex;
1187
+ align-items: center;
1188
+ font-size: 16px;
1189
+ color: var(--snake-color-primary, #65c4aa);
1190
+
1191
+ .commodity-currency {
1192
+ font-size: 12px;
1193
+ }
1194
+ }
1195
+
1196
+ .commodity-currency {
1197
+ font-size: 16px;
1198
+ line-height: 44px;
1199
+ color: var(--snake-color-primary, #65c4aa);
1200
+ }
1201
+
1202
+ .commodity-action {
1203
+ padding: 2px 7px;
1204
+ font-size: 12px;
1205
+ font-style: normal;
1206
+ border: 1px solid var(--snake-color-primary, rgb(101, 196, 170));
1207
+
1208
+ &:nth-of-type(1) {
1209
+ color: var(--snake-color-primary, rgb(101, 196, 170));
1210
+ border-radius: 10px;
1211
+ }
1212
+
1213
+ &:nth-of-type(2) {
1214
+ color: #fff;
1215
+ background-color: var(--snake-color-primary, rgb(101, 196, 170));
1216
+ border-radius: 10px;
1217
+ }
1218
+
1219
+ &:nth-of-type(3) {
1220
+ color: var(--snake-color-primary, rgb(101, 196, 170));
1221
+ }
1222
+
1223
+ &:nth-of-type(4) {
1224
+ color: #fff;
1225
+ background-color: var(--snake-color-primary, rgb(101, 196, 170));
1226
+ }
1227
+ }
1228
+ }
1229
+ }
1230
+ }
1231
+ }
1232
+
1233
+ .defaultcommodityListFlex {
1234
+ display: flex;
1235
+ flex-wrap: wrap;
1236
+ justify-content: space-between;
1237
+ }
1238
+
1239
+ .tab-type2 {
1240
+ }
1241
+
1242
+ .type3 {
1243
+ ::v-deep.content {
1244
+ flex: 3.9 !important;
1245
+
1246
+ .defaultcommodityList3 {
1247
+ // height: 84px !important;
1248
+
1249
+ .bg-pic {
1250
+ // height: 84px !important;
1251
+ }
1252
+ }
1253
+
1254
+ .text {
1255
+ .commodity-title {
1256
+ font-size: 12px !important;
1257
+ }
1258
+
1259
+ .commodity-description {
1260
+ font-size: 10px !important;
1261
+ }
1262
+
1263
+ .mony {
1264
+ .commodity-price {
1265
+ font-size: 12px !important;
1266
+
1267
+ .commodity-currency {
1268
+ font-size: 12px !important;
1269
+ }
1270
+ }
1271
+
1272
+ .commodity-currency {
1273
+ font-size: 14px !important;
1274
+ }
1275
+
1276
+ .commodity-action {
1277
+ padding: 1px 5px !important;
1278
+ font-size: 5px !important;
1279
+ }
1280
+ }
1281
+ }
1282
+ }
1283
+ }
1284
+ }
1285
+ </style>