shoplazza-cli 1.1.2 → 2.0.0
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/CHANGELOG.md +21 -0
- package/LICENSE +21 -0
- package/README.md +206 -332
- package/README.zh.md +318 -0
- package/package.json +24 -70
- package/scripts/install.js +144 -0
- package/scripts/jsbuild/dev/index.js +123 -0
- package/scripts/jsbuild/index.js +77 -0
- package/{lib/checkout/build → scripts/jsbuild}/plugin/vite-plugin-add-extension-id.js +4 -2
- package/scripts/jsbuild/vite.config.js +35 -0
- package/scripts/run.js +29 -0
- package/.editorconfig +0 -28
- package/.prettierrc +0 -9
- package/bin/shoplazza +0 -137
- package/fixtures/assets/blog.scss +0 -74
- package/fixtures/assets/cart_modal.scss +0 -450
- package/fixtures/assets/collection_detail.js +0 -234
- package/fixtures/assets/collection_detail.scss +0 -345
- package/fixtures/assets/collection_list.scss +0 -11
- package/fixtures/assets/collection_slider.scss +0 -169
- package/fixtures/assets/feature_columns.scss +0 -26
- package/fixtures/assets/feature_product.scss +0 -109
- package/fixtures/assets/footer.js +0 -58
- package/fixtures/assets/footer.scss +0 -337
- package/fixtures/assets/four_images.scss +0 -29
- package/fixtures/assets/gallery.scss +0 -55
- package/fixtures/assets/header.js +0 -178
- package/fixtures/assets/header.scss +0 -929
- package/fixtures/assets/image_text.scss +0 -72
- package/fixtures/assets/logo_bar.scss +0 -11
- package/fixtures/assets/newsletter.scss +0 -90
- package/fixtures/assets/not_found.scss +0 -39
- package/fixtures/assets/page_detail.scss +0 -16
- package/fixtures/assets/pagination.scss +0 -150
- package/fixtures/assets/postcss.config.js +0 -6
- package/fixtures/assets/product_description.scss +0 -88
- package/fixtures/assets/product_detail.js +0 -634
- package/fixtures/assets/product_detail.scss +0 -1106
- package/fixtures/assets/relative_product.scss +0 -45
- package/fixtures/assets/reviews.scss +0 -70
- package/fixtures/assets/rich_text.scss +0 -71
- package/fixtures/assets/search.js +0 -87
- package/fixtures/assets/search.scss +0 -67
- package/fixtures/assets/slide.scss +0 -51
- package/fixtures/assets/slider.scss +0 -141
- package/fixtures/assets/test.scss +0 -1
- package/fixtures/assets/theme.css +0 -976
- package/fixtures/assets/theme.scss +0 -1100
- package/fixtures/assets/three_images.scss +0 -20
- package/fixtures/assets/tools.scss +0 -23
- package/fixtures/assets/two_images.scss +0 -24
- package/fixtures/assets/video.scss +0 -45
- package/fixtures/assets/video_text.scss +0 -63
- package/fixtures/config/settings_data.json +0 -107
- package/fixtures/config/settings_schema.json +0 -690
- package/fixtures/layout/theme.liquid +0 -76
- package/fixtures/locales/ar-SA.json +0 -212
- package/fixtures/locales/de-DE.json +0 -290
- package/fixtures/locales/en-US.json +0 -290
- package/fixtures/locales/es-ES.json +0 -290
- package/fixtures/locales/fr-FR.json +0 -290
- package/fixtures/locales/id-ID.json +0 -212
- package/fixtures/locales/it-IT.json +0 -212
- package/fixtures/locales/ja-JP.json +0 -289
- package/fixtures/locales/ko-KR.json +0 -290
- package/fixtures/locales/nl-NL.json +0 -290
- package/fixtures/locales/pl-PL.json +0 -290
- package/fixtures/locales/pt-PT.json +0 -212
- package/fixtures/locales/ru-RU.json +0 -212
- package/fixtures/locales/th-TH.json +0 -212
- package/fixtures/locales/zh-CN.json +0 -290
- package/fixtures/locales/zh-TW.json +0 -290
- package/fixtures/sections/apps.liquid +0 -47
- package/fixtures/sections/blog.liquid +0 -137
- package/fixtures/sections/collection_desc.liquid +0 -34
- package/fixtures/sections/collection_detail.liquid +0 -436
- package/fixtures/sections/collection_image.liquid +0 -104
- package/fixtures/sections/collection_list.liquid +0 -161
- package/fixtures/sections/collection_name.liquid +0 -34
- package/fixtures/sections/collection_slider.liquid +0 -330
- package/fixtures/sections/feature_columns.liquid +0 -275
- package/fixtures/sections/feature_product.liquid +0 -227
- package/fixtures/sections/footer.liquid +0 -488
- package/fixtures/sections/four_images.liquid +0 -160
- package/fixtures/sections/gallery.liquid +0 -258
- package/fixtures/sections/header.liquid +0 -1157
- package/fixtures/sections/html.liquid +0 -40
- package/fixtures/sections/image_text.liquid +0 -350
- package/fixtures/sections/instagram_plus.liquid +0 -393
- package/fixtures/sections/logo_bar.liquid +0 -183
- package/fixtures/sections/newsletter.liquid +0 -225
- package/fixtures/sections/not_found.liquid +0 -39
- package/fixtures/sections/overlay_image.liquid +0 -648
- package/fixtures/sections/page_detail.liquid +0 -39
- package/fixtures/sections/photo_collection.liquid +0 -433
- package/fixtures/sections/product_description.liquid +0 -208
- package/fixtures/sections/product_detail.liquid +0 -611
- package/fixtures/sections/products.liquid +0 -216
- package/fixtures/sections/relative_product.liquid +0 -121
- package/fixtures/sections/reviews.liquid +0 -115
- package/fixtures/sections/rich_text.liquid +0 -157
- package/fixtures/sections/search.liquid +0 -163
- package/fixtures/sections/slide.liquid +0 -719
- package/fixtures/sections/three_images.liquid +0 -157
- package/fixtures/sections/two_images.liquid +0 -125
- package/fixtures/sections/video.liquid +0 -95
- package/fixtures/sections/video_text.liquid +0 -128
- package/fixtures/snippets/bgset.liquid +0 -21
- package/fixtures/snippets/card_title.liquid +0 -8
- package/fixtures/snippets/cart_modal.liquid +0 -74
- package/fixtures/snippets/collection.liquid +0 -77
- package/fixtures/snippets/collection_filter_modal.liquid +0 -56
- package/fixtures/snippets/default_image_4.liquid +0 -14
- package/fixtures/snippets/default_image_6.liquid +0 -18
- package/fixtures/snippets/default_image_8.liquid +0 -23
- package/fixtures/snippets/four_images_item.liquid +0 -8
- package/fixtures/snippets/header_ads.liquid +0 -95
- package/fixtures/snippets/hero_image.liquid +0 -94
- package/fixtures/snippets/icon_video_play_large.liquid +0 -1
- package/fixtures/snippets/icon_video_play_medium.liquid +0 -4
- package/fixtures/snippets/icon_video_play_small.liquid +0 -4
- package/fixtures/snippets/lazyimg.liquid +0 -22
- package/fixtures/snippets/lazyimg_art.liquid +0 -36
- package/fixtures/snippets/lazysizes.liquid +0 -41
- package/fixtures/snippets/link.liquid +0 -2
- package/fixtures/snippets/pagination.liquid +0 -48
- package/fixtures/snippets/product.liquid +0 -126
- package/fixtures/snippets/product_art_tpl.liquid +0 -152
- package/fixtures/snippets/product_info_body.liquid +0 -337
- package/fixtures/snippets/product_info_tpl.liquid +0 -423
- package/fixtures/snippets/product_label.liquid +0 -46
- package/fixtures/snippets/settings.liquid +0 -295
- package/fixtures/snippets/social-meta-tags.liquid +0 -106
- package/fixtures/snippets/video_html.liquid +0 -11
- package/fixtures/snippets/video_source.liquid +0 -98
- package/fixtures/snippets/video_thumb_icon.liquid +0 -2
- package/fixtures/templates/404.liquid +0 -1
- package/fixtures/templates/collection.liquid +0 -92
- package/fixtures/templates/index.liquid +0 -206
- package/fixtures/templates/page.liquid +0 -1
- package/fixtures/templates/product.liquid +0 -99
- package/fixtures/templates/search.liquid +0 -1
- package/jest.config.js +0 -192
- package/lib/__tests__/log.test.js +0 -15
- package/lib/__tests__/utils.test.js +0 -69
- package/lib/app/api/cli.js +0 -225
- package/lib/app/api/openapi.js +0 -121
- package/lib/app/api/partnerOpenapi.js +0 -104
- package/lib/app/bin/index.js +0 -20
- package/lib/app/bin/javy/javy-arm-linux-v5.0.1 +0 -0
- package/lib/app/bin/javy/javy-arm-macos-v5.0.1 +0 -0
- package/lib/app/bin/javy/javy-x86_64-linux-v5.0.1 +0 -0
- package/lib/app/bin/javy/javy-x86_64-macos-v5.0.1 +0 -0
- package/lib/app/bin/javy/javy-x86_64-windows-v5.0.1 +0 -0
- package/lib/app/commands/config/actions/link.js +0 -189
- package/lib/app/commands/config/actions/use.js +0 -40
- package/lib/app/commands/config/index.js +0 -25
- package/lib/app/commands/config/link.js +0 -11
- package/lib/app/commands/config/use.js +0 -11
- package/lib/app/commands/deploy/actions/deploy.js +0 -196
- package/lib/app/commands/deploy/index.js +0 -11
- package/lib/app/commands/dev/actions/dev.js +0 -206
- package/lib/app/commands/dev/index.js +0 -11
- package/lib/app/commands/generate/actions/extension.js +0 -97
- package/lib/app/commands/generate/actions/generateCheckout.js +0 -58
- package/lib/app/commands/generate/actions/generateFunction.js +0 -56
- package/lib/app/commands/generate/actions/generateTheme.js +0 -128
- package/lib/app/commands/generate/extension.js +0 -11
- package/lib/app/commands/generate/index.js +0 -22
- package/lib/app/commands/index.js +0 -82
- package/lib/app/commands/info/actions/info.js +0 -168
- package/lib/app/commands/info/index.js +0 -11
- package/lib/app/commands/init/actions/init.js +0 -176
- package/lib/app/commands/init/index.js +0 -14
- package/lib/app/commands/versions/actions/list.js +0 -210
- package/lib/app/commands/versions/index.js +0 -22
- package/lib/app/commands/versions/list.js +0 -14
- package/lib/app/constant/code.js +0 -7
- package/lib/app/constant/color.js +0 -18
- package/lib/app/constant/extension.js +0 -16
- package/lib/app/constant/host.js +0 -23
- package/lib/app/constant/sso.js +0 -7
- package/lib/app/index.js +0 -8
- package/lib/app/services/auth/config.js +0 -33
- package/lib/app/services/auth/index.js +0 -9
- package/lib/app/services/auth/oauth-server.js +0 -70
- package/lib/app/services/auth/partner-token.js +0 -45
- package/lib/app/services/auth/sso-token.js +0 -69
- package/lib/app/services/auth/store-token.js +0 -100
- package/lib/app/services/auth/url-builder.js +0 -23
- package/lib/app/services/config/index.js +0 -41
- package/lib/app/services/devServer/app.js +0 -76
- package/lib/app/services/devServer/index.js +0 -103
- package/lib/app/services/devServer/middleware/hmacValidatorMiddleWare.js +0 -20
- package/lib/app/services/devServer/middleware/index.js +0 -5
- package/lib/app/services/devServer/tunnel/index.js +0 -43
- package/lib/app/services/devServer/tunnel/providers/cloudflare.js +0 -364
- package/lib/app/services/devServer/tunnel/providers/ngrok.js +0 -70
- package/lib/app/services/devServer/utils/index.js +0 -5
- package/lib/app/services/devServer/utils/secureCompare.js +0 -5
- package/lib/app/services/devServer/views/app.ejs +0 -133
- package/lib/app/services/extension-build/buildCheckout.js +0 -47
- package/lib/app/services/extension-build/buildFunction.js +0 -57
- package/lib/app/services/extension-build/buildTheme.js +0 -100
- package/lib/app/services/extension-build/index.js +0 -23
- package/lib/app/services/extension-build/plugins/vite-plugin-add-extension-id.js +0 -26
- package/lib/app/services/extension-diff/index.js +0 -132
- package/lib/app/services/extension-upsert/index.js +0 -21
- package/lib/app/services/extension-upsert/upsertCheckout.js +0 -44
- package/lib/app/services/extension-upsert/upsertFunction.js +0 -52
- package/lib/app/services/extension-upsert/upsertTheme.js +0 -113
- package/lib/app/services/oss/index.js +0 -45
- package/lib/app/services/partner/index.js +0 -52
- package/lib/app/store/base-store.js +0 -37
- package/lib/app/store/config-store.js +0 -55
- package/lib/app/store/config.js +0 -21
- package/lib/app/store/index.js +0 -14
- package/lib/app/store/install-store.js +0 -41
- package/lib/app/store/sso-store.js +0 -55
- package/lib/app/utils/asyncPool.js +0 -42
- package/lib/app/utils/debug/index.js +0 -16
- package/lib/app/utils/env.js +0 -24
- package/lib/app/utils/error.js +0 -20
- package/lib/app/utils/git.js +0 -20
- package/lib/app/utils/json.js +0 -27
- package/lib/app/utils/path.js +0 -33
- package/lib/app/utils/platform.js +0 -37
- package/lib/app/utils/request/cli.js +0 -72
- package/lib/app/utils/request/debug.js +0 -13
- package/lib/app/utils/request/openapi.js +0 -67
- package/lib/app/utils/request/partnerOpenapi.js +0 -47
- package/lib/app/utils/toml.js +0 -56
- package/lib/app/utils/views/message.js +0 -68
- package/lib/app/utils/views/select.js +0 -36
- package/lib/app/utils/withTempDir.js +0 -55
- package/lib/auth/__mocks__/getCode.js +0 -7
- package/lib/auth/__mocks__/index.js +0 -0
- package/lib/auth/child.js +0 -23
- package/lib/auth/getCode.js +0 -39
- package/lib/auth/index.js +0 -134
- package/lib/check.js +0 -28
- package/lib/checkout/api.js +0 -164
- package/lib/checkout/build/plugin/vite-plugin-transform-extension-html.js +0 -207
- package/lib/checkout/build/vite.config.js +0 -34
- package/lib/checkout/build.js +0 -38
- package/lib/checkout/config.js +0 -97
- package/lib/checkout/create.js +0 -132
- package/lib/checkout/delete.js +0 -26
- package/lib/checkout/deploy.js +0 -59
- package/lib/checkout/dev/index.js +0 -143
- package/lib/checkout/fields.js +0 -29
- package/lib/checkout/index.js +0 -63
- package/lib/checkout/preview.js +0 -52
- package/lib/checkout/pull.js +0 -22
- package/lib/checkout/push.js +0 -141
- package/lib/checkout/template/README.md +0 -34
- package/lib/checkout/template/_gitignore +0 -4
- package/lib/checkout/template/extension.config.js +0 -4
- package/lib/checkout/template/extensions/extension-template/extension.json +0 -10
- package/lib/checkout/template/extensions/extension-template/src/content.html +0 -3
- package/lib/checkout/template/extensions/extension-template/src/index.html +0 -5
- package/lib/checkout/template/extensions/extension-template/src/index.js +0 -11
- package/lib/checkout/template/extensions/extension-template/src/script.html +0 -3
- package/lib/checkout/template/extensions/extension-template/src/style.html +0 -3
- package/lib/checkout/template/package.json +0 -17
- package/lib/checkout/undeploy.js +0 -40
- package/lib/checkout/util.js +0 -201
- package/lib/checkout/verify.js +0 -16
- package/lib/checkout/version.js +0 -7
- package/lib/commands/__tests__/login.test.js +0 -77
- package/lib/commands/__tests__/logout.test.js +0 -29
- package/lib/commands/__tests__/store.test.js +0 -44
- package/lib/commands/__tests__/switch.test.js +0 -45
- package/lib/commands/login.js +0 -120
- package/lib/commands/logout.js +0 -23
- package/lib/commands/store.js +0 -14
- package/lib/commands/switch.js +0 -52
- package/lib/commands/theme/__tests__/delete.test.js +0 -49
- package/lib/commands/theme/__tests__/init.test.js +0 -21
- package/lib/commands/theme/__tests__/list.test.js +0 -80
- package/lib/commands/theme/__tests__/package.test.js +0 -17
- package/lib/commands/theme/__tests__/publish.test.js +0 -61
- package/lib/commands/theme/__tests__/pull.test.js +0 -69
- package/lib/commands/theme/__tests__/push.test.js +0 -63
- package/lib/commands/theme/__tests__/serve.test.js +0 -107
- package/lib/commands/theme/delete.js +0 -64
- package/lib/commands/theme/init.js +0 -51
- package/lib/commands/theme/list.js +0 -28
- package/lib/commands/theme/package.js +0 -37
- package/lib/commands/theme/publish.js +0 -56
- package/lib/commands/theme/pull.js +0 -62
- package/lib/commands/theme/push.js +0 -106
- package/lib/commands/theme/serve.js +0 -153
- package/lib/commands/theme/share.js +0 -20
- package/lib/commands/version.js +0 -6
- package/lib/common/constants.js +0 -24
- package/lib/common/db/partner.js +0 -91
- package/lib/common/inquirers/choose-app.js +0 -79
- package/lib/common/inquirers/choose-partner.js +0 -74
- package/lib/common/log.js +0 -15
- package/lib/common/login.js +0 -125
- package/lib/common/logout.js +0 -16
- package/lib/db/__mocks__/index.js +0 -9
- package/lib/db/__tests__/analytics.test.js +0 -19
- package/lib/db/__tests__/user.test.js +0 -20
- package/lib/db/analytics.js +0 -48
- package/lib/db/index.js +0 -9
- package/lib/db/user.js +0 -71
- package/lib/function/bin/index.js +0 -20
- package/lib/function/bin/javy/javy-arm-linux-v5.0.1 +0 -0
- package/lib/function/bin/javy/javy-arm-macos-v5.0.1 +0 -0
- package/lib/function/bin/javy/javy-x86_64-linux-v5.0.1 +0 -0
- package/lib/function/bin/javy/javy-x86_64-macos-v5.0.1 +0 -0
- package/lib/function/bin/javy/javy-x86_64-windows-v5.0.1 +0 -0
- package/lib/function/commands/compile.js +0 -43
- package/lib/function/commands/create.js +0 -77
- package/lib/function/commands/list.js +0 -18
- package/lib/function/commands/release.js +0 -69
- package/lib/function/index.js +0 -24
- package/lib/function/template/js/README.md +0 -37
- package/lib/function/template/js/_gitignore +0 -4
- package/lib/function/template/js/extension.config.json +0 -5
- package/lib/function/template/js/package.json +0 -17
- package/lib/function/template/js/src/index.js +0 -64
- package/lib/function/utils.js +0 -29
- package/lib/log.js +0 -13
- package/lib/openAPI/__mocks__/index.js +0 -20
- package/lib/openAPI/api.js +0 -76
- package/lib/openAPI/index.js +0 -56
- package/lib/oss.js +0 -102
- package/lib/partner-api/axios.js +0 -67
- package/lib/partner-api/index.js +0 -79
- package/lib/report.js +0 -37
- package/lib/theme-extension/api/index.js +0 -96
- package/lib/theme-extension/commands/build.js +0 -114
- package/lib/theme-extension/commands/connect.js +0 -73
- package/lib/theme-extension/commands/create.js +0 -105
- package/lib/theme-extension/commands/deploy.js +0 -56
- package/lib/theme-extension/commands/list.js +0 -35
- package/lib/theme-extension/commands/release.js +0 -59
- package/lib/theme-extension/commands/serve.js +0 -179
- package/lib/theme-extension/commands/versions.js +0 -55
- package/lib/theme-extension/index.js +0 -29
- package/lib/theme-extension/template/basic-app/README.md +0 -125
- package/lib/theme-extension/template/basic-app/extension.config.json +0 -4
- package/lib/theme-extension/template/basic-app/package.json +0 -18
- package/lib/theme-extension/template/basic-app/theme-app/assets/index.css +0 -4
- package/lib/theme-extension/template/basic-app/theme-app/assets-manifest.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/blocks/index.liquid +0 -16
- package/lib/theme-extension/template/basic-app/theme-app/locales/ar-SA.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/locales/de-DE.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/locales/en-US.json +0 -6
- package/lib/theme-extension/template/basic-app/theme-app/locales/es-ES.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/locales/fr-FR.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/locales/id-ID.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/locales/it-IT.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/locales/ja-JP.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/locales/ko-KR.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/locales/nl-NL.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/locales/pl-PL.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/locales/pt-PT.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/locales/ru-RU.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/locales/th-TH.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/locales/zh-CN.json +0 -6
- package/lib/theme-extension/template/basic-app/theme-app/locales/zh-TW.json +0 -1
- package/lib/theme-extension/template/basic-app/theme-app/snippets/index.liquid +0 -8
- package/lib/theme-extension/template/embed-app/README.md +0 -125
- package/lib/theme-extension/template/embed-app/extension.config.json +0 -4
- package/lib/theme-extension/template/embed-app/package.json +0 -18
- package/lib/theme-extension/template/embed-app/theme-app/assets-manifest.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/blocks/index.liquid +0 -18
- package/lib/theme-extension/template/embed-app/theme-app/locales/ar-SA.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/locales/de-DE.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/locales/en-US.json +0 -6
- package/lib/theme-extension/template/embed-app/theme-app/locales/es-ES.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/locales/fr-FR.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/locales/id-ID.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/locales/it-IT.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/locales/ja-JP.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/locales/ko-KR.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/locales/nl-NL.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/locales/pl-PL.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/locales/pt-PT.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/locales/ru-RU.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/locales/th-TH.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/locales/zh-CN.json +0 -6
- package/lib/theme-extension/template/embed-app/theme-app/locales/zh-TW.json +0 -1
- package/lib/theme-extension/template/embed-app/theme-app/snippets/index.liquid +0 -8
- package/lib/theme-extension/template/embed-app/theme-app/snippets/index_css.liquid +0 -6
- package/lib/theme-extension/utils/config.js +0 -32
- package/lib/theme-extension/utils/index.js +0 -213
- package/lib/tracing.js +0 -50
- package/lib/utils/config.js +0 -12
- package/lib/utils/console.js +0 -33
- package/lib/utils/env.js +0 -17
- package/lib/utils/file.js +0 -48
- package/lib/utils/platform.js +0 -37
- package/lib/utils/utils.js +0 -165
- /package/{lib/checkout → scripts/jsbuild}/dev/client.js +0 -0
- /package/{lib/app/services/extension-build/plugins → scripts/jsbuild/plugin}/vite-plugin-transform-extension-html.js +0 -0
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
{% use 'three_images.css' %}
|
|
2
|
-
<div class="container container-gap">
|
|
3
|
-
{% assign text= section.settings.text %}
|
|
4
|
-
<div class="row three-image__row">
|
|
5
|
-
{% assign defaultImg = 'oss/operation/0910a006fb3101bcf913804c47bf3b13.png' %}
|
|
6
|
-
{% for i in (1..3) %}
|
|
7
|
-
{% if i == 1 %}
|
|
8
|
-
{% assign imgSrc = 'image_src_1' %}
|
|
9
|
-
{% assign linkUrl = 'url_1' %}
|
|
10
|
-
{% elsif i == 2 %}
|
|
11
|
-
{% assign imgSrc = 'image_src_2' %}
|
|
12
|
-
{% assign linkUrl = 'url_2' %}
|
|
13
|
-
{% else %}
|
|
14
|
-
{% assign imgSrc = 'image_src_3' %}
|
|
15
|
-
{% assign linkUrl = 'url_3' %}
|
|
16
|
-
{% endif %}
|
|
17
|
-
{% assign imageUrl = section.settings[imgSrc] %}
|
|
18
|
-
{% assign linkToUrl = section.settings[linkUrl].url %}
|
|
19
|
-
{% assign link_type = section.settings[linkUrl].type %}
|
|
20
|
-
<div class="col-sm-12 col-md-4 three-image__image">
|
|
21
|
-
<a class="common__img-wrapper_lazy {% if linkToUrl %}common__mask{% endif %} {%if shop.env == 1 and imageUrl == "" %}common__img-desc{% endif %}" data-title="Image-{{i}}"
|
|
22
|
-
style="padding-bottom:{{ images[imageUrl].height | image_padding_bottom : images[imageUrl].width, origin: 'unlimit'}}; width:100%"
|
|
23
|
-
{% if linkToUrl%}
|
|
24
|
-
href="{{ linkToUrl }}"
|
|
25
|
-
{% endif %}
|
|
26
|
-
{% if link_type == 'web' %}
|
|
27
|
-
target="_blank"
|
|
28
|
-
{% endif %}>
|
|
29
|
-
{% assign src = imageUrl | default: defaultImg %}
|
|
30
|
-
{% include 'lazyimg',
|
|
31
|
-
src: src,
|
|
32
|
-
class: 'img-full-width'
|
|
33
|
-
%}
|
|
34
|
-
</a>
|
|
35
|
-
</div>
|
|
36
|
-
{% endfor %}
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
{% schema %}
|
|
43
|
-
{
|
|
44
|
-
"name": "three_images",
|
|
45
|
-
"settings": [
|
|
46
|
-
{
|
|
47
|
-
"type": "header",
|
|
48
|
-
"content": {
|
|
49
|
-
"en-US": "Image 1",
|
|
50
|
-
"zh-CN": "图1"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"type": "image_picker",
|
|
55
|
-
"id": "image_src_1",
|
|
56
|
-
"label": {
|
|
57
|
-
"en-US": "Image",
|
|
58
|
-
"zh-CN": "图片"
|
|
59
|
-
},
|
|
60
|
-
"info": {
|
|
61
|
-
"zh-CN": "建议尺寸:宽度1000px,高度可自适应",
|
|
62
|
-
"en-US": "Recommended resolution: width 1000px,responsive height"
|
|
63
|
-
},
|
|
64
|
-
"default": ""
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"type": "url",
|
|
68
|
-
"id": "url_1",
|
|
69
|
-
"label": {
|
|
70
|
-
"en-US": "Link",
|
|
71
|
-
"zh-CN": "链接"
|
|
72
|
-
},
|
|
73
|
-
"is_image_link": true,
|
|
74
|
-
"default": ""
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"type": "header",
|
|
78
|
-
"content": {
|
|
79
|
-
"en-US": "Image 2",
|
|
80
|
-
"zh-CN": "图2"
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"type": "image_picker",
|
|
85
|
-
"id": "image_src_2",
|
|
86
|
-
"label": {
|
|
87
|
-
"en-US": "Image",
|
|
88
|
-
"zh-CN": "图片"
|
|
89
|
-
},
|
|
90
|
-
"info": {
|
|
91
|
-
"zh-CN": "建议尺寸:宽度1000px,高度可自适应",
|
|
92
|
-
"en-US": "Recommended resolution: width 1000px,responsive height"
|
|
93
|
-
},
|
|
94
|
-
"default": ""
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"type": "url",
|
|
98
|
-
"id": "url_2",
|
|
99
|
-
"label": {
|
|
100
|
-
"en-US": "Link",
|
|
101
|
-
"zh-CN": "链接"
|
|
102
|
-
},
|
|
103
|
-
"is_image_link": true,
|
|
104
|
-
"default": ""
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"type": "header",
|
|
108
|
-
"content": {
|
|
109
|
-
"en-US": "Image 3",
|
|
110
|
-
"zh-CN": "图3"
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"type": "image_picker",
|
|
115
|
-
"id": "image_src_3",
|
|
116
|
-
"label": {
|
|
117
|
-
"en-US": "Image",
|
|
118
|
-
"zh-CN": "图片"
|
|
119
|
-
},
|
|
120
|
-
"info": {
|
|
121
|
-
"zh-CN": "建议尺寸:宽度1000px,高度可自适应",
|
|
122
|
-
"en-US": "Recommended resolution: width 1000px, responsive height"
|
|
123
|
-
},
|
|
124
|
-
"default": ""
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"type": "url",
|
|
128
|
-
"id": "url_3",
|
|
129
|
-
"label": {
|
|
130
|
-
"en-US": "Link",
|
|
131
|
-
"zh-CN": "链接"
|
|
132
|
-
},
|
|
133
|
-
"is_image_link": true,
|
|
134
|
-
"default": ""
|
|
135
|
-
}
|
|
136
|
-
],
|
|
137
|
-
"presets": [
|
|
138
|
-
{
|
|
139
|
-
"name": "three_images",
|
|
140
|
-
"cname": {
|
|
141
|
-
"zh-CN": "多图-3",
|
|
142
|
-
"en-US": "Images 3"
|
|
143
|
-
},
|
|
144
|
-
"category": {
|
|
145
|
-
"en-US": "Material",
|
|
146
|
-
"zh-CN": "素材"
|
|
147
|
-
},
|
|
148
|
-
"ccategory": {
|
|
149
|
-
"en-US": "Material",
|
|
150
|
-
"zh-CN": "素材"
|
|
151
|
-
},
|
|
152
|
-
"display": true,
|
|
153
|
-
"blocks": []
|
|
154
|
-
}
|
|
155
|
-
]
|
|
156
|
-
}
|
|
157
|
-
{% endschema %}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
{% use 'two_images.css' %}
|
|
2
|
-
<div class="container container-gap">
|
|
3
|
-
{% assign text= section.settings.text %}
|
|
4
|
-
<div class="row two-image__row">
|
|
5
|
-
{% assign defaultImg = 'oss/operation/0910a006fb3101bcf913804c47bf3b13.png' %}
|
|
6
|
-
|
|
7
|
-
{% for i in (1..2) %}
|
|
8
|
-
{% if i == 1 %}
|
|
9
|
-
{% assign imgSrc = 'image_src_1' %}
|
|
10
|
-
{% assign linkUrl = 'url_1' %}
|
|
11
|
-
{% else %}
|
|
12
|
-
{% assign imgSrc = 'image_src_2' %}
|
|
13
|
-
{% assign linkUrl = 'url_2' %}
|
|
14
|
-
{% endif %}
|
|
15
|
-
{% assign imageUrl = section.settings[imgSrc] %}
|
|
16
|
-
{% assign linkToUrl = section.settings[linkUrl].url %}
|
|
17
|
-
{% assign link_type = section.settings[linkUrl].type %}
|
|
18
|
-
<div class="col-sm-12 col-md-6 two-image__image">
|
|
19
|
-
<a class="common__img-wrapper_lazy {% if linkToUrl %}common__mask{% endif %} {%if shop.env == 1 and imageUrl == "" %}common__img-desc{% endif %}" data-title="Image-{{i}}"
|
|
20
|
-
style="padding-bottom:{{ images[imageUrl].height | image_padding_bottom : images[imageUrl].width, origin: 'unlimit'}}; width:100%"
|
|
21
|
-
{% if linkToUrl%}
|
|
22
|
-
href="{{linkToUrl}}"
|
|
23
|
-
{% endif %}
|
|
24
|
-
{% if link_type == 'web' %}
|
|
25
|
-
target="_blank"
|
|
26
|
-
{% endif %}>
|
|
27
|
-
{% assign src = imageUrl | default: defaultImg %}
|
|
28
|
-
{% include 'lazyimg',
|
|
29
|
-
src: src,
|
|
30
|
-
class: 'img-full-width'
|
|
31
|
-
%}
|
|
32
|
-
</a>
|
|
33
|
-
</div>
|
|
34
|
-
{% endfor %}
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{% schema %}
|
|
41
|
-
{
|
|
42
|
-
"name": "two_images",
|
|
43
|
-
"settings": [
|
|
44
|
-
{
|
|
45
|
-
"type": "header",
|
|
46
|
-
"content": {
|
|
47
|
-
"en-US": "Image 1",
|
|
48
|
-
"zh-CN": "图1"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"type": "image_picker",
|
|
53
|
-
"id": "image_src_1",
|
|
54
|
-
"label": {
|
|
55
|
-
"en-US": "Image",
|
|
56
|
-
"zh-CN": "图片"
|
|
57
|
-
},
|
|
58
|
-
"info": {
|
|
59
|
-
"zh-CN": "建议尺寸:宽度1000px,高度可自适应",
|
|
60
|
-
"en-US": "Recommended resolution:width 1000px,responsive height"
|
|
61
|
-
},
|
|
62
|
-
"default": ""
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"type": "url",
|
|
66
|
-
"id": "url_1",
|
|
67
|
-
"label": {
|
|
68
|
-
"en-US": "Link",
|
|
69
|
-
"zh-CN": "链接"
|
|
70
|
-
},
|
|
71
|
-
"is_image_link": true,
|
|
72
|
-
"default": ""
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"type": "header",
|
|
76
|
-
"content": {
|
|
77
|
-
"en-US": "Image 2",
|
|
78
|
-
"zh-CN": "图2"
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"type": "image_picker",
|
|
83
|
-
"id": "image_src_2",
|
|
84
|
-
"label": {
|
|
85
|
-
"en-US": "Image",
|
|
86
|
-
"zh-CN": "图片"
|
|
87
|
-
},
|
|
88
|
-
"info": {
|
|
89
|
-
"zh-CN": "建议尺寸:宽度1000px,高度可自适应",
|
|
90
|
-
"en-US": "Recommended resolution:width 1000px,responsive height"
|
|
91
|
-
},
|
|
92
|
-
"default": ""
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"type": "url",
|
|
96
|
-
"id": "url_2",
|
|
97
|
-
"label": {
|
|
98
|
-
"en-US": "Link",
|
|
99
|
-
"zh-CN": "链接"
|
|
100
|
-
},
|
|
101
|
-
"is_image_link": true,
|
|
102
|
-
"default": ""
|
|
103
|
-
}
|
|
104
|
-
],
|
|
105
|
-
"presets": [
|
|
106
|
-
{
|
|
107
|
-
"name": "two_images",
|
|
108
|
-
"cname": {
|
|
109
|
-
"zh-CN": "多图-2",
|
|
110
|
-
"en-US": "Images 2"
|
|
111
|
-
},
|
|
112
|
-
"category": {
|
|
113
|
-
"en-US": "Material",
|
|
114
|
-
"zh-CN": "素材"
|
|
115
|
-
},
|
|
116
|
-
"ccategory": {
|
|
117
|
-
"en-US": "Material",
|
|
118
|
-
"zh-CN": "素材"
|
|
119
|
-
},
|
|
120
|
-
"display": true,
|
|
121
|
-
"blocks": []
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
{% endschema %}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
{% use 'video.css' %}
|
|
2
|
-
{% assign defaultImage = 'oss/operation/ee147ae7fe87ec16f50a5f17e57e6aa9.jpg' | img_url %}
|
|
3
|
-
<div class="container video-{{section.id}} container-gap">
|
|
4
|
-
<div class="row">
|
|
5
|
-
<div class="video">
|
|
6
|
-
{% if section.settings.video_title %}
|
|
7
|
-
<h1 class="video__title dj_skin_title text-truncate">{{section.settings.video_title}}</h1>
|
|
8
|
-
{% endif %}
|
|
9
|
-
<div class="video__wrapper">
|
|
10
|
-
<img class="video__wrappe_default" src="{{defaultImage}}"/>
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
{% javascript %}
|
|
17
|
-
$(function () {
|
|
18
|
-
var videoId = $.getYoutubeId('{{section.settings.video.url}}');
|
|
19
|
-
videoId && $('.video-{{section.id}} .video__wrapper').html('<iframe title="" src="https://www.youtube.com/embed/' + videoId + '?rel=0&modestbranding=1&autoplay='+ 0 + '" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>');
|
|
20
|
-
})
|
|
21
|
-
{% endjavascript %}
|
|
22
|
-
|
|
23
|
-
{% schema %}
|
|
24
|
-
{
|
|
25
|
-
"name": "video",
|
|
26
|
-
"settings": [
|
|
27
|
-
{
|
|
28
|
-
"type": "header",
|
|
29
|
-
"content": {
|
|
30
|
-
"en-US": "Text",
|
|
31
|
-
"zh-CN": "文本"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"type": "text",
|
|
36
|
-
"id": "video_title",
|
|
37
|
-
"label": {
|
|
38
|
-
"en-US": "Heading",
|
|
39
|
-
"zh-CN": "标题"
|
|
40
|
-
},
|
|
41
|
-
"placeholder": {
|
|
42
|
-
"zh-CN": "视频标题",
|
|
43
|
-
"en-US": "Video title"
|
|
44
|
-
},
|
|
45
|
-
"default": "Video"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"type": "header",
|
|
49
|
-
"content": {
|
|
50
|
-
"en-US": "Video",
|
|
51
|
-
"zh-CN": "视频"
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"type": "popover",
|
|
56
|
-
"label": {
|
|
57
|
-
"zh-CN": "请复制视频链接到下方,当前仅支持Youtube视频",
|
|
58
|
-
"en-US": "Copy the video link to the below (only support Youtube video now)"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"type": "video_url",
|
|
63
|
-
"id": "video",
|
|
64
|
-
"placeholder": {
|
|
65
|
-
"en-US": "Paste Youtube video link",
|
|
66
|
-
"zh-CN": "粘贴Youtube视频链接"
|
|
67
|
-
},
|
|
68
|
-
"label": {
|
|
69
|
-
"zh-CN": "视频链接",
|
|
70
|
-
"en-US": "Video link"
|
|
71
|
-
},
|
|
72
|
-
"default": ""
|
|
73
|
-
}
|
|
74
|
-
],
|
|
75
|
-
"presets": [
|
|
76
|
-
{
|
|
77
|
-
"name": "video",
|
|
78
|
-
"cname": {
|
|
79
|
-
"en-US": "Video",
|
|
80
|
-
"zh-CN": "视频"
|
|
81
|
-
},
|
|
82
|
-
"category": {
|
|
83
|
-
"en-US": "Material",
|
|
84
|
-
"zh-CN": "素材"
|
|
85
|
-
},
|
|
86
|
-
"ccategory": {
|
|
87
|
-
"en-US": "Material",
|
|
88
|
-
"zh-CN": "素材"
|
|
89
|
-
},
|
|
90
|
-
"display": true,
|
|
91
|
-
"blocks": []
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
{% endschema %}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
{% use 'video_text.css' %}
|
|
2
|
-
{% assign defaultImage = 'oss/operation/ee147ae7fe87ec16f50a5f17e57e6aa9.jpg' | img_url %}
|
|
3
|
-
<div class="video-text container container-gap">
|
|
4
|
-
<div class="row">
|
|
5
|
-
<div class="col-12 col-md-6 video-text__text d-flex flex-column justify-content-center">
|
|
6
|
-
{% for block in section.blocks %}
|
|
7
|
-
{% if block.type == 'heading' and block.settings.heading %}
|
|
8
|
-
<h1 class="dj_skin_title_font video-text__text_title">{{block.settings.heading | escape}}</h1>
|
|
9
|
-
{% endif %}
|
|
10
|
-
{% if block.type == 'desc' and block.settings.desc %}
|
|
11
|
-
<div class="dj-mce-view dj_skin_text video-text__text_desc">{{block.settings.desc}}</div>
|
|
12
|
-
{% endif %}
|
|
13
|
-
{% endfor %}
|
|
14
|
-
</div>
|
|
15
|
-
<div class="col-12 col-md-6 video-text__video d-flex align-items-center">
|
|
16
|
-
<div class="video-text__video_wrapper">
|
|
17
|
-
<img class="video-text__video_wrapper-default" src="{{defaultImage}}"/>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{% javascript %}
|
|
25
|
-
|
|
26
|
-
$(function () {
|
|
27
|
-
var videoId = $.getYoutubeId('{{section.settings.video_url.url}}');
|
|
28
|
-
videoId && $('[data-section-id="{{section.id}}"] .video-text__video_wrapper').html('<iframe title="" class="video-text__video_wrapper-iframe" src="https://www.youtube.com/embed/' + videoId + '?rel=0&modestbranding=1&autoplay='+ 0 + '" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>');
|
|
29
|
-
})
|
|
30
|
-
{% endjavascript %}
|
|
31
|
-
|
|
32
|
-
{% schema %}
|
|
33
|
-
{
|
|
34
|
-
"name": "video_text",
|
|
35
|
-
"max_blocks": 2,
|
|
36
|
-
"settings": [
|
|
37
|
-
{
|
|
38
|
-
"type": "video_url",
|
|
39
|
-
"id": "video_url",
|
|
40
|
-
"placeholder": {
|
|
41
|
-
"en-US": "Paste Youtube video link",
|
|
42
|
-
"zh-CN": "粘贴Youtube视频链接"
|
|
43
|
-
},
|
|
44
|
-
"label": {
|
|
45
|
-
"zh-CN": "视频背景链接",
|
|
46
|
-
"en-US": "Video link"
|
|
47
|
-
},
|
|
48
|
-
"default": ""
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
"blocks": [
|
|
52
|
-
{
|
|
53
|
-
"type": "heading",
|
|
54
|
-
"name": {
|
|
55
|
-
"zh-CN": "标题",
|
|
56
|
-
"en-US": "Heading"
|
|
57
|
-
},
|
|
58
|
-
"limit": 1,
|
|
59
|
-
"settings": [
|
|
60
|
-
{
|
|
61
|
-
"type": "text",
|
|
62
|
-
"id": "heading",
|
|
63
|
-
"label": {
|
|
64
|
-
"en-US": "Heading",
|
|
65
|
-
"zh-CN": "标题"
|
|
66
|
-
},
|
|
67
|
-
"default": "Video hero"
|
|
68
|
-
}
|
|
69
|
-
]
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"type": "desc",
|
|
73
|
-
"name": {
|
|
74
|
-
"zh-CN": "文字",
|
|
75
|
-
"en-US": "Text"
|
|
76
|
-
},
|
|
77
|
-
"limit": 1,
|
|
78
|
-
"settings": [
|
|
79
|
-
{
|
|
80
|
-
"type": "richtext",
|
|
81
|
-
"id": "desc",
|
|
82
|
-
"label": {
|
|
83
|
-
"en-US": "Text",
|
|
84
|
-
"zh-CN": "正文"
|
|
85
|
-
},
|
|
86
|
-
"placeholder": {
|
|
87
|
-
"zh-CN": "输入文本内容",
|
|
88
|
-
"en-US": "Input text"
|
|
89
|
-
},
|
|
90
|
-
"default": "<p><span>Use this text to share information about your brand with your customers. Describe a product,share announcements,or welcome customers to your store.</span></p>"
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
],
|
|
95
|
-
"presets": [
|
|
96
|
-
{
|
|
97
|
-
"name": "video_text",
|
|
98
|
-
"cname": {
|
|
99
|
-
"en-US": "Text video",
|
|
100
|
-
"zh-CN": "文本视频"
|
|
101
|
-
},
|
|
102
|
-
"category": {
|
|
103
|
-
"en-US": "Material",
|
|
104
|
-
"zh-CN": "素材"
|
|
105
|
-
},
|
|
106
|
-
"ccategory": {
|
|
107
|
-
"en-US": "Material",
|
|
108
|
-
"zh-CN": "素材"
|
|
109
|
-
},
|
|
110
|
-
"display": true,
|
|
111
|
-
"blocks": [
|
|
112
|
-
{
|
|
113
|
-
"type": "heading",
|
|
114
|
-
"settings": {
|
|
115
|
-
"heading": "Video hero"
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"type": "desc",
|
|
120
|
-
"settings": {
|
|
121
|
-
"desc": "<p><span>Use this text to share information about your brand with your customers. Describe a product,share announcements,or welcome customers to your store.</span></p>"
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
]
|
|
127
|
-
}
|
|
128
|
-
{% endschema %}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{% if image != blank %}
|
|
2
|
-
{% comment %} 默认图是从管理平台上传,没有width信息,返回 {% endcomment %}
|
|
3
|
-
{% if image.width == 0 or image.width == nil %}
|
|
4
|
-
{{ image.src | img_url: '180x' }} 180w,
|
|
5
|
-
{{ image.src | img_url: '540x' }} 540w,
|
|
6
|
-
{{ image.src | img_url: '900x' }} 900w,
|
|
7
|
-
{{ image.src | img_url: '1296x' }} 1296w,
|
|
8
|
-
{{ image.src | img_url: '1728x' }} 1728w
|
|
9
|
-
{% else %}
|
|
10
|
-
{% if image.width <= 180 %}{{ image.src | img_url: '180x' }} 180w,{% endif %}
|
|
11
|
-
{% if image.width > 180 %}{{ image.src | img_url: '180x' }} 180w,{% endif %}
|
|
12
|
-
{% if image.width > 360 %}{{ image.src | img_url: '360x' }} 360w,{% endif %}
|
|
13
|
-
{% if image.width > 540 %}{{ image.src | img_url: '540x' }} 540w,{% endif %}
|
|
14
|
-
{% if image.width > 720 %}{{ image.src | img_url: '720x' }} 720w,{% endif %}
|
|
15
|
-
{% if image.width > 900 %}{{ image.src | img_url: '900x' }} 900w,{% endif %}
|
|
16
|
-
{% if image.width > 1080 %}{{ image.src | img_url: '1080x' }} 1080w,{% endif %}
|
|
17
|
-
{% if image.width > 1296 %}{{ image.src | img_url: '1296x' }} 1296w,{% endif %}
|
|
18
|
-
{% if image.width > 1512 %}{{ image.src | img_url: '1512x' }} 1512w,{% endif %}
|
|
19
|
-
{% if image.width > 1728 %}{{ image.src | img_url: '1728x' }} 1728w{% endif %}
|
|
20
|
-
{% endif %}
|
|
21
|
-
{% endif %}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
{% use 'cart_modal.css' %}
|
|
2
|
-
<script id="atc-modal-wrapper" type="text/html">
|
|
3
|
-
<div class="modal fade right" id="atc-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
4
|
-
<div class="modal-dialog">
|
|
5
|
-
<div class="modal-content">
|
|
6
|
-
<div class="modal-body">
|
|
7
|
-
<div class="sep-font sep-font-close close modal__close" data-dismiss="modal" aria-label="Close"></div>
|
|
8
|
-
<div id='atc_container'>
|
|
9
|
-
</div>
|
|
10
|
-
<div style="display:flex;align-items:center;justify-content:center;height: 2.5rem;">
|
|
11
|
-
<a href="/cart" class="atc-btn__link">{{ 'i18n.product.product_detail.view_cart' | t }}</a>
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
{% javascript %}
|
|
20
|
-
$(function () {
|
|
21
|
-
if ($('#atc-modal').length) return;
|
|
22
|
-
$(document.body).on("dj.addToCart", function (e, options) {
|
|
23
|
-
if (window.SHOP_PARAMS.template_type == '13') { $.toast.show({ content: window.SHOP_PARAMS.product_lang.added_to_cart_successfully }) };
|
|
24
|
-
if (window.SHOP_PARAMS.template_type === '13') return;
|
|
25
|
-
if (options.source == "drawer" || options.process != 'to_toast') return;
|
|
26
|
-
if ($.cart) { $(document).trigger("dj.cart.refresh"); $('#atc-modal').modal('show'); return; }
|
|
27
|
-
$.ajax({
|
|
28
|
-
type: 'GET',
|
|
29
|
-
dataType: 'html',
|
|
30
|
-
url: '/cart?' + $.toQuery($.params()),
|
|
31
|
-
success: function (res) {
|
|
32
|
-
if ($('#atc-modal').length) return;
|
|
33
|
-
console.log('options', options)
|
|
34
|
-
var modalTemplate = template('atc-modal-wrapper', options);
|
|
35
|
-
$('body').prepend(modalTemplate);
|
|
36
|
-
var bodyHTML = res.match(/(<body\b[^>]*>)([^<]*(?:(?!<\/body>)<[^<]*)*)(<\/body>)/gi)[0];
|
|
37
|
-
var bodyClass = (res.match(/\<body.+class="([^"]+)/) || ["",""])[1];
|
|
38
|
-
$('#atc-modal .modal-content').addClass(bodyClass);
|
|
39
|
-
console.log('bodyHTML', bodyHTML)
|
|
40
|
-
var $body = $(bodyHTML);
|
|
41
|
-
$body.find('[data-section-type^=header],[data-section-type^=footer]').attr({ 'data-section-id': '' }).remove();
|
|
42
|
-
$("#atc_container").html($body);
|
|
43
|
-
var $modal = $('#atc-modal');
|
|
44
|
-
$('.modal-backdrop').css({ display: 'none' })
|
|
45
|
-
$modal.modal('show').on('shown.bs.modal', function () {
|
|
46
|
-
$.loading.hide();
|
|
47
|
-
$('#product-select-modal').modal('hide');
|
|
48
|
-
if ($(window).width() < 768) {
|
|
49
|
-
$(document.body).addClass('cart_fixed-screen');
|
|
50
|
-
}
|
|
51
|
-
$(document.body).one("click", '.modal-backdrop', function () {
|
|
52
|
-
$modal.modal('hide')
|
|
53
|
-
})
|
|
54
|
-
})
|
|
55
|
-
$modal.on('hide.bs.modal hidden.bs.modal', function () {
|
|
56
|
-
$(document.body).removeClass('cart_fixed-screen');
|
|
57
|
-
})
|
|
58
|
-
cartObj && cartObj.line_items && cartObj.line_items.forEach(function(item, index) {
|
|
59
|
-
if (Number(item.image.width) >= Number(item.image.height)) {
|
|
60
|
-
$('#cart').before('<style> #cart_form .cart__item:nth-of-type(' + (index + 1) + ') .cart__img {height:90px!important;} </style>')
|
|
61
|
-
} else {
|
|
62
|
-
if ((110 / 90) * item.image.width < item.image.height) {
|
|
63
|
-
$('#cart').before('<style> #cart_form .cart__item:nth-of-type(' + (index + 1) + ') .cart__img {height:110px!important;} </style>')
|
|
64
|
-
} else {
|
|
65
|
-
$('#cart').before('<style> #cart_form .cart__item:nth-of-type(' + (index + 1) + ') .cart__img {width:90px;height:' + ((90 * item.image.height) / item.image.width) + 'px!important;} </style>')
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
$(document).trigger("dj.cart.refresh")
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
|
-
{% endjavascript %}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
{% assign title = collection.title %}
|
|
2
|
-
{% assign type = collection.type %}
|
|
3
|
-
{% assign image = collection.image %}
|
|
4
|
-
{% assign url = collection.url %}
|
|
5
|
-
{% assign imgSize = imgSize | '600x' %}
|
|
6
|
-
|
|
7
|
-
{% assign isMock = collection.isMock %}
|
|
8
|
-
{% assign imageHeightMd = heightMd | default: "100%" %}
|
|
9
|
-
{% assign imageHeight = height | default: "100%" %}
|
|
10
|
-
{% assign defaultImg = defaultImage | default: 'oss/operation/5fa90cbdc7fbff1eac9c585b3b5caa0e.png' %}
|
|
11
|
-
{% assign src = image.src | default: defaultImg %}
|
|
12
|
-
|
|
13
|
-
{% comment %} 小图情况处理 {% endcomment %}
|
|
14
|
-
{% assign rate = image.height | image_padding_bottom : image.width, origin: 'unlimit' | abs %}
|
|
15
|
-
{% assign rate_gt = 'width: 100%;height: auto;max-width: unset;max-height: unset; right: 0; top: 50%; left: 50%; bottom: unset; transform: translate(-50%, -50%);' %}
|
|
16
|
-
{% assign rate_lt = 'height: 100%;max-width: unset;max-height: unset; bottom: 0; left: 50%; top: 100%; right: unset; transform: translate(-50%, -50%);' %}
|
|
17
|
-
|
|
18
|
-
{% comment %} 由于无法获取默认图宽高比例,需要手动设置 {% endcomment %}
|
|
19
|
-
{% if src == defaultImg %}
|
|
20
|
-
{% assign rate = '100' %}
|
|
21
|
-
{% endif %}
|
|
22
|
-
|
|
23
|
-
{% comment %} PC端 {% endcomment %}
|
|
24
|
-
<div data-track="item"
|
|
25
|
-
data-track-type="{{type|escape}}" data-track-name="{{title|escape}}" class="product-snippet">
|
|
26
|
-
{% if isMock %}
|
|
27
|
-
{% assign src = defaultImg %}
|
|
28
|
-
{% endif %}
|
|
29
|
-
{% assign wrapper_rate = imageHeightMd | abs %}
|
|
30
|
-
{% assign img_size = rate_lt %}
|
|
31
|
-
{% if rate > wrapper_rate %}
|
|
32
|
-
{% assign img_size = rate_gt %}
|
|
33
|
-
{% endif %}
|
|
34
|
-
{% assign wrapper_rate_mobile = imageHeight | abs %}
|
|
35
|
-
{% assign img_size_mobile = rate_lt %}
|
|
36
|
-
{% if rate > wrapper_rate_mobile %}
|
|
37
|
-
{% assign img_size_mobile = rate_gt %}
|
|
38
|
-
{% endif %}
|
|
39
|
-
<style>
|
|
40
|
-
@media (min-width: 768px) {
|
|
41
|
-
[data-section-id="{{section.id}}"] a.product-snippet__img-wrapper {
|
|
42
|
-
padding-bottom: {{imageHeightMd}};
|
|
43
|
-
}
|
|
44
|
-
[data-section-id="{{section.id}}"] a.product-snippet__img-wrapper img[id="{{src}}"] {
|
|
45
|
-
{{img_size}}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
@media (max-width: 768px) {
|
|
49
|
-
[data-section-id="{{section.id}}"] a.product-snippet__img-wrapper {
|
|
50
|
-
padding-bottom: {{imageHeight}};
|
|
51
|
-
}
|
|
52
|
-
[data-section-id="{{section.id}}"] a.product-snippet__img-wrapper img[id="{{src}}"] {
|
|
53
|
-
{{img_size_mobile}}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
</style>
|
|
57
|
-
|
|
58
|
-
<a {% if isMock != true and url %}href="{{url}}"{% endif %}
|
|
59
|
-
class="product-snippet__img-wrapper common__img-wrapper_lazy common__mask_title two_line_text_truncate d-flex align-items-center justify-content-center dj_skin_title_font_family"
|
|
60
|
-
title="{{title}}"
|
|
61
|
-
style="width: 100%; {% if isMock %}background: #f7f7f7;{% endif %}">
|
|
62
|
-
<img
|
|
63
|
-
id="{{src}}"
|
|
64
|
-
src="{{shop.default_img}}"
|
|
65
|
-
class="lazyload {{class}} imglazy"
|
|
66
|
-
{% if lazysize %}
|
|
67
|
-
data-src="{{src | img_url: lazysize}}"
|
|
68
|
-
{% else %}
|
|
69
|
-
|
|
70
|
-
data-src="{{src | img_url: '{width}x'}}"
|
|
71
|
-
data-sizes="auto"
|
|
72
|
-
{% endif %}
|
|
73
|
-
alt="{{image.alt | default: title | escape}}"
|
|
74
|
-
{{other}}
|
|
75
|
-
>
|
|
76
|
-
</a>
|
|
77
|
-
</div>
|