diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..9d08a1a8 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/package-lock.json b/package-lock.json index 9648a22b..eaa5d09b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1687,6 +1687,17 @@ "integrity": "sha1-4a1IbmxUUBY0xsOXxcEh2qODYHw=", "dev": true }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "optional": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, "cacache": { "version": "13.0.1", "resolved": "https://registry.npm.taobao.org/cacache/download/cacache-13.0.1.tgz?cache=0&sync_timestamp=1594428010987&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcacache%2Fdownload%2Fcacache-13.0.1.tgz", @@ -1713,6 +1724,34 @@ "unique-filename": "^1.1.1" } }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.1.0.tgz", + "integrity": "sha1-ThSHCmGNni7dl92DRf2dncMVZGo=", + "dev": true, + "optional": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "optional": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true, + "optional": true + }, "find-cache-dir": { "version": "3.3.1", "resolved": "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-3.3.1.tgz", @@ -1734,6 +1773,25 @@ "path-exists": "^4.0.0" } }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz?cache=0&sync_timestamp=1596294337050&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhas-flag%2Fdownload%2Fhas-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true, + "optional": true + }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-2.0.0.tgz", + "integrity": "sha1-5MrOW4FtQloWa18JfhDNErNgZLA=", + "dev": true, + "optional": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz", @@ -1798,6 +1856,16 @@ "minipass": "^3.1.1" } }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1598611730985&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz", + "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=", + "dev": true, + "optional": true, + "requires": { + "has-flag": "^4.0.0" + } + }, "terser-webpack-plugin": { "version": "2.3.8", "resolved": "https://registry.npm.taobao.org/terser-webpack-plugin/download/terser-webpack-plugin-2.3.8.tgz?cache=0&sync_timestamp=1600532057758&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser-webpack-plugin%2Fdownload%2Fterser-webpack-plugin-2.3.8.tgz", @@ -1814,6 +1882,18 @@ "terser": "^4.6.12", "webpack-sources": "^1.4.3" } + }, + "vue-loader-v16": { + "version": "npm:vue-loader@16.0.0-beta.8", + "resolved": "https://registry.npm.taobao.org/vue-loader/download/vue-loader-16.0.0-beta.8.tgz?cache=0&sync_timestamp=1600850425972&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-loader%2Fdownload%2Fvue-loader-16.0.0-beta.8.tgz", + "integrity": "sha1-H1I9n+qOjG5PW7mf12gWWvWEWHk=", + "dev": true, + "optional": true, + "requires": { + "chalk": "^4.1.0", + "hash-sum": "^2.0.0", + "loader-utils": "^2.0.0" + } } } }, @@ -2397,6 +2477,15 @@ "integrity": "sha1-4eguTz6Zniz9YbFhKA0WoRH4ZCg=", "dev": true }, + "axios": { + "version": "0.18.0", + "resolved": "https://registry.npm.taobao.org/axios/download/axios-0.18.0.tgz?cache=0&sync_timestamp=1597979584536&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faxios%2Fdownload%2Faxios-0.18.0.tgz", + "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", + "requires": { + "follow-redirects": "^1.3.0", + "is-buffer": "^1.1.5" + } + }, "babel-loader": { "version": "8.1.0", "resolved": "https://registry.npm.taobao.org/babel-loader/download/babel-loader-8.1.0.tgz", @@ -2419,6 +2508,27 @@ "object.assign": "^4.1.0" } }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + }, + "dependencies": { + "core-js": { + "version": "2.6.11", + "resolved": "https://registry.npm.taobao.org/core-js/download/core-js-2.6.11.tgz?cache=0&sync_timestamp=1586450527243&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-2.6.11.tgz", + "integrity": "sha1-OIMUafmSK97Y7iHJ3EaYXgOZMIw=" + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.11.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.11.1.tgz", + "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=" + } + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz", @@ -2501,6 +2611,14 @@ "tweetnacl": "^0.14.3" } }, + "better-scroll": { + "version": "1.13.2", + "resolved": "https://registry.npm.taobao.org/better-scroll/download/better-scroll-1.13.2.tgz", + "integrity": "sha1-MebgiM8tI85I5S+tbMWRNP/rL1Y=", + "requires": { + "babel-runtime": "^6.0.0" + } + }, "bfj": { "version": "6.1.2", "resolved": "https://registry.npm.taobao.org/bfj/download/bfj-6.1.2.tgz", @@ -3394,6 +3512,12 @@ "integrity": "sha1-FuQHD7qK4ptnnyIVhT7hgasuq8A=", "dev": true }, + "components": { + "version": "0.1.0", + "resolved": "https://registry.npm.taobao.org/components/download/components-0.1.0.tgz", + "integrity": "sha1-IFfAjpx78mYv7slcSeX/Kpq4XtU=", + "dev": true + }, "compressible": { "version": "2.0.18", "resolved": "https://registry.npm.taobao.org/compressible/download/compressible-2.0.18.tgz", @@ -5095,8 +5219,7 @@ "follow-redirects": { "version": "1.13.0", "resolved": "https://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.13.0.tgz?cache=0&sync_timestamp=1597057988030&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffollow-redirects%2Fdownload%2Ffollow-redirects-1.13.0.tgz", - "integrity": "sha1-tC6Nk6Kn7qXtiGM2dtZZe8jjhNs=", - "dev": true + "integrity": "sha1-tC6Nk6Kn7qXtiGM2dtZZe8jjhNs=" }, "for-in": { "version": "1.0.2", @@ -5942,8 +6065,7 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npm.taobao.org/is-buffer/download/is-buffer-1.1.6.tgz", - "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=", - "dev": true + "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=" }, "is-callable": { "version": "1.2.2", @@ -10279,87 +10401,10 @@ } } }, - "vue-loader-v16": { - "version": "npm:vue-loader@16.0.0-beta.8", - "resolved": "https://registry.npm.taobao.org/vue-loader/download/vue-loader-16.0.0-beta.8.tgz?cache=0&sync_timestamp=1600850425972&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-loader%2Fdownload%2Fvue-loader-16.0.0-beta.8.tgz", - "integrity": "sha1-H1I9n+qOjG5PW7mf12gWWvWEWHk=", - "dev": true, - "optional": true, - "requires": { - "chalk": "^4.1.0", - "hash-sum": "^2.0.0", - "loader-utils": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", - "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", - "dev": true, - "optional": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.1.0.tgz", - "integrity": "sha1-ThSHCmGNni7dl92DRf2dncMVZGo=", - "dev": true, - "optional": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", - "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", - "dev": true, - "optional": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", - "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", - "dev": true, - "optional": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz?cache=0&sync_timestamp=1596294337050&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhas-flag%2Fdownload%2Fhas-flag-4.0.0.tgz", - "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", - "dev": true, - "optional": true - }, - "loader-utils": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-2.0.0.tgz", - "integrity": "sha1-5MrOW4FtQloWa18JfhDNErNgZLA=", - "dev": true, - "optional": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1598611730985&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz", - "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=", - "dev": true, - "optional": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } + "vue-router": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/vue-router/download/vue-router-3.0.2.tgz?cache=0&sync_timestamp=1601637530869&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-router%2Fdownload%2Fvue-router-3.0.2.tgz", + "integrity": "sha1-3txnr+bE4rwlaCyLHCqMDXx+Vr4=" }, "vue-style-loader": { "version": "4.1.2", diff --git a/package.json b/package.json index a5926821..4a20d469 100644 --- a/package.json +++ b/package.json @@ -7,12 +7,16 @@ "build": "vue-cli-service build" }, "dependencies": { + "axios": "^0.18.0", + "better-scroll": "^1.13.2", "core-js": "^3.6.5", - "vue": "^2.6.11" + "vue": "^2.6.11", + "vue-router": "^3.0.2" }, "devDependencies": { "@vue/cli-plugin-babel": "^4.5.0", "@vue/cli-service": "^4.5.0", + "components": "^0.1.0", "vue-template-compiler": "^2.6.11" } } diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index df36fcfb..00000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/index.html b/public/index.html index 41235286..8f58b91c 100644 --- a/public/index.html +++ b/public/index.html @@ -4,7 +4,7 @@ - + <%= htmlWebpackPlugin.options.title %> diff --git a/public/logo.png b/public/logo.png new file mode 100644 index 00000000..65158d89 Binary files /dev/null and b/public/logo.png differ diff --git a/src/App.vue b/src/App.vue index 55df3153..71e08a64 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,28 +1,24 @@ diff --git a/src/assets/css/base.css b/src/assets/css/base.css new file mode 100644 index 00000000..3c31bd72 --- /dev/null +++ b/src/assets/css/base.css @@ -0,0 +1,66 @@ +@import "./normalize.css"; + +:root { + --color-text: #666; + --color-high-text: #ff5777; + --color-tint: #ff8198; + --color-background: #fff; + --font-size: 14px; + --line-height: 1.5; +} + +*, +*::before, +*::after { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif; + user-select: none; /* 禁止用户鼠标在页面上选中文字/图片等 */ + -webkit-tap-highlight-color: transparent; /* webkit是苹果浏览器引擎,tap点击,highlight背景高亮,color颜色,颜色用数值调节 */ + background: var(--color-background); + color: var(--color-text); + width: 100vw; +} + +a { + color: var(--color-text); + text-decoration: none; +} + + +.clear-fix::after { + clear: both; + content: ''; + display: block; + width: 0; + height: 0; + visibility: hidden; +} + +.clear-fix { + zoom: 1; +} + +.arrow-right { + border-top: 1px solid #999; + border-left: 1px solid #999; + width: 9px; + height: 9px; + background-color: transparent; + transform: rotate(135deg); + display: inline-block; + margin-left: .1rem; +} + +.left { + float: left; +} + +.right { + float: right; +} + diff --git a/src/assets/css/normalize.css b/src/assets/css/normalize.css new file mode 100644 index 00000000..47b010e4 --- /dev/null +++ b/src/assets/css/normalize.css @@ -0,0 +1,341 @@ +/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ + +/* Document + ========================================================================== */ + +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ + +html { + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers. + */ + +body { + margin: 0; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/* Grouping content + ========================================================================== */ + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + +hr { + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +pre { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Remove the gray background on active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + +abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, +strong { + font-weight: bolder; +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +code, +kbd, +samp { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/** + * Add the correct font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove the border on images inside links in IE 10. + */ + +img { + border-style: none; +} + +/* Forms + ========================================================================== */ + +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ +} + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, +input { /* 1 */ + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + +button, +select { /* 1 */ + text-transform: none; +} + +/** + * Correct the inability to style clickable types in iOS and Safari. + */ + +button, +[type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +/** + * Remove the inner border and padding in Firefox. + */ + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Correct the padding in Firefox. + */ + +fieldset { + padding: 0.35em 0.75em 0.625em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + +legend { + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ +} + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + vertical-align: baseline; +} + +/** + * Remove the default vertical scrollbar in IE 10+. + */ + +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ + +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + +[type="search"] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ +} + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + +::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ +} + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ + +details { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Misc + ========================================================================== */ + +/** + * Add the correct display in IE 10+. + */ + +template { + display: none; +} + +/** + * Add the correct display in IE 10. + */ + +[hidden] { + display: none; +} diff --git a/src/assets/img/cart/tick.svg b/src/assets/img/cart/tick.svg new file mode 100644 index 00000000..f8812a29 --- /dev/null +++ b/src/assets/img/cart/tick.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/img/common/back.svg b/src/assets/img/common/back.svg new file mode 100644 index 00000000..b0962864 --- /dev/null +++ b/src/assets/img/common/back.svg @@ -0,0 +1 @@ + diff --git a/src/assets/img/common/collect.svg b/src/assets/img/common/collect.svg new file mode 100644 index 00000000..7677c4fe --- /dev/null +++ b/src/assets/img/common/collect.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/img/common/placeholder.png b/src/assets/img/common/placeholder.png new file mode 100644 index 00000000..6df54a7c Binary files /dev/null and b/src/assets/img/common/placeholder.png differ diff --git a/src/assets/img/common/top.png b/src/assets/img/common/top.png new file mode 100644 index 00000000..c75bd734 Binary files /dev/null and b/src/assets/img/common/top.png differ diff --git a/src/assets/img/detail/detail_bottom.png b/src/assets/img/detail/detail_bottom.png new file mode 100644 index 00000000..a73cf6e4 Binary files /dev/null and b/src/assets/img/detail/detail_bottom.png differ diff --git a/src/assets/img/home/recommend_bg.jpg b/src/assets/img/home/recommend_bg.jpg new file mode 100644 index 00000000..4533eb6c Binary files /dev/null and b/src/assets/img/home/recommend_bg.jpg differ diff --git a/src/assets/img/tabbar/cart.svg b/src/assets/img/tabbar/cart.svg new file mode 100644 index 00000000..69916f7a --- /dev/null +++ b/src/assets/img/tabbar/cart.svg @@ -0,0 +1,18 @@ + + + + +Created by potrace 1.15, written by Peter Selinger 2001-2017 + + + + + diff --git a/src/assets/img/tabbar/cart_active.svg b/src/assets/img/tabbar/cart_active.svg new file mode 100644 index 00000000..ee79a987 --- /dev/null +++ b/src/assets/img/tabbar/cart_active.svg @@ -0,0 +1,18 @@ + + + + +Created by potrace 1.15, written by Peter Selinger 2001-2017 + + + + + diff --git a/src/assets/img/tabbar/category.svg b/src/assets/img/tabbar/category.svg new file mode 100644 index 00000000..14febb99 --- /dev/null +++ b/src/assets/img/tabbar/category.svg @@ -0,0 +1,21 @@ + + + + +Created by potrace 1.15, written by Peter Selinger 2001-2017 + + + + + + + + diff --git a/src/assets/img/tabbar/category_active.svg b/src/assets/img/tabbar/category_active.svg new file mode 100644 index 00000000..4e84fca0 --- /dev/null +++ b/src/assets/img/tabbar/category_active.svg @@ -0,0 +1,21 @@ + + + + +Created by potrace 1.15, written by Peter Selinger 2001-2017 + + + + + + + + diff --git a/src/assets/img/tabbar/home.svg b/src/assets/img/tabbar/home.svg new file mode 100644 index 00000000..9a670e28 --- /dev/null +++ b/src/assets/img/tabbar/home.svg @@ -0,0 +1,19 @@ + + + + +Created by potrace 1.15, written by Peter Selinger 2001-2017 + + + + + diff --git a/src/assets/img/tabbar/home_active.svg b/src/assets/img/tabbar/home_active.svg new file mode 100644 index 00000000..4375ec74 --- /dev/null +++ b/src/assets/img/tabbar/home_active.svg @@ -0,0 +1,19 @@ + + + + +Created by potrace 1.15, written by Peter Selinger 2001-2017 + + + + + diff --git a/src/assets/img/tabbar/profile.svg b/src/assets/img/tabbar/profile.svg new file mode 100644 index 00000000..4a5dcd07 --- /dev/null +++ b/src/assets/img/tabbar/profile.svg @@ -0,0 +1,19 @@ + + + + +Created by potrace 1.15, written by Peter Selinger 2001-2017 + + + + + diff --git a/src/assets/img/tabbar/profile_active.svg b/src/assets/img/tabbar/profile_active.svg new file mode 100644 index 00000000..6a16c228 --- /dev/null +++ b/src/assets/img/tabbar/profile_active.svg @@ -0,0 +1,19 @@ + + + + +Created by potrace 1.15, written by Peter Selinger 2001-2017 + + + + + diff --git a/src/assets/logo.png b/src/assets/logo.png deleted file mode 100644 index f3d2503f..00000000 Binary files a/src/assets/logo.png and /dev/null differ diff --git a/src/common/const.js b/src/common/const.js new file mode 100644 index 00000000..e69de29b diff --git a/src/common/mixin.js b/src/common/mixin.js new file mode 100644 index 00000000..0e929aa1 --- /dev/null +++ b/src/common/mixin.js @@ -0,0 +1,38 @@ +import {debounce} from "@/common/utils"; + +export const itemListenerMixin={ + data(){ + return{ + itemImgListener:null, + } + }, + + mounted(){ + const refresh = debounce(this.$refs.scroll.refresh,500) + + this.itemImgListener=()=>{ + refresh() + } + + this.$bus.$on('itemImgLoad',this.itemImgListener) + + } +} +export const backTopMixin={ + data(){ + return{ + isShowBackTop:false, + tabOffsetTop:0, + isTabFixed:false, + } + }, + methods:{ + backClick(){ + this.$refs.scroll.scrollTo(0,0) + }, + contentScoll(position){ + this.isShowBackTop=(-position.y)>1000 + this.isTabFixed=(-position.y)>this.tabOffsetTop + }, + } +} diff --git a/src/common/utils.js b/src/common/utils.js new file mode 100644 index 00000000..6ac1d39e --- /dev/null +++ b/src/common/utils.js @@ -0,0 +1,37 @@ +export function debounce(func,delay){ + let timer=null + //...args多个参数 delay是延迟执行 但timer已经赋值 再次传入timer清空 + return function (...args){ + if(timer) clearTimeout(timer) + + timer=setTimeout(()=>{ + func.apply(this,args) + },delay) + } +} + +export function formatDate(date, fmt) { + if (/(y+)/.test(fmt)) { + fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); + } + let o = { + 'M+': date.getMonth() + 1, + 'd+': date.getDate(), + 'h+': date.getHours(), + 'm+': date.getMinutes(), + 's+': date.getSeconds() + }; + for (let k in o) { + if (new RegExp(`(${k})`).test(fmt)) { + let str = o[k] + ''; + fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str)); + } + } + return fmt; +} + +function padLeftZero (str) { + return ('00' + str).substr(str.length); +} + + diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index 7fd2dc57..00000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - diff --git a/src/components/common/Scroll/Scroll.vue b/src/components/common/Scroll/Scroll.vue new file mode 100644 index 00000000..56382d16 --- /dev/null +++ b/src/components/common/Scroll/Scroll.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/src/components/common/navbar/NavBar.vue b/src/components/common/navbar/NavBar.vue new file mode 100644 index 00000000..48e740f9 --- /dev/null +++ b/src/components/common/navbar/NavBar.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/src/components/common/swiper/Swiper.vue b/src/components/common/swiper/Swiper.vue new file mode 100644 index 00000000..ef2142b3 --- /dev/null +++ b/src/components/common/swiper/Swiper.vue @@ -0,0 +1,371 @@ + + + + + diff --git a/src/components/common/swiper/SwiperItem.vue b/src/components/common/swiper/SwiperItem.vue new file mode 100644 index 00000000..5ad3e73e --- /dev/null +++ b/src/components/common/swiper/SwiperItem.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/src/components/common/swiper/index.js b/src/components/common/swiper/index.js new file mode 100644 index 00000000..5eec1951 --- /dev/null +++ b/src/components/common/swiper/index.js @@ -0,0 +1,6 @@ +import Swiper from './Swiper' +import SwiperItem from './SwiperItem' + +export { + Swiper, SwiperItem +} diff --git a/src/components/common/tabbar/TabBar.vue b/src/components/common/tabbar/TabBar.vue new file mode 100644 index 00000000..b1a700fd --- /dev/null +++ b/src/components/common/tabbar/TabBar.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/common/tabbar/TabBarItem.vue b/src/components/common/tabbar/TabBarItem.vue new file mode 100644 index 00000000..b1cd7f6c --- /dev/null +++ b/src/components/common/tabbar/TabBarItem.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/src/components/content/backTop/backTop.vue b/src/components/content/backTop/backTop.vue new file mode 100644 index 00000000..9e87c395 --- /dev/null +++ b/src/components/content/backTop/backTop.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/content/goods/GoodsList.vue b/src/components/content/goods/GoodsList.vue new file mode 100644 index 00000000..0e79cea0 --- /dev/null +++ b/src/components/content/goods/GoodsList.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/src/components/content/goods/GoodsListItem.vue b/src/components/content/goods/GoodsListItem.vue new file mode 100644 index 00000000..27e6825d --- /dev/null +++ b/src/components/content/goods/GoodsListItem.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/src/components/content/mainTabbar/MainTabBar.vue b/src/components/content/mainTabbar/MainTabBar.vue new file mode 100644 index 00000000..bb96f3ac --- /dev/null +++ b/src/components/content/mainTabbar/MainTabBar.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/components/content/tabControl/TabControl.vue b/src/components/content/tabControl/TabControl.vue new file mode 100644 index 00000000..33273ef7 --- /dev/null +++ b/src/components/content/tabControl/TabControl.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/src/main.js b/src/main.js index 63eb05f7..dc2ca82b 100644 --- a/src/main.js +++ b/src/main.js @@ -1,8 +1,11 @@ import Vue from 'vue' import App from './App.vue' +import router from './router' Vue.config.productionTip = false +Vue.prototype.$bus = new Vue() new Vue({ render: h => h(App), + router, }).$mount('#app') diff --git a/src/network/detail.js b/src/network/detail.js new file mode 100644 index 00000000..1cf2ae08 --- /dev/null +++ b/src/network/detail.js @@ -0,0 +1,50 @@ +import {request} from "@/network/request"; + +export function getDetail(iid){ + return request({ + url:'/detail', + params:{ + iid + } + }) +} + +export function getRecommend(){ + return request({ + url:'/recommend' + }) +} + +export class Goods{ + constructor(itemInfo, columns, services) { + this.title = itemInfo.title; + this.desc = itemInfo.desc; + this.newPrice = itemInfo.price; + this.oldPrice = itemInfo.oldPrice; + this.discount = itemInfo.discountDesc; + this.columns = columns; + this.services = services; + this.nowPrice = itemInfo.highNowPrice; + } +} + +export class Shop { + constructor(shopInfo) { + this.logo = shopInfo.shopLogo; + this.name = shopInfo.name; + this.fans = shopInfo.cFans; + this.sells = shopInfo.cSells; + this.score = shopInfo.score; + this.goodsCount = shopInfo.cGoods + } +} + +export class GoodsParam { + constructor(info, rule) { + // 注: images可能没有值(某些商品有值, 某些没有值) + this.image = info.images ? info.images[0] : ''; + this.infos = info.set; + this.sizes = rule.tables; + } +} + diff --git a/src/network/home.js b/src/network/home.js new file mode 100644 index 00000000..96b51eb4 --- /dev/null +++ b/src/network/home.js @@ -0,0 +1,18 @@ +import {request} from "@/network/request"; + +export function getHomeMutidata(){ + return request({ + url:'/home/multidata' + }) +} +export function getHomeGoods(type,page){ + return request({ + url:'/home/data', + params:{ + type, + page + } + }) +} + + diff --git a/src/network/request.js b/src/network/request.js new file mode 100644 index 00000000..3548bd08 --- /dev/null +++ b/src/network/request.js @@ -0,0 +1,26 @@ +import axios from 'axios' + +export function request(config){ + const instance =axios.create({ + baseURL:'http://152.136.185.210:8000/api/w6', + timeout:5000 + }) + + // //拦截 + // instance.interceptors.request.use(config=>{ + // console.log(config); + // return config + // }, + // err=>{ + // // console.log(err) + // }) + // + // instance.interceptors.request.use(res=>{ + // return res.get + // },err=>{ + // console.log(err); + // }) + + return instance(config) +} + diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 00000000..41c7db47 --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,41 @@ +import Vue from 'vue' +import Router from 'vue-router' + +const Home=()=>import('../views/home/Home') +const Category=()=>import('../views/category/Category') +const Cart=()=>import('../views/cart/Cart') +const Profile=()=>import('../views/profile/Profile') +const Detail=()=>import('../views/detail/Detail') +Vue.use(Router) + +const routes=[ + { + path:'', + redirect:'/home' + }, + { + path:'/home', + component:Home + }, + { + path:'/category', + component:Category + }, + { + path:'/cart', + component:Cart + }, + { + path: '/profile', + component: Profile + }, + { + path: '/detail/:iid', + component: Detail + } +] +const router =new Router({ + routes, + mode:'history' +}) +export default router diff --git a/src/views/cart/Cart.vue b/src/views/cart/Cart.vue new file mode 100644 index 00000000..5c66266d --- /dev/null +++ b/src/views/cart/Cart.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/src/views/category/Category.vue b/src/views/category/Category.vue new file mode 100644 index 00000000..dd0ba701 --- /dev/null +++ b/src/views/category/Category.vue @@ -0,0 +1,152 @@ + + + + + diff --git a/src/views/detail/Detail.vue b/src/views/detail/Detail.vue new file mode 100644 index 00000000..ad0ff5e9 --- /dev/null +++ b/src/views/detail/Detail.vue @@ -0,0 +1,168 @@ + + + + + diff --git a/src/views/detail/childComps/DetailBaseInfo.vue b/src/views/detail/childComps/DetailBaseInfo.vue new file mode 100644 index 00000000..427dace4 --- /dev/null +++ b/src/views/detail/childComps/DetailBaseInfo.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/src/views/detail/childComps/DetailBottomBar.vue b/src/views/detail/childComps/DetailBottomBar.vue new file mode 100644 index 00000000..bb74ab50 --- /dev/null +++ b/src/views/detail/childComps/DetailBottomBar.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/src/views/detail/childComps/DetailCommentInfo.vue b/src/views/detail/childComps/DetailCommentInfo.vue new file mode 100644 index 00000000..b543bfe8 --- /dev/null +++ b/src/views/detail/childComps/DetailCommentInfo.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/src/views/detail/childComps/DetailGoodsInfo.vue b/src/views/detail/childComps/DetailGoodsInfo.vue new file mode 100644 index 00000000..ea409cac --- /dev/null +++ b/src/views/detail/childComps/DetailGoodsInfo.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/src/views/detail/childComps/DetailNewBar.vue b/src/views/detail/childComps/DetailNewBar.vue new file mode 100644 index 00000000..4150fa05 --- /dev/null +++ b/src/views/detail/childComps/DetailNewBar.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/src/views/detail/childComps/DetailParamInfo.vue b/src/views/detail/childComps/DetailParamInfo.vue new file mode 100644 index 00000000..d9bf83f8 --- /dev/null +++ b/src/views/detail/childComps/DetailParamInfo.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/src/views/detail/childComps/DetailShopInfo.vue b/src/views/detail/childComps/DetailShopInfo.vue new file mode 100644 index 00000000..bd713182 --- /dev/null +++ b/src/views/detail/childComps/DetailShopInfo.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/src/views/detail/childComps/DetailSwiper.vue b/src/views/detail/childComps/DetailSwiper.vue new file mode 100644 index 00000000..80836f00 --- /dev/null +++ b/src/views/detail/childComps/DetailSwiper.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/views/home/Home.vue b/src/views/home/Home.vue new file mode 100644 index 00000000..62e9bf27 --- /dev/null +++ b/src/views/home/Home.vue @@ -0,0 +1,173 @@ + + + + + diff --git a/src/views/home/childComps/HomeRecommendView.vue b/src/views/home/childComps/HomeRecommendView.vue new file mode 100644 index 00000000..830ce244 --- /dev/null +++ b/src/views/home/childComps/HomeRecommendView.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/views/home/childComps/HomeSwiper.vue b/src/views/home/childComps/HomeSwiper.vue new file mode 100644 index 00000000..750885d1 --- /dev/null +++ b/src/views/home/childComps/HomeSwiper.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/src/views/home/childComps/HomefeatureView.vue b/src/views/home/childComps/HomefeatureView.vue new file mode 100644 index 00000000..25209bb4 --- /dev/null +++ b/src/views/home/childComps/HomefeatureView.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/src/views/profile/Profile.vue b/src/views/profile/Profile.vue new file mode 100644 index 00000000..c0c5932c --- /dev/null +++ b/src/views/profile/Profile.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/vue.config.js b/vue.config.js new file mode 100644 index 00000000..f1c70093 --- /dev/null +++ b/vue.config.js @@ -0,0 +1,13 @@ +module.exports={ + configureWebpack:{ + resolve:{ + alias:{ + 'assets':'@/assets', + 'common':'@/common', + 'components':'@/components', + 'network':'@/network', + 'views':'@/views', + } + } + } +}