diff --git a/front-end/mall4uni/.editorconfig b/front-end/mall4uni/.editorconfig new file mode 100644 index 00000000..b0dea31a --- /dev/null +++ b/front-end/mall4uni/.editorconfig @@ -0,0 +1,8 @@ +root = true +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true \ No newline at end of file diff --git a/front-end/mall4uni/.env.development b/front-end/mall4uni/.env.development new file mode 100644 index 00000000..d8810407 --- /dev/null +++ b/front-end/mall4uni/.env.development @@ -0,0 +1,16 @@ +# 如需添加更多环境变量,请以 VITE_APP_ 开头声明 +# 在代码中使用 import.meta.env.VITE_APP_XXX 获取指定变量 + +# 环境配置标识 +VITE_APP_ENV = 'development' + +# 微信公众号appid +# 注意此处为微信 公众号appid,不是小程序appid +# 小程序appid在 manifest.json 文件的 mp-weixin.appid 字段中配置 +VITE_APP_MP_APPID = 'wx42bbe857570c5b40' + +# 统一接口域名 +VITE_APP_BASE_API = 'http://127.0.0.1:8086' + +# 图片域名 +VITE_APP_RESOURCES_URL = 'https://img.mall4j.com/' diff --git a/front-end/mall4uni/.env.production b/front-end/mall4uni/.env.production new file mode 100644 index 00000000..2ad001ab --- /dev/null +++ b/front-end/mall4uni/.env.production @@ -0,0 +1,16 @@ +# 如需添加更多环境变量,请以 VITE_APP_ 开头声明 +# 在代码中使用 import.meta.env.VITE_APP_XXX 获取指定变量 + +# 环境配置标识 +VITE_APP_ENV = 'production' + +# 微信公众号appid +# 注意此处为微信 公众号appid,不是小程序appid +# 小程序appid在 manifest.json 文件的 mp-weixin.appid 字段中配置 +VITE_APP_MP_APPID = 'wx42bbe857570c5b40' + +# 统一接口域名 +VITE_APP_BASE_API = 'http://127.0.0.1:8086' + +# 图片域名 +VITE_APP_RESOURCES_URL = 'https://img.mall4j.com/' diff --git a/front-end/mall4uni/.env.testing b/front-end/mall4uni/.env.testing new file mode 100644 index 00000000..e492361c --- /dev/null +++ b/front-end/mall4uni/.env.testing @@ -0,0 +1,16 @@ +# 如需添加更多环境变量,请以 VITE_APP_ 开头声明 +# 在代码中使用 import.meta.env.VITE_APP_XXX 获取指定变量 + +# 环境配置标识 +VITE_APP_ENV = 'testing' + +# 微信公众号appid +# 注意此处为微信 公众号appid,不是小程序appid +# 小程序appid在 manifest.json 文件的 mp-weixin.appid 字段中配置 +VITE_APP_MP_APPID = 'wx42bbe857570c5b40' + +# 统一接口域名 +VITE_APP_BASE_API = 'http://127.0.0.1:8086' + +# 图片域名 +VITE_APP_RESOURCES_URL = 'https://img.mall4j.com/' diff --git a/front-end/mall4uni/.eslintignore b/front-end/mall4uni/.eslintignore new file mode 100644 index 00000000..934a34af --- /dev/null +++ b/front-end/mall4uni/.eslintignore @@ -0,0 +1,17 @@ +# eslint 忽略列表 + +# disk编译目录 +dist + +build/*.js +src/assets +src/components/tki-barcode +src/package-user/components/uv-parse +src/uni_modules +src/utils/jwx +src/js_sdk +public + +uni_modules +auto-imports.d.ts + diff --git a/front-end/mall4uni/.eslintrc.cjs b/front-end/mall4uni/.eslintrc.cjs new file mode 100644 index 00000000..a87c46ff --- /dev/null +++ b/front-end/mall4uni/.eslintrc.cjs @@ -0,0 +1,87 @@ + +module.exports = { + env: { + browser: true, + es2021: true, + node: true + }, + globals: { + uni: 'readonly', + getApp: 'readonly', + wx: 'readonly', + getCurrentPages: 'readonly', + plus: 'readonly' + }, + extends: [ + 'standard', + './.eslintrc-auto-import.json', + 'plugin:vue/vue3-recommended', + 'plugin:vue-scoped-css/vue3-recommended' + ], + overrides: [ + ], + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module' + }, + plugins: [ + 'vue' + ], + rules: { + // Possible Errors + // 要求使用 let 或 const 而不是 var + 'no-var': 'error', + // 强制 "for" 循环中更新子句的计数器朝着正确的方向移动 + 'for-direction': 'error', + // 强制 getter 函数中出现 return 语句 + 'getter-return': 'error', + // 禁止在嵌套的块中出现变量声明或 function 声明 + 'no-inner-declarations': 'error', + // 禁止由于 await 或 yield的使用而可能导致出现竞态条件的赋值 + 'require-atomic-updates': 'error', + // console 警告 + 'no-console': 'warn', + // 禁止出现未使用过的变量 + 'no-unused-vars': [ + 'warn', + { + args: 'all', + caughtErrors: 'none', + ignoreRestSiblings: true, + vars: 'all' + } + ], + // 关闭名称校验 + 'vue/multi-word-component-names': 'off', + // 非生产环境启用 debugger + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', + + // Best Practices + eqeqeq: 'off', + + // Stylistic Issues + // 强制可嵌套的块的最大深度 + 'max-depth': ['error', 5], + // 强制函数最大代码行数 + 'max-lines-per-function': [ + 'error', + { + max: 150, + skipBlankLines: true + } + ], + // 强制回调函数最大嵌套深度 + 'max-nested-callbacks': ['error', { max: 10 }], + // 强制函数定义中最多允许的参数数量 + 'max-params': ['error', { max: 5 }], + // 强制每一行中所允许的最大语句数量 + 'max-statements-per-line': ['error', { max: 1 }], + // 三目运算符换行 + 'multiline-ternary': ['error', 'never'], + // 传值给组件时的使用 kebab-case + 'vue/v-on-event-hyphenation': ['warn', 'always', { + autofix: true, + ignore: [] + }] + } +} diff --git a/front-end/mall4uni/.gitignore b/front-end/mall4uni/.gitignore new file mode 100644 index 00000000..e065e6e4 --- /dev/null +++ b/front-end/mall4uni/.gitignore @@ -0,0 +1,28 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +*.local + +# Editor directories and files +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +/src/auto-imports.d.ts + +.idea +.hbuilderx +.vscode +package-lock.json +pnpm-lock.yaml +.eslintrc-auto-import.json diff --git a/front-end/mall4uni/.npmrc b/front-end/mall4uni/.npmrc new file mode 100644 index 00000000..febf696a --- /dev/null +++ b/front-end/mall4uni/.npmrc @@ -0,0 +1,4 @@ +engine-strict = true +shamefully-hoist = true +strict-peer-dependencies = false +registry = https://registry.npmmirror.com diff --git a/front-end/mall4uni/Dockerfile b/front-end/mall4uni/Dockerfile new file mode 100644 index 00000000..11555cf2 --- /dev/null +++ b/front-end/mall4uni/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:1.20 +COPY ./dist/build/h5 /usr/share/nginx/html/h5 +COPY ./nginx.conf /etc/nginx/conf.d diff --git a/front-end/mall4uni/LICENSE b/front-end/mall4uni/LICENSE new file mode 100644 index 00000000..dbbe3558 --- /dev/null +++ b/front-end/mall4uni/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/front-end/mall4uni/README.md b/front-end/mall4uni/README.md new file mode 100644 index 00000000..620c6d7d --- /dev/null +++ b/front-end/mall4uni/README.md @@ -0,0 +1,99 @@ +![输入图片说明](https://images.gitee.com/uploads/images/2019/0711/174845_6db7724e_5094767.png "在这里输入图片标题") + + +一个基于springboot的开源商城 uniapp端 + +Mall4j商城系统uniapp版本,做啥都不愁。即使不跨端,uni-app也是更好的小程序开发框架、更好的App跨平台框架、更方便的H5开发框架。不管领导安排什么样的项目,你都可以快速交付,不需要转换开发思维、不需要更改开发习惯。 + + +该项目仅供学习参考、可供个人学习使用、如需商用联系作者进行授权,否则必将追究法律责任 + + + +## 开发环境启动 + +### 1.安装nodejs + +[NodeJS](https://nodejs.org/) 项目要求最低 18.12.0,推荐 20.9.0 + +如果不了解怎么安装nodejs的,可以参考 [菜鸟教程的nodejs相关](https://www.runoob.com/nodejs/nodejs-install-setup.html) + +### 2.启动 + +- 项目要求使用 [pnpm](https://www.pnpm.cn/) 包管理工具 +- 使用编辑器打开项目,在根目录执行以下命令安装依赖 + + ``` + pnpm install + ``` + +- 运行 + + ``` + pnpm run dev:h5 + ``` + +- 部署 + + ``` + pnpm run build:h5 + ``` + +- 如果不想使用 pnpm,请删除 `package.json` 文件中 `preinstall` 脚本后再进行安装 + + ```json + { + "scripts" : { + "preinstall": "npx only-allow pnpm" // 使用其他包管理工具(npm、yarn、cnpm等)请删除此命令 + } + } + ``` + + +## 项目链接 + +java后台:https://gitee.com/gz-yami/mall4j + +vue后台:https://gitee.com/gz-yami/mall4v + +原生微信小程序:https://gitee.com/gz-yami/mall4m + +uniapp端:https://gitee.com/gz-yami/mall4uni + + +## uni-app相关截图 + +![un-app总截图](./static/screenshot/uniappInfo.png) + +![un-app首页截图](./static/screenshot/uniappIndex.png) + +![un-app购物车截图](./static/screenshot/uniappCart.png) + +![un-app个人中心截图](./static/screenshot/uniappMy.png) + +![un-app商品sku截图](./static/screenshot/uniappSku.png) + + + +## 小程序相关截图 + +![小程序截图](https://images.gitee.com/uploads/images/2019/0706/085234_4eb7509b_5094767.jpeg "小程序截图") + + + +## 提交反馈 +- Mall4j商城官网 https://www.mall4j.com + + +- Mall4j商城官方技术QQ 1群:722835385(3000人群已满) +- Mall4j商城官方技术QQ 2群:729888395 +- 如需购买商城商业版源码,请联系商务微信 + + ![输入图片说明](https://19838323.s21i.faiusr.com/4/4/ABUIABAEGAAgksmNlAYojomK2gIwrAI4rAI!160x160.png) + + + +## mall4cloud微服务商城版本已上线 +https://gitee.com/gz-yami/mall4cloud + +## 更多信息请查看Mall4j商城官网 diff --git a/front-end/mall4uni/index.html b/front-end/mall4uni/index.html new file mode 100644 index 00000000..f4d95849 --- /dev/null +++ b/front-end/mall4uni/index.html @@ -0,0 +1,21 @@ + + + + + + mall4uni-pro + + + + + +
+ + + diff --git a/front-end/mall4uni/jsconfig.json b/front-end/mall4uni/jsconfig.json new file mode 100644 index 00000000..c177f0b5 --- /dev/null +++ b/front-end/mall4uni/jsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "types": [ + "@dcloudio/types", + "miniprogram-api-typings", + "mini-types" + ] + }, + "allowJs": true // 允许编译js文件 +} diff --git a/front-end/mall4uni/nginx.conf b/front-end/mall4uni/nginx.conf new file mode 100644 index 00000000..7d1057f5 --- /dev/null +++ b/front-end/mall4uni/nginx.conf @@ -0,0 +1,29 @@ +server { + listen 80; + server_name mini-h5.mall4j.com; + + gzip on; + gzip_static on; + + location / { + try_files $uri $uri/ /; + root /usr/share/nginx/html/h5; + index index.html; + + #### kill cache + add_header Last-Modified $date_gmt; + add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; + if_modified_since off; + expires off; + etag off; + } + + error_page 404 /404.html; + location = /404-light.html { + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + } +} + diff --git a/front-end/mall4uni/package.json b/front-end/mall4uni/package.json new file mode 100644 index 00000000..fdd98c4e --- /dev/null +++ b/front-end/mall4uni/package.json @@ -0,0 +1,75 @@ +{ + "name": "mall4uni-pro", + "private": true, + "version": "0.0.0", + "scripts": { + "preinstall": "npx only-allow pnpm", + "dev:h5": "uni", + "dev:h5-test": "uni --mode testing", + "dev:mp-weixin": "uni -p mp-weixin", + "build:app-android": "uni build -p app-android", + "build:app-ios": "uni build -p app-ios", + "build:h5": "uni build", + "build:h5-test": "uni build --outDir=./dist/test/h5 --mode testing", + "build:mp-weixin": "uni build -p mp-weixin", + "lint": "eslint --ext .js,.vue src", + "lint:fix": "eslint --fix --ext .js --ext .jsx --ext .vue src", + "prepare": "husky install", + "lint:staged": "lint-staged" + }, + "engines": { + "node": ">=16", + "pnpm": ">=6" + }, + "dependencies": { + "@babel/eslint-parser": "^7.21.3", + "@dcloudio/uni-app": "3.0.0-3080720230703001", + "@dcloudio/uni-app-plus": "3.0.0-3080720230703001", + "@dcloudio/uni-components": "3.0.0-3080720230703001", + "@dcloudio/uni-h5": "3.0.0-3080720230703001", + "@dcloudio/uni-mp-alipay": "3.0.0-3080720230703001", + "@dcloudio/uni-mp-baidu": "3.0.0-3080720230703001", + "@dcloudio/uni-mp-jd": "3.0.0-3080720230703001", + "@dcloudio/uni-mp-kuaishou": "3.0.0-3080720230703001", + "@dcloudio/uni-mp-lark": "3.0.0-3080720230703001", + "@dcloudio/uni-mp-qq": "3.0.0-3080720230703001", + "@dcloudio/uni-mp-toutiao": "3.0.0-3080720230703001", + "@dcloudio/uni-mp-weixin": "3.0.0-3080720230703001", + "@dcloudio/uni-quickapp-webview": "3.0.0-3080720230703001", + "@uni-ui/code-ui": "^1.5.3", + "big.js": "^6.2.1", + "crypto-js": "^4.1.1", + "js-base64": "^3.7.5", + "uni-crazy-router": "^1.1.3", + "uni-vite-plugin-h5-prod-effect": "^1.0.1", + "video.js": "^8.3.0", + "videojs-flash": "^2.2.1", + "vue": "^3.2.47" + }, + "devDependencies": { + "@dcloudio/types": "^3.3.3", + "@dcloudio/uni-automator": "3.0.0-3080720230703001", + "@dcloudio/uni-cli-shared": "3.0.0-3080720230703001", + "@dcloudio/uni-stacktracey": "3.0.0-3080720230703001", + "@dcloudio/vite-plugin-uni": "3.0.0-3080720230703001", + "eslint": "^8.38.0", + "eslint-config-standard": "^17.0.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-n": "^15.7.0", + "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-vue": "^9.10.0", + "eslint-plugin-vue-scoped-css": "^2.4.0", + "husky": "8.0.3", + "lint-staged": "13.2.2", + "sass": "^1.61.0", + "unplugin-auto-import": "^0.15.2", + "unplugin-vue-components": "^0.24.1", + "vite": "^4.1.5", + "vue-eslint-parser": "^9.1.1" + }, + "lint-staged": { + "*.{js,vue}": [ + "eslint --fix" + ] + } +} diff --git a/front-end/mall4uni/src/App.vue b/front-end/mall4uni/src/App.vue new file mode 100644 index 00000000..d899935f --- /dev/null +++ b/front-end/mall4uni/src/App.vue @@ -0,0 +1,15 @@ + + + diff --git a/front-end/mall4uni/src/app.css b/front-end/mall4uni/src/app.css new file mode 100644 index 00000000..8ff70e17 --- /dev/null +++ b/front-end/mall4uni/src/app.css @@ -0,0 +1,109 @@ +/**app.wxss**/ +.container { + height: 100%; + box-sizing: border-box; + color: #333; + font-family: helvetica,'Heiti SC',PingFangSC-Light; +} +.price{ + font-family: Arial; + display: inline-block; + color: #eb2444; + padding-bottom:10rpx; + padding-left:10rpx; +} + +/* 价格数字显示不同大小 */ +.symbol { + font-size: 24rpx; +} + +.big-num { + font-size: 32rpx; +} + +.small-num { + font-size: 24rpx; +} + +/* +*改变checkbox样式 +*自定义样式 +*/ +/* reg */ +uni-checkbox-group { + width: 100% !important; +} +uni-checkbox-group uni-label{ + width: 33% !important; + display: inline-flex; + margin-bottom: 20rpx; +} +/*checkbox 选项框大小 */ +uni-checkbox .uni-checkbox-input{ + width: 38rpx !important; + height: 38rpx !important; + border-radius: 50%!important; +} +/*checkbox选中后样式 */ +uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked{ + background: #e43130; + border: 1px solid transparent !important; +} +/*checkbox选中后图标样式 */ +uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked::before{ + display: inline-block; + width: 20rpx; + height: 20rpx; + line-height: 20rpx; + text-align: center; + font-size: 18rpx; + color: #fff; + background: transparent; + transform: translate(-60%, -50%) scale(1); + -webkit-transform: translate(-60%, -50%) scale(1); +} + +/* +*改变radio样式 +*自定义样式 +*/ +/* 未选中的 背景样式 */ +uni-radio .uni-radio-input{ + height: 36rpx; + width: 36rpx; + border-radius: 50%; + background: transparent; + box-sizing: border-box; +} +/* 选中后的 背景样式 */ +uni-radio .uni-radio-input.uni-radio-input-checked{ + border: none !important; + background: #e43130 !important; +} +/* 选中后的 对勾样式 */ +uni-radio .uni-radio-input.uni-radio-input-checked::before{ + border-radius: 50%; + width: 32rpx; + height: 32rpx; + line-height: 32rpx; + text-align: center; + font-size: 20rpx; + color:#fff; + background: #e43130; + border-radius: 50%; + transform: translate(-50%, -50%) scale(1); + -webkit-transform: translate(-50%, -50%) scale(1); +} + +/* 底部按钮兼容 iPhone X以上 */ +@media screen and (width: 375px) and (height: 812px){ + .container { + padding-bottom: 70px; + } +} +@media screen and (width: 414px) and (height: 736px){ + .container { + padding-bottom: 70px; + } +} diff --git a/front-end/mall4uni/src/components/img-show/img-show.vue b/front-end/mall4uni/src/components/img-show/img-show.vue new file mode 100644 index 00000000..8bf664d4 --- /dev/null +++ b/front-end/mall4uni/src/components/img-show/img-show.vue @@ -0,0 +1,79 @@ + + + + + diff --git a/front-end/mall4uni/src/components/production/production.scss b/front-end/mall4uni/src/components/production/production.scss new file mode 100644 index 00000000..b7105a20 --- /dev/null +++ b/front-end/mall4uni/src/components/production/production.scss @@ -0,0 +1,67 @@ +.prod-items { + width: 43%; + background: #fff; + margin-bottom: 40rpx; + box-sizing: border-box; + .hot-imagecont { + border-radius: 8rpx; + text-align: center; + font-size: 0; + } + .hot-text { + margin-top: 20rpx; + .prod-info { + font-size: 20rpx; + color: #777; + padding: 0 20rpx; + margin-top: 8rpx; + } + .prod-text-info { + position: relative; + height: 50rpx; + line-height: 70rpx; + font-family: Arial; + .price { + color: #eb2444; + padding-left: 20rpx; + } + } + } +} +prod { + &:nth-child(2n-1) { + .prod-items { + padding: 20rpx 10rpx 10rpx 20rpx; + } + } + &:nth-child(2n) { + .prod-items { + padding: 20rpx 20rpx 10rpx 10rpx; + } + } +} +.hot-imagecont { + .hotsaleimg { + width: 100%; + height: 345rpx; + } +} +.hot-text { + .hotprod-text { + height: 76rpx; + font-size: 28rpx; + display: -webkit-box; + word-break: break-all; + padding: 0 20rpx; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + color: #000; + } +} +.deadline-price { + font-size: 22rpx; + margin-right: 5rpx; +} diff --git a/front-end/mall4uni/src/components/production/production.vue b/front-end/mall4uni/src/components/production/production.vue new file mode 100644 index 00000000..849c8beb --- /dev/null +++ b/front-end/mall4uni/src/components/production/production.vue @@ -0,0 +1,73 @@ + + + + diff --git a/front-end/mall4uni/src/main.js b/front-end/mall4uni/src/main.js new file mode 100644 index 00000000..ebe9b26d --- /dev/null +++ b/front-end/mall4uni/src/main.js @@ -0,0 +1,10 @@ +import { + createSSRApp +} from 'vue' +import App from './App.vue' +export function createApp () { + const app = createSSRApp(App) + return { + app + } +} diff --git a/front-end/mall4uni/src/manifest.json b/front-end/mall4uni/src/manifest.json new file mode 100644 index 00000000..f53d5de5 --- /dev/null +++ b/front-end/mall4uni/src/manifest.json @@ -0,0 +1,105 @@ +{ + "name" : "", + "appid" : "__UNI__2CF44C6", + "description" : "", + "versionName" : "1.0.0", + "versionCode" : "100", + "transformPx" : false, + /* 5+App特有相关 */ + "app-plus" : { + "compatible" : { + "ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持 + }, + "usingComponents" : true, + "nvueStyleCompiler" : "uni-app", + "compilerVersion" : 3, + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 + }, + /* 模块配置 */ + "modules" : { + "Camera" : {}, + "LivePusher" : {} + }, + /* 应用发布信息 */ + "distribute" : { + /* android打包配置 */ + "android" : { + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ] + } + } + }, + /* 小程序特有相关 */ + "mp-weixin" : { + "appid" : "wx6fa71e69231a4fa4", + "setting" : { + "urlCheck" : false + }, + "usingComponents" : true, + "permission" : { + "scope.userLocation" : { + "desc" : "你的位置信息将用于地址信息新增、修改以及获取附近门店" + } + }, + "plugins" : { + "live-player-plugin" : { + "version" : "1.3.5", + "provider" : "wx2b03c6e691cd7370" + } + }, + "requiredPrivateInfos" : [ "getLocation", "chooseLocation" ] + }, + "h5" : { + "title" : "", + "domain" : "https://mini-h5.mall4j.com", + "router" : { + "mode" : "history" + }, + "uniStatistics" : { + "enable" : false + }, + "optimization" : { + "treeShaking" : { + "enable" : false + } + }, + "template" : "index.html", + "devServer" : { + "disableHostCheck" : true, + "port" : 80 + }, + "sdkConfigs" : { + "maps" : { + "qqmap" : { + // 用于h5端ip定位 + "key" : "" + } + } + } + }, + "uniStatistics" : { + "enable" : false + }, + "vueVersion" : "3" +} diff --git a/front-end/mall4uni/src/pages.json b/front-end/mall4uni/src/pages.json new file mode 100644 index 00000000..e0115c22 --- /dev/null +++ b/front-end/mall4uni/src/pages.json @@ -0,0 +1,197 @@ +{ + "pages": [ + { + "path": "pages/index/index", + "style": { + "backgroundTextStyle": "dark", + "navigationBarBackgroundColor": "#fff", + "navigationBarTextStyle": "black", + "enablePullDownRefresh": true, + "navigationBarTitleText": "mall4j" + } + }, + { + "path": "pages/user/user", + "style": { + "navigationBarTitleText": "个人中心" + } + }, + { + "path": "pages/basket/basket", + "style": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "购物车", + "navigationBarTextStyle": "black" + } + }, + { + "path": "pages/category/category", + "style": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "分类商品", + "navigationBarTextStyle": "black" + } + }, + { + "path": "pages/sub-category/sub-category" + }, + { + "path": "pages/search-page/search-page", + "style": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "搜索", + "navigationBarTextStyle": "black", + "navigationStyle": "custom" + } + }, + { + "path": "pages/delivery-address/delivery-address", + "style": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "收货地址", + "navigationBarTextStyle": "black" + } + }, + { + "path": "pages/editAddress/editAddress", + "style": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "编辑收货地址", + "navigationBarTextStyle": "black" + } + }, + { + "path": "pages/orderList/orderList", + "style": { + "backgroundTextStyle": "light", + "navigationBarTitleText": "订单列表", + "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "#fafafa" + } + }, + { + "path": "pages/order-detail/order-detail", + "style": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "订单详情", + "navigationBarTextStyle": "black" + } + }, + { + "path": "pages/submit-order/submit-order", + "style": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "提交订单", + "navigationBarTextStyle": "black" + } + }, + { + "path": "pages/express-delivery/express-delivery", + "style": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "物流查询", + "navigationBarTextStyle": "black" + } + }, + { + "path": "pages/pay-result/pay-result", + "style": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "支付结果", + "navigationBarTextStyle": "black" + } + }, + { + "path": "pages/search-prod-show/search-prod-show", + "style": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "搜索结果", + "navigationBarTextStyle": "black" + } + }, + { + "path": "pages/prod/prod", + "style": { + "navigationBarTitleText": "商品详情" + } + }, + { + "path": "pages/prod-classify/prod-classify", + "style": { + "onReachBottomDistance": 0 + } + }, + { + "path": "pages/recent-news/recent-news", + "style": { + "backgroundTextStyle": "light", + "navigationBarTitleText": "最新公告", + "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "#fafafa" + } + }, + { + "path": "pages/news-detail/news-detail", + "style": { + "backgroundTextStyle": "light", + "navigationBarTitleText": "最新公告", + "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "#fafafa" + } + }, + { + "path": "pages/accountLogin/accountLogin" + }, + { + "path": "pages/register/register" + } + ], + "tabBar": { + "selectedColor": "#3a86b9", + "color": "#b8b8b8", + "list": [ + { + "pagePath": "pages/index/index", + "text": "首页", + "iconPath": "/static/images/tabbar/homepage.png", + "selectedIconPath": "/static/images/tabbar/homepage-sel.png" + }, + { + "pagePath": "pages/category/category", + "text": "分类", + "iconPath": "/static/images/tabbar/category.png", + "selectedIconPath": "/static/images/tabbar/category-sel.png" + }, + { + "pagePath": "pages/basket/basket", + "text": "购物车", + "iconPath": "/static/images/tabbar/basket.png", + "selectedIconPath": "/static/images/tabbar/basket-sel.png" + }, + { + "pagePath": "pages/user/user", + "text": "我的", + "iconPath": "/static/images/tabbar/user.png", + "selectedIconPath": "/static/images/tabbar/user-sel.png" + } + ] + }, + "sitemapLocation": "sitemap.json", + "globalStyle": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "WeChat", + "navigationBarTextStyle": "black" + }, + "subPackages": [] +} diff --git a/front-end/mall4uni/src/pages/accountLogin/accountLogin.scss b/front-end/mall4uni/src/pages/accountLogin/accountLogin.scss new file mode 100644 index 00000000..fdbdd26d --- /dev/null +++ b/front-end/mall4uni/src/pages/accountLogin/accountLogin.scss @@ -0,0 +1,124 @@ +.con { + background: #fff; + height: 100%; + margin-top: 50px; +} +image { + display: block; + width: 150rpx; + height: 150rpx; + margin: auto; + border-radius: 50%; + width: 150rpx; + height: 150rpx; + margin-bottom: 8%; +} +.login-form { + width: 90%; + margin: 0 auto; + margin-bottom: 20%; +} +.authorized-btn { + width: 90%; + margin: 0 auto; + text-align: center; + background-color: #0ab906; + border: 1rpx solid #0ab906; + color: #fff; + border-radius: 6rpx; + font-size: 26rpx; + padding: 8rpx; + margin-top: 80rpx; + border: 1rpx solid #0ab906; + border-radius: 6rpx; + font-size: 26rpx; + padding: 8rpx; + margin-top: 80rpx; +} +.to-idx-btn { + width: 90%; + margin: 0 auto; + text-align: center; + background-color: #eeeeee; + color: #333; + border-radius: 6rpx; + font-size: 26rpx; + padding: 8rpx; + margin-top: 30rpx; + border-radius: 6rpx; + font-size: 26rpx; + padding: 8rpx; + margin-top: 30rpx; +} +.form-title { + width: 100%; + margin-bottom: 50rpx; + font-size: 32rpx; + text-align: center; + color: #00a0e9; + margin-bottom: 50rpx; + font-size: 32rpx; +} +.item { + display: block; + margin-bottom: 30rpx; + margin-bottom: 30rpx; +} +.account { + display: flex; + background: #f8f8f8; + padding: 15rpx; + box-sizing: border-box; + font-size: 26rpx; + align-items: center; + input { + padding-left: 20rpx; + width: 75%; + padding-left: 20rpx; + } +} +button { + &::after { + border: 0 !important; + } +} +.operate { + display: flex; + justify-content: space-between; + align-items: center; +} + +.to-register { + font-size: 28rpx; + color: #00AAFF; + font-size: 28rpx; +} +.error { + .error-text { + display: block; + width: 100%; + font-size: 28rpx; + color: #e43130; + text-align: left; + margin-top: 10rpx; + font-size: 28rpx; + margin-top: 10rpx; + .warning-icon { + display: inline-block; + color: #fff; + width: 26rpx; + height: 26rpx; + line-height: 26rpx; + background: #e43130; + border-radius: 50%; + text-align: center; + margin-right: 12rpx; + font-size: 22rpx; + width: 26rpx; + height: 26rpx; + line-height: 26rpx; + margin-right: 12rpx; + font-size: 22rpx; + } + } +} diff --git a/front-end/mall4uni/src/pages/accountLogin/accountLogin.vue b/front-end/mall4uni/src/pages/accountLogin/accountLogin.vue new file mode 100644 index 00000000..f1058d1f --- /dev/null +++ b/front-end/mall4uni/src/pages/accountLogin/accountLogin.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/basket/basket.scss b/front-end/mall4uni/src/pages/basket/basket.scss new file mode 100644 index 00000000..ff73ecec --- /dev/null +++ b/front-end/mall4uni/src/pages/basket/basket.scss @@ -0,0 +1,365 @@ +.container { + width: 100%; + background: #f4f4f4; + min-height: calc(100vh - 118rpx); +} +.prod-list { + padding-bottom: 118rpx; + width: 100%; + .prod-block { + background: #fff; + margin-top: 15rpx; + .discount-tips { + padding: 20rpx 0 20rpx 20rpx; + border-bottom: 2rpx solid #f4f4f4; + height: 40rpx; + line-height: 40rpx; + .text-block { + padding: 3rpx 5rpx; + border-radius: 8rpx; + font-size: 22rpx; + color: #eb2444; + border: 2rpx solid #eb2444; + } + .text-list { + font-size: 24rpx; + margin-left: 10rpx; + } + } + } + .item { + background: #fff; + display: flex; + align-items: center; + padding: 20rpx; + .prodinfo { + position: relative; + color: #999; + width: 100%; + &::after { + content: ''; + background-color: #f4f4f4; + left: 0; + height: 1px; + transform-origin: 50% 100% 0; + bottom: -20rpx; + position: absolute; + display: block; + width: 642rpx; + padding-left: 20rpx; + } + .pic { + text-align: center; + width: 180rpx; + height: 180rpx; + line-height: 180rpx; + font-size: 0; + } + } + &:last-child { + .prodinfo { + &::after { + height: 0; + } + } + } + .staus { + text-align: center; + background: rgb(196, 192, 192); + font-size: 20rpx; + width: 50rpx; + color: #fff; + } + .opt { + font-size: 28rpx; + margin-left: 20rpx; + width: 100%; + } + .pic { + image { + max-width: 100%; + max-height: 100%; + vertical-align: middle; + } + } + } + .lose-efficacy { + .discount-tips { + padding: 20rpx 0; + border-bottom: 2rpx solid #ddd; + height: 50rpx; + line-height: 50rpx; + margin-left: 20rpx; + .text-list { + font-size: 30rpx; + margin-left: 10rpx; + } + } + } +} +.prodinfo { + display: flex; + margin-left: 20rpx; + .opt { + .prod-name { + color: #333; + max-height: 72rpx; + line-height: 36rpx; + display: -webkit-box; + word-break: break-all; + overflow: hidden; + text-overflow: ellipsis; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + .prod-info-text { + color: #999; + display: inline-block; + -webkit-line-clamp: 1; + height: 48rpx; + line-height: 48rpx; + background: #f9f9f9; + padding: 0 10rpx 0 10rpx; + border-radius: 4rpx; + margin: 10rpx 0 0rpx 0; + overflow: hidden; + font-size: 24rpx; + position: relative; + font-family: arial; + } + .prod-info-text.empty-n { + padding: 0; + } + .price-count { + display: flex; + align-items: center; + justify-content: space-between; + .price { + color: #eb2444; + } + } + } +} +.prod-info-text { + &:before { + border-top: 5px solid #aaa; + } + &:after { + border-top: 5px solid #f9f9f9; + top: 9px; + } +} +.lose-efficacy { + .prodinfo { + .opt { + .price-count { + .price { + color: #999; + } + } + } + } + margin-top: 20rpx; + background: #fff; + .item { + background: #f8f8f9; + } + .discount-tips { + .empty-prod { + color: #777; + font-size: 26rpx; + border: 2rpx solid #999; + padding: 0 10rpx; + border-radius: 8rpx; + float: right; + margin-right: 20rpx; + } + } +} +.m-numSelector { + .minus { + float: left; + box-sizing: border-box; + height: 56rpx; + border: 2rpx solid #d9d9d9; + position: relative; + width: 56rpx; + border-right: 0; + border-top-left-radius: 4rpx; + border-bottom-left-radius: 4rpx; + &::before { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; + content: ' '; + width: 22rpx; + height: 3rpx; + background-color: #7f7f7f; + } + } + input { + float: left; + box-sizing: border-box; + height: 56rpx; + border: 2rpx solid #d9d9d9; + width: 56rpx; + text-align: center; + color: #333; + } + .plus { + float: left; + box-sizing: border-box; + height: 56rpx; + border: 2rpx solid #d9d9d9; + position: relative; + width: 56rpx; + border-left: 0; + border-top-right-radius: 4rpx; + border-bottom-right-radius: 4rpx; + &::before { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; + content: ' '; + width: 22rpx; + height: 3rpx; + background-color: #7f7f7f; + } + &::after { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; + content: ' '; + width: 22rpx; + height: 3rpx; + background-color: #7f7f7f; + transform: rotate(90deg); + } + } + float: right; + &:not(.disabled) { + .minus { + &:not(.disabled) { + &:active { + background-color: #f4f4f4; + } + } + } + .plus { + &:not(.disabled) { + &:active { + background-color: #f4f4f4; + } + } + } + } +} +:deep(checkbox) { + .uni-checkbox-input, + .wx-checkbox-input { + border-radius: 50%; + width: 35rpx; + height: 35rpx; + } + .wx-checkbox-input.wx-checkbox-input-checked { + background: #eb2444; + border-color: #eb2444; + &::before { + text-align: center; + font-size: 22rpx; + color: #fff; + background: transparent; + transform: translate(-50%, -50%) scale(1); + -webkit-transform: translate(-50%, -50%) scale(1); + } + } +} +.empty { + font-size: 26rpx; + color: #aaa; + padding-top: 200rpx; + .txt { + text-align: center; + margin-top: 30rpx; + } + .img { + margin-top: 80rpx; + text-align: center; + image { + width: 80rpx; + height: 80rpx; + } + } +} +.price-count { + .disable-price { + color: #999; + } +} +.cart-footer { + position: fixed; + bottom: calc(90rpx + env(safe-area-inset-bottom)); + left: 0; + width: 100%; + display: flex; + flex-direction: row nowrap; + height: 98rpx; + border-top: 2rpx solid #f4f4f4; + z-index: 999; + .btn { + position: relative; + display: flex; + flex-grow: 1; + justify-content: center; + align-items: center; + width: 0; + background-color: #fafafa; + background: rgba(255,255,255,0.95); + font-size: 28rpx; + .total-msg { + font-size: 20rpx; + } + } + .btn.total { + display: flex; + flex-flow: column; + align-items: flex-start; + width: 300rpx; + .price { + color: #eb2444; + font-size: 30rpx; + } + } + .btn.del { + color: #eb2444; + width: 70rpx; + font-size: 22rpx; + text-align: left; + display: block; + line-height: 102rpx; + } + .btn.all { + width: 150rpx; + font-size: 26rpx; + label { + display: flex; + flex-grow: 1; + justify-content: center; + align-items: center; + } + } + .btn.settle { + width: 200rpx; + background: #eb2444; + color: #fff; + } +} diff --git a/front-end/mall4uni/src/pages/basket/basket.vue b/front-end/mall4uni/src/pages/basket/basket.vue new file mode 100644 index 00000000..b8e810a2 --- /dev/null +++ b/front-end/mall4uni/src/pages/basket/basket.vue @@ -0,0 +1,401 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/category/category.scss b/front-end/mall4uni/src/pages/category/category.scss new file mode 100644 index 00000000..47b86c25 --- /dev/null +++ b/front-end/mall4uni/src/pages/category/category.scss @@ -0,0 +1,225 @@ +.container { + display: flex; + flex-direction: row; + height: 100%; +} +.main { + position: fixed; + display: flex; + overflow: hidden; + height: 100%; +} +.search-bar { + width: 100%; + position: fixed; + top: 0; + left: 0; + color: #777; + background: #fff; + box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.07); + z-index: 3; + padding: 20rpx 0; + .arrow { + width: 20rpx; + height: 20rpx; + border-bottom: 2rpx solid #777; + border-left: 2rpx solid #777; + transform: rotate(45deg); + position: absolute; + left: 30rpx; + top: 41rpx; + } + .search-box { + display: flex; + justify-content: center; + align-items: center; + height: 60rpx; + background: #f7f7f7; + z-index: 999; + width: 92%; + border-radius: 50rpx; + text-align: center; + margin: auto; + .search-img { + width: 32rpx; + height: 32rpx; + margin-right: 10rpx; + } + } + .search-hint { + font-size: 28rpx; + position: absolute; + right: 30rpx; + top: 32rpx; + } +} +.sear-input { + font-size: 28rpx; +} +.leftmenu { + width: 200rpx; + height: 100%; + box-sizing: border-box; + background-color: #f5f6f7; + overflow: scroll; + z-index: 2; + .ca-empty { + padding-top: 400rpx; + text-align: center; + color: #aaa; + font-size: 24rpx; + } +} +.menu-item { + line-height: 90rpx; + height: 90rpx; + text-align: center; + border-bottom: 2rpx silid #e3e3e3; + position: relative; + color: #777; + font-size: 28rpx; + text.tips-num { + position: absolute; + top: 20rpx; + right: 15rpx; + border-radius: 15rpx; + width: 30rpx; + height: 30rpx; + background: red; + color: #fff; + font-size: 25rpx; + line-height: 30rpx; + } +} +.menu-item.active { + color: #eb2444; + font-size: 28rpx; + font-weight: bold; + position: relative; + background: #fff; + &:before { + position: absolute; + left: 0; + content: ""; + width: 8rpx; + height: 32rpx; + top: 29rpx; + background: #eb2444; + } +} +.rightcontent { + width: 550rpx; + height: 100%; + box-sizing: border-box; + background-color: #fff; + z-index: 1; + .adver-map { + width: auto; + box-sizing: border-box; + overflow: hidden; + position: relative; + margin: 30rpx 20rpx 0; + .item-a { + display: block; + font-size: 0; + width: 100%; + image { + max-width: 100%; + } + } + } + .cont-item { + padding: 0 20rpx 20rpx 20rpx; + padding-bottom: 94rpx; + .show-item { + .more-prod-pic { + text-align: center; + width: 150rpx; + height: 150rpx; + line-height: 150rpx; + font-size: 0; + .more-pic { + max-width: 100%; + max-height: 100%; + border-radius: 8rpx; + vertical-align: middle; + } + } + position: relative; + display: flex; + justify-content: flex-start; + padding: 20rpx 0; + &::after { + content: ''; + background-color: #f4f4f4; + left: 0; + height: 1px; + transform-origin: 50% 100% 0; + bottom: 0; + position: absolute; + display: block; + width: 510rpx; + padding-left: 20rpx; + } + .prod-text-right { + margin-left: 20rpx; + width: 75%; + .cate-prod-info { + font-size: 22rpx; + color: #999; + margin: 10rpx 0 20rpx 0; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + overflow: hidden; + } + .prod-text.more { + margin: 0; + font-size: 28rpx; + display: -webkit-box; + word-break: break-all; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + color: #000; + } + .prod-price.more { + font-size: 28rpx; + color: #eb2444; + font-family: arial; + } + } + } + } +} +.th-cate-con { + display: flex; + flex-wrap: wrap; +} +.sub-category { + width: 33.33%; + display: flex; + flex-direction: column; + padding: 30rpx; + box-sizing: border-box; + align-items: center; +} +.sub-category-item { + >.more-pic { + width: 120rpx; + height: 120rpx; + padding-bottom: 10rpx; + } + text { + font-size: 25rpx; + word-break: break-word; + } +} +.cont-item.empty { + display: block; + font-size: 24rpx; + color: #aaa; + text-align: center; +} diff --git a/front-end/mall4uni/src/pages/category/category.vue b/front-end/mall4uni/src/pages/category/category.vue new file mode 100644 index 00000000..b25b6b0c --- /dev/null +++ b/front-end/mall4uni/src/pages/category/category.vue @@ -0,0 +1,172 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/delivery-address/delivery-address.scss b/front-end/mall4uni/src/pages/delivery-address/delivery-address.scss new file mode 100644 index 00000000..a6e83259 --- /dev/null +++ b/front-end/mall4uni/src/pages/delivery-address/delivery-address.scss @@ -0,0 +1,93 @@ +.container { + background-color: #f4f4f4; + border-top: 2rpx solid #e9eaec; + min-height: 100vh; +} +.main { + margin-top: 20rpx; + padding-bottom: 150rpx; +} +.address { + margin-bottom: 15rpx; + width: 100%; + background-color: #fff; + border-bottom: 2rpx solid #e9eaec; + .personal { + position: relative; + padding: 20rpx 30rpx; + border-bottom: 3rpx dashed #e9eaec; + .info-tit { + .name { + margin-right: 30rpx; + font-size: 32rpx; + display: inline-block; + } + .tel { + font-size: 30rpx; + } + image { + position: absolute; + right: 30rpx; + top: 46rpx; + width: 40rpx; + height: 40rpx; + margin-left: 50rpx; + vertical-align: middle; + } + } + } + .select-btn { + padding: 15rpx 30rpx; + display: flex; + align-items: center; + justify-content: space-between; + .box { + font-size: 26rpx; + } + } +} +.personal { + .addr { + font-size: 26rpx; + margin: 10rpx 0; + margin-top: 20rpx; + .addr-get { + display: inline-block; + color: #999; + width: 100%; + word-break: break-word; + } + } +} +.footer { + position: fixed; + bottom: 0; + width: 100%; + height: 100rpx; + line-height: 100rpx; + text-align: center; + background-color: #fff; + box-shadow: 0 -1rpx 8rpx rgba(0, 0, 0, 0.05); + text { + font-size: 32rpx; + color: #eb2444; + } +} +.empty { + .img { + text-align: center; + margin-top: 130rpx; + image { + width: 100rpx; + height: 100rpx; + display: block; + margin: auto; + } + } + .txt { + margin-top: 30rpx; + font-size: 24rpx; + text-align: center; + color: #999; + } +} diff --git a/front-end/mall4uni/src/pages/delivery-address/delivery-address.vue b/front-end/mall4uni/src/pages/delivery-address/delivery-address.vue new file mode 100644 index 00000000..c32b68b7 --- /dev/null +++ b/front-end/mall4uni/src/pages/delivery-address/delivery-address.vue @@ -0,0 +1,160 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/editAddress/editAddress.scss b/front-end/mall4uni/src/pages/editAddress/editAddress.scss new file mode 100644 index 00000000..b8e9ee5b --- /dev/null +++ b/front-end/mall4uni/src/pages/editAddress/editAddress.scss @@ -0,0 +1,158 @@ +.container { + background: #fff; +} +.input-box { + margin-bottom: 50rpx; + background: #fff; + padding: 0 20rpx; + .section { + display: flex; + align-items: center; + width: 100%; + font-size: 28rpx; + padding: 30rpx 0; + line-height: 48rpx; + height: 100%; + box-sizing: border-box; + border-bottom: 2rpx solid #e5e5e5; + text { + width: 20%; + color: #333; + } + input { + width: 70%; + padding: 0 20rpx; + color: #333; + } + picker { + width: 70%; + padding: 0 30rpx; + } + .pca { + width: 70%; + padding: 0 20rpx; + } + .arrow { + width: 28rpx; + height: 28rpx; + image { + width: 100%; + height: 100%; + vertical-align: top; + } + } + } +} +.btn-box { + padding: 5px 10px; + width: 100%; + text-align: center; + margin: auto; + text { + font-size: 30rpx; + } + .clear.btn { + width: 60%; + height: 80rpx; + line-height: 80rpx; + margin: auto; + text-align: center; + border: 1rpx solid #eb2444; + border-radius: 50rpx; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 0 rgba(255, 255, 255, 0.3); + margin-top: 40rpx; + color: #eb2444; + background-color: #f8f0f1b6; + } + .keep { + color: #fff; + background-color: #eb2444; + } +} +.keep.btn { + width: 60%; + height: 80rpx; + line-height: 80rpx; + margin: auto; + text-align: center; + border: 1rpx solid #eb2444; + border-radius: 50rpx; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 0 rgba(255, 255, 255, 0.3); +} +.infoText { + margin-top: 20rpx; + text-align: center; + width: 100%; + justify-content: center; +} +picker-view { + background-color: white; + padding: 0; + width: 100%; + height: 380rpx; + bottom: 0; + position: fixed; + text { + color: #999; + display: inline-flex; + position: fixed; + margin-top: 20rpx; + height: 50rpx; + text-align: center; + line-height: 50rpx; + font-size: 34rpx; + font-family: Arial, Helvetica, sans-serif; + } +} +picker-view-column { + view { + vertical-align: middle; + font-size: 28rpx; + line-height: 28rpx; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + } +} +.animation-element-wrapper { + display: flex; + position: fixed; + left: 0; + top: 0; + height: 100%; + width: 100%; + background-color: rgba(0, 0, 0, 0.6); + z-index: 999; +} +.animation-element { + display: flex; + position: fixed; + width: 100%; + height: 470rpx; + bottom: 0; + background-color: rgba(255, 255, 255, 1); +} +.animation-button { + top: 20rpx; + width: 290rpx; + height: 100rpx; + align-items: center; +} +.left-bt { + left: 30rpx; +} +.right-bt { + right: 20rpx; + top: 20rpx; + position: absolute; + width: 80rpx !important; +} +.line { + display: block; + position: fixed; + height: 2rpx; + width: 100%; + margin-top: 89rpx; + background-color: #eee; +} diff --git a/front-end/mall4uni/src/pages/editAddress/editAddress.vue b/front-end/mall4uni/src/pages/editAddress/editAddress.vue new file mode 100644 index 00000000..8875137f --- /dev/null +++ b/front-end/mall4uni/src/pages/editAddress/editAddress.vue @@ -0,0 +1,435 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/express-delivery/express-delivery.scss b/front-end/mall4uni/src/pages/express-delivery/express-delivery.scss new file mode 100644 index 00000000..8ca16133 --- /dev/null +++ b/front-end/mall4uni/src/pages/express-delivery/express-delivery.scss @@ -0,0 +1,175 @@ +page { + background: #f7f8fa; +} +.container { + height: 100%; +} +.padding20 { + padding-top: 88rpx; +} +.f-fl { + float: left; +} +.f-fr { + float: right; +} +.navWrap { + position: fixed; + top: 0; + left: 0; + z-index: 1; + overflow: hidden; + background-color: #fafafa; + border-bottom: 2rpx solid #f4f4f4; + height: 92rpx; +} +.nav { + display: flex; + flex-flow: row nowrap; +} +.nav-slider { + left: 0; + bottom: 0; + height: 4rpx; + background-color: #b4282d; + transition: transform 0.3s; + transition: transform 0.3s, -webkit-transform 0.3s; + box-sizing: border-box; +} +.nav-item { + display: flex; + align-items: center; + justify-content: center; + flex: 1; + float: left; + height: 88rpx; + padding: 0 16rpx; + font-size: 28rpx; + text { + box-sizing: border-box; + color: #333; + padding: 27rpx 16rpx 23rpx; + line-height: 34rpx; + } +} +.nav-item.active { + text { + color: #b4282d; + } +} +.u-icon { + vertical-align: middle; +} +.deliveryInfo { + height: 198rpx; + width: 100%; + vertical-align: middle; + padding-left: 30rpx; + background-size: cover; + display: table; + position: relative; + box-sizing: border-box; + .companyname { + line-height: 1; + margin-left: 136rpx; + font-size: 28rpx; + .key { + color: #666; + } + } + .expno { + line-height: 1; + margin-left: 136rpx; + font-size: 28rpx; + margin-top: 16rpx; + .key { + color: #666; + } + } +} +.icon-express { + width: 104rpx; + height: 104rpx; + background-size: 100% 100%; + position: absolute; + top: 48rpx; + left: 30rpx; +} +.infoWarp { + display: table-cell; + vertical-align: middle; +} +.deliveryDetail { + margin-top: 20rpx; + padding-top: 40rpx; + background-color: #fff; + min-height: 670rpx; +} +.detailItem { + border-left: 1px dashed #f4f4f4; + margin-left: 42rpx; + position: relative; + margin-bottom: 2rpx; +} +.dot { + image { + width: 35rpx; + height: 35rpx; + background-size: 100%; + position: absolute; + top: 40rpx; + left: -18rpx; + } +} +.lastest { + .dot { + image { + top: -2rpx; + } + } + .detail { + .desc { + color: #105c3e; + margin-top: 0; + } + .time { + color: #105c3e; + } + border-top: 0; + } +} +.detail { + .desc { + font-size: 24rpx; + line-height: 30rpx; + margin-top: 40rpx; + } + .time { + font-size: 24rpx; + line-height: 30rpx; + color: #999; + margin-top: 15rpx; + margin-bottom: 39rpx; + } + border-top: 1px solid #f4f4f4; + margin-left: 28rpx; + overflow: hidden; + padding-right: 30rpx; +} +.deliveryTip { + height: 80rpx; + background-color: #fff8d8; + padding-left: 30rpx; + color: #f48f18; + font-size: 28rpx; + line-height: 80rpx; + margin-bottom: 20rpx; +} +.empty-space { + margin-top: 20rpx; + background: #fff; + font-size: 28rpx; + color: #333; + padding: 20rpx 0; + text-align: center; +} diff --git a/front-end/mall4uni/src/pages/express-delivery/express-delivery.vue b/front-end/mall4uni/src/pages/express-delivery/express-delivery.vue new file mode 100644 index 00000000..cb9d3407 --- /dev/null +++ b/front-end/mall4uni/src/pages/express-delivery/express-delivery.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/index/index.scss b/front-end/mall4uni/src/pages/index/index.scss new file mode 100644 index 00000000..bc6bbbcf --- /dev/null +++ b/front-end/mall4uni/src/pages/index/index.scss @@ -0,0 +1,410 @@ +.container { + background: #f7f7f7; + height: auto; +} + +/* 轮播图及搜索框 */ +swiper { + width: 100%; + height: 350rpx; + overflow: hidden; +} +swiper.pic-swiper { + margin-top: 75rpx; + padding: 10rpx 0; + background: #fff; + height: 422rpx; + .img-box { + font-size: 0; + } + .banner { + position: absolute; + width: 690rpx; + margin: 0 10rpx; + height: 402rpx; + border-radius: 8rpx; + display: inline-block; + box-shadow: 0 4px 10px 0 rgba(83, 83, 83, 0.288); + } +} +swiper-item { + font-size: 26rpx; + font-weight: bold; +} +.wx-swiper-dots { + margin-bottom: 15rpx; +} +.banner-item { + box-sizing: border-box; +} +.container { + .bg-sear { + position: fixed; + z-index: 999; + width: 100%; + line-height: 56rpx; + background: #fff; + padding: 20rpx 0; + text-align: center; + top: 0; + } +} +.bg-sear { + .section { + display: flex; + justify-content: center; + align-items: center; + height: 60rpx; + background: #fff; + z-index: 1; + border-radius: 50rpx; + width: 92%; + margin: auto; + left: 4%; + background: #f7f7f7; + .placeholder { + display: block; + font-size: 24rpx; + color: #999; + } + .search-img { + width: 32rpx; + height: 32rpx; + margin-right: 10rpx; + } + } +} + +/* 分类栏目 */ +.content { + background: #fff; +} +.cat-item { + display: flex; + justify-content: space-between; + background: #fff; + padding-top: 20rpx; + padding-bottom: 30rpx; + .item { + text-align: center; + width: 25%; + display: flex; + flex-direction: column; + margin: auto; + align-items: center; + image { + width: 75rpx; + height: 75rpx; + } + text { + font-size: 26rpx; + margin-top: 20rpx; + } + } +} + +/* 消息播放 */ +.message-play { + position: relative; + height: 90rpx; + background: #fff; + margin: auto; + padding: 0 60rpx 0 100rpx; + box-sizing: border-box; + box-shadow: 0 16rpx 32rpx 0 rgba(7, 17, 27, 0.05); + border: 2rpx solid #fafafa; + .hornpng { + width: 77rpx; + height: 36rpx; + position: absolute; + left: 20rpx; + top: 27rpx; + margin-right: 8rpx; + } + .swiper-cont { + height: 90rpx; + line-height: 90rpx; + .items { + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + text-align: left; + } + } +} +.arrow { + width: 15rpx; + height: 15rpx; + border-top: 3rpx solid #686868; + border-right: 3rpx solid #686868; + transform: rotate(45deg); + position: absolute; + right: 30rpx; + top: 34rpx; +} + +/* 每日上新 */ +.title { + position: relative; + height: 64rpx; + line-height: 64rpx; + font-size: 32rpx; + padding: 40rpx 0 10rpx 30rpx; + color: #333; + background: #fff; + .more-prod-cont { + color: #999; + display: inline-block; + text-align: right; + .more { + position: absolute; + right: 30rpx; + top: 48rpx; + color: #666; + font-size: 24rpx; + padding: 0 20rpx; + height: 44rpx; + line-height: 44rpx; + } + .arrow { + top: 58rpx; + right: 30rpx; + border-top: 2rpx solid #666; + border-right: 2rpx solid #666; + } + } +} +.up-to-date { + .title { + color: #fff; + background: none; + .more-prod-cont { + .more { + position: absolute; + right: 30rpx; + top: 48rpx; + color: #fff; + font-size: 24rpx; + background: #65addf; + border-radius: 30rpx; + padding: 0 30rpx; + height: 44rpx; + line-height: 44rpx; + } + } + } + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAABxCAYAAACkwXoWAAABS2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxMzggNzkuMTU5ODI0LCAyMDE2LzA5LzE0LTAxOjA5OjAxICAgICAgICAiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIi8+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgo8P3hwYWNrZXQgZW5kPSJyIj8+IEmuOgAAAZBJREFUeJzt1DEBwCAAwLAxYfhEGXJABkcTBb065trnAwj6XwcAvGKAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGRdKykDj9OUNYkAAAAASUVORK5CYII="); + background-position: top; + background-size: 100% 332rpx; + background-repeat: no-repeat; + background-color: #fff; + .item-cont { + margin: auto; + height: auto; + width: calc(100% - 40rpx); + display: flex; + flex-wrap: wrap; + &::before { + clear: both; + height: 0; + overflow: hidden; + } + .prod-item { + border-radius: 10rpx; + width: 220rpx; + background: #fff; + display: inline-block; + margin: 0 8rpx; + margin-bottom: 20rpx; + box-shadow: 0rpx 6rpx 8rpx rgba(58,134,185,0.2); + .imagecont { + width: 100%; + font-size: 0; + .prodimg { + width: 220rpx; + height: 220rpx; + vertical-align: middle; + border-top-left-radius: 10rpx; + border-top-right-radius: 10rpx; + font-size: 0; + } + } + .prod-text { + font-size: 28rpx; + overflow: hidden; + margin: 10rpx 0; + height: 75rpx; + display: -webkit-box; + word-break: break-all; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + color: #000; + padding: 0 10rpx; + } + .prod-price { + font-size: 25rpx; + color: #eb2444; + font-family: Arial; + padding: 0 10rpx; + } + } + } +} +.hotsale-item-cont { + padding-bottom: 20rpx; + background: #fff; +} +.more.prod-price { + position: absolute; + bottom: 20rpx; +} + +/* 商城热卖 */ +.hot-sale { + .prod-items { + width: 345rpx; + display: inline-block; + background: #fff; + padding-bottom: 20rpx; + box-sizing: border-box; + box-shadow: 0rpx 6rpx 8rpx rgba(58,134,185,0.2); + &:nth-child(2n-1) { + margin: 20rpx 10rpx 10rpx 20rpx; + } + &:nth-child(2n) { + margin: 20rpx 20rpx 10rpx 10rpx; + } + } +} +.prod-items { + .hot-imagecont { + .hotsaleimg { + width: 341rpx; + height: 341rpx; + } + font-size: 0; + text-align: center; + } + .hot-text { + .hotprod-text { + font-size: 28rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + margin-top: 20rpx; + padding: 0 10rpx; + .prod-info { + font-size: 22rpx; + color: #999; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + .prod-text-info { + position: relative; + height: 70rpx; + line-height: 70rpx; + font-family: Arial; + .hotprod-price { + display: inline; + font-size: 26rpx; + color: #eb2444; + } + .basket-img { + width: 50rpx; + height: 50rpx; + position: absolute; + right: 0; + bottom: 7rpx; + padding: 8rpx; + } + } + } +} +.more-prod { + .prod-text-right { + .prod-info { + font-size: 22rpx; + color: #999; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + } +} +.singal-price { + display: inline; + font-size: 20rpx; + text-decoration: line-through; + color: #777; + margin-left: 15rpx; +} + +/* 更多宝贝 */ +.more-prod { + background: #fff; + .prod-show { + .show-item { + .more-prod-pic { + width: 250rpx; + height: 250rpx; + .more-pic { + max-width: 100%; + max-height: 100%; + } + } + position: relative; + display: flex; + padding: 20rpx; + justify-content: flex-start; + border-top: 2rpx solid #f4f4f4; + .prod-text-right { + margin-left: 30rpx; + width: 72%; + padding-bottom: 10rpx; + display: flex; + flex-direction: column; + justify-content: center; + .go-to-buy { + font-size: 26rpx; + background: #fff2f5; + color: #eb2444; + border-radius: 50rpx; + text-align: center; + padding: 12rpx 20rpx; + position: absolute; + right: 20rpx; + bottom: 20rpx; + } + .prod-text.more { + margin: 0; + font-size: 28rpx; + overflow: hidden; + margin-bottom: 20rpx; + display: -webkit-box; + word-break: break-all; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + .more.prod-price { + font-size: 28rpx; + font-family: arial; + } + } + } + } +} +.b-cart { + margin-top: 30rpx; + .basket-img { + width: 50rpx; + height: 50rpx; + position: absolute; + right: 46rpx; + padding: 8rpx; + } +} diff --git a/front-end/mall4uni/src/pages/index/index.vue b/front-end/mall4uni/src/pages/index/index.vue new file mode 100644 index 00000000..70a8c77f --- /dev/null +++ b/front-end/mall4uni/src/pages/index/index.vue @@ -0,0 +1,507 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/news-detail/news-detail.scss b/front-end/mall4uni/src/pages/news-detail/news-detail.scss new file mode 100644 index 00000000..7dd8eced --- /dev/null +++ b/front-end/mall4uni/src/pages/news-detail/news-detail.scss @@ -0,0 +1,23 @@ +.news-detail { + padding: 20rpx; + .news-detail-title { + font-size: 32rpx; + font-weight: bold; + line-height: 50rpx; + padding: 20rpx; + } + .news-detail-text { + font-size: 28rpx; + line-height: 46rpx; + text-align: justify; + text-justify: inter-ideograph; + margin-top: 20rpx; + } +} +.content { + :deep(img) { + display: block; + width: 100%; + height: auto; + } +} diff --git a/front-end/mall4uni/src/pages/news-detail/news-detail.vue b/front-end/mall4uni/src/pages/news-detail/news-detail.vue new file mode 100644 index 00000000..e21ce593 --- /dev/null +++ b/front-end/mall4uni/src/pages/news-detail/news-detail.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/order-detail/order-detail.scss b/front-end/mall4uni/src/pages/order-detail/order-detail.scss new file mode 100644 index 00000000..9a7795df --- /dev/null +++ b/front-end/mall4uni/src/pages/order-detail/order-detail.scss @@ -0,0 +1,247 @@ +.container { + background: #f4f4f4; +} +.order-detail { + margin-bottom: 120rpx; + padding-bottom: 160rpx; + .delivery-addr { + padding: 20rpx 30rpx; + background: #fff; + .user-info { + line-height: 48rpx; + word-wrap: break-word; + word-break: break-all; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + .item { + font-size: 28rpx; + margin-right: 30rpx; + vertical-align: top; + display: inline-block; + } + } + .addr { + font-size: 26rpx; + line-height: 36rpx; + color: #999; + word-wrap: break-word; + } + } +} +.prod-item { + background-color: #fff; + margin-top: 15rpx; + font-size: 28rpx; + .item-cont { + .prod-pic { + image { + width: 180rpx; + height: 180rpx; + width: 100%; + height: 100%; + } + font-size: 0; + display: block; + width: 160rpx; + height: 160rpx; + overflow: hidden; + background: #fff; + margin-right: 16rpx; + } + display: flex; + align-items: center; + padding: 30rpx; + border-top: 2rpx solid #f1f1f1; + .prod-info { + margin-left: 10rpx; + font-size: 28rpx; + width: 100%; + position: relative; + height: 80px; + -webkit-flex: 1; + -ms-flex: 1; + -webkit-box-flex: 1; + -moz-box-flex: 1; + flex: 1; + .prodname { + font-size: 28rpx; + line-height: 40rpx; + max-height: 86rpx; + overflow: hidden; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + text-overflow: ellipsis; + word-break: break-all; + } + .prod-info-cont { + position: relative; + color: #999; + margin-top: 10rpx; + font-size: 24rpx; + .info-item { + color: #999; + height: 28rpx; + margin-top: 10rpx; + font-size: 24rpx; + overflow: hidden; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + text-overflow: ellipsis; + word-break: break-all; + width: 70%; + } + .number { + float: left; + margin-right: 20rpx; + } + } + } + } + .price-nums { + margin-top: 30rpx; + .prodprice { + color: #333; + height: 50rpx; + line-height: 50rpx; + font-size: 24rpx; + float: left; + } + .btn-box { + float: right; + text-align: right; + .btn { + padding: 6rpx 30rpx; + line-height: 36rpx; + margin-left: 20rpx; + font-size: 24rpx; + display: inline-block; + border: 2rpx solid #e4e4e4; + border-radius: 50rpx; + } + } + } +} +.order-msg { + background: #fff; + margin-top: 15rpx; + font-size: 28rpx; + .msg-item { + padding: 20rpx; + border-top: 2rpx solid #f1f1f1; + &:first-child { + border: 0; + } + .item { + display: flex; + padding: 10rpx 0; + align-items: center; + box-sizing: border-box; + .item-tit { + min-width: 140rpx; + color: #999; + line-height: 48rpx; + } + .item-txt { + flex: 1; + line-height: 48rpx; + } + .item-txt.remarks { + max-width: 600rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + .copy-btn { + display: block; + margin-left: 20rpx; + border: 2rpx solid #e4e4e4; + padding: 6rpx 24rpx; + border-radius: 50rpx; + font-size: 24rpx; + line-height: 28rpx; + } + .item-txt.price { + text-align: right; + } + } + .item.payment { + border-top: 2rpx solid #f1f1f1; + color: #eb2444; + padding-top: 30rpx; + } + } +} +.order-detail-footer { + position: fixed; + bottom: 0; + width: 100%; + max-width: 750rpx; + background: #fff; + margin: auto; + display: -webkit-flex; + display: -webkit-box; + display: -moz-box; + display: -ms-flexbox; + display: flex; + padding: 22rpx 0; + font-size: 26rpx; + box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05); + .dele-order { + margin-left: 20rpx; + line-height: 60rpx; + display: block; + margin-right: 20rpx; + width: 150rpx; + text-align: center; + } + .footer-box { + flex: 1; + text-align: right; + line-height: 60rpx; + .buy-again { + font-size: 26rpx; + color: #fff; + background: #eb2444; + border-radius: 50rpx; + padding: 10rpx 20rpx; + margin-right: 20rpx; + } + .apply-service { + font-size: 26rpx; + border-radius: 50rpx; + padding: 10rpx 20rpx; + border: 1px solid #e4e4e4; + margin-right: 20rpx; + } + } +} +.clearfix { + &:after { + content: " "; + display: table; + clear: both; + } +} +.order-state { + height: 70rpx; + line-height: 70rpx; + text-align: right; + margin-right: 20rpx; + .order-sts { + color: #eb2444; + font-size: 28rpx; + } + .order-sts.gray { + color: #999; + height: 32rpx; + line-height: 32rpx; + } + .order-sts.normal { + color: #333; + } +} diff --git a/front-end/mall4uni/src/pages/order-detail/order-detail.vue b/front-end/mall4uni/src/pages/order-detail/order-detail.vue new file mode 100644 index 00000000..2c485145 --- /dev/null +++ b/front-end/mall4uni/src/pages/order-detail/order-detail.vue @@ -0,0 +1,299 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/orderList/orderList.scss b/front-end/mall4uni/src/pages/orderList/orderList.scss new file mode 100644 index 00000000..3ca19c6e --- /dev/null +++ b/front-end/mall4uni/src/pages/orderList/orderList.scss @@ -0,0 +1,211 @@ +.container { + background-color: #f4f4f4; + color: #333; +} +.order-tit { + position: fixed; + top: 0; + display: flex; + justify-content: space-around; + z-index: 999; + width: 100%; + height: 100rpx; + line-height: 100rpx; + background-color: #fff; + border-bottom: 2rpx solid #f4f4f4; + text { + display: block; + font-size: 28rpx; + color: 999; + width: 100rpx; + text-align: center; + } + text.on { + border-bottom: 4rpx solid #eb2444; + color: #eb2444; + } +} +.main { + margin-top: 100rpx; +} +.prod-item { + background-color: #fff; + margin-top: 15rpx; + font-size: 28rpx; + .item-cont { + .prod-pic { + image { + width: 180rpx; + height: 180rpx; + width: 100%; + height: 100%; + } + font-size: 0; + display: inline-block; + width: 160rpx; + height: 160rpx; + overflow: hidden; + background: #fff; + margin-right: 16rpx; + } + .categories { + white-space: nowrap; + } + display: flex; + align-items: center; + padding: 20rpx 30rpx; + border-radius: 10rpx; + display: -webkit-flex; + display: -webkit-box; + display: -moz-box; + display: -ms-flexbox; + background: #fafafa; + .prod-info { + margin-left: 10rpx; + font-size: 28rpx; + width: 100%; + position: relative; + height: 160rpx; + -webkit-flex: 1; + -ms-flex: 1; + -webkit-box-flex: 1; + -moz-box-flex: 1; + flex: 1; + .prodname { + font-size: 28rpx; + line-height: 36rpx; + max-height: 86rpx; + overflow: hidden; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + text-overflow: ellipsis; + word-break: break-all; + } + .prod-info-cont { + color: #999; + line-height: 40rpx; + margin-top: 10rpx; + font-size: 22rpx; + overflow: hidden; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + text-overflow: ellipsis; + word-break: break-all; + } + } + } + .order-num { + padding: 20rpx 30rpx; + display: flex; + justify-content: space-between; + font-size: 28rpx; + .clear-btn { + width: 32rpx; + height: 32rpx; + font-size: 0; + vertical-align: top; + margin-left: 42rpx; + position: relative; + &::after { + content: " "; + display: block; + position: absolute; + left: -10px; + top: 0rpx; + width: 1px; + height: 32rpx; + background: #ddd; + } + .clear-list-btn { + width: 100%; + height: 100%; + vertical-align: middle; + } + } + } + .total-num { + text-align: right; + padding: 20rpx 30rpx; + font-size: 28rpx; + .prodprice { + display: inline-block; + color: #333; + } + .prodcount { + margin-right: 20rpx; + } + } + .price-nums { + .prodprice { + color: #333; + position: absolute; + bottom: 0; + } + .prodcount { + position: absolute; + bottom: 5rpx; + right: 0; + color: #999; + font-family: verdana; + } + } + .prod-foot { + border-top: 2rpx solid #e6e6e6; + .total { + font-size: 25rpx; + margin-bottom: 20rpx; + padding-bottom: 20rpx; + border-bottom: 2rpx solid #e9eaec; + } + .btn { + display: flex; + align-items: center; + justify-content: flex-end; + } + } +} +.order-state { + display: flex; + align-items: center; + font-size: 24rpx; + .order-sts.red { + color: #eb2444; + } + .order-sts.gray { + color: #999; + } +} +.other-button-hover { + background-color: blue; +} +.button-hover { + background-color: red; + background-color: blue; +} +.button { + margin-top: 20rpx; + margin-bottom: 20rpx; + margin-left: 10px; + font-size: 26rpx; + background: #fff; + padding: 10rpx 30rpx; + border-radius: 80rpx; + border: 2rpx solid #e1e1e1; + &:last-child { + margin-right: 10rpx; + } +} +.button.warn { + color: #eb2444; + border-color: #eb2444; +} +.empty { + font-size: 24rpx; + margin-top: 100rpx; + text-align: center; + color: #999; + height: 300rpx; + line-height: 300rpx; +} diff --git a/front-end/mall4uni/src/pages/orderList/orderList.vue b/front-end/mall4uni/src/pages/orderList/orderList.vue new file mode 100644 index 00000000..63a0ab54 --- /dev/null +++ b/front-end/mall4uni/src/pages/orderList/orderList.vue @@ -0,0 +1,424 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/pay-result/pay-result.scss b/front-end/mall4uni/src/pages/pay-result/pay-result.scss new file mode 100644 index 00000000..eb8e3e36 --- /dev/null +++ b/front-end/mall4uni/src/pages/pay-result/pay-result.scss @@ -0,0 +1,50 @@ +.pay-sts { + font-size: 40rpx; + margin-top: 100rpx; + padding: 30rpx 0; + text-align: center; +} +.pay-sts.fail { + color: #f43530; +} +.pay-sts.succ { + color: #19be6b; +} +.btns { + margin-top: 50rpx; + text-align: center; + .button { + border-radius: 10rpx; + font-size: 28rpx; + background: #fff; + color: #333; + padding: 20rpx 35rpx; + width: 300rpx; + margin: 0 20rpx; + text-align: center; + } + .button.checkorder { + background: #19be6b; + color: #fff; + margin-bottom: 20rpx; + border: 2rpx solid #19be6b; + } + .button.payagain { + background: #fff; + border: 2rpx solid #f90; + color: #f90; + } + .button.shopcontinue { + background: #fff; + border: 2rpx solid #19be6b; + color: #19be6b; + } +} +.tips { + font-size: 28rpx; + color: #999; + text-align: center; + .warn { + color: #f43530; + } +} diff --git a/front-end/mall4uni/src/pages/pay-result/pay-result.vue b/front-end/mall4uni/src/pages/pay-result/pay-result.vue new file mode 100644 index 00000000..9dae1167 --- /dev/null +++ b/front-end/mall4uni/src/pages/pay-result/pay-result.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/prod-classify/prod-classify.scss b/front-end/mall4uni/src/pages/prod-classify/prod-classify.scss new file mode 100644 index 00000000..861c212d --- /dev/null +++ b/front-end/mall4uni/src/pages/prod-classify/prod-classify.scss @@ -0,0 +1,30 @@ +.container { + background: #fff; + margin: 7px; +} +.line-fix { + width: 100%; + height: 2rpx; + background: #e1e1e1; + position: fixed; + top: 0; +} +.tit-background { + width: 100%; + height: 20rpx; + background: #f4f4f4; +} +.prod-list { + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} +/* 空 */ +.empty { + display: block; + width: 100%; + font-size: 26rpx; + color: #999; + margin-top: 20vh; + text-align: center; +} diff --git a/front-end/mall4uni/src/pages/prod-classify/prod-classify.vue b/front-end/mall4uni/src/pages/prod-classify/prod-classify.vue new file mode 100644 index 00000000..c43ae5a7 --- /dev/null +++ b/front-end/mall4uni/src/pages/prod-classify/prod-classify.vue @@ -0,0 +1,232 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/prod/prod.scss b/front-end/mall4uni/src/pages/prod/prod.scss new file mode 100644 index 00000000..7478438a --- /dev/null +++ b/front-end/mall4uni/src/pages/prod/prod.scss @@ -0,0 +1,628 @@ +.container { + background: #f4f4f4; + height: 100%; + padding-bottom: 150rpx; +} +swiper { + height: 750rpx; + width: 100%; + border-bottom: 2rpx solid #f8f8f8; + image { + height: 750rpx; + width: 100%; + } +} +.prod-info { + padding: 30rpx 30rpx 0 30rpx; + position: relative; + background: #fff; +} +.tit-wrap { + position: relative; + line-height: 40rpx; + padding-right: 104rpx; + .col { + position: absolute; + top: 0; + right: 0; + width: 80rpx; + color: #666; + font-size: 20rpx; + padding-left: 20rpx; + text-align: center; + image { + display: block; + margin: auto; + width: 40rpx; + height: 40rpx; + } + &::after { + content: ""; + display: block; + width: 1px; + height: auto; + background: #f1f1f1; + position: absolute; + top: 0; + bottom: 5px; + left: 0; + } + } +} +.prod-tit { + font-size: 32rpx; + color: #333; + padding-right: 20rpx; +} +.sales-p { + background: #fff; + line-height: 40rpx; + color: #999; + font-size: 24rpx; + margin-top: 6rpx; + margin-right: 104rpx; +} +.prod-price { + font-size: 30rpx; + height: 100rpx; + line-height: 100rpx; +} +.price { + color: #eb2444; + font-size: 24rpx; + font-weight: 600; + margin-right: 30rpx; +} +.price-num { + font-size: 46rpx; + font-weight: 400; +} +.ori-price { + font-size: 25rpx; + color: #999; + text-decoration: line-through; +} +.sales { + color: #999; +} +.more { + position: absolute; + right: 20rpx; + width: 60rpx; + top: 10rpx; + text-align: right; + font-size: 40rpx; + color: #999; + letter-spacing: 1px; +} +.sku { + padding: 20rpx; + background: #fff; + margin-top: 20rpx; + position: relative; + line-height: 48rpx; +} +.sku-tit { + position: absolute; + display: inline-block; + width: 60rpx; + left: 20rpx; + font-size: 22rpx; + top: 20rpx; + color: #999; +} +.sku-con { + margin: 0 80rpx; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + font-size: 28rpx; + font-weight: bold; +} +.cmt-wrap { + background: #fff; + margin-top: 20rpx; + position: relative; + line-height: 48rpx; +} +.cmt-tit { + font-size: 32rpx; + position: relative; + border-bottom: 1px solid #ddd; + padding: 20rpx; +} +.cmt-t { + width: 300rpx; +} +.cmt-good { + color: #eb2444; + font-size: 24rpx; +} +.cmt-count { + position: absolute; + right: 20rpx; + top: 20rpx; + font-size: 24rpx; + color: #666; +} +.cmt-more { + width: 20rpx; + height: 20rpx; + border-top: 2rpx solid #999; + border-right: 2rpx solid #999; + transform: rotate(45deg); + margin-left: 10rpx; + display: inline-block; +} +.cmt-cont { + padding: 0 20rpx; +} +.cmt-tag { + position: relative; + padding: 14px 3px 0 0; + margin: 0; + text { + margin: 0 10px 10px 0; + background: #fdf0f0; + display: inline-block; + padding: 0 10px; + height: 25px; + border-radius: 3px; + line-height: 25px; + font-size: 12px; + font-family: -apple-system, Helvetica, sans-serif; + color: #666; + } + text.selected { + color: #fff; + background: #e93b3d; + } +} +.cmt-item { + position: relative; + padding: 10px 0; + &::after { + content: ""; + height: 0; + display: block; + border-bottom: 1px solid #ddd; + position: absolute; + left: 0; + bottom: 0; + right: -10px; + border-bottom-color: #e5e5e5; + } +} +.cmt-items { + .empty { + display: block; + font-size: 24rpx; + text-align: center; + color: #aaa; + margin-top: 5vh; + } +} +.cmt-user { + line-height: 25px; + margin-bottom: 8px; + font-size: 12px; + .user-img { + width: 25px; + height: 25px; + border-radius: 50%; + vertical-align: middle; + } + .nickname { + margin-left: 10px; + display: inline-block; + color: #333; + max-width: 8.2em; + height: 25px; + line-height: 27px; + } + .date { + float: right; + color: #999; + margin-left: -60px; + } +} +.cmt-user-info { + display: flex; + align-items: center; + width: 400rpx; +} +.cmt-cnt { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + position: relative; + line-height: 1.5; + font-size: 14px; + margin: 5px 0; + word-break: break-all; + max-height: 126px; +} +.cmt-attr { + height: 85px; + width: 100%; + white-space: nowrap; + image { + display: inline-block; + width: 80px; + height: 80px; + margin-right: 5px; + margin-bottom: 5px; + border-radius: 2px; + background: #f3f3f3; + } +} +.cmt-more-v { + text-align: center; + background-color: #fff; + font-size: 12px; + text { + height: 25px; + line-height: 25px; + font-size: 12px; + text-align: center; + color: #333; + padding: 0px 10px; + margin: 10px 0; + border: 1px solid #ccc; + border-radius: 40px; + display: inline-block; + } +} +.cmt-popup { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + z-index: 998; + background-color: #fff; + padding-bottom: 98rpx; + .cmt-cont { + height: calc(100% - 80rpx); + overflow: auto; + } + .cmt-cnt { + -webkit-line-clamp: 20; + max-height: 500px; + } + .load-more { + font-size: 14px; + padding: 20px; + text-align: center; + margin-bottom: 10px; + text { + border: 1px solid #ddd; + padding: 5px 10px; + border-radius: 10px; + color: #666; + } + } +} +.cmt-reply { + font-size: 14px; + border-top: 1px dashed #ddd; + padding: 5px 0; + .reply-tit { + color: #eb2444; + } +} +.prod-detail { + background: #fff; + margin-top: 20rpx; + position: relative; + line-height: 48rpx; + image { + width: 750rpx !important; + display: block; + } +} +rich-text { + image { + width: 100% !important; + } +} +:deep(.img) { + width: 100% !important; + display: block; +} +.cart-footer { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + display: flex; + flex-flow: row nowrap; + height: 98rpx; + z-index: 999; + box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05); + .btn { + position: relative; + display: flex; + flex-grow: 1; + justify-content: center; + align-items: center; + width: 0; + background-color: #fff; + font-size: 28rpx; + flex-flow: column; + .badge { + position: absolute; + top: 20rpx; + left: 62rpx; + display: inline-block; + width: 28rpx; + height: 28rpx; + border-radius: 14rpx; + background-color: #eb2444; + text-align: center; + line-height: 28rpx; + font-size: 18rpx; + color: #fff; + } + .badge-1 { + width: 36rpx; + } + } + .btn.icon { + flex-grow: 0; + flex-shrink: 0; + width: 125rpx; + font-size: 20rpx; + color: #666; + image { + width: 50rpx; + height: 50rpx; + } + } + .btn.cart { + background: #584e61; + color: #fff; + } + .btn.buy { + background: #eb2444; + color: #fff; + } +} +.close { + color: #aaa; + border-radius: 12px; + line-height: 20px; + text-align: center; + height: 20px; + width: 20px; + font-size: 18px; + padding: 1px; + top: 10px; + right: 10px; + position: absolute; + &::before { + content: "\2716"; + } +} +.popup-cnt { + max-height: 429px; + overflow: auto; + padding: 0 10px; +} +.pup-sku { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + z-index: 999; + background-color: rgba(0, 0, 0, 0.3); +} +.pup-sku-main { + position: absolute; + bottom: 0; + width: 100%; + min-height: 375px; + max-height: 475px; + background-color: #fff; +} +.pup-sku-header { + position: relative; + line-height: 46px; + font-size: 16px; + color: #333; + height: 70px; + padding: 0 0 10px 110px; + background-color: #fff; +} +.pup-sku-img { + position: absolute; + left: 10px; + top: -20px; + border-radius: 2px; + width: 90px; + height: 90px; + border: 0 none; + vertical-align: top; +} +.pup-sku-price { + display: inline-block; + height: 40px; + line-height: 40px; + color: #e4393c; + font-size: 10px; +} +.pup-sku-price-int { + font-size: 16px; +} +.pup-sku-prop { + word-break: break-all; + font-size: 12px; + color: #333; + line-height: 1.4em; + padding-right: 10px; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + text { + color: #999; + margin-right: 5px; + } +} +.pup-sku-body { + box-sizing: border-box; + max-height: 379px; + padding-bottom: 100px; + overflow: auto; +} +.pup-sku-area { + .sku-kind { + font-size: 12px; + color: #999; + margin: 0 10px; + height: 40px; + line-height: 40px; + } + .sku-choose { + overflow: hidden; + margin-bottom: 3px; + } +} +.sku-choose-item { + display: inline-block; + padding: 0 10px; + min-width: 20px; + max-width: 270px; + overflow: hidden; + height: 30px; + line-height: 30px; + text-align: center; + margin-left: 10px; + margin-bottom: 10px; + border-radius: 4px; + color: #333; + background-color: #f7f7f7; + font-size: 14px; +} +.sku-choose-item.active { + background-color: #eb2444; + color: #fff; +} +.sku-choose-item.gray { + background-color: #f9f9f9; + color: #ddd; +} +.pup-sku-count { + padding: 0 10px 13px; + font-size: 12px; + .count-name { + color: #999; + height: 31px; + line-height: 31px; + width: 100rpx; + } + .num-wrap { + position: relative; + z-index: 0; + width: 110px; + float: right; + vertical-align: middle; + display: flex; + } + .text-wrap { + position: relative; + width: 45px; + z-index: 0; + margin: 0 1px; + input { + height: 30px; + width: 100%; + color: #333; + background: #fff; + font-size: 12px; + text-align: center; + border: none; + background: #f7f7f7; + } + } +} +.num-wrap { + .minus { + position: relative; + max-width: 30px; + min-width: 30px; + height: 30px; + line-height: 30px; + background: #f7f7f7; + text-align: center; + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; + } + .plus { + position: relative; + max-width: 30px; + min-width: 30px; + height: 30px; + line-height: 30px; + background: #f7f7f7; + text-align: center; + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + } + .row { + border-radius: 20px; + position: absolute; + top: 50%; + left: 50%; + margin-left: -7px; + margin-top: -1px; + width: 14px; + height: 2px; + background-color: #ccc; + } + .col { + border-radius: 20px; + position: absolute; + top: 50%; + left: 50%; + margin-left: -1px; + margin-top: -7px; + width: 2px; + height: 14px; + background-color: #999; + } +} +.pup-sku-footer { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + display: flex; + flex-direction: row nowrap; + height: 98rpx; + z-index: 999; + box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05); + .btn { + position: relative; + display: flex; + flex-grow: 1; + justify-content: center; + align-items: center; + width: 0; + background-color: #fff; + font-size: 28rpx; + flex-flow: column; + } + .btn.cart { + background: #584e61; + color: #fff; + } + .btn.buy { + background: #eb2444; + color: #fff; + } +} diff --git a/front-end/mall4uni/src/pages/prod/prod.vue b/front-end/mall4uni/src/pages/prod/prod.vue new file mode 100644 index 00000000..576998e2 --- /dev/null +++ b/front-end/mall4uni/src/pages/prod/prod.vue @@ -0,0 +1,875 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/recent-news/recent-news.scss b/front-end/mall4uni/src/pages/recent-news/recent-news.scss new file mode 100644 index 00000000..f6dbc96b --- /dev/null +++ b/front-end/mall4uni/src/pages/recent-news/recent-news.scss @@ -0,0 +1,34 @@ +.recent-news { + background: #fff; + .news-item { + padding: 20rpx 20rpx 0 20rpx; + position: relative; + &::after { + content: " "; + width: 100%; + height: 2rpx; + background-color: #e1e1e1; + left: 20rpx; + display: block; + position: absolute; + } + .news-item-title { + font-size: 28rpx; + text-align: left; + } + .news-item-date { + font-size: 24rpx; + color: #999; + text-align: right; + margin-top: 10rpx; + margin-bottom: 20rpx; + } + } + .empty { + display: block; + padding-top: 200rpx; + color: #999; + font-size: 26rpx; + text-align: center; + } +} diff --git a/front-end/mall4uni/src/pages/recent-news/recent-news.vue b/front-end/mall4uni/src/pages/recent-news/recent-news.vue new file mode 100644 index 00000000..779d20a5 --- /dev/null +++ b/front-end/mall4uni/src/pages/recent-news/recent-news.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/register/register.scss b/front-end/mall4uni/src/pages/register/register.scss new file mode 100644 index 00000000..fdbdd26d --- /dev/null +++ b/front-end/mall4uni/src/pages/register/register.scss @@ -0,0 +1,124 @@ +.con { + background: #fff; + height: 100%; + margin-top: 50px; +} +image { + display: block; + width: 150rpx; + height: 150rpx; + margin: auto; + border-radius: 50%; + width: 150rpx; + height: 150rpx; + margin-bottom: 8%; +} +.login-form { + width: 90%; + margin: 0 auto; + margin-bottom: 20%; +} +.authorized-btn { + width: 90%; + margin: 0 auto; + text-align: center; + background-color: #0ab906; + border: 1rpx solid #0ab906; + color: #fff; + border-radius: 6rpx; + font-size: 26rpx; + padding: 8rpx; + margin-top: 80rpx; + border: 1rpx solid #0ab906; + border-radius: 6rpx; + font-size: 26rpx; + padding: 8rpx; + margin-top: 80rpx; +} +.to-idx-btn { + width: 90%; + margin: 0 auto; + text-align: center; + background-color: #eeeeee; + color: #333; + border-radius: 6rpx; + font-size: 26rpx; + padding: 8rpx; + margin-top: 30rpx; + border-radius: 6rpx; + font-size: 26rpx; + padding: 8rpx; + margin-top: 30rpx; +} +.form-title { + width: 100%; + margin-bottom: 50rpx; + font-size: 32rpx; + text-align: center; + color: #00a0e9; + margin-bottom: 50rpx; + font-size: 32rpx; +} +.item { + display: block; + margin-bottom: 30rpx; + margin-bottom: 30rpx; +} +.account { + display: flex; + background: #f8f8f8; + padding: 15rpx; + box-sizing: border-box; + font-size: 26rpx; + align-items: center; + input { + padding-left: 20rpx; + width: 75%; + padding-left: 20rpx; + } +} +button { + &::after { + border: 0 !important; + } +} +.operate { + display: flex; + justify-content: space-between; + align-items: center; +} + +.to-register { + font-size: 28rpx; + color: #00AAFF; + font-size: 28rpx; +} +.error { + .error-text { + display: block; + width: 100%; + font-size: 28rpx; + color: #e43130; + text-align: left; + margin-top: 10rpx; + font-size: 28rpx; + margin-top: 10rpx; + .warning-icon { + display: inline-block; + color: #fff; + width: 26rpx; + height: 26rpx; + line-height: 26rpx; + background: #e43130; + border-radius: 50%; + text-align: center; + margin-right: 12rpx; + font-size: 22rpx; + width: 26rpx; + height: 26rpx; + line-height: 26rpx; + margin-right: 12rpx; + font-size: 22rpx; + } + } +} diff --git a/front-end/mall4uni/src/pages/register/register.vue b/front-end/mall4uni/src/pages/register/register.vue new file mode 100644 index 00000000..c03c8f3c --- /dev/null +++ b/front-end/mall4uni/src/pages/register/register.vue @@ -0,0 +1,166 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/search-page/search-page.scss b/front-end/mall4uni/src/pages/search-page/search-page.scss new file mode 100644 index 00000000..51687fda --- /dev/null +++ b/front-end/mall4uni/src/pages/search-page/search-page.scss @@ -0,0 +1,119 @@ +.search-bar { + width: 100%; + position: fixed; + top: 0; + left: 0; + color: #777; + background: #fff; + box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.07); + z-index: 3; + .search-box { + position: relative; + height: 60rpx; + background: #f7f7f7; + z-index: 999; + width: 80%; + margin-left: 70rpx; + border-radius: 50rpx; + margin: 20rpx 0 20rpx 20rpx; + .search-img { + width: 32rpx; + height: 32rpx; + position: absolute; + left: 20rpx; + top: 14rpx; + display: block; + } + } + .search-hint { + font-size: 28rpx; + position: absolute; + right: 30rpx; + top: 31rpx; + color: #eb2444; + } +} +.sear-input { + height: 60rpx; + border-radius: 50rpx; + border: 0; + margin: 0 30rpx 0 64rpx; + line-height: 48rpx; + vertical-align: top; + background: #f7f7f7; + font-size: 28rpx; +} +.search-display { + background: #fff; + padding: 20rpx; + margin-top: 100rpx; + .title-text { + padding: 30rpx 0; + font-size: 30rpx; + color: #666; + } +} +.hot-search { + .hot-search-tags { + overflow: hidden; + font-size: 26rpx; + text-align: center; + padding-bottom: 30rpx; + .tags { + display: block; + max-width: 100%; + overflow: hidden; + float: left; + border-radius: 50rpx; + white-space: nowrap; + text-overflow: ellipsis; + background-color: #f2f2f2; + box-sizing: border-box; + margin-right: 20rpx; + margin-bottom: 20rpx; + padding: 10rpx 30rpx; + } + } +} +.history-search { + .title-text.history-line { + position: relative; + border-top: 2rpx solid #e1e1e1; + } + .his-search-tags { + overflow: hidden; + font-size: 26rpx; + text-align: center; + display: inline-block; + .tags { + max-width: 300rpx; + overflow: hidden; + float: left; + border-radius: 50rpx; + white-space: nowrap; + text-overflow: ellipsis; + background-color: #f2f2f2; + box-sizing: border-box; + margin-right: 20rpx; + margin-bottom: 20rpx; + padding: 10rpx 30rpx; + } + } +} +.clear-history { + image { + width: 32rpx; + height: 32rpx; + position: absolute; + right: 10rpx; + top: 30rpx; + } +} +.search-tit-empty { + display: block; + margin: 0 auto; + text-align: center; + width: 100%; + font-size: 24rpx; + color: #aaa; +} diff --git a/front-end/mall4uni/src/pages/search-page/search-page.vue b/front-end/mall4uni/src/pages/search-page/search-page.vue new file mode 100644 index 00000000..bacaa842 --- /dev/null +++ b/front-end/mall4uni/src/pages/search-page/search-page.vue @@ -0,0 +1,183 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/search-prod-show/search-prod-show.scss b/front-end/mall4uni/src/pages/search-prod-show/search-prod-show.scss new file mode 100644 index 00000000..56b4bfbc --- /dev/null +++ b/front-end/mall4uni/src/pages/search-prod-show/search-prod-show.scss @@ -0,0 +1,186 @@ +.container { + background: #f4f4f4; + .empty { + text-align: center; + color: #999; + font-size: 26rpx; + } + .empty.empty-top { + margin-top: 300rpx; + } +} +.fixed-box { + position: fixed; + width: 100%; + top: 0; + z-index: 999; + background: #fff; + .tabs { + width: 100%; + height: 80rpx; + line-height: 80rpx; + padding: 10rpx 0; + z-index: 999; + background: #fff; + &::after { + content: ''; + background-color: #e1e1e1; + left: 0; + height: 1px; + transform-origin: 50% 100% 0; + bottom: 0; + position: absolute; + display: block; + width: 100%; + } + .tab-item { + display: inline-block; + width: 33.33%; + text-align: center; + font-size: 28rpx; + } + .tab-item.on { + color: #eb2444; + } + } +} +.search-bar { + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + color: #777; + background: #fff; + z-index: 3; + padding: 0 30rpx; + box-sizing: border-box; + margin: 30rpx 0; + .search-box { + position: relative; + height: 60rpx; + background: #f7f7f7; + z-index: 999; + width: 80%; + border-radius: 50rpx; + margin-right: 30rpx; + flex: 1; + .search-img { + width: 32rpx; + height: 32rpx; + position: absolute; + left: 20rpx; + top: 14rpx; + display: block; + } + } + .search-hint { + font-size: 28rpx; + position: absolute; + right: 30rpx; + top: 31rpx; + color: #eb2444; + } + .search-list-img { + width: 40rpx; + height: 40rpx; + font-size: 0; + image { + width: 100%; + height: 100%; + } + } +} +.sear-input { + height: 60rpx; + border-radius: 50rpx; + border: 0; + margin: 0 30rpx 0 64rpx; + line-height: 48rpx; + vertical-align: top; + background: #f7f7f7; + font-size: 28rpx; +} +.prod-show { + background: #fff; + .prod-items { + float: left; + background: #fff; + padding-bottom: 20rpx; + box-sizing: border-box; + } +} +.prod-items { + margin: 0 20rpx; +} +.hotsale-item-cont { + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} +.prod-list { + padding-top: 150rpx; + min-height: calc(100vh - 150rpx); + .cont-item { + padding: 0 20rpx 20rpx 20rpx; + .show-item { + .more-prod-pic { + text-align: center; + width: 170rpx; + height: 170rpx; + font-size: 0; + .more-pic { + width: 100%; + height: 100%; + vertical-align: middle; + } + } + position: relative; + display: flex; + justify-content: flex-start; + padding: 20rpx; + border-radius: 20rpx; + background: #fff; + margin-bottom: 20rpx; + box-shadow: 0 16rpx 32rpx 0 rgba(7, 17, 27, 0.05); + .prod-text-right { + margin-left: 20rpx; + width: 75%; + .cate-prod-info { + font-size: 22rpx; + color: #999; + margin: 10rpx 0 20rpx 0; + } + .go-to-buy { + font-size: 26rpx; + background: #eb2444; + color: #fff; + border-radius: 50rpx; + width: 150rpx; + text-align: center; + padding: 8rpx 3rpx; + position: absolute; + right: 20rpx; + bottom: 20rpx; + } + .prod-text.more { + margin: 0; + height: 78rpx; + font-size: 28rpx; + display: -webkit-box; + word-break: break-all; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + color: #000; + } + .prod-price.more { + font-size: 28rpx; + color: #eb2444; + font-family: arial; + } + } + } + } +} diff --git a/front-end/mall4uni/src/pages/search-prod-show/search-prod-show.vue b/front-end/mall4uni/src/pages/search-prod-show/search-prod-show.vue new file mode 100644 index 00000000..c41c9363 --- /dev/null +++ b/front-end/mall4uni/src/pages/search-prod-show/search-prod-show.vue @@ -0,0 +1,223 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/sub-category/sub-category.scss b/front-end/mall4uni/src/pages/sub-category/sub-category.scss new file mode 100644 index 00000000..93a63359 --- /dev/null +++ b/front-end/mall4uni/src/pages/sub-category/sub-category.scss @@ -0,0 +1,109 @@ +.container { + background: #f4f4f4; +} +.category-tit { + width: 100%; + white-space: nowrap; + position: fixed; + top: 0px; + z-index: 999; + background-color: #fff; + border-bottom: 2rpx solid #f4f4f4; + font-size: 30rpx; + .category-item { + display: inline-block; + padding: 20rpx 10rpx; + margin: 0 20rpx; + box-sizing: border-box; + font-size: 28rpx; + } +} +.prod-item { + height: calc(100vh - 100rpx); +} +.on { + border-bottom: 4rpx solid #e43130; + color: #e43130; +} +::-webkit-scrollbar { + width: 0; + height: 0; + color: transparent; +} +.empty { + margin-top: 200rpx; +} +.prod-items { + width: 345rpx; + display: inline-block; + background: #fff; + padding-bottom: 20rpx; + box-sizing: border-box; + box-shadow: 0rpx 6rpx 8rpx rgba(58,134,185,0.2); + &:nth-child(2n-1) { + margin: 20rpx 10rpx 10rpx 20rpx; + } + &:nth-child(2n) { + margin: 20rpx 20rpx 10rpx 10rpx; + } + .hot-imagecont { + .hotsaleimg { + width: 341rpx; + height: 341rpx; + } + font-size: 0; + text-align: center; + } + .hot-text { + .hotprod-text { + font-size: 28rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + margin-top: 20rpx; + padding: 0 10rpx; + .prod-info { + font-size: 22rpx; + color: #999; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + .prod-text-info { + position: relative; + height: 70rpx; + line-height: 70rpx; + font-family: Arial; + .hotprod-price { + display: inline; + font-size: 26rpx; + color: #eb2444; + } + .basket-img { + width: 50rpx; + height: 50rpx; + position: absolute; + right: 0; + bottom: 7rpx; + padding: 8rpx; + } + } + } +} +.more-prod { + .prod-text-right { + .prod-info { + font-size: 22rpx; + color: #999; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + } +} +.empty-wrap { + color: #aaa; + text-align: center; + padding-top: 400rpx; +} diff --git a/front-end/mall4uni/src/pages/sub-category/sub-category.vue b/front-end/mall4uni/src/pages/sub-category/sub-category.vue new file mode 100644 index 00000000..fa8ab783 --- /dev/null +++ b/front-end/mall4uni/src/pages/sub-category/sub-category.vue @@ -0,0 +1,177 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/submit-order/submit-order.scss b/front-end/mall4uni/src/pages/submit-order/submit-order.scss new file mode 100644 index 00000000..97eadec8 --- /dev/null +++ b/front-end/mall4uni/src/pages/submit-order/submit-order.scss @@ -0,0 +1,429 @@ +.container { + background: #f4f4f4; +} +.submit-order { + margin-bottom: 100rpx; + padding-bottom: 160rpx; + .delivery-addr { + position: relative; + background: #fff; + .addr-icon { + width: 32rpx; + height: 32rpx; + display: block; + position: absolute; + left: 30rpx; + top: 24rpx; + image { + width: 100%; + height: 100%; + } + } + .user-info { + padding-top: 20rpx; + line-height: 48rpx; + word-wrap: break-word; + word-break: break-all; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + .item { + font-size: 30rpx; + margin-right: 30rpx; + vertical-align: top; + display: inline-block; + } + } + .addr { + font-size: 26rpx; + line-height: 36rpx; + color: #999; + width: 90%; + padding-bottom: 20rpx; + margin-top: 15rpx; + word-wrap: break-word; + } + .arrow { + width: 15rpx; + height: 15rpx; + border-top: 2rpx solid #777; + border-right: 2rpx solid #777; + transform: rotate(45deg); + position: absolute; + right: 30rpx; + top: 60rpx; + } + .arrow.empty { + top: 39rpx; + } + } +} +.delivery-addr { + .addr-bg { + .add-addr { + .plus-sign { + color: #eb2444; + border: 2rpx solid #eb2444; + padding: 0rpx 6rpx; + margin-right: 10rpx; + } + font-size: 28rpx; + color: #666; + display: flex; + align-items: center; + padding: 30rpx 0; + } + padding: 0 30rpx; + } + .addr-bg.whole { + padding: 0 39rpx 0 77rpx; + } +} +.addr-bg { + .add-addr { + .plus-sign-img { + width: 32rpx; + height: 32rpx; + font-size: 0; + margin-right: 10rpx; + image { + width: 100%; + height: 100%; + } + } + } +} +.prod-item { + background-color: #fff; + margin-top: 15rpx; + font-size: 28rpx; + .item-cont { + .prod-pic { + image { + width: 180rpx; + height: 180rpx; + width: 100%; + height: 100%; + } + font-size: 0; + display: block; + width: 160rpx; + height: 160rpx; + overflow: hidden; + background: #fff; + margin-right: 16rpx; + } + display: flex; + align-items: center; + padding: 30rpx; + border-bottom: 2rpx solid #f1f1f1; + .prod-info { + margin-left: 10rpx; + font-size: 28rpx; + width: 100%; + position: relative; + height: 160rpx; + -webkit-flex: 1; + -ms-flex: 1; + -webkit-box-flex: 1; + -moz-box-flex: 1; + flex: 1; + .prodname { + font-size: 28rpx; + line-height: 40rpx; + max-height: 86rpx; + overflow: hidden; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + text-overflow: ellipsis; + word-break: break-all; + } + .prod-info-cont { + color: #999; + line-height: 40rpx; + margin-top: 10rpx; + font-size: 22rpx; + overflow: hidden; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + text-overflow: ellipsis; + word-break: break-all; + } + } + } + .order-num { + padding: 20rpx 30rpx; + display: flex; + justify-content: space-between; + font-size: 28rpx; + .clear-btn { + width: 32rpx; + height: 32rpx; + font-size: 0; + vertical-align: top; + margin-top: 6rpx; + margin-left: 42rpx; + position: relative; + &::after { + content: " "; + display: block; + position: absolute; + left: -10px; + top: 1px; + width: 1px; + height: 12px; + background: #ddd; + } + .clear-list-btn { + width: 100%; + height: 100%; + vertical-align: middle; + } + } + } + .total-num { + text-align: right; + padding: 20rpx 30rpx; + font-size: 28rpx; + .prodprice { + display: inline-block; + color: #333; + } + .prodcount { + margin-right: 20rpx; + } + } + .price-nums { + .prodprice { + position: absolute; + bottom: 0; + } + .prodcount { + position: absolute; + bottom: 5rpx; + right: 0; + color: #999; + font-family: verdana; + } + } +} +.order-state { + display: flex; + align-items: center; +} +.order-msg { + background: #fff; + margin-top: 15rpx; + padding: 0 30rpx; + font-size: 28rpx; + .msg-item { + border-top: 2rpx solid #f1f1f1; + &:first-child { + border: 0; + } + .item { + position: relative; + display: flex; + padding: 16rpx 0; + align-items: center; + .item-tit { + line-height: 48rpx; + } + .item-txt { + -webkit-box-flex: 1; + -moz-box-flex: 1; + flex: 1; + font-family: arial; + max-height: 48rpx; + overflow: hidden; + line-height: 48rpx; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + text-overflow: ellipsis; + word-break: break-all; + } + .item-txt.price { + padding: 0; + text-align: right; + } + input { + flex: 1; + } + .coupon-btn { + display: block; + margin: 0 30rpx; + line-height: 28rpx; + color: #999; + } + .arrow { + width: 15rpx; + height: 15rpx; + border-top: 2rpx solid #999; + border-right: 2rpx solid #999; + transform: rotate(45deg); + position: absolute; + right: 0rpx; + } + } + .item.payment { + border-top: 2rpx solid #f1f1f1; + color: #eb2444; + } + .item.coupon { + border-bottom: 2rpx solid #e1e1e1; + } + } +} +.submit-order-footer { + position: fixed; + bottom: 0; + width: 100%; + max-width: 750rpx; + background: #fff; + margin: auto; + display: -webkit-flex; + display: -webkit-box; + display: -moz-box; + display: -ms-flexbox; + display: flex; + font-size: 26rpx; + box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05); + .sub-order { + flex: 1; + margin: 0 30rpx; + line-height: 100rpx; + display: block; + text-align: left; + font-size: 28rpx; + .item-txt { + .price { + display: inline; + color: #eb2444; + font-size: 28rpx; + } + } + } + .footer-box { + padding: 0 10rpx; + width: 200rpx; + background: #eb2444; + text-align: center; + line-height: 100rpx; + color: #fff; + } +} +.clearfix { + &:after { + content: " "; + display: table; + clear: both; + } +} +.popup-hide { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + z-index: 999; + background-color: rgba(0, 0, 0, 0.3); +} +.popup-box { + position: absolute; + bottom: 0; + width: 100%; + height: 80%; + overflow: hidden; + background-color: #fff; +} +.popup-tit { + position: relative; + height: 46px; + line-height: 46px; + padding-left: 10px; + font-size: 16px; + color: #333; + font-weight: bold; +} +.close { + color: #aaa; + border-radius: 12px; + line-height: 20px; + text-align: center; + height: 20px; + width: 20px; + font-size: 18px; + padding: 1px; + top: 10px; + right: 10px; + position: absolute; + &::before { + content: "\2716"; + } +} +.coupon-tabs { + display: flex; + font-size: 14px; + justify-content: space-around; + border-bottom: 1px solid #f2f2f2; +} +.coupon-tab { + padding: 10px 0; +} +.coupon-tab.on { + border-bottom: 2px solid #eb2444; + font-weight: 600; +} +.popup-cnt { + height: calc(100% - 88px); + overflow: auto; + padding: 0 10px; + background: #f4f4f4; +} +.coupon-ok { + position: fixed; + bottom: 0; + width: 100%; + height: 60px; + line-height: 50px; + font-size: 14px; + text-align: center; + box-shadow: 0px -1px 1px #ddd; + text { + border-radius: 20px; + display: inline-block; + height: 20px; + line-height: 20px; + width: 450rpx; + padding: 7px; + color: #fff; + box-shadow: -1px 3px 3px #aaa; + } +} +.botm-empty { + height: 60px; +} +checkbox { + .wx-checkbox-input { + border-radius: 50%; + width: 35rpx; + height: 35rpx; + } + .wx-checkbox-input.wx-checkbox-input-checked { + background: #eb2444; + border-color: #eb2444; + &::before { + text-align: center; + font-size: 22rpx; + color: #fff; + background: transparent; + transform: translate(-50%, -50%) scale(1); + -webkit-transform: translate(-50%, -50%) scale(1); + } + } +} diff --git a/front-end/mall4uni/src/pages/submit-order/submit-order.vue b/front-end/mall4uni/src/pages/submit-order/submit-order.vue new file mode 100644 index 00000000..166ad64c --- /dev/null +++ b/front-end/mall4uni/src/pages/submit-order/submit-order.vue @@ -0,0 +1,527 @@ + + + + + diff --git a/front-end/mall4uni/src/pages/user/user.scss b/front-end/mall4uni/src/pages/user/user.scss new file mode 100644 index 00000000..c5e82dcf --- /dev/null +++ b/front-end/mall4uni/src/pages/user/user.scss @@ -0,0 +1,222 @@ +.container { + background-color: #f7f7f7; + padding-bottom: 60rpx; +} +.userinfo { + position: relative; + width: 100%; + background: #fff; + text-align: center; + padding: 30rpx 0; + .userinfo-con { + width: 240rpx; + margin: auto; + .userinfo-avatar { + overflow: hidden; + display: block; + width: 160rpx; + height: 160rpx; + border-radius: 50%; + box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2); + margin: auto; + image { + width: 160rpx; + height: 160rpx; + } + } + .userinfo-name { + font-size: 30rpx; + font-weight: bold; + margin-top: 20rpx; + overflow: hidden; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + text-overflow: ellipsis; + word-break: break-all; + } + } +} +.userinfo-none { + display: flex; + padding: 30rpx; + background: #fff; + align-items: center; + .default-pic { + padding-right: 30rpx; + image { + width: 160rpx; + height: 160rpx; + } + } +} +.none-login { + button { + background: #fff; + &::after { + border: 0; + } + } + .unlogin { + font-size: 30rpx; + text-align: left; + padding: 0; + } + .click-login { + font-size: 26rpx; + color: #777; + text-align: left; + padding: 0; + } +} +.binding-phone { + position: relative; + background: #fff; + height: 80rpx; + line-height: 80rpx; + padding: 0 30rpx; + border-top: 2rpx solid #f7f7f7; + border-bottom: 2rpx solid #f7f7f7; + .show-tip { + font-size: 26rpx; + } + .gotobinding { + border-radius: 8rpx; + font-size: 28rpx; + color: #e24b4b; + font-weight: bold; + } +} +.list-cont { + width: 100%; + background: #f7f7f7; + margin-top: 20rpx; + .total-order { + background: #fff; + .order-tit { + display: flex; + justify-content: space-between; + height: 80rpx; + line-height: 80rpx; + font-size: 30rpx; + border-bottom: 1px solid #f7f7f7; + padding: 0 30rpx; + .checkmore { + font-size: 22rpx; + color: #80848f; + display: flex; + align-items: center; + } + } + .procedure { + display: flex; + justify-content: space-around; + align-items: center; + font-size: 25rpx; + height: 160rpx; + .items { + position: relative; + display: flex; + flex-direction: column; + align-items: center; + image { + width: 70rpx; + height: 70rpx; + margin-bottom: 20rpx; + } + .num-badge { + position: absolute; + top: -15rpx; + right: -12rpx; + color: #eb2444; + border: 3rpx solid #eb2444; + border-radius: 50rpx; + background: #fff; + min-width: 30rpx; + height: 30rpx; + line-height: 30rpx; + text-align: center; + padding: 2rpx; + display: block; + } + } + } + } + .my-menu { + background-color: #fff; + margin-top: 20rpx; + .memu-item { + display: flex; + align-items: center; + justify-content: space-between; + height: 100rpx; + border-bottom: 2rpx solid #f7f7f7; + padding: 0 30rpx; + &:nth-child(1) { + border-top: 2rpx solid #f7f7f7; + } + &:last-child { + border-bottom: none; + } + text { + font-size: 28rpx; + } + image { + width: 50rpx; + height: 50rpx; + margin-right: 20rpx; + } + .i-name { + display: flex; + align-items: center; + } + } + } +} +.arrowhead { + width: 15rpx; + height: 15rpx; + border-top: 2rpx solid #999; + border-right: 2rpx solid #999; + transform: rotate(45deg); + margin-left: 10rpx; +} +.prod-col { + margin-top: 20rpx; + background: #fff; + display: flex; + justify-content: space-around; + padding: 30rpx 0 10rpx 0; + font-size: 12px; + .col-item { + text-align: center; + .num { + font-size: 16px; + font-weight: 700; + color: #3a86b9; + } + .tit { + line-height: 34px; + } + } +} +.log-out { + padding: 20rpx; + text-align: center; + margin-top: 20rpx; +} +.log-out-n { + font-size: 30rpx; + margin: auto; + width: 200rpx; + padding: 20rpx; + border-radius: 10rpx; + background: #e43130; + color: #ffffff; +} +button.memu-btn.memu-item { + background-color: #fff; + &:after { + border: 0; + } +} diff --git a/front-end/mall4uni/src/pages/user/user.vue b/front-end/mall4uni/src/pages/user/user.vue new file mode 100644 index 00000000..51aed0b3 --- /dev/null +++ b/front-end/mall4uni/src/pages/user/user.vue @@ -0,0 +1,375 @@ + + + + + diff --git a/front-end/mall4uni/src/static/images/icon/addr.png b/front-end/mall4uni/src/static/images/icon/addr.png new file mode 100644 index 00000000..101f3251 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/addr.png differ diff --git a/front-end/mall4uni/src/static/images/icon/bg1.png b/front-end/mall4uni/src/static/images/icon/bg1.png new file mode 100644 index 00000000..bb679f95 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/bg1.png differ diff --git a/front-end/mall4uni/src/static/images/icon/car-new.png b/front-end/mall4uni/src/static/images/icon/car-new.png new file mode 100644 index 00000000..2a25e25b Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/car-new.png differ diff --git a/front-end/mall4uni/src/static/images/icon/car.png b/front-end/mall4uni/src/static/images/icon/car.png new file mode 100644 index 00000000..6834595d Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/car.png differ diff --git a/front-end/mall4uni/src/static/images/icon/clear-his.png b/front-end/mall4uni/src/static/images/icon/clear-his.png new file mode 100644 index 00000000..31780e67 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/clear-his.png differ diff --git a/front-end/mall4uni/src/static/images/icon/coupon-ot.png b/front-end/mall4uni/src/static/images/icon/coupon-ot.png new file mode 100644 index 00000000..0e1939d8 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/coupon-ot.png differ diff --git a/front-end/mall4uni/src/static/images/icon/coupon-used.png b/front-end/mall4uni/src/static/images/icon/coupon-used.png new file mode 100644 index 00000000..1c70631f Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/coupon-used.png differ diff --git a/front-end/mall4uni/src/static/images/icon/def.png b/front-end/mall4uni/src/static/images/icon/def.png new file mode 100644 index 00000000..75766ae3 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/def.png differ diff --git a/front-end/mall4uni/src/static/images/icon/delive-dot.png b/front-end/mall4uni/src/static/images/icon/delive-dot.png new file mode 100644 index 00000000..0573a755 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/delive-dot.png differ diff --git a/front-end/mall4uni/src/static/images/icon/delivery-car.png b/front-end/mall4uni/src/static/images/icon/delivery-car.png new file mode 100644 index 00000000..7fdd500f Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/delivery-car.png differ diff --git a/front-end/mall4uni/src/static/images/icon/dot.png b/front-end/mall4uni/src/static/images/icon/dot.png new file mode 100644 index 00000000..c0920039 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/dot.png differ diff --git a/front-end/mall4uni/src/static/images/icon/empty-cash.png b/front-end/mall4uni/src/static/images/icon/empty-cash.png new file mode 100644 index 00000000..860e9ae7 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/empty-cash.png differ diff --git a/front-end/mall4uni/src/static/images/icon/everydaySale.png b/front-end/mall4uni/src/static/images/icon/everydaySale.png new file mode 100644 index 00000000..b0c869c7 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/everydaySale.png differ diff --git a/front-end/mall4uni/src/static/images/icon/getCoupon.png b/front-end/mall4uni/src/static/images/icon/getCoupon.png new file mode 100644 index 00000000..fbe22f56 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/getCoupon.png differ diff --git a/front-end/mall4uni/src/static/images/icon/head04.png b/front-end/mall4uni/src/static/images/icon/head04.png new file mode 100644 index 00000000..c64a4013 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/head04.png differ diff --git a/front-end/mall4uni/src/static/images/icon/horn.png b/front-end/mall4uni/src/static/images/icon/horn.png new file mode 100644 index 00000000..ae9279b3 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/horn.png differ diff --git a/front-end/mall4uni/src/static/images/icon/menu-01.png b/front-end/mall4uni/src/static/images/icon/menu-01.png new file mode 100644 index 00000000..54f7aab9 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/menu-01.png differ diff --git a/front-end/mall4uni/src/static/images/icon/menu-02.png b/front-end/mall4uni/src/static/images/icon/menu-02.png new file mode 100644 index 00000000..450cdd6c Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/menu-02.png differ diff --git a/front-end/mall4uni/src/static/images/icon/menu-03.png b/front-end/mall4uni/src/static/images/icon/menu-03.png new file mode 100644 index 00000000..fcce049f Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/menu-03.png differ diff --git a/front-end/mall4uni/src/static/images/icon/menu-04.png b/front-end/mall4uni/src/static/images/icon/menu-04.png new file mode 100644 index 00000000..d3ec6d9c Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/menu-04.png differ diff --git a/front-end/mall4uni/src/static/images/icon/more.png b/front-end/mall4uni/src/static/images/icon/more.png new file mode 100644 index 00000000..3baecd20 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/more.png differ diff --git a/front-end/mall4uni/src/static/images/icon/myAddr.png b/front-end/mall4uni/src/static/images/icon/myAddr.png new file mode 100644 index 00000000..b007c4fd Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/myAddr.png differ diff --git a/front-end/mall4uni/src/static/images/icon/myCoupon.png b/front-end/mall4uni/src/static/images/icon/myCoupon.png new file mode 100644 index 00000000..b45fee73 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/myCoupon.png differ diff --git a/front-end/mall4uni/src/static/images/icon/newProd.png b/front-end/mall4uni/src/static/images/icon/newProd.png new file mode 100644 index 00000000..67b45048 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/newProd.png differ diff --git a/front-end/mall4uni/src/static/images/icon/neweveryday.png b/front-end/mall4uni/src/static/images/icon/neweveryday.png new file mode 100644 index 00000000..483bd3c2 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/neweveryday.png differ diff --git a/front-end/mall4uni/src/static/images/icon/newprods.png b/front-end/mall4uni/src/static/images/icon/newprods.png new file mode 100644 index 00000000..d885b349 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/newprods.png differ diff --git a/front-end/mall4uni/src/static/images/icon/plus-sign.png b/front-end/mall4uni/src/static/images/icon/plus-sign.png new file mode 100644 index 00000000..b1d39151 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/plus-sign.png differ diff --git a/front-end/mall4uni/src/static/images/icon/prod-col-red.png b/front-end/mall4uni/src/static/images/icon/prod-col-red.png new file mode 100644 index 00000000..14374076 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/prod-col-red.png differ diff --git a/front-end/mall4uni/src/static/images/icon/prod-col.png b/front-end/mall4uni/src/static/images/icon/prod-col.png new file mode 100644 index 00000000..8a03d7e1 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/prod-col.png differ diff --git a/front-end/mall4uni/src/static/images/icon/promotion.png b/front-end/mall4uni/src/static/images/icon/promotion.png new file mode 100644 index 00000000..480652bc Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/promotion.png differ diff --git a/front-end/mall4uni/src/static/images/icon/revise.png b/front-end/mall4uni/src/static/images/icon/revise.png new file mode 100644 index 00000000..f3bb4806 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/revise.png differ diff --git a/front-end/mall4uni/src/static/images/icon/search-01.png b/front-end/mall4uni/src/static/images/icon/search-01.png new file mode 100644 index 00000000..99eb77a6 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/search-01.png differ diff --git a/front-end/mall4uni/src/static/images/icon/search-col.png b/front-end/mall4uni/src/static/images/icon/search-col.png new file mode 100644 index 00000000..587c2bf7 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/search-col.png differ diff --git a/front-end/mall4uni/src/static/images/icon/search-col2.png b/front-end/mall4uni/src/static/images/icon/search-col2.png new file mode 100644 index 00000000..cdd35fb0 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/search-col2.png differ diff --git a/front-end/mall4uni/src/static/images/icon/search.png b/front-end/mall4uni/src/static/images/icon/search.png new file mode 100644 index 00000000..feac7b93 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/search.png differ diff --git a/front-end/mall4uni/src/static/images/icon/star-empty.png b/front-end/mall4uni/src/static/images/icon/star-empty.png new file mode 100644 index 00000000..47889cab Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/star-empty.png differ diff --git a/front-end/mall4uni/src/static/images/icon/star-red.png b/front-end/mall4uni/src/static/images/icon/star-red.png new file mode 100644 index 00000000..2c3efcd8 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/star-red.png differ diff --git a/front-end/mall4uni/src/static/images/icon/timePrice.png b/front-end/mall4uni/src/static/images/icon/timePrice.png new file mode 100644 index 00000000..6d98d4e1 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/timePrice.png differ diff --git a/front-end/mall4uni/src/static/images/icon/toComment.png b/front-end/mall4uni/src/static/images/icon/toComment.png new file mode 100644 index 00000000..117b507d Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/toComment.png differ diff --git a/front-end/mall4uni/src/static/images/icon/toDelivery.png b/front-end/mall4uni/src/static/images/icon/toDelivery.png new file mode 100644 index 00000000..5b879a47 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/toDelivery.png differ diff --git a/front-end/mall4uni/src/static/images/icon/toPay.png b/front-end/mall4uni/src/static/images/icon/toPay.png new file mode 100644 index 00000000..7eb0499a Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/toPay.png differ diff --git a/front-end/mall4uni/src/static/images/icon/toTake.png b/front-end/mall4uni/src/static/images/icon/toTake.png new file mode 100644 index 00000000..84255db1 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/toTake.png differ diff --git a/front-end/mall4uni/src/static/images/icon/tuiguang01.png b/front-end/mall4uni/src/static/images/icon/tuiguang01.png new file mode 100644 index 00000000..0b7d0860 Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/tuiguang01.png differ diff --git a/front-end/mall4uni/src/static/images/icon/tuiguang02.png b/front-end/mall4uni/src/static/images/icon/tuiguang02.png new file mode 100644 index 00000000..87aba09e Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/tuiguang02.png differ diff --git a/front-end/mall4uni/src/static/images/icon/tuiguang03.png b/front-end/mall4uni/src/static/images/icon/tuiguang03.png new file mode 100644 index 00000000..a3832d1a Binary files /dev/null and b/front-end/mall4uni/src/static/images/icon/tuiguang03.png differ diff --git a/front-end/mall4uni/src/static/images/tabbar/basket-sel.png b/front-end/mall4uni/src/static/images/tabbar/basket-sel.png new file mode 100644 index 00000000..da0b48af Binary files /dev/null and b/front-end/mall4uni/src/static/images/tabbar/basket-sel.png differ diff --git a/front-end/mall4uni/src/static/images/tabbar/basket.png b/front-end/mall4uni/src/static/images/tabbar/basket.png new file mode 100644 index 00000000..5e05262e Binary files /dev/null and b/front-end/mall4uni/src/static/images/tabbar/basket.png differ diff --git a/front-end/mall4uni/src/static/images/tabbar/category-sel.png b/front-end/mall4uni/src/static/images/tabbar/category-sel.png new file mode 100644 index 00000000..489b7354 Binary files /dev/null and b/front-end/mall4uni/src/static/images/tabbar/category-sel.png differ diff --git a/front-end/mall4uni/src/static/images/tabbar/category.png b/front-end/mall4uni/src/static/images/tabbar/category.png new file mode 100644 index 00000000..937e8029 Binary files /dev/null and b/front-end/mall4uni/src/static/images/tabbar/category.png differ diff --git a/front-end/mall4uni/src/static/images/tabbar/homepage-sel.png b/front-end/mall4uni/src/static/images/tabbar/homepage-sel.png new file mode 100644 index 00000000..6b8fc0a6 Binary files /dev/null and b/front-end/mall4uni/src/static/images/tabbar/homepage-sel.png differ diff --git a/front-end/mall4uni/src/static/images/tabbar/homepage.png b/front-end/mall4uni/src/static/images/tabbar/homepage.png new file mode 100644 index 00000000..622fcfec Binary files /dev/null and b/front-end/mall4uni/src/static/images/tabbar/homepage.png differ diff --git a/front-end/mall4uni/src/static/images/tabbar/user-sel.png b/front-end/mall4uni/src/static/images/tabbar/user-sel.png new file mode 100644 index 00000000..954b222c Binary files /dev/null and b/front-end/mall4uni/src/static/images/tabbar/user-sel.png differ diff --git a/front-end/mall4uni/src/static/images/tabbar/user.png b/front-end/mall4uni/src/static/images/tabbar/user.png new file mode 100644 index 00000000..451d0dcb Binary files /dev/null and b/front-end/mall4uni/src/static/images/tabbar/user.png differ diff --git a/front-end/mall4uni/src/static/logo.png b/front-end/mall4uni/src/static/logo.png new file mode 100644 index 00000000..671753ec Binary files /dev/null and b/front-end/mall4uni/src/static/logo.png differ diff --git a/front-end/mall4uni/src/static/screenshot/index.jpg b/front-end/mall4uni/src/static/screenshot/index.jpg new file mode 100644 index 00000000..adffb737 Binary files /dev/null and b/front-end/mall4uni/src/static/screenshot/index.jpg differ diff --git a/front-end/mall4uni/src/static/screenshot/my.jpg b/front-end/mall4uni/src/static/screenshot/my.jpg new file mode 100644 index 00000000..5e3eddfc Binary files /dev/null and b/front-end/mall4uni/src/static/screenshot/my.jpg differ diff --git a/front-end/mall4uni/src/static/screenshot/prodInfo.jpg b/front-end/mall4uni/src/static/screenshot/prodInfo.jpg new file mode 100644 index 00000000..af79c988 Binary files /dev/null and b/front-end/mall4uni/src/static/screenshot/prodInfo.jpg differ diff --git a/front-end/mall4uni/src/static/screenshot/shopCart.jpg b/front-end/mall4uni/src/static/screenshot/shopCart.jpg new file mode 100644 index 00000000..c920e75a Binary files /dev/null and b/front-end/mall4uni/src/static/screenshot/shopCart.jpg differ diff --git a/front-end/mall4uni/src/static/screenshot/sku.jpg b/front-end/mall4uni/src/static/screenshot/sku.jpg new file mode 100644 index 00000000..b42bea44 Binary files /dev/null and b/front-end/mall4uni/src/static/screenshot/sku.jpg differ diff --git a/front-end/mall4uni/src/static/screenshot/uniappCart.png b/front-end/mall4uni/src/static/screenshot/uniappCart.png new file mode 100644 index 00000000..995f4eb8 Binary files /dev/null and b/front-end/mall4uni/src/static/screenshot/uniappCart.png differ diff --git a/front-end/mall4uni/src/static/screenshot/uniappIndex.png b/front-end/mall4uni/src/static/screenshot/uniappIndex.png new file mode 100644 index 00000000..f7c6aa65 Binary files /dev/null and b/front-end/mall4uni/src/static/screenshot/uniappIndex.png differ diff --git a/front-end/mall4uni/src/static/screenshot/uniappInfo.png b/front-end/mall4uni/src/static/screenshot/uniappInfo.png new file mode 100644 index 00000000..58d1845d Binary files /dev/null and b/front-end/mall4uni/src/static/screenshot/uniappInfo.png differ diff --git a/front-end/mall4uni/src/static/screenshot/uniappMy.png b/front-end/mall4uni/src/static/screenshot/uniappMy.png new file mode 100644 index 00000000..7210c8bd Binary files /dev/null and b/front-end/mall4uni/src/static/screenshot/uniappMy.png differ diff --git a/front-end/mall4uni/src/static/screenshot/uniappSku.png b/front-end/mall4uni/src/static/screenshot/uniappSku.png new file mode 100644 index 00000000..e368446b Binary files /dev/null and b/front-end/mall4uni/src/static/screenshot/uniappSku.png differ diff --git a/front-end/mall4uni/src/uni.scss b/front-end/mall4uni/src/uni.scss new file mode 100644 index 00000000..5df2b3c3 --- /dev/null +++ b/front-end/mall4uni/src/uni.scss @@ -0,0 +1,76 @@ +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ + +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ + +/* 颜色变量 */ + +/* 行为相关颜色 */ +$uni-color-primary: #007aff; +$uni-color-success: #4cd964; +$uni-color-warning: #f0ad4e; +$uni-color-error: #dd524d; + +/* 文字基本颜色 */ +$uni-text-color: #333; // 基本色 +$uni-text-color-inverse: #fff; // 反色 +$uni-text-color-grey: #999; // 辅助灰色,如加载更多的提示信息 +$uni-text-color-placeholder: #808080; +$uni-text-color-disable: #c0c0c0; + +/* 背景颜色 */ +$uni-bg-color: #fff; +$uni-bg-color-grey: #f8f8f8; +$uni-bg-color-hover: #f1f1f1; // 点击状态颜色 +$uni-bg-color-mask: rgba(0, 0, 0, 0.4); // 遮罩颜色 + +/* 边框颜色 */ +$uni-border-color: #c8c7cc; + +/* 尺寸变量 */ + +/* 文字尺寸 */ +$uni-font-size-sm: 12px; +$uni-font-size-base: 14px; +$uni-font-size-lg: 16; + +/* 图片尺寸 */ +$uni-img-size-sm: 20px; +$uni-img-size-base: 26px; +$uni-img-size-lg: 40px; + +/* Border Radius */ +$uni-border-radius-sm: 2px; +$uni-border-radius-base: 3px; +$uni-border-radius-lg: 6px; +$uni-border-radius-circle: 50%; + +/* 水平间距 */ +$uni-spacing-row-sm: 5px; +$uni-spacing-row-base: 10px; +$uni-spacing-row-lg: 15px; + +/* 垂直间距 */ +$uni-spacing-col-sm: 4px; +$uni-spacing-col-base: 8px; +$uni-spacing-col-lg: 12px; + +/* 透明度 */ +$uni-opacity-disabled: 0.3; // 组件禁用态的透明度 + +/* 文章场景相关 */ +$uni-color-title: #2c405a; // 文章标题颜色 +$uni-font-size-title: 20px; +$uni-color-subtitle: #555; // 二级标题颜色 +$uni-font-size-subtitle: 18px; +$uni-color-paragraph: #3f536e; // 文章段落颜色 +$uni-font-size-paragraph: 15px; \ No newline at end of file diff --git a/front-end/mall4uni/src/utils/constant.js b/front-end/mall4uni/src/utils/constant.js new file mode 100644 index 00000000..84c01f4a --- /dev/null +++ b/front-end/mall4uni/src/utils/constant.js @@ -0,0 +1,23 @@ +export const PayType = { + SCOREPAY: 0, // 积分支付 + WECHATPAY: 1, // 小程序支付 + ALIPAY: 2, // 支付宝支付 + WECHATPAY_SWEEP_CODE: 3, // 微信扫码支付 + WECHATPAY_H5: 4, // 微信H5支付 + WECHATPAY_MP: 5, // 微信公众号支付 + ALIPAY_H5: 6, // 支付宝H5支付 + ALIPAY_APP: 7, // 支付宝APP支付 + WECHATPAY_APP: 8, // 微信APP支付 + BALANCEPAY: 9 // 余额支付 +} + +export const AppType = { + MINI: 1, // 小程序 + MP: 2, // 微信公众号 + PC: 3, // pc + H5: 4, // h5 + ANDROID: 5, // 安卓 + IOS: 6, // 苹果 + ALI: 7, // 支付宝H5 + ALIMINI: 8 // 支付宝小程序 +} diff --git a/front-end/mall4uni/src/utils/crypto.js b/front-end/mall4uni/src/utils/crypto.js new file mode 100644 index 00000000..7af45874 --- /dev/null +++ b/front-end/mall4uni/src/utils/crypto.js @@ -0,0 +1,11 @@ +import CryptoJS from 'crypto-js' +// 加密 +const keyStr = '-mall4j-password' // 解密用的key +export function encrypt (word) { + const time = Date.now() + + const key = CryptoJS.enc.Utf8.parse(keyStr) + const srcs = CryptoJS.enc.Utf8.parse(time + word) // 加密方式: 时间戳 + 密文 + const encrypted = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 }) + return encrypted.toString() +} diff --git a/front-end/mall4uni/src/utils/http.js b/front-end/mall4uni/src/utils/http.js new file mode 100644 index 00000000..f4dbb865 --- /dev/null +++ b/front-end/mall4uni/src/utils/http.js @@ -0,0 +1,162 @@ +/* eslint-disable no-console */ +// 全局请求封装 +import loginMethods from './login' + +const http = { + request: async function (params) { + // 请求参数处理 + if (Object.prototype.toString.call(params.data) === '[object Array]') { + params.data = JSON.stringify(params.data) + } else if (Object.prototype.toString.call(params.data) === '[object Number]') { + params.data = params.data + '' + } + + // 刷新token + if (!params.login && !getApp()?.globalData.isLanding && !params.isRefreshing) { + await loginMethods.refreshToken() + } + // 发起请求 + return new Promise((resolve, reject) => { + uni.request({ + dataType: 'json', + responseType: params.responseType === undefined ? 'text' : params.responseType, + header: { + Authorization: uni.getStorageSync('Token') + }, + url: (params.domain ? params.domain : import.meta.env.VITE_APP_BASE_API) + params.url, + data: params.data, + method: params.method === undefined ? 'POST' : params.method, + success: (res) => { + const responseData = res.data + + // 请求小程序码 + if (params.responseType === 'arraybuffer' && res.statusCode === 200) { + return resolve(responseData) + } + + // 00000 请求成功 + // A00002 用于直接显示提示系统的成功,内容由输入决定 + if (responseData.code === '00000' || responseData.code === 'A00002') { + resolve(responseData) + } + // A00004 未授权 + if (responseData.code === 'A00004') { + // 重设登录后跳转地址 + loginMethods.setRouteUrlAfterLogin() + uni.removeStorageSync('expiresTimeStamp') + uni.removeStorageSync('loginResult') + uni.removeStorageSync('Token') + if (!params.dontTrunLogin) { + uni.showModal({ + title: '提示', + content: uni.getStorageSync('hadLogin') ? '登录已过期,请重新登陆!' : '请先进行登录!', + cancelText: '取消', + confirmText: '确定', + success: res => { + if (res.confirm) { + uni.navigateTo({ + url: '/pages/accountLogin/accountLogin' + }) + } else { + const router = getCurrentPages() + if (router[0].route === 'pages/basket/basket') { + uni.switchTab({ + url: '/pages/index/index' + }) + } + } + } + }) + } + resolve(responseData) + } + + // A00005 服务器出了点小差 + if (responseData.code === 'A00005') { + this.onRequestFail(params, responseData) + uni.showToast({ + title: '服务器出了点小差~', + icon: 'none' + }) + } + + // 其他异常码 + // A00001 用于直接显示提示用户的错误,内容由输入内容决定 + // A04001 社交账号未绑定 + // A00012 tempUid错误 + // A00006 验证码错误 + if (responseData.code === 'A04001' || responseData.code === 'A00001' || responseData.code === 'A00012' || responseData.code === 'A00006') { + if (!params.hasCatch) { + uni.showToast({ + title: responseData.msg || responseData.data || 'Error', + icon: 'none' + }) + } + } + + if (responseData.code !== '00000') { + reject(responseData) + } + }, + fail: (err) => { + uni.showToast({ + title: '请求失败' + }) + reject(err) + } + }) + }) + }, + getCartCount: () => { + if (!uni.getStorageSync('Token')) { + util.removeTabBadge() + return + } + http.request({ + url: '/p/shopCart/prodCount', + method: 'GET', + dontTrunLogin: true, + data: {} + }) + .then(({ data }) => { + if (data > 0) { + uni.setTabBarBadge({ + index: 2, + text: data + '' + }) + getApp().globalData.totalCartCount = data + } else { + uni.removeTabBarBadge({ + index: 2 + }) + getApp().globalData.totalCartCount = 0 + } + }) + }, + onRequestFail: (params, responseData) => { + console.error('============== 请求异常 ==============') + console.log('接口地址: ', params.url) + console.log('异常信息: ', responseData) + console.error('============== 请求异常 end ==========') + }, + /** + * 登录成功后执行 + * @param {Object} result 登录成功返回的数据 + * @param {Object} fn 登录成功后的回调 + */ + loginSuccess: (result, fn) => { + // 保存登陆信息 + wx.setStorageSync('loginResult', result) + // 保存成功登录标识,token过期判断 + wx.setStorageSync('hadLogin', true) + const expiresTimeStamp = result.expiresIn * 1000 / 2 + new Date().getTime() + // 缓存token的过期时间 + uni.setStorageSync('expiresTimeStamp', expiresTimeStamp) + + wx.setStorageSync('Token', result.accessToken) // 把token存入缓存,请求接口数据时要用 + if (fn) { + fn() + } + } +} +export default http diff --git a/front-end/mall4uni/src/utils/login.js b/front-end/mall4uni/src/utils/login.js new file mode 100644 index 00000000..2a5a458a --- /dev/null +++ b/front-end/mall4uni/src/utils/login.js @@ -0,0 +1,40 @@ +const loginMethods = { + /** + * 刷新token + */ + refreshToken: () => { + const expiresTimeStamp = uni.getStorageSync('expiresTimeStamp') + if (!uni.getStorageSync('Token') || !expiresTimeStamp) return + const isExpires = expiresTimeStamp < new Date().getTime() + const isRefreshing = uni.getStorageSync('isRefreshingToken') + if (!isExpires || isRefreshing) { + return + } + uni.setStorageSync('isRefreshingToken', true) + http.request({ + url: '/token/refresh', + method: 'POST', + login: true, + isRefreshing: true, + dontTrunLogin: true + }).then(res => { + uni.setStorageSync('isRefreshingToken', false) + uni.setStorageSync('expiresTimeStamp', res.data * 1000 / 2 + new Date().getTime()) + }).catch(() => { + uni.setStorageSync('isRefreshingToken', false) + }) + }, + + /** + * 设置登录后的跳转地址 + */ + setRouteUrlAfterLogin: () => { + const pages = getCurrentPages() + // 登录后的回跳地址 + if (pages[pages.length - 1].route.indexOf('user-login') === -1) { + uni.setStorageSync('routeUrlAfterLogin', pages[pages.length - 1].$page.fullPath) + } + } +} + +export default loginMethods diff --git a/front-end/mall4uni/src/utils/util.js b/front-end/mall4uni/src/utils/util.js new file mode 100644 index 00000000..553e5bb4 --- /dev/null +++ b/front-end/mall4uni/src/utils/util.js @@ -0,0 +1,65 @@ +const util = { + formatTime: date => { + const year = date.getFullYear() + const month = date.getMonth() + 1 + const day = date.getDate() + const hour = date.getHours() + const minute = date.getMinutes() + const second = date.getSeconds() + return [year, month, day].map(util.formatNumber).join('/') + ' ' + [hour, minute, second].map(util.formatNumber).join(':') + }, + + formatNumber: n => { + n = n.toString() + return n[1] ? n : '0' + n + }, + + formatHtml: content => { + if (!content) { + return + } + content = content.replace(/

') + return content + }, + + /** + * 移除购物车Tabbar的数字 + */ + removeTabBadge: () => { + uni.removeTabBarBadge({ + index: 3 + }) + }, + /** + * 获取链接上的参数 + */ + getUrlKey: (name) => { + return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || ['', ''])[1] + .replace(/\+/g, '%20')) || null + }, + /** + * 文件地址校验 + * @param fileUrl 获取到的文件路径 + */ + checkFileUrl: (fileUrl) => { + // 防止 fileUrl 为null时 indexOf() 方法失效报错 + const url = fileUrl || '' + const baseUrl = import.meta.env.VITE_APP_RESOURCES_URL + // 判断 fileUrl 中是否已存在基础路径 + const check = url.indexOf(baseUrl) !== -1 + if (check || !fileUrl) { + return url + } else { + return baseUrl + url + } + } +} + +export default util diff --git a/front-end/mall4uni/src/wxs/number.js b/front-end/mall4uni/src/wxs/number.js new file mode 100644 index 00000000..457ddcba --- /dev/null +++ b/front-end/mall4uni/src/wxs/number.js @@ -0,0 +1,91 @@ + +// 原 wxs/number.wxs 文件,使用时在 js中引入 +// const wxs = number() + +function number () { + const wxs = { + // 转换为价格的格式 + toPrice: (val) => { + if (!val) { + val = 0 + } + val = Number(val) + return val.toFixed(2) + }, + // 价格展示 + parsePrice: (val) => { + if (!val) { + val = 0 + } + return val.toFixed(2).split('.') + }, + + // 取整 + rounding: (val) => { + if (!val) { + val = 0 + } + return parseInt(val) + }, + // 满减格式 + parseDiscount: (discountRule, lang) => { + if (discountRule == 0) { + return lang == 'zh_CN' ? '满额减' : 'Amount' + } else if (discountRule == 1) { + return lang == 'zh_CN' ? '满件减' : 'Pieces' + } else if (discountRule == 2) { + return lang == 'zh_CN' ? '满额折' : 'Amount-discount' + } else if (discountRule == 3) { + return lang == 'zh_CN' ? '满件折' : 'Pieces-discount' + } else { + return '' + } + }, + // 满减提示 + parseDiscountMsg: (discountRule, needAmount, discount, lang) => { + if (discountRule == 0) { + return lang == 'zh_CN' ? '购满' + needAmount + '元减' + discount + '元' : 'Over ' + needAmount + ' minus ' + discount + } else if (discountRule == 1) { + return lang == 'zh_CN' ? '购满' + needAmount + '件减' + discount + '元' : discount + ' less for ' + needAmount + ' pieces' + } else if (discountRule == 2) { + return lang == 'zh_CN' ? '购满' + needAmount + '元打' + discount + '折' : discount + '% off over ' + needAmount + } else if (discountRule == 3) { + return lang == 'zh_CN' ? '购满' + needAmount + '件打' + discount + '折' : discount + '% off over ' + needAmount + ' pieces' + } else { + return '' + } + }, + + // 优惠券名称 + parseDiscountProd: (discountRule, needAmount, discount, lang) => { + if (discountRule == 1) { + return lang == 'zh_CN' ? '满' + needAmount + '元减' + discount + '元' : '¥' + discount + ' off on ' + '¥' + needAmount + } else if (discountRule == 2) { + return lang == 'zh_CN' ? '满' + needAmount + '元打' + discount + '折' : (100 - discount * 10) + '% off on ' + '¥' + needAmount + } else { + return '' + } + }, + + // 满减名称 + getCurrDiscountName: (discountId, discounts, lang) => { + for (let i = 0; i < discounts?.length; i++) { + if (discounts[i].discountId == discountId) { + return discounts[i].discountName + } + } + return lang == 'zh_CN' ? '不参与促销' : 'Not participating in promotion' + }, + + /** + * 裁剪日期 2020-03-20 15:04:40 -> 2020-03-20 + */ + spliceDate: (dateStr) => { + if (!dateStr) return + return dateStr.split(' ')[0] + } + } + return wxs +} + +export default number diff --git a/front-end/mall4uni/static/images/icon/addr.png b/front-end/mall4uni/static/images/icon/addr.png new file mode 100644 index 00000000..101f3251 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/addr.png differ diff --git a/front-end/mall4uni/static/images/icon/bg1.png b/front-end/mall4uni/static/images/icon/bg1.png new file mode 100644 index 00000000..bb679f95 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/bg1.png differ diff --git a/front-end/mall4uni/static/images/icon/car-new.png b/front-end/mall4uni/static/images/icon/car-new.png new file mode 100644 index 00000000..2a25e25b Binary files /dev/null and b/front-end/mall4uni/static/images/icon/car-new.png differ diff --git a/front-end/mall4uni/static/images/icon/car.png b/front-end/mall4uni/static/images/icon/car.png new file mode 100644 index 00000000..6834595d Binary files /dev/null and b/front-end/mall4uni/static/images/icon/car.png differ diff --git a/front-end/mall4uni/static/images/icon/clear-his.png b/front-end/mall4uni/static/images/icon/clear-his.png new file mode 100644 index 00000000..31780e67 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/clear-his.png differ diff --git a/front-end/mall4uni/static/images/icon/coupon-ot.png b/front-end/mall4uni/static/images/icon/coupon-ot.png new file mode 100644 index 00000000..0e1939d8 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/coupon-ot.png differ diff --git a/front-end/mall4uni/static/images/icon/coupon-used.png b/front-end/mall4uni/static/images/icon/coupon-used.png new file mode 100644 index 00000000..1c70631f Binary files /dev/null and b/front-end/mall4uni/static/images/icon/coupon-used.png differ diff --git a/front-end/mall4uni/static/images/icon/delive-dot.png b/front-end/mall4uni/static/images/icon/delive-dot.png new file mode 100644 index 00000000..0573a755 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/delive-dot.png differ diff --git a/front-end/mall4uni/static/images/icon/delivery-car.png b/front-end/mall4uni/static/images/icon/delivery-car.png new file mode 100644 index 00000000..7fdd500f Binary files /dev/null and b/front-end/mall4uni/static/images/icon/delivery-car.png differ diff --git a/front-end/mall4uni/static/images/icon/dot.png b/front-end/mall4uni/static/images/icon/dot.png new file mode 100644 index 00000000..c0920039 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/dot.png differ diff --git a/front-end/mall4uni/static/images/icon/empty-cash.png b/front-end/mall4uni/static/images/icon/empty-cash.png new file mode 100644 index 00000000..860e9ae7 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/empty-cash.png differ diff --git a/front-end/mall4uni/static/images/icon/everydaySale.png b/front-end/mall4uni/static/images/icon/everydaySale.png new file mode 100644 index 00000000..b0c869c7 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/everydaySale.png differ diff --git a/front-end/mall4uni/static/images/icon/getCoupon.png b/front-end/mall4uni/static/images/icon/getCoupon.png new file mode 100644 index 00000000..fbe22f56 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/getCoupon.png differ diff --git a/front-end/mall4uni/static/images/icon/head04.png b/front-end/mall4uni/static/images/icon/head04.png new file mode 100644 index 00000000..c64a4013 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/head04.png differ diff --git a/front-end/mall4uni/static/images/icon/horn.png b/front-end/mall4uni/static/images/icon/horn.png new file mode 100644 index 00000000..ae9279b3 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/horn.png differ diff --git a/front-end/mall4uni/static/images/icon/menu-01.png b/front-end/mall4uni/static/images/icon/menu-01.png new file mode 100644 index 00000000..54f7aab9 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/menu-01.png differ diff --git a/front-end/mall4uni/static/images/icon/menu-02.png b/front-end/mall4uni/static/images/icon/menu-02.png new file mode 100644 index 00000000..450cdd6c Binary files /dev/null and b/front-end/mall4uni/static/images/icon/menu-02.png differ diff --git a/front-end/mall4uni/static/images/icon/menu-03.png b/front-end/mall4uni/static/images/icon/menu-03.png new file mode 100644 index 00000000..fcce049f Binary files /dev/null and b/front-end/mall4uni/static/images/icon/menu-03.png differ diff --git a/front-end/mall4uni/static/images/icon/menu-04.png b/front-end/mall4uni/static/images/icon/menu-04.png new file mode 100644 index 00000000..d3ec6d9c Binary files /dev/null and b/front-end/mall4uni/static/images/icon/menu-04.png differ diff --git a/front-end/mall4uni/static/images/icon/more.png b/front-end/mall4uni/static/images/icon/more.png new file mode 100644 index 00000000..3baecd20 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/more.png differ diff --git a/front-end/mall4uni/static/images/icon/myAddr.png b/front-end/mall4uni/static/images/icon/myAddr.png new file mode 100644 index 00000000..b007c4fd Binary files /dev/null and b/front-end/mall4uni/static/images/icon/myAddr.png differ diff --git a/front-end/mall4uni/static/images/icon/myCoupon.png b/front-end/mall4uni/static/images/icon/myCoupon.png new file mode 100644 index 00000000..b45fee73 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/myCoupon.png differ diff --git a/front-end/mall4uni/static/images/icon/newProd.png b/front-end/mall4uni/static/images/icon/newProd.png new file mode 100644 index 00000000..67b45048 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/newProd.png differ diff --git a/front-end/mall4uni/static/images/icon/neweveryday.png b/front-end/mall4uni/static/images/icon/neweveryday.png new file mode 100644 index 00000000..483bd3c2 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/neweveryday.png differ diff --git a/front-end/mall4uni/static/images/icon/newprods.png b/front-end/mall4uni/static/images/icon/newprods.png new file mode 100644 index 00000000..d885b349 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/newprods.png differ diff --git a/front-end/mall4uni/static/images/icon/plus-sign.png b/front-end/mall4uni/static/images/icon/plus-sign.png new file mode 100644 index 00000000..b1d39151 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/plus-sign.png differ diff --git a/front-end/mall4uni/static/images/icon/prod-col-red.png b/front-end/mall4uni/static/images/icon/prod-col-red.png new file mode 100644 index 00000000..14374076 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/prod-col-red.png differ diff --git a/front-end/mall4uni/static/images/icon/prod-col.png b/front-end/mall4uni/static/images/icon/prod-col.png new file mode 100644 index 00000000..8a03d7e1 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/prod-col.png differ diff --git a/front-end/mall4uni/static/images/icon/promotion.png b/front-end/mall4uni/static/images/icon/promotion.png new file mode 100644 index 00000000..480652bc Binary files /dev/null and b/front-end/mall4uni/static/images/icon/promotion.png differ diff --git a/front-end/mall4uni/static/images/icon/revise.png b/front-end/mall4uni/static/images/icon/revise.png new file mode 100644 index 00000000..f3bb4806 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/revise.png differ diff --git a/front-end/mall4uni/static/images/icon/search-01.png b/front-end/mall4uni/static/images/icon/search-01.png new file mode 100644 index 00000000..99eb77a6 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/search-01.png differ diff --git a/front-end/mall4uni/static/images/icon/search-col.png b/front-end/mall4uni/static/images/icon/search-col.png new file mode 100644 index 00000000..587c2bf7 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/search-col.png differ diff --git a/front-end/mall4uni/static/images/icon/search-col2.png b/front-end/mall4uni/static/images/icon/search-col2.png new file mode 100644 index 00000000..cdd35fb0 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/search-col2.png differ diff --git a/front-end/mall4uni/static/images/icon/search.png b/front-end/mall4uni/static/images/icon/search.png new file mode 100644 index 00000000..feac7b93 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/search.png differ diff --git a/front-end/mall4uni/static/images/icon/star-empty.png b/front-end/mall4uni/static/images/icon/star-empty.png new file mode 100644 index 00000000..47889cab Binary files /dev/null and b/front-end/mall4uni/static/images/icon/star-empty.png differ diff --git a/front-end/mall4uni/static/images/icon/star-red.png b/front-end/mall4uni/static/images/icon/star-red.png new file mode 100644 index 00000000..2c3efcd8 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/star-red.png differ diff --git a/front-end/mall4uni/static/images/icon/timePrice.png b/front-end/mall4uni/static/images/icon/timePrice.png new file mode 100644 index 00000000..6d98d4e1 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/timePrice.png differ diff --git a/front-end/mall4uni/static/images/icon/toComment.png b/front-end/mall4uni/static/images/icon/toComment.png new file mode 100644 index 00000000..117b507d Binary files /dev/null and b/front-end/mall4uni/static/images/icon/toComment.png differ diff --git a/front-end/mall4uni/static/images/icon/toDelivery.png b/front-end/mall4uni/static/images/icon/toDelivery.png new file mode 100644 index 00000000..5b879a47 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/toDelivery.png differ diff --git a/front-end/mall4uni/static/images/icon/toPay.png b/front-end/mall4uni/static/images/icon/toPay.png new file mode 100644 index 00000000..7eb0499a Binary files /dev/null and b/front-end/mall4uni/static/images/icon/toPay.png differ diff --git a/front-end/mall4uni/static/images/icon/toTake.png b/front-end/mall4uni/static/images/icon/toTake.png new file mode 100644 index 00000000..84255db1 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/toTake.png differ diff --git a/front-end/mall4uni/static/images/icon/tuiguang01.png b/front-end/mall4uni/static/images/icon/tuiguang01.png new file mode 100644 index 00000000..0b7d0860 Binary files /dev/null and b/front-end/mall4uni/static/images/icon/tuiguang01.png differ diff --git a/front-end/mall4uni/static/images/icon/tuiguang02.png b/front-end/mall4uni/static/images/icon/tuiguang02.png new file mode 100644 index 00000000..87aba09e Binary files /dev/null and b/front-end/mall4uni/static/images/icon/tuiguang02.png differ diff --git a/front-end/mall4uni/static/images/icon/tuiguang03.png b/front-end/mall4uni/static/images/icon/tuiguang03.png new file mode 100644 index 00000000..a3832d1a Binary files /dev/null and b/front-end/mall4uni/static/images/icon/tuiguang03.png differ diff --git a/front-end/mall4uni/static/images/tabbar/basket-sel.png b/front-end/mall4uni/static/images/tabbar/basket-sel.png new file mode 100644 index 00000000..da0b48af Binary files /dev/null and b/front-end/mall4uni/static/images/tabbar/basket-sel.png differ diff --git a/front-end/mall4uni/static/images/tabbar/basket.png b/front-end/mall4uni/static/images/tabbar/basket.png new file mode 100644 index 00000000..5e05262e Binary files /dev/null and b/front-end/mall4uni/static/images/tabbar/basket.png differ diff --git a/front-end/mall4uni/static/images/tabbar/category-sel.png b/front-end/mall4uni/static/images/tabbar/category-sel.png new file mode 100644 index 00000000..489b7354 Binary files /dev/null and b/front-end/mall4uni/static/images/tabbar/category-sel.png differ diff --git a/front-end/mall4uni/static/images/tabbar/category.png b/front-end/mall4uni/static/images/tabbar/category.png new file mode 100644 index 00000000..937e8029 Binary files /dev/null and b/front-end/mall4uni/static/images/tabbar/category.png differ diff --git a/front-end/mall4uni/static/images/tabbar/homepage-sel.png b/front-end/mall4uni/static/images/tabbar/homepage-sel.png new file mode 100644 index 00000000..6b8fc0a6 Binary files /dev/null and b/front-end/mall4uni/static/images/tabbar/homepage-sel.png differ diff --git a/front-end/mall4uni/static/images/tabbar/homepage.png b/front-end/mall4uni/static/images/tabbar/homepage.png new file mode 100644 index 00000000..622fcfec Binary files /dev/null and b/front-end/mall4uni/static/images/tabbar/homepage.png differ diff --git a/front-end/mall4uni/static/images/tabbar/user-sel.png b/front-end/mall4uni/static/images/tabbar/user-sel.png new file mode 100644 index 00000000..954b222c Binary files /dev/null and b/front-end/mall4uni/static/images/tabbar/user-sel.png differ diff --git a/front-end/mall4uni/static/images/tabbar/user.png b/front-end/mall4uni/static/images/tabbar/user.png new file mode 100644 index 00000000..451d0dcb Binary files /dev/null and b/front-end/mall4uni/static/images/tabbar/user.png differ diff --git a/front-end/mall4uni/static/logo.png b/front-end/mall4uni/static/logo.png new file mode 100644 index 00000000..671753ec Binary files /dev/null and b/front-end/mall4uni/static/logo.png differ diff --git a/front-end/mall4uni/static/screenshot/index.jpg b/front-end/mall4uni/static/screenshot/index.jpg new file mode 100644 index 00000000..adffb737 Binary files /dev/null and b/front-end/mall4uni/static/screenshot/index.jpg differ diff --git a/front-end/mall4uni/static/screenshot/my.jpg b/front-end/mall4uni/static/screenshot/my.jpg new file mode 100644 index 00000000..5e3eddfc Binary files /dev/null and b/front-end/mall4uni/static/screenshot/my.jpg differ diff --git a/front-end/mall4uni/static/screenshot/prodInfo.jpg b/front-end/mall4uni/static/screenshot/prodInfo.jpg new file mode 100644 index 00000000..af79c988 Binary files /dev/null and b/front-end/mall4uni/static/screenshot/prodInfo.jpg differ diff --git a/front-end/mall4uni/static/screenshot/shopCart.jpg b/front-end/mall4uni/static/screenshot/shopCart.jpg new file mode 100644 index 00000000..c920e75a Binary files /dev/null and b/front-end/mall4uni/static/screenshot/shopCart.jpg differ diff --git a/front-end/mall4uni/static/screenshot/sku.jpg b/front-end/mall4uni/static/screenshot/sku.jpg new file mode 100644 index 00000000..b42bea44 Binary files /dev/null and b/front-end/mall4uni/static/screenshot/sku.jpg differ diff --git a/front-end/mall4uni/static/screenshot/uniappCart.png b/front-end/mall4uni/static/screenshot/uniappCart.png new file mode 100644 index 00000000..995f4eb8 Binary files /dev/null and b/front-end/mall4uni/static/screenshot/uniappCart.png differ diff --git a/front-end/mall4uni/static/screenshot/uniappIndex.png b/front-end/mall4uni/static/screenshot/uniappIndex.png new file mode 100644 index 00000000..f7c6aa65 Binary files /dev/null and b/front-end/mall4uni/static/screenshot/uniappIndex.png differ diff --git a/front-end/mall4uni/static/screenshot/uniappInfo.png b/front-end/mall4uni/static/screenshot/uniappInfo.png new file mode 100644 index 00000000..58d1845d Binary files /dev/null and b/front-end/mall4uni/static/screenshot/uniappInfo.png differ diff --git a/front-end/mall4uni/static/screenshot/uniappMy.png b/front-end/mall4uni/static/screenshot/uniappMy.png new file mode 100644 index 00000000..7210c8bd Binary files /dev/null and b/front-end/mall4uni/static/screenshot/uniappMy.png differ diff --git a/front-end/mall4uni/static/screenshot/uniappSku.png b/front-end/mall4uni/static/screenshot/uniappSku.png new file mode 100644 index 00000000..e368446b Binary files /dev/null and b/front-end/mall4uni/static/screenshot/uniappSku.png differ diff --git a/front-end/mall4uni/tsconfig.json b/front-end/mall4uni/tsconfig.json new file mode 100644 index 00000000..e4a0d1ba --- /dev/null +++ b/front-end/mall4uni/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "sourceMap": true, + "skipLibCheck": true + }, + "exclude": [ + "node_modules" + ], + "include": [ + "src/auto-import/components.d.ts", + "src/auto-import/imports.d.ts" + ] +} diff --git a/front-end/mall4uni/vite.config.js b/front-end/mall4uni/vite.config.js new file mode 100644 index 00000000..d4a3b1fc --- /dev/null +++ b/front-end/mall4uni/vite.config.js @@ -0,0 +1,38 @@ +import { defineConfig } from 'vite' +import uni from '@dcloudio/vite-plugin-uni' +import path from 'path' +import AutoImport from 'unplugin-auto-import/vite' +import h5ProdEffectPlugin from 'uni-vite-plugin-h5-prod-effect' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [ + uni(), + AutoImport({ + imports: [ + 'vue', + 'uni-app' + ], + dirs: [ + 'src/utils', + 'src/wxs/**' + ], + dts: 'src/auto-imports.d.ts', + eslintrc: { + enabled: true + } + }), + // 对h5 production环境打包时的特殊处理,否则uni-crazy-router在这个环境会异常 + h5ProdEffectPlugin() + ], + server: { + host: true, + port: 80, + open: true + }, + resolve: { + alias: { + '@': path.resolve(__dirname, 'src') + } + } +}) diff --git a/front-end/mall4v/.editorconfig b/front-end/mall4v/.editorconfig new file mode 100644 index 00000000..fb43e5c2 --- /dev/null +++ b/front-end/mall4v/.editorconfig @@ -0,0 +1,8 @@ +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/front-end/mall4v/.env.development b/front-end/mall4v/.env.development new file mode 100644 index 00000000..ff3343a1 --- /dev/null +++ b/front-end/mall4v/.env.development @@ -0,0 +1,11 @@ +# 如需添加更多环境变量,请以 VITE_APP_ 开头声明 +# 在代码中使用 import.meta.env.VITE_APP_XXX 获取指定变量 + +# 环境配置标识 +VITE_APP_ENV = 'development' + +# api接口请求地址 +VITE_APP_BASE_API = 'http://127.0.0.1:8085' + +# 静态资源文件url +VITE_APP_RESOURCES_URL = 'https://img.mall4j.com/' diff --git a/front-end/mall4v/.env.production b/front-end/mall4v/.env.production new file mode 100644 index 00000000..7ce51ce2 --- /dev/null +++ b/front-end/mall4v/.env.production @@ -0,0 +1,11 @@ +# 如需添加更多环境变量,请以 VITE_APP_ 开头声明 +# 在代码中使用 import.meta.env.VITE_APP_XXX 获取指定变量 + +# 环境配置标识 +VITE_APP_ENV = 'production' + +# api接口请求地址 +VITE_APP_BASE_API = 'http://127.0.0.1:8085' + +# 静态资源文件url +VITE_APP_RESOURCES_URL = 'https://img.mall4j.com/' diff --git a/front-end/mall4v/.env.testing b/front-end/mall4v/.env.testing new file mode 100644 index 00000000..bc68cca5 --- /dev/null +++ b/front-end/mall4v/.env.testing @@ -0,0 +1,11 @@ +# 如需添加更多环境变量,请以 VITE_APP_ 开头声明 +# 在代码中使用 import.meta.env.VITE_APP_XXX 获取指定变量 + +# 环境配置标识 +VITE_APP_ENV = 'testing' + +# api接口请求地址 +VITE_APP_BASE_API = 'http://127.0.0.1:8085' + +# 静态资源文件url +VITE_APP_RESOURCES_URL = 'https://img.mall4j.com/' diff --git a/front-end/mall4v/.eslintignore b/front-end/mall4v/.eslintignore new file mode 100644 index 00000000..f8be2075 --- /dev/null +++ b/front-end/mall4v/.eslintignore @@ -0,0 +1,9 @@ +/build/ +/config/ +/dist/ +/*.js +/src/components/verifition +/test/unit/coverage/ +/src/icons/iconfont.js +/components.d.ts +/src/auto-import diff --git a/front-end/mall4v/.eslintrc-auto-import.json b/front-end/mall4v/.eslintrc-auto-import.json new file mode 100644 index 00000000..2186ddf1 --- /dev/null +++ b/front-end/mall4v/.eslintrc-auto-import.json @@ -0,0 +1,94 @@ +{ + "globals": { + "$t": true, + "Component": true, + "ComponentPublicInstance": true, + "ComputedRef": true, + "Debounce": true, + "EffectScope": true, + "InjectionKey": true, + "PropType": true, + "Ref": true, + "VNode": true, + "clearLoginInfo": true, + "computed": true, + "configDefInfo": true, + "createApp": true, + "customRef": true, + "defineAsyncComponent": true, + "defineComponent": true, + "effectScope": true, + "encrypt": true, + "flatten": true, + "checkFileUrl": true, + "formatConfigInfo": true, + "getCurrentInstance": true, + "getCurrentScope": true, + "getLevels": true, + "getUUID": true, + "h": true, + "http": true, + "idList": true, + "inject": true, + "isAuth": true, + "isEmail": true, + "isHtmlNull": true, + "isMobile": true, + "isPhone": true, + "isProxy": true, + "isQq": true, + "isReactive": true, + "isReadonly": true, + "isRef": true, + "isURL": true, + "markRaw": true, + "nextTick": true, + "onActivated": true, + "onBeforeMount": true, + "onBeforeRouteLeave": true, + "onBeforeRouteUpdate": true, + "onBeforeUnmount": true, + "onBeforeUpdate": true, + "onDeactivated": true, + "onErrorCaptured": true, + "onMounted": true, + "onRenderTracked": true, + "onRenderTriggered": true, + "onScopeDispose": true, + "onServerPrefetch": true, + "onUnmounted": true, + "onUpdated": true, + "provide": true, + "reactive": true, + "readonly": true, + "ref": true, + "resolveComponent": true, + "shallowReactive": true, + "shallowReadonly": true, + "shallowRef": true, + "toRaw": true, + "toRef": true, + "toRefs": true, + "treeDataTranslate": true, + "triggerRef": true, + "unref": true, + "uploadFile": true, + "useAttrs": true, + "useCommonStore": true, + "scoreProdStore":true, + "useCssModule": true, + "useCssVars": true, + "useLink": true, + "useRoute": true, + "useRouter": true, + "useSlots": true, + "useUserStore": true, + "useWebConfigStore": true, + "validHtmlLength": true, + "validNoEmptySpace": true, + "watch": true, + "watchEffect": true, + "watchPostEffect": true, + "watchSyncEffect": true + } +} \ No newline at end of file diff --git a/front-end/mall4v/.eslintrc.cjs b/front-end/mall4v/.eslintrc.cjs new file mode 100644 index 00000000..4d5678e5 --- /dev/null +++ b/front-end/mall4v/.eslintrc.cjs @@ -0,0 +1,79 @@ +module.exports = { + root: true, + env: { + browser: true, + es2021: true + }, + globals: { + BMap: 'readonly' + }, + extends: [ + 'standard', + './.eslintrc-auto-import.json', + 'plugin:vue/vue3-recommended', + 'plugin:vue-scoped-css/vue3-recommended' + ], + overrides: [], + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module' + }, + plugins: ['vue'], + rules: { + // Possible Errors + // 要求使用 let 或 const 而不是 var + 'no-var': 'error', + // 强制 "for" 循环中更新子句的计数器朝着正确的方向移动 + 'for-direction': 'error', + // 强制 getter 函数中出现 return 语句 + 'getter-return': 'error', + // 禁止在嵌套的块中出现变量声明或 function 声明 + 'no-inner-declarations': 'error', + // 禁止由于 await 或 yield的使用而可能导致出现竞态条件的赋值 + 'require-atomic-updates': 'error', + // console 警告 + 'no-console': 'warn', + // 禁止出现未使用过的变量 + 'no-unused-vars': [ + 'warn', + { + args: 'all', + caughtErrors: 'none', + ignoreRestSiblings: true, + vars: 'all' + } + ], + // 关闭名称校验 + 'vue/multi-word-component-names': 'off', + // 非生产环境启用 debugger + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', + + // Best Practices + eqeqeq: 'off', + + // Stylistic Issues + // 强制可嵌套的块的最大深度 + 'max-depth': ['error', 5], + // 强制函数最大代码行数 + 'max-lines-per-function': [ + 'error', + { + max: 150, + skipBlankLines: true + } + ], + // 强制回调函数最大嵌套深度 + 'max-nested-callbacks': ['error', { max: 10 }], + // 强制函数定义中最多允许的参数数量 + 'max-params': ['error', { max: 5 }], + // 强制每一行中所允许的最大语句数量 + 'max-statements-per-line': ['error', { max: 1 }], + // 三目运算符换行 + 'multiline-ternary': ['error', 'never'], + // 传值给组件时的使用 kebab-case + 'vue/v-on-event-hyphenation': ['warn', 'always', { + autofix: true, + ignore: [] + }] + } +} diff --git a/front-end/mall4v/.gitignore b/front-end/mall4v/.gitignore new file mode 100644 index 00000000..59b467b6 --- /dev/null +++ b/front-end/mall4v/.gitignore @@ -0,0 +1,29 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +package-lock.json +pnpm-lock.yaml +dist +dist-ssr +*.local + +# Editor directories and files +.vscode +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +# 自动引入 +src/auto-import +components.d.ts diff --git a/front-end/mall4v/.npmrc b/front-end/mall4v/.npmrc new file mode 100644 index 00000000..febf696a --- /dev/null +++ b/front-end/mall4v/.npmrc @@ -0,0 +1,4 @@ +engine-strict = true +shamefully-hoist = true +strict-peer-dependencies = false +registry = https://registry.npmmirror.com diff --git a/front-end/mall4v/Dockerfile b/front-end/mall4v/Dockerfile new file mode 100644 index 00000000..49cfa0e1 --- /dev/null +++ b/front-end/mall4v/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:1.20 +COPY ./dist /usr/share/nginx/html/dist +COPY ./nginx.conf /etc/nginx/conf.d \ No newline at end of file diff --git a/front-end/mall4v/LICENSE b/front-end/mall4v/LICENSE new file mode 100644 index 00000000..dbbe3558 --- /dev/null +++ b/front-end/mall4v/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/front-end/mall4v/README.md b/front-end/mall4v/README.md new file mode 100644 index 00000000..65ceba55 --- /dev/null +++ b/front-end/mall4v/README.md @@ -0,0 +1,91 @@ +一个基于vue、element ui 的轻量级、前后端分离、拥有完整sku和下单流程的完全开源商城后台所属前端界面 + + + + +## 前言 + +`mall4j商城`项目致力于为中小企业打造一个完整、易于维护的开源的电商系统,采用现阶段流行技术实现。后台管理系统包含商品管理、订单管理、运费模板、规格管理、会员管理、运营管理、内容管理、统计报表、权限管理、设置等模块。 + + +## 授权 + +Mall4j官网 https://www.mall4j.com + +Mall4j 使用 AGPLv3 开源,请遵守 AGPLv3 的相关条款,或者联系作者获取商业授权(https://www.mall4j.com) + +## 项目链接 + +java后台:https://gitee.com/gz-yami/mall4j + +vue中后台:https://gitee.com/gz-yami/mall4v + +小程序:https://gitee.com/gz-yami/mall4m + + + + +## 部署教程 + +### 1.安装nodejs + +[NodeJS](https://nodejs.org/) 项目要求最低 18.12.0,推荐 20.9.0 + +如果不了解怎么安装nodejs的,可以参考 [菜鸟教程的nodejs相关](https://www.runoob.com/nodejs/nodejs-install-setup.html) + +### 2.启动 + +- 项目要求使用 [pnpm](https://www.pnpm.cn/) 包管理工具 +- 使用编辑器打开项目,在根目录执行以下命令安装依赖 + +``` +pnpm install +``` + +- 运行 + +``` +pnpm run dev +``` + +- 部署 + +``` +pnpm run build +``` + +- 如果不想使用 pnpm,请删除 `package.json` 文件中 `preinstall` 脚本后再进行安装 + +```json +{ + "scripts" : { + "preinstall": "npx only-allow pnpm" // 使用其他包管理工具(npm、yarn、cnpm等)请删除此命令 + } +} +``` + +## 相关截图 + +![登陆](https://gitee.com/gz-yami/mall4j/raw/master/screenshot/login.png) + +![订单](https://gitee.com/gz-yami/mall4j/raw/master/screenshot/order.png) + +![商品列表](https://gitee.com/gz-yami/mall4j/raw/master/screenshot/prodList.png) + +![sku](https://gitee.com/gz-yami/mall4j/raw/master/screenshot/sku.png) + +![运费模板](https://gitee.com/gz-yami/mall4j/raw/master/screenshot/transport.png) + + + +## 提交反馈 + +提问之前,请先阅读[提问的智慧](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md): + +- QQ群:722835385 + + ![QQ群](https://gitee.com/gz-yami/mall4j/raw/master/screenshot/qqGroup.png) + +- 论坛: + +- 商务邮箱:yamitech@163.com diff --git a/front-end/mall4v/index.html b/front-end/mall4v/index.html new file mode 100644 index 00000000..92c332d7 --- /dev/null +++ b/front-end/mall4v/index.html @@ -0,0 +1,16 @@ + + + + + + + + + + + + +

+ + + diff --git a/front-end/mall4v/nginx.conf b/front-end/mall4v/nginx.conf new file mode 100644 index 00000000..b7f87ed4 --- /dev/null +++ b/front-end/mall4v/nginx.conf @@ -0,0 +1,22 @@ +server { + listen 80; + server_name mini-admin.mall4j.com; + + gzip on; + gzip_static on; + + location / { + try_files $uri $uri/ /; + root /usr/share/nginx/html/dist; + index index.html; + } + + error_page 404 /404.html; + location = /404-light.html { + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + } +} + diff --git a/front-end/mall4v/package.json b/front-end/mall4v/package.json new file mode 100644 index 00000000..42725304 --- /dev/null +++ b/front-end/mall4v/package.json @@ -0,0 +1,70 @@ +{ + "name": "mall4v", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "preinstall": "npx only-allow pnpm", + "dev": "vite", + "dev:test": "vite --mode testing", + "build": "vite build", + "build:test": "vite build --mode testing", + "lint": "eslint --ext .js,.vue src", + "lint:fix": "eslint --fix --ext .js,.vue src", + "preview": "vite preview", + "prepare": "husky install", + "lint:staged": "lint-staged" + }, + "engines": { + "node": ">=16", + "pnpm": ">=6" + }, + "dependencies": { + "@element-plus/icons-vue": "2.1.0", + "@smallwei/avue": "^3.2.22", + "@tinymce/tinymce-vue": "^5.1.0", + "axios": "1.3.4", + "big.js": "6.2.1", + "browser-image-compression": "2.0.2", + "crypto-js": "4.1.1", + "echarts": "5.4.1", + "element-plus": "2.3.6", + "element-resize-detector": "1.2.4", + "js-base64": "3.7.5", + "lodash": "4.17.21", + "moment": "2.29.4", + "pinia": "2.0.33", + "qs": "6.11.1", + "tinymce": "^6.4.1", + "vue": "3.2.47", + "vue-cookies": "1.8.3", + "vue-draggable-next": "2.1.1", + "vue-router": "4.1.6" + }, + "devDependencies": { + "@babel/eslint-parser": "^7.21.3", + "@vitejs/plugin-vue": "^4.1.0", + "eslint": "^8.38.0", + "eslint-config-standard": "^17.0.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-n": "^15.7.0", + "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-vue": "^9.10.0", + "eslint-plugin-vue-scoped-css": "^2.4.0", + "husky": "8.0.3", + "lint-staged": "13.2.2", + "sass": "^1.59.3", + "unplugin-auto-import": "^0.15.1", + "unplugin-vue-components": "^0.24.1", + "vite": "^4.3.9", + "vite-plugin-compression": "^0.5.1", + "vite-plugin-eslint": "^1.8.1", + "vite-plugin-svg-icons": "^2.0.1", + "vue-eslint-parser": "^9.1.1" + }, + "lint-staged": { + "*.{js,vue}": [ + "eslint --fix" + ] + } +} diff --git a/front-end/mall4v/public/favicon.ico b/front-end/mall4v/public/favicon.ico new file mode 100644 index 00000000..dd24b3af Binary files /dev/null and b/front-end/mall4v/public/favicon.ico differ diff --git a/front-end/mall4v/src/App.vue b/front-end/mall4v/src/App.vue new file mode 100644 index 00000000..964ca7fc --- /dev/null +++ b/front-end/mall4v/src/App.vue @@ -0,0 +1,12 @@ + + + + diff --git a/front-end/mall4v/src/assets/app.scss b/front-end/mall4v/src/assets/app.scss new file mode 100644 index 00000000..48d58322 --- /dev/null +++ b/front-end/mall4v/src/assets/app.scss @@ -0,0 +1,27 @@ +// 商品卡片信息的名称删除按钮组 +.card-prod-info-btn{ + font-size: 14px; + .prod-name{ + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + padding: 0 8px; + } + .del-btn{ + line-height: 20px; + text-align: right; + padding-right: 8px; + user-select: none; + span{ + color: #155bd4; + cursor: pointer; + &:hover{ + opacity: 0.8; + } + &.disabled{ + opacity: 0.6; + cursor: not-allowed; + } + } + } +} diff --git a/front-end/mall4v/src/assets/img/address.png b/front-end/mall4v/src/assets/img/address.png new file mode 100644 index 00000000..ae738a55 Binary files /dev/null and b/front-end/mall4v/src/assets/img/address.png differ diff --git a/front-end/mall4v/src/assets/img/avatar.png b/front-end/mall4v/src/assets/img/avatar.png new file mode 100644 index 00000000..88526ec1 Binary files /dev/null and b/front-end/mall4v/src/assets/img/avatar.png differ diff --git a/front-end/mall4v/src/assets/img/base_z36574a.png b/front-end/mall4v/src/assets/img/base_z36574a.png new file mode 100644 index 00000000..10b4cef1 Binary files /dev/null and b/front-end/mall4v/src/assets/img/base_z36574a.png differ diff --git a/front-end/mall4v/src/assets/img/bg_mobile_head_default2968da.png b/front-end/mall4v/src/assets/img/bg_mobile_head_default2968da.png new file mode 100644 index 00000000..248cfb76 Binary files /dev/null and b/front-end/mall4v/src/assets/img/bg_mobile_head_default2968da.png differ diff --git a/front-end/mall4v/src/assets/img/buyer.png b/front-end/mall4v/src/assets/img/buyer.png new file mode 100644 index 00000000..9df263f1 Binary files /dev/null and b/front-end/mall4v/src/assets/img/buyer.png differ diff --git a/front-end/mall4v/src/assets/img/car.png b/front-end/mall4v/src/assets/img/car.png new file mode 100644 index 00000000..a0c80444 Binary files /dev/null and b/front-end/mall4v/src/assets/img/car.png differ diff --git a/front-end/mall4v/src/assets/img/def.png b/front-end/mall4v/src/assets/img/def.png new file mode 100644 index 00000000..75766ae3 Binary files /dev/null and b/front-end/mall4v/src/assets/img/def.png differ diff --git a/front-end/mall4v/src/assets/img/default-verify-error.jpg b/front-end/mall4v/src/assets/img/default-verify-error.jpg new file mode 100644 index 00000000..aa0237bb Binary files /dev/null and b/front-end/mall4v/src/assets/img/default-verify-error.jpg differ diff --git a/front-end/mall4v/src/assets/img/index_z354723.png b/front-end/mall4v/src/assets/img/index_z354723.png new file mode 100644 index 00000000..8d8f8c4e Binary files /dev/null and b/front-end/mall4v/src/assets/img/index_z354723.png differ diff --git a/front-end/mall4v/src/assets/img/invoice.png b/front-end/mall4v/src/assets/img/invoice.png new file mode 100644 index 00000000..f5a48625 Binary files /dev/null and b/front-end/mall4v/src/assets/img/invoice.png differ diff --git a/front-end/mall4v/src/assets/img/line.png b/front-end/mall4v/src/assets/img/line.png new file mode 100644 index 00000000..19388c84 Binary files /dev/null and b/front-end/mall4v/src/assets/img/line.png differ diff --git a/front-end/mall4v/src/assets/img/login-bg.png b/front-end/mall4v/src/assets/img/login-bg.png new file mode 100644 index 00000000..e518cfca Binary files /dev/null and b/front-end/mall4v/src/assets/img/login-bg.png differ diff --git a/front-end/mall4v/src/assets/img/login-logo.png b/front-end/mall4v/src/assets/img/login-logo.png new file mode 100644 index 00000000..8feeff5b Binary files /dev/null and b/front-end/mall4v/src/assets/img/login-logo.png differ diff --git a/front-end/mall4v/src/assets/img/message.png b/front-end/mall4v/src/assets/img/message.png new file mode 100644 index 00000000..655b8c1c Binary files /dev/null and b/front-end/mall4v/src/assets/img/message.png differ diff --git a/front-end/mall4v/src/assets/img/message.svg b/front-end/mall4v/src/assets/img/message.svg new file mode 100644 index 00000000..b25cc07e --- /dev/null +++ b/front-end/mall4v/src/assets/img/message.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/assets/img/remarks.png b/front-end/mall4v/src/assets/img/remarks.png new file mode 100644 index 00000000..ee0a1616 Binary files /dev/null and b/front-end/mall4v/src/assets/img/remarks.png differ diff --git a/front-end/mall4v/src/assets/img/revise.png b/front-end/mall4v/src/assets/img/revise.png new file mode 100644 index 00000000..6969b5aa Binary files /dev/null and b/front-end/mall4v/src/assets/img/revise.png differ diff --git a/front-end/mall4v/src/assets/img/time.png b/front-end/mall4v/src/assets/img/time.png new file mode 100644 index 00000000..cfbfb8ac Binary files /dev/null and b/front-end/mall4v/src/assets/img/time.png differ diff --git a/front-end/mall4v/src/assets/img/yami.png b/front-end/mall4v/src/assets/img/yami.png new file mode 100644 index 00000000..da712104 Binary files /dev/null and b/front-end/mall4v/src/assets/img/yami.png differ diff --git a/front-end/mall4v/src/assets/scss/_base.scss b/front-end/mall4v/src/assets/scss/_base.scss new file mode 100644 index 00000000..f2dde4d9 --- /dev/null +++ b/front-end/mall4v/src/assets/scss/_base.scss @@ -0,0 +1,370 @@ +*, +*:before, +*:after { + box-sizing: border-box; +} +body { + font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif; + font-size: 14px; + line-height: 1.15; + color: #303133; + background-color: #fff; +} +a { + color: mix(#fff, $--color-primary, 20%); + text-decoration: none; + &:focus, + &:hover { + color: $--color-primary; + text-decoration: underline; + } +} +img { + vertical-align: middle; + max-width: 100%; +} + +.el-cascader-menu { + .el-scrollbar__wrap { + overflow-y: auto !important; + width: 100% !important; + margin: 0 !important; + overflow: auto !important; + } +} + +/* Utils +------------------------------ */ +.clearfix:before, +.clearfix:after { + content: " "; + display: table; +} +.clearfix:after { + clear: both; +} + + +/* Animation +------------------------------ */ +.fade-enter-active, +.fade-leave-active { + transition: opacity .5s; +} +.fade-enter, +.fade-leave-to { + opacity: 0; +} + + +/* Reset element-ui +------------------------------ */ +.site-wrapper { + .el-pagination { + text-align: right; + } +} + + +/* Layout +------------------------------ */ +.site-wrapper { + position: relative; + min-width: 1180px; +} + + +/* Sidebar fold +------------------------------ */ +.site-sidebar--fold { + .site-navbar__header, + .site-navbar__brand, + .site-sidebar, + .site-sidebar__inner, + .el-menu.site-sidebar__menu { + width: 64px; + } + .site-navbar__body, + .site-content__wrapper { + margin-left: 64px; + } + .site-navbar__brand { + &-lg { + display: none; + } + &-mini { + display: inline-block; + } + } + .site-sidebar, + .site-sidebar__inner { + overflow: initial; + } + .site-sidebar__menu-icon { + margin-right: 0; + font-size: 20px; + } + .site-content--tabs > .el-tabs > .el-tabs__header { + left: 64px; + } +} +// animation +.site-navbar__header, +.site-navbar__brand, +.site-navbar__body, +.site-sidebar, +.site-sidebar__inner, +.site-sidebar__menu.el-menu, +.site-sidebar__menu-icon, +.site-content__wrapper, +.site-content--tabs > .el-tabs .el-tabs__header { + transition: inline-block .3s, left .3s, width .3s, margin-left .3s, font-size .3s; +} + + +/* Navbar +------------------------------ */ +.site-navbar { + position: fixed; + top: 0; + right: 0; + left: 0; + z-index: 1030; + height: 50px; + box-shadow: 0 2px 4px rgba(0, 0, 0, .08); + background-color: $navbar--background-color; + + &--inverse { + .site-navbar__body { + background-color: transparent; + } + .el-menu { + > .el-menu-item, + > .el-submenu > .el-submenu__title { + color: #fff; + &:focus, + &:hover { + color: #fff; + background-color: mix(#000, $navbar--background-color, 15%); + } + } + > .el-menu-item.is-active, + > .el-submenu.is-active > .el-submenu__title { + border-bottom-color: mix(#fff, $navbar--background-color, 85%); + } + .el-menu-item i, + .el-submenu__title i, + .el-dropdown { + color: #fff; + } + } + .el-menu--popup-bottom-start { + background-color: $navbar--background-color; + } + } + + &__header { + position: relative; + float: left; + width: 230px; + height: 50px; + overflow: hidden; + } + &__brand { + display: table-cell; + vertical-align: middle; + width: 230px; + height: 50px; + margin: 0; + line-height: 50px; + font-size: 20px; + text-align: center; + text-transform: uppercase; + white-space: nowrap; + color: #fff; + + &-lg, + &-mini { + margin: 0 5px; + color: #fff; + &:focus, + &:hover { + color: #fff; + text-decoration: none; + } + } + &-mini { + display: none; + } + } + &__switch { + font-size: 18px; + border-bottom: none !important; + } + &__avatar { + border-bottom: none !important; + * { + vertical-align: inherit; + } + .el-dropdown-link { + > img { + width: 36px; + height: auto; + margin-right: 5px; + border-radius: 100%; + vertical-align: middle; + } + } + } + &__body { + position: relative; + margin-left: 230px; + padding-right: 15px; + background-color: #fff; + } + &__menu { + float: left; + background-color: transparent; + border-bottom: 0; + + &--right { + float: right; + } + a:focus, + a:hover { + text-decoration: none; + } + .el-menu-item, + .el-submenu > .el-submenu__title { + height: 50px; + line-height: 50px; + } + .el-submenu > .el-menu { + top: 55px; + } + .el-badge { + display: inline; + z-index: 2; + &__content { + line-height: 16px; + } + } + } +} + + +/* Sidebar +------------------------------ */ +.site-sidebar { + position: fixed; + top: 50px; + left: 0; + bottom: 0; + z-index: 1020; + width: 230px; + overflow: hidden; + + &--dark, + &--dark-popper { + background-color: $sidebar--background-color-dark; + .site-sidebar__menu.el-menu, + > .el-menu--popup { + background-color: $sidebar--background-color-dark; + .el-menu-item, + .el-submenu > .el-submenu__title { + color: $sidebar--color-text-dark; + &:focus, + &:hover { + color: mix(#fff, $sidebar--color-text-dark, 50%); + background-color: mix(#fff, $sidebar--background-color-dark, 2.5%); + } + } + .el-menu, + .el-submenu.is-opened { + background-color: mix(#000, $sidebar--background-color-dark, 15%); + } + .el-menu-item.is-active, + .el-submenu.is-active > .el-submenu__title { + color: mix(#fff, $sidebar--color-text-dark, 80%); + } + } + } + &__inner { + position: relative; + z-index: 1; + width: 250px; + height: 100%; + padding-bottom: 15px; + overflow-y: scroll; + } + &__menu.el-menu { + width: 230px; + border-right: 0; + } + &__menu-icon { + width: 24px; + margin-right: 5px; + text-align: center; + font-size: 16px; + color: inherit !important; + } +} + + +/* Content +------------------------------ */ +.site-content { + position: relative; + padding: 15px; + + &__wrapper { + position: relative; + padding-top: 50px; + margin-left: 230px; + min-height: 100%; + background: $content--background-color; + } + &--tabs { + padding: 55px 0 0; + } + > .el-tabs { + > .el-tabs__header { + position: fixed; + top: 50px; + left: 230px; + right: 0; + z-index: 930; + padding: 0 55px 0 15px; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .12), 0 0 6px 0 rgba(0, 0, 0, .04); + background-color: #fff; + > .el-tabs__nav-wrap { + margin-bottom: 0; + &:after { + display: none; + } + } + } + > .el-tabs__content { + padding: 0 15px 15px; + > .site-tabs__tools { + position: fixed; + top: 50px; + right: 0; + z-index: 931; + height: 40px; + padding: 0 12px; + font-size: 16px; + line-height: 40px; + background-color: $content--background-color; + cursor: pointer; + .el-icon--right { + margin-left: 0; + } + } + } + } +} + +.element-error-message-zindex{ + z-index:3000 !important; +} diff --git a/front-end/mall4v/src/assets/scss/_normalize.scss b/front-end/mall4v/src/assets/scss/_normalize.scss new file mode 100644 index 00000000..9bb25298 --- /dev/null +++ b/front-end/mall4v/src/assets/scss/_normalize.scss @@ -0,0 +1,447 @@ +/*! normalize.css v7.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 + * IE on Windows Phone and in iOS. + */ + + html { + line-height: 1.15; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers (opinionated). + */ + +body { + margin: 0; +} + +/** + * Add the correct display in IE 9-. + */ + +article, +aside, +footer, +header, +nav, +section { + display: block; +} + +/** + * 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 + ========================================================================== */ + +/** + * Add the correct display in IE 9-. + * 1. Add the correct display in IE. + */ + +figcaption, +figure, +main { /* 1 */ + display: block; +} + +/** + * Add the correct margin in IE 8. + */ + +figure { + margin: 1em 40px; +} + +/** + * 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 + ========================================================================== */ + +/** + * 1. Remove the gray background on active links in IE 10. + * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. + */ + +a { + background-color: transparent; /* 1 */ + -webkit-text-decoration-skip: objects; /* 2 */ +} + +/** + * 1. Remove the bottom border in Chrome 57- and Firefox 39-. + * 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 */ +} + +/** + * Prevent the duplicate application of `bolder` by the next rule in Safari 6. + */ + +b, +strong { + font-weight: inherit; +} + +/** + * 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 style in Android 4.3-. + */ + +dfn { + font-style: italic; +} + +/** + * Add the correct background and color in IE 9-. + */ + +mark { + background-color: #ff0; + color: #000; +} + +/** + * 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 + ========================================================================== */ + +/** + * Add the correct display in IE 9-. + */ + +audio, +video { + display: inline-block; +} + +/** + * Add the correct display in iOS 4-7. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Remove the border on images inside links in IE 10-. + */ + +img { + border-style: none; +} + +/** + * Hide the overflow in IE. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Forms + ========================================================================== */ + +/** + * 1. Change the font styles in all browsers (opinionated). + * 2. Remove the margin in Firefox and Safari. + */ + +button, +input, +optgroup, +select, +textarea { + font-family: sans-serif; /* 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; +} + +/** + * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` + * controls in Android 4. + * 2. Correct the inability to style clickable types in iOS and Safari. + */ + +button, +html [type="button"], /* 1 */ +[type="reset"], +[type="submit"] { + -webkit-appearance: button; /* 2 */ +} + +/** + * 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 */ +} + +/** + * 1. Add the correct display in IE 9-. + * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ +} + +/** + * Remove the default vertical scrollbar in IE. + */ + +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 and cancel buttons in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-cancel-button, +[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 IE 9-. + * 1. Add the correct display in Edge, IE, and Firefox. + */ + +details, /* 1 */ +menu { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Scripting + ========================================================================== */ + +/** + * Add the correct display in IE 9-. + */ + +canvas { + display: inline-block; +} + +/** + * Add the correct display in IE. + */ + +template { + display: none; +} + +/* Hidden + ========================================================================== */ + +/** + * Add the correct display in IE 10-. + */ + +[hidden] { + display: none; +} \ No newline at end of file diff --git a/front-end/mall4v/src/assets/scss/_variables.scss b/front-end/mall4v/src/assets/scss/_variables.scss new file mode 100644 index 00000000..b081e04e --- /dev/null +++ b/front-end/mall4v/src/assets/scss/_variables.scss @@ -0,0 +1,13 @@ +// 站点主色 +// tips: 要达到整站主题修改效果, 请确保[$--color-primary]站点主色与[/src/element-ui-theme/index.js]文件中[import './element-[#17B3A3]/index.css']当前主题色一致 +$--color-primary: #02A1E9; + +// Navbar +$navbar--background-color: $--color-primary; + +// Sidebar +$sidebar--background-color-dark: #263238; +$sidebar--color-text-dark: #8a979e; + +// Content +$content--background-color: #f1f4f5; diff --git a/front-end/mall4v/src/assets/scss/index.scss b/front-end/mall4v/src/assets/scss/index.scss new file mode 100644 index 00000000..c17d72cc --- /dev/null +++ b/front-end/mall4v/src/assets/scss/index.scss @@ -0,0 +1,3 @@ +@import "normalize"; // api: https://github.com/necolas/normalize.css/ +@import "variables"; // 站点变量 +@import "base"; diff --git a/front-end/mall4v/src/components/mul-pic-upload/index.vue b/front-end/mall4v/src/components/mul-pic-upload/index.vue new file mode 100644 index 00000000..9b934a4d --- /dev/null +++ b/front-end/mall4v/src/components/mul-pic-upload/index.vue @@ -0,0 +1,99 @@ + + + diff --git a/front-end/mall4v/src/components/pic-upload/index.vue b/front-end/mall4v/src/components/pic-upload/index.vue new file mode 100644 index 00000000..92409a5c --- /dev/null +++ b/front-end/mall4v/src/components/pic-upload/index.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/front-end/mall4v/src/components/prods-select/index.vue b/front-end/mall4v/src/components/prods-select/index.vue new file mode 100644 index 00000000..c50bad46 --- /dev/null +++ b/front-end/mall4v/src/components/prods-select/index.vue @@ -0,0 +1,226 @@ + + + diff --git a/front-end/mall4v/src/components/tiny-mce/index.vue b/front-end/mall4v/src/components/tiny-mce/index.vue new file mode 100644 index 00000000..fb712da9 --- /dev/null +++ b/front-end/mall4v/src/components/tiny-mce/index.vue @@ -0,0 +1,195 @@ + + + + + diff --git a/front-end/mall4v/src/components/verifition/Verify.vue b/front-end/mall4v/src/components/verifition/Verify.vue new file mode 100644 index 00000000..8841ad0a --- /dev/null +++ b/front-end/mall4v/src/components/verifition/Verify.vue @@ -0,0 +1,452 @@ + + + diff --git a/front-end/mall4v/src/components/verifition/Verify/VerifyPoints.vue b/front-end/mall4v/src/components/verifition/Verify/VerifyPoints.vue new file mode 100644 index 00000000..1a38f619 --- /dev/null +++ b/front-end/mall4v/src/components/verifition/Verify/VerifyPoints.vue @@ -0,0 +1,261 @@ + + diff --git a/front-end/mall4v/src/components/verifition/Verify/VerifySlide.vue b/front-end/mall4v/src/components/verifition/Verify/VerifySlide.vue new file mode 100644 index 00000000..6a3f144d --- /dev/null +++ b/front-end/mall4v/src/components/verifition/Verify/VerifySlide.vue @@ -0,0 +1,375 @@ + + diff --git a/front-end/mall4v/src/components/verifition/api/index.js b/front-end/mall4v/src/components/verifition/api/index.js new file mode 100644 index 00000000..3a8624ae --- /dev/null +++ b/front-end/mall4v/src/components/verifition/api/index.js @@ -0,0 +1,24 @@ +/** + * 此处可直接引用自己项目封装好的 axios 配合后端联调 + */ + +import request from './../utils/axios' // 组件内部封装的axios +// import request from "@/api/axios.js" //调用项目封装的axios + +// 获取验证图片 以及token +export function reqGet (data) { + return request({ + url: '/captcha/get', + method: 'post', + data + }) +} + +// 滑动或者点选验证 +export function reqCheck (data) { + return request({ + url: '/captcha/check', + method: 'post', + data + }) +} diff --git a/front-end/mall4v/src/components/verifition/utils/ase.js b/front-end/mall4v/src/components/verifition/utils/ase.js new file mode 100644 index 00000000..31a18c68 --- /dev/null +++ b/front-end/mall4v/src/components/verifition/utils/ase.js @@ -0,0 +1,11 @@ +import CryptoJS from 'crypto-js' +/** + * @word 要加密的内容 + * @keyWord String 服务器随机返回的关键字 + * */ +export function aesEncrypt (word, keyWord = 'XwKsGlMcdPMEhR1B') { + const key = CryptoJS.enc.Utf8.parse(keyWord) + const srcs = CryptoJS.enc.Utf8.parse(word) + const encrypted = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 }) + return encrypted.toString() +} diff --git a/front-end/mall4v/src/components/verifition/utils/axios.js b/front-end/mall4v/src/components/verifition/utils/axios.js new file mode 100644 index 00000000..8230cb9d --- /dev/null +++ b/front-end/mall4v/src/components/verifition/utils/axios.js @@ -0,0 +1,27 @@ +import axios from 'axios' + +axios.defaults.baseURL = import.meta.env.VITE_APP_BASE_API + +const service = axios.create({ + timeout: 40000, + headers: { + 'X-Requested-With': 'XMLHttpRequest', + 'Content-Type': 'application/json; charset=UTF-8' + } +}) +service.interceptors.request.use( + config => { + return config + }, + error => { + Promise.reject(error) + } +) + +// response interceptor +service.interceptors.response.use( + response => { + return response.data + } +) +export default service diff --git a/front-end/mall4v/src/components/verifition/utils/util.js b/front-end/mall4v/src/components/verifition/utils/util.js new file mode 100644 index 00000000..82b5cc04 --- /dev/null +++ b/front-end/mall4v/src/components/verifition/utils/util.js @@ -0,0 +1,35 @@ +export function resetSize (vm) { + let img_width, img_height, bar_width, bar_height // 图片的宽度、高度,移动条的宽度、高度 + + const parentWidth = vm.$el.parentNode.offsetWidth || window.offsetWidth + const parentHeight = vm.$el.parentNode.offsetHeight || window.offsetHeight + if (vm.imgSize.width.indexOf('%') != -1) { + img_width = parseInt(vm.imgSize.width) / 100 * parentWidth + 'px' + } else { + img_width = vm.imgSize.width + } + + if (vm.imgSize.height.indexOf('%') != -1) { + img_height = parseInt(vm.imgSize.height) / 100 * parentHeight + 'px' + } else { + img_height = vm.imgSize.height + } + + if (vm.barSize.width.indexOf('%') != -1) { + bar_width = parseInt(vm.barSize.width) / 100 * parentWidth + 'px' + } else { + bar_width = vm.barSize.width + } + + if (vm.barSize.height.indexOf('%') != -1) { + bar_height = parseInt(vm.barSize.height) / 100 * parentHeight + 'px' + } else { + bar_height = vm.barSize.height + } + + return { imgWidth: img_width, imgHeight: img_height, barWidth: bar_width, barHeight: bar_height } +} + +export const _code_chars = [1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] +export const _code_color1 = ['#fffff0', '#f0ffff', '#f0fff0', '#fff0f0'] +export const _code_color2 = ['#FF0033', '#006699', '#993366', '#FF9900', '#66CC66', '#FF33CC'] diff --git a/front-end/mall4v/src/crud/admin/form.js b/front-end/mall4v/src/crud/admin/form.js new file mode 100644 index 00000000..728b7358 --- /dev/null +++ b/front-end/mall4v/src/crud/admin/form.js @@ -0,0 +1,70 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + selection: true, + index: false, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + menuWidth: 350, + align: 'center', + refreshBtn: true, + searchSize: 'mini', + addBtn: false, + editBtn: false, + delBtn: false, + viewBtn: false, + props: { + label: 'label', + value: 'value' + }, + column: [{ + label: '表单名称', + prop: 'formName', + search: true + }, { + label: '按钮文本', + prop: 'buttonName', + search: true + }, { + label: '提交次数', + prop: 'submitNum', + type: 'select', + dicData: [ + { + label: '不做限制', + value: 0 + }, { + label: '每个IP限填一次', + value: 1 + } + ] + }, { + label: '开启验证', + prop: 'needValidation', + type: 'select', + dicData: [ + { + label: '不需要', + value: 0 + }, { + label: '需要', + value: 1 + } + ] + }, { + label: '提交权限', + prop: 'submitPerm', + type: 'select', + dicData: [ + { + label: '所有人', + value: 0 + }, { + label: '仅会员可提交', + value: 1 + } + ] + }] +} diff --git a/front-end/mall4v/src/crud/admin/indexImg.js b/front-end/mall4v/src/crud/admin/indexImg.js new file mode 100644 index 00000000..942e582f --- /dev/null +++ b/front-end/mall4v/src/crud/admin/indexImg.js @@ -0,0 +1,47 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + selection: true, + index: false, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + menuWidth: 350, + align: 'center', + refreshBtn: true, + searchSize: 'mini', + addBtn: false, + editBtn: false, + delBtn: false, + viewBtn: false, + props: { + label: 'label', + value: 'value' + }, + column: [{ + label: '轮播图片', + prop: 'imgUrl', + type: 'upload', + slot: true, + listType: 'picture-img' + }, { + label: '顺序', + prop: 'seq' + }, { + width: 150, + label: '状态', + prop: 'status', + search: true, + type: 'select', + dicData: [ + { + label: '禁用', + value: 0 + }, { + label: '正常', + value: 1 + } + ] + }] +} diff --git a/front-end/mall4v/src/crud/admin/message.js b/front-end/mall4v/src/crud/admin/message.js new file mode 100644 index 00000000..ea9b0338 --- /dev/null +++ b/front-end/mall4v/src/crud/admin/message.js @@ -0,0 +1,52 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + index: false, + indexLabel: '序号', + selection: true, + stripe: true, + menuAlign: 'center', + menuWidth: 350, + align: 'center', + refreshBtn: true, + searchSize: 'mini', + addBtn: false, + editBtn: false, + delBtn: false, + viewBtn: false, + props: { + label: 'label', + value: 'value' + }, + column: [{ + label: '创建时间', + prop: 'createTime' + }, + { + label: '姓名', + prop: 'userName', + search: true + }, { + label: '邮箱', + prop: 'email' + }, { + label: '联系方式', + prop: 'contact' + }, { + label: '审核', + prop: 'status', + search: true, + slot: true, + type: 'select', + dicData: [ + { + label: '未审核', + value: 0 + }, { + label: '审核通过', + value: 1 + } + ] + }] +} diff --git a/front-end/mall4v/src/crud/prod/prodComm.js b/front-end/mall4v/src/crud/prod/prodComm.js new file mode 100644 index 00000000..81b776fd --- /dev/null +++ b/front-end/mall4v/src/crud/prod/prodComm.js @@ -0,0 +1,77 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + index: true, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + align: 'center', + addBtn: false, + editBtn: false, + delBtn: false, + column: [ + { + label: '商品名', + prop: 'prodName', + search: true + }, + { + label: '用户昵称', + prop: 'nickName', + slot: true + }, + { + label: '记录时间', + prop: 'recTime', + width: '200' + }, + { + label: '回复时间', + slot: true, + prop: 'replyTime', + width: '200', + dicData: [ + { + label: '无', + value: '' + } + ] + }, + { + label: '评价得分', + prop: 'score' + }, + { + label: '是否匿名', + prop: 'isAnonymous', + dicData: [ + { + label: '否', + value: 0 + }, { + label: '是', + value: 1 + } + ] + }, + { + prop: 'status', + label: '审核状态', + search: true, + type: 'select', + dicData: [ + { + label: '待审核', + value: 0 + }, { + label: '审核通过', + value: 1 + }, { + label: '审核未通过', + value: -1 + } + ] + } + ] +} diff --git a/front-end/mall4v/src/crud/prod/prodList.js b/front-end/mall4v/src/crud/prod/prodList.js new file mode 100644 index 00000000..b2e3c4a4 --- /dev/null +++ b/front-end/mall4v/src/crud/prod/prodList.js @@ -0,0 +1,59 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + selection: true, + index: false, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + menuWidth: 350, + align: 'center', + refreshBtn: true, + searchSize: 'mini', + addBtn: false, + editBtn: false, + delBtn: false, + viewBtn: false, + props: { + label: 'label', + value: 'value' + }, + column: [{ + label: '产品名字', + prop: 'prodName', + search: true + }, { + label: '商品原价', + prop: 'oriPrice' + }, { + label: '商品现价', + prop: 'price' + }, { + label: '商品库存', + prop: 'totalStocks' + }, { + label: '产品图片', + prop: 'pic', + type: 'upload', + width: 150, + listType: 'picture-img' + + }, { + width: 150, + label: '状态', + prop: 'status', + search: true, + slot: true, + type: 'select', + dicData: [ + { + label: '未上架', + value: 0 + }, { + label: '上架', + value: 1 + } + ] + }] +} diff --git a/front-end/mall4v/src/crud/prod/prodTag.js b/front-end/mall4v/src/crud/prod/prodTag.js new file mode 100644 index 00000000..fadb3c78 --- /dev/null +++ b/front-end/mall4v/src/crud/prod/prodTag.js @@ -0,0 +1,46 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + index: true, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + align: 'center', + addBtn: false, + editBtn: false, + delBtn: false, + column: [ + { + label: '标签名称', + prop: 'title', + search: true, + slot: true + }, + { + label: '状态', + prop: 'status', + type: 'select', + slot: true, + search: true, + dicData: [ + { + label: '禁用', + value: 0 + }, { + label: '正常', + value: 1 + } + ] + }, + { + label: '默认类型', + prop: 'isDfault', + slot: true + }, + { + label: '排序', + prop: 'seq' + } + ] +} diff --git a/front-end/mall4v/src/crud/prod/spec.js b/front-end/mall4v/src/crud/prod/spec.js new file mode 100644 index 00000000..06790c67 --- /dev/null +++ b/front-end/mall4v/src/crud/prod/spec.js @@ -0,0 +1,30 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + index: true, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + menuWidth: 350, + align: 'center', + refreshBtn: true, + searchSize: 'mini', + addBtn: false, + editBtn: false, + viewBtn: false, + delBtn: false, + props: { + label: 'label', + value: 'value' + }, + column: [{ + label: '属性名称', + prop: 'propName', + search: true + }, { + label: '属性值', + prop: 'prodPropValues', + slot: true + }] +} diff --git a/front-end/mall4v/src/crud/shop/hotSearch.js b/front-end/mall4v/src/crud/shop/hotSearch.js new file mode 100644 index 00000000..a7bf9426 --- /dev/null +++ b/front-end/mall4v/src/crud/shop/hotSearch.js @@ -0,0 +1,52 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + index: false, + selection: true, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + align: 'center', + addBtn: false, + editBtn: false, + delBtn: false, + column: [ + { + label: '热搜标题', + prop: 'title', + search: true + }, + { + label: '热搜内容', + prop: 'content', + search: true + }, + { + label: '录入时间', + prop: 'recDate', + sortable: true + }, + { + label: '顺序', + prop: 'seq', + sortable: true + }, + { + label: '启用状态', + prop: 'status', + type: 'select', + slot: true, + search: true, + dicData: [ + { + label: '未启用', + value: 0 + }, { + label: '启用', + value: 1 + } + ] + } + ] +} diff --git a/front-end/mall4v/src/crud/shop/notice.js b/front-end/mall4v/src/crud/shop/notice.js new file mode 100644 index 00000000..6284d24f --- /dev/null +++ b/front-end/mall4v/src/crud/shop/notice.js @@ -0,0 +1,52 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + index: true, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + align: 'center', + addBtn: false, + editBtn: false, + delBtn: false, + column: [ + { + label: '公告内容', + prop: 'title', + search: true + }, + { + label: '状态', + prop: 'status', + search: true, + slot: true, + type: 'select', + dicData: [ + { + label: '撤销', + value: 0 + }, { + label: '公布', + value: 1 + } + ] + }, + { + label: '是否置顶', + prop: 'isTop', + search: true, + slot: true, + type: 'select', + dicData: [ + { + label: '否', + value: 0 + }, { + label: '是', + value: 1 + } + ] + } + ] +} diff --git a/front-end/mall4v/src/crud/shop/pickAddr.js b/front-end/mall4v/src/crud/shop/pickAddr.js new file mode 100644 index 00000000..d884de6b --- /dev/null +++ b/front-end/mall4v/src/crud/shop/pickAddr.js @@ -0,0 +1,43 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + index: false, + selection: true, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + menuWidth: 350, + align: 'center', + refreshBtn: true, + searchSize: 'mini', + addBtn: false, + editBtn: false, + viewBtn: false, + delBtn: false, + props: { + label: 'label', + value: 'value' + }, + column: [ + { + label: '自提点名称', + prop: 'addrName', + search: true + }, { + label: '手机号', + prop: 'mobile' + }, { + label: '省份', + prop: 'province' + }, { + label: '城市', + prop: 'city' + }, { + label: '区/县', + prop: 'area' + }, { + label: '地址', + prop: 'addr' + }] +} diff --git a/front-end/mall4v/src/crud/shop/transport.js b/front-end/mall4v/src/crud/shop/transport.js new file mode 100644 index 00000000..7a02c0bc --- /dev/null +++ b/front-end/mall4v/src/crud/shop/transport.js @@ -0,0 +1,27 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + index: false, + selection: true, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + menuWidth: 350, + align: 'center', + refreshBtn: true, + searchSize: 'mini', + addBtn: false, + editBtn: false, + delBtn: false, + viewBtn: false, + props: { + label: 'label', + value: 'value' + }, + column: [{ + label: '模板名称', + prop: 'transName', + search: true + }] +} diff --git a/front-end/mall4v/src/crud/sys/area.js b/front-end/mall4v/src/crud/sys/area.js new file mode 100644 index 00000000..027da3d2 --- /dev/null +++ b/front-end/mall4v/src/crud/sys/area.js @@ -0,0 +1,30 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + index: true, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + align: 'center', + addBtn: false, + editBtn: false, + column: [ + { + label: '', + prop: 'areaId' + }, + { + label: '', + prop: 'areaName' + }, + { + label: '', + prop: 'parentId' + }, + { + label: '', + prop: 'level' + } + ] +} diff --git a/front-end/mall4v/src/crud/sys/config.js b/front-end/mall4v/src/crud/sys/config.js new file mode 100644 index 00000000..eb807f73 --- /dev/null +++ b/front-end/mall4v/src/crud/sys/config.js @@ -0,0 +1,33 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + selection: true, + index: false, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + menuWidth: 350, + align: 'center', + refreshBtn: true, + searchSize: 'mini', + addBtn: false, + editBtn: false, + delBtn: false, + viewBtn: false, + props: { + label: 'label', + value: 'value' + }, + column: [{ + label: '参数名', + prop: 'paramKey', + search: true + }, { + label: '参数值', + prop: 'paramValue' + }, { + label: '备注', + prop: 'remark' + }] +} diff --git a/front-end/mall4v/src/crud/sys/log.js b/front-end/mall4v/src/crud/sys/log.js new file mode 100644 index 00000000..e9d3081e --- /dev/null +++ b/front-end/mall4v/src/crud/sys/log.js @@ -0,0 +1,47 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + menu: false, // 移除操作栏 + selection: true, + index: false, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + menuWidth: 350, + align: 'center', + refreshBtn: true, + searchSize: 'mini', + addBtn: false, + editBtn: false, + delBtn: false, + viewBtn: false, + props: { + label: 'label', + value: 'value' + }, + column: [{ + label: '用户名', + prop: 'username', + search: true + }, { + label: '用户操作', + prop: 'operation', + search: true + }, { + label: '请求方法', + prop: 'method' + }, { + label: '请求参数', + prop: 'params' + }, { + label: '执行时长(毫秒)', + prop: 'time' + }, { + label: 'IP地址', + prop: 'ip' + }, { + label: '创建时间', + prop: 'createDate' + }] +} diff --git a/front-end/mall4v/src/crud/sys/role.js b/front-end/mall4v/src/crud/sys/role.js new file mode 100644 index 00000000..682aef08 --- /dev/null +++ b/front-end/mall4v/src/crud/sys/role.js @@ -0,0 +1,33 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + selection: true, + index: false, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + menuWidth: 350, + align: 'center', + refreshBtn: true, + searchSize: 'mini', + addBtn: false, + editBtn: false, + delBtn: false, + viewBtn: false, + props: { + label: 'label', + value: 'value' + }, + column: [{ + label: '角色名称', + prop: 'roleName', + search: true + }, { + label: '备注', + prop: 'remark' + }, { + label: '创建时间', + prop: 'createTime' + }] +} diff --git a/front-end/mall4v/src/crud/sys/user.js b/front-end/mall4v/src/crud/sys/user.js new file mode 100644 index 00000000..a2a61a3f --- /dev/null +++ b/front-end/mall4v/src/crud/sys/user.js @@ -0,0 +1,50 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + selection: true, + index: false, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + menuWidth: 350, + align: 'center', + refreshBtn: true, + searchSize: 'mini', + addBtn: false, + editBtn: false, + delBtn: false, + viewBtn: false, + props: { + label: 'label', + value: 'value' + }, + column: [{ + label: '用户名', + prop: 'username', + search: true + }, { + label: '邮箱', + prop: 'email' + }, { + label: '手机号', + prop: 'mobile' + }, { + label: '创建时间', + prop: 'createTime' + }, { + label: '状态', + prop: 'status', + type: 'select', + dicData: [ + { + label: '禁用', + value: 0 + }, { + label: '正常', + value: 1 + } + ] + + }] +} diff --git a/front-end/mall4v/src/crud/user/addr.js b/front-end/mall4v/src/crud/user/addr.js new file mode 100644 index 00000000..8d62154c --- /dev/null +++ b/front-end/mall4v/src/crud/user/addr.js @@ -0,0 +1,80 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + index: true, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + align: 'center', + addBtn: false, + editBtn: false, + delBtn: false, + viewBtn: false, + column: [ + { + label: '收货人名称', + prop: 'receiver' + }, + { + label: '省', + prop: 'province' + }, + { + label: '城市', + prop: 'city' + }, + { + label: '区', + prop: 'area' + }, + { + label: '地址', + prop: 'addr' + }, + { + label: '邮编', + prop: 'postCode' + }, + { + label: '手机', + prop: 'mobile' + }, + { + label: '状态', + prop: 'status', + search: true, + type: 'select', + dicData: [ + { + label: '无效', + value: 0 + }, { + label: '正常', + value: 1 + } + ] + }, + { + label: '默认地址', + prop: 'commonAddr', + dicData: [ + { + label: '否', + value: 0 + }, { + label: '是', + value: 1 + } + ] + }, + { + label: '建立时间', + prop: 'createTime' + }, + { + label: '更新时间', + prop: 'updateTime' + } + ] +} diff --git a/front-end/mall4v/src/crud/user/user.js b/front-end/mall4v/src/crud/user/user.js new file mode 100644 index 00000000..29049e38 --- /dev/null +++ b/front-end/mall4v/src/crud/user/user.js @@ -0,0 +1,53 @@ +export const tableOption = { + searchMenuSpan: 6, + columnBtn: false, + border: true, + // selection: true, + index: false, + indexLabel: '序号', + stripe: true, + menuAlign: 'center', + menuWidth: 350, + align: 'center', + refreshBtn: true, + searchSize: 'mini', + addBtn: false, + editBtn: false, + delBtn: false, + viewBtn: false, + props: { + label: 'label', + value: 'value' + }, + column: [{ + label: '用户昵称', + prop: 'nickName', + search: true + }, { + label: '用户头像', + prop: 'pic', + type: 'upload', + imgWidth: 150, + listType: 'picture-img', + slot: true + }, { + label: '状态', + prop: 'status', + search: true, + type: 'select', + slot: true, + dicData: [ + { + label: '禁用', + value: 0 + }, { + label: '正常', + value: 1 + } + ] + }, { + label: '注册时间', + prop: 'userRegtime', + imgWidth: 150 + }] +} diff --git a/front-end/mall4v/src/icons/SvgIcon.vue b/front-end/mall4v/src/icons/SvgIcon.vue new file mode 100644 index 00000000..8bad1367 --- /dev/null +++ b/front-end/mall4v/src/icons/SvgIcon.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/front-end/mall4v/src/icons/svg/icon-Data.svg b/front-end/mall4v/src/icons/svg/icon-Data.svg new file mode 100644 index 00000000..dfdafdb0 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-Data.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-Distribution.svg b/front-end/mall4v/src/icons/svg/icon-Distribution.svg new file mode 100644 index 00000000..38880357 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-Distribution.svg @@ -0,0 +1,3 @@ + + + diff --git a/front-end/mall4v/src/icons/svg/icon-Distribution1.svg b/front-end/mall4v/src/icons/svg/icon-Distribution1.svg new file mode 100644 index 00000000..109d2b85 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-Distribution1.svg @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/front-end/mall4v/src/icons/svg/icon-Finance.svg b/front-end/mall4v/src/icons/svg/icon-Finance.svg new file mode 100644 index 00000000..078ff626 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-Finance.svg @@ -0,0 +1,11 @@ + + + + + + diff --git a/front-end/mall4v/src/icons/svg/icon-Group.svg b/front-end/mall4v/src/icons/svg/icon-Group.svg new file mode 100644 index 00000000..20ecdd69 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-Group.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/front-end/mall4v/src/icons/svg/icon-Live.svg b/front-end/mall4v/src/icons/svg/icon-Live.svg new file mode 100644 index 00000000..93c05924 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-Live.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/front-end/mall4v/src/icons/svg/icon-Marketing.svg b/front-end/mall4v/src/icons/svg/icon-Marketing.svg new file mode 100644 index 00000000..96fc71c0 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-Marketing.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-Message.svg b/front-end/mall4v/src/icons/svg/icon-Message.svg new file mode 100644 index 00000000..3d22dff8 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-Message.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/front-end/mall4v/src/icons/svg/icon-Platform.svg b/front-end/mall4v/src/icons/svg/icon-Platform.svg new file mode 100644 index 00000000..22aa00d0 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-Platform.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-Points.svg b/front-end/mall4v/src/icons/svg/icon-Points.svg new file mode 100644 index 00000000..275a86c8 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-Points.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/front-end/mall4v/src/icons/svg/icon-Product.svg b/front-end/mall4v/src/icons/svg/icon-Product.svg new file mode 100644 index 00000000..e3e76924 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-Product.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/front-end/mall4v/src/icons/svg/icon-Resources.svg b/front-end/mall4v/src/icons/svg/icon-Resources.svg new file mode 100644 index 00000000..66cb30a5 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-Resources.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-Settlement.svg b/front-end/mall4v/src/icons/svg/icon-Settlement.svg new file mode 100644 index 00000000..f134ddb3 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-Settlement.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/front-end/mall4v/src/icons/svg/icon-admin.svg b/front-end/mall4v/src/icons/svg/icon-admin.svg new file mode 100644 index 00000000..a8889a12 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-admin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-bianji.svg b/front-end/mall4v/src/icons/svg/icon-bianji.svg new file mode 100644 index 00000000..1305cd65 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-bianji.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-config.svg b/front-end/mall4v/src/icons/svg/icon-config.svg new file mode 100644 index 00000000..c75b4387 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-config.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-dangdifill.svg b/front-end/mall4v/src/icons/svg/icon-dangdifill.svg new file mode 100644 index 00000000..9eb01135 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-dangdifill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-daohang.svg b/front-end/mall4v/src/icons/svg/icon-daohang.svg new file mode 100644 index 00000000..e3ee42df --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-daohang.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-decorate.svg b/front-end/mall4v/src/icons/svg/icon-decorate.svg new file mode 100644 index 00000000..08552a1b --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-decorate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-duanxin.svg b/front-end/mall4v/src/icons/svg/icon-duanxin.svg new file mode 100644 index 00000000..855c516f --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-duanxin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-editor.svg b/front-end/mall4v/src/icons/svg/icon-editor.svg new file mode 100644 index 00000000..6fdd731d --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-editor.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-financial.svg b/front-end/mall4v/src/icons/svg/icon-financial.svg new file mode 100644 index 00000000..fa9aa7df --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-financial.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-form.svg b/front-end/mall4v/src/icons/svg/icon-form.svg new file mode 100644 index 00000000..b19cc684 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-form.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/front-end/mall4v/src/icons/svg/icon-geren.svg b/front-end/mall4v/src/icons/svg/icon-geren.svg new file mode 100644 index 00000000..89b1484f --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-geren.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-goods.svg b/front-end/mall4v/src/icons/svg/icon-goods.svg new file mode 100644 index 00000000..87d00c64 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-goods.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-inventory.svg b/front-end/mall4v/src/icons/svg/icon-inventory.svg new file mode 100644 index 00000000..3e891f87 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-inventory.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-jiesuo.svg b/front-end/mall4v/src/icons/svg/icon-jiesuo.svg new file mode 100644 index 00000000..2e8cc026 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-jiesuo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-job.svg b/front-end/mall4v/src/icons/svg/icon-job.svg new file mode 100644 index 00000000..c2fc231a --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-job.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-log.svg b/front-end/mall4v/src/icons/svg/icon-log.svg new file mode 100644 index 00000000..c97a6721 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-log.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/front-end/mall4v/src/icons/svg/icon-members.svg b/front-end/mall4v/src/icons/svg/icon-members.svg new file mode 100644 index 00000000..4497cceb --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-members.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-menu.svg b/front-end/mall4v/src/icons/svg/icon-menu.svg new file mode 100644 index 00000000..c115201d --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-menu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-msg-tip.svg b/front-end/mall4v/src/icons/svg/icon-msg-tip.svg new file mode 100644 index 00000000..daa84407 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-msg-tip.svg @@ -0,0 +1,18 @@ + + + + diff --git a/front-end/mall4v/src/icons/svg/icon-mudedi.svg b/front-end/mall4v/src/icons/svg/icon-mudedi.svg new file mode 100644 index 00000000..665f4ef8 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-mudedi.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-notice.svg b/front-end/mall4v/src/icons/svg/icon-notice.svg new file mode 100644 index 00000000..ca0c7270 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-notice.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-order.svg b/front-end/mall4v/src/icons/svg/icon-order.svg new file mode 100644 index 00000000..307888d2 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-order.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-oss.svg b/front-end/mall4v/src/icons/svg/icon-oss.svg new file mode 100644 index 00000000..964ff543 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-oss.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-pinglun.svg b/front-end/mall4v/src/icons/svg/icon-pinglun.svg new file mode 100644 index 00000000..89dbe1d7 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-pinglun.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-prod.svg b/front-end/mall4v/src/icons/svg/icon-prod.svg new file mode 100644 index 00000000..0e65630d --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-prod.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-role.svg b/front-end/mall4v/src/icons/svg/icon-role.svg new file mode 100644 index 00000000..6d02fc12 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-role.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-set.svg b/front-end/mall4v/src/icons/svg/icon-set.svg new file mode 100644 index 00000000..8a6d5749 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-set.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-shanchu.svg b/front-end/mall4v/src/icons/svg/icon-shanchu.svg new file mode 100644 index 00000000..02e4673b --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-shanchu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-shezhi.svg b/front-end/mall4v/src/icons/svg/icon-shezhi.svg new file mode 100644 index 00000000..270e54c5 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-shezhi.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-shoucang.svg b/front-end/mall4v/src/icons/svg/icon-shoucang.svg new file mode 100644 index 00000000..ab6fc171 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-shoucang.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-shoucangfill.svg b/front-end/mall4v/src/icons/svg/icon-shoucangfill.svg new file mode 100644 index 00000000..8e278e10 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-shoucangfill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-shouye.svg b/front-end/mall4v/src/icons/svg/icon-shouye.svg new file mode 100644 index 00000000..aa96cdba --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-shouye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-sousuo.svg b/front-end/mall4v/src/icons/svg/icon-sousuo.svg new file mode 100644 index 00000000..08c5ffb8 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-sousuo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-sql.svg b/front-end/mall4v/src/icons/svg/icon-sql.svg new file mode 100644 index 00000000..d8203720 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-sql.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-store.svg b/front-end/mall4v/src/icons/svg/icon-store.svg new file mode 100644 index 00000000..a4f7d228 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-store.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-suoding.svg b/front-end/mall4v/src/icons/svg/icon-suoding.svg new file mode 100644 index 00000000..9ab7d7a3 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-suoding.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-system.svg b/front-end/mall4v/src/icons/svg/icon-system.svg new file mode 100644 index 00000000..0a36a868 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-system.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-tixing.svg b/front-end/mall4v/src/icons/svg/icon-tixing.svg new file mode 100644 index 00000000..03084e9d --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-tixing.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-tubiao.svg b/front-end/mall4v/src/icons/svg/icon-tubiao.svg new file mode 100644 index 00000000..53f34453 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-tubiao.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/front-end/mall4v/src/icons/svg/icon-vip.svg b/front-end/mall4v/src/icons/svg/icon-vip.svg new file mode 100644 index 00000000..79f4e593 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-vip.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-xiangqu.svg b/front-end/mall4v/src/icons/svg/icon-xiangqu.svg new file mode 100644 index 00000000..4a46c9b7 --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-xiangqu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-xiangqufill.svg b/front-end/mall4v/src/icons/svg/icon-xiangqufill.svg new file mode 100644 index 00000000..f56ac48b --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-xiangqufill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/icons/svg/icon-zhedie.svg b/front-end/mall4v/src/icons/svg/icon-zhedie.svg new file mode 100644 index 00000000..25eac25e --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-zhedie.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/front-end/mall4v/src/icons/svg/icon-zonghe.svg b/front-end/mall4v/src/icons/svg/icon-zonghe.svg new file mode 100644 index 00000000..9c2fa5fe --- /dev/null +++ b/front-end/mall4v/src/icons/svg/icon-zonghe.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front-end/mall4v/src/layout/main-content.vue b/front-end/mall4v/src/layout/main-content.vue new file mode 100644 index 00000000..cd16490b --- /dev/null +++ b/front-end/mall4v/src/layout/main-content.vue @@ -0,0 +1,85 @@ + + + + diff --git a/front-end/mall4v/src/layout/main-navbar-update-password.vue b/front-end/mall4v/src/layout/main-navbar-update-password.vue new file mode 100644 index 00000000..e981fd9d --- /dev/null +++ b/front-end/mall4v/src/layout/main-navbar-update-password.vue @@ -0,0 +1,121 @@ + + + diff --git a/front-end/mall4v/src/layout/main-navbar.vue b/front-end/mall4v/src/layout/main-navbar.vue new file mode 100644 index 00000000..e5cd7247 --- /dev/null +++ b/front-end/mall4v/src/layout/main-navbar.vue @@ -0,0 +1,172 @@ + + + + + diff --git a/front-end/mall4v/src/layout/main-sidebar-sub-menu-item.vue b/front-end/mall4v/src/layout/main-sidebar-sub-menu-item.vue new file mode 100644 index 00000000..867e1afa --- /dev/null +++ b/front-end/mall4v/src/layout/main-sidebar-sub-menu-item.vue @@ -0,0 +1,125 @@ + + + + diff --git a/front-end/mall4v/src/layout/main-sidebar-sub-menu.vue b/front-end/mall4v/src/layout/main-sidebar-sub-menu.vue new file mode 100644 index 00000000..63223916 --- /dev/null +++ b/front-end/mall4v/src/layout/main-sidebar-sub-menu.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/front-end/mall4v/src/layout/main-sidebar.vue b/front-end/mall4v/src/layout/main-sidebar.vue new file mode 100644 index 00000000..797e6a2a --- /dev/null +++ b/front-end/mall4v/src/layout/main-sidebar.vue @@ -0,0 +1,295 @@ + + + + diff --git a/front-end/mall4v/src/layout/main.vue b/front-end/mall4v/src/layout/main.vue new file mode 100644 index 00000000..4967b794 --- /dev/null +++ b/front-end/mall4v/src/layout/main.vue @@ -0,0 +1,59 @@ + + + diff --git a/front-end/mall4v/src/main.js b/front-end/mall4v/src/main.js new file mode 100644 index 00000000..7ec19352 --- /dev/null +++ b/front-end/mall4v/src/main.js @@ -0,0 +1,49 @@ +import { createApp } from 'vue' +import App from './App.vue' +import { createPinia } from 'pinia' +import ElementPlus from 'element-plus' +import moment from 'moment' +import 'element-plus/dist/index.css' +import * as ElementPlusIconsVue from '@element-plus/icons-vue' +import router from '@/router' +import locale from 'element-plus/lib/locale/lang/zh-cn' +import Avue from '@smallwei/avue' +import '@smallwei/avue/lib/index.css' + +// 全局样式 +import '@/styles/index.scss' +// svg +import 'virtual:svg-icons-register' +import svgIcon from '@/icons/SvgIcon.vue' +moment.locale('zh-cn', { + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY-MM-DD', + LL: 'YYYY-MM-DD HH:mm:ss' + }, + week: { + // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 + dow: 1, // 星期一, 是一个星期的第一天 + doy: 4 // 1月4日所在的的一周是一年的第一周 + } +}) +const app = createApp(App) + +// router +app.use(router) +// pinia +const pinia = createPinia() +app.use(pinia) + +app.component('SvgIcon', svgIcon) + +// Avue +app.use(Avue) +// element-plus +app.use(ElementPlus, { locale }) +for (const [key, component] of Object.entries(ElementPlusIconsVue)) { + app.component(key, component) +} + +app.mount('#app') diff --git a/front-end/mall4v/src/router/index.js b/front-end/mall4v/src/router/index.js new file mode 100644 index 00000000..013bf38f --- /dev/null +++ b/front-end/mall4v/src/router/index.js @@ -0,0 +1,216 @@ +import { createRouter, createWebHistory } from 'vue-router' +import cookie from 'vue-cookies' +import { isURL } from '@/utils/validate' +import { clearLoginInfo } from '@/utils' +import Layout from '@/layout/main.vue' +import Login from '@/views/common/login/index.vue' + +// 全局路由(无需嵌套上左右整体布局) +const globalRoutes = [ + { + path: '/404', + component: () => import('@/views/common/error-page/404.vue'), + name: '404', + meta: { title: '404未找到' } + }, + { + path: '/login', + component: Login, + name: 'login', + meta: { title: '登录' } + } +] + +export const mainRoutes = { + path: '/', + component: Layout, + name: 'home', + redirect: '/home', + children: [ + { + path: 'home', + name: 'home', + component: () => import('@/views/common/home/index.vue') + }, + { + path: '/prodInfo', + name: 'prodInfo', + component: () => import('@/views/modules/prod/prodInfo/index.vue') + } + ], + // eslint-disable-next-line no-unused-vars + beforeEnter (to, from, next) { + const authorization = cookie.get('Authorization') + if (!authorization || !/\S/.test(authorization)) { + clearLoginInfo() + next({ name: 'login' }) + } + next() + } +} + +const router = createRouter({ + history: createWebHistory(), + scrollBehavior: () => ({ top: 0 }), + isAddDynamicMenuRoutes: false, // 是否已经添加动态(菜单)路由 + routes: globalRoutes.concat(mainRoutes) +}) + +// eslint-disable-next-line no-unused-vars +router.beforeEach((to, from, next) => { + const commonStore = useCommonStore() + // 添加动态(菜单)路由 + // 1. 已经添加 or 全局路由, 直接访问 + // 2. 获取菜单列表, 添加并保存本地存储 + if (router.options.isAddDynamicMenuRoutes || fnCurrentRouteType(to, globalRoutes) === 'global') { + const routeList = commonStore.routeList + let navTitles = [] + let leftMenuId = '' + routeList.forEach(item => { + if (to.meta.menuId === item.menuId) { + navTitles.push(item.name) + routeList.forEach(item1 => { + if (item.parentId === item1.menuId) { + navTitles.push(item1.name) + leftMenuId = item.parentId + routeList.forEach(item2 => { + if (item1.parentId === item2.menuId) { + navTitles.push(item2.name) + leftMenuId = item1.parentId + } + }) + } + }) + } + }) + navTitles = navTitles.reverse() + if (to.meta.isLeftMenu || to.path === '/home' || leftMenuId) { + if (leftMenuId) { + commonStore.updateSelectLeftId(leftMenuId) + commonStore.updateSelectRightId(to.meta.menuId) + } else { + commonStore.updateSidebarFold(true) + commonStore.updateSelectLeftId(to.path === '/home' ? '' : to.meta.menuId) + } + } + commonStore.updateSelectMenu(navTitles) + next() + } else { + http({ + url: http.adornUrl('/sys/menu/nav'), + method: 'get', + params: http.adornParams() + }).then(({ data }) => { + sessionStorage.setItem('Authorities', JSON.stringify(data.authorities || '[]')) + fnAddDynamicMenuRoutes(data.menuList) + router.options.isAddDynamicMenuRoutes = true + const rList = [] + data.menuList.forEach(item => { + item.isLeftMenu = item.parentId === 0 + rList.push({ + menuId: item.menuId, + name: item.name, + parentId: item.parentId, + url: item.url + }) + if (item.list) { + item.list.forEach(item1 => { + item1.isLeftMenu = item1.parentId === 0 + rList.push({ + menuId: item1.menuId, + name: item1.name, + parentId: item1.parentId, + url: item1.url + }) + if (item1.list) { + item1.list.forEach(item2 => { + item2.isLeftMenu = item2.parentId === 0 + rList.push({ + menuId: item2.menuId, + name: item2.name, + parentId: item2.parentId, + url: item2.url + }) + }) + } + }) + } + }) + fnAddDynamicMenuRoutes(data.menuList) + sessionStorage.setItem('menuList', JSON.stringify(data.menuList || '[]')) + commonStore.updateRouteList(rList) + commonStore.updateMenuIds(rList) + next({ ...to, replace: true }) + }).catch(e => { + // eslint-disable-next-line no-console + console.log(`%c${e} 请求菜单列表和权限失败,跳转至登录页!!`, 'color:blue') + router.push({ name: 'login' }) + }) + } +}) + +/** + * 判断当前路由类型, global: 全局路由, main: 主入口路由 + * @param {*} route 当前路由 + * @param globalRoutes 全局路由 + */ +function fnCurrentRouteType (route, globalRoutes = []) { + let temp = [] + for (let i = 0; i < globalRoutes.length; i++) { + if (route.path === globalRoutes[i].path) { + return 'global' + } else if (globalRoutes[i].children && globalRoutes[i].children.length >= 1) { + temp = temp.concat(globalRoutes[i].children) + } + } + return temp.length >= 1 ? fnCurrentRouteType(route, temp) : 'main' +} + +/** + * 添加动态(菜单)路由 + * @param {*} menuList 菜单列表 + * @param {*} routes 递归创建的动态(菜单)路由 + */ +function fnAddDynamicMenuRoutes (menuList = [], routes = []) { + let temp = [] + const modules = import.meta.glob('../views/modules/**/index.vue') + for (let i = 0; i < menuList.length; i++) { + if (menuList[i].list && menuList[i].list.length >= 1) { + temp = temp.concat(menuList[i].list) + } else if (menuList[i].url && /\S/.test(menuList[i].url)) { + menuList[i].url = menuList[i].url.replace(/^\//, '') + const route = { + path: menuList[i].url, + component: null, + name: menuList[i].url, + meta: { + menuId: menuList[i].menuId, + title: menuList[i].name, + isDynamic: true, + isTab: true, + iframeUrl: '' + } + } + // url以http[s]://开头, 通过iframe展示 + if (isURL(menuList[i].url)) { + route.path = `i-${menuList[i].menuId}` + route.name = `i-${menuList[i].menuId}` + route.meta.iframeUrl = menuList[i].url + } else { + try { + route.component = modules[`../views/modules/${menuList[i].url}/index.vue`] || null + } catch (e) {} + } + routes.push(route) + } + } + if (temp.length >= 1) { + fnAddDynamicMenuRoutes(temp, routes) + } else { + mainRoutes.name = 'main-dynamic' + mainRoutes.children = routes + router.addRoute(mainRoutes) + } + router.addRoute({ path: '/:pathMatch(.*)*', redirect: { name: '404' } }) +} +export default router diff --git a/front-end/mall4v/src/stores/common.js b/front-end/mall4v/src/stores/common.js new file mode 100644 index 00000000..72ba4af7 --- /dev/null +++ b/front-end/mall4v/src/stores/common.js @@ -0,0 +1,80 @@ +import { defineStore } from 'pinia' +import router from '@/router' +export const useCommonStore = defineStore('common', { + state: () => { + return { + // 页面文档可视高度(随窗口改变大小) + documentClientHeight: 0, + // 侧边栏, 布局皮肤, light(浅色) / dark(黑色) + sidebarLayoutSkin: 'dark', + // 侧边栏, 折叠状态 + sidebarFold: true, + // 侧边栏, 菜单 + menuList: [], + menuActiveName: '', + // 主入口标签页 + mainTabs: [], + mainTabsActiveName: '', + // 当前选择的标签 + selectMenu: [], + // 路由列表 + routeList: [], + menuIds: [], + selectLeftId: '', + selectRightId: '' + } + }, + actions: { + updateDocumentClientHeight (height) { + this.documentClientHeight = height + }, + updateSidebarFold (fold) { + this.sidebarFold = fold + }, + updateMenuList (list) { + this.menuList = list + }, + updateMenuActiveName (name) { + this.menuActiveName = name + }, + updateMainTabs (tabs) { + this.mainTabs = tabs + }, + updateMainTabsActiveName (name) { + this.mainTabsActiveName = name + }, + updateRouteList (list) { + this.routeList = list + }, + updateSelectMenu (list) { + this.selectMenu = list + }, + updateSelectLeftId (id) { + this.selectLeftId = id + }, + updateSelectRightId (id) { + this.selectRightId = id + }, + replaceSelectMenu (title) { + this.selectMenu.splice(this.selectMenu.length - 1, 1, title) + }, + updateMenuIds (list) { + this.menuIds = [] + list.forEach(menu => { + this.menuIds.push(String(menu.menuId + '')) + }) + }, + removeMainActiveTab () { + this.mainTabs = this.mainTabs.filter(item => item.name !== this.mainTabsActiveName) + if (this.mainTabs.length >= 1) { + // 当前选中tab被删除 + router.push({ name: this.mainTabs[this.mainTabs.length - 1].name }, () => { + this.mainTabsActiveName = this.mainTabs[this.mainTabs.length - 1].name + }) + } else { + this.menuActiveName = '' + router.push({ name: 'home' }) + } + } + } +}) diff --git a/front-end/mall4v/src/stores/prod.js b/front-end/mall4v/src/stores/prod.js new file mode 100644 index 00000000..ef07f3c7 --- /dev/null +++ b/front-end/mall4v/src/stores/prod.js @@ -0,0 +1,37 @@ +import { defineStore } from 'pinia' +export const scoreProdStore = defineStore('prod', { + state: () => { + return { + id: 0, + skuTags: [], + defalutSku: { + price: 0, // 销售价 + oriPrice: 0, // 市场价 + stocks: 0, // 库存 + properties: '', // 销售属性组合字符串 + skuName: '', // sku名称 + prodName: '', // 商品名称 + weight: 0, // 商品重量 + volume: 0, // 商品体积 + status: 1 // 0 禁用 1 启用 + } + } + }, + actions: { + updateSkuTags (skuTags) { + this.skuTags = skuTags + }, + addSkuTag (skuTag) { + this.skuTags.push(skuTag) + }, + removeSkuTag (tagIndex) { + this.skuTags.splice(tagIndex, 1) + }, + removeSkuTagItem (tagIndex, tagItemIndex) { + this.skuTags[tagIndex].tagItems.splice(tagItemIndex, 1) + }, + addSkuTagItem ({ tagIndex, tagItem }) { + this.skuTags[tagIndex].tagItems.push(tagItem) + } + } +}) diff --git a/front-end/mall4v/src/stores/user.js b/front-end/mall4v/src/stores/user.js new file mode 100644 index 00000000..0af1012d --- /dev/null +++ b/front-end/mall4v/src/stores/user.js @@ -0,0 +1,29 @@ +import { defineStore } from 'pinia' +export const useUserStore = defineStore('user', { + state: () => { + return { + id: 0, + name: '', + userId: '', + shopId: '', + mobile: '' + } + }, + actions: { + updateId (id) { + this.id = id + }, + updateName (name) { + this.name = name + }, + updateMobile (mobile) { + this.mobile = mobile + }, + updateShopId (shopId) { + this.shopId = shopId + }, + updateUserId (userId) { + this.userId = userId + } + } +}) diff --git a/front-end/mall4v/src/styles/_base.scss b/front-end/mall4v/src/styles/_base.scss new file mode 100644 index 00000000..088920b0 --- /dev/null +++ b/front-end/mall4v/src/styles/_base.scss @@ -0,0 +1,517 @@ +*, +*:before, +*:after { + box-sizing: border-box; +} +body { + font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif; + font-size: 14px; + line-height: 1.15; + color: #303133; + background-color: #fff; +} +a { + color: mix(#fff, $--color-primary, 20%); + text-decoration: none; + &:focus, + &:hover { + color: $--color-primary; + text-decoration: underline; + } +} +img { + vertical-align: middle; + max-width: 100%; +} + + +/* Utils +------------------------------ */ +.clearfix:before, +.clearfix:after { + content: " "; + display: table; +} +.clearfix:after { + clear: both; +} + + + + +/* Reset element-ui +------------------------------ */ +.site-wrapper { + .el-pagination { + display: flex; + justify-content: flex-end; + } +} + + +/* Layout +------------------------------ */ +.site-wrapper { + position: relative; + min-width: 1180px; +} + + +/* Sidebar fold +------------------------------ */ +.site-content--tabs { + padding: 60px 20px 20px 20px !important; +} +.site-navbar { + color: #333333; +} +.site-sidebar--fold { + .site-navbar__header, + .site-navbar__brand, + .site-sidebar { + width: 100px; + } + .site-navbar__body, + .site-content__wrapper { + margin-left: 100px; + border-bottom: 1px solid #EBEDF0; + } + .site-navbar__brand { + &-lg { + display: none; + } + &-mini { + display: inline-block; + } + } + .site-sidebar, + .site-sidebar__inner { + overflow: initial; + } +} +// animation +.site-sidebar, +.site-sidebar__menu-icon, +.site-content__wrapper, +.site-content--tabs > .el-tabs .el-tabs__header { + transition: inline-block .3s, left .3s, width .3s, margin-left .3s, font-size .3s; +} + + +/* Navbar +------------------------------ */ +.site-navbar { + position: fixed; + top: 0; + right: 0; + left: 0; + z-index: 1030; + height: 50px; + // box-shadow: 0 2px 4px rgba(0, 0, 0, .08); + background-color: $navbar--background-color; + + &__header { + position: relative; + float: left; + // width: 180px; + height: 50px; + margin-left: 20px; + overflow: hidden; + } + &__brand { + display: table-cell; + vertical-align: middle; + // width: 230px; + height: 50px; + margin: 0; + line-height: 50px; + font-size: 20px; + text-align: center; + text-transform: uppercase; + white-space: nowrap; + color: #fff; + + &-lg, + &-mini { + margin: 0 5px; + color: #fff; + &:focus, + &:hover { + color: #fff; + text-decoration: none; + } + } + &-mini { + display: none; + } + } + &__switch { + font-size: 18px; + border-bottom: none !important; + } + &__avatar { + border-bottom: none !important; + * { + vertical-align: inherit; + } + .el-dropdown-link { + > img { + width: 36px; + height: auto; + margin-right: 5px; + border-radius: 100%; + vertical-align: middle; + } + } + } + &__body { + position: relative; + // margin-left: 230px; + // padding-right: 15px; + background-color: #fff; + } + &__menu { + float: left; + background-color: transparent; + border-bottom: 0; + + &--right { + float: right; + } + a:focus, + a:hover { + text-decoration: none; + } + } +} + + +/* Sidebar +------------------------------ */ +.site-sidebar { + position: fixed; + top: 50px; + left: 0; + bottom: 0; + z-index: 1020; + width: 250px; + overflow: hidden; + + &--dark, + &--dark-popper { + background-color: $sidebar--background-color-dark; + } + &__inner { + position: relative; + z-index: 1; + width: 250px; + height: 100%; + padding-bottom: 15px; + overflow-y: scroll; + } + &__menu.el-menu { + width: 100px; + border-right: 0; + } + &__menu-icon { + width: 24px; + margin-right: 5px; + text-align: center; + font-size: 16px; + color: inherit !important; + } +} + + +/* Content +------------------------------ */ +.site-content { + position: relative; + padding: 15px; + background-color: #F5F6F9; + + &__wrapper { + position: relative; + padding-top: 50px; + margin-left: 230px; + min-height: 100%; + background: $content--background-color; + } + &--tabs { + padding: 55px 0 0; + } +} + + +// 新版规范全局统一样式 +// el-table 表格表头样式 +.table-header { + background-color: #f7f8fa !important; + color: #000; + height: 60px; +} +// el-table 表格行样式 - 多行文本/图文 +.table-row { + height: 100px; +} +// el-table 表格行样式 - 单行文本展示 +.table-row-low { + height: 65px; +} +// el-table 表格单元格样式 +.table-cell { + padding: 0; +} +// 表格文字换行模式 +.el-table .cell { + line-height: 20px !important; + word-break: break-word !important; +} +// 表格第一列样式(内容&表头) +.el-table tr > td:first-child > .cell, +.el-table th:first-child > .cell { + padding-left: 20px; +} + +// 按钮样式 +.default-btn { + height: 32px; + line-height: 32px; + padding: 0 15px; + font-size: 13px; + background-color: #fff; + border: 1px solid #dcdfe6; + border-radius: 2px; + cursor: pointer; + display: inline-block; +} +.default-btn:hover { + color: #155bd4; + border-color: #155bd4; +} +.default-btn.primary-btn { + color: #ffffff; + background-color: #155bd4; + border-color: #155bd4; +} +.default-btn.primary-btn:hover { + background: #447cdd; + border-color: #447cdd; +} +.default-btn.text-btn { + font-size: 14px; + padding: 0; + margin-right: 0; + border: none; + color: #155bd4; + background-color: unset; + word-break: keep-all; +} +.default-btn.text-btn:hover { + color: #447cdd; +} +.default-btn.text-btn.disabled-btn { + color: #C0C4CC; + &:hover { + cursor: not-allowed; + color: #C0C4CC; + } +} +.default-btn.primary-btn.disabled-btn { + color: #ffffff; + background-color: #8aadea; + border-color: #8aadea; + &:hover { + background-color: #8aadea; + border-color: #8aadea; + cursor: not-allowed; + } +} +.default-btn.disabled-btn { + color: #999; + &:hover { + border-color: #dcdfe6; + cursor: not-allowed; + } +} +// 相邻按钮样式 +.default-btn + .default-btn { + margin-left: 10px; +} +.text-btn + .text-btn { + margin-left: 20px; +} + +// 状态展示 +.tag-text { + font-size: 14px; +} + +// el-dialog 样式 +.el-dialog__header { + border-bottom: 1px solid #f0f0f0; + margin-right: 0; +} + +.el-dialog__footer { + border-top: 1px solid #f0f0f0; +} + + +// 列表布局样式 +// 搜索栏 +.search-bar { + padding: 25px 20px 0; + margin-bottom: 20px; + background-color: #F7F8FA; + .input-row { + display: block; + // 选择器(下拉框) & 输入框 宽度 + .el-form-item .el-form-item__content .el-select, + .el-form-item .el-form-item__content .el-input { + width: 200px; + white-space: nowrap; + display: -webkit-inline-flex; + } + } + .el-form--inline .el-form-item { + margin-right: 20px !important; + margin-bottom: 25px; + .el-form-item__label-wrap { + margin-left: unset !important; + } + } +} +// 主体 +.main-container { + // 操作按钮 + .operation-bar { + position: relative; + display: flex; + align-items: center; + height: 32px; + line-height: 32px; + .el-checkbox { + padding-left: 20px; + margin-right: 10px; + } + .had-selected { + font-size: 12px; + margin-right: 10px; + } + .tag-text { + font-size: 12px; + } + } + // 表格 + .table-con { + margin-top: 20px; + padding-bottom: 30px; + .text-btn-con { + width: 100%; + display: flex; + justify-content: center; + } + // 图片 + 文本 + .table-cell-con { + display: flex; + align-items: center; + .table-cell-image { + width: 60px; + height: 60px; + img { + display: block; + width: 100%; + height: 100%; + object-fit: contain; + } + } + .table-cell-text { + margin-left: 8px; + flex: 1; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + word-break: break-word; + display: -webkit-box; + -webkit-line-clamp: 2; + /* autoprefixer: ignore next */ + -webkit-box-orient: vertical; + overflow: hidden; + line-height: 20px; + } + } + // 纯图片 + .table-cell-image { + width: 60px; + height: 60px; + img { + display: block; + width: 100%; + height: 100%; + object-fit: contain; + } + } + // 纯文本 + .table-cell-text { + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + word-break: break-word; + display: -webkit-box; + -webkit-line-clamp: 2; + /* autoprefixer: ignore next */ + -webkit-box-orient: vertical; + overflow: hidden; + line-height: 20px; + } + .line-clamp-one { + -webkit-line-clamp: 1; + } + } +} + +// el-tabs 样式 +.el-tabs__nav-wrap::after{ + height: 1px !important; +} +.el-tabs__active-bar { + width: 0 !important; +} +.el-tabs__item { + padding: 0 20px !important; + min-width: 68px; + width: auto; + text-align: center; +} +.el-tabs__item.is-active { + background: none; + border-bottom: 2px solid #155BD4; +} + +// 新增页面头部标题样式 +.new-page-title { + width: 100%; + height: 62px; + background: #F7F8FA; + box-sizing: border-box; + padding: 19px 20px; + display: flex; + align-items: center; + margin-bottom: 20px; + .line { + width: 4px; + height: 19px; + background: #155BD4; + opacity: 1; + border-radius: 2px; + margin-right: 10px; + } + .text { + font-size: 18px; + font-weight: bold; + color: #333333; + opacity: 1; + } +} +.time-select-item { + text-align: center; +} \ No newline at end of file diff --git a/front-end/mall4v/src/styles/_normalize.scss b/front-end/mall4v/src/styles/_normalize.scss new file mode 100644 index 00000000..7fb5177f --- /dev/null +++ b/front-end/mall4v/src/styles/_normalize.scss @@ -0,0 +1,445 @@ +/*! normalize.css v7.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 + * IE on Windows Phone and in iOS. + */ + + html { + line-height: 1.15; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers (opinionated). + */ + +body { + margin: 0; +} + +/** + * Add the correct display in IE 9-. + */ + +article, +aside, +footer, +header, +nav, +section { + display: block; +} + +/** + * 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 + ========================================================================== */ + +/** + * Add the correct display in IE 9-. + * 1. Add the correct display in IE. + */ + +figcaption, +figure, +main { /* 1 */ + display: block; +} + +/** + * Add the correct margin in IE 8. + */ + +figure { + margin: 1em 40px; +} + +/** + * 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 + ========================================================================== */ + +/** + * 1. Remove the gray background on active links in IE 10. + * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. + */ + +a { + background-color: transparent; /* 1 */ +} + +/** + * 1. Remove the bottom border in Chrome 57- and Firefox 39-. + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + +abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ +} + +/** + * Prevent the duplicate application of `bolder` by the next rule in Safari 6. + */ + +b, +strong { + font-weight: inherit; +} + +/** + * 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 style in Android 4.3-. + */ + +dfn { + font-style: italic; +} + +/** + * Add the correct background and color in IE 9-. + */ + +mark { + background-color: #ff0; + color: #000; +} + +/** + * 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 + ========================================================================== */ + +/** + * Add the correct display in IE 9-. + */ + +audio, +video { + display: inline-block; +} + +/** + * Add the correct display in iOS 4-7. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Remove the border on images inside links in IE 10-. + */ + +img { + border-style: none; +} + +/** + * Hide the overflow in IE. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Forms + ========================================================================== */ + +/** + * 1. Change the font styles in all browsers (opinionated). + * 2. Remove the margin in Firefox and Safari. + */ + +button, +input, +optgroup, +select, +textarea { + font-family: sans-serif; /* 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; +} + +/** + * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` + * controls in Android 4. + * 2. Correct the inability to style clickable types in iOS and Safari. + */ + +button, +html [type="button"], /* 1 */ +[type="reset"], +[type="submit"] { + -webkit-appearance: button; /* 2 */ +} + +/** + * 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 */ +} + +/** + * 1. Add the correct display in IE 9-. + * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ +} + +/** + * Remove the default vertical scrollbar in IE. + */ + +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 and cancel buttons in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-cancel-button, +[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 IE 9-. + * 1. Add the correct display in Edge, IE, and Firefox. + */ + +details, /* 1 */ +menu { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Scripting + ========================================================================== */ + +/** + * Add the correct display in IE 9-. + */ + +canvas { + display: inline-block; +} + +/** + * Add the correct display in IE. + */ + +template { + display: none; +} + +/* Hidden + ========================================================================== */ + +/** + * Add the correct display in IE 10-. + */ + +[hidden] { + display: none; +} \ No newline at end of file diff --git a/front-end/mall4v/src/styles/_variables.scss b/front-end/mall4v/src/styles/_variables.scss new file mode 100644 index 00000000..4518fa2e --- /dev/null +++ b/front-end/mall4v/src/styles/_variables.scss @@ -0,0 +1,14 @@ + +// css 变量 +$--color-primary: #155BD4; + +// Navbar +$navbar--background-color: $--color-primary; + +// Sidebar +$sidebar--background-color-dark: #263238; +$sidebar--color-text-dark: #8a979e; + +// Content +$content--background-color: #f1f4f5; + diff --git a/front-end/mall4v/src/styles/element-variables.scss b/front-end/mall4v/src/styles/element-variables.scss new file mode 100644 index 00000000..25c06812 --- /dev/null +++ b/front-end/mall4v/src/styles/element-variables.scss @@ -0,0 +1,7 @@ +// element-plus +:root { + --el-color-primary: #155BD4; + --el-color-primary-light-3: #447cdd; + --el-menu-item-height: 40px; + --el-menu-sub-item-height: 40px; +} diff --git a/front-end/mall4v/src/styles/index.scss b/front-end/mall4v/src/styles/index.scss new file mode 100644 index 00000000..526a674d --- /dev/null +++ b/front-end/mall4v/src/styles/index.scss @@ -0,0 +1,8 @@ +@import "_normalize"; // api: https://github.com/necolas/normalize.css/ +@import "_variables"; +@import "_base"; +@import "@/styles/element-variables.scss"; + +.element-error-message-zindex { + z-index:3000 !important; +} diff --git a/front-end/mall4v/src/utils/crypto.js b/front-end/mall4v/src/utils/crypto.js new file mode 100644 index 00000000..f1ecc2ff --- /dev/null +++ b/front-end/mall4v/src/utils/crypto.js @@ -0,0 +1,14 @@ +import CryptoJS from 'crypto-js' +// 加密 +const keyStr = '-mall4j-password' // 解密用的key +export function encrypt (word) { + const time = Date.now() + + const key = CryptoJS.enc.Utf8.parse(keyStr) + const srcs = CryptoJS.enc.Utf8.parse(time + word) // 加密方式: 时间戳 + 密文 + const encrypted = CryptoJS.AES.encrypt(srcs, key, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7 + }) + return encrypted.toString() +} diff --git a/front-end/mall4v/src/utils/debounce.js b/front-end/mall4v/src/utils/debounce.js new file mode 100644 index 00000000..ecbb79a2 --- /dev/null +++ b/front-end/mall4v/src/utils/debounce.js @@ -0,0 +1,19 @@ +// 防抖 防止表单重复提交 +export const Debounce = (fn, t) => { + const delay = t || 1000 + let timer + return function () { + const args = arguments + if (timer) { + clearTimeout(timer) + } + + const callNow = !timer + + timer = setTimeout(() => { + timer = null + }, delay) + + if (callNow) fn.apply(this, args) + } +} diff --git a/front-end/mall4v/src/utils/http.js b/front-end/mall4v/src/utils/http.js new file mode 100644 index 00000000..109564e0 --- /dev/null +++ b/front-end/mall4v/src/utils/http.js @@ -0,0 +1,190 @@ +import axios from 'axios' +import qs from 'qs' +import cookie from 'vue-cookies' +import router from '@/router' +import merge from 'lodash/merge' +import { clearLoginInfo } from '@/utils' +import { ElMessage } from 'element-plus' + +const http = axios.create({ + timeout: 1000 * 30, + withCredentials: true, + headers: { + 'Content-Type': 'application/json; charset=utf-8' + } +}) + +/** + * 请求拦截 + */ +http.interceptors.request.use( + config => { + config.headers.Authorization = cookie.get('Authorization') // 请求头带上token + // 只针对get方式进行序列化 + if (config.method === 'get' || config.method === 'GET') { + config.paramsSerializer = function (params) { + return qs.stringify(params, { arrayFormat: 'repeat' }) + } + } + return config + }, + error => { + return Promise.reject(error) + } +) + +/** + * 响应拦截 + */ +http.interceptors.response.use( + response => { + // blob 格式处理 + if (response.request.responseType === 'blob') { + return response + } + const res = response.data + // 00000 请求成功 + if (res.code === '00000' || res.code === 'A00002') { + return res + } + // A00001 用于直接显示提示用户的错误,内容由输入决定 + if (res.code === 'A00001') { + ElMessage({ + message: res.msg || res.data || 'Error', + type: 'error', + duration: 1.5 * 1000 + }) + return Promise.reject(res) + } + // A00004 未授权 + if (res.code === 'A00004') { + clearLoginInfo() + router.push({ name: 'login' }) + } + + // A00005 服务器异常 + if (res.code === 'A00005') { + // eslint-disable-next-line no-console + console.error('============== 请求异常 ==============', '\n', `接口地址: ${response.config.url.replace(import.meta.env.VITE_APP_BASE_API, '')}`, '\n', `异常信息: ${res}`, '\n', '============== 请求异常 end ==========') + ElMessage({ + message: '服务器出了点小差,请稍后再试', + type: 'error', + duration: 1.5 * 1000, + customClass: 'element-error-message-zindex' + }) + return Promise.reject(res) + } + }, + error => { + // eslint-disable-next-line no-console + console.log('========请求失败========', '\n', error.response, '\n', '========请求失败 end========') + switch (error.response.status) { + case 400: + ElMessage({ + message: error.response.data, + type: 'error', + duration: 1500, + customClass: 'element-error-message-zindex' + }) + break + case 401: + clearLoginInfo() + router.push({ name: 'login' }) + break + case 405: + ElMessage({ + message: 'http请求方式有误', + type: 'error', + duration: 1500, + customClass: 'element-error-message-zindex' + }) + break + case 500: + ElMessage({ + message: '服务器出了点小差,请稍后再试', + type: 'error', + duration: 1500, + customClass: 'element-error-message-zindex' + }) + break + case 501: + ElMessage({ + message: '服务器不支持当前请求所需要的某个功能', + type: 'error', + duration: 1500, + customClass: 'element-error-message-zindex' + }) + break + } + return Promise.reject(error) + } +) + +/** + * 请求地址处理 + * @param {*} actionName action方法名称 + */ +http.adornUrl = actionName => { + return import.meta.env.VITE_APP_BASE_API + actionName +} + +/** + * im请求地址处理 + * @param {*} actionName action方法名称 + */ +http.adornImUrl = actionName => { + return import.meta.env.VITE_APP_IM_API + actionName +} + +/** + * im ws 请求地址处理 + * @param {*} actionName action方法名称 + */ +http.adornWsImUrl = actionName => { + return import.meta.env.VITE_APP_WS_IM_API + actionName +} + +/** + * get请求参数处理 + * @param {*} params 参数对象 + * @param {*} openDefultParams 是否开启默认参数? + */ +http.adornParams = (params = {}, openDefultParams = true) => { + const defaults = { + t: Date.now() + } + return openDefultParams ? merge(defaults, params) : params +} + +/** + * post请求数据处理 + * @param {*} data 数据对象 + * @param {*} openDefultdata 是否开启默认数据? + * @param {*} contentType 数据格式 + * json: 'application/json; charset=utf-8' + * form: 'application/x-www-form-urlencoded; charset=utf-8' + */ +http.adornData = (data = {}, openDefultdata = true, contentType = 'json') => { + const defaults = { + t: Date.now() + } + data = openDefultdata ? merge(defaults, data) : data + return contentType === 'json' ? JSON.stringify(data) : qs.stringify(data) +} + +const uploadFile = function (url, file) { + const config = { + // 添加请求头 + headers: { + 'Content-Type': 'multipart/form-data', + Authorization: cookie.get('Authorization') // 请求头带上token + } + } + const param = new FormData() + // 通过append向form对象添加数据 + param.append('file', file) + return axios.post(url, param, config) +} + +export default http +export { uploadFile } diff --git a/front-end/mall4v/src/utils/index.js b/front-end/mall4v/src/utils/index.js new file mode 100644 index 00000000..a85198a9 --- /dev/null +++ b/front-end/mall4v/src/utils/index.js @@ -0,0 +1,89 @@ +import cookie from 'vue-cookies' +import router from '@/router' + +/** + * 获取uuid + */ +export function getUUID () { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { + return (c === 'x' ? (Math.random() * 16) | 0 : 'r&0x3' | '0x8').toString(16) + }) +} +/** + * 是否有权限 + * @param {*} key + */ +export function isAuth (key) { + const authorities = JSON.parse(sessionStorage.getItem('Authorities') || '[]') + if (authorities.length) { + for (const i in authorities) { + const element = authorities[i] + if (element === key) { + return true + } + } + } + return false +} + +/** + * 清除登录信息 + */ +export function clearLoginInfo () { + cookie.remove('Authorization') + router.options.isAddDynamicMenuRoutes = false +} + +/** + * 树形数据转换 + * @param {*} data + * @param {*} id + * @param {*} pid + */ +export function treeDataTranslate (data, id = 'id', pid = 'parentId') { + const res = [] + const temp = {} + for (let i = 0; i < data.length; i++) { + temp[data[i][id]] = data[i] + } + for (let k = 0; k < data.length; k++) { + if (temp[data[k][pid]] && data[k][id] !== data[k][pid]) { + if (!temp[data[k][pid]].children) { + temp[data[k][pid]].children = [] + } + if (!temp[data[k][pid]]._level) { + temp[data[k][pid]]._level = 1 + } + data[k]._level = temp[data[k][pid]]._level + 1 + temp[data[k][pid]].children.push(data[k]) + } else { + res.push(data[k]) + } + } + return res +} + +function idListFromTree (data, val, res = [], id = 'id', children = 'children') { + for (let i = 0; i < data.length; i++) { + const element = data[i] + if (element[children]) { + if (idListFromTree(element[children], val, res, id, children)) { + res.push(element[id]) + return true + } + } + if (element[id] === val) { + res.push(element[id]) + return true + } + } +} +/** + * 将数组中的parentId列表取出,倒序排列 + */ +// eslint-disable-next-line no-unused-vars +export function idList (data, val, id = 'id', children = 'children') { + const res = [] + idListFromTree(data, val, res, id) + return res +} diff --git a/front-end/mall4v/src/utils/unitOption.js b/front-end/mall4v/src/utils/unitOption.js new file mode 100644 index 00000000..120bbec8 --- /dev/null +++ b/front-end/mall4v/src/utils/unitOption.js @@ -0,0 +1,102 @@ +export const unitOption = [ + { + lable: '件', + value: '件' + }, + { + lable: '盒', + value: '盒' + }, + { + lable: '箱', + value: '箱' + }, + { + lable: '包', + value: '包' + }, + { + lable: '瓶', + value: '瓶' + }, + { + lable: '只', + value: '只' + }, + { + lable: '千克', + value: '千克' + }, + { + lable: '克', + value: '克' + }, + { + lable: '斤', + value: '斤' + }, + { + lable: '两', + value: '两' + }, + { + lable: '双', + value: '双' + }, + { + lable: '套', + value: '套' + }, + { + lable: '对', + value: '对' + }, + { + lable: '块', + value: '块' + }, + { + lable: '台', + value: '台' + }, + { + lable: '本', + value: '本' + }, + { + lable: '把', + value: '把' + }, + { + lable: '码', + value: '码' + }, + { + lable: '捆', + value: '捆' + }, + { + lable: '提', + value: '提' + }, + { + lable: '杯', + value: '杯' + }, + { + lable: '听', + value: '听' + }, + { + lable: '条', + value: '条' + }, + { + lable: '副', + value: '副' + }, + { + lable: '顶', + value: '顶' + } +] diff --git a/front-end/mall4v/src/utils/validate.js b/front-end/mall4v/src/utils/validate.js new file mode 100644 index 00000000..6462d1e2 --- /dev/null +++ b/front-end/mall4v/src/utils/validate.js @@ -0,0 +1,49 @@ +/** + * 邮箱 + * @param {*} s + */ +export function isEmail (s) { + return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s) +} + +/** + * 手机号码 + * @param {*} s + */ +export function isMobile (s) { + return /^1[0-9]{10}$/.test(s) +} + +/** + * 电话号码 + * @param {*} s + */ +export function isPhone (s) { + return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s) +} + +/** + * URL地址 + * @param {*} s + */ +export function isURL (s) { + return /^http[s]?:\/\/.*/.test(s) +} + +/** + * qq + * @param {*} s + */ +export function isQq (s) { + return /[1-9][0-9]{4,14}/.test(s) +} + +/** + * 判断是否全为空格 只要有一个其他字符返回false + * @param {String} str + * @returns {Boolean} + */ +export function validNoEmptySpace (str) { + const reg = /^\s+$/g + return reg.test(str) +} diff --git a/front-end/mall4v/src/views/common/error-page/404.vue b/front-end/mall4v/src/views/common/error-page/404.vue new file mode 100644 index 00000000..3d026a15 --- /dev/null +++ b/front-end/mall4v/src/views/common/error-page/404.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/front-end/mall4v/src/views/common/home/index.vue b/front-end/mall4v/src/views/common/home/index.vue new file mode 100644 index 00000000..025b98b5 --- /dev/null +++ b/front-end/mall4v/src/views/common/home/index.vue @@ -0,0 +1,134 @@ + + + diff --git a/front-end/mall4v/src/views/common/login/index.vue b/front-end/mall4v/src/views/common/login/index.vue new file mode 100644 index 00000000..4e9a745f --- /dev/null +++ b/front-end/mall4v/src/views/common/login/index.vue @@ -0,0 +1,199 @@ + + + + + diff --git a/front-end/mall4v/src/views/modules/admin/indexImg/add-or-update.vue b/front-end/mall4v/src/views/modules/admin/indexImg/add-or-update.vue new file mode 100644 index 00000000..90e320fa --- /dev/null +++ b/front-end/mall4v/src/views/modules/admin/indexImg/add-or-update.vue @@ -0,0 +1,253 @@ + + + + + diff --git a/front-end/mall4v/src/views/modules/admin/indexImg/index.vue b/front-end/mall4v/src/views/modules/admin/indexImg/index.vue new file mode 100644 index 00000000..57177da6 --- /dev/null +++ b/front-end/mall4v/src/views/modules/admin/indexImg/index.vue @@ -0,0 +1,177 @@ + + + diff --git a/front-end/mall4v/src/views/modules/order/order/components/consignment-info.vue b/front-end/mall4v/src/views/modules/order/order/components/consignment-info.vue new file mode 100644 index 00000000..1b3767f7 --- /dev/null +++ b/front-end/mall4v/src/views/modules/order/order/components/consignment-info.vue @@ -0,0 +1,101 @@ + + diff --git a/front-end/mall4v/src/views/modules/order/order/components/order-devy.vue b/front-end/mall4v/src/views/modules/order/order/components/order-devy.vue new file mode 100644 index 00000000..ec4be958 --- /dev/null +++ b/front-end/mall4v/src/views/modules/order/order/components/order-devy.vue @@ -0,0 +1,124 @@ + + diff --git a/front-end/mall4v/src/views/modules/order/order/components/order-info.vue b/front-end/mall4v/src/views/modules/order/order/components/order-info.vue new file mode 100644 index 00000000..e4a6038f --- /dev/null +++ b/front-end/mall4v/src/views/modules/order/order/components/order-info.vue @@ -0,0 +1,518 @@ + + + + + diff --git a/front-end/mall4v/src/views/modules/order/order/index.vue b/front-end/mall4v/src/views/modules/order/order/index.vue new file mode 100644 index 00000000..83dc19c9 --- /dev/null +++ b/front-end/mall4v/src/views/modules/order/order/index.vue @@ -0,0 +1,559 @@ + + + + + diff --git a/front-end/mall4v/src/views/modules/prod/category/add-or-update.vue b/front-end/mall4v/src/views/modules/prod/category/add-or-update.vue new file mode 100644 index 00000000..3999a920 --- /dev/null +++ b/front-end/mall4v/src/views/modules/prod/category/add-or-update.vue @@ -0,0 +1,209 @@ + + + diff --git a/front-end/mall4v/src/views/modules/prod/category/index.vue b/front-end/mall4v/src/views/modules/prod/category/index.vue new file mode 100644 index 00000000..444f509e --- /dev/null +++ b/front-end/mall4v/src/views/modules/prod/category/index.vue @@ -0,0 +1,179 @@ + + + + + diff --git a/front-end/mall4v/src/views/modules/prod/prodComm/add-or-update.vue b/front-end/mall4v/src/views/modules/prod/prodComm/add-or-update.vue new file mode 100644 index 00000000..e84dd226 --- /dev/null +++ b/front-end/mall4v/src/views/modules/prod/prodComm/add-or-update.vue @@ -0,0 +1,219 @@ + + + diff --git a/front-end/mall4v/src/views/modules/prod/prodComm/index.vue b/front-end/mall4v/src/views/modules/prod/prodComm/index.vue new file mode 100644 index 00000000..b2154a19 --- /dev/null +++ b/front-end/mall4v/src/views/modules/prod/prodComm/index.vue @@ -0,0 +1,122 @@ + + + diff --git a/front-end/mall4v/src/views/modules/prod/prodInfo/components/prod-transport.vue b/front-end/mall4v/src/views/modules/prod/prodInfo/components/prod-transport.vue new file mode 100644 index 00000000..e21a6437 --- /dev/null +++ b/front-end/mall4v/src/views/modules/prod/prodInfo/components/prod-transport.vue @@ -0,0 +1,159 @@ + + + diff --git a/front-end/mall4v/src/views/modules/prod/prodInfo/components/sku-table.vue b/front-end/mall4v/src/views/modules/prod/prodInfo/components/sku-table.vue new file mode 100644 index 00000000..ceeff69d --- /dev/null +++ b/front-end/mall4v/src/views/modules/prod/prodInfo/components/sku-table.vue @@ -0,0 +1,246 @@ + + + + + diff --git a/front-end/mall4v/src/views/modules/prod/prodInfo/components/sku-tag.vue b/front-end/mall4v/src/views/modules/prod/prodInfo/components/sku-tag.vue new file mode 100644 index 00000000..9f3908fb --- /dev/null +++ b/front-end/mall4v/src/views/modules/prod/prodInfo/components/sku-tag.vue @@ -0,0 +1,534 @@ + + + + + diff --git a/front-end/mall4v/src/views/modules/prod/prodInfo/index.vue b/front-end/mall4v/src/views/modules/prod/prodInfo/index.vue new file mode 100644 index 00000000..f60a30b9 --- /dev/null +++ b/front-end/mall4v/src/views/modules/prod/prodInfo/index.vue @@ -0,0 +1,344 @@ + + + diff --git a/front-end/mall4v/src/views/modules/prod/prodList/index.vue b/front-end/mall4v/src/views/modules/prod/prodList/index.vue new file mode 100644 index 00000000..21750887 --- /dev/null +++ b/front-end/mall4v/src/views/modules/prod/prodList/index.vue @@ -0,0 +1,181 @@ + + + diff --git a/front-end/mall4v/src/views/modules/prod/prodTag/add-or-update.vue b/front-end/mall4v/src/views/modules/prod/prodTag/add-or-update.vue new file mode 100644 index 00000000..0c014057 --- /dev/null +++ b/front-end/mall4v/src/views/modules/prod/prodTag/add-or-update.vue @@ -0,0 +1,145 @@ + + + diff --git a/front-end/mall4v/src/views/modules/prod/prodTag/index.vue b/front-end/mall4v/src/views/modules/prod/prodTag/index.vue new file mode 100644 index 00000000..f8a92f20 --- /dev/null +++ b/front-end/mall4v/src/views/modules/prod/prodTag/index.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/front-end/mall4v/src/views/modules/prod/spec/add-or-update.vue b/front-end/mall4v/src/views/modules/prod/spec/add-or-update.vue new file mode 100644 index 00000000..42ef6585 --- /dev/null +++ b/front-end/mall4v/src/views/modules/prod/spec/add-or-update.vue @@ -0,0 +1,190 @@ + + + + diff --git a/front-end/mall4v/src/views/modules/prod/spec/index.vue b/front-end/mall4v/src/views/modules/prod/spec/index.vue new file mode 100644 index 00000000..7982190e --- /dev/null +++ b/front-end/mall4v/src/views/modules/prod/spec/index.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/front-end/mall4v/src/views/modules/shop/hotSearch/add-or-update.vue b/front-end/mall4v/src/views/modules/shop/hotSearch/add-or-update.vue new file mode 100644 index 00000000..4dd8eb5e --- /dev/null +++ b/front-end/mall4v/src/views/modules/shop/hotSearch/add-or-update.vue @@ -0,0 +1,163 @@ + + + diff --git a/front-end/mall4v/src/views/modules/shop/hotSearch/index.vue b/front-end/mall4v/src/views/modules/shop/hotSearch/index.vue new file mode 100644 index 00000000..a4062116 --- /dev/null +++ b/front-end/mall4v/src/views/modules/shop/hotSearch/index.vue @@ -0,0 +1,170 @@ + + + diff --git a/front-end/mall4v/src/views/modules/shop/notice/add-or-update.vue b/front-end/mall4v/src/views/modules/shop/notice/add-or-update.vue new file mode 100644 index 00000000..86c95c44 --- /dev/null +++ b/front-end/mall4v/src/views/modules/shop/notice/add-or-update.vue @@ -0,0 +1,148 @@ + + + diff --git a/front-end/mall4v/src/views/modules/shop/notice/index.vue b/front-end/mall4v/src/views/modules/shop/notice/index.vue new file mode 100644 index 00000000..a2999dfe --- /dev/null +++ b/front-end/mall4v/src/views/modules/shop/notice/index.vue @@ -0,0 +1,153 @@ + + + + + diff --git a/front-end/mall4v/src/views/modules/shop/pickAddr/add-or-update.vue b/front-end/mall4v/src/views/modules/shop/pickAddr/add-or-update.vue new file mode 100644 index 00000000..48e28b23 --- /dev/null +++ b/front-end/mall4v/src/views/modules/shop/pickAddr/add-or-update.vue @@ -0,0 +1,289 @@ + + + diff --git a/front-end/mall4v/src/views/modules/shop/pickAddr/index.vue b/front-end/mall4v/src/views/modules/shop/pickAddr/index.vue new file mode 100644 index 00000000..60243401 --- /dev/null +++ b/front-end/mall4v/src/views/modules/shop/pickAddr/index.vue @@ -0,0 +1,166 @@ + + + diff --git a/front-end/mall4v/src/views/modules/shop/transport/add-or-update.vue b/front-end/mall4v/src/views/modules/shop/transport/add-or-update.vue new file mode 100644 index 00000000..70169d70 --- /dev/null +++ b/front-end/mall4v/src/views/modules/shop/transport/add-or-update.vue @@ -0,0 +1,568 @@ + + + + + diff --git a/front-end/mall4v/src/views/modules/shop/transport/index.vue b/front-end/mall4v/src/views/modules/shop/transport/index.vue new file mode 100644 index 00000000..3132cb97 --- /dev/null +++ b/front-end/mall4v/src/views/modules/shop/transport/index.vue @@ -0,0 +1,167 @@ + + + diff --git a/front-end/mall4v/src/views/modules/sys/area/add-or-update.vue b/front-end/mall4v/src/views/modules/sys/area/add-or-update.vue new file mode 100644 index 00000000..18d9404e --- /dev/null +++ b/front-end/mall4v/src/views/modules/sys/area/add-or-update.vue @@ -0,0 +1,151 @@ + + + diff --git a/front-end/mall4v/src/views/modules/sys/area/index.vue b/front-end/mall4v/src/views/modules/sys/area/index.vue new file mode 100644 index 00000000..5959b255 --- /dev/null +++ b/front-end/mall4v/src/views/modules/sys/area/index.vue @@ -0,0 +1,165 @@ + + + + + diff --git a/front-end/mall4v/src/views/modules/sys/config/add-or-update.vue b/front-end/mall4v/src/views/modules/sys/config/add-or-update.vue new file mode 100644 index 00000000..d35e5db6 --- /dev/null +++ b/front-end/mall4v/src/views/modules/sys/config/add-or-update.vue @@ -0,0 +1,124 @@ + + + diff --git a/front-end/mall4v/src/views/modules/sys/config/index.vue b/front-end/mall4v/src/views/modules/sys/config/index.vue new file mode 100644 index 00000000..89edc3a9 --- /dev/null +++ b/front-end/mall4v/src/views/modules/sys/config/index.vue @@ -0,0 +1,144 @@ + + + diff --git a/front-end/mall4v/src/views/modules/sys/log/index.vue b/front-end/mall4v/src/views/modules/sys/log/index.vue new file mode 100644 index 00000000..721d9a2e --- /dev/null +++ b/front-end/mall4v/src/views/modules/sys/log/index.vue @@ -0,0 +1,57 @@ + + + diff --git a/front-end/mall4v/src/views/modules/sys/menu/add-or-update.vue b/front-end/mall4v/src/views/modules/sys/menu/add-or-update.vue new file mode 100644 index 00000000..6bda12ac --- /dev/null +++ b/front-end/mall4v/src/views/modules/sys/menu/add-or-update.vue @@ -0,0 +1,299 @@ + + + diff --git a/front-end/mall4v/src/views/modules/sys/menu/index.vue b/front-end/mall4v/src/views/modules/sys/menu/index.vue new file mode 100644 index 00000000..15c9a566 --- /dev/null +++ b/front-end/mall4v/src/views/modules/sys/menu/index.vue @@ -0,0 +1,197 @@ + + + diff --git a/front-end/mall4v/src/views/modules/sys/role/add-or-update.vue b/front-end/mall4v/src/views/modules/sys/role/add-or-update.vue new file mode 100644 index 00000000..1a8695dd --- /dev/null +++ b/front-end/mall4v/src/views/modules/sys/role/add-or-update.vue @@ -0,0 +1,151 @@ + + + diff --git a/front-end/mall4v/src/views/modules/sys/role/index.vue b/front-end/mall4v/src/views/modules/sys/role/index.vue new file mode 100644 index 00000000..e8f90c33 --- /dev/null +++ b/front-end/mall4v/src/views/modules/sys/role/index.vue @@ -0,0 +1,153 @@ + + + diff --git a/front-end/mall4v/src/views/modules/sys/user/add-or-update.vue b/front-end/mall4v/src/views/modules/sys/user/add-or-update.vue new file mode 100644 index 00000000..848a06a8 --- /dev/null +++ b/front-end/mall4v/src/views/modules/sys/user/add-or-update.vue @@ -0,0 +1,245 @@ + + + diff --git a/front-end/mall4v/src/views/modules/sys/user/index.vue b/front-end/mall4v/src/views/modules/sys/user/index.vue new file mode 100644 index 00000000..9bfe7420 --- /dev/null +++ b/front-end/mall4v/src/views/modules/sys/user/index.vue @@ -0,0 +1,155 @@ + + + diff --git a/front-end/mall4v/src/views/modules/user/user/add-or-update.vue b/front-end/mall4v/src/views/modules/user/user/add-or-update.vue new file mode 100644 index 00000000..1c9c6cb7 --- /dev/null +++ b/front-end/mall4v/src/views/modules/user/user/add-or-update.vue @@ -0,0 +1,139 @@ + + + diff --git a/front-end/mall4v/src/views/modules/user/user/index.vue b/front-end/mall4v/src/views/modules/user/user/index.vue new file mode 100644 index 00000000..6804cf59 --- /dev/null +++ b/front-end/mall4v/src/views/modules/user/user/index.vue @@ -0,0 +1,120 @@ + + + diff --git a/front-end/mall4v/tsconfig.json b/front-end/mall4v/tsconfig.json new file mode 100644 index 00000000..4709f16b --- /dev/null +++ b/front-end/mall4v/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "sourceMap": true, + "skipLibCheck": true + }, + "exclude": [ + "node_modules" + ], + "include": [ + "src/auto-import/components.d.ts", + "src/auto-import/imports.d.ts" + ] +} \ No newline at end of file diff --git a/front-end/mall4v/vite.config.js b/front-end/mall4v/vite.config.js new file mode 100644 index 00000000..bf886a3a --- /dev/null +++ b/front-end/mall4v/vite.config.js @@ -0,0 +1,96 @@ +import { defineConfig, loadEnv } from 'vite' +import vue from '@vitejs/plugin-vue' +import path from 'path' +import AutoImport from 'unplugin-auto-import/vite' +import Components from 'unplugin-vue-components/vite' +import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' +import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' +import viteCompression from 'vite-plugin-compression' + +// eslint +import eslintPlugin from 'vite-plugin-eslint' + +// https://vitejs.dev/config/ +export default defineConfig(()=> { + return { + plugins: [ + vue(), + createSvgIconsPlugin({ + iconDirs: [path.resolve(process.cwd(), 'src/icons/svg')], + symbolId: 'icon-[dir]-[name]' + }), + // 自动引入内容 + AutoImport({ + imports: [ + 'vue', + 'vue-router' + ], + dirs: [ + 'src/hooks/**', + 'src/stores/**', + 'src/utils/**' + ], + resolvers: [ + ElementPlusResolver() + ], + dts: 'src/auto-import/imports.d.ts', + eslintrc: { + enabled: false + } + }), + // 自动引入组件 + Components({ + dirs: [ + 'src/components' + ], + resolvers: [ + ElementPlusResolver() + ], + dts: 'src/auto-import/components.d.ts' + }), + // eslint + eslintPlugin({ + include: ['src/**/*.js', 'src/**/*.vue', 'src/*.js', 'src/*.vue'] + }), + // 对大于 1k 的文件进行压缩 + viteCompression({ + threshold: 1000, + }) + ], + server: { + host: true, + port: 9527, + open: true + }, + resolve: { + alias: { + '@': path.resolve(__dirname, 'src'), + 'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js' + } + }, + build: { + base: './', + rollupOptions: { + // 静态资源分类打包 + output: { + chunkFileNames: 'static/js/[name]-[hash].js', + entryFileNames: 'static/js/[name]-[hash].js', + assetFileNames: 'static/[ext]/[name]-[hash].[ext]', + // 静态资源分拆打包 + manualChunks (id) { + if (id.includes('node_modules')) { + if (id.toString().indexOf('.pnpm/') !== -1) { + return id.toString().split('.pnpm/')[1].split('/')[0].toString(); + } else if (id.toString().indexOf('node_modules/') !== -1) { + return id.toString().split('node_modules/')[1].split('/')[0].toString(); + } + } + } + } + }, + sourcemap: false, + target: 'es2015', + reportCompressedSize: false + } + } +})