-
5library-activity/.gitattributes
-
34library-activity/.gitignore
-
674library-activity/LICENSE
-
41library-activity/README.md
-
23library-activity/app.config.js
-
26library-activity/index.html
-
5834library-activity/package-lock.json
-
41library-activity/package.json
-
1library-activity/public/js/aes.min.js
-
2library-activity/public/js/axios.js
-
1library-activity/public/js/cipher-core.min.js
-
1library-activity/public/js/core.min.js
-
1library-activity/public/js/enc-base64.min.js
-
1library-activity/public/js/enc-hex.min.js
-
1library-activity/public/js/enc-utf8.min.js
-
1library-activity/public/js/evpkdf.min.js
-
1library-activity/public/js/md5.min.js
-
1library-activity/public/js/mode-ecb.min.js
-
1library-activity/public/js/pad-pkcs7.min.js
-
40library-activity/public/js/rem.js
-
14library-activity/public/js/swiper6.min.js
-
39library-activity/src/App.vue
-
191library-activity/src/assets/css/reset.css
-
13library-activity/src/assets/css/swiper6.min.css
-
BINlibrary-activity/src/assets/images/active.png
-
BINlibrary-activity/src/assets/images/activeA.png
-
BINlibrary-activity/src/assets/images/arrow.png
-
BINlibrary-activity/src/assets/images/back.png
-
BINlibrary-activity/src/assets/images/bookimg.png
-
BINlibrary-activity/src/assets/images/btn1.png
-
BINlibrary-activity/src/assets/images/btn2.png
-
BINlibrary-activity/src/assets/images/btn3.png
-
BINlibrary-activity/src/assets/images/cart.png
-
BINlibrary-activity/src/assets/images/cartA.png
-
BINlibrary-activity/src/assets/images/d-fh.png
-
BINlibrary-activity/src/assets/images/d-she.png
-
BINlibrary-activity/src/assets/images/d-shuo.png
-
BINlibrary-activity/src/assets/images/dealer.png
-
BINlibrary-activity/src/assets/images/gift.png
-
BINlibrary-activity/src/assets/images/hi.png
-
BINlibrary-activity/src/assets/images/lending.png
-
BINlibrary-activity/src/assets/images/mine.png
-
BINlibrary-activity/src/assets/images/mineA.png
-
BINlibrary-activity/src/assets/images/minebg.png
-
BINlibrary-activity/src/assets/images/nodata.png
-
BINlibrary-activity/src/assets/images/return.png
-
BINlibrary-activity/src/assets/images/selected.png
-
BINlibrary-activity/src/assets/images/time.png
-
BINlibrary-activity/src/assets/images/xd-status.png
-
BINlibrary-activity/src/assets/images/y-qx.png
-
BINlibrary-activity/src/assets/images/y-wc.png
-
BINlibrary-activity/src/assets/images/yh1.png
-
BINlibrary-activity/src/assets/images/yh2.png
-
2library-activity/src/assets/js/axios.js
-
40library-activity/src/assets/js/rem.js
-
14library-activity/src/assets/js/swiper6.min.js
-
BINlibrary-activity/src/assets/logo-48.png
-
155library-activity/src/common/qiniu-uploader.js
-
47library-activity/src/common/selectLbrary.js
-
13library-activity/src/common/util.js
-
62library-activity/src/components/aitoast/aitoast.vue
-
116library-activity/src/components/tabBar/index.vue
-
477library-activity/src/components/verify/slide-verify.vue
-
249library-activity/src/components/wuc-tab/wuc-tab.vue
-
133library-activity/src/main.js
-
143library-activity/src/router/index.js
-
419library-activity/src/utils/api.js
-
43library-activity/src/utils/http.js
-
113library-activity/src/utils/tool.js
-
152library-activity/src/utils/util.js
-
388library-activity/src/views/cart/cart.vue
-
107library-activity/src/views/cart/result.vue
-
436library-activity/src/views/index.vue
-
316library-activity/src/views/mine/mine.vue
-
13library-activity/src/vuex/index.js
-
187library-activity/src/vuex/modules/home.js
-
41library-activity/src/vuex/modules/login.js
-
157library-activity/src/vuex/modules/reading.js
-
58library-activity/vite.config.js
-
3064library-activity/yarn.lock
@ -0,0 +1,5 @@ |
|||||
|
*.js linguist-language=vue |
||||
|
|
||||
|
*.css linguist-language=vue |
||||
|
|
||||
|
*.html linguist-language=vue |
||||
@ -0,0 +1,34 @@ |
|||||
|
.DS_Store |
||||
|
node_modules |
||||
|
|
||||
|
# local env files |
||||
|
.env.local |
||||
|
.env.*.local |
||||
|
|
||||
|
# Log files |
||||
|
npm-debug.log* |
||||
|
yarn-debug.log* |
||||
|
yarn-error.log* |
||||
|
pnpm-debug.log* |
||||
|
|
||||
|
# Editor directories and files |
||||
|
.idea |
||||
|
.vscode |
||||
|
*.suo |
||||
|
*.ntvs* |
||||
|
*.njsproj |
||||
|
*.sln |
||||
|
*.sw? |
||||
|
|
||||
|
### IntelliJ IDEA ### |
||||
|
.idea |
||||
|
*.iws |
||||
|
*.iml |
||||
|
*.ipr |
||||
|
|
||||
|
### NetBeans ### |
||||
|
/nbproject/private/ |
||||
|
/build/ |
||||
|
/nbbuild/ |
||||
|
/nbdist/ |
||||
|
/.nb-gradle/ |
||||
@ -0,0 +1,674 @@ |
|||||
|
GNU GENERAL PUBLIC LICENSE |
||||
|
Version 3, 29 June 2007 |
||||
|
|
||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> |
||||
|
Everyone is permitted to copy and distribute verbatim copies |
||||
|
of this license document, but changing it is not allowed. |
||||
|
|
||||
|
Preamble |
||||
|
|
||||
|
The GNU General Public License is a free, copyleft license for |
||||
|
software and other kinds of works. |
||||
|
|
||||
|
The licenses for most software and other practical works are designed |
||||
|
to take away your freedom to share and change the works. By contrast, |
||||
|
the GNU General Public License is 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. We, the Free Software Foundation, use the |
||||
|
GNU General Public License for most of our software; it applies also to |
||||
|
any other work released this way by its authors. You can apply it to |
||||
|
your programs, too. |
||||
|
|
||||
|
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. |
||||
|
|
||||
|
To protect your rights, we need to prevent others from denying you |
||||
|
these rights or asking you to surrender the rights. Therefore, you have |
||||
|
certain responsibilities if you distribute copies of the software, or if |
||||
|
you modify it: responsibilities to respect the freedom of others. |
||||
|
|
||||
|
For example, if you distribute copies of such a program, whether |
||||
|
gratis or for a fee, you must pass on to the recipients the same |
||||
|
freedoms that you received. You must make sure that they, too, receive |
||||
|
or can get the source code. And you must show them these terms so they |
||||
|
know their rights. |
||||
|
|
||||
|
Developers that use the GNU GPL protect your rights with two steps: |
||||
|
(1) assert copyright on the software, and (2) offer you this License |
||||
|
giving you legal permission to copy, distribute and/or modify it. |
||||
|
|
||||
|
For the developers' and authors' protection, the GPL clearly explains |
||||
|
that there is no warranty for this free software. For both users' and |
||||
|
authors' sake, the GPL requires that modified versions be marked as |
||||
|
changed, so that their problems will not be attributed erroneously to |
||||
|
authors of previous versions. |
||||
|
|
||||
|
Some devices are designed to deny users access to install or run |
||||
|
modified versions of the software inside them, although the manufacturer |
||||
|
can do so. This is fundamentally incompatible with the aim of |
||||
|
protecting users' freedom to change the software. The systematic |
||||
|
pattern of such abuse occurs in the area of products for individuals to |
||||
|
use, which is precisely where it is most unacceptable. Therefore, we |
||||
|
have designed this version of the GPL to prohibit the practice for those |
||||
|
products. If such problems arise substantially in other domains, we |
||||
|
stand ready to extend this provision to those domains in future versions |
||||
|
of the GPL, as needed to protect the freedom of users. |
||||
|
|
||||
|
Finally, every program is threatened constantly by software patents. |
||||
|
States should not allow patents to restrict development and use of |
||||
|
software on general-purpose computers, but in those that do, we wish to |
||||
|
avoid the special danger that patents applied to a free program could |
||||
|
make it effectively proprietary. To prevent this, the GPL assures that |
||||
|
patents cannot be used to render the program non-free. |
||||
|
|
||||
|
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 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. Use with the GNU Affero General Public License. |
||||
|
|
||||
|
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 Affero 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 special requirements of the GNU Affero General Public License, |
||||
|
section 13, concerning interaction through a network will apply to the |
||||
|
combination as such. |
||||
|
|
||||
|
14. Revised Versions of this License. |
||||
|
|
||||
|
The Free Software Foundation may publish revised and/or new versions of |
||||
|
the GNU 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 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 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 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. |
||||
|
|
||||
|
<one line to give the program's name and a brief idea of what it does.> |
||||
|
Copyright (C) <year> <name of author> |
||||
|
|
||||
|
This program is free software: you can redistribute it and/or modify |
||||
|
it under the terms of the GNU 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 General Public License for more details. |
||||
|
|
||||
|
You should have received a copy of the GNU General Public License |
||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>. |
||||
|
|
||||
|
Also add information on how to contact you by electronic and paper mail. |
||||
|
|
||||
|
If the program does terminal interaction, make it output a short |
||||
|
notice like this when it starts in an interactive mode: |
||||
|
|
||||
|
<program> Copyright (C) <year> <name of author> |
||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
||||
|
This is free software, and you are welcome to redistribute it |
||||
|
under certain conditions; type `show c' for details. |
||||
|
|
||||
|
The hypothetical commands `show w' and `show c' should show the appropriate |
||||
|
parts of the General Public License. Of course, your program's commands |
||||
|
might be different; for a GUI interface, you would use an "about box". |
||||
|
|
||||
|
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 GPL, see |
||||
|
<https://www.gnu.org/licenses/>. |
||||
|
|
||||
|
The GNU General Public License does not permit incorporating your program |
||||
|
into proprietary programs. If your program is a subroutine library, you |
||||
|
may consider it more useful to permit linking proprietary applications with |
||||
|
the library. If this is what you want to do, use the GNU Lesser General |
||||
|
Public License instead of this License. But first, please read |
||||
|
<https://www.gnu.org/licenses/why-not-lgpl.html>. |
||||
@ -0,0 +1,41 @@ |
|||||
|
|
||||
|
|
||||
|
# H5 图书馆活动演示项目 # |
||||
|
基于Vue 3.0 + Vite 2.0 + Vue-Router 4.0 + vant + axios。 |
||||
|
|
||||
|
|
||||
|
## 目录结构介绍 ## |
||||
|
|
||||
|
|-- dist // 项目打包后生产目录 |
||||
|
|-- public // 静态文件目录,可直接在index.html 中引入 |
||||
|
|-- src // 源码目录 |
||||
|
| |-- components // 公共组件 |
||||
|
| |-- leftnav.vue // 左边菜单栏 |
||||
|
| |-- navcon.vue // 头部菜单栏 |
||||
|
| |-- Pagination.vue // 公共分页组件 |
||||
|
| |-- views // 主要路由页面 |
||||
|
| |-- Login.vue // 登录 |
||||
|
| |-- index.vue // 主页面 |
||||
|
| |-- App.vue // 页面入口文件 |
||||
|
| |-- main.js // 程序入口文件,加载各种公共组件 |
||||
|
|-- .babelrc // ES6语法编译配置 |
||||
|
|-- .editorconfig // 代码编写规格 |
||||
|
|-- .gitignore // 忽略的文件 |
||||
|
|-- index.html // 入口html文件 |
||||
|
|-- app.config.js // 开发环境和线上环境配置文件 |
||||
|
|-- vite.config.js // vite 配置文件 |
||||
|
|-- package.json // 项目及工具的依赖配置文件 |
||||
|
|-- README.md // 说明 |
||||
|
|
||||
|
## 安装依赖包 ## |
||||
|
npm install |
||||
|
|
||||
|
## 部署开发环境 ## |
||||
|
npm run dev |
||||
|
|
||||
|
## 打包 ## |
||||
|
npm run build |
||||
|
|
||||
|
## 打包后部署生产环境服务器 ## |
||||
|
npm run serve |
||||
|
|
||||
@ -0,0 +1,23 @@ |
|||||
|
/** |
||||
|
* 项目的一些定制化配置 |
||||
|
*/ |
||||
|
const isProd = process.env.NODE_ENV === 'production' |
||||
|
const proxyConfig = { |
||||
|
proxy: { |
||||
|
//'/api': 'https://testapi.aiyxlib.com/api',
|
||||
|
// 'url': 'http://restapi.amap.com/',
|
||||
|
// url: "https://testapi.aiyxlib.com/api",
|
||||
|
'url': "http://192.168.99.111:5001/api", |
||||
|
}, |
||||
|
prodProxy: { |
||||
|
//'url': "http://192.168.99.111:5001",
|
||||
|
//'url': 'https://testapi.aiyxlib.com',
|
||||
|
'url': 'https://rosefinchapi.aiyxlib.com/api' |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export default { |
||||
|
// 代理配置,可支持多个代理,key为前缀,命中后,会把前缀去掉,转发到代理服务器
|
||||
|
proxy: isProd ? proxyConfig.prodProxy.url : proxyConfig.proxy.url |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,26 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en"> |
||||
|
<head> |
||||
|
<meta charset="UTF-8" /> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||
|
<link rel="icon" href="/logo-48.png"> |
||||
|
<title>你选书 我买单</title> |
||||
|
</head> |
||||
|
<body> |
||||
|
<div id="app"></div> |
||||
|
<script src="https://s.yezgea02.com/1609305532675/echarts.js"></script> |
||||
|
<script type="module" src="/src/main.js"></script> |
||||
|
<script src="/js/core.min.js"></script> |
||||
|
<script src="/js/enc-base64.min.js"></script> |
||||
|
<script src="/js/md5.min.js"></script> |
||||
|
<script src="/js/evpkdf.min.js"></script> |
||||
|
<script src="/js/cipher-core.min.js"></script> |
||||
|
<script src="/js/aes.min.js"></script> |
||||
|
<script src="/js/pad-pkcs7.min.js"></script> |
||||
|
<script src="/js/mode-ecb.min.js"></script> |
||||
|
<script src="/js/enc-utf8.min.js"></script> |
||||
|
<script src="/js/enc-hex.min.js"></script> |
||||
|
<script src="https://sdk-release.qnsdk.com/qiniu-web-player-1.2.0.js"></script> |
||||
|
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script> |
||||
|
</body> |
||||
|
</html> |
||||
5834
library-activity/package-lock.json
File diff suppressed because it is too large
View File
@ -0,0 +1,41 @@ |
|||||
|
{ |
||||
|
"name": "vue3-mobile", |
||||
|
"version": "0.0.0", |
||||
|
"scripts": { |
||||
|
"dev": "vite --mode development", |
||||
|
"build:beta": "vite build --mode beta", |
||||
|
"build": "vite build --mode production", |
||||
|
"serve": "vite preview" |
||||
|
}, |
||||
|
"dependencies": { |
||||
|
"@sentry/browser": "^6.3.1", |
||||
|
"@sentry/tracing": "^6.3.1", |
||||
|
"axios": "^0.21.1", |
||||
|
"js-md5": "^0.7.3", |
||||
|
"pushstate-server": "^3.1.0", |
||||
|
"qs": "^6.9.6", |
||||
|
"vant": "^3.1.5", |
||||
|
"vue": "^3.0.5", |
||||
|
"vue-router": "^4.0.4", |
||||
|
"vuex": "4.0", |
||||
|
"wangeditor": "^4.6.10" |
||||
|
}, |
||||
|
"devDependencies": { |
||||
|
"@babel/core": "^7.13.8", |
||||
|
"@babel/runtime": "^7.13.8", |
||||
|
"@rollup/plugin-babel": "^5.3.0", |
||||
|
"@vitejs/plugin-vue": "^1.1.4", |
||||
|
"@vue/compiler-sfc": "^3.0.5", |
||||
|
"babel": "^6.23.0", |
||||
|
"babel-plugin-component": "^1.1.1", |
||||
|
"babel-plugin-import": "^1.13.3", |
||||
|
"element-theme-chalk": "^2.15.1", |
||||
|
"sass": "^1.69.4", |
||||
|
"sass-loader": "^10.0.3", |
||||
|
"vite": "^2.0.1", |
||||
|
"vite-babel-plugin": "^0.0.2", |
||||
|
"vite-plugin-babel-import": "^2.0.2", |
||||
|
"vite-plugin-imp": "^2.0.4", |
||||
|
"vite-plugin-svg-icons": "^2.0.1" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1 @@ |
|||||
|
!function(e,r){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],r):r(e.CryptoJS)}(this,function(t){return function(){var e=t,r=e.lib.BlockCipher,i=e.algo,f=[],u=[],h=[],y=[],a=[],p=[],v=[],_=[],k=[],l=[];!function(){for(var e=[],r=0;r<256;r++)e[r]=r<128?r<<1:r<<1^283;var i=0,o=0;for(r=0;r<256;r++){var t=o^o<<1^o<<2^o<<3^o<<4;t=t>>>8^255&t^99,f[i]=t;var n=e[u[t]=i],c=e[n],s=e[c],d=257*e[t]^16843008*t;h[i]=d<<24|d>>>8,y[i]=d<<16|d>>>16,a[i]=d<<8|d>>>24,p[i]=d;d=16843009*s^65537*c^257*n^16843008*i;v[t]=d<<24|d>>>8,_[t]=d<<16|d>>>16,k[t]=d<<8|d>>>24,l[t]=d,i?(i=n^e[e[e[s^n]]],o^=e[e[o]]):i=o=1}}();var S=[0,1,2,4,8,16,32,64,128,27,54],o=i.AES=r.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,r=e.words,i=e.sigBytes/4,o=4*(1+(this._nRounds=6+i)),t=this._keySchedule=[],n=0;n<o;n++)n<i?t[n]=r[n]:(d=t[n-1],n%i?6<i&&n%i==4&&(d=f[d>>>24]<<24|f[d>>>16&255]<<16|f[d>>>8&255]<<8|f[255&d]):(d=f[(d=d<<8|d>>>24)>>>24]<<24|f[d>>>16&255]<<16|f[d>>>8&255]<<8|f[255&d],d^=S[n/i|0]<<24),t[n]=t[n-i]^d);for(var c=this._invKeySchedule=[],s=0;s<o;s++){n=o-s;if(s%4)var d=t[n];else d=t[n-4];c[s]=s<4||n<=4?d:v[f[d>>>24]]^_[f[d>>>16&255]]^k[f[d>>>8&255]]^l[f[255&d]]}}},encryptBlock:function(e,r){this._doCryptBlock(e,r,this._keySchedule,h,y,a,p,f)},decryptBlock:function(e,r){var i=e[r+1];e[r+1]=e[r+3],e[r+3]=i,this._doCryptBlock(e,r,this._invKeySchedule,v,_,k,l,u);i=e[r+1];e[r+1]=e[r+3],e[r+3]=i},_doCryptBlock:function(e,r,i,o,t,n,c,s){for(var d=this._nRounds,f=e[r]^i[0],u=e[r+1]^i[1],h=e[r+2]^i[2],y=e[r+3]^i[3],a=4,p=1;p<d;p++){var v=o[f>>>24]^t[u>>>16&255]^n[h>>>8&255]^c[255&y]^i[a++],_=o[u>>>24]^t[h>>>16&255]^n[y>>>8&255]^c[255&f]^i[a++],k=o[h>>>24]^t[y>>>16&255]^n[f>>>8&255]^c[255&u]^i[a++],l=o[y>>>24]^t[f>>>16&255]^n[u>>>8&255]^c[255&h]^i[a++];f=v,u=_,h=k,y=l}v=(s[f>>>24]<<24|s[u>>>16&255]<<16|s[h>>>8&255]<<8|s[255&y])^i[a++],_=(s[u>>>24]<<24|s[h>>>16&255]<<16|s[y>>>8&255]<<8|s[255&f])^i[a++],k=(s[h>>>24]<<24|s[y>>>16&255]<<16|s[f>>>8&255]<<8|s[255&u])^i[a++],l=(s[y>>>24]<<24|s[f>>>16&255]<<16|s[u>>>8&255]<<8|s[255&h])^i[a++];e[r]=v,e[r+1]=_,e[r+2]=k,e[r+3]=l},keySize:8});e.AES=r._createHelper(o)}(),t.AES}); |
||||
2
library-activity/public/js/axios.js
File diff suppressed because it is too large
View File
@ -0,0 +1 @@ |
|||||
|
!function(e,t){"object"==typeof exports?module.exports=exports=t(require("./core"),require("./evpkdf")):"function"==typeof define&&define.amd?define(["./core","./evpkdf"],t):t(e.CryptoJS)}(this,function(m){m.lib.Cipher||function(){var e=m,t=e.lib,r=t.Base,a=t.WordArray,i=t.BufferedBlockAlgorithm,n=e.enc,c=(n.Utf8,n.Base64),o=e.algo.EvpKDF,s=t.Cipher=i.extend({cfg:r.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(i){return{encrypt:function(e,t,r){return f(t).encrypt(i,e,t,r)},decrypt:function(e,t,r){return f(t).decrypt(i,e,t,r)}}}});function f(e){return"string"==typeof e?g:k}t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var p,d=e.mode={},h=t.BlockCipherMode=r.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),u=d.CBC=((p=h.extend()).Encryptor=p.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;_.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),p.Decryptor=p.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,n=e.slice(t,t+i);r.decryptBlock(e,t),_.call(this,e,t,i),this._prevBlock=n}}),p);function _(e,t,r){var i,n=this._iv;n?(i=n,this._iv=void 0):i=this._prevBlock;for(var c=0;c<r;c++)e[t+c]^=i[c]}var l=(e.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,i=r-e.sigBytes%r,n=i<<24|i<<16|i<<8|i,c=[],o=0;o<i;o+=4)c.push(n);var s=a.create(c,i);e.concat(s)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},y=(t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:u,padding:l}),reset:function(){var e;s.reset.call(this);var t=this.cfg,r=t.iv,i=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(i,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),t.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),v=(e.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?a.create([1398893684,1701076831]).concat(r).concat(t):t).toString(c)},parse:function(e){var t,r=c.parse(e),i=r.words;return 1398893684==i[0]&&1701076831==i[1]&&(t=a.create(i.slice(2,4)),i.splice(0,4),r.sigBytes-=16),y.create({ciphertext:r,salt:t})}},k=t.SerializableCipher=r.extend({cfg:r.extend({format:v}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),c=n.finalize(t),o=n.cfg;return y.create({ciphertext:c,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,r,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(r,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),x=(e.kdf={}).OpenSSL={execute:function(e,t,r,i){i=i||a.random(8);var n=o.create({keySize:t+r}).compute(e,i),c=a.create(n.words.slice(t),4*r);return n.sigBytes=4*t,y.create({key:n,iv:c,salt:i})}},g=t.PasswordBasedCipher=k.extend({cfg:k.cfg.extend({kdf:x}),encrypt:function(e,t,r,i){var n=(i=this.cfg.extend(i)).kdf.execute(r,e.keySize,e.ivSize);i.iv=n.iv;var c=k.encrypt.call(this,e,t,n.key,i);return c.mixIn(n),c},decrypt:function(e,t,r,i){i=this.cfg.extend(i),t=this._parse(t,i.format);var n=i.kdf.execute(r,e.keySize,e.ivSize,t.salt);return i.iv=n.iv,k.decrypt.call(this,e,t,n.key,i)}})}()}); |
||||
@ -0,0 +1 @@ |
|||||
|
!function(t,n){"object"==typeof exports?module.exports=exports=n():"function"==typeof define&&define.amd?define([],n):t.CryptoJS=n()}(this,function(){var t=t||function(f){var t;if("undefined"!=typeof window&&window.crypto&&(t=window.crypto),!t&&"undefined"!=typeof window&&window.msCrypto&&(t=window.msCrypto),!t&&"undefined"!=typeof global&&global.crypto&&(t=global.crypto),!t&&"function"==typeof require)try{t=require("crypto")}catch(t){}function i(){if(t){if("function"==typeof t.getRandomValues)try{return t.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof t.randomBytes)try{return t.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")}var e=Object.create||function(t){var n;return r.prototype=t,n=new r,r.prototype=null,n};function r(){}var n={},o=n.lib={},s=o.Base={extend:function(t){var n=e(this);return t&&n.mixIn(t),n.hasOwnProperty("init")&&this.init!==n.init||(n.init=function(){n.$super.init.apply(this,arguments)}),(n.init.prototype=n).$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},p=o.WordArray=s.extend({init:function(t,n){t=this.words=t||[],this.sigBytes=null!=n?n:4*t.length},toString:function(t){return(t||c).stringify(this)},concat:function(t){var n=this.words,e=t.words,i=this.sigBytes,r=t.sigBytes;if(this.clamp(),i%4)for(var o=0;o<r;o++){var s=e[o>>>2]>>>24-o%4*8&255;n[i+o>>>2]|=s<<24-(i+o)%4*8}else for(o=0;o<r;o+=4)n[i+o>>>2]=e[o>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=f.ceil(n/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var n=[],e=0;e<t;e+=4)n.push(i());return new p.init(n,t)}}),a=n.enc={},c=a.Hex={stringify:function(t){for(var n=t.words,e=t.sigBytes,i=[],r=0;r<e;r++){var o=n[r>>>2]>>>24-r%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(t){for(var n=t.length,e=[],i=0;i<n;i+=2)e[i>>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new p.init(e,n/2)}},u=a.Latin1={stringify:function(t){for(var n=t.words,e=t.sigBytes,i=[],r=0;r<e;r++){var o=n[r>>>2]>>>24-r%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var n=t.length,e=[],i=0;i<n;i++)e[i>>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new p.init(e,n)}},d=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},h=o.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=d.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var n,e=this._data,i=e.words,r=e.sigBytes,o=this.blockSize,s=r/(4*o),a=(s=t?f.ceil(s):f.max((0|s)-this._minBufferSize,0))*o,c=f.min(4*a,r);if(a){for(var u=0;u<a;u+=o)this._doProcessBlock(i,u);n=i.splice(0,a),e.sigBytes-=c}return new p.init(n,c)},clone:function(){var t=s.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),l=(o.Hasher=h.extend({cfg:s.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new l.HMAC.init(e,n).finalize(t)}}}),n.algo={});return n}(Math);return t}); |
||||
@ -0,0 +1 @@ |
|||||
|
!function(r,e){"object"==typeof exports?module.exports=exports=e(require("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(r.CryptoJS)}(this,function(r){var s;return s=r.lib.WordArray,r.enc.Base64={stringify:function(r){var e=r.words,t=r.sigBytes,a=this._map;r.clamp();for(var n=[],o=0;o<t;o+=3)for(var i=(e[o>>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,f=0;f<4&&o+.75*f<t;f++)n.push(a.charAt(i>>>6*(3-f)&63));var c=a.charAt(64);if(c)for(;n.length%4;)n.push(c);return n.join("")},parse:function(r){var e=r.length,t=this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var n=0;n<t.length;n++)a[t.charCodeAt(n)]=n}var o=t.charAt(64);if(o){var i=r.indexOf(o);-1!==i&&(e=i)}return function(r,e,t){for(var a=[],n=0,o=0;o<e;o++)if(o%4){var i=t[r.charCodeAt(o-1)]<<o%4*2,f=t[r.charCodeAt(o)]>>>6-o%4*2,c=i|f;a[n>>>2]|=c<<24-n%4*8,n++}return s.create(a,n)}(r,e,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64}); |
||||
@ -0,0 +1 @@ |
|||||
|
!function(e,o){"object"==typeof exports?module.exports=exports=o(require("./core")):"function"==typeof define&&define.amd?define(["./core"],o):o(e.CryptoJS)}(this,function(e){return e.enc.Hex}); |
||||
@ -0,0 +1 @@ |
|||||
|
!function(e,o){"object"==typeof exports?module.exports=exports=o(require("./core")):"function"==typeof define&&define.amd?define(["./core"],o):o(e.CryptoJS)}(this,function(e){return e.enc.Utf8}); |
||||
@ -0,0 +1 @@ |
|||||
|
!function(e,t){"object"==typeof exports?module.exports=exports=t(require("./core"),require("./sha1"),require("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],t):t(e.CryptoJS)}(this,function(e){var t,r,i,u,n,o,a;return r=(t=e).lib,i=r.Base,u=r.WordArray,n=t.algo,o=n.MD5,a=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,i=this.cfg,n=i.hasher.create(),o=u.create(),a=o.words,c=i.keySize,f=i.iterations;a.length<c;){r&&n.update(r),r=n.update(e).finalize(t),n.reset();for(var s=1;s<f;s++)r=n.finalize(r),n.reset();o.concat(r)}return o.sigBytes=4*c,o}}),t.EvpKDF=function(e,t,r){return a.create(r).compute(e,t)},e.EvpKDF}); |
||||
@ -0,0 +1 @@ |
|||||
|
!function(r,e){"object"==typeof exports?module.exports=exports=e(require("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(r.CryptoJS)}(this,function(i){return function(h){var r=i,e=r.lib,t=e.WordArray,n=e.Hasher,o=r.algo,b=[];!function(){for(var r=0;r<64;r++)b[r]=4294967296*h.abs(h.sin(r+1))|0}();var a=o.MD5=n.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(r,e){for(var t=0;t<16;t++){var n=e+t,o=r[n];r[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var a=this._hash.words,i=r[e+0],s=r[e+1],c=r[e+2],f=r[e+3],h=r[e+4],u=r[e+5],v=r[e+6],d=r[e+7],l=r[e+8],_=r[e+9],p=r[e+10],y=r[e+11],D=r[e+12],H=r[e+13],M=r[e+14],g=r[e+15],m=a[0],w=a[1],x=a[2],B=a[3];m=j(m,w,x,B,i,7,b[0]),B=j(B,m,w,x,s,12,b[1]),x=j(x,B,m,w,c,17,b[2]),w=j(w,x,B,m,f,22,b[3]),m=j(m,w,x,B,h,7,b[4]),B=j(B,m,w,x,u,12,b[5]),x=j(x,B,m,w,v,17,b[6]),w=j(w,x,B,m,d,22,b[7]),m=j(m,w,x,B,l,7,b[8]),B=j(B,m,w,x,_,12,b[9]),x=j(x,B,m,w,p,17,b[10]),w=j(w,x,B,m,y,22,b[11]),m=j(m,w,x,B,D,7,b[12]),B=j(B,m,w,x,H,12,b[13]),x=j(x,B,m,w,M,17,b[14]),m=k(m,w=j(w,x,B,m,g,22,b[15]),x,B,s,5,b[16]),B=k(B,m,w,x,v,9,b[17]),x=k(x,B,m,w,y,14,b[18]),w=k(w,x,B,m,i,20,b[19]),m=k(m,w,x,B,u,5,b[20]),B=k(B,m,w,x,p,9,b[21]),x=k(x,B,m,w,g,14,b[22]),w=k(w,x,B,m,h,20,b[23]),m=k(m,w,x,B,_,5,b[24]),B=k(B,m,w,x,M,9,b[25]),x=k(x,B,m,w,f,14,b[26]),w=k(w,x,B,m,l,20,b[27]),m=k(m,w,x,B,H,5,b[28]),B=k(B,m,w,x,c,9,b[29]),x=k(x,B,m,w,d,14,b[30]),m=q(m,w=k(w,x,B,m,D,20,b[31]),x,B,u,4,b[32]),B=q(B,m,w,x,l,11,b[33]),x=q(x,B,m,w,y,16,b[34]),w=q(w,x,B,m,M,23,b[35]),m=q(m,w,x,B,s,4,b[36]),B=q(B,m,w,x,h,11,b[37]),x=q(x,B,m,w,d,16,b[38]),w=q(w,x,B,m,p,23,b[39]),m=q(m,w,x,B,H,4,b[40]),B=q(B,m,w,x,i,11,b[41]),x=q(x,B,m,w,f,16,b[42]),w=q(w,x,B,m,v,23,b[43]),m=q(m,w,x,B,_,4,b[44]),B=q(B,m,w,x,D,11,b[45]),x=q(x,B,m,w,g,16,b[46]),m=z(m,w=q(w,x,B,m,c,23,b[47]),x,B,i,6,b[48]),B=z(B,m,w,x,d,10,b[49]),x=z(x,B,m,w,M,15,b[50]),w=z(w,x,B,m,u,21,b[51]),m=z(m,w,x,B,D,6,b[52]),B=z(B,m,w,x,f,10,b[53]),x=z(x,B,m,w,p,15,b[54]),w=z(w,x,B,m,s,21,b[55]),m=z(m,w,x,B,l,6,b[56]),B=z(B,m,w,x,g,10,b[57]),x=z(x,B,m,w,v,15,b[58]),w=z(w,x,B,m,H,21,b[59]),m=z(m,w,x,B,h,6,b[60]),B=z(B,m,w,x,y,10,b[61]),x=z(x,B,m,w,c,15,b[62]),w=z(w,x,B,m,_,21,b[63]),a[0]=a[0]+m|0,a[1]=a[1]+w|0,a[2]=a[2]+x|0,a[3]=a[3]+B|0},_doFinalize:function(){var r=this._data,e=r.words,t=8*this._nDataBytes,n=8*r.sigBytes;e[n>>>5]|=128<<24-n%32;var o=h.floor(t/4294967296),a=t;e[15+(64+n>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e[14+(64+n>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,s=i.words,c=0;c<4;c++){var f=s[c];s[c]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return i},clone:function(){var r=n.clone.call(this);return r._hash=this._hash.clone(),r}});function j(r,e,t,n,o,a,i){var s=r+(e&t|~e&n)+o+i;return(s<<a|s>>>32-a)+e}function k(r,e,t,n,o,a,i){var s=r+(e&n|t&~n)+o+i;return(s<<a|s>>>32-a)+e}function q(r,e,t,n,o,a,i){var s=r+(e^t^n)+o+i;return(s<<a|s>>>32-a)+e}function z(r,e,t,n,o,a,i){var s=r+(t^(e|~n))+o+i;return(s<<a|s>>>32-a)+e}r.MD5=n._createHelper(a),r.HmacMD5=n._createHmacHelper(a)}(Math),i.MD5}); |
||||
@ -0,0 +1 @@ |
|||||
|
!function(e,o){"object"==typeof exports?module.exports=exports=o(require("./core"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],o):o(e.CryptoJS)}(this,function(e){var o;return e.mode.ECB=((o=e.lib.BlockCipherMode.extend()).Encryptor=o.extend({processBlock:function(e,o){this._cipher.encryptBlock(e,o)}}),o.Decryptor=o.extend({processBlock:function(e,o){this._cipher.decryptBlock(e,o)}}),o),e.mode.ECB}); |
||||
@ -0,0 +1 @@ |
|||||
|
!function(e,r){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],r):r(e.CryptoJS)}(this,function(e){return e.pad.Pkcs7}); |
||||
@ -0,0 +1,40 @@ |
|||||
|
(function (doc, win) { |
||||
|
var docEl = doc.documentElement, |
||||
|
isIOS = navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), |
||||
|
dpr = isIOS ? Math.min(win.devicePixelRatio, 3) : 1, |
||||
|
dpr = window.top === window.self ? dpr : 1, //被iframe引用时,禁止缩放
|
||||
|
dpr = 1, |
||||
|
scale = 1 / dpr, |
||||
|
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'; |
||||
|
docEl.dataset.dpr = dpr; |
||||
|
var metaEl = doc.createElement('meta'); |
||||
|
metaEl.name = 'viewport'; |
||||
|
metaEl.content = 'initial-scale=' + scale + ',maximum-scale=' + scale + ', minimum-scale=' + scale; |
||||
|
docEl.firstElementChild.appendChild(metaEl); |
||||
|
var recalc = function () { |
||||
|
var width = docEl.clientWidth; |
||||
|
if (width / dpr > 750) { |
||||
|
width = 750 * dpr; |
||||
|
} |
||||
|
// 乘以100,px : rem = 100 : 1
|
||||
|
docEl.style.fontSize = 100 * (width / 750) + 'px'; |
||||
|
}; |
||||
|
recalc() |
||||
|
if (!doc.addEventListener) return; |
||||
|
win.addEventListener(resizeEvt, recalc, false); |
||||
|
})(document, window); |
||||
|
|
||||
|
|
||||
|
|
||||
|
const isIPhoneX = () => { |
||||
|
let u = navigator.userAgent; |
||||
|
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); |
||||
|
if (isIOS) { |
||||
|
if (screen.height == 812 && screen.width == 375) { |
||||
|
return true; |
||||
|
} |
||||
|
else { |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
14
library-activity/public/js/swiper6.min.js
File diff suppressed because it is too large
View File
@ -0,0 +1,39 @@ |
|||||
|
<template> |
||||
|
<router-view> </router-view> |
||||
|
</template> |
||||
|
|
||||
|
<style> |
||||
|
html, |
||||
|
body { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
box-sizing: border-box; |
||||
|
padding: 0px; |
||||
|
margin: 0px; |
||||
|
} |
||||
|
#app { |
||||
|
font-family: 'Avenir', Helvetica, Arial, sans-serif; |
||||
|
-webkit-font-smoothing: antialiased; |
||||
|
-moz-osx-font-smoothing: grayscale; |
||||
|
widows: 100%; |
||||
|
height: 100%; |
||||
|
} |
||||
|
/*���������?��������?���ֱ��Ӧ�����������ij�?*/ |
||||
|
div::-webkit-scrollbar { |
||||
|
width: 10px; |
||||
|
height: 10px; |
||||
|
background-color: #f5f5f5; |
||||
|
} |
||||
|
/*����������������Ӱ+Բ?*/ |
||||
|
div::-webkit-scrollbar-track { |
||||
|
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); |
||||
|
border-radius: 10px; |
||||
|
background-color: #f5f5f5; |
||||
|
} |
||||
|
/*���廬������Ӱ+Բ?*/ |
||||
|
div::-webkit-scrollbar-thumb { |
||||
|
border-radius: 10px; |
||||
|
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); |
||||
|
background-color: #aaa; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,191 @@ |
|||||
|
body, |
||||
|
h1, |
||||
|
h2, |
||||
|
h3, |
||||
|
h4, |
||||
|
h5, |
||||
|
h6, |
||||
|
hr, |
||||
|
p, |
||||
|
blockquote, |
||||
|
dl, |
||||
|
dt, |
||||
|
dd, |
||||
|
ul, |
||||
|
ol, |
||||
|
li, |
||||
|
pre, |
||||
|
form, |
||||
|
fieldset, |
||||
|
legend, |
||||
|
button, |
||||
|
input, |
||||
|
textarea, |
||||
|
th, |
||||
|
td { |
||||
|
outline: none; |
||||
|
border: none; |
||||
|
padding: 0; |
||||
|
margin: 0; |
||||
|
text-decoration: inherit |
||||
|
} |
||||
|
|
||||
|
body, |
||||
|
button, |
||||
|
input, |
||||
|
select, |
||||
|
textarea { |
||||
|
font: 12PX/1.5 tahoma, arial, 'microsoft yahei', sans-serif |
||||
|
} |
||||
|
|
||||
|
h1, |
||||
|
h2, |
||||
|
h3, |
||||
|
h4, |
||||
|
h5, |
||||
|
h6 { |
||||
|
font-size: 100%; |
||||
|
} |
||||
|
|
||||
|
address, |
||||
|
cite, |
||||
|
dfn, |
||||
|
em, |
||||
|
var { |
||||
|
font-style: normal; |
||||
|
} |
||||
|
|
||||
|
code, |
||||
|
kbd, |
||||
|
pre, |
||||
|
samp { |
||||
|
font-family: couriernew, courier, monospace; |
||||
|
} |
||||
|
|
||||
|
small { |
||||
|
font-size: 12PX; |
||||
|
} |
||||
|
|
||||
|
ul, |
||||
|
ol { |
||||
|
list-style: none; |
||||
|
} |
||||
|
|
||||
|
a { |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
|
||||
|
a:hover { |
||||
|
text-decoration: underline; |
||||
|
} |
||||
|
|
||||
|
sup { |
||||
|
vertical-align: text-top; |
||||
|
} |
||||
|
|
||||
|
sub { |
||||
|
vertical-align: text-bottom; |
||||
|
} |
||||
|
|
||||
|
legend { |
||||
|
color: #000; |
||||
|
} |
||||
|
|
||||
|
fieldset, |
||||
|
img { |
||||
|
border: 0; |
||||
|
} |
||||
|
|
||||
|
button, |
||||
|
input, |
||||
|
select, |
||||
|
textarea { |
||||
|
font-size: 100%; |
||||
|
} |
||||
|
|
||||
|
table { |
||||
|
border-collapse: collapse; |
||||
|
border-spacing: 0; |
||||
|
} |
||||
|
|
||||
|
@font-face { |
||||
|
font-family: 'iconfont'; /* Project id 1835591 */ |
||||
|
src: url('//at.alicdn.com/t/font_1835591_9gvgo3dg47s.woff2?t=1639703777755') format('woff2'), |
||||
|
url('//at.alicdn.com/t/font_1835591_9gvgo3dg47s.woff?t=1639703777755') format('woff'), |
||||
|
url('//at.alicdn.com/t/font_1835591_9gvgo3dg47s.ttf?t=1639703777755') format('truetype'); |
||||
|
} |
||||
|
.fixedtop{ |
||||
|
width: 100%; |
||||
|
position: fixed; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
z-index: 999; |
||||
|
} |
||||
|
.iconfont { |
||||
|
font-family: "iconfont" !important; |
||||
|
font-size: 16px; |
||||
|
font-style: normal; |
||||
|
-webkit-font-smoothing: antialiased; |
||||
|
-moz-osx-font-smoothing: grayscale; |
||||
|
} |
||||
|
.flexRow{ |
||||
|
display: -webkit-box; |
||||
|
display: -webkit-flex; |
||||
|
display: flex; |
||||
|
-webkit-box-align: center; |
||||
|
-webkit-align-items: center; |
||||
|
align-items: center; |
||||
|
-webkit-box-pack: center; |
||||
|
-webkit-justify-content: center; |
||||
|
justify-content: center; |
||||
|
} |
||||
|
.swiper-pagination-bullet-active{ |
||||
|
background: rgb(255, 255, 255) !important; |
||||
|
opacity:1; |
||||
|
} |
||||
|
.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet{ |
||||
|
background:rgb(186, 192, 223); |
||||
|
opacity: 1 !important; |
||||
|
} |
||||
|
.swiper-slide{ |
||||
|
transform: translate3d(0, 0, 0); |
||||
|
} |
||||
|
|
||||
|
img{ |
||||
|
object-fit: cover; |
||||
|
} |
||||
|
|
||||
|
body{ |
||||
|
overflow-x: hidden; |
||||
|
background-color: #F4F4FC; |
||||
|
} |
||||
|
|
||||
|
.main { |
||||
|
width: 100%; |
||||
|
overflow-x: hidden; |
||||
|
/* padding-bottom: 1rem; */ |
||||
|
background-color: #F4F4FC; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
} |
||||
|
|
||||
|
.overflow-txt-only{ |
||||
|
word-break: break-all; |
||||
|
display: -webkit-box; |
||||
|
-webkit-box-orient: vertical; |
||||
|
-webkit-line-clamp: 1; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
} |
||||
|
.overflow-txt{ |
||||
|
word-break: break-all; |
||||
|
display: -webkit-box; |
||||
|
-webkit-box-orient: vertical; |
||||
|
-webkit-line-clamp: 2; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
} |
||||
13
library-activity/src/assets/css/swiper6.min.css
File diff suppressed because it is too large
View File
|
After Width: 48 | Height: 48 | Size: 740 B |
|
After Width: 48 | Height: 48 | Size: 945 B |
|
After Width: 16 | Height: 16 | Size: 290 B |
|
After Width: 40 | Height: 40 | Size: 386 B |
|
After Width: 686 | Height: 284 | Size: 86 KiB |
|
After Width: 183 | Height: 60 | Size: 7.4 KiB |
|
After Width: 183 | Height: 60 | Size: 4.8 KiB |
|
After Width: 151 | Height: 60 | Size: 2.7 KiB |
|
After Width: 48 | Height: 48 | Size: 1.3 KiB |
|
After Width: 48 | Height: 48 | Size: 1.3 KiB |
|
After Width: 48 | Height: 48 | Size: 975 B |
|
After Width: 48 | Height: 48 | Size: 1.8 KiB |
|
After Width: 60 | Height: 60 | Size: 2.4 KiB |
|
After Width: 24 | Height: 24 | Size: 806 B |
|
After Width: 32 | Height: 32 | Size: 969 B |
|
After Width: 36 | Height: 36 | Size: 1.1 KiB |
|
After Width: 56 | Height: 56 | Size: 1.0 KiB |
|
After Width: 48 | Height: 48 | Size: 1.2 KiB |
|
After Width: 48 | Height: 48 | Size: 1.2 KiB |
|
After Width: 750 | Height: 320 | Size: 28 KiB |
|
After Width: 399 | Height: 255 | Size: 33 KiB |
|
After Width: 56 | Height: 56 | Size: 1.0 KiB |
|
After Width: 37 | Height: 37 | Size: 1.3 KiB |
|
After Width: 26 | Height: 26 | Size: 703 B |
|
After Width: 251 | Height: 251 | Size: 15 KiB |
|
After Width: 52 | Height: 52 | Size: 1.4 KiB |
|
After Width: 52 | Height: 52 | Size: 1.6 KiB |
|
After Width: 15 | Height: 15 | Size: 525 B |
|
After Width: 15 | Height: 15 | Size: 529 B |
2
library-activity/src/assets/js/axios.js
File diff suppressed because it is too large
View File
@ -0,0 +1,40 @@ |
|||||
|
(function (doc, win) { |
||||
|
var docEl = doc.documentElement, |
||||
|
isIOS = navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), |
||||
|
dpr = isIOS ? Math.min(win.devicePixelRatio, 3) : 1, |
||||
|
dpr = window.top === window.self ? dpr : 1, //被iframe引用时,禁止缩放
|
||||
|
dpr = 1, |
||||
|
scale = 1 / dpr, |
||||
|
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'; |
||||
|
docEl.dataset.dpr = dpr; |
||||
|
var metaEl = doc.createElement('meta'); |
||||
|
metaEl.name = 'viewport'; |
||||
|
metaEl.content = 'initial-scale=' + scale + ',maximum-scale=' + scale + ', minimum-scale=' + scale; |
||||
|
docEl.firstElementChild.appendChild(metaEl); |
||||
|
var recalc = function () { |
||||
|
var width = docEl.clientWidth; |
||||
|
if (width / dpr > 750) { |
||||
|
width = 750 * dpr; |
||||
|
} |
||||
|
// 乘以100,px : rem = 100 : 1
|
||||
|
docEl.style.fontSize = 100 * (width / 750) + 'px'; |
||||
|
}; |
||||
|
recalc() |
||||
|
if (!doc.addEventListener) return; |
||||
|
win.addEventListener(resizeEvt, recalc, false); |
||||
|
})(document, window); |
||||
|
|
||||
|
|
||||
|
|
||||
|
const isIPhoneX = () => { |
||||
|
let u = navigator.userAgent; |
||||
|
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); |
||||
|
if (isIOS) { |
||||
|
if (screen.height == 812 && screen.width == 375) { |
||||
|
return true; |
||||
|
} |
||||
|
else { |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
14
library-activity/src/assets/js/swiper6.min.js
File diff suppressed because it is too large
View File
|
After Width: 40 | Height: 40 | Size: 1.1 KiB |
@ -0,0 +1,155 @@ |
|||||
|
// created by gpake
|
||||
|
export function qiniuUploader() { |
||||
|
|
||||
|
var config = { |
||||
|
qiniuRegion: '', |
||||
|
qiniuImageURLPrefix: '', |
||||
|
qiniuUploadToken: '', |
||||
|
qiniuUploadTokenURL: '', |
||||
|
qiniuUploadTokenFunction: null, |
||||
|
qiniuShouldUseQiniuFileName: false |
||||
|
} |
||||
|
|
||||
|
// module.exports = {
|
||||
|
// init: init,
|
||||
|
// upload: upload,
|
||||
|
// }
|
||||
|
|
||||
|
// 在整个程序生命周期中,只需要 init 一次即可
|
||||
|
// 如果需要变更参数,再调用 init 即可
|
||||
|
function init(options) { |
||||
|
config = { |
||||
|
qiniuRegion: '', |
||||
|
qiniuImageURLPrefix: '', |
||||
|
qiniuUploadToken: '', |
||||
|
qiniuUploadTokenURL: '', |
||||
|
qiniuUploadTokenFunction: null, |
||||
|
qiniuShouldUseQiniuFileName: false |
||||
|
}; |
||||
|
updateConfigWithOptions(options); |
||||
|
} |
||||
|
|
||||
|
function updateConfigWithOptions(options) { |
||||
|
if (options.region) { |
||||
|
config.qiniuRegion = options.region; |
||||
|
} else { |
||||
|
console.error('qiniu uploader need your bucket region'); |
||||
|
} |
||||
|
if (options.uptoken) { |
||||
|
config.qiniuUploadToken = options.uptoken; |
||||
|
} else if (options.uptokenURL) { |
||||
|
config.qiniuUploadTokenURL = options.uptokenURL; |
||||
|
} else if(options.uptokenFunc) { |
||||
|
config.qiniuUploadTokenFunction = options.uptokenFunc; |
||||
|
} |
||||
|
if (options.domain) { |
||||
|
config.qiniuImageURLPrefix = options.domain; |
||||
|
} |
||||
|
config.qiniuShouldUseQiniuFileName = options.shouldUseQiniuFileName |
||||
|
} |
||||
|
|
||||
|
function upload(file, success, fail, options) { |
||||
|
if (null == file) { |
||||
|
console.error('qiniu uploader need file to upload'); |
||||
|
return; |
||||
|
} |
||||
|
if (options) { |
||||
|
updateConfigWithOptions(options); |
||||
|
} |
||||
|
if (config.qiniuUploadToken) { |
||||
|
doUpload(file, success, fail, options); |
||||
|
} else if (config.qiniuUploadTokenURL) { |
||||
|
getQiniuToken(function() { |
||||
|
doUpload(file, success, fail, options); |
||||
|
}); |
||||
|
} else if (config.qiniuUploadTokenFunction) { |
||||
|
config.qiniuUploadToken = config.qiniuUploadTokenFunction(); |
||||
|
if (null == config.qiniuUploadToken && config.qiniuUploadToken.length > 0) { |
||||
|
console.error('qiniu UploadTokenFunction result is null, please check the return value'); |
||||
|
return |
||||
|
} |
||||
|
doUpload(file, success, fail, options); |
||||
|
} else { |
||||
|
console.error('qiniu uploader need one of [uptoken, uptokenURL, uptokenFunc]'); |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function doUpload(file, success, fail, options) { |
||||
|
if (null == config.qiniuUploadToken && config.qiniuUploadToken.length > 0) { |
||||
|
console.error('qiniu UploadToken is null, please check the init config or networking'); |
||||
|
return |
||||
|
} |
||||
|
var url = uploadURLFromRegionCode(config.qiniuRegion); |
||||
|
var formData = { |
||||
|
'token': config.qiniuUploadToken |
||||
|
}; |
||||
|
if (!config.qiniuShouldUseQiniuFileName) { |
||||
|
formData['key'] = options.key || file.name |
||||
|
} |
||||
|
let dataObject = { |
||||
|
fileUrl: '' |
||||
|
} |
||||
|
let param = new FormData() // 创建form对象
|
||||
|
param.append('key', formData.key) // 通过append向form对象添加数据
|
||||
|
param.append('token', formData.token) // 通过append向form对象添加数据
|
||||
|
param.append('file', file, file.name) // 通过append向form对象添加数据
|
||||
|
// 上传请求
|
||||
|
axios.post(url, param, config) |
||||
|
.then(res => { |
||||
|
if (res.data) { |
||||
|
dataObject = res.data; |
||||
|
if (res.data.key) { |
||||
|
dataObject.fileUrl = location.protocol +'//' + config.qiniuImageURLPrefix + '/' + res.data.key |
||||
|
} |
||||
|
success(dataObject); |
||||
|
} else { |
||||
|
fail(res.statusText) |
||||
|
} |
||||
|
}) |
||||
|
.catch(res => { |
||||
|
fail(res) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
function getQiniuToken(callback) { |
||||
|
axios.get(config.qiniuUploadTokenURL,{ |
||||
|
params: {} |
||||
|
}) |
||||
|
.then(res => { |
||||
|
var token = res.data.uptoken; |
||||
|
if (token && token.length > 0) { |
||||
|
config.qiniuUploadToken = token; |
||||
|
if (callback) { |
||||
|
callback(); |
||||
|
} |
||||
|
} else { |
||||
|
console.error('qiniuUploader cannot get your token, please check the uptokenURL or server') |
||||
|
} |
||||
|
}) |
||||
|
.catch(res => { |
||||
|
console.log(res) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
function uploadURLFromRegionCode(code) { |
||||
|
var uploadURL = null; |
||||
|
switch(code) { |
||||
|
case 'ECN': uploadURL = location.protocol + '//upload.qiniup.com'; break; |
||||
|
case 'NCN': uploadURL = location.protocol + '//up-z1.qiniup.com'; break; |
||||
|
case 'SCN': uploadURL = location.protocol + '//up-z2.qiniup.com'; break; |
||||
|
case 'NA': uploadURL = location.protocol + '//up-na0.qiniup.com'; break; |
||||
|
case 'ASG': uploadURL = location.protocol + '//up-as0.qiniup.com'; break; |
||||
|
default: console.error('please make the region is with one of [ECN, SCN, NCN, NA, ASG]'); |
||||
|
} |
||||
|
return uploadURL; |
||||
|
} |
||||
|
|
||||
|
return { |
||||
|
config, |
||||
|
init, |
||||
|
upload, |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
@ -0,0 +1,47 @@ |
|||||
|
import { reactive,ref,computed,onMounted,getCurrentInstance,watch } from 'vue'; |
||||
|
|
||||
|
export function selectLbrary() { |
||||
|
const { proxy } = getCurrentInstance(); |
||||
|
//let lbraryArray = ref(["武汉图书馆", "国家图书馆", "汤湖图书馆", "科技精英图书馆"]);
|
||||
|
let lbraryArrayData = reactive({ |
||||
|
lbraryArray:["武汉图书馆", "国家图书馆", "汤湖图书馆", "科技精英图书馆"], |
||||
|
iftshow: false, |
||||
|
toastmassage:'' |
||||
|
}) |
||||
|
//获取图书馆列表
|
||||
|
let GetArrayList = () => { |
||||
|
const that = proxy; |
||||
|
that.$http.get(that.$API.GETLIBRARYINFO,{ |
||||
|
params: {} |
||||
|
}) |
||||
|
.then(res => { |
||||
|
lbraryArrayData.lbraryArray = [ |
||||
|
{ |
||||
|
text:'请选择图书馆', |
||||
|
id:0 |
||||
|
} |
||||
|
] |
||||
|
if (res.type == 200) { |
||||
|
for(let i = 0; i < res.data.length; i++){ |
||||
|
let obj = { |
||||
|
text:'', |
||||
|
id:'' |
||||
|
} |
||||
|
obj.text = res.data[i].name; |
||||
|
obj.id = res.data[i].id; |
||||
|
lbraryArrayData.lbraryArray.push(obj) |
||||
|
} |
||||
|
} else { |
||||
|
lbraryArrayData.iftshow++, |
||||
|
lbraryArrayData.toastmassage= res.content; |
||||
|
} |
||||
|
}) |
||||
|
.catch(res => { |
||||
|
console.log(res) |
||||
|
}) |
||||
|
} |
||||
|
GetArrayList(); |
||||
|
return { |
||||
|
lbraryArrayData |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
import { computed } from 'vue' |
||||
|
import { useStore } from 'vuex' |
||||
|
import { useRoute } from 'vue-router' |
||||
|
|
||||
|
export const toHost = (url) => { |
||||
|
return computed(() => { |
||||
|
const host = url.replace(/^https?:\/\//, '').replace(/\/.*$/, '') |
||||
|
const parts = host.split('.').slice(-3) |
||||
|
if (parts[0] === 'www') parts.shift() |
||||
|
|
||||
|
return parts.join('.') |
||||
|
}) |
||||
|
} |
||||
@ -0,0 +1,62 @@ |
|||||
|
<template> |
||||
|
<div class="tishi-di" v-if="data.ifs"> |
||||
|
<div class="tishi"> |
||||
|
{{toastmassage}} |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { reactive,computed,onMounted,watch } from 'vue'; |
||||
|
export default { |
||||
|
props: { |
||||
|
toastmassage: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
iftshow: { |
||||
|
type: Number, |
||||
|
default: 0 |
||||
|
} |
||||
|
}, |
||||
|
setup(props){ |
||||
|
const data = reactive({ |
||||
|
timer:null, |
||||
|
ifs:false |
||||
|
}) |
||||
|
watch(() => props.iftshow, (oldVlaue, newValue) => { |
||||
|
data.ifs = true; |
||||
|
}) |
||||
|
watch(() => data.ifs, (oldVlaue, newValue) => { |
||||
|
let that = data; |
||||
|
clearTimeout(that.timer); |
||||
|
that.timer = null; |
||||
|
that.timer=setTimeout(function(){ |
||||
|
that.ifs = false; |
||||
|
},1500) |
||||
|
}) |
||||
|
return { |
||||
|
data |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.tishi-di{ |
||||
|
width: 100%; |
||||
|
position: fixed; |
||||
|
bottom: 16%; |
||||
|
left: 0; |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
} |
||||
|
.tishi{ |
||||
|
padding: 0.18rem 0.40rem; |
||||
|
background-color: rgb(226,226,226,0.9); |
||||
|
font-size: 0.28rem; |
||||
|
color: #222222; |
||||
|
border-radius: 0.04rem; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,116 @@ |
|||||
|
<template> |
||||
|
<div class="tab-bar-main"> |
||||
|
<div :class="['bar-item',tabCur === 0 ? 'active':'' ]" @click="toActive"> |
||||
|
<i></i> |
||||
|
<span>活动</span> |
||||
|
</div> |
||||
|
<div :class="['bar-item',tabCur === 1 ? 'active':'' ]" @click="toCart"> |
||||
|
<i></i> |
||||
|
<span>书车</span> |
||||
|
</div> |
||||
|
<div :class="['bar-item',tabCur === 2 ? 'active':'' ]" @click="toMine"> |
||||
|
<i></i> |
||||
|
<span>我的</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { reactive, computed, onMounted, getCurrentInstance } from 'vue' |
||||
|
export default { |
||||
|
name: 'tabBar', |
||||
|
props: { |
||||
|
tabCur: { |
||||
|
type: Number, |
||||
|
default() { |
||||
|
return 0; |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
setup() { |
||||
|
const { proxy } = getCurrentInstance() |
||||
|
let data = reactive({ |
||||
|
|
||||
|
}) |
||||
|
let toActive = () => { |
||||
|
proxy.$router.push({ path: '/' }) |
||||
|
} |
||||
|
let toCart = () => { |
||||
|
proxy.$router.push({ path: '/Cart' }) |
||||
|
} |
||||
|
let toMine = () => { |
||||
|
proxy.$router.push({ path: '/Mine' }) |
||||
|
} |
||||
|
return { |
||||
|
data, |
||||
|
toActive, |
||||
|
toCart, |
||||
|
toMine, |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped lang="scss"> |
||||
|
.tab-bar-main { |
||||
|
position: fixed; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
text-align: center; |
||||
|
width: 100%; |
||||
|
height: 1.225rem; |
||||
|
background-color: #fff; |
||||
|
|
||||
|
.bar-item { |
||||
|
flex: 1; |
||||
|
font-size: 0.275rem; |
||||
|
color: #BEC7DC; |
||||
|
i { |
||||
|
display: block; |
||||
|
width: 0.6rem; |
||||
|
height: 0.6rem; |
||||
|
margin: 0 auto; |
||||
|
} |
||||
|
&:first-child { |
||||
|
i { |
||||
|
background: url('@assets/images/active.png') no-repeat; |
||||
|
background-size: cover; |
||||
|
} |
||||
|
} |
||||
|
&:nth-child(2) { |
||||
|
i { |
||||
|
background: url('@assets/images/cart.png') no-repeat; |
||||
|
background-size: cover; |
||||
|
} |
||||
|
} |
||||
|
&:last-child { |
||||
|
i { |
||||
|
background: url('@assets/images/mine.png') no-repeat; |
||||
|
background-size: cover; |
||||
|
} |
||||
|
} |
||||
|
&.active { |
||||
|
color: #5F75A9; |
||||
|
&:first-child { |
||||
|
i { |
||||
|
background: url('@assets/images/activeA.png') no-repeat; |
||||
|
background-size: cover; |
||||
|
} |
||||
|
} |
||||
|
&:nth-child(2) { |
||||
|
i { |
||||
|
background: url('@assets/images/cartA.png') no-repeat; |
||||
|
background-size: cover; |
||||
|
} |
||||
|
} |
||||
|
&:last-child { |
||||
|
i { |
||||
|
background: url('@assets/images/mineA.png') no-repeat; |
||||
|
background-size: cover; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,477 @@ |
|||||
|
<template> |
||||
|
<div class="slide-verify" :style="{width: w + 'px'}" id="slideVerify" onselectstart="return false;"> |
||||
|
<!-- 图片加载遮蔽罩 --> |
||||
|
<div :class="{'slider-verify-loading': loadBlock}"></div> |
||||
|
<canvas :width="w" :height="h" ref="canvas" ></canvas> |
||||
|
<div v-if="show" @click="refresh" class="slide-verify-refresh-icon"></div> |
||||
|
<canvas :width="w" :height="h" ref="block" class="slide-verify-block"></canvas> |
||||
|
<!-- container --> |
||||
|
<div class="slide-verify-slider" :class="{'container-active': containerActive, 'container-success': containerSuccess, 'container-fail': containerFail}"> |
||||
|
<div class="slide-verify-slider-mask" :style="{width: sliderMaskWidth}"> |
||||
|
<!-- slider --> |
||||
|
<div @mousedown="sliderDown" |
||||
|
@touchstart="touchStartEvent" |
||||
|
@touchmove="touchMoveEvent" |
||||
|
@touchend="touchEndEvent" |
||||
|
class="slide-verify-slider-mask-item" |
||||
|
:style="{left: sliderLeft}"> |
||||
|
<div class="slide-verify-slider-mask-item-icon"></div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<span class="slide-verify-slider-text">{{sliderText}}</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
const PI = Math.PI; |
||||
|
|
||||
|
function sum(x, y) { |
||||
|
return x + y |
||||
|
} |
||||
|
|
||||
|
function square(x) { |
||||
|
return x * x |
||||
|
} |
||||
|
export default { |
||||
|
name: 'SlideVerify', |
||||
|
props: { |
||||
|
// block length |
||||
|
l: { |
||||
|
type: Number, |
||||
|
default: 42, |
||||
|
}, |
||||
|
// block radius |
||||
|
r: { |
||||
|
type: Number, |
||||
|
default: 10, |
||||
|
}, |
||||
|
// canvas width |
||||
|
w: { |
||||
|
type: Number, |
||||
|
default: 310, |
||||
|
}, |
||||
|
// canvas height |
||||
|
h: { |
||||
|
type: Number, |
||||
|
default: 155, |
||||
|
}, |
||||
|
sliderText: { |
||||
|
type: String, |
||||
|
default: '向右滑动滑块填充拼图', |
||||
|
}, |
||||
|
accuracy: { |
||||
|
type: Number, |
||||
|
default: 5, // 若为 -1 则不进行机器判断 |
||||
|
}, |
||||
|
show: { |
||||
|
type: Boolean, |
||||
|
default: true, |
||||
|
}, |
||||
|
imgs: { |
||||
|
type: Array, |
||||
|
default: () => [], |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
containerActive: false, // container active class |
||||
|
containerSuccess: false, // container success class |
||||
|
containerFail: false, // container fail class |
||||
|
canvasCtx: null, |
||||
|
blockCtx: null, |
||||
|
block: null, |
||||
|
block_x: undefined, // container random position |
||||
|
block_y: undefined, |
||||
|
L: this.l + this.r * 2 + 3, // block real lenght |
||||
|
img: undefined, |
||||
|
originX: undefined, |
||||
|
originY: undefined, |
||||
|
isMouseDown: false, |
||||
|
trail: [], |
||||
|
sliderLeft: 0, // block right offset |
||||
|
sliderMaskWidth: 0, // mask width, |
||||
|
success: false, // Bug Fixes 修复了验证成功后还能滑动 |
||||
|
loadBlock: true, // Features 图片加载提示,防止图片没加载完就开始验证 |
||||
|
timestamp: null, |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.init() |
||||
|
}, |
||||
|
methods: { |
||||
|
init() { |
||||
|
this.initDom() |
||||
|
this.initImg() |
||||
|
this.bindEvents() |
||||
|
}, |
||||
|
initDom() { |
||||
|
this.block = this.$refs.block; |
||||
|
this.canvasCtx = this.$refs.canvas.getContext('2d') |
||||
|
this.blockCtx = this.block.getContext('2d') |
||||
|
}, |
||||
|
initImg() { |
||||
|
const img = this.createImg(() => { |
||||
|
// 图片加载完关闭遮蔽罩 |
||||
|
this.loadBlock = false; |
||||
|
this.drawBlock() |
||||
|
this.canvasCtx.drawImage(img, 0, 0, this.w, this.h) |
||||
|
this.blockCtx.drawImage(img, 0, 0, this.w, this.h) |
||||
|
let { |
||||
|
block_x: x, |
||||
|
block_y: y, |
||||
|
r, |
||||
|
L |
||||
|
} = this |
||||
|
let _y = y - r * 2 - 1 |
||||
|
let ImageData = this.blockCtx.getImageData(x, _y, L, L); |
||||
|
this.block.width = L; |
||||
|
this.blockCtx.putImageData(ImageData, 0, _y) |
||||
|
}); |
||||
|
this.img = img; |
||||
|
}, |
||||
|
drawBlock() { |
||||
|
this.block_x = this.getRandomNumberByRange(this.L + 10, this.w - (this.L + 10)) |
||||
|
this.block_y = this.getRandomNumberByRange(10 + this.r * 2, this.h - (this.L + 10)) |
||||
|
this.draw(this.canvasCtx, this.block_x, this.block_y, 'fill') |
||||
|
this.draw(this.blockCtx, this.block_x, this.block_y, 'clip') |
||||
|
}, |
||||
|
draw(ctx, x, y, operation) { |
||||
|
let { |
||||
|
l, |
||||
|
r |
||||
|
} = this; |
||||
|
ctx.beginPath() |
||||
|
ctx.moveTo(x, y) |
||||
|
ctx.arc(x + l / 2, y - r + 2, r, 0.72 * PI, 2.26 * PI) |
||||
|
ctx.lineTo(x + l, y) |
||||
|
ctx.arc(x + l + r - 2, y + l / 2, r, 1.21 * PI, 2.78 * PI) |
||||
|
ctx.lineTo(x + l, y + l) |
||||
|
ctx.lineTo(x, y + l) |
||||
|
ctx.arc(x + r - 2, y + l / 2, r + 0.4, 2.76 * PI, 1.24 * PI, true) |
||||
|
ctx.lineTo(x, y) |
||||
|
ctx.lineWidth = 2 |
||||
|
ctx.fillStyle = 'rgba(255, 255, 255, 0.7)' |
||||
|
ctx.strokeStyle = 'rgba(255, 255, 255, 0.7)' |
||||
|
ctx.stroke() |
||||
|
ctx[operation]() |
||||
|
// Bug Fixes 修复了火狐和ie显示问题 |
||||
|
ctx.globalCompositeOperation = "destination-over" |
||||
|
}, |
||||
|
createImg(onload) { |
||||
|
const img = document.createElement('img'); |
||||
|
img.crossOrigin = "Anonymous"; |
||||
|
img.onload = onload; |
||||
|
img.onerror = () => { |
||||
|
img.src = this.getRandomImg() |
||||
|
} |
||||
|
img.src = this.getRandomImg() |
||||
|
return img; |
||||
|
}, |
||||
|
// 随机生成img src |
||||
|
getRandomImg() { |
||||
|
// return require('../assets/img.jpg') |
||||
|
const len = this.imgs.length; |
||||
|
return len > 0 ? |
||||
|
this.imgs[this.getRandomNumberByRange(0, len)] : |
||||
|
'https://picsum.photos/300/150/?image=' + this.getRandomNumberByRange(0, 1084); |
||||
|
}, |
||||
|
getRandomNumberByRange(start, end) { |
||||
|
return Math.round(Math.random() * (end - start) + start) |
||||
|
}, |
||||
|
refresh() { |
||||
|
this.reset() |
||||
|
this.$emit('refresh') |
||||
|
}, |
||||
|
sliderDown(event) { |
||||
|
if (this.success) return; |
||||
|
this.originX = event.clientX; |
||||
|
this.originY = event.clientY; |
||||
|
this.isMouseDown = true; |
||||
|
this.timestamp = + new Date(); |
||||
|
}, |
||||
|
touchStartEvent(e) { |
||||
|
if (this.success) return; |
||||
|
this.originX = e.changedTouches[0].pageX; |
||||
|
this.originY = e.changedTouches[0].pageY; |
||||
|
this.isMouseDown = true; |
||||
|
this.timestamp = + new Date(); |
||||
|
}, |
||||
|
bindEvents() { |
||||
|
document.addEventListener('mousemove', (e) => { |
||||
|
if (!this.isMouseDown) return false; |
||||
|
const moveX = e.clientX - this.originX; |
||||
|
const moveY = e.clientY - this.originY; |
||||
|
if (moveX < 0 || moveX + 38 >= this.w) return false; |
||||
|
this.sliderLeft = moveX + 'px'; |
||||
|
let blockLeft = (this.w - 40 - 20) / (this.w - 40) * moveX; |
||||
|
this.block.style.left = blockLeft + 'px'; |
||||
|
|
||||
|
this.containerActive = true; // add active |
||||
|
this.sliderMaskWidth = moveX + 'px'; |
||||
|
this.trail.push(moveY); |
||||
|
}); |
||||
|
document.addEventListener('mouseup', (e) => { |
||||
|
if (!this.isMouseDown) return false |
||||
|
this.isMouseDown = false |
||||
|
if (e.clientX === this.originX) return false; |
||||
|
this.containerActive = false; // remove active |
||||
|
this.timestamp = + new Date() - this.timestamp; |
||||
|
|
||||
|
const { |
||||
|
spliced, |
||||
|
TuringTest |
||||
|
} = this.verify(); |
||||
|
if (spliced) { |
||||
|
if(this.accuracy === -1) { |
||||
|
this.containerSuccess = true; |
||||
|
this.success = true; |
||||
|
this.$emit('success', this.timestamp); |
||||
|
return; |
||||
|
} |
||||
|
if (TuringTest) { |
||||
|
// succ |
||||
|
this.containerSuccess = true; |
||||
|
this.success = true; |
||||
|
this.$emit('success', this.timestamp) |
||||
|
} else { |
||||
|
this.containerFail = true; |
||||
|
this.$emit('again') |
||||
|
} |
||||
|
} else { |
||||
|
this.containerFail = true; |
||||
|
this.$emit('fail') |
||||
|
setTimeout(() => { |
||||
|
this.reset() |
||||
|
}, 1000) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
touchMoveEvent(e) { |
||||
|
if (!this.isMouseDown) return false; |
||||
|
const moveX = e.changedTouches[0].pageX - this.originX; |
||||
|
const moveY = e.changedTouches[0].pageY - this.originY; |
||||
|
if (moveX < 0 || moveX + 38 >= this.w) return false; |
||||
|
this.sliderLeft = moveX + 'px'; |
||||
|
let blockLeft = (this.w - 40 - 20) / (this.w - 40) * moveX; |
||||
|
this.block.style.left = blockLeft + 'px'; |
||||
|
|
||||
|
this.containerActive = true; |
||||
|
this.sliderMaskWidth = moveX + 'px'; |
||||
|
this.trail.push(moveY); |
||||
|
}, |
||||
|
touchEndEvent(e) { |
||||
|
if (!this.isMouseDown) return false |
||||
|
this.isMouseDown = false |
||||
|
if (e.changedTouches[0].pageX === this.originX) return false; |
||||
|
this.containerActive = false; |
||||
|
this.timestamp = + new Date() - this.timestamp; |
||||
|
|
||||
|
const { |
||||
|
spliced, |
||||
|
TuringTest |
||||
|
} = this.verify(); |
||||
|
if (spliced) { |
||||
|
if(this.accuracy === -1) { |
||||
|
this.containerSuccess = true; |
||||
|
this.success = true; |
||||
|
this.$emit('success', this.timestamp); |
||||
|
return; |
||||
|
} |
||||
|
if (TuringTest) { |
||||
|
// succ |
||||
|
this.containerSuccess = true; |
||||
|
this.success = true; |
||||
|
this.$emit('success', this.timestamp) |
||||
|
} else { |
||||
|
this.containerFail = true; |
||||
|
this.$emit('again') |
||||
|
} |
||||
|
} else { |
||||
|
this.containerFail = true; |
||||
|
this.$emit('fail') |
||||
|
setTimeout(() => { |
||||
|
this.reset() |
||||
|
}, 1000) |
||||
|
} |
||||
|
}, |
||||
|
verify() { |
||||
|
const arr = this.trail // drag y move distance |
||||
|
const average = arr.reduce(sum) / arr.length // average |
||||
|
const deviations = arr.map(x => x - average) // deviation array |
||||
|
const stddev = Math.sqrt(deviations.map(square).reduce(sum) / arr.length) // standard deviation |
||||
|
const left = parseInt(this.block.style.left) |
||||
|
const accuracy = this.accuracy <= 1 ? 1 : this.accuracy > 10 ? 10 : this.accuracy; |
||||
|
return { |
||||
|
spliced: Math.abs(left - this.block_x) <= accuracy, |
||||
|
TuringTest: average !== stddev, // equal => not person operate |
||||
|
} |
||||
|
}, |
||||
|
reset() { |
||||
|
this.success = false; |
||||
|
this.containerActive = false; |
||||
|
this.containerSuccess = false; |
||||
|
this.containerFail = false; |
||||
|
this.sliderLeft = 0; |
||||
|
this.block.style.left = 0; |
||||
|
this.sliderMaskWidth = 0; |
||||
|
// canvas |
||||
|
let { |
||||
|
w, |
||||
|
h |
||||
|
} = this; |
||||
|
this.canvasCtx.clearRect(0, 0, w, h) |
||||
|
this.blockCtx.clearRect(0, 0, w, h) |
||||
|
this.block.width = w |
||||
|
|
||||
|
// generate img |
||||
|
this.img.src = this.getRandomImg(); |
||||
|
this.$emit('fulfilled') |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.slide-verify { |
||||
|
position: relative; |
||||
|
} |
||||
|
|
||||
|
/* 图片加载样式 */ |
||||
|
.slider-verify-loading{ |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
left: 0; |
||||
|
bottom: 0; |
||||
|
background: rgba(255, 255, 255, 0.9); |
||||
|
z-index: 999; |
||||
|
animation: loading 1.5s infinite; |
||||
|
} |
||||
|
|
||||
|
@keyframes loading { |
||||
|
0%{ |
||||
|
opacity: .7; |
||||
|
} |
||||
|
100% { |
||||
|
opacity: 9; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.slide-verify-block { |
||||
|
position: absolute; |
||||
|
left: 0; |
||||
|
top: 0 |
||||
|
} |
||||
|
|
||||
|
.slide-verify-refresh-icon { |
||||
|
position: absolute; |
||||
|
right: 0; |
||||
|
top: 0; |
||||
|
width: 34px; |
||||
|
height: 34px; |
||||
|
cursor: pointer; |
||||
|
background: url("../../assets/images/login/icon_light.png") 0 -437px; |
||||
|
background-size: 34px 471px |
||||
|
} |
||||
|
|
||||
|
.slide-verify-slider { |
||||
|
position: relative; |
||||
|
text-align: center; |
||||
|
width: 100%; |
||||
|
height: 40px; |
||||
|
line-height: 40px; |
||||
|
margin-top: 15px; |
||||
|
background: #f7f9fa; |
||||
|
color: #45494c; |
||||
|
border: 1px solid #e4e7eb |
||||
|
} |
||||
|
|
||||
|
.slide-verify-slider-mask { |
||||
|
position: absolute; |
||||
|
left: 0; |
||||
|
top: 0; |
||||
|
height: 40px; |
||||
|
border: 0 solid #1991FA; |
||||
|
background: #D1E9FE |
||||
|
} |
||||
|
|
||||
|
.slide-verify-slider-mask-item { |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
width: 40px; |
||||
|
height: 40px; |
||||
|
background: #fff; |
||||
|
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3); |
||||
|
cursor: pointer; |
||||
|
transition: background .2s linear |
||||
|
} |
||||
|
|
||||
|
.slide-verify-slider-mask-item:hover { |
||||
|
background: #1991FA |
||||
|
} |
||||
|
|
||||
|
.slide-verify-slider-mask-item:hover .slide-verify-slider-mask-item-icon { |
||||
|
background-position: 0 -13px |
||||
|
} |
||||
|
|
||||
|
.slide-verify-slider-mask-item-icon { |
||||
|
position: absolute; |
||||
|
top: 15px; |
||||
|
left: 13px; |
||||
|
width: 14px; |
||||
|
height: 12px; |
||||
|
background: url("../../assets/images/login/icon_light.png") 0 -26px; |
||||
|
background-size: 34px 471px |
||||
|
} |
||||
|
.container-active .slide-verify-slider-mask-item { |
||||
|
height: 38px; |
||||
|
top: -1px; |
||||
|
border: 1px solid #1991FA; |
||||
|
} |
||||
|
|
||||
|
.container-active .slide-verify-slider-mask { |
||||
|
height: 38px; |
||||
|
border-width: 1px; |
||||
|
} |
||||
|
|
||||
|
.container-success .slide-verify-slider-mask-item { |
||||
|
height: 38px; |
||||
|
top: -1px; |
||||
|
border: 1px solid #52CCBA; |
||||
|
background-color: #52CCBA !important; |
||||
|
} |
||||
|
|
||||
|
.container-success .slide-verify-slider-mask { |
||||
|
height: 38px; |
||||
|
border: 1px solid #52CCBA; |
||||
|
background-color: #D2F4EF; |
||||
|
} |
||||
|
|
||||
|
.container-success .slide-verify-slider-mask-item-icon { |
||||
|
background-position: 0 0 !important; |
||||
|
} |
||||
|
|
||||
|
.container-fail .slide-verify-slider-mask-item { |
||||
|
height: 38px; |
||||
|
top: -1px; |
||||
|
border: 1px solid #f57a7a; |
||||
|
background-color: #f57a7a !important; |
||||
|
} |
||||
|
|
||||
|
.container-fail .slide-verify-slider-mask { |
||||
|
height: 38px; |
||||
|
border: 1px solid #f57a7a; |
||||
|
background-color: #fce1e1; |
||||
|
} |
||||
|
|
||||
|
.container-fail .slide-verify-slider-mask-item-icon { |
||||
|
top: 14px; |
||||
|
background-position: 0 -82px !important; |
||||
|
} |
||||
|
|
||||
|
.container-active .slide-verify-slider-text, |
||||
|
.container-success .slide-verify-slider-text, |
||||
|
.container-fail .slide-verify-slider-text { |
||||
|
display: none; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,249 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<div class="text" v-if="!textFlex"> |
||||
|
<div class="wuc-tab-item" :class="[index === tabCur ? selectClass + ' cur':'']" v-for="(item,index) in tabList" |
||||
|
:key="item.id" |
||||
|
:id="item.id" |
||||
|
@click="tabSelect(index,item.id,index,item.code,item.id,item)" > |
||||
|
<div :class="item.icon"></div> |
||||
|
<span>{{item.name}}</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="flex text-center" v-if="textFlex"> |
||||
|
<div class="wuc-tab-item flex-sub" :class="index === tabCur ? selectClass + ' cur':''" v-for="(item,index) in tabList" |
||||
|
:key="index" |
||||
|
:id="index" |
||||
|
@click="tabSelect(index,item.code,item.id,item)" > |
||||
|
<div :class="item.icon"></div> |
||||
|
<span>{{item.name}}</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { reactive,computed,onMounted,getCurrentInstance } from 'vue'; |
||||
|
export default { |
||||
|
name: "wuc-tab", |
||||
|
data() { |
||||
|
return {}; |
||||
|
}, |
||||
|
props: { |
||||
|
tabList: { |
||||
|
type: Array, |
||||
|
default() { |
||||
|
return []; |
||||
|
}, |
||||
|
}, |
||||
|
tabCur: { |
||||
|
type: Number, |
||||
|
default() { |
||||
|
return 0; |
||||
|
}, |
||||
|
}, |
||||
|
tabClass: { |
||||
|
type: String, |
||||
|
default() { |
||||
|
return ""; |
||||
|
}, |
||||
|
}, |
||||
|
tabStyle: { |
||||
|
type: String, |
||||
|
default() { |
||||
|
return ""; |
||||
|
}, |
||||
|
}, |
||||
|
textFlex: { |
||||
|
type: Boolean, |
||||
|
default() { |
||||
|
return true; |
||||
|
}, |
||||
|
}, |
||||
|
selectClass: { |
||||
|
type: String, |
||||
|
default() { |
||||
|
return "text-blue"; |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
setup(props, context){ |
||||
|
const { proxy } = getCurrentInstance() |
||||
|
let moveHandle = () => { |
||||
|
} |
||||
|
let tabSelect = (index, e, s, item) => { |
||||
|
context.emit("update:tabCur", index); |
||||
|
context.emit("change", index); |
||||
|
context.emit("chengeid", e); |
||||
|
context.emit("chengeclass", s); |
||||
|
context.emit("changeitem", item); |
||||
|
if(index > 0) { |
||||
|
let tab = document.getElementsByClassName('wuc-tab-item'); |
||||
|
for (let i = 0; i < tab.length; i++) { |
||||
|
tab[i].style.color = '#666666'; |
||||
|
} |
||||
|
} else { |
||||
|
let tab = document.getElementsByClassName('wuc-tab-item'); |
||||
|
for (let i = 0; i < tab.length; i++) { |
||||
|
tab[i].style.color = '#fff'; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return { |
||||
|
scrollLeft: computed(function(){ |
||||
|
return (props.tabCur - 1) * 60; |
||||
|
} |
||||
|
), |
||||
|
moveHandle, |
||||
|
tabSelect |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
div, |
||||
|
scroll-view, |
||||
|
swiper { |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
.wuc-tab { |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
.wuc-tab :deep(.uni-scroll-view::-webkit-scrollbar) { |
||||
|
display: none; |
||||
|
} |
||||
|
.wuc-tab-item { |
||||
|
color: white; |
||||
|
display: inline-block; |
||||
|
margin: 0 0.10rem; |
||||
|
padding: 0 0.20rem; |
||||
|
font-size: 0.32rem; |
||||
|
} |
||||
|
.wuc-tab.fixed { |
||||
|
position: fixed; |
||||
|
width: 100%; |
||||
|
top: 0; |
||||
|
z-index: 1024; |
||||
|
box-shadow: 0 0.01rem 0.06rem rgba(0, 0, 0, 0.1); |
||||
|
} |
||||
|
.flex-sub { |
||||
|
flex: 1 !important; |
||||
|
} |
||||
|
.text-red { |
||||
|
color: #333333; |
||||
|
font-size: 0.36rem; |
||||
|
font-weight: bold; |
||||
|
position: relative; |
||||
|
height: 0.80rem; |
||||
|
} |
||||
|
.text-red:after { |
||||
|
content: ""; |
||||
|
position: absolute; |
||||
|
bottom: 0px; |
||||
|
top: auto; |
||||
|
left: 60%; |
||||
|
height:0.08rem; |
||||
|
margin-left: -20%; |
||||
|
width: 0.43rem; |
||||
|
border-radius: 0.15rem; |
||||
|
background-color: #0499f8; |
||||
|
} |
||||
|
.text-blue { |
||||
|
color: #333333 !important; |
||||
|
font-size: 0.36rem; |
||||
|
font-weight: bold; |
||||
|
height: 0.82rem; |
||||
|
line-height: 0.82rem; |
||||
|
position: relative; |
||||
|
} |
||||
|
.text-blue:after { |
||||
|
content: ""; |
||||
|
position: absolute; |
||||
|
bottom: 0px; |
||||
|
top: auto; |
||||
|
left: 50%; |
||||
|
height: 0.08rem; |
||||
|
margin-left: -0.20rem; |
||||
|
width: 0.36rem; |
||||
|
border-radius: 0.04rem; |
||||
|
background-color: #0499f8; |
||||
|
} |
||||
|
.text-list1 span { |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
.text-list2 span { |
||||
|
background: rgba(7, 27, 77, 0.4); |
||||
|
border-radius: 0.36rem; |
||||
|
padding: 0.06rem 0.24rem; |
||||
|
} |
||||
|
.text-Subclass span { |
||||
|
background: #16c7c5; |
||||
|
border-radius: 0.36rem; |
||||
|
color: #ffffff; |
||||
|
padding: 0.06rem 0.24rem; |
||||
|
} |
||||
|
.text-white { |
||||
|
color: #ffffff; |
||||
|
font-size: 0.36rem; |
||||
|
font-weight: bold; |
||||
|
height: 0.82rem; |
||||
|
line-height: 0.82rem; |
||||
|
position: relative; |
||||
|
} |
||||
|
.text-white:after { |
||||
|
content: ""; |
||||
|
position: absolute; |
||||
|
bottom: 0px; |
||||
|
top: auto; |
||||
|
left: 50%; |
||||
|
height: 0.08rem; |
||||
|
margin-left: -0.20rem; |
||||
|
width: 0.36rem; |
||||
|
border-radius: 0.04rem; |
||||
|
background-color: #ffffff; |
||||
|
} |
||||
|
.bg-white { |
||||
|
background-color: #ffffff; |
||||
|
} |
||||
|
.bg-blue { |
||||
|
background-color: rgb(4, 167, 242); |
||||
|
color: white; |
||||
|
border-radius: 0.40rem; |
||||
|
padding: 0 0.20rem; |
||||
|
} |
||||
|
.text-orange { |
||||
|
color: #f37b1d; |
||||
|
} |
||||
|
.text-xl { |
||||
|
font-size: 0.36rem; |
||||
|
} |
||||
|
.knowLEdgeTab { |
||||
|
color: #e5e5e5; |
||||
|
font-size: 0.36rem; |
||||
|
height: 0.90rem; |
||||
|
line-height: 0.90rem; |
||||
|
} |
||||
|
.sortItem .wuc-tab-item { |
||||
|
color: #333333; |
||||
|
font-size: 0.28rem; |
||||
|
padding: 0 0.50rem; |
||||
|
height: 0.60rem; |
||||
|
line-height: 0.60rem; |
||||
|
background-color: #f3f5f4; |
||||
|
border-radius: 0.30rem; |
||||
|
} |
||||
|
.sortOnItem { |
||||
|
color: #1685fb !important; |
||||
|
background-color: #e7f5fe !important; |
||||
|
} |
||||
|
.FindTabClass { |
||||
|
color: #222222; |
||||
|
font-size: 0.28rem; |
||||
|
height: 0.84rem; |
||||
|
line-height: 0.76rem; |
||||
|
} |
||||
|
.topTabList2 .wuc-tab-item{ |
||||
|
color: #333333; |
||||
|
} |
||||
|
.topTabList2 .text-white:after{ |
||||
|
background-color: #333333; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,133 @@ |
|||||
|
import { createApp } from 'vue' |
||||
|
import App from './App.vue' |
||||
|
import router from './router/index' |
||||
|
import { _createStore } from './vuex'; |
||||
|
|
||||
|
|
||||
|
// 引入http请求插件
|
||||
|
import $API from './utils/api' |
||||
|
import $http from './utils/http' |
||||
|
import { addRequestInterceptor, addResponseInterceptor } from './utils/http' |
||||
|
import Qs from 'qs'; |
||||
|
|
||||
|
// reset 样式
|
||||
|
import '@/assets/css/reset.css' |
||||
|
import '@/assets/css/swiper6.min.css' |
||||
|
import '@/assets/js/rem.js' |
||||
|
import '@/assets/js/swiper6.min.js' |
||||
|
|
||||
|
|
||||
|
import { Toast, Swipe, SwipeItem, Popup, Picker, Tab, Tabs, Dialog, Uploader, DatetimePicker, Slider, Checkbox, CheckboxGroup } from 'vant'; |
||||
|
|
||||
|
import 'vant/lib/index.css'; |
||||
|
|
||||
|
Toast.setDefaultOptions({ duration: 500 }); |
||||
|
//vue.use(Toast);
|
||||
|
|
||||
|
|
||||
|
// 路由拦截器
|
||||
|
// router.beforeEach((to, from, next) => {
|
||||
|
// if (to.matched.length != 0) {
|
||||
|
// if (to.meta.requireAuth) { // 判断该路由是否需要登录权限
|
||||
|
// if (Boolean(localStorage.getItem("userInfo"))) { // 通过vuex state获取当前的user是否存在
|
||||
|
// next();
|
||||
|
// } else {
|
||||
|
// next({
|
||||
|
// path: '/login',
|
||||
|
// query: { redirect: to.fullPath } // 将跳转的路由path作为参数,登录成功后跳转到该路由
|
||||
|
// })
|
||||
|
// }
|
||||
|
// } else {
|
||||
|
// if (Boolean(localStorage.getItem("userInfo"))) { // 判断是否登录
|
||||
|
// if (to.path != "/" && to.path != "/login") { //判断是否要跳到登录界面
|
||||
|
// next();
|
||||
|
// } else {
|
||||
|
// /**
|
||||
|
// * 防刷新,如果登录,修改路由跳转到登录页面,修改路由为登录后的首页
|
||||
|
// */
|
||||
|
// next({
|
||||
|
// path: '/standardizedData/groupAirline'
|
||||
|
// })
|
||||
|
// }
|
||||
|
// } else {
|
||||
|
// next();
|
||||
|
// }
|
||||
|
// }
|
||||
|
// } else {
|
||||
|
// next({
|
||||
|
// path: '/login',
|
||||
|
// query: { redirect: to.fullPath } // 将跳转的路由path作为参数,登录成功后跳转到该路由
|
||||
|
// })
|
||||
|
// }
|
||||
|
// })
|
||||
|
|
||||
|
|
||||
|
// request前自动添加api配置
|
||||
|
addRequestInterceptor( |
||||
|
(config) => { |
||||
|
let Authorization = ""; |
||||
|
if (typeof localStorage !== "undefined") { |
||||
|
const userData = JSON.parse(localStorage.getItem('userData')) || ""; |
||||
|
if (userData) { |
||||
|
let token = ''; |
||||
|
if (userData.token) { |
||||
|
token = userData.token |
||||
|
} else if(userData.data.token){ |
||||
|
token = userData.data.token |
||||
|
} |
||||
|
Authorization = "Bearer " + token; |
||||
|
} |
||||
|
config.headers['Authorization'] = Authorization; |
||||
|
} |
||||
|
config.transformRequest = [ |
||||
|
function(data){ |
||||
|
return Qs.stringify(data) //使用Qs将请求参数序列化
|
||||
|
}] |
||||
|
/*统一加/api前缀*/ |
||||
|
//config.url = `/api${config.url}`
|
||||
|
return config |
||||
|
}, |
||||
|
(error) => { |
||||
|
return Promise.reject(error) |
||||
|
} |
||||
|
) |
||||
|
|
||||
|
// http 返回response前处理
|
||||
|
addResponseInterceptor( |
||||
|
(response) => { |
||||
|
/*todo 在这里统一前置处理请求响应 */ |
||||
|
return Promise.resolve(response.data) |
||||
|
}, |
||||
|
(error) => { |
||||
|
/* |
||||
|
* todo 统一处理500、400等错误状态 |
||||
|
* 这里reject下,交给entry-server.js的处理 |
||||
|
*/ |
||||
|
const { response, request } = error |
||||
|
return Promise.reject({ code: response.status, data: response.data, method: request.method, path: request.path }) |
||||
|
} |
||||
|
) |
||||
|
|
||||
|
const app = createApp(App) |
||||
|
const store = _createStore(); |
||||
|
|
||||
|
app.use(router) |
||||
|
app.use(store) |
||||
|
|
||||
|
app.use(Toast) |
||||
|
.use(Swipe) |
||||
|
.use(Popup) |
||||
|
.use(Picker) |
||||
|
.use(Tab) |
||||
|
.use(Tabs) |
||||
|
.use(Dialog) |
||||
|
.use(Uploader) |
||||
|
.use(DatetimePicker) |
||||
|
.use(SwipeItem) |
||||
|
.use(Slider) |
||||
|
.use(Checkbox) |
||||
|
.use(CheckboxGroup); |
||||
|
|
||||
|
app.config.globalProperties.$API = $API |
||||
|
app.config.globalProperties.$http = $http |
||||
|
app.mount('#app') |
||||
@ -0,0 +1,143 @@ |
|||||
|
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router' |
||||
|
|
||||
|
const router = createRouter({ |
||||
|
history: createWebHistory(), // hash模式:createWebHashHistory,history模式:createWebHistory
|
||||
|
routes: [ |
||||
|
{ |
||||
|
path: '/', |
||||
|
name: 'index', |
||||
|
component: () => |
||||
|
import('@/views/index.vue'), |
||||
|
}, |
||||
|
{ |
||||
|
path: '/Mine', |
||||
|
name: 'Mine', |
||||
|
component: () => |
||||
|
import('@/views/mine/mine.vue'), |
||||
|
}, |
||||
|
{ |
||||
|
path: '/Cart', |
||||
|
name: 'Cart', |
||||
|
component: () => |
||||
|
import('@/views/cart/cart.vue'), |
||||
|
}, |
||||
|
{ |
||||
|
path: '/CartResult', |
||||
|
name: 'CartResult', |
||||
|
component: () => |
||||
|
import('@/views/cart/result.vue'), |
||||
|
} |
||||
|
// {
|
||||
|
// path: '/Login',
|
||||
|
// name: 'Login',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/login/login.vue'),
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/Registered',
|
||||
|
// name: 'Registered',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/registered/registered.vue'),
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/Registered1',
|
||||
|
// name: 'Registered1',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/registered1/registered1.vue'),
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/ResetPassword1',
|
||||
|
// name: 'ResetPassword1',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/ResetPassword1/ResetPassword1.vue'),
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/ResetPassword2',
|
||||
|
// name: 'ResetPassword2',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/ResetPassword2/ResetPassword2.vue'),
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/ResetPassword3',
|
||||
|
// name: 'ResetPassword3',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/ResetPassword3/ResetPassword3.vue'),
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/Mine',
|
||||
|
// name: 'Mine',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/mine/mine.vue'), // 我的页面
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/MineInfo',
|
||||
|
// name: 'MineInfo',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/mineInfo/mineInfo.vue'), // 个人资料页面
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/MineRule',
|
||||
|
// name: 'MineRule',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/mineRule/mineRule.vue'), // 规则页面
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/MineCard',
|
||||
|
// name: 'MineCard',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/mineCard/mineCard.vue'), // 我的图书证
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/ChangePhone',
|
||||
|
// name: 'ChangePhone',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/ChangePhone/ChangePhone.vue'), // 修改手机号
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/ChangeMineCard',
|
||||
|
// name: 'ChangeMineCard',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/changeMineCard/changeMineCard.vue'), // 切换读者证
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/MineVerifyLogin',
|
||||
|
// name: 'MineVerifyLogin',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/mineVerifyLogin/mineVerifyLogin.vue'), // 切换读者证验证账号密码
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/ActivityList',
|
||||
|
// name: 'ActivityList',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/activityList/activityList.vue'), // 线上活动/线下活动列表
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/LoreActiveDetails',
|
||||
|
// name: 'LoreActiveDetails',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/loreActiveDetails/loreActiveDetails.vue'), // 活动列表 - 内容详情
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/AboutUs',
|
||||
|
// name: 'AboutUs',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/aboutUs/aboutUs.vue'), // 关于我们
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/Protocol',
|
||||
|
// name: 'Protocol',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/protocol/protocol.vue'), // 关于我们详情
|
||||
|
// },
|
||||
|
// {
|
||||
|
// path: '/bindMobilePhone',
|
||||
|
// name: 'bindMobilePhone',
|
||||
|
// component: () =>
|
||||
|
// import('@/views/bindMobilePhone/bindMobilePhone.vue'), // 绑定手机号页面
|
||||
|
// }
|
||||
|
] |
||||
|
}) |
||||
|
|
||||
|
export default router |
||||
|
|
||||
|
|
||||
@ -0,0 +1,419 @@ |
|||||
|
|
||||
|
const API = {} |
||||
|
|
||||
|
|
||||
|
//获取阅文
|
||||
|
API.GETDOC = '/IndexApp/GetDoc'; |
||||
|
|
||||
|
//获取视频
|
||||
|
API.GETVIDEO = '/IndexApp/GetVideo'; |
||||
|
|
||||
|
//获取电子图书
|
||||
|
API.GETEBOOKS = '/IndexApp/GetEBooks'; |
||||
|
|
||||
|
// 获取新闻公告
|
||||
|
API.GETNEWS = '/IndexApp/GetNews'; |
||||
|
|
||||
|
// 获取banners
|
||||
|
API.GETBANNERS = '/IndexApp/GetBanners'; |
||||
|
|
||||
|
// 登录
|
||||
|
API.LOGIN = '/Account/AppLogin'; |
||||
|
|
||||
|
//注册页面获取图书馆列表
|
||||
|
API.GETLIBRARYINFO= '/Account/libraryInfo'; |
||||
|
|
||||
|
//发送修改密码验证码
|
||||
|
API.FORGOTACCOUNTMESSAGE= '/Account/ForgotAccountMessage'; |
||||
|
|
||||
|
///校验验证码
|
||||
|
API.FORGOTVERIFICATIONCODE= '/Account/ForgotVerificationCode'; |
||||
|
|
||||
|
//搜索资料 GET application/x-www-form-urlencoded
|
||||
|
API.SEARCHDOC= '/Docment/SearchDoc'; |
||||
|
|
||||
|
// 获取资料专题
|
||||
|
API.GETTOPICS= '/Docment/Topics'; |
||||
|
|
||||
|
// 根据标识获取所属的二级类别
|
||||
|
API.GETSECCLASS= '/Class/GetSecClass'; |
||||
|
|
||||
|
// 获取资料Banner
|
||||
|
API.GETDOCBANNER= '/WebMobile/GetDocBanner'; |
||||
|
|
||||
|
// 首页获取视频列表
|
||||
|
API.GETVIDEOBYMARkREC= '/Video/GetVideoByMarkRec'; |
||||
|
|
||||
|
// 获取视频专题列表
|
||||
|
API.GETVIDEOTHEMETOP= '/Video/GetVideoThemeTop'; |
||||
|
|
||||
|
// 获取视频Banner
|
||||
|
API.GETVIDEOBANNERS= '/WebMobile/GetVideoBanner'; |
||||
|
|
||||
|
//获取首页读书列表
|
||||
|
API.GETBOOKBYMARkREC= '/EBook/GetBookByMarkRec'; |
||||
|
|
||||
|
// 获取电子书专题(Top)
|
||||
|
API.GETBOOKTHEMETOP= '/EBook/GetBookThemeTop'; |
||||
|
|
||||
|
//获取电子书专题banner
|
||||
|
API.GETBOOKBANNERS= '/WebMobile/GetEBookBanner'; |
||||
|
|
||||
|
//搜索电子图书 GET application/x-www-form-urlencoded
|
||||
|
API.GETBOOKBASEPAGES= '/EBook/GetBookBasePages'; |
||||
|
|
||||
|
//根据ID获取主表信息
|
||||
|
API.GETBOOKBASE= '/EBook/GetBookBase'; |
||||
|
|
||||
|
// 根据主表Id获取详情列表并获取进度 GET application/json
|
||||
|
API.GETBASEANDDETAILSID= '/EBook/GetBaseAndDetailsAndResourceByBaseId', |
||||
|
|
||||
|
//根据图书主表Id和图书资源主表Id获取图书资源信息并获取进度
|
||||
|
API.GETRESOURCEANDUSEDBYRESOURCEID= '/EBook/GetResourceAndUsedByResourceId', |
||||
|
|
||||
|
// 获取评论列表
|
||||
|
API.GETCOMMENTPAGES= '/Comment/GetCommentPages', |
||||
|
|
||||
|
// 加入收藏 post application/x-www-form-urlencoded
|
||||
|
API.SETCOLLECTS= '/MyCollect/SetCollects'; |
||||
|
|
||||
|
// 猜你喜欢读书列表
|
||||
|
API.GETEBOOKSMORE= '/EBook/GetMore'; |
||||
|
|
||||
|
// 评论答案
|
||||
|
API.ADDCOMMENT= '/Comment/AddComment'; |
||||
|
|
||||
|
// 添加评论回复
|
||||
|
API.ADDCOMMENTBACK= '/Comment/AddCommentBack'; |
||||
|
|
||||
|
// 评论举报
|
||||
|
API.ADDREPORT= '/Report/AddReport'; |
||||
|
|
||||
|
// 用户点赞(目前对象包括:评论/回复、动态、问题、回答)
|
||||
|
API.CUSTLIKE= '/Use/CustLike'; |
||||
|
|
||||
|
// 获取我的收藏
|
||||
|
API.GETMYCOLLECTSPAGES= '/MyCollect/GetMyCollectsPages'; |
||||
|
|
||||
|
// 检查我的收藏资源状态
|
||||
|
API.CHECKMYCOLLECTSSTATE= '/MyCollect/CheckMyCollectsState'; |
||||
|
|
||||
|
//获取验证注册规则
|
||||
|
API.GETVERIFY = '/Account/GetVerify'; |
||||
|
|
||||
|
//发送注册验证码
|
||||
|
API.SENDMSGCODE = '/Account/SendMsgCode'; |
||||
|
|
||||
|
//注册
|
||||
|
API.REGISTER = '/Account/RegisterNew'; |
||||
|
|
||||
|
//获取阅文首页其他所有数据列表
|
||||
|
API.GETDOCHOMEPAGEALL = '/WebMobile/GetDocHomePageAll'; |
||||
|
|
||||
|
//获取视频首页其他所有数据列表
|
||||
|
API.GETVIDEOHOMEPAGEALL = '/WebMobile/GetVideoHomePageAll'; |
||||
|
|
||||
|
//获取读书首页其他所有数据列表
|
||||
|
API.GETBOOKHOMEPAGEALL = '/WebMobile/GetEBookHomePageAll'; |
||||
|
|
||||
|
// 资料主表ID获取资料主表信息
|
||||
|
API.GETCONTENT= '/Docment/GetContent'; |
||||
|
|
||||
|
// 获取资料(章节)内容
|
||||
|
API.DOCDETAILS= '/Docment/DocDetails'; |
||||
|
|
||||
|
// 获取资料目录
|
||||
|
API.CATALOG= '/Docment/Catalog'; |
||||
|
|
||||
|
//注册验证
|
||||
|
API.CHECKREGISTERVERITY = '/Account/CheckRegisterVerityJson'; |
||||
|
|
||||
|
//修改密码
|
||||
|
API.FORGOTACCOUNT = '/Account/ForgotAccount'; |
||||
|
|
||||
|
//获取GetQiniuDomain
|
||||
|
API.GETQINIUDOMAIN = '/Dictionary/GetQiniuDomain'; |
||||
|
|
||||
|
//猜你还想看
|
||||
|
API.GETVIDEOMORE = '/Video/GetMore'; |
||||
|
|
||||
|
//根据ID获取视频主表信息
|
||||
|
API.GETVIDEOBASE = '/Video/GetVideoBase'; |
||||
|
|
||||
|
//加入收藏 POST application/x-www-form-urlencoded
|
||||
|
API.SETCOLLECTS = '/MyCollect/SetCollects'; |
||||
|
|
||||
|
//根据主表Id获取详情列表并获取进度 GET application/json
|
||||
|
API.GETDETAILSANDUSEDBYBASEID = '/Video/GetDetailsAndUsedByBaseIdNew'; |
||||
|
|
||||
|
//评论举报 POST application/x-www-form-urlencoded
|
||||
|
API.ADDREPORT = '/Report/AddReport'; |
||||
|
|
||||
|
// 根据详情Id获取详情并更新进度 GET application/json
|
||||
|
API.GETDETAIlLANDEDITUSEDBYID = '/Video/GetDetailAndEditUsedById'; |
||||
|
|
||||
|
//根据目录索引图书详情并更新进度 PUT application/json
|
||||
|
API.GETLISTANDUPDATEUSED = '/EBook/GetListAndUpdateUsed'; |
||||
|
|
||||
|
//添加书签,笔记,划线 POST application/json
|
||||
|
API.ADDBOOKMARK = '/EBook/AddBookMark'; |
||||
|
|
||||
|
//移除书签 PUT application/json
|
||||
|
API.DELBOOkMARK = '/EBook/DelBookMark'; |
||||
|
|
||||
|
// 根据主表Id获取详情列表并获取进度 GET application/json
|
||||
|
API.GETBOOKMARKPAGES = '/EBook/GetBookMarkPages'; |
||||
|
|
||||
|
// 加入收藏 POST application/x-www-form-urlencoded
|
||||
|
API.SetCollects = '/MyCollect/SetCollects'; |
||||
|
|
||||
|
//获取问题标签 GET application/json
|
||||
|
API.GEQUESTIONSTAGS = '/Question/GetTags'; |
||||
|
|
||||
|
//获取问题列表 GET application/json
|
||||
|
API.GETQUESTIONPAGES = '/Question/GetQuestionPages'; |
||||
|
|
||||
|
//获取答主榜 GET application/json
|
||||
|
API.GETTOPCUSTANSWER = '/Answer/GetTopCustAnswer'; |
||||
|
|
||||
|
//搜索视频 GET application/x-www-form-urlencoded
|
||||
|
API.GETVIDEOBASEPAGES = '/Video/GetVideoBasePages'; |
||||
|
|
||||
|
//搜索词记录 POST application/x-www-form-urlencoded
|
||||
|
API.ADDHOTSEARCHLOG = '/HotSearch/AddHotSearchLog'; |
||||
|
|
||||
|
//获取搜索热词 GET application/x-www-form-urlencoded
|
||||
|
API.GETHOTSEARCH = '/HotSearch/GetHotSearch'; |
||||
|
|
||||
|
//获取AI新闻列表 GET application/x-www-form-urlencoded
|
||||
|
API.LISTNEW = '/News/ListNew'; |
||||
|
|
||||
|
//获取新闻详情 GET application/x-www-form-urlencoded
|
||||
|
API.NEWSDETAIL = '/News/Detail'; |
||||
|
|
||||
|
//猜你喜欢 GET application/x-www-form-urlencoded
|
||||
|
API.GETNEWSMORE = '/News/GetMore'; |
||||
|
|
||||
|
//修改用户信息 POST application/x-www-form-urlencoded
|
||||
|
API.EDITUSERINFO = '/Me/EditUserinfo'; |
||||
|
|
||||
|
//获取用户信息 GET application/x-www-form-urlencoded
|
||||
|
API.GETUSERINFO = '/Me/GetUserInfo'; |
||||
|
|
||||
|
//上传 GET application/json
|
||||
|
API.UPLOADTOKENEASY = '/Me/UploadTokenEasy'; |
||||
|
|
||||
|
//七牛云辅助 GET application/json
|
||||
|
API.UPLOADHELPER = '/Me/UploadHelper'; |
||||
|
|
||||
|
//查询读者号 GET application/x-www-form-urlencoded
|
||||
|
API.GETCRAD = '/Me/GetCrad'; |
||||
|
|
||||
|
//绑定微信 POST application/x-www-form-urlencoded
|
||||
|
API.WECHATBIND = '/Me/WeChatBinding'; |
||||
|
|
||||
|
//微信解绑 PUT application/x-www-form-urlencoded
|
||||
|
API.WECHATUNBOUND = '/Me/WeChatUnbound'; |
||||
|
|
||||
|
//切换读者证 无toke版 PUT application/x-www-form-urlencoded
|
||||
|
API.CHANGEREADERCODE = '/Account/ChangeReaderCode'; |
||||
|
|
||||
|
//切换读者证 toke版 PUT application/x-www-form-urlencoded
|
||||
|
API.CHANGEREADERCODETOKEN = '/Account/ChangeReaderCodeToken'; |
||||
|
|
||||
|
//阅刊列表(需登录) GET application/json
|
||||
|
API.GETTHEMEPAGES = '/ThemeList/GetThemePages'; |
||||
|
|
||||
|
//阅刊更新点击量 PUT application/x-www-form-urlencoded
|
||||
|
API.UPCLICKNUM = '/ThemeList/UpClickNum'; |
||||
|
|
||||
|
//获取微信token GET application/json
|
||||
|
API.GETWECHATTOkEN = '/WeChat/GetToken'; |
||||
|
|
||||
|
//获取微信用户信息 GET application/json
|
||||
|
API.GETWECHATUSERINFO = '/WeChat/GetUserInfo'; |
||||
|
|
||||
|
//获取Vr列表 GET application/json
|
||||
|
API.GETVRPAGES = '/VR/GetVRPages'; |
||||
|
|
||||
|
//修改手机号获取验证码 POST application/json
|
||||
|
API.CHANGEPHONEMESSAGE = '/Account/ChangePhoneMessage'; |
||||
|
|
||||
|
//修改手机号 PUT application/json
|
||||
|
API.EDITPHONE = '/Account/EditPhone'; |
||||
|
|
||||
|
//获取活动banner GET
|
||||
|
API.GETACTBANNERS = '/Activity/GetActBanners'; |
||||
|
|
||||
|
//获取活动 GET application/x-www-form-urlencoded
|
||||
|
// API.GETRECENT = '/Activity/GetRecent';
|
||||
|
|
||||
|
//线上线下活动混排列表 GET application/x-www-form-urlencoded
|
||||
|
API.GETACTALLLIST = '/IndexPc/GetActAllList'; |
||||
|
|
||||
|
//线上活动列表 GET application/x-www-form-urlencoded
|
||||
|
API.GETACTONLINEPAGES = '/ActOnline/GetActOnlinePages'; |
||||
|
|
||||
|
//线下活动列表 GET application/x-www-form-urlencoded
|
||||
|
API.GETACTIVITYPAGES = '/Activity/GetActivityPages'; |
||||
|
|
||||
|
//获取活动详情 GET application/x-www-form-urlencoded
|
||||
|
API.GETACTIVITYDETAILS = '/Activity/GetActivityDetails'; |
||||
|
|
||||
|
//获取走进AI列表 GET application/json
|
||||
|
API.GETAPPROACHLISTPAGES = '/Approach/GetApproachListPages'; |
||||
|
|
||||
|
//发送意见反馈 POST application/x-www-form-urlencoded
|
||||
|
API.ADDFEEDBACKLITE = '/Feedback/AddFeedbackLite'; |
||||
|
|
||||
|
//关于我们 GET application/json
|
||||
|
API.GETABOUTOUR = '/OtherInformation/GetInfoPagesLite'; |
||||
|
|
||||
|
//关于我们详情 GET application/json
|
||||
|
API.GETABOUTOURDETAIL= '/OtherInformation/GetInfoById'; |
||||
|
|
||||
|
//获取排行榜 GET application/json
|
||||
|
API.GETTOPBASE = '/Approach/GetTopBase'; |
||||
|
|
||||
|
//根据排行榜ID获取榜单 GET application/json
|
||||
|
API.GETTOPLISTBYID = '/Approach/GetTopListById'; |
||||
|
|
||||
|
//获取走进AI信息 GET application/json
|
||||
|
API.GETAPPROACHBYID = '/Approach/GetApproachById'; |
||||
|
|
||||
|
//获取关于TA列表 GET application/json
|
||||
|
API.GETAPPROACHDETAILSLIST = '/Approach/GetApproachDetailsList'; |
||||
|
|
||||
|
//获取更多大师 GET application/json
|
||||
|
API.GETAPPROACHLISTMORE = '/Approach/GetApproachListMore'; |
||||
|
|
||||
|
//获取关于TA列表-详情-基本信息 GET application/json
|
||||
|
API.GETAPPROACHDETAILSBYID = '/Approach/GetApproachDetailsById'; |
||||
|
|
||||
|
//获取关于TA列表 GET application/json
|
||||
|
API.GETAPPROACHDETAILSLISTMORE = '/Approach/GetApproachDetailsListMore'; |
||||
|
|
||||
|
//获取所有走进Ai二级分类 GET application/json
|
||||
|
API.GETAPPROACHCLASS = '/Approach/GetClass'; |
||||
|
|
||||
|
//系统消息已读 PUT application/x-www-form-urlencoded
|
||||
|
API.EDITMYMESSAGESCHECKED = '/MyMessages/EditMyMessagesChecked'; |
||||
|
|
||||
|
//获取消息数量 GET application/x-www-form-urlencoded
|
||||
|
API.GETNUMNOCHECKED = '/MyMessages/GetNumNoChecked'; |
||||
|
|
||||
|
//获取我的回复消息 PUT application/x-www-form-urlencoded
|
||||
|
API.EDITMYQUESTIONACHECKED = '/MyMessages/EditMyQuestionAChecked'; |
||||
|
|
||||
|
// 获取我的答案的评论回复 GET application/x-www-form-urlencoded
|
||||
|
API.GETMYANSWERCOMMENTPAGES = '/MyMessages/GetMyAnswerCommentPages'; |
||||
|
|
||||
|
//获取系统消息 GET application/x-www-form-urlencoded
|
||||
|
API.GETMYMESSAGESPAGES = '/MyMessages/GetMyMessagesPages'; |
||||
|
|
||||
|
//回复评论已读 PUT application/x-www-form-urlencoded
|
||||
|
API.EDITMYCOMMENTCHECkED = '/MyMessages/EditMyCommentChecked'; |
||||
|
|
||||
|
//根据类型和详情ID获取主表ID跳转 GET application/x-www-form-urlencoded
|
||||
|
API.GETBASEIDBYTYPEANDDETAILSID = '/MyMessages/GetBaseIdByTypeAndDetailsId'; |
||||
|
|
||||
|
//获取我的回复消息 GET application/x-www-form-urlencoded
|
||||
|
API.GETMYCOMMENTPAGESNEW = '/MyMessages/GetMyCommentPagesNew'; |
||||
|
|
||||
|
//动态列表 GET application/x-www-form-urlencoded
|
||||
|
API.GETDYNAMICPAGES = '/Dynamic/GetDynamicPages'; |
||||
|
|
||||
|
//动态列表 POST application/x-www-form-urlencoded
|
||||
|
API.DYNAMICEDITATTN = '/Dynamic/EditAttn'; |
||||
|
|
||||
|
//根据动态ID获取详情 GET application/x-www-form-urlencoded
|
||||
|
API.GETDYNAMICBYIDFORAPP = '/Dynamic/GetDynamicByIDForAPP'; |
||||
|
|
||||
|
//发布动态 POST application/x-www-form-urlencoded
|
||||
|
API.ADDDYNAMIC = '/Dynamic/AddDynamic'; |
||||
|
|
||||
|
//获取第三方个人信息 GET application/json
|
||||
|
API.GETOTHERUSERINFO = '/Me/GetOtherUserInfo'; |
||||
|
|
||||
|
//获取第三方问题 GET application/json
|
||||
|
API.GETOTHERQUESTIONPAGES = '/Question/GetOtherQuestionPages'; |
||||
|
|
||||
|
//我的关注 GET application/json
|
||||
|
API.MINEATTN = '/Dynamic/MineAttn'; |
||||
|
|
||||
|
//获取第三方关注 GET application/json
|
||||
|
API.OTHERATTN = '/Dynamic/OtherAttn'; |
||||
|
|
||||
|
//我的粉丝 GET application/json
|
||||
|
API.DYNAMICATTNME = '/Dynamic/AttnMe'; |
||||
|
|
||||
|
//获取第三方粉丝 GET application/json
|
||||
|
API.DYNAMICATTNOTHER = '/Dynamic/AttnOther'; |
||||
|
|
||||
|
//点赞 PUT application/x-www-form-urlencoded
|
||||
|
API.USELIKE = '/Use/UseLike'; |
||||
|
|
||||
|
//获取答案列表 GET application/x-www-form-urlencoded
|
||||
|
API.GETANSEWRPAGES = '/Answer/GetAnswerPages'; |
||||
|
|
||||
|
//获取问题详情 GET application/json
|
||||
|
API.GETQUESTIONBYID = '/Question/GetQuestionByID'; |
||||
|
|
||||
|
//发布回答 POST application/x-www-form-urlencoded
|
||||
|
API.ADDANSWER = '/Answer/AddAnswer'; |
||||
|
|
||||
|
//发布问题 POST application/x-www-form-urlencoded
|
||||
|
API.ADDQUESTION = '/Question/AddQuestion'; |
||||
|
|
||||
|
//用户积分明细列表 GET application/json
|
||||
|
API.GETCUSTPOINTSLOGPAGES = '/Points/GetCustPointsLogPages'; |
||||
|
|
||||
|
//获取我的积分信息(当前) GET application/json
|
||||
|
API.GETMYPOINTSINFONOW = '/Points/GetMyPointsInfoNow'; |
||||
|
|
||||
|
//添加积分记录 POST application/x-www-form-urlencoded
|
||||
|
API.ADDPOINTLOG = '/Points/AddPointLog'; |
||||
|
|
||||
|
//根据任务标识获取积分任务并判断任务是否完成 GET application/json
|
||||
|
API.GETPOINTSBYCODEANDCHECKISOVER = '/Points/GetPointsByCodeAndCheckIsOver'; |
||||
|
|
||||
|
//获取3D列表 GET application/json
|
||||
|
API.GETVRLIST = '/IndexPc/GetVRList'; |
||||
|
|
||||
|
//我的邀请(邀请回答) GET application/json
|
||||
|
API.GETMYINVITATION = '/Question/GetMyInvitation'; |
||||
|
|
||||
|
//邀请我的(邀请回答) GET application/json
|
||||
|
API.GETINVITEME = '/Question/GetInviteMe'; |
||||
|
|
||||
|
//邀请回答人员列表(一页显示6人,最多显示5页,共计30人) GET application/json
|
||||
|
API.GETCUSTFORANSWER = '/Question/GetCustForAnswer'; |
||||
|
|
||||
|
//添加邀请答题人信息 POST application/x-www-form-urlencoded
|
||||
|
API.ADDCUSTFORANSWER = '/Question/AddCustForAnswer'; |
||||
|
|
||||
|
//邀请我的标记已读 PUT application/x-www-form-urlencoded
|
||||
|
API.EDITINVITEMECHECKED = '/MyMessages/EditInviteMeChecked'; |
||||
|
|
||||
|
//根据sid获得机构信息 GET application/json
|
||||
|
API.GETCLNTBYSID = '/Account/GetClntBySid'; |
||||
|
|
||||
|
//微信登录(新用户注册则返回userinfo) POST application/x-www-form-urlencoded
|
||||
|
API.WECHATLOGIN = '/Account/WeChatLogin'; |
||||
|
|
||||
|
//微信注册 POST application/x-www-form-urlencoded
|
||||
|
API.WECHATREGISTER = '/Account/WeChatRegister'; |
||||
|
|
||||
|
// 获取问答Banner
|
||||
|
API.GETANSWERBANNERS= '/Answer/GetBanners'; |
||||
|
|
||||
|
// 获取JS_SDK Config 相关配置参数 GET application/json
|
||||
|
API.GETWXJSCONFIG = '/WeChat/GetWXJSConfig'; |
||||
|
|
||||
|
// 根据答案Id获取答案详情(APP专用) GET application/json
|
||||
|
API.GETANSWERBYIDFORAPP = '/Answer/GetAnswerByIdForApp'; |
||||
|
|
||||
|
export default API |
||||
|
|
||||
|
|
||||
|
|
||||
@ -0,0 +1,43 @@ |
|||||
|
/** |
||||
|
* |
||||
|
* @file axios封装 |
||||
|
* export default http 接口请求 |
||||
|
* export addRequestInterceptor 请求前拦截器 |
||||
|
* export addResponseInterceptor 请求后拦截器 |
||||
|
* export setCookies 同步cookie |
||||
|
*/ |
||||
|
import axios from 'axios' |
||||
|
|
||||
|
import appConfig from '~/app.config' |
||||
|
|
||||
|
const defaultHeaders = { |
||||
|
Accept: 'application/json, text/plain, */*; charset=utf-8', |
||||
|
'Content-Type': 'application/json; charset=utf-8', |
||||
|
Pragma: 'no-cache', |
||||
|
'Cache-Control': 'no-cache' |
||||
|
} |
||||
|
Object.assign(axios.defaults.headers.common, defaultHeaders) |
||||
|
|
||||
|
axios.defaults.baseURL = appConfig.proxy |
||||
|
/* if (!process.browser) { |
||||
|
axios.defaults.baseURL = `http://${currentIP}:${appConfig.appPort}` |
||||
|
} */ |
||||
|
//console.log(axios.defaults.baseURL)
|
||||
|
|
||||
|
const methods = ['get', 'post', 'put', 'delete', 'patch', 'options', 'request', 'head'] |
||||
|
|
||||
|
const http = {} |
||||
|
methods.forEach(method => { |
||||
|
http[method] = axios[method].bind(axios) |
||||
|
}) |
||||
|
|
||||
|
export const addRequestInterceptor = (resolve, reject) => { |
||||
|
if (axios.interceptors.request.handlers.length === 0) axios.interceptors.request.use(resolve, reject) |
||||
|
} |
||||
|
export const addResponseInterceptor = (resolve, reject) => { |
||||
|
if (axios.interceptors.response.handlers.length === 0) axios.interceptors.response.use(resolve, reject) |
||||
|
} |
||||
|
export const setCookies = Cookies => axios.defaults.headers.cookie = Cookies |
||||
|
|
||||
|
|
||||
|
export default http |
||||
@ -0,0 +1,113 @@ |
|||||
|
|
||||
|
|
||||
|
|
||||
|
export const Urlencode = str => { |
||||
|
str = (str + '').toString(); |
||||
|
return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28'). |
||||
|
replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+'); |
||||
|
} |
||||
|
|
||||
|
export const isIPhoneX = () => { |
||||
|
let u = navigator.userAgent; |
||||
|
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); |
||||
|
if (isIOS) { |
||||
|
if (screen.height == 812 && screen.width == 375) { |
||||
|
return true; |
||||
|
} |
||||
|
else { |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//获取url 参数值,并解码
|
||||
|
export const getUnescapeUrlParam = (name) => { |
||||
|
let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'); |
||||
|
let localUrl = window.location.href.split("?")[1] |
||||
|
let r = localUrl.match(reg); |
||||
|
if (r != null) { |
||||
|
return unescape(r[2]); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
// 截取时间
|
||||
|
export const cutTime = (val) => { |
||||
|
if (val == null) { |
||||
|
return val |
||||
|
} else { |
||||
|
return val.slice(0, val.indexOf("T")) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 判断是否登录才可操作
|
||||
|
export const isLogin = (proxy,$dialog) => { |
||||
|
let userData = localStorage.getItem('userData') || ""; |
||||
|
// clientType主要是鉴别当前用户的类型
|
||||
|
// ClientType = 1 普通用户
|
||||
|
// ClientType = 0 白名单用户
|
||||
|
if (JSON.parse(userData).clientType === 0) { |
||||
|
proxy.$dialog.confirm({ |
||||
|
title: '', |
||||
|
message: '该功能需要登录账号!', |
||||
|
}) |
||||
|
.then(() => { |
||||
|
proxy.$router.push('/Login'); |
||||
|
}) |
||||
|
.catch(() => { |
||||
|
console.log('用户点击取消'); |
||||
|
}); |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 时间格式化1 val时间戳数字
|
||||
|
export const formatDateDay = (val) => { |
||||
|
let date = new Date(val); |
||||
|
let YY = date.getFullYear() + '-'; |
||||
|
let MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
||||
|
let DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()); |
||||
|
return YY + MM + + DD |
||||
|
} |
||||
|
|
||||
|
// 时间格式化2 val时间戳数字
|
||||
|
export const formatDateMin = (val) => { |
||||
|
let date = new Date(val); |
||||
|
let YY = date.getFullYear() + '-'; |
||||
|
let MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
||||
|
let DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()); |
||||
|
let hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'; |
||||
|
let mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':'; |
||||
|
let ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()); |
||||
|
return YY + MM + DD +" "+ hh + mm + ss; |
||||
|
} |
||||
|
|
||||
|
// 判断是否微信浏览器
|
||||
|
export const isWeiXin = () => { |
||||
|
let ua = window.navigator.userAgent.toLowerCase(); |
||||
|
if(ua.match(/MicroMessenger/i) == 'micromessenger'){ |
||||
|
return true; |
||||
|
}else{ |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//获取url 参数值 (原封不动获取url 参数, 不解码)
|
||||
|
const getUrlParam = (name) => { |
||||
|
let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'); |
||||
|
let localUrl = window.location.href.split("?")[1] |
||||
|
let r = localUrl.match(reg); |
||||
|
if (r != null) { |
||||
|
return r[2]; |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
//检测是否是移动端
|
||||
|
const isMobile = () => { |
||||
|
if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) { |
||||
|
return true; |
||||
|
} else { |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,152 @@ |
|||||
|
/** |
||||
|
* 时间戳 |
||||
|
* @param {*} timestamp 时间戳 |
||||
|
*/ |
||||
|
const timestampToTime = (timestamp) => { |
||||
|
let date = new Date(timestamp) //时间戳为10位需*1000,时间戳为13位的话不需乘1000
|
||||
|
let Y = date.getFullYear() + '-' |
||||
|
let M = |
||||
|
(date.getMonth() + 1 < 10 ? |
||||
|
'0' + (date.getMonth() + 1) : |
||||
|
date.getMonth() + 1) + '-' |
||||
|
let D = |
||||
|
(date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ' |
||||
|
let h = |
||||
|
(date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':' |
||||
|
let m = |
||||
|
(date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + |
||||
|
':' |
||||
|
let s = |
||||
|
date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() |
||||
|
return Y + M + D + h + m + s |
||||
|
}; |
||||
|
/** |
||||
|
* 存储localStorage |
||||
|
*/ |
||||
|
const setStore = (name, content) => { |
||||
|
if (!name) return; |
||||
|
if (typeof content !== 'string') { |
||||
|
content = JSON.stringify(content); |
||||
|
} |
||||
|
window.localStorage.setItem(name, content); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取localStorage |
||||
|
*/ |
||||
|
const getStore = name => { |
||||
|
if (!name) return; |
||||
|
return window.localStorage.getItem(name); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除localStorage |
||||
|
*/ |
||||
|
const removeStore = name => { |
||||
|
if (!name) return; |
||||
|
window.localStorage.removeItem(name); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 设置cookie |
||||
|
**/ |
||||
|
const setCookie = (name, value, day) => { |
||||
|
let date = new Date(); |
||||
|
date.setDate(date.getDate() + day); |
||||
|
document.cookie = name + '=' + value + ';expires=' + date; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 获取cookie |
||||
|
**/ |
||||
|
const getCookie = name => { |
||||
|
let reg = RegExp(name + '=([^;]+)'); |
||||
|
let arr = document.cookie.match(reg); |
||||
|
if (arr) { |
||||
|
return arr[1]; |
||||
|
} else { |
||||
|
return ''; |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 删除cookie |
||||
|
**/ |
||||
|
const delCookie = name => { |
||||
|
setCookie(name, null, -1); |
||||
|
}; |
||||
|
|
||||
|
/* 定义时间戳转时间方法 */ |
||||
|
const $timetrans = dd => { |
||||
|
let date = new Date(dd * 1000);//如果date为10位不需要乘1000
|
||||
|
let Y = date.getFullYear() + '-'; |
||||
|
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
||||
|
let D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
||||
|
let h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'; |
||||
|
let m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':'; |
||||
|
let s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()); |
||||
|
return Y + M + D + h + m + s; |
||||
|
}; |
||||
|
const $timeDate = dd => { |
||||
|
let date = new Date(dd * 1000); |
||||
|
let Y = date.getFullYear() + '-'; |
||||
|
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
||||
|
let D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
||||
|
return Y + M + D; |
||||
|
}; |
||||
|
const $timeMonth = dd => { |
||||
|
let date = new Date(dd * 1000); |
||||
|
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
||||
|
let D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
||||
|
return M + D; |
||||
|
}; |
||||
|
const $timeHour = dd => { |
||||
|
let date = new Date(dd * 1000); |
||||
|
let h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'; |
||||
|
let m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()); |
||||
|
return h + m; |
||||
|
}; |
||||
|
|
||||
|
const $Day = (begintime, endtime) => { |
||||
|
let nTime = endtime - begintime; |
||||
|
let day = Math.floor(nTime / 86400000); |
||||
|
return day; |
||||
|
}; |
||||
|
|
||||
|
/* 生成加密随机数 */ |
||||
|
const $randomChar = () => { |
||||
|
let x = "0123456789qwertyuioplkjhgfdsazxcvbnm"; |
||||
|
let tmp = ""; |
||||
|
let timestamp = new Date().getTime(); |
||||
|
for (let i = 0; i < 13; i++) { |
||||
|
tmp += x.charAt(Math.ceil(Math.random() * 100000000) % x.length); |
||||
|
} |
||||
|
return timestamp + tmp; |
||||
|
}; |
||||
|
const $sortObj = (obj) => { |
||||
|
let returnObj = []; |
||||
|
for (let i = obj.length - 1; i >= 0; i--) { |
||||
|
returnObj.push(obj[i]); |
||||
|
} |
||||
|
return returnObj; |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 导出 |
||||
|
**/ |
||||
|
export { |
||||
|
$timetrans, |
||||
|
$timeDate, |
||||
|
$timeMonth, |
||||
|
$Day, |
||||
|
$sortObj, |
||||
|
$randomChar, |
||||
|
timestampToTime, |
||||
|
setStore, |
||||
|
getStore, |
||||
|
removeStore, |
||||
|
setCookie, |
||||
|
getCookie, |
||||
|
delCookie |
||||
|
} |
||||
@ -0,0 +1,388 @@ |
|||||
|
<template> |
||||
|
<div class="main"> |
||||
|
<div class="cart-main"> |
||||
|
<div class="cart-top"> |
||||
|
<div class="cart-num">图书数量<span>(5)</span></div> |
||||
|
<span @click="cartDelt">管理</span> |
||||
|
</div> |
||||
|
<div class="cart-list"> |
||||
|
<div class="cart-item"> |
||||
|
<div class="list-top"> |
||||
|
<van-checkbox v-model="checked"></van-checkbox> |
||||
|
<div class="top-info"> |
||||
|
<p class="active-name">你选书,我买单<i></i></p> |
||||
|
<p class="dealer">京东商城</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="product-list"> |
||||
|
<div class="product-item"> |
||||
|
<van-checkbox v-model="checked"></van-checkbox> |
||||
|
<div class="product-cont"> |
||||
|
<div class="product-img"><img src="" alt="" /></div> |
||||
|
<div class="product-txt"> |
||||
|
<div class="product-info"> |
||||
|
<h4 class="overflow-txt-only">秒懂AI提问:让人工智能开发大脑 </h4> |
||||
|
<div class="author-date"> |
||||
|
<p class="author overflow-txt-only">秋叶 刘进新 姜梅 定秋枫</p> |
||||
|
<p class="date overflow-txt-only ">2023年07月</p> |
||||
|
</div> |
||||
|
<div class="intro overflow-txt">精心提炼20种GPT提问方法及指令,从入门到进阶再到精通,100个案例带你玩</div> |
||||
|
</div> |
||||
|
<div class="product-bottom"> |
||||
|
<p class="product-price">实付款 <span><i class="rmb">¥</i>29.0</span><i>129.0</i></p> |
||||
|
<span class="product-num">x1</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="product-item"> |
||||
|
<van-checkbox v-model="checked"></van-checkbox> |
||||
|
<div class="product-cont"> |
||||
|
<div class="product-img"><img src="" alt="" /></div> |
||||
|
<div class="product-txt"> |
||||
|
<div class="product-info"> |
||||
|
<h4 class="overflow-txt-only">秒懂AI提问:让人工智能开发大脑 </h4> |
||||
|
<div class="author-date"> |
||||
|
<p class="author overflow-txt-only">秋叶 刘进新 姜梅 定秋枫</p> |
||||
|
<p class="date overflow-txt-only ">2023年07月</p> |
||||
|
</div> |
||||
|
<div class="intro overflow-txt">精心提炼20种GPT提问方法及指令,从入门到进阶再到精通,100个案例带你玩</div> |
||||
|
</div> |
||||
|
<div class="product-bottom"> |
||||
|
<p class="product-price">实付款 <span><i class="rmb">¥</i>29.0</span><i>129.0</i></p> |
||||
|
<span class="product-num">x1</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="cart-item"> |
||||
|
<div class="list-top"> |
||||
|
<van-checkbox v-model="checked"></van-checkbox> |
||||
|
<div class="top-info"> |
||||
|
<p class="active-name">你选书,我买单<i></i></p> |
||||
|
<p class="dealer">京东商城</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="product-list"> |
||||
|
<div class="product-item"> |
||||
|
<van-checkbox v-model="checked"></van-checkbox> |
||||
|
<div class="product-cont"> |
||||
|
<div class="product-img"><img src="" alt="" /></div> |
||||
|
<div class="product-txt"> |
||||
|
<div class="product-info"> |
||||
|
<h4 class="overflow-txt-only">秒懂AI提问:让人工智能开发大脑 </h4> |
||||
|
<div class="author-date"> |
||||
|
<p class="author overflow-txt-only">秋叶 刘进新 姜梅 定秋枫</p> |
||||
|
<p class="date overflow-txt-only ">2023年07月</p> |
||||
|
</div> |
||||
|
<div class="intro overflow-txt">精心提炼20种GPT提问方法及指令,从入门到进阶再到精通,100个案例带你玩</div> |
||||
|
</div> |
||||
|
<div class="product-bottom"> |
||||
|
<p class="product-price">实付款 <span><i class="rmb">¥</i>29.0</span><i>129.0</i></p> |
||||
|
<span class="product-num">x1</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="product-item"> |
||||
|
<van-checkbox v-model="checked"></van-checkbox> |
||||
|
<div class="product-cont"> |
||||
|
<div class="product-img"><img src="" alt="" /></div> |
||||
|
<div class="product-txt"> |
||||
|
<div class="product-info"> |
||||
|
<h4 class="overflow-txt-only">秒懂AI提问:让人工智能开发大脑 </h4> |
||||
|
<div class="author-date"> |
||||
|
<p class="author overflow-txt-only">秋叶 刘进新 姜梅 定秋枫</p> |
||||
|
<p class="date overflow-txt-only ">2023年07月</p> |
||||
|
</div> |
||||
|
<div class="intro overflow-txt">精心提炼20种GPT提问方法及指令,从入门到进阶再到精通,100个案例带你玩</div> |
||||
|
</div> |
||||
|
<div class="product-bottom"> |
||||
|
<p class="product-price">实付款 <span><i class="rmb">¥</i>29.0</span><i>129.0</i></p> |
||||
|
<span class="product-num">x1</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="cart-pay"> |
||||
|
<van-checkbox v-model="checked">全选</van-checkbox> |
||||
|
<div v-if="!isDeltHandle" class="payment-right"> |
||||
|
<div class="total-num">合计:<span><i class="rmb">¥</i>0</span></div> |
||||
|
<p class="pay-btn" @click="goPay">下单</p> |
||||
|
</div> |
||||
|
<div v-else class="payment-right"> |
||||
|
<p class="delt-btn" @click="confirmDelt">删除</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
<TabBar :tabCur.sync="tabCur" /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { Toast } from 'vant' |
||||
|
import { reactive, computed, onMounted, getCurrentInstance, toRefs } from 'vue' |
||||
|
import TabBar from '@/components/tabBar/index.vue' |
||||
|
export default { |
||||
|
name: 'Cart', |
||||
|
components: { TabBar }, |
||||
|
setup() { |
||||
|
const { proxy } = getCurrentInstance() |
||||
|
let data = reactive({ |
||||
|
tabCur: 1, |
||||
|
checked: false, |
||||
|
isDeltHandle: false |
||||
|
}) |
||||
|
onMounted(() => {}) |
||||
|
let goPay = () => { |
||||
|
proxy.$router.push({ path: '/CartResult' }) |
||||
|
} |
||||
|
let cartDelt = () =>{ |
||||
|
data.isDeltHandle = !data.isDeltHandle |
||||
|
} |
||||
|
return { |
||||
|
...toRefs(data), |
||||
|
goPay, |
||||
|
cartDelt |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.cart-header{ |
||||
|
display: flex; |
||||
|
justify-content: flex-end; |
||||
|
padding: .175rem .4rem; |
||||
|
background-color: #fff; |
||||
|
height: 0.7rem; |
||||
|
line-height: 0.7rem; |
||||
|
font-size: .3rem; |
||||
|
color: #191A1A; |
||||
|
} |
||||
|
.cart-main{ |
||||
|
padding: 0.25rem .125rem 2.375rem .125rem; |
||||
|
color: #191A1A; |
||||
|
.cart-top{ |
||||
|
position: fixed; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
left: 0; |
||||
|
background-color: #F4F4FC; |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
font-size: .3rem; |
||||
|
padding: .25rem; |
||||
|
z-index: 999; |
||||
|
.cart-num{ |
||||
|
font-size: .3rem; |
||||
|
opacity: 0.6; |
||||
|
span{ |
||||
|
font-size: 0.25rem; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
.cart-list{ |
||||
|
padding-top: .875rem; |
||||
|
} |
||||
|
.cart-item{ |
||||
|
padding: .25rem; |
||||
|
margin-bottom: .1875rem; |
||||
|
box-shadow: 0px .0375rem 0.75rem 1px rgba(0,0,0,0.08); |
||||
|
border-radius: 0.1rem; |
||||
|
background-color: #fff; |
||||
|
.list-top{ |
||||
|
display: flex; |
||||
|
justify-content: flex-start; |
||||
|
align-items: center; |
||||
|
.top-info{ |
||||
|
display: flex; |
||||
|
flex: 1; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
} |
||||
|
.active-name{ |
||||
|
position: relative; |
||||
|
padding: 0 0.375rem; |
||||
|
font-size: .3rem; |
||||
|
background: url('@assets/images/gift.png') no-repeat left center; |
||||
|
background-size: 0.275rem 0.275rem; |
||||
|
&::after{ |
||||
|
position: absolute; |
||||
|
right: 0; |
||||
|
top: 50%; |
||||
|
content: ""; |
||||
|
width: .2rem; |
||||
|
height: .2rem; |
||||
|
background: url('@assets/images/arrow.png') no-repeat center center; |
||||
|
background-size:.2rem .2rem; |
||||
|
transform: translateY(-50%) |
||||
|
} |
||||
|
} |
||||
|
.dealer{ |
||||
|
padding-left: .4rem; |
||||
|
font-size: .3rem; |
||||
|
background: url('@assets/images/dealer.png') no-repeat left center; |
||||
|
background-size: .3rem .3rem; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.product-list{ |
||||
|
.product-item{ |
||||
|
display: flex; |
||||
|
justify-content: flex-start; |
||||
|
margin-top: .25rem; |
||||
|
.product-cont{ |
||||
|
flex: 1; |
||||
|
display: flex; |
||||
|
justify-content: flex-start; |
||||
|
.product-img{ |
||||
|
width: 1.25rem; |
||||
|
height: 1.75rem; |
||||
|
margin: .125rem 0.2rem 0 0; |
||||
|
background-color: #f1f1f1; |
||||
|
border-radius: 0.05rem; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
.product-txt{ |
||||
|
flex: 1; |
||||
|
.product-info{ |
||||
|
h4{ |
||||
|
font-size: .3rem; |
||||
|
} |
||||
|
.author-date{ |
||||
|
display: flex; |
||||
|
justify-content: flex-start; |
||||
|
margin: .075rem 0; |
||||
|
p{ |
||||
|
font-size: .25rem; |
||||
|
padding: 0 .05rem; |
||||
|
margin-right: 0.1rem; |
||||
|
background-color: #F4F6FC; |
||||
|
color: #717275; |
||||
|
} |
||||
|
} |
||||
|
.intro{ |
||||
|
font-size: .25rem; |
||||
|
opacity: 0.6; |
||||
|
} |
||||
|
} |
||||
|
.product-bottom{ |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
color: #757676; |
||||
|
.product-price{ |
||||
|
span{ |
||||
|
display: inline-block; |
||||
|
font-size: .35rem; |
||||
|
font-weight: bold; |
||||
|
color: #000; |
||||
|
margin-right: 0.175rem; |
||||
|
.rmb{ |
||||
|
font-style: normal; |
||||
|
font-size: .25rem; |
||||
|
text-decoration: none; |
||||
|
color: #000; |
||||
|
} |
||||
|
} |
||||
|
i{ |
||||
|
font-style: normal; |
||||
|
text-decoration: line-through; |
||||
|
color: #FF3871; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.cart-pay{ |
||||
|
position: fixed; |
||||
|
left: 0; |
||||
|
right: 0; |
||||
|
bottom: 1.225rem; |
||||
|
padding: 0 .4rem; |
||||
|
height: 1rem; |
||||
|
background-color: #fcfcfc; |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
.payment-right{ |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
font-size: .3rem; |
||||
|
.total-num{ |
||||
|
font-size: 0.3rem; |
||||
|
span{ |
||||
|
font-size: .35rem; |
||||
|
font-weight: bold; |
||||
|
color: #FF3871; |
||||
|
.rmb{ |
||||
|
font-style: normal; |
||||
|
font-size: .25rem; |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
.pay-btn{ |
||||
|
width: 1.875rem; |
||||
|
height: 0.75rem; |
||||
|
margin-left: 0.5rem; |
||||
|
line-height: 0.75rem; |
||||
|
text-align: center; |
||||
|
color: #fff; |
||||
|
background: url('@assets/images/btn3.png') no-repeat center center; |
||||
|
background-size: 100% 100%; |
||||
|
} |
||||
|
.delt-btn{ |
||||
|
width: 1.875rem; |
||||
|
height: 0.75rem; |
||||
|
line-height: 0.75rem; |
||||
|
font-size: .3rem; |
||||
|
color: #000; |
||||
|
text-align: center; |
||||
|
border: 2px solid #000; |
||||
|
opacity: 0.6; |
||||
|
border-radius: .625rem; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.van-checkbox{ |
||||
|
margin-right: .15rem; |
||||
|
} |
||||
|
|
||||
|
:deep(.van-checkbox__icon){ |
||||
|
height: .325rem; |
||||
|
} |
||||
|
:deep(.van-checkbox__icon .van-icon){ |
||||
|
width: .325rem; |
||||
|
height: .325rem; |
||||
|
border-color: rgba(0,0,0,.3); |
||||
|
} |
||||
|
:deep(.van-checkbox__icon--checked .van-icon){ |
||||
|
border: none; |
||||
|
background: url('@assets/images/selected.png') no-repeat transparent; |
||||
|
background-size: .325rem .325rem; |
||||
|
} |
||||
|
:deep(.van-icon-success:before){ |
||||
|
display: none; |
||||
|
} |
||||
|
:deep(.van-checkbox__label){ |
||||
|
font-size: .3rem; |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,107 @@ |
|||||
|
<template> |
||||
|
<div class="main"> |
||||
|
<div class="result-header"> |
||||
|
<span class="back" @click="toBack"></span> |
||||
|
<p>下单成功</p> |
||||
|
</div> |
||||
|
<div class="result-main"> |
||||
|
<img src="@assets/images/xd-status.png" alt="" /> |
||||
|
<p>恭喜,您已成功下单</p> |
||||
|
<span class="tip">我们会尽快完成审核工作,请耐心等待!</span> |
||||
|
<div class="result-btn"> |
||||
|
<span>查看订单</span> |
||||
|
<span class="result-btn-more" @click="toMoreOrder">再下一单</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<TabBar :tabCur.sync="tabCur" /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { Toast } from 'vant' |
||||
|
import { reactive, computed, onMounted, getCurrentInstance, toRefs } from 'vue' |
||||
|
import TabBar from '@/components/tabBar/index.vue' |
||||
|
export default { |
||||
|
name: 'Cart', |
||||
|
components: { TabBar }, |
||||
|
setup() { |
||||
|
const { proxy } = getCurrentInstance() |
||||
|
let data = reactive({ |
||||
|
tabCur: 1 |
||||
|
}) |
||||
|
onMounted(() => {}) |
||||
|
let toBack = () => { |
||||
|
proxy.$router.go(-1); |
||||
|
} |
||||
|
let toMoreOrder = () =>{ |
||||
|
location.href = './'; |
||||
|
} |
||||
|
return { |
||||
|
...toRefs(data), |
||||
|
toBack, |
||||
|
toMoreOrder |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.result-header{ |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
padding: 0 .4rem; |
||||
|
height: 1rem; |
||||
|
background-color: #fff; |
||||
|
box-shadow: 0px .075rem .125rem 1px #EFECEC; |
||||
|
.back{ |
||||
|
display: block; |
||||
|
width: .5rem; |
||||
|
height: .5rem; |
||||
|
background: url('@assets/images/back.png') no-repeat transparent; |
||||
|
background-size: .5rem .5rem; |
||||
|
} |
||||
|
P{ |
||||
|
flex: 1; |
||||
|
text-align: center; |
||||
|
font-size: .375rem; |
||||
|
} |
||||
|
} |
||||
|
.result-main{ |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
align-items: center; |
||||
|
padding-top: 1.875rem; |
||||
|
img{ |
||||
|
display: block; |
||||
|
width: 3.125rem; |
||||
|
} |
||||
|
p{ |
||||
|
margin: .5rem 0 .125rem 0; |
||||
|
font-size: .4rem; |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
.tip{ |
||||
|
font-size: .325rem; |
||||
|
} |
||||
|
.result-btn{ |
||||
|
margin-top: 1rem; |
||||
|
span{ |
||||
|
display: inline-block; |
||||
|
width: 2.5rem; |
||||
|
height: .875rem; |
||||
|
line-height: .875rem; |
||||
|
margin: 0 .25rem; |
||||
|
font-size: .35rem; |
||||
|
text-align: center; |
||||
|
color: #5A86F4; |
||||
|
border: 1px solid #5A86F4; |
||||
|
border-radius: .625rem; |
||||
|
&.result-btn-more{ |
||||
|
background-color: #5A86F4; |
||||
|
color: #fff; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,436 @@ |
|||||
|
<template> |
||||
|
<div class="main"> |
||||
|
<!-- <div class="index-header">当前活动</div> --> |
||||
|
<div class="active-main"> |
||||
|
<div class="active-list"> |
||||
|
<div class="active-item"> |
||||
|
<div class="active-img"> |
||||
|
<img src="@assets/images/bookimg.png" alt="" /> |
||||
|
<span>限选3册</span> |
||||
|
</div> |
||||
|
<div class="active-info"> |
||||
|
<div class="active-info-top"> |
||||
|
<h4>你选书,我买单</h4> |
||||
|
<span></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="active-time"> |
||||
|
活动时间:2023/10/1 - 2023/12/31 |
||||
|
</div> |
||||
|
<div class="active-bottom"> |
||||
|
<p class="active-slogn">新书 · 选书· 下单· 借阅</p> |
||||
|
<span class="active-btn"></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="active-item"> |
||||
|
<div class="active-img"> |
||||
|
<img src="@assets/images/bookimg.png" alt="" /> |
||||
|
<span>限选3册</span> |
||||
|
</div> |
||||
|
<div class="active-info"> |
||||
|
<div class="active-info-top"> |
||||
|
<h4>你选书,我买单</h4> |
||||
|
<span>活动仅剩最后3天</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="active-time"> |
||||
|
活动时间:2023/10/1 - 2023/12/31 |
||||
|
</div> |
||||
|
<div class="active-bottom"> |
||||
|
<p class="active-slogn">新书 · 选书· 下单· 借阅</p> |
||||
|
<span class="active-btn"></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="active-item"> |
||||
|
<div class="active-img"> |
||||
|
<img src="@assets/images/bookimg.png" alt="" /> |
||||
|
<span>限选3册</span> |
||||
|
</div> |
||||
|
<div class="active-info"> |
||||
|
<div class="active-info-top"> |
||||
|
<h4>你选书,我买单</h4> |
||||
|
<span>12.13 09:00开始</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="active-time"> |
||||
|
活动时间:2023/10/1 - 2023/12/31 |
||||
|
</div> |
||||
|
<div class="active-bottom"> |
||||
|
<p class="active-slogn">新书 · 选书· 下单· 借阅</p> |
||||
|
<span class="active-btn wait-btn"></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="active-nodata"> |
||||
|
<img src="@assets/images/nodata.png" alt="" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<TabBar :tabCur.sync="data.tabCur" /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { reactive, computed, onMounted, getCurrentInstance } from 'vue' |
||||
|
import WucTab from '@/components/wuc-tab/wuc-tab.vue' |
||||
|
import TabBar from '@/components/tabBar/index.vue' |
||||
|
import { useStore, mapGetters } from 'vuex' |
||||
|
import { useRoute } from 'vue-router' |
||||
|
import { isWeiXin } from '@/utils/tool.js' |
||||
|
import { Toast } from 'vant' |
||||
|
|
||||
|
export default { |
||||
|
components: { WucTab, TabBar }, |
||||
|
setup() { |
||||
|
const store = useStore() |
||||
|
const { proxy } = getCurrentInstance() |
||||
|
const data = reactive({ |
||||
|
tabCur: 0, |
||||
|
isWeiXin: true, |
||||
|
weChatUserInfo: {}, |
||||
|
showLoginDialog: false, |
||||
|
isTryOutLogin: true, |
||||
|
key: '', |
||||
|
iv: '', |
||||
|
}) |
||||
|
onMounted(async () => { |
||||
|
data.isWeiXin = isWeiXin() |
||||
|
data.key = CryptoJS.enc.Utf8.parse('0yxk2020aiyx2021') |
||||
|
data.iv = CryptoJS.enc.Utf8.parse('0yxk2020aiyx2021') |
||||
|
let option = proxy.$route.query |
||||
|
if (option.sid) { |
||||
|
localStorage.setItem('aiyxSid', option.sid) |
||||
|
// 外部试用 |
||||
|
if (option.sid == 'aiyxlibmultimediaadmin') { |
||||
|
ToTryLogin() |
||||
|
data.isTryOutLogin = false |
||||
|
localStorage.setItem('isTryout', 1) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/* 登录判断 */ |
||||
|
proxy.isLogin(option) |
||||
|
|
||||
|
const userData = localStorage.getItem('userData') || '' |
||||
|
if (userData) { |
||||
|
} |
||||
|
}) |
||||
|
let Encrypt = (o) => { |
||||
|
if (typeof o === 'string') { |
||||
|
if (o) { |
||||
|
var srcs = CryptoJS.enc.Utf8.parse(o) |
||||
|
return CryptoJS.AES.encrypt(srcs, data.key, { |
||||
|
keySize: 128 / 8, |
||||
|
iv: data.iv, |
||||
|
mode: CryptoJS.mode.CBC, |
||||
|
padding: CryptoJS.pad.Pkcs7, |
||||
|
}).toString() |
||||
|
} |
||||
|
} else if (typeof o === 'object') { |
||||
|
for (var _o in o) { |
||||
|
if (o[_o]) { |
||||
|
var srcs = CryptoJS.enc.Utf8.parse(o[_o]) |
||||
|
o[_o] = CryptoJS.AES.encrypt(srcs, data.key, { |
||||
|
keySize: 128 / 8, |
||||
|
iv: data.iv, |
||||
|
mode: CryptoJS.mode.CBC, |
||||
|
padding: CryptoJS.pad.Pkcs7, |
||||
|
}).toString() |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return o |
||||
|
} |
||||
|
// 试用直接登录 |
||||
|
let ToTryLogin = () => { |
||||
|
let param = { |
||||
|
Phone: 'a0c82379-37c1-d2e3-a2bf-82e0d081787c', |
||||
|
Pwd: Encrypt('123456'), |
||||
|
} |
||||
|
proxy.$http |
||||
|
.post(proxy.$API.LOGIN, param, { |
||||
|
headers: { |
||||
|
'Content-Type': 'application/x-www-form-urlencoded', |
||||
|
}, |
||||
|
}) |
||||
|
.then((res) => { |
||||
|
if (res.type == 200) { |
||||
|
localStorage.setItem( |
||||
|
'userData', |
||||
|
JSON.stringify(res.data) |
||||
|
) |
||||
|
localStorage.setItem( |
||||
|
'userphone', |
||||
|
'a0c82379-37c1-d2e3-a2bf-82e0d081787c' |
||||
|
) |
||||
|
if (localStorage.getItem('actOnlinePage')) { |
||||
|
const actionUrl = |
||||
|
localStorage.getItem('actonlineLink') |
||||
|
location.href = actionUrl |
||||
|
} else { |
||||
|
location.href = '/' |
||||
|
} |
||||
|
} else if (res.type == 403) { |
||||
|
Toast(res.content) |
||||
|
setTimeout(() => { |
||||
|
// let url = '/ChangeMineCard?custId=' + res.data.custId |
||||
|
// proxy.$router.push(url) |
||||
|
}, 1000) |
||||
|
} else { |
||||
|
Toast(res.content) |
||||
|
} |
||||
|
}) |
||||
|
.catch((res) => { |
||||
|
console.log(res) |
||||
|
}) |
||||
|
} |
||||
|
/* 登录判断 */ |
||||
|
let isLogin = (option) => { |
||||
|
/* 如果微信code 存在, 则获取微信用户信息进行微信登录或者注册 */ |
||||
|
if (option.code) { |
||||
|
localStorage.setItem('aiyxWeChatLoginStatus', 'noLogin') |
||||
|
proxy.getWeChatUserInfo() |
||||
|
localStorage.setItem('aiyxWeChatCode', option.code) |
||||
|
} else { |
||||
|
const userData = localStorage.getItem('userData') || '' |
||||
|
if (!userData) { |
||||
|
data.showLoginDialog = true |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
// 微信登录 |
||||
|
let weChatLogin = () => { |
||||
|
if (!data.isWeiXin) { |
||||
|
Toast('请使用微信登录') |
||||
|
return |
||||
|
} |
||||
|
let homeUrl = location.protocol + '//' + location.host |
||||
|
let url = |
||||
|
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxd2a2989d0fb9cf1c&redirect_uri=' + |
||||
|
homeUrl + |
||||
|
'&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect' |
||||
|
location.href = url |
||||
|
} |
||||
|
/* 获取微信用户信息 */ |
||||
|
let getWeChatUserInfo = () => { |
||||
|
const that = data |
||||
|
let option = proxy.$route.query |
||||
|
let param = { |
||||
|
Code: option.code || '', |
||||
|
} |
||||
|
proxy.$http |
||||
|
.post(proxy.$API.WECHATLOGIN, param, { |
||||
|
headers: { |
||||
|
'Content-Type': 'application/x-www-form-urlencoded', |
||||
|
}, |
||||
|
}) |
||||
|
.then((res) => { |
||||
|
if (res.type == 200) { |
||||
|
data.showLoginDialog = false |
||||
|
if (res.data) { |
||||
|
localStorage.setItem( |
||||
|
'userData', |
||||
|
JSON.stringify(res.data) |
||||
|
) |
||||
|
localStorage.setItem('userphone', res.data.phone) |
||||
|
localStorage.setItem( |
||||
|
'aiyxWeChatLoginStatus', |
||||
|
'isLogin' |
||||
|
) |
||||
|
} |
||||
|
console.log('微信登录成功') |
||||
|
} else if (res.type == 203 && res.data) { |
||||
|
that.weChatUserInfo = res.data |
||||
|
localStorage.setItem( |
||||
|
'weChatUserInfo', |
||||
|
JSON.stringify(that.weChatUserInfo) |
||||
|
) |
||||
|
// proxy.$router.push('/bindMobilePhone') |
||||
|
} else { |
||||
|
console.log(res.content) |
||||
|
} |
||||
|
}) |
||||
|
.catch((res) => { |
||||
|
console.log(res) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
/* 获取token 和用户信息 */ |
||||
|
let getTokenAndUserInfo = () => { |
||||
|
if (!location.search) { |
||||
|
return |
||||
|
} |
||||
|
let code = proxy.$route.query.code |
||||
|
if (code) { |
||||
|
proxy.$http |
||||
|
.get(proxy.$API.GETWECHATTOkEN, { |
||||
|
params: { Code: code }, |
||||
|
}) |
||||
|
.then((res) => { |
||||
|
if (res.type == 200) { |
||||
|
let data = res.data |
||||
|
let access_token = data.access_token |
||||
|
let openid = data.openid |
||||
|
proxy.$http |
||||
|
.get(proxy.$API.GETWECHATUSERINFO, { |
||||
|
params: { |
||||
|
AccessToken: access_token, |
||||
|
OpenId: openid, |
||||
|
}, |
||||
|
}) |
||||
|
.then((res) => { |
||||
|
if (res.type == 200) { |
||||
|
let datas = res.data |
||||
|
alert( |
||||
|
'我的昵称是:' + |
||||
|
datas.nickname + |
||||
|
',我的openid是:' + |
||||
|
datas.openid + |
||||
|
',我的城市是:' + |
||||
|
datas.city |
||||
|
) |
||||
|
} |
||||
|
}) |
||||
|
.catch((res) => { |
||||
|
console.log(res) |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
.catch((res) => { |
||||
|
console.log(res) |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
return { |
||||
|
data, |
||||
|
Encrypt, |
||||
|
ToTryLogin, |
||||
|
isLogin, |
||||
|
getTokenAndUserInfo, |
||||
|
weChatLogin, |
||||
|
getWeChatUserInfo, |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.index-header { |
||||
|
padding: 0 0.4rem; |
||||
|
height: 1.125rem; |
||||
|
line-height: 1.125rem; |
||||
|
font-size: 0.5rem; |
||||
|
color: #fff; |
||||
|
background-color: #5a86f4; |
||||
|
} |
||||
|
.active-main{ |
||||
|
padding-bottom: 1.475rem; |
||||
|
} |
||||
|
.active-list { |
||||
|
padding: 0 0.4rem; |
||||
|
font-size: 0.3rem; |
||||
|
color: #191a1a; |
||||
|
.active-item { |
||||
|
background-color: #fff; |
||||
|
margin-top: 0.25rem; |
||||
|
box-shadow: 0px 0.0375rem 0.75rem 1px rgba(0, 0, 0, 0.08); |
||||
|
border-radius: 0.1rem; |
||||
|
.active-img { |
||||
|
position: relative; |
||||
|
// height: 3.55rem; |
||||
|
img { |
||||
|
display: block; |
||||
|
width: 100%; |
||||
|
} |
||||
|
span { |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
display: block; |
||||
|
padding: 0 0.125rem; |
||||
|
height: 0.6rem; |
||||
|
line-height: 0.6rem; |
||||
|
font-size: 0.3rem; |
||||
|
text-align: center; |
||||
|
color: #fff; |
||||
|
background-color: rgba(0, 0, 0, 0.4); |
||||
|
border-radius: 0.1rem 0 0.1rem 0; |
||||
|
} |
||||
|
} |
||||
|
.active-info { |
||||
|
margin-top: 0.25rem; |
||||
|
padding: 0 0.25rem; |
||||
|
.active-info-top { |
||||
|
display: flex; |
||||
|
justify-content: flex-start; |
||||
|
h4 { |
||||
|
margin-right: 0.125rem; |
||||
|
font-size: 0.45rem; |
||||
|
font-weight: 800; |
||||
|
} |
||||
|
span { |
||||
|
margin-top: 0.225rem; |
||||
|
color: #f3a916; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
.active-time { |
||||
|
padding: 0 0.25rem 0 0.625rem; |
||||
|
background: url('@assets/images/time.png') no-repeat 0.25rem center; |
||||
|
background-size: 0.325rem 0.325rem; |
||||
|
} |
||||
|
.active-bottom { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
padding: 0.125rem 0.25rem 0.15rem 0.25rem; |
||||
|
.active-slogn { |
||||
|
position: relative; |
||||
|
height: 0.55rem; |
||||
|
line-height: 0.55rem; |
||||
|
font-size: 0.25rem; |
||||
|
padding: 0 0.15rem; |
||||
|
background-color: #f4f6fc; |
||||
|
border-radius: 0.05rem; |
||||
|
&::before { |
||||
|
content: ''; |
||||
|
position: absolute; |
||||
|
top: -0.1rem; |
||||
|
left: 0.15rem; |
||||
|
width: 0.175rem; |
||||
|
height: 0.175rem; |
||||
|
background: url('@assets/images/yh1.png') no-repeat; |
||||
|
background-size: 100% 100%; |
||||
|
} |
||||
|
&::after { |
||||
|
content: ''; |
||||
|
position: absolute; |
||||
|
bottom: -0.1rem; |
||||
|
right: 0.15rem; |
||||
|
width: 0.175rem; |
||||
|
height: 0.175rem; |
||||
|
background: url('@assets/images/yh2.png') no-repeat; |
||||
|
background-size: 100% 100%; |
||||
|
} |
||||
|
} |
||||
|
.active-btn { |
||||
|
width: 2.28rem; |
||||
|
height: 0.75rem; |
||||
|
background: url('@assets/images/btn1.png') no-repeat; |
||||
|
background-size: 100% 100%; |
||||
|
&.wait-btn { |
||||
|
background: url('@assets/images/btn2.png') no-repeat; |
||||
|
background-size: 100% 100%; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.active-nodata { |
||||
|
img { |
||||
|
display: block; |
||||
|
width: 5rem; |
||||
|
margin: 0 auto; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,316 @@ |
|||||
|
<template> |
||||
|
<div class="main"> |
||||
|
<div class="mine-top"> |
||||
|
<div class="user-main"> |
||||
|
<div class="user-info"> |
||||
|
<div class="user-img"> |
||||
|
<img src="" alt="" /> |
||||
|
</div> |
||||
|
<p class="user-name">张秀才</p> |
||||
|
<div class="user-tip">欢迎来到爱图图书</div> |
||||
|
</div> |
||||
|
<div class="user-card"> |
||||
|
<p>NO.10078398329</p> |
||||
|
<span>切换证号</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="mine-content"> |
||||
|
<div class="mine-item mine-order"> |
||||
|
<div class="mini-title"> |
||||
|
<h4>我的订单</h4> |
||||
|
<span>查看全部</span> |
||||
|
</div> |
||||
|
<div class="order-handle"> |
||||
|
<div class="order-item"> |
||||
|
<div class="order-icon"> |
||||
|
<img src="@assets/images/d-she.png" alt="" /> |
||||
|
<i>1</i> |
||||
|
</div> |
||||
|
<p>待审核</p> |
||||
|
</div> |
||||
|
<div class="order-item"> |
||||
|
<div class="order-icon"> |
||||
|
<img src="@assets/images/d-fh.png" alt="" /> |
||||
|
<!-- <i></i> --> |
||||
|
</div> |
||||
|
<p>待发货</p> |
||||
|
</div> |
||||
|
<div class="order-item"> |
||||
|
<div class="order-icon"> |
||||
|
<img src="@assets/images/d-shuo.png" alt="" /> |
||||
|
<!-- <i></i> --> |
||||
|
</div> |
||||
|
<p>待收货</p> |
||||
|
</div> |
||||
|
<div class="order-item"> |
||||
|
<div class="order-icon"> |
||||
|
<img src="@assets/images/y-wc.png" alt="" /> |
||||
|
<!-- <i></i> --> |
||||
|
</div> |
||||
|
<p>已完成</p> |
||||
|
</div> |
||||
|
<div class="order-item"> |
||||
|
<div class="order-icon"> |
||||
|
<img src="@assets/images/y-qx.png" alt="" /> |
||||
|
<!-- <i></i> --> |
||||
|
</div> |
||||
|
<p>已取消</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="log-info"> |
||||
|
<div class="log-img"> |
||||
|
<img src="" alt="" /> |
||||
|
</div> |
||||
|
<div class="log-txt"> |
||||
|
<div class="log-num">顺丰速运 SF1629871960733</div> |
||||
|
<div class="logo-cont overflow-txt-only">[鄂州市]快件离开 【湖北武昌转运中心】</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="mine-item mine-lend"> |
||||
|
<div class="mini-title"> |
||||
|
<h4>我的借阅</h4> |
||||
|
<span>查看全部</span> |
||||
|
</div> |
||||
|
<div class="order-handle"> |
||||
|
<div class="order-item"> |
||||
|
<div class="order-icon"> |
||||
|
<img src="@assets/images/lending.png" alt="" /> |
||||
|
</div> |
||||
|
<p>借阅中</p> |
||||
|
</div> |
||||
|
<div class="order-item"> |
||||
|
<div class="order-icon"> |
||||
|
<img src="@assets/images/return.png" alt="" /> |
||||
|
</div> |
||||
|
<p>已归还</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="mine-item mine-lend"> |
||||
|
<div class="mini-title"> |
||||
|
<h4>更多设置</h4> |
||||
|
</div> |
||||
|
<div class="setting"> |
||||
|
<div class="setting-item">我的收货地址</div> |
||||
|
<div class="setting-item">帮助与反馈</div> |
||||
|
<div class="setting-item">关于我们</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<TabBar :tabCur.sync="data.tabCur" /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { Toast } from 'vant' |
||||
|
import { reactive, computed, onMounted, getCurrentInstance, watch } from 'vue' |
||||
|
import TabBar from '@/components/tabBar/index.vue' |
||||
|
export default { |
||||
|
name: 'Mine', |
||||
|
components: { TabBar }, |
||||
|
setup() { |
||||
|
const { proxy } = getCurrentInstance() |
||||
|
let data = reactive({ |
||||
|
tabCur: 2, |
||||
|
}) |
||||
|
onMounted(() => {}) |
||||
|
return { |
||||
|
data |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.mine-top { |
||||
|
position: relative; |
||||
|
width: 100%; |
||||
|
height: 140px; |
||||
|
background: url('@assets/images/minebg.png') no-repeat left top; |
||||
|
background-size: 100% 100%; |
||||
|
.user-main { |
||||
|
margin: 1.625rem.2rem 0 .2rem; |
||||
|
padding-bottom: .4rem; |
||||
|
background-color: #fff; |
||||
|
border-radius: 0.1rem; |
||||
|
} |
||||
|
.user-info{ |
||||
|
display: flex; |
||||
|
justify-content: flex-start; |
||||
|
align-items: center; |
||||
|
padding-top: .225rem; |
||||
|
.user-img{ |
||||
|
width: 1.5rem; |
||||
|
height: 1.5rem; |
||||
|
margin: -0.625rem 0 0 .75rem; |
||||
|
border-radius: 50%; |
||||
|
overflow: hidden; |
||||
|
background-color: #fff; |
||||
|
img{ |
||||
|
display: block; |
||||
|
width: 1.45rem; |
||||
|
} |
||||
|
} |
||||
|
.user-name{ |
||||
|
font-size: 0.4rem; |
||||
|
flex: 1; |
||||
|
margin-left: 0.1875rem; |
||||
|
} |
||||
|
.user-tip{ |
||||
|
position: relative; |
||||
|
padding: 0.2rem .2rem .2rem .375rem; |
||||
|
margin-right: .2rem; |
||||
|
font-size: .25rem; |
||||
|
background-color: #EEF6FE; |
||||
|
border-radius: .1rem; |
||||
|
&::before{ |
||||
|
position: absolute; |
||||
|
left: -0.225rem; |
||||
|
top: 50%; |
||||
|
width: .45rem; |
||||
|
height: .45rem; |
||||
|
content: ""; |
||||
|
background: url('@assets/images/hi.png') no-repeat; |
||||
|
background-size: 100% 100%; |
||||
|
transform: translateY(-50%); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
.user-card{ |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
padding: .125rem .225rem; |
||||
|
margin: .325rem .2rem 0 .2rem; |
||||
|
height: .7rem; |
||||
|
line-height: .7rem; |
||||
|
font-size: .325rem; |
||||
|
background-color: #DEEEFC; |
||||
|
border-radius: .1rem; |
||||
|
p{ |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
span{ |
||||
|
display: block; |
||||
|
padding: 0 .15rem; |
||||
|
background-color: #2B3C74; |
||||
|
color: #fff; |
||||
|
border-radius: 0.1rem; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
.mine-content{ |
||||
|
margin: 2rem 0 1.25rem 0; |
||||
|
padding: 0 .2rem; |
||||
|
} |
||||
|
.mine-item{ |
||||
|
margin-bottom: .25rem; |
||||
|
padding: .3125rem .2rem .375rem .2rem; |
||||
|
background-color: #fff; |
||||
|
border-radius: 0.1rem; |
||||
|
.mini-title{ |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
font-size: .4rem; |
||||
|
margin-bottom: .375rem; |
||||
|
span{ |
||||
|
font-size: .3rem; |
||||
|
padding-right: .25rem; |
||||
|
background: url('@assets/images/arrow.png') no-repeat right center; |
||||
|
background-size: .2rem .2rem; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.order-handle{ |
||||
|
display: flex; |
||||
|
justify-content: flex-start; |
||||
|
align-items: center; |
||||
|
text-align: center; |
||||
|
.order-item{ |
||||
|
flex: 1; |
||||
|
.order-icon{ |
||||
|
position: relative; |
||||
|
width: .6rem; |
||||
|
margin: 0 auto .2rem auto; |
||||
|
img{ |
||||
|
display: block; |
||||
|
width: .6rem; |
||||
|
height: .6rem; |
||||
|
} |
||||
|
i{ |
||||
|
position: absolute; |
||||
|
right: -0.1rem; |
||||
|
top: -0.15rem; |
||||
|
height: .3rem; |
||||
|
line-height: .3rem; |
||||
|
padding: 0 .1rem; |
||||
|
font-size: .25rem; |
||||
|
font-style: normal; |
||||
|
color: #fff; |
||||
|
background-color: #FF3871; |
||||
|
border-radius: .15rem; |
||||
|
} |
||||
|
} |
||||
|
p{ |
||||
|
font-size: .325rem; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.log-info{ |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
padding: .2rem; |
||||
|
margin-top: 0.325rem; |
||||
|
background-color: #F5F8FF; |
||||
|
border-radius: .1rem; |
||||
|
.log-img{ |
||||
|
width: 0.925rem; |
||||
|
height: 1.125rem; |
||||
|
background-color: #f3f3f3; |
||||
|
border-radius: .1rem; |
||||
|
overflow: hidden; |
||||
|
img{ |
||||
|
display: block; |
||||
|
width: 100%; |
||||
|
} |
||||
|
} |
||||
|
.log-txt{ |
||||
|
flex: 1; |
||||
|
margin-left: .2rem; |
||||
|
.log-num{ |
||||
|
font-size: .35rem; |
||||
|
line-height: .625rem; |
||||
|
} |
||||
|
.logo-cont{ |
||||
|
font-size: .3rem; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.mine-lend{ |
||||
|
.order-handle{ |
||||
|
.order-item{ |
||||
|
width: 20%; |
||||
|
flex: none; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.setting{ |
||||
|
.setting-item{ |
||||
|
margin-bottom: 0.5rem; |
||||
|
font-size: .325rem; |
||||
|
height: 0.525rem; |
||||
|
line-height: 0.525rem; |
||||
|
background: url('@assets/images/arrow.png') no-repeat right center; |
||||
|
background-size: .2rem .2rem; |
||||
|
&:last-child{ |
||||
|
margin-bottom: .125rem; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,13 @@ |
|||||
|
import { createStore } from 'vuex' |
||||
|
import home from './modules/home' |
||||
|
|
||||
|
|
||||
|
|
||||
|
export function _createStore() { |
||||
|
return createStore({ |
||||
|
modules: { |
||||
|
home |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,187 @@ |
|||||
|
import { createStore } from 'vuex' |
||||
|
// 引入http请求
|
||||
|
import $http from '@/utils/http' |
||||
|
|
||||
|
import API from '@/utils/api' |
||||
|
|
||||
|
|
||||
|
const state = () => ({ |
||||
|
count: 1, |
||||
|
testResult: null, |
||||
|
materialList:[], |
||||
|
bannerList:[], |
||||
|
newsList:[], |
||||
|
videoList:[], |
||||
|
bookList:[], |
||||
|
VRList:[] |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
const getters = { |
||||
|
getCount:state => state.count, |
||||
|
getTestResult: state => state.testResult, |
||||
|
getDoc: state => state.materialList, |
||||
|
getVideoList: state => state.videoList, |
||||
|
getBookList: state => state.bookList, |
||||
|
getNewsList: state => state.newsList, |
||||
|
getBanners: state => state.bannerList, |
||||
|
getVRList: state => state.VRList, |
||||
|
getDocBanners: state => state.docBannerList |
||||
|
} |
||||
|
|
||||
|
const mutations = { |
||||
|
INCREMENT: (state) => { |
||||
|
state.count++ |
||||
|
}, |
||||
|
DECREMENT: (state) => { |
||||
|
state.count-- |
||||
|
}, |
||||
|
INITCOUNT: (state, COUNT) => { |
||||
|
state.count = COUNT |
||||
|
}, |
||||
|
TESTRESULT: (state, data) => { |
||||
|
state.testResult = data |
||||
|
}, |
||||
|
GETDOC: (state, data) => { |
||||
|
state.materialList = data |
||||
|
}, |
||||
|
GETVIDEO: (state, data) => { |
||||
|
state.videoList = data |
||||
|
}, |
||||
|
GETEBOOKS: (state, data) => { |
||||
|
state.bookList = data |
||||
|
}, |
||||
|
GETNEWS: (state, data) => { |
||||
|
state.newsList = data |
||||
|
}, |
||||
|
GETBANNERS: (state, data) => { |
||||
|
state.bannerList = data |
||||
|
}, |
||||
|
GETDOCBANNERS: (state, data) => { |
||||
|
state.docBannerList = data |
||||
|
}, |
||||
|
GETVRLIST: (state, data) => { |
||||
|
state.VRList = data |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
const actions = { |
||||
|
increment({ state, commit }) { |
||||
|
commit('INCREMENT') |
||||
|
}, |
||||
|
decrement({ state, commit }) { |
||||
|
commit('DECREMENT') |
||||
|
}, |
||||
|
loading({ commit, state }) { |
||||
|
return $http.get(API.GETBANNERS) |
||||
|
.then(res => { |
||||
|
commit('TESTRESULT', res) |
||||
|
}) |
||||
|
}, |
||||
|
getDoc({ commit, state }) { |
||||
|
|
||||
|
return $http.get(API.GETDOC,{ |
||||
|
params: { |
||||
|
nShow: 3 |
||||
|
} |
||||
|
}) |
||||
|
.then(res => { |
||||
|
if (res.type == 200) { |
||||
|
commit('GETDOC', res.data) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
getVideoList({ commit, state }) { |
||||
|
return $http.get(API.GETVIDEO,{ |
||||
|
params: { |
||||
|
nShow: 4 |
||||
|
} |
||||
|
}) |
||||
|
.then(res => { |
||||
|
if (res.type == 200) { |
||||
|
commit('GETVIDEO', res.data) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
getVRList({ commit, state }) { |
||||
|
return $http.get(API.GETVRLIST,{ |
||||
|
params: { |
||||
|
nShow: 4 |
||||
|
} |
||||
|
}) |
||||
|
.then(res => { |
||||
|
if (res.type == 200) { |
||||
|
commit('GETVRLIST', res.data) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
getBookList({ commit, state }) { |
||||
|
return $http.get(API.GETEBOOKS,{ |
||||
|
params: { |
||||
|
nShow: 6 |
||||
|
} |
||||
|
}) |
||||
|
.then(res => { |
||||
|
if (res.type == 200) { |
||||
|
commit('GETEBOOKS', res.data) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
getNewsList({ commit, state }) { |
||||
|
return $http.get(API.GETNEWS,{ |
||||
|
params: { |
||||
|
nShow: 5 |
||||
|
} |
||||
|
}) |
||||
|
.then(res => { |
||||
|
if (res.type == 200) { |
||||
|
commit('GETNEWS', res.data) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
getBanners({ commit, state }) { |
||||
|
return $http.get(API.GETBANNERS,{ |
||||
|
params: { |
||||
|
nShow: 5 |
||||
|
} |
||||
|
}) |
||||
|
.then(res => { |
||||
|
if (res.type == 200) { |
||||
|
commit('GETBANNERS', res.data) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
getDocBanners({ commit, state }) { |
||||
|
let Authorization = ""; |
||||
|
if (localStorage) { |
||||
|
const userData = JSON.parse(localStorage.getItem('userData')) || ""; |
||||
|
if (userData) { |
||||
|
Authorization = "Bearer " + userData.token; |
||||
|
} |
||||
|
} |
||||
|
return $http.get(API.GETDOCBANNER,{ |
||||
|
params: { |
||||
|
nShow: 5 |
||||
|
}, |
||||
|
headers: { |
||||
|
Authorization: Authorization |
||||
|
} |
||||
|
}) |
||||
|
.then(res => { |
||||
|
if (res.type == 200) { |
||||
|
commit('GETDOCBANNER', res.data) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
resetCount({ commit }) { |
||||
|
commit('INITCOUNT', 67) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
state, |
||||
|
mutations, |
||||
|
actions, |
||||
|
getters |
||||
|
} |
||||
@ -0,0 +1,41 @@ |
|||||
|
import { createStore } from 'vuex' |
||||
|
|
||||
|
|
||||
|
const state = () => ({ |
||||
|
userInfo: '' |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
const getters = { |
||||
|
getUserInfo:state => state.userInfo |
||||
|
} |
||||
|
|
||||
|
const mutations = { |
||||
|
LOGIN: (state,data) => { |
||||
|
state.userInfo = data; |
||||
|
localStorage.setItem("userInfo", data); |
||||
|
}, |
||||
|
LOGOUT: (state) => { |
||||
|
state.userInfo = ''; |
||||
|
localStorage.setItem("userInfo", ''); |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
|
||||
|
const actions = { |
||||
|
login({ state, commit }) { |
||||
|
commit('LOGIN') |
||||
|
}, |
||||
|
logout({ state, commit }) { |
||||
|
commit('LOGOUT') |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
state, |
||||
|
mutations, |
||||
|
actions, |
||||
|
getters |
||||
|
} |
||||
@ -0,0 +1,157 @@ |
|||||
|
import { createStore } from 'vuex' |
||||
|
// 引入http请求
|
||||
|
import $http from '@/utils/http' |
||||
|
|
||||
|
import API from '@/utils/api' |
||||
|
|
||||
|
|
||||
|
const state = () => ({ |
||||
|
bookBaseList: [], |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
const getters = { |
||||
|
getBookBase:state => state.bookBaseList, |
||||
|
} |
||||
|
|
||||
|
const mutations = { |
||||
|
GETBOOKBASEDATA: (state, data) => { |
||||
|
state.bookBaseList = data |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
let that = { |
||||
|
ebookId:global.ebookId, |
||||
|
ResourceId:global.ResourceId, |
||||
|
userData: global.userData |
||||
|
} |
||||
|
console.log('global') |
||||
|
|
||||
|
// 根据目录索引图书详情并更新进度【New】
|
||||
|
let GetListAndUpdateUsed = (Booklink, BooklinkTitle, PathId = "") => { |
||||
|
//console.log(that.detailData);
|
||||
|
let param = { |
||||
|
BaseId: that.ebookId, |
||||
|
ResourceId: that.ResourceId, |
||||
|
Booklink: Booklink, |
||||
|
BooklinkTitle: BooklinkTitle, |
||||
|
tPath: PathId |
||||
|
} |
||||
|
proxy.$http |
||||
|
.put(proxy.$API.GETLISTANDUPDATEUSED, |
||||
|
param |
||||
|
) |
||||
|
.then(res => { |
||||
|
if (res.type == 200) { |
||||
|
let resData = res.data; |
||||
|
console.log(resData) |
||||
|
that.directoryList = JSON.parse( |
||||
|
resData.tResource.navigation |
||||
|
).MenuData; |
||||
|
} else { |
||||
|
// that.$message.error(response.data.content);
|
||||
|
} |
||||
|
}) |
||||
|
.catch((res) => { |
||||
|
console.log(res) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 根据图书主表Id和图书资源主表Id获取图书资源信息并获取进度【New】
|
||||
|
let GetResourceAndUsedByResourceId = () => { |
||||
|
let that = data; |
||||
|
let param = { |
||||
|
BaseId: that.ebookId, |
||||
|
ResourceId: that.ResourceId |
||||
|
} |
||||
|
proxy.$http |
||||
|
.get(proxy.$API.GETRESOURCEANDUSEDBYRESOURCEID, |
||||
|
{ |
||||
|
params: param |
||||
|
} |
||||
|
) |
||||
|
.then(res => { |
||||
|
if (res.type == 200) { |
||||
|
let resData = res.data; |
||||
|
if (that.keyId == "reading") { |
||||
|
if (resData.tUsed.length == 0) { |
||||
|
that.ItemIndex = 0; |
||||
|
GetListAndUpdateUsed( |
||||
|
that.directoryList[0].Key, |
||||
|
that.directoryList[0].Title |
||||
|
); |
||||
|
} else { |
||||
|
that.directoryList.forEach((e, index) => { |
||||
|
if (e.Key == resData.tUsed[0].scheduleOne) { |
||||
|
that.ItemIndex = index; |
||||
|
} |
||||
|
}); |
||||
|
GetListAndUpdateUsed( |
||||
|
resData.tUsed[0].scheduleOne, |
||||
|
resData.tUsed[0].scheduleOneTitle |
||||
|
); |
||||
|
} |
||||
|
} else { |
||||
|
that.directoryList.forEach((e, index) => { |
||||
|
if (e.Key == that.keyId) { |
||||
|
that.ItemIndex = index; |
||||
|
GetListAndUpdateUsed(e.Key, e.Title); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
console.log(resData); |
||||
|
} else { |
||||
|
//that.message = res.data.content
|
||||
|
//that.messageShow = true;
|
||||
|
} |
||||
|
}) |
||||
|
.catch((res) => { |
||||
|
console.log(res) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
const actions = { |
||||
|
getBookBase({ commit, state }) { |
||||
|
console.log(77) |
||||
|
let Authorization = ""; |
||||
|
if (that.userData) { |
||||
|
const userData = JSON.parse(that.userData) || ""; |
||||
|
console.log(userData) |
||||
|
if (userData) { |
||||
|
Authorization = "Bearer " + userData.token; |
||||
|
} |
||||
|
} |
||||
|
console.log(Authorization) |
||||
|
return $http.get(API.GETBASEANDDETAILSID,{ |
||||
|
params: { |
||||
|
BaseId: that.ebookId |
||||
|
}, |
||||
|
headers: { |
||||
|
Authorization: Authorization |
||||
|
} |
||||
|
}) |
||||
|
.then(res => { |
||||
|
console.log(res) |
||||
|
if (res.type == 200) { |
||||
|
//commit('GETBOOKBASEDATA', res.data)
|
||||
|
let resData = res.data; |
||||
|
that.directoryList = JSON.parse( |
||||
|
resData.tResource.navigation |
||||
|
).MenuData; |
||||
|
// console.log(that.directoryList);
|
||||
|
GetResourceAndUsedByResourceId(); |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
state, |
||||
|
mutations, |
||||
|
actions, |
||||
|
getters |
||||
|
} |
||||
@ -0,0 +1,58 @@ |
|||||
|
import { defineConfig } from 'vite' |
||||
|
import vue from '@vitejs/plugin-vue' |
||||
|
import path from 'path' |
||||
|
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' |
||||
|
|
||||
|
const baseUrl = { |
||||
|
development: './', |
||||
|
beta: './', |
||||
|
release: './' |
||||
|
} |
||||
|
|
||||
|
// https://vitejs.dev/config/
|
||||
|
export default ({ mode }) => defineConfig({ |
||||
|
plugins: [ |
||||
|
vue(), |
||||
|
createSvgIconsPlugin({ |
||||
|
// 指定需要缓存的图标文件夹
|
||||
|
iconDirs: [path.resolve(process.cwd(), 'src/assets/img/icons')], |
||||
|
// 指定symbolId格式
|
||||
|
symbolId: 'icon-[name]', |
||||
|
}), |
||||
|
], |
||||
|
base: baseUrl[mode], |
||||
|
build: { |
||||
|
minify: 'terser', |
||||
|
terserOptions: { |
||||
|
compress: { |
||||
|
// 生产环境打包移除console
|
||||
|
drop_console: true, |
||||
|
drop_debugger: true, |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
resolve: { |
||||
|
alias: { |
||||
|
'~': path.resolve(__dirname, './'), |
||||
|
'@': path.resolve(__dirname, 'src'), |
||||
|
'@assets': path.resolve(__dirname, 'src/assets'), |
||||
|
} |
||||
|
}, |
||||
|
css: { |
||||
|
preprocessorOptions: { |
||||
|
less: { |
||||
|
additionalData: '@import "./src/assets/style/global.less";' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
server: { |
||||
|
port: 8089, |
||||
|
proxy: { |
||||
|
'/api': { |
||||
|
target: 'http://192.168.99.111:5001', |
||||
|
changeOrigin: true, |
||||
|
rewrite: path => path.replace(/^\/api/, '') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}) |
||||