mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-07-28 05:00:41 +08:00
Compare commits
33 Commits
v1.0.0-beta
..
v1.0
| Author | SHA1 | Date | |
|---|---|---|---|
| a81c506a14 | |||
| 70dc7cd0a7 | |||
| ee28753094 | |||
| 91923c0b42 | |||
| f6feecb324 | |||
| 6fdaeed792 | |||
| f838da43d8 | |||
| 21d723d260 | |||
| d701867b83 | |||
| 66f4ccffc0 | |||
| 9720743c80 | |||
| 6ba87b1972 | |||
| a0f3d1b220 | |||
| 6e80fa14c8 | |||
| 22a8e92dc2 | |||
| 6b1e0e5cc0 | |||
| 261617fc12 | |||
| 5000da9a64 | |||
| 9573b303e2 | |||
| f12262f4df | |||
| 1305b4a555 | |||
| b7e2025ebb | |||
| 0da5feb2ee | |||
| e46c5c2b6f | |||
| 70c5b34de0 | |||
| 9d3ebac076 | |||
| 3fd3b2247a | |||
| 3702cb1618 | |||
| 473655171b | |||
| 9e2f090747 | |||
| e05d0d7ce5 | |||
| 3ba10fa105 | |||
| acc9070134 |
@@ -2,4 +2,5 @@ node_modules/
|
|||||||
unpackage/
|
unpackage/
|
||||||
config/halo.config.js
|
config/halo.config.js
|
||||||
config/ad.config.js
|
config/ad.config.js
|
||||||
|
config/love.config.js
|
||||||
package-lock.json
|
package-lock.json
|
||||||
@@ -10,6 +10,14 @@
|
|||||||
{
|
{
|
||||||
"launchtype" : "local"
|
"launchtype" : "local"
|
||||||
},
|
},
|
||||||
|
"h5" :
|
||||||
|
{
|
||||||
|
"launchtype" : "local"
|
||||||
|
},
|
||||||
|
"mp-qq" :
|
||||||
|
{
|
||||||
|
"launchtype" : "local"
|
||||||
|
},
|
||||||
"mp-weixin" :
|
"mp-weixin" :
|
||||||
{
|
{
|
||||||
"launchtype" : "local"
|
"launchtype" : "local"
|
||||||
|
|||||||
@@ -64,14 +64,10 @@ export default {
|
|||||||
@import './common/icons/mphtmliconfont.css';
|
@import './common/icons/mphtmliconfont.css';
|
||||||
|
|
||||||
/* #ifndef MP-WEIXIN */
|
/* #ifndef MP-WEIXIN */
|
||||||
@import './common/markdown/markdown.scss'; //引入markdown呈现
|
@import './common/markdown/markdown.scss';
|
||||||
/* #endif */
|
/* #endif */
|
||||||
|
|
||||||
page {
|
page {
|
||||||
// background-color: #f3f5f7;
|
|
||||||
// background-color: #f7f7f7;
|
|
||||||
// background-color: #ffffff;
|
|
||||||
background-color: #fafafa;
|
background-color: #fafafa;
|
||||||
// background-color: #f4f5f5;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,20 +1,661 @@
|
|||||||
The MIT License (MIT)
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 19 November 2007
|
||||||
|
|
||||||
Copyright (c) 2018 RuoYi
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
Preamble
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
|
||||||
the Software without restriction, including without limitation the rights to
|
|
||||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
copies or substantial portions of the Software.
|
software and other kinds of works, specifically designed to ensure
|
||||||
|
cooperation with the community in the case of network server software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
The licenses for most software and other practical works are designed
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
to take away your freedom to share and change the works. By contrast,
|
||||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
our General Public Licenses are intended to guarantee your freedom to
|
||||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
share and change all versions of a program--to make sure it remains free
|
||||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
software for all its users.
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
Developers that use our General Public Licenses protect your rights
|
||||||
|
with two steps: (1) assert copyright on the software, and (2) offer
|
||||||
|
you this License which gives you legal permission to copy, distribute
|
||||||
|
and/or modify the software.
|
||||||
|
|
||||||
|
A secondary benefit of defending all users' freedom is that
|
||||||
|
improvements made in alternate versions of the program, if they
|
||||||
|
receive widespread use, become available for other developers to
|
||||||
|
incorporate. Many developers of free software are heartened and
|
||||||
|
encouraged by the resulting cooperation. However, in the case of
|
||||||
|
software used on network servers, this result may fail to come about.
|
||||||
|
The GNU General Public License permits making a modified version and
|
||||||
|
letting the public access it on a server without ever releasing its
|
||||||
|
source code to the public.
|
||||||
|
|
||||||
|
The GNU Affero General Public License is designed specifically to
|
||||||
|
ensure that, in such cases, the modified source code becomes available
|
||||||
|
to the community. It requires the operator of a network server to
|
||||||
|
provide the source code of the modified version running there to the
|
||||||
|
users of that server. Therefore, public use of a modified version, on
|
||||||
|
a publicly accessible server, gives the public access to the source
|
||||||
|
code of the modified version.
|
||||||
|
|
||||||
|
An older license, called the Affero General Public License and
|
||||||
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
|
this license.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the
|
||||||
|
Program, your modified version must prominently offer all users
|
||||||
|
interacting with it remotely through a computer network (if your version
|
||||||
|
supports such interaction) an opportunity to receive the Corresponding
|
||||||
|
Source of your version by providing access to the Corresponding Source
|
||||||
|
from a network server at no charge, through some standard or customary
|
||||||
|
means of facilitating copying of software. This Corresponding Source
|
||||||
|
shall include the Corresponding Source for any work covered by version 3
|
||||||
|
of the GNU General Public License that is incorporated pursuant to the
|
||||||
|
following paragraph.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the work with which it is combined will remain governed by version
|
||||||
|
3 of the GNU General Public License.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU Affero General Public License from time to time. Such new versions
|
||||||
|
will be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU Affero General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU Affero General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU Affero General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<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 Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If your software can interact with users remotely through a computer
|
||||||
|
network, you should also make sure that it provides a way for users to
|
||||||
|
get its source. For example, if your program is a web application, its
|
||||||
|
interface could display a "Source" link that leads users to an archive
|
||||||
|
of the code. There are many ways you could offer source, and different
|
||||||
|
solutions will be better for different programs; see section 13 for the
|
||||||
|
specific requirements.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center"><b>uni-halo</b> 基于Halo一款现代化的开源博客/CMS系统API开发的多端系统,值得一试。</p>
|
<p align="center"><b>【uni-halo】</b> 基于 uniapp + Halo API 开发的多端项目,值得一试。</p>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<p align="center">
|
<p align="center">
|
||||||
@@ -16,95 +16,107 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
如果您觉得这个项目对您有帮助,可以帮作者买杯饮料鼓励鼓励!
|
如果您觉得这个项目对您有帮助,可以帮作者买杯饮料鼓励鼓励,同时为了项目能够持续发展,可以根据您的喜好支持一下本项目哦,非常感谢您的支持,作者也会更有动力持续维护和更新新的功能哦~
|
||||||
|
|
||||||
<table rules="none" align="center" border="0">
|
|支付宝 |微信 |QQ |
|
||||||
<tr>
|
|:--: |:--: |:--: |
|
||||||
<td>
|
|| | |
|
||||||
<center>
|
|
||||||
<img src="https://uni-halo.925i.cn/qrcode/zfb.png" width="100%" />
|
|
||||||
<br/>
|
|
||||||
<font color="AAAAAA">支付宝打赏</font>
|
|
||||||
</center>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<center>
|
|
||||||
<img src="https://uni-halo.925i.cn/qrcode/wx.png" width="100%" />
|
|
||||||
<br/>
|
|
||||||
<font color="AAAAAA">微信打赏</font>
|
|
||||||
</center>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<center>
|
|
||||||
<img src="https://uni-halo.925i.cn/qrcode/qq.png" width="100%" />
|
|
||||||
<br/>
|
|
||||||
<font color="AAAAAA">QQ打赏</font>
|
|
||||||
</center>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
## 🧐 功能介绍
|
||||||
|
|
||||||
## 🌸 快速开始
|
#### 🍻 基础功能
|
||||||
|
|
||||||
详细部署文档请查阅 [uni-halo-doc](https://uni-halo.925i.cn/)
|
几乎实现PC端后台的全功能,让您在手机端也可以管理您的博客。
|
||||||
|
|
||||||
- 1、拉取或下载项目<https://gitee.com/ialley-workshop-open/uni-halo>;
|
- 用户端:文章列表、文章分类、文章详情、图库、留言板、友链、个人日记等
|
||||||
- 2、通过hbuilderx 导入项目;
|
- 管理端:资料修改、密码修改、日记管理、文章管理、分类管理、标签管理、附件管理、友链管理、评论管理、日志管理等
|
||||||
- 3、命令行执行 npm i 安装依赖;
|
|
||||||
- 4、配置运行信息,找到项目根目录config目录,将`halo.config.template.js`修改为 `halo.config.js` 并设置相关信息;
|
|
||||||
- 5、点击hbuilderx 工具 右上角预览、或者点击工具栏 运行-内置浏览器运行;
|
|
||||||
- 6、项目发行:
|
|
||||||
- 发行小程序:点击工具栏 发行 -> 小程序-微信
|
|
||||||
- 发行APP: 点击工具栏 发行 -> 原生App-云打包
|
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
## ⭐️ 功能清单
|
#### 💞 特色功能
|
||||||
|
|
||||||
### 用户部分
|
- 恋爱日记:精心为您设计了秀恩爱的模块,秀出关于你们的故事、情侣甜蜜相册、恋爱记录清单,为您的恋爱保驾护航。
|
||||||
1. - [x] 文章分类
|
|
||||||
2. - [x] 文章详情&海报分享
|
|
||||||
3. - [x] 文章归档
|
|
||||||
4. - [x] 文章列表和搜索
|
|
||||||
5. - [x] 数据统计展示
|
|
||||||
6. - [x] 图库
|
|
||||||
7. - [x] 友链
|
|
||||||
8. - [x] 留言板
|
|
||||||
9. - [x] 个人日记
|
|
||||||
|
|
||||||
### 管理部分
|
<br/>
|
||||||
1. - [x] 个人信息修改
|
|
||||||
2. - [x] 个人密码修改
|
|
||||||
3. - [x] 日记管理
|
|
||||||
4. - [x] 文章管理
|
|
||||||
5. - [x] 分类管理
|
|
||||||
6. - [x] 标签管理
|
|
||||||
7. - [x] 附件管理
|
|
||||||
8. - [x] 友链管理
|
|
||||||
9. - [x] 图库管理
|
|
||||||
10. - [x] 评论管理
|
|
||||||
11. - [x] 日志管理
|
|
||||||
12. - [ ] 菜单设置
|
|
||||||
13. - [ ] 系统设置
|
|
||||||
|
|
||||||
## 📃 TODO
|
## 😎 文档源码
|
||||||
1. - [ ] 暗黑模式
|
|
||||||
2. - [ ] 国际化
|
|
||||||
|
|
||||||
|
- 作者博客:[https://b.925i.cn/](https://b.925i.cn/)
|
||||||
|
- 官方文档:[https://uni-halo.925i.cn/](https://uni-halo.925i.cn/)
|
||||||
|
- Gitee :[https://gitee.com/ialley-workshop-open/uni-halo](https://gitee.com/ialley-workshop-open/uni-halo)
|
||||||
|
- Github :[https://github.com/ialley-workshop-open/uni-halo](https://github.com/ialley-workshop-open/uni-halo)
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
## 🌈 在线体验
|
## 😏 在线体验
|
||||||
|
|
||||||
- 敬请期待...
|
说明:微信扫码、或搜索【小莫唐尼】即可在线体验已上线小程序!!!
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
## 😘 界面预览
|
||||||
|
|
||||||
|
##### 📱 用户端
|
||||||
|
|
||||||
|
说明:以下仅为部分截图
|
||||||
|
|
||||||
|
|首页|分类|图库|友链|
|
||||||
|
|:--:|:--:|:--:|:--:|
|
||||||
|
|||||
|
||||||
|
|
||||||
|
|我的|归档|详情|留言板|
|
||||||
|
|:--:|:--:|:--:|:--:|
|
||||||
|
|||||
|
||||||
|
|
||||||
|
##### 💻 管理端
|
||||||
|
|
||||||
|
说明:以下仅为部分截图
|
||||||
|
|
||||||
|
|后台首页|文章管理|
|
||||||
|
|:--:|:--:|
|
||||||
|
|||
|
||||||
|
|
||||||
|
##### 📱 恋爱日记
|
||||||
|
|
||||||
|
说明:以下仅为部分截图
|
||||||
|
|
||||||
|
|主页 |恋爱相册 |恋爱清单 |
|
||||||
|
|:--: |:--: |-- |
|
||||||
|
| | | |
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
## 🙋 使用交流
|
||||||
|
|
||||||
|
- 提交 issues:[Github Issues](https://github.com/ialley-workshop-open/uni-halo/issues) 丨 [Gitee Issues](https://gitee.com/ialley-workshop-open/uni-halo/issues)
|
||||||
|
- 微信交流群:由于微信交流群时效性太短,所以有需要的话可以先加入QQ群,再邀请进微信群
|
||||||
|
- QQ 交流群:632969367
|
||||||
|
- 快速加群:[](https://qm.qq.com/cgi-bin/qm/qr?k=cuam7lhrB_vHuvjw2mzUO1sOKdF9KRyM&jump_from=webapi&authKey=d6bJhNaqupTTfoMDWDIeYUTAs44Ax7p64SsM/5NRtFhXE09YexDO15Izuyth6XAi)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
## 🎉 加入我们
|
||||||
|
|
||||||
|
uni-halo 还在持续更新中,本项目欢迎您的参与,共同维护,逐步完善,将项目做得更强。项目采用 AGPL-3.0 开源协议,本着一切免费的原则,原则上不会收取任何费用及版权,可以放心使用。
|
||||||
|
|
||||||
|
如果你想加入我们,可以多提供一些好的建议或者提交 pr,我们将会非常乐意接受您的建议和意见。
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
## 🔍 开源许可
|
||||||
## 🔍 许可证
|
|
||||||
<a href="https://gitee.com/ialley-workshop-open/uni-halo/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
|
|
||||||
uni-halo 使用 MIT 协议开源,请遵守开源协议。
|
|
||||||
|
|
||||||
## 🏭 贡献
|
uni-halo 使用 AGPL-3.0 协议开源,请遵守开源协议。
|
||||||
|
|
||||||
贡献代码请查看 [代码贡献规范](https://uni-halo.925i.cn/standard/category.html)
|
<br/>
|
||||||
|
|
||||||
## 🙆♂ Halo
|
## 🙋 致谢
|
||||||
- 接口文档地址(内容端):<https://api.halo.run/content-api.html>
|
uni-halo 得益于以下优秀的技术支撑,我只是站在巨人的肩膀上捡了几根头发丝,但是非常感谢这些优秀的项目,带给了我们其他开发者和用户非常友好的体验!
|
||||||
- 接口文档地址(管理端):<https://api.halo.run/admin-api.html>
|
|
||||||
|
- [Halo:一款好用又强大的开源建站工具](https://halo.run/)
|
||||||
|
- [uni-app:是一个使用 Vue.js 开发所有前端应用的框架,开发者编写一套代码可编译到多个平台](https://uniapp.dcloud.net.cn/)
|
||||||
|
- [tm-vuetify:是一个为 uni-app 平台定制的颜值也非常高的 UI 框架](https://www.jx2d.cn/)
|
||||||
|
- [mp-html:一个强大的小程序富文本组件](https://jin-yufeng.gitee.io/mp-html/#/)
|
||||||
@@ -24,6 +24,7 @@ const createOrEditModel = {
|
|||||||
"value": "string"
|
"value": "string"
|
||||||
}],
|
}],
|
||||||
"originalContent": "string",
|
"originalContent": "string",
|
||||||
|
"formatContent": "",
|
||||||
"password": "string",
|
"password": "string",
|
||||||
"slug": "string",
|
"slug": "string",
|
||||||
"status": "DRAFT",
|
"status": "DRAFT",
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import HttpHandler from '@/common/http/request.js'
|
import HttpHandler from '@/common/http/request.js'
|
||||||
|
import { getCache } from '@/utils/storage.js'
|
||||||
export default {
|
export default {
|
||||||
/**
|
/**
|
||||||
* 查询分类列表
|
* 查询分类列表
|
||||||
@@ -19,6 +20,8 @@ export default {
|
|||||||
* @param {Object} params 查询参数
|
* @param {Object} params 查询参数
|
||||||
*/
|
*/
|
||||||
getCategoryPostList: (slug, params) => {
|
getCategoryPostList: (slug, params) => {
|
||||||
|
// 从缓存中根据分类获取密码,如果获取到了说明本分类需要密码,避免多个分类需要密码在输入密码后刷新页面点错了分类
|
||||||
|
params.password = getCache('APP_CATEGORY_PWD_' + slug)
|
||||||
return HttpHandler.Get(`/api/content/categories/${slug}/posts`, params)
|
return HttpHandler.Get(`/api/content/categories/${slug}/posts`, params)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import archive from './archive.js'
|
|||||||
import article from './article.js'
|
import article from './article.js'
|
||||||
import blogger from './blogger.js'
|
import blogger from './blogger.js'
|
||||||
import category from './category.js'
|
import category from './category.js'
|
||||||
|
import tag from './tag.js'
|
||||||
import comment from './comment.js'
|
import comment from './comment.js'
|
||||||
import journal from './journal.js'
|
import journal from './journal.js'
|
||||||
import link from './link.js'
|
import link from './link.js'
|
||||||
@@ -44,6 +45,7 @@ const ApiManager = {
|
|||||||
...article,
|
...article,
|
||||||
...blogger,
|
...blogger,
|
||||||
...category,
|
...category,
|
||||||
|
...tag,
|
||||||
...comment,
|
...comment,
|
||||||
...journal,
|
...journal,
|
||||||
...link,
|
...link,
|
||||||
|
|||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 标签接口
|
||||||
|
* @see https://api.halo.run/content-api.html#tag/tag-controller
|
||||||
|
*/
|
||||||
|
|
||||||
|
import HttpHandler from '@/common/http/request.js'
|
||||||
|
export default {
|
||||||
|
/**
|
||||||
|
* 查询标签列表
|
||||||
|
* @param {Object} params 查询参数
|
||||||
|
*/
|
||||||
|
getTagList: (params) => {
|
||||||
|
return HttpHandler.Get('/api/content/tags', params)
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询标签下的文章
|
||||||
|
* @param {String} slug 别名
|
||||||
|
* @param {Object} params 查询参数
|
||||||
|
*/
|
||||||
|
getTagPostsList: (slug, params) => {
|
||||||
|
return HttpHandler.Get(`/api/content/tags/${slug}/posts`, params)
|
||||||
|
},
|
||||||
|
}
|
||||||
+87
-18
@@ -13,8 +13,54 @@ import {
|
|||||||
getAdminAccessToken
|
getAdminAccessToken
|
||||||
} from "@/utils/auth.js";
|
} from "@/utils/auth.js";
|
||||||
import {
|
import {
|
||||||
delCache
|
delCache,
|
||||||
|
setCache
|
||||||
} from "@/utils/storage";
|
} from "@/utils/storage";
|
||||||
|
|
||||||
|
const getCategoryNameByUrl = (url) => {
|
||||||
|
const reg = '(?<=/api/content/categories/).+(?=/posts)'
|
||||||
|
return url.match(reg)[0] || '无分类名'
|
||||||
|
}
|
||||||
|
const showCategoryInputPasswordModal = (response, category) => {
|
||||||
|
uni.showModal({
|
||||||
|
title: `[ ${category} ] 分类已加密`, // TODO 这里应该获取分类的名字,可以在弹窗之前请求后台拿到所有分类根据分类code拿到名称,但是不会在这之前发送请求
|
||||||
|
content: '',
|
||||||
|
editable: true,
|
||||||
|
placeholderText: '请输入分类密码后访问',
|
||||||
|
confirmText: '验证密码',
|
||||||
|
cancelText: '暂不访问',
|
||||||
|
showCancel: true,
|
||||||
|
cancelColor: '#999999',
|
||||||
|
confirmColor: '#03a9f4',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
// TODO 这里如果没有输入密码点击确认应该阻止窗口关闭,但是没找到方法
|
||||||
|
if (!res.content) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '提示:请输入密码',
|
||||||
|
icon: 'none',
|
||||||
|
success: () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
showCategoryInputPasswordModal(response, category);
|
||||||
|
}, 800)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 根据请求URL正则匹配分类code,然后把输入的密码根据分类code放入缓存,然后在category.getCategoryPostList中获取,解决多个分类加密输入密码后点错的问题
|
||||||
|
// 目前存在一个问题,比如前两个都需要密码,如果先输入第二个的密码之后,重新进来默认打开第一个还会弹窗,所以想在弹窗标题上增加分类名字
|
||||||
|
// 另外有以下两种方式科技解决
|
||||||
|
// TODO 1.其实这里获取到密码之后可以直接发送一个请求追加上password参数,因为后台会缓存权限,后续不输入密码也可以访问,可惜不会
|
||||||
|
// TODO 2.另外也可以拿到密码之后,直接选中该分类追加password参数,重新请求,可惜也不会
|
||||||
|
setCache('APP_CATEGORY_PWD_' + category, res.content)
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/tabbar/category/category'
|
||||||
|
});
|
||||||
|
} else if (res.cancel) {}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export const setInterceptors = (http) => {
|
export const setInterceptors = (http) => {
|
||||||
http.interceptors.request.use(
|
http.interceptors.request.use(
|
||||||
(config) => {
|
(config) => {
|
||||||
@@ -57,28 +103,51 @@ export const setInterceptors = (http) => {
|
|||||||
message: 'API接口服务异常!'
|
message: 'API接口服务异常!'
|
||||||
})
|
})
|
||||||
} else if (response.data.status == 401) {
|
} else if (response.data.status == 401) {
|
||||||
delCache('APP_ADMIN_LOGIN_TOKEN');
|
uni.$tm.toast(response.data.message);
|
||||||
uni.$eShowModal({
|
// 如果是请求分类之后报401说明密码错误,那么清除该密码,下次点击会报403弹窗再次输入密码
|
||||||
title: '提示',
|
if (response.config.url.indexOf('/api/content/categories') >= 0) {
|
||||||
content: '您未登录超管账号或登录已过期,是否重新登录?',
|
const category = getCategoryNameByUrl(response.config.url)
|
||||||
showCancel: true,
|
delCache('APP_CATEGORY_PWD_' + category);
|
||||||
cancelText: '否',
|
uni.showToast({
|
||||||
cancelColor: '#999999',
|
title: '提示:密码不正确',
|
||||||
confirmText: '是',
|
icon: 'none',
|
||||||
confirmColor: '#03a9f4'
|
success: () => {
|
||||||
}).then(res => {
|
setTimeout(() => {
|
||||||
uni.navigateTo({
|
showCategoryInputPasswordModal(response, category);
|
||||||
url: '/pagesB/login/login'
|
}, 800)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}).catch(err => {
|
} else {
|
||||||
uni.switchTab({
|
// 其他情况维持原来的逻辑
|
||||||
url: '/pages/tabbar/about/about'
|
delCache('APP_ADMIN_LOGIN_TOKEN');
|
||||||
|
uni.$eShowModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '您未登录超管账号或登录已过期,是否重新登录?',
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '否',
|
||||||
|
cancelColor: '#999999',
|
||||||
|
confirmText: '是',
|
||||||
|
confirmColor: '#03a9f4'
|
||||||
|
}).then(res => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesB/login/login'
|
||||||
|
})
|
||||||
|
}).catch(err => {
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/tabbar/about/about'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
|
} else if (response.data.status == 403) {
|
||||||
|
// 如果报403是请求分类文章接口(您没有该分类的访问权限)的话说明是私密分类,需要输入密码请求
|
||||||
|
if (response.config.url.indexOf('/api/content/categories') >= 0) {
|
||||||
|
const category = getCategoryNameByUrl(response.config.url);
|
||||||
|
showCategoryInputPasswordModal(response, category);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return Promise.reject(response.data);
|
return Promise.reject(response.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -44,53 +44,53 @@ export default {
|
|||||||
color: var(--main);
|
color: var(--main);
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
position: relative;
|
position: relative;
|
||||||
font-size:1.25em;
|
font-size:1.2em;
|
||||||
`,
|
`,
|
||||||
h2: `
|
h2: `
|
||||||
color: var(--main);
|
color: var(--main);
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 22px 0 16px;
|
margin: 22px 0 16px;
|
||||||
font-size: 1.2em;
|
font-size: 1.16em;
|
||||||
`,
|
`,
|
||||||
h3: `
|
h3: `
|
||||||
color: var(--main);
|
color: var(--main);
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 26px 0 18px;
|
margin: 26px 0 18px;
|
||||||
font-size: 1.3em;
|
font-size: 1.14em;
|
||||||
`,
|
`,
|
||||||
h4: `
|
h4: `
|
||||||
color: var(--main);
|
color: var(--main);
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
margin-bottom: 18px;
|
margin-bottom: 18px;
|
||||||
position: relative;
|
position: relative;
|
||||||
font-size: 1.18em;
|
font-size: 1.12em;
|
||||||
`,
|
`,
|
||||||
h5: `
|
h5: `
|
||||||
color: var(--main);
|
color: var(--main);
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
margin-bottom: 14px;
|
margin-bottom: 14px;
|
||||||
position: relative;
|
position: relative;
|
||||||
font-size: 1em;
|
font-size: 1.1em;
|
||||||
`,
|
`,
|
||||||
h6: `
|
h6: `
|
||||||
color: #303133;
|
color: #303133;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
margin-bottom: 14px;
|
margin-bottom: 14px;
|
||||||
position: relative;
|
position: relative;
|
||||||
font-size: 1em;
|
font-size: 14px;
|
||||||
`,
|
`,
|
||||||
p: `
|
p: `
|
||||||
line-height: 1.65;
|
line-height: 1.65;
|
||||||
margin-bottom: 14px;
|
margin-bottom: 14px;
|
||||||
font-size: 15px;
|
font-size: 14px;
|
||||||
`,
|
`,
|
||||||
'code': ` `,
|
'code': ` `,
|
||||||
strong: 'font-weight: 700;color: rgb(248, 57, 41);',
|
strong: 'font-weight: 700;color: rgb(248, 57, 41);',
|
||||||
video: 'width: 100%',
|
video: 'width: 100%',
|
||||||
},
|
},
|
||||||
containStyle: 'font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif;padding:12px;font-size: 16px;color: #606266;word-spacing: 0.8px;letter-spacing: 0.8px;border-radius: 6px;background-color:#FFFFFF;',
|
containStyle: 'font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif;padding:12px;font-size: 14px;color: #606266;word-spacing: 0.8px;letter-spacing: 0.8px;border-radius: 6px;background-color:#FFFFFF;',
|
||||||
|
|
||||||
loadingGif: HaloConfig.loadingGifUrl,
|
loadingGif: HaloConfig.loadingGifUrl,
|
||||||
emptyGif: HaloConfig.loadingEmptyUrl,
|
emptyGif: HaloConfig.loadingEmptyUrl,
|
||||||
|
|||||||
+26
-4
@@ -18,15 +18,31 @@ export default {
|
|||||||
return {
|
return {
|
||||||
author: HaloConfig.author,
|
author: HaloConfig.author,
|
||||||
_isWechat: true,
|
_isWechat: true,
|
||||||
haloAdConfig: HaloAdConfig
|
haloAdConfig: HaloAdConfig,
|
||||||
|
_aniWaitIndex: 0, // 动画索引
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// 获取全局应用设置
|
// 获取全局应用设置
|
||||||
globalAppSettings() {
|
globalAppSettings() {
|
||||||
return uni.$tm.vx.getters().setting.getSettings;
|
return uni.$tm.vx.getters().getSettings;
|
||||||
|
},
|
||||||
|
// 计算动画索引
|
||||||
|
calcAniWait() {
|
||||||
|
return (index) => {
|
||||||
|
if ((index + 1) % 10 == 0) {
|
||||||
|
this._aniWaitIndex = 1;
|
||||||
|
} else {
|
||||||
|
this._aniWaitIndex += 1;
|
||||||
|
}
|
||||||
|
console.log('this._aniWaitIndex', this._aniWaitIndex);
|
||||||
|
return this._aniWaitIndex * 50
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.fnResetSetAniWaitIndex()
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
this._isWechat = true;
|
this._isWechat = true;
|
||||||
@@ -36,7 +52,9 @@ export default {
|
|||||||
this._isWechat = false;
|
this._isWechat = false;
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
this.fnResetSetAniWaitIndex()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 设置页面标题
|
* 设置页面标题
|
||||||
@@ -60,8 +78,12 @@ export default {
|
|||||||
console.log('err:', err);
|
console.log('err:', err);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
// 初始化动画索引值(需要在每个页面调用)
|
||||||
|
fnResetSetAniWaitIndex() {
|
||||||
|
this._aniWaitIndex = 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
// 微信分享配置
|
||||||
|
import haloConfig from '@/config/halo.config.js'
|
||||||
|
import { jsonToUrlParams2 } from '@/utils/url.params.js'
|
||||||
|
export const haloWxShareMixin = {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
haloWxShareData: {
|
||||||
|
...haloConfig.wxShareConfig
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//#ifdef MP-WEIXIN
|
||||||
|
onShareAppMessage(res) {
|
||||||
|
return {
|
||||||
|
...this.haloWxShareData,
|
||||||
|
success: res => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//#endif
|
||||||
|
/* 分享到微信好友 */
|
||||||
|
onShareAppMessage(res) {
|
||||||
|
const promise = new Promise(resolve => {
|
||||||
|
setTimeout(() => {
|
||||||
|
resolve({
|
||||||
|
title: this.haloWxShareData.title,
|
||||||
|
path: this.haloWxShareData.path,
|
||||||
|
})
|
||||||
|
}, 2000)
|
||||||
|
})
|
||||||
|
return {
|
||||||
|
title: this.haloWxShareData.title,
|
||||||
|
path: '',
|
||||||
|
promise
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 分享到朋友圈-这里封装不够,在页面还要声明一次,否则是拿不到参数的,被分享者在朋友圈打开链接是空的
|
||||||
|
onShareTimeline: function() {
|
||||||
|
return {
|
||||||
|
title: this.haloWxShareData.title,
|
||||||
|
query: {},
|
||||||
|
imageUrl: this.haloWxShareData.imageUrl,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 设置分享信息(需要在页面调用)
|
||||||
|
fnSetWxShareConfig(config = {}) {
|
||||||
|
let currentRoutes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
||||||
|
let currentRoute = currentRoutes[currentRoutes.length - 1].route; //获取当前页面路由(分销思路,分享者点开使用的小程序将获取到分享者的id)
|
||||||
|
let sharePath = currentRoutes
|
||||||
|
if (config.params) {
|
||||||
|
const URLParams = config.params ? jsonToUrlParams2(config.params) : {};
|
||||||
|
sharePath += URLParams
|
||||||
|
}
|
||||||
|
let _config = Object.assign({}, {
|
||||||
|
path: sharePath,
|
||||||
|
copyLink: haloConfig.apiUrl,
|
||||||
|
query: {}
|
||||||
|
}, config)
|
||||||
|
|
||||||
|
uni.$tm.vx.commit('setWxShare', _config);
|
||||||
|
this.haloWxShareData = _config;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,3 +36,139 @@
|
|||||||
transform: rotateZ(360deg);
|
transform: rotateZ(360deg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 自定义广告
|
||||||
|
|
||||||
|
.ad-card {
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 24rpx;
|
||||||
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
|
||||||
|
&.is-lr {
|
||||||
|
display: flex;
|
||||||
|
.ad-card_tip {
|
||||||
|
top: initial;
|
||||||
|
left: 288rpx;
|
||||||
|
bottom: 24rpx;
|
||||||
|
// right: 160rpx;
|
||||||
|
padding: 4rpx 20rpx;
|
||||||
|
background-color: transparent;
|
||||||
|
border: 2rpx solid #607d8b;
|
||||||
|
color: #607d8b;
|
||||||
|
}
|
||||||
|
.ad-card_cover {
|
||||||
|
width: 240rpx;
|
||||||
|
height: 180rpx;
|
||||||
|
animation: adLinkAni 1s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
.ad-card_info {
|
||||||
|
width: 0;
|
||||||
|
flex-grow: 1;
|
||||||
|
padding-left: 24rpx;
|
||||||
|
&-title {
|
||||||
|
margin-top: 0;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
&-link {
|
||||||
|
top: initial;
|
||||||
|
// right: 150rpx;
|
||||||
|
bottom: 0;
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&_tip {
|
||||||
|
position: absolute;
|
||||||
|
left: 36rpx;
|
||||||
|
top: 36rpx;
|
||||||
|
display: inline-flex;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
padding: 4rpx 10rpx;
|
||||||
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
&_cover {
|
||||||
|
width: 100%;
|
||||||
|
height: 300rpx;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
}
|
||||||
|
&_info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
&-title {
|
||||||
|
width: calc(100% - 120rpx);
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
&-desc {
|
||||||
|
margin-top: 6rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #616161;
|
||||||
|
line-height: 1.8;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
}
|
||||||
|
&-link {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 6rpx;
|
||||||
|
display: inline-flex;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
padding: 4rpx 10rpx;
|
||||||
|
border: 2rpx solid #03a9f4;
|
||||||
|
color: #03a9f4;
|
||||||
|
font-size: 24rpx;
|
||||||
|
transform: scale(0.93);
|
||||||
|
// animation: adLinkAni 0.8s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes adLinkAni {
|
||||||
|
0% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: scale(1.02);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 文本省略样式 开始 */
|
||||||
|
.text-sub-one {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 多行文本省略 */
|
||||||
|
@for $i from 2 through 30 {
|
||||||
|
.text-sub-more-#{$i} {
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: $i;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 文本省略样式 结束 */
|
||||||
|
|||||||
@@ -1,18 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="article-card " :class="cardType" @click="fnClickEvent('card')">
|
<view class="article-card " :class="cardType" @click="fnClickEvent('card')">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<cache-image
|
<cache-image class="thumbnail" radius="6rpx" :url="$utils.checkThumbnailUrl(article.thumbnail)" :fileMd5="$utils.checkThumbnailUrl(article.thumbnail)" mode="aspectFill"></cache-image>
|
||||||
class="thumbnail"
|
|
||||||
radius="12rpx"
|
|
||||||
:url="$utils.checkThumbnailUrl(article.thumbnail)"
|
|
||||||
:fileMd5="$utils.checkThumbnailUrl(article.thumbnail)"
|
|
||||||
mode="aspectFill"
|
|
||||||
></cache-image>
|
|
||||||
<!-- <image class="thumbnail" lazy-load :src="$utils.checkThumbnailUrl(article.thumbnail)" mode="aspectFill"></image> -->
|
<!-- <image class="thumbnail" lazy-load :src="$utils.checkThumbnailUrl(article.thumbnail)" mode="aspectFill"></image> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<text class="is-top" v-if="article.topped">置顶</text>
|
<text class="is-top bg-gradient-blue-accent" v-if="article.topped">置顶</text>
|
||||||
<text class="title-text text-overflow">{{ article.title }}</text>
|
<text class="title-text text-overflow">{{ article.title }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="content text-overflow-2">{{ article.summary }}</view>
|
<view class="content text-overflow-2">{{ article.summary }}</view>
|
||||||
@@ -33,272 +27,327 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
||||||
name: 'article-card',
|
export default {
|
||||||
props: {
|
name: 'article-card',
|
||||||
from: {
|
components: { tmTags },
|
||||||
type: String,
|
props: {
|
||||||
default: ''
|
from: {
|
||||||
},
|
type: String,
|
||||||
article: {
|
default: ''
|
||||||
type: Object,
|
},
|
||||||
default: () => {}
|
article: {
|
||||||
}
|
type: Object,
|
||||||
},
|
default: () => {}
|
||||||
computed: {
|
}
|
||||||
cardType() {
|
},
|
||||||
// tb_image_text=上图下文
|
computed: {
|
||||||
// tb_text_image=上文下图
|
cardType() {
|
||||||
if (this.from == 'home' && this.globalAppSettings.layout.home == 'h_row_col2') {
|
// tb_image_text=上图下文
|
||||||
if (!['tb_image_text', 'tb_text_image', 'only_text'].some(x => x == this.globalAppSettings.layout.cardType)) {
|
// tb_text_image=上文下图
|
||||||
return [this.from, this.globalAppSettings.layout.home, 'tb_image_text'];
|
if (this.from == 'home' && this.globalAppSettings.layout.home == 'h_row_col2') {
|
||||||
}
|
if (!['tb_image_text', 'tb_text_image', 'only_text'].some(x => x == this.globalAppSettings.layout.cardType)) {
|
||||||
return [this.from, this.globalAppSettings.layout.home, this.globalAppSettings.layout.cardType];
|
return [this.from, this.globalAppSettings.layout.home, 'tb_image_text'];
|
||||||
|
}
|
||||||
|
return [this.from, this.globalAppSettings.layout.home, this.globalAppSettings.layout.cardType];
|
||||||
|
}
|
||||||
|
return [this.globalAppSettings.layout.home, this.globalAppSettings.layout.cardType];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fnClickEvent() {
|
||||||
|
this.$emit('on-click', this.article);
|
||||||
}
|
}
|
||||||
return [this.globalAppSettings.layout.home, this.globalAppSettings.layout.cardType];
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
methods: {
|
|
||||||
fnClickEvent() {
|
|
||||||
this.$emit('on-click', this.article);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.article-card {
|
.article-card {
|
||||||
display: flex;
|
display: flex;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin: 0 24rpx;
|
margin: 0 24rpx;
|
||||||
padding: 32rpx;
|
padding: 24rpx;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
background-color: #ffff;
|
background-color: #ffff;
|
||||||
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
&.home {
|
|
||||||
&.h_row_col2 {
|
&.h_row_col1 {
|
||||||
margin: 12rpx;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.home {
|
||||||
|
&.h_row_col2 {
|
||||||
|
margin: 12rpx;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
width: 100%;
|
||||||
|
height: 200rpx;
|
||||||
|
|
||||||
|
.thumbnail {
|
||||||
|
|
||||||
|
::v-deep uni-image {
|
||||||
|
border-radius: 6rpx 6rpx 0 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
.title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
.is-top {
|
||||||
|
height: 36rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
line-height: 36rpx;
|
||||||
|
vertical-align: 4rpx;
|
||||||
|
transform: scale(0.9);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.foot {
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.create-time {
|
||||||
|
font-size: 24rpx;
|
||||||
|
|
||||||
|
.time-label {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.visits {
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.tb_text_image {
|
||||||
|
padding: 12rpx;
|
||||||
|
|
||||||
|
.left .thumbnail {
|
||||||
|
::v-deep {
|
||||||
|
uni-image {
|
||||||
|
border-radius: 6rpx !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.only_text {
|
||||||
|
padding: 24rpx;
|
||||||
|
|
||||||
|
.right .foot {
|
||||||
|
.create-time {
|
||||||
|
.time-label {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.visits {
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.lr_image_text {}
|
||||||
|
|
||||||
|
&.lr_text_image {
|
||||||
|
.left {
|
||||||
|
order: 2;
|
||||||
|
padding-left: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
order: 1;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.tb_image_text {
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 24rpx;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 200rpx;
|
height: 340rpx;
|
||||||
|
|
||||||
.thumbnail {
|
.thumbnail {
|
||||||
::v-deep uni-image {
|
::v-deep uni-image {
|
||||||
border-radius: 6rpx 6rpx 0 0 !important;
|
border-radius: 6rpx 6rpx 0 0 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
.title {
|
padding-left: 0;
|
||||||
display: flex;
|
padding: 24rpx 0;
|
||||||
align-items: center;
|
padding-bottom: 0;
|
||||||
font-size: 26rpx;
|
width: 100%;
|
||||||
font-weight: bold;
|
|
||||||
.is-top {
|
|
||||||
height: 36rpx;
|
|
||||||
margin-right: 10rpx;
|
|
||||||
line-height: 36rpx;
|
|
||||||
vertical-align: 4rpx;
|
|
||||||
transform: scale(0.9);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.foot {
|
.foot {
|
||||||
justify-content: space-between;
|
justify-content: flex-start;
|
||||||
.create-time {
|
|
||||||
font-size: 24rpx;
|
|
||||||
.time-label {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.visits {
|
|
||||||
font-size: 24rpx;
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.tb_text_image {
|
|
||||||
padding: 12rpx;
|
|
||||||
.left .thumbnail {
|
|
||||||
::v-deep {
|
|
||||||
uni-image {
|
|
||||||
border-radius: 6rpx !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.only_text {
|
|
||||||
padding: 24rpx;
|
|
||||||
.right .foot {
|
|
||||||
.create-time {
|
|
||||||
.time-label {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.visits {
|
|
||||||
font-size: 24rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.lr_image_text {
|
|
||||||
}
|
|
||||||
|
|
||||||
&.lr_text_image {
|
.create-time {
|
||||||
.left {
|
.time-label {
|
||||||
order: 2;
|
display: inline-block;
|
||||||
padding-left: 30rpx;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.visits {
|
||||||
|
margin-left: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.right {
|
|
||||||
order: 1;
|
&.tb_text_image {
|
||||||
padding-left: 0;
|
flex-direction: column;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
width: 100%;
|
||||||
|
height: 340rpx;
|
||||||
|
order: 2;
|
||||||
|
margin-top: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
padding-left: 0;
|
||||||
|
width: 100%;
|
||||||
|
order: 1;
|
||||||
|
|
||||||
|
.foot {
|
||||||
|
justify-content: flex-start;
|
||||||
|
|
||||||
|
.create-time {
|
||||||
|
.time-label {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.visits {
|
||||||
|
margin-left: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
&.tb_image_text {
|
&.only_text {
|
||||||
flex-direction: column;
|
padding: 36rpx;
|
||||||
padding: 0;
|
|
||||||
|
.left {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
padding-left: 0;
|
||||||
|
|
||||||
|
.content {
|
||||||
|
margin-top: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.foot {
|
||||||
|
justify-content: flex-start;
|
||||||
|
margin-top: 24rpx;
|
||||||
|
|
||||||
|
.create-time {
|
||||||
|
.time-label {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.visits {
|
||||||
|
margin-left: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
width: 100%;
|
width: 240rpx;
|
||||||
height: 300rpx;
|
height: 180rpx;
|
||||||
|
|
||||||
.thumbnail {
|
.thumbnail {
|
||||||
::v-deep uni-image {
|
width: 100%;
|
||||||
border-radius: 6rpx 6rpx 0 0 !important;
|
height: 100%;
|
||||||
}
|
border-radius: 12rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
padding-left: 0;
|
width: 0;
|
||||||
padding: 24rpx;
|
flex-grow: 1;
|
||||||
width: 100%;
|
display: flex;
|
||||||
.foot {
|
flex-direction: column;
|
||||||
justify-content: flex-start;
|
padding-left: 30rpx;
|
||||||
.create-time {
|
box-sizing: border-box;
|
||||||
.time-label {
|
|
||||||
display: inline-block;
|
.title {
|
||||||
}
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: var(--main-text-color);
|
||||||
|
|
||||||
|
.is-top {
|
||||||
|
height: 40rpx;
|
||||||
|
padding: 0 12rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
vertical-align: 4rpx;
|
||||||
|
color: #fff;
|
||||||
|
// background-image: -webkit-linear-gradient(0deg, #3ca5f6 0, #a86af9 100%);
|
||||||
|
border-radius: 6rpx 12rpx;
|
||||||
|
box-shadow: none !important;
|
||||||
}
|
}
|
||||||
.visits {
|
|
||||||
margin-left: 24rpx;
|
&-text {
|
||||||
|
color: #303133;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
&.tb_text_image {
|
|
||||||
flex-direction: column;
|
|
||||||
.left {
|
|
||||||
width: 100%;
|
|
||||||
height: 260rpx;
|
|
||||||
order: 2;
|
|
||||||
margin-top: 24rpx;
|
|
||||||
}
|
|
||||||
.right {
|
|
||||||
padding-left: 0;
|
|
||||||
width: 100%;
|
|
||||||
order: 1;
|
|
||||||
.foot {
|
|
||||||
justify-content: flex-start;
|
|
||||||
.create-time {
|
|
||||||
.time-label {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.visits {
|
|
||||||
margin-left: 24rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.only_text {
|
|
||||||
padding: 36rpx;
|
|
||||||
.left {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.right {
|
|
||||||
padding-left: 0;
|
|
||||||
.content {
|
.content {
|
||||||
margin-top: 24rpx;
|
display: -webkit-box;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #909399;
|
||||||
|
height: 80rpx;
|
||||||
|
margin-top: 14rpx;
|
||||||
|
line-height: 42rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.foot {
|
.foot {
|
||||||
justify-content: flex-start;
|
display: flex;
|
||||||
margin-top: 24rpx;
|
font-size: 24rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
color: #909399;
|
||||||
|
margin-top: 18rpx;
|
||||||
|
|
||||||
.create-time {
|
.create-time {
|
||||||
|
font-size: 26rpx;
|
||||||
|
|
||||||
.time-label {
|
.time-label {
|
||||||
display: inline-block;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.visits {
|
.visits {
|
||||||
margin-left: 24rpx;
|
.number {
|
||||||
|
padding: 0 6rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
</style>
|
||||||
.left {
|
|
||||||
width: 240rpx;
|
|
||||||
height: 180rpx;
|
|
||||||
.thumbnail {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.right {
|
|
||||||
width: 0;
|
|
||||||
flex-grow: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
padding-left: 30rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
.title {
|
|
||||||
display: flex;
|
|
||||||
font-size: 30rpx;
|
|
||||||
color: var(--main-text-color);
|
|
||||||
.is-top {
|
|
||||||
height: 40rpx;
|
|
||||||
padding: 0 12rpx;
|
|
||||||
margin-right: 10rpx;
|
|
||||||
line-height: 40rpx;
|
|
||||||
font-size: 24rpx;
|
|
||||||
white-space: nowrap;
|
|
||||||
vertical-align: 4rpx;
|
|
||||||
color: #fff;
|
|
||||||
background-image: -webkit-linear-gradient(0deg, #3ca5f6 0, #a86af9 100%);
|
|
||||||
border-radius: 4rpx 12rpx;
|
|
||||||
}
|
|
||||||
&-text {
|
|
||||||
color: #303133;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.content {
|
|
||||||
display: -webkit-box;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #909399;
|
|
||||||
height: 80rpx;
|
|
||||||
margin-top: 14rpx;
|
|
||||||
line-height: 42rpx;
|
|
||||||
}
|
|
||||||
.foot {
|
|
||||||
display: flex;
|
|
||||||
font-size: 24rpx;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
color: #909399;
|
|
||||||
margin-top: 18rpx;
|
|
||||||
|
|
||||||
.create-time {
|
|
||||||
font-size: 26rpx;
|
|
||||||
.time-label {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.visits {
|
|
||||||
.number {
|
|
||||||
padding: 0 6rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,13 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="article-min-card" :class="[globalAppSettings.layout.cardType]" @click="fnClickEvent('card')">
|
<view class="article-min-card" :class="[globalAppSettings.layout.cardType]" @click="fnClickEvent('card')">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<cache-image
|
<cache-image class="thumbnail" radius="6rpx" :url="$utils.checkThumbnailUrl(article.thumbnail)" :fileMd5="$utils.checkThumbnailUrl(article.thumbnail)" mode="aspectFill"></cache-image>
|
||||||
class="thumbnail"
|
|
||||||
radius="12rpx"
|
|
||||||
:url="$utils.checkThumbnailUrl(article.thumbnail)"
|
|
||||||
:fileMd5="$utils.checkThumbnailUrl(article.thumbnail)"
|
|
||||||
mode="aspectFill"
|
|
||||||
></cache-image>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view class="title text-overflow">{{ article.title }}</view>
|
<view class="title text-overflow">{{ article.title }}</view>
|
||||||
@@ -30,168 +24,197 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'article-min-card',
|
name: 'article-min-card',
|
||||||
props: {
|
props: {
|
||||||
article: {
|
article: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fnClickEvent() {
|
||||||
|
this.$emit('on-click', this.article);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
methods: {
|
|
||||||
fnClickEvent() {
|
|
||||||
this.$emit('on-click', this.article);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.article-min-card {
|
.article-min-card {
|
||||||
display: flex;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
background-color: #ffff;
|
|
||||||
overflow: hidden;
|
|
||||||
margin: 12rpx 24rpx;
|
|
||||||
margin-bottom: 24rpx;
|
|
||||||
padding: 16rpx;
|
|
||||||
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.05);
|
|
||||||
&.lr_image_text {
|
|
||||||
}
|
|
||||||
|
|
||||||
&.lr_text_image {
|
|
||||||
.left {
|
|
||||||
order: 2;
|
|
||||||
padding-left: 30rpx;
|
|
||||||
}
|
|
||||||
.right {
|
|
||||||
order: 1;
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.tb_image_text {
|
|
||||||
flex-direction: column;
|
|
||||||
.left {
|
|
||||||
width: 100%;
|
|
||||||
height: 220rpx;
|
|
||||||
}
|
|
||||||
.right {
|
|
||||||
padding-left: 0;
|
|
||||||
width: 100%;
|
|
||||||
.title {
|
|
||||||
margin-top: 24rpx;
|
|
||||||
}
|
|
||||||
.foot {
|
|
||||||
justify-content: flex-start;
|
|
||||||
.create-time {
|
|
||||||
.time-label {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.visits {
|
|
||||||
margin-left: 24rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.tb_text_image {
|
|
||||||
flex-direction: column;
|
|
||||||
.left {
|
|
||||||
width: 100%;
|
|
||||||
height: 220rpx;
|
|
||||||
order: 2;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
}
|
|
||||||
.right {
|
|
||||||
padding-left: 0;
|
|
||||||
width: 100%;
|
|
||||||
order: 1;
|
|
||||||
.foot {
|
|
||||||
justify-content: flex-start;
|
|
||||||
.create-time {
|
|
||||||
.time-label {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.visits {
|
|
||||||
margin-left: 24rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.only_text {
|
|
||||||
.left {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.right {
|
|
||||||
padding-left: 0;
|
|
||||||
.foot {
|
|
||||||
justify-content: flex-start;
|
|
||||||
.create-time {
|
|
||||||
.time-label {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.visits {
|
|
||||||
margin-left: 24rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.left {
|
|
||||||
width: 180rpx;
|
|
||||||
height: 130rpx;
|
|
||||||
.thumbnail {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.right {
|
|
||||||
width: 0;
|
|
||||||
flex-grow: 1;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
box-sizing: border-box;
|
||||||
padding-left: 24rpx;
|
border-radius: 12rpx;
|
||||||
.title {
|
background-color: #ffff;
|
||||||
font-size: 28rpx;
|
overflow: hidden;
|
||||||
font-weight: 600;
|
margin: 12rpx 24rpx;
|
||||||
color: var(--main-text-color);
|
margin-bottom: 24rpx;
|
||||||
|
padding: 16rpx;
|
||||||
|
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
|
|
||||||
|
&.lr_image_text {}
|
||||||
|
|
||||||
|
&.lr_text_image {
|
||||||
|
.left {
|
||||||
|
order: 2;
|
||||||
|
padding-left: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
order: 1;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.content {
|
|
||||||
font-size: 26rpx;
|
&.tb_image_text {
|
||||||
color: #909399;
|
flex-direction: column;
|
||||||
margin-top: 14rpx;
|
|
||||||
}
|
.left {
|
||||||
.foot {
|
width: 100%;
|
||||||
display: flex;
|
height: 220rpx;
|
||||||
font-size: 24rpx;
|
}
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
.right {
|
||||||
color: #909399;
|
padding-left: 0;
|
||||||
margin-top: 14rpx;
|
width: 100%;
|
||||||
.create-time {
|
|
||||||
font-size: 24rpx;
|
.title {
|
||||||
.time-label {
|
margin-top: 24rpx;
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
.icon {
|
|
||||||
font-size: 24rpx;
|
.foot {
|
||||||
padding-right: 4rpx;
|
justify-content: flex-start;
|
||||||
|
|
||||||
|
.create-time {
|
||||||
|
.time-label {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.visits {
|
||||||
|
margin-left: 24rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.visits {
|
}
|
||||||
.icon {
|
|
||||||
font-size: 28rpx;
|
&.tb_text_image {
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
width: 100%;
|
||||||
|
height: 220rpx;
|
||||||
|
order: 2;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
padding-left: 0;
|
||||||
|
width: 100%;
|
||||||
|
order: 1;
|
||||||
|
|
||||||
|
.foot {
|
||||||
|
justify-content: flex-start;
|
||||||
|
|
||||||
|
.create-time {
|
||||||
|
.time-label {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.visits {
|
||||||
|
margin-left: 24rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.number {
|
}
|
||||||
padding: 0 6rpx;
|
}
|
||||||
|
|
||||||
|
&.only_text {
|
||||||
|
.left {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
padding-left: 0;
|
||||||
|
|
||||||
|
.foot {
|
||||||
|
justify-content: flex-start;
|
||||||
|
|
||||||
|
.create-time {
|
||||||
|
.time-label {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.visits {
|
||||||
|
margin-left: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.left {
|
||||||
|
width: 180rpx;
|
||||||
|
height: 130rpx;
|
||||||
|
|
||||||
|
.thumbnail {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
width: 0;
|
||||||
|
flex-grow: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding-left: 20rpx;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--main-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #909399;
|
||||||
|
margin-top: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.foot {
|
||||||
|
display: flex;
|
||||||
|
font-size: 24rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
color: #909399;
|
||||||
|
margin-top: 14rpx;
|
||||||
|
|
||||||
|
.create-time {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
|
||||||
|
.time-label {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding-right: 4rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.visits {
|
||||||
|
.icon {
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.number {
|
||||||
|
padding: 0 6rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
</style>
|
||||||
</style>
|
|
||||||
@@ -1,15 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<view style="overflow: hidden;position: fixed;width: 100%;height: 100%;pointer-events: none; top: 0;">
|
<view class="barrage-wrap" :class="[type]">
|
||||||
<view class="danmu-li" v-for="(item, index) in listData" :class="item.type" :style="item.style" :key="index">
|
<view class="danmu-li" v-for="(item, index) in listData" :class="[type, item.type]" :style="[item.style]" :key="index">
|
||||||
<view class="danmu-inner">
|
<view class="danmu-inner">
|
||||||
<view class="user-box">
|
<view class="user-box">
|
||||||
<view class="user-img">
|
<view class="user-img"><image class="avatar" :src="item.item.avatar"></image></view>
|
||||||
<view class="img-box">
|
<view class="user-text cl1">{{ item.item.author }}</view>
|
||||||
<image :src="item.avatar || 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=317894666,3379114684&fm=26&gp=0.jpg'"></image>
|
<view class="user-status cl1">{{ item.item.content }}</view>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="user-text cl1">{{ item.nickName }}</view>
|
|
||||||
<view class="user-status cl1">{{ item.text }}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -18,11 +14,17 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
//rightToLeft leftToRight leftBottom
|
// rightToLeft leftToRight leftBottom
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'rightToLeft'
|
default: 'rightToLeft'
|
||||||
},
|
},
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default() {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
minTime: {
|
minTime: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 4
|
default: 4
|
||||||
@@ -43,34 +45,34 @@ export default {
|
|||||||
//轨道高度
|
//轨道高度
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 40
|
default: 40
|
||||||
},
|
|
||||||
noStacked: {
|
|
||||||
//不允许堆叠(暂不可用)
|
|
||||||
type: Array,
|
|
||||||
default() {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
closeTimer: null,
|
||||||
listData: []
|
listData: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.hrackNum = Math.floor((this.maxTop - this.minTop) / this.hrackH);
|
//leftBottom 使用参数
|
||||||
|
if (this.type === 'leftBottom') {
|
||||||
|
this.hrackNum = Math.floor(this.maxTop / this.hrackH);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
add(obj) {
|
add(obj) {
|
||||||
|
this.isShow = true;
|
||||||
|
this.showFlag = true;
|
||||||
let data = {
|
let data = {
|
||||||
item: obj.item,
|
...obj,
|
||||||
id: Date.parse(new Date()),
|
id: Date.parse(new Date()),
|
||||||
time: Math.ceil(Math.floor(Math.random() * (this.maxTime - this.minTime + 1) + this.minTime)),
|
time: Math.ceil(Math.floor(Math.random() * (this.maxTime - this.minTime + 1) + this.minTime)),
|
||||||
type: this.type
|
type: this.type
|
||||||
};
|
};
|
||||||
if (this.type === 'leftBottom') {
|
if (this.type === 'leftBottom') {
|
||||||
let objData = {
|
let objData = {
|
||||||
item: data.item,
|
item: data,
|
||||||
type: 'leftBottomEnter',
|
type: 'leftBottomEnter',
|
||||||
style: {
|
style: {
|
||||||
transition: `all 0.5s`,
|
transition: `all 0.5s`,
|
||||||
@@ -88,7 +90,7 @@ export default {
|
|||||||
} else if (this.listData[i].status === 'reset') {
|
} else if (this.listData[i].status === 'reset') {
|
||||||
//重置
|
//重置
|
||||||
this.listData[i].style.transition = 'none';
|
this.listData[i].style.transition = 'none';
|
||||||
this.listData[i].style.bottom = 0;
|
this.listData[i].style.bottom = '6px';
|
||||||
this.listData[i].status = 'reuse';
|
this.listData[i].status = 'reuse';
|
||||||
} else if (this.listData[i].status === 'recycle') {
|
} else if (this.listData[i].status === 'recycle') {
|
||||||
//回收
|
//回收
|
||||||
@@ -105,8 +107,16 @@ export default {
|
|||||||
if (listLen < hrackNum + 2) {
|
if (listLen < hrackNum + 2) {
|
||||||
this.listData.push(objData);
|
this.listData.push(objData);
|
||||||
}
|
}
|
||||||
} else if (this.type === 'rightToLeft' || this.type === 'leftToRight') {
|
} else if (this.type === 'rightToLeft') {
|
||||||
let objData = this.horStacked(data);
|
let objData = {
|
||||||
|
item: data,
|
||||||
|
type: 'rightToLeft',
|
||||||
|
style: {
|
||||||
|
animationDuration: `${data.time}s`,
|
||||||
|
top: `${Math.ceil(Math.random() * (this.maxTop - this.minTop + 1) + this.minTop)}px`
|
||||||
|
},
|
||||||
|
delTime: Date.parse(new Date()) + data.time * 1200
|
||||||
|
};
|
||||||
for (let i in this.listData) {
|
for (let i in this.listData) {
|
||||||
if (this.listData[i].delTime <= Date.parse(new Date())) {
|
if (this.listData[i].delTime <= Date.parse(new Date())) {
|
||||||
this.repaint(i, objData.type);
|
this.repaint(i, objData.type);
|
||||||
@@ -118,16 +128,50 @@ export default {
|
|||||||
this.listData.push(objData);
|
this.listData.push(objData);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
horStacked(data) {
|
async remove(options = {}) {
|
||||||
return {
|
if (this.type == 'rightToLeft') {
|
||||||
item: data.item,
|
if (this.listData.length != 0) {
|
||||||
type: this.type,
|
const last = this.listData[this.listData.length - 1];
|
||||||
style: {
|
setTimeout(() => {
|
||||||
animationDuration: `${data.time}s`,
|
this.listData = [];
|
||||||
top: `${Math.ceil(Math.random() * (this.maxTop - this.minTop + 1) + this.minTop)}px`
|
}, last.item.time * 1200 + 1000);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
options = Object.assign(
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
duration: 5000, // 延迟关闭的时间
|
||||||
|
speed: 1000 // 弹幕消失的速度
|
||||||
},
|
},
|
||||||
delTime: Date.parse(new Date()) + data.time * 1200
|
options
|
||||||
|
);
|
||||||
|
|
||||||
|
const _fnHandleRemove = item => {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
setTimeout(() => {
|
||||||
|
// item['type'] = 'leftBottomExitLeft';
|
||||||
|
item['type'] = 'is-hide';
|
||||||
|
resolve();
|
||||||
|
}, options.speed);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
const _fnHandleLoop = item => {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
setTimeout(async () => {
|
||||||
|
for (var i = 0; i < this.listData.length; i++) {
|
||||||
|
await _fnHandleRemove(this.listData[i]);
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
}, options.duration);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
await _fnHandleLoop();
|
||||||
|
setTimeout(() => {
|
||||||
|
this.listData = [];
|
||||||
|
}, options.duration + 200);
|
||||||
},
|
},
|
||||||
repaint(index, type) {
|
repaint(index, type) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -137,8 +181,8 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style></style>
|
|
||||||
<style lang="scss">
|
<style lang="scss" scoped>
|
||||||
@keyframes leftBottomEnter {
|
@keyframes leftBottomEnter {
|
||||||
0% {
|
0% {
|
||||||
transform: translateY(100%);
|
transform: translateY(100%);
|
||||||
@@ -163,6 +207,20 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes leftBottomExitLeft {
|
||||||
|
0% {
|
||||||
|
transform: translateX(0%);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: translateX(-50%);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: translateX(-100%);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@keyframes leftToRight {
|
@keyframes leftToRight {
|
||||||
0% {
|
0% {
|
||||||
transform: translateX(-100%);
|
transform: translateX(-100%);
|
||||||
@@ -182,13 +240,38 @@ export default {
|
|||||||
transform: translateX(-100%);
|
transform: translateX(-100%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.barrage-wrap {
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
pointer-events: none;
|
||||||
|
top: 0;
|
||||||
|
z-index: 99;
|
||||||
|
transition: all 1s ease-in-out;
|
||||||
|
&.leftBottom {
|
||||||
|
top: initial;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
bottom: 130rpx;
|
||||||
|
/* #endif */
|
||||||
|
/* #ifndef H5 */
|
||||||
|
bottom: 36rpx;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
}
|
||||||
.danmu-li {
|
.danmu-li {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
transform: translateX(100%);
|
transform: translateX(100%);
|
||||||
animation-timing-function: linear;
|
animation-timing-function: linear;
|
||||||
|
transition: all 0.5s ease-in-out;
|
||||||
|
opacity: 1;
|
||||||
|
&.is-hide {
|
||||||
|
opacity: 0;
|
||||||
|
// transform: translateX(-100%) !important;
|
||||||
|
}
|
||||||
|
&.leftBottom {
|
||||||
|
left: 24rpx;
|
||||||
|
}
|
||||||
&.leftBottomEnter {
|
&.leftBottomEnter {
|
||||||
animation-name: leftBottomEnter;
|
animation-name: leftBottomEnter;
|
||||||
}
|
}
|
||||||
@@ -196,53 +279,59 @@ export default {
|
|||||||
animation-name: leftBottomExit;
|
animation-name: leftBottomExit;
|
||||||
animation-fill-mode: forwards;
|
animation-fill-mode: forwards;
|
||||||
}
|
}
|
||||||
|
&.leftBottomExitLeft {
|
||||||
|
animation-name: leftBottomExitLeft;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
}
|
||||||
&.rightToLeft {
|
&.rightToLeft {
|
||||||
animation-name: rightToLeft;
|
animation-name: rightToLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.leftToRight {
|
&.leftToRight {
|
||||||
animation-name: leftToRight;
|
animation-name: rightToLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
.danmu-inner {
|
.danmu-inner {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
font-size: 24rpx;
|
||||||
.user-box {
|
.user-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 3rpx 40rpx 3rpx 10rpx;
|
padding: 6rpx 40rpx 6rpx 10rpx;
|
||||||
background: rgba(0, 0, 0, 0.3);
|
background: rgba(0, 0, 0, 0.3);
|
||||||
border-radius: 32rpx;
|
border-radius: 32rpx;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.user-img {
|
.user-img {
|
||||||
.img-box {
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
image {
|
.avatar {
|
||||||
width: 58rpx;
|
width: 42rpx;
|
||||||
height: 58rpx;
|
height: 42rpx;
|
||||||
background: rgba(55, 55, 55, 1);
|
background: rgba(55, 55, 55, 1);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-status {
|
.user-status {
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: rgba(255, 255, 255, 1);
|
color: rgba(255, 255, 255, 1);
|
||||||
|
max-width: 320rpx;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-text {
|
.user-text {
|
||||||
|
max-width: 100rpx;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
// white-space: nowrap;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
width: 80rpx;
|
|
||||||
color: rgba(255, 255, 255, 1);
|
color: rgba(255, 255, 255, 1);
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,180 +1,193 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="">
|
<view class="cache-image-wrap">
|
||||||
<view v-if="loadStatus == 'loading'" class="img-loading" :style="[imgStyle, loadStyle]">
|
<view v-if="loadStatus == 'loading'" class="img-loading" :style="[imgStyle, loadStyle]">
|
||||||
<!-- <text class="img-load-icon iconfont icon-loading"></text>
|
<!-- <text class="img-load-icon iconfont icon-loading"></text>
|
||||||
<text class="img-load-text">{{ loadText }}</text> -->
|
<text class="img-load-text">{{ loadText }}</text> -->
|
||||||
<image :src="loadingImgSrc" :style="[imgStyle]" mode="aspectFit"></image>
|
<image :src="loadingImgSrc" :style="[loadingImgStyle]" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="loadStatus == 'error'" class="img-error" :style="[imgStyle, loadErrStyle]">
|
<view v-if="loadStatus == 'error'" class="img-error" :style="[imgStyle, loadErrStyle]">
|
||||||
<text class="img-err-icon iconfont icon-exclamation-circle"></text>
|
<!-- <text class="img-err-icon iconfont icon-exclamation-circle"></text>
|
||||||
<text class="img-load-text">{{ loadErrText }}</text>
|
<text class="img-load-text">{{ loadErrText }}</text> -->
|
||||||
|
<image class="img-error-img" :src="loadingErrorImageSrc" mode="scaleToFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<image
|
<image v-show="loadStatus == 'success'" :src="src" @load="fnOnLoad" @error="fnOnError" :lazy-load="lazyLoad" :style="[imgStyle]" :mode="mode" @click="$emit('on-click', url)"></image>
|
||||||
v-show="loadStatus == 'success'"
|
|
||||||
:src="src"
|
|
||||||
@load="fnOnLoad"
|
|
||||||
@error="fnOnError"
|
|
||||||
:lazy-load="lazyLoad"
|
|
||||||
:style="[imgStyle]"
|
|
||||||
:mode="mode"
|
|
||||||
@click="$emit('on-click', url)"
|
|
||||||
></image>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import imageCache from '@/utils/imageCache.js';
|
import imageCache from '@/utils/imageCache.js';
|
||||||
export default {
|
export default {
|
||||||
name: 'cache-image',
|
name: 'cache-image',
|
||||||
props: {
|
props: {
|
||||||
url: {
|
url: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
lazyLoad: {
|
lazyLoad: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
loadStyle: {
|
loadStyle: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default() {
|
default () {
|
||||||
return {
|
return {
|
||||||
backgroundColor: '#ffffff',
|
backgroundColor: '#ffffff',
|
||||||
color: '#333'
|
color: '#333'
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
loadErrStyle: {
|
||||||
|
type: Object,
|
||||||
|
default () {
|
||||||
|
return {
|
||||||
|
color: 'rgba(244, 67, 54,1)'
|
||||||
|
// backgroundColor: 'rgba(244, 67, 54,0.2)'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mode: {
|
||||||
|
type: String,
|
||||||
|
default: 'aspectFill'
|
||||||
|
},
|
||||||
|
loadText: {
|
||||||
|
type: String,
|
||||||
|
default: '加载中...'
|
||||||
|
},
|
||||||
|
loadErrText: {
|
||||||
|
type: String,
|
||||||
|
default: '加载失败'
|
||||||
|
},
|
||||||
|
fileMd5: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
styles: {
|
||||||
|
type: Object,
|
||||||
|
default () {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
width: {
|
||||||
|
type: String,
|
||||||
|
default: '100%'
|
||||||
|
},
|
||||||
|
height: {
|
||||||
|
type: String,
|
||||||
|
default: '100%'
|
||||||
|
},
|
||||||
|
radius: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadErrStyle: {
|
data() {
|
||||||
type: Object,
|
return {
|
||||||
default() {
|
imgStyle: {},
|
||||||
return {
|
loadingImgStyle: {
|
||||||
color: 'rgba(244, 67, 54,1)'
|
width: '120rpx',
|
||||||
// backgroundColor: 'rgba(244, 67, 54,0.2)'
|
},
|
||||||
};
|
src: '', // 图片地址
|
||||||
|
loadStatus: 'loading'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
loadingImgSrc() {
|
||||||
|
return getApp().globalData.loadingGifUrl;
|
||||||
|
},
|
||||||
|
loadingErrorImageSrc() {
|
||||||
|
return getApp().globalData.loadingErrUrl
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mode: {
|
watch: {
|
||||||
type: String,
|
// 监听图片md5值的变化
|
||||||
default: 'aspectFill'
|
fileMd5(val) {
|
||||||
},
|
// 查找获取图片缓存
|
||||||
loadText: {
|
this.fnGetImageCache();
|
||||||
type: String,
|
|
||||||
default: '加载中...'
|
|
||||||
},
|
|
||||||
loadErrText: {
|
|
||||||
type: String,
|
|
||||||
default: '加载失败'
|
|
||||||
},
|
|
||||||
fileMd5: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
styles: {
|
|
||||||
type: Object,
|
|
||||||
default() {
|
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
width: {
|
created() {
|
||||||
type: String,
|
this.imgStyle = {
|
||||||
default: '100%'
|
width: this.width,
|
||||||
},
|
height: this.height,
|
||||||
height: {
|
borderRadius: this.radius,
|
||||||
type: String,
|
...this.styles
|
||||||
default: '100%'
|
};
|
||||||
},
|
|
||||||
radius: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
imgStyle: {},
|
|
||||||
src: '', // 图片地址
|
|
||||||
loadStatus: 'loading'
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
loadingImgSrc() {
|
|
||||||
return getApp().globalData.loadingGifUrl;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
// 监听图片md5值的变化
|
|
||||||
fileMd5(val) {
|
|
||||||
// 查找获取图片缓存
|
// 查找获取图片缓存
|
||||||
this.fnGetImageCache();
|
this.fnGetImageCache();
|
||||||
}
|
},
|
||||||
},
|
methods: {
|
||||||
created() {
|
// 查找获取图片缓存
|
||||||
this.imgStyle = {
|
async fnGetImageCache() {
|
||||||
width: this.width,
|
// #ifdef APP-PLUS
|
||||||
height: this.height,
|
var result = await imageCache.getImageCache(this.url, this.fileMd5);
|
||||||
borderRadius: this.radius,
|
if (result) {
|
||||||
...this.styles
|
this.src = result;
|
||||||
};
|
} else {
|
||||||
|
this.src = this.url;
|
||||||
// 查找获取图片缓存
|
}
|
||||||
this.fnGetImageCache();
|
// #endif
|
||||||
},
|
// #ifndef APP-PLUS
|
||||||
methods: {
|
|
||||||
// 查找获取图片缓存
|
|
||||||
async fnGetImageCache() {
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
var result = await imageCache.getImageCache(this.url, this.fileMd5);
|
|
||||||
if (result) {
|
|
||||||
this.src = result;
|
|
||||||
} else {
|
|
||||||
this.src = this.url;
|
this.src = this.url;
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
fnOnLoad() {
|
||||||
|
this.loadStatus = 'success';
|
||||||
|
},
|
||||||
|
fnOnError(e) {
|
||||||
|
this.loadStatus = 'error';
|
||||||
}
|
}
|
||||||
// #endif
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
this.src = this.url;
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
fnOnLoad() {
|
|
||||||
this.loadStatus = 'success';
|
|
||||||
},
|
|
||||||
fnOnError() {
|
|
||||||
this.loadStatus = 'error';
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.img-loading,
|
.cache-image-wrap {
|
||||||
.img-error {
|
width: 100%;
|
||||||
display: flex;
|
height: 100%;
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
background-color: #f2f2f2;
|
|
||||||
}
|
|
||||||
.img-load-icon {
|
|
||||||
font-size: 36rpx;
|
|
||||||
animation: xhRote 0.8s infinite linear;
|
|
||||||
}
|
|
||||||
.img-load-text {
|
|
||||||
font-size: 28rpx;
|
|
||||||
margin-top: 8rpx;
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
.img-error {
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
.img-err-icon {
|
|
||||||
font-size: 36rpx;
|
|
||||||
}
|
|
||||||
@keyframes xhRote {
|
|
||||||
0% {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
.img-loading,
|
||||||
transform: rotate(360deg);
|
.img-error {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: #f2f2f2;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
.img-load-icon {
|
||||||
|
font-size: 36rpx;
|
||||||
|
animation: xhRote 0.8s infinite linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img-load-text {
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img-error {
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
&-img {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.img-err-icon {
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes xhRote {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="category-mini-card">
|
<view class="category-mini-card">
|
||||||
<!-- <image class="img" lazy-load :src="$utils.checkThumbnailUrl(category.thumbnail)" mode="aspectFill"></image> -->
|
|
||||||
<cache-image
|
<cache-image
|
||||||
class="img"
|
class="img"
|
||||||
height="120rpx"
|
height="120rpx"
|
||||||
@@ -35,12 +34,13 @@ export default {
|
|||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
// border: 2rpx solid #f7f7f7;
|
|
||||||
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
|
position: relative;
|
||||||
.img {
|
.img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 120rpx;
|
height: 120rpx;
|
||||||
border: 6rpx 6rpx 0 0;
|
border: 6rpx 6rpx 0 0;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.label {
|
.label {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -55,9 +55,13 @@ export default {
|
|||||||
padding-right: 24rpx;
|
padding-right: 24rpx;
|
||||||
}
|
}
|
||||||
.name {
|
.name {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 16rpx;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: var(--main-text-color);
|
color: #333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,8 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class=" comment-item flex flex-col mt-30 pt-24" :class="{ 'child-comment-item': isChild, 'no-solid': !useSolid, classItem }">
|
<view class=" comment-item flex flex-col mt-30 pt-24" :class="{ 'child-comment-item': isChild, 'no-solid': !useSolid, classItem }">
|
||||||
<view class="comment-item_user flex">
|
<view class="comment-item_user flex">
|
||||||
<image v-if="comment.isAdmin" class="user-avatar" :src="bloggerInfo.avatar" mode="aspectFill" @error="fnOnImageError(comment)"></image>
|
<image
|
||||||
<image v-else class="user-avatar" :src="comment.avatar" mode="aspectFill" @error="fnOnImageError(comment)"></image>
|
v-if="comment.isAdmin"
|
||||||
|
class="user-avatar"
|
||||||
|
:class="{ 'is-radius': globalAppSettings.isAvatarRadius }"
|
||||||
|
:src="bloggerInfo.avatar"
|
||||||
|
mode="aspectFill"
|
||||||
|
@error="fnOnImageError(comment)"
|
||||||
|
></image>
|
||||||
|
<image
|
||||||
|
v-else
|
||||||
|
class="user-avatar"
|
||||||
|
:class="{ 'is-radius': globalAppSettings.isAvatarRadius }"
|
||||||
|
:src="comment.avatar"
|
||||||
|
mode="aspectFill"
|
||||||
|
@error="fnOnImageError(comment)"
|
||||||
|
></image>
|
||||||
<view class="user-info pl-14">
|
<view class="user-info pl-14">
|
||||||
<view class="author">
|
<view class="author">
|
||||||
<text class="mr-6 text-grey-darken-1 text-size-m">{{ comment.author }}</text>
|
<text class="mr-6 text-grey-darken-1 text-size-m">{{ comment.author }}</text>
|
||||||
@@ -11,7 +25,7 @@
|
|||||||
<tm-tags v-else :dense="true" color="bg-gradient-light-blue-lighten " size="xs" model="fill">游客</tm-tags>
|
<tm-tags v-else :dense="true" color="bg-gradient-light-blue-lighten " size="xs" model="fill">游客</tm-tags>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex mt-4">
|
<view class="flex mt-4">
|
||||||
<view v-if="false" class="text-size-s text-grey mr-12">IP属地:浙江省杭州市</view>
|
<view v-if="false" class="text-size-s text-grey mr-12">IP属地:暂无信息</view>
|
||||||
<view class="time text-size-xs text-grey">
|
<view class="time text-size-xs text-grey">
|
||||||
<text class="">{{ $tm.dayjs(comment.createTime).format('YYYY年MM月DD日') }}</text>
|
<text class="">{{ $tm.dayjs(comment.createTime).format('YYYY年MM月DD日') }}</text>
|
||||||
<text class="ml-12">{{ $tm.dayjs(comment.createTime).fromNow(true) }}前</text>
|
<text class="ml-12">{{ $tm.dayjs(comment.createTime).fromNow(true) }}前</text>
|
||||||
@@ -19,13 +33,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="useActions" class="">
|
<view v-if="useActions" class="">
|
||||||
<tm-button size="s" text theme="blue" @click="$emit('on-comment', { type: 'user', comment: comment })">回复</tm-button>
|
<tm-button v-if="!disallowComment" size="s" text theme="blue" @click="$emit('on-comment', { type: 'user', comment: comment })">回复</tm-button>
|
||||||
<tm-button size="s" text theme="grey" @click="$emit('on-copy', comment.content)">复制</tm-button>
|
<tm-button size="s" text theme="grey" @click="$emit('on-copy', comment.content)">复制</tm-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="comment-item_content mt-12" :class="{ 'has-bg': useContentBg, 'not-ml': isChild }" @click="$emit('on-detail', comment)" v-html="comment.content"></view>
|
<view class="comment-item_content mt-12" :class="{ 'has-bg': useContentBg, 'not-ml': isChild }" @click="$emit('on-detail', comment)" v-html="comment.content"></view>
|
||||||
|
|
||||||
<!-- <view v-if="useActions" class="comment-item_info text-size-s text-grey">
|
<!-- <view v-if="useActions" class="comment-item_info text-size-s text-grey">
|
||||||
<text v-if="false" @click="$emit('on-todo')">点赞</text>
|
<text v-if="false" @click="$emit('on-todo')">点赞</text>
|
||||||
<text @click="$emit('on-comment', { type: 'user', comment: comment })">回复</text>
|
<text @click="$emit('on-comment', { type: 'user', comment: comment })">回复</text>
|
||||||
@@ -46,6 +59,10 @@ export default {
|
|||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => []
|
||||||
},
|
},
|
||||||
|
disallowComment: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
useActions: {
|
useActions: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
@@ -74,7 +91,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
// 获取博主信息
|
// 获取博主信息
|
||||||
bloggerInfo() {
|
bloggerInfo() {
|
||||||
let blogger = this.$tm.vx.getters().blogger.getBlogger;
|
let blogger = this.$tm.vx.getters().getBlogger;
|
||||||
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
|
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
|
||||||
return blogger;
|
return blogger;
|
||||||
}
|
}
|
||||||
@@ -111,10 +128,13 @@ export default {
|
|||||||
.user-avatar {
|
.user-avatar {
|
||||||
width: 70rpx;
|
width: 70rpx;
|
||||||
height: 70rpx;
|
height: 70rpx;
|
||||||
border-radius: 50%;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 4rpx solid #ffffff;
|
|
||||||
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.05);
|
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||||
|
border: 4rpx solid #ffffff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
&.is-radius {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.user-info {
|
.user-info {
|
||||||
width: 0;
|
width: 0;
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
<!-- <text class="filter-item">全部</text> -->
|
<!-- <text class="filter-item">全部</text> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view v-if="disallowComment" class="disallow-comment"><tm-empty icon="icon-shiliangzhinengduixiang-" label="文章已开启禁止评论"></tm-empty></view> -->
|
|
||||||
<!-- 内容区域 -->
|
<!-- 内容区域 -->
|
||||||
<view class="comment-list_content">
|
<view class="comment-list_content">
|
||||||
<view v-if="loading != 'success'" class="loading-wrap flex">
|
<view v-if="loading != 'success'" class="loading-wrap flex">
|
||||||
@@ -27,9 +26,21 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
|
<tm-alerts
|
||||||
|
v-if="disallowComment && dataList.length !== 0"
|
||||||
|
color="red"
|
||||||
|
text
|
||||||
|
:margin="[0, 0]"
|
||||||
|
:shadow="0"
|
||||||
|
label="Ծ‸Ծ博主已设置该文章禁止评论!"
|
||||||
|
:round="3"
|
||||||
|
></tm-alerts>
|
||||||
<view class="empty pt-50" v-if="dataList.length == 0">
|
<view class="empty pt-50" v-if="dataList.length == 0">
|
||||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="暂无评论">
|
<tm-empty v-if="disallowComment" icon="icon-shiliangzhinengduixiang-" label="暂无评论">
|
||||||
<tm-button theme="bg-gradient-light-blue-accent" size="m" v-if="!disallowComment" @click="fnToComment(null)">抢沙发</tm-button>
|
<text class="text-red text-size-s">- 文章已开启禁止评论 -</text>
|
||||||
|
</tm-empty>
|
||||||
|
<tm-empty v-else icon="icon-shiliangzhinengduixiang-" label="暂无评论">
|
||||||
|
<tm-button theme="light-blue" :dense="true" :shadow="0" size="m" @click="fnToComment(null)">抢沙发</tm-button>
|
||||||
</tm-empty>
|
</tm-empty>
|
||||||
</view>
|
</view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
@@ -40,6 +51,7 @@
|
|||||||
:isChild="false"
|
:isChild="false"
|
||||||
:comment="comment"
|
:comment="comment"
|
||||||
:postId="postId"
|
:postId="postId"
|
||||||
|
:disallowComment="disallowComment"
|
||||||
@on-copy="fnCopyContent"
|
@on-copy="fnCopyContent"
|
||||||
@on-comment="fnToComment"
|
@on-comment="fnToComment"
|
||||||
@on-todo="fnToDo"
|
@on-todo="fnToDo"
|
||||||
@@ -54,6 +66,7 @@
|
|||||||
:isChild="true"
|
:isChild="true"
|
||||||
:comment="childComment"
|
:comment="childComment"
|
||||||
:postId="postId"
|
:postId="postId"
|
||||||
|
:disallowComment="disallowComment"
|
||||||
@on-copy="fnCopyContent"
|
@on-copy="fnCopyContent"
|
||||||
@on-comment="fnToComment"
|
@on-comment="fnToComment"
|
||||||
@on-todo="fnToDo"
|
@on-todo="fnToDo"
|
||||||
@@ -74,9 +87,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
|
import tmAlerts from '@/tm-vuetify/components/tm-alerts/tm-alerts.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'comment-list',
|
name: 'comment-list',
|
||||||
components: { tmEmpty, tmButton },
|
components: { tmEmpty, tmButton, tmAlerts },
|
||||||
props: {
|
props: {
|
||||||
// 是否禁用评论
|
// 是否禁用评论
|
||||||
disallowComment: {
|
disallowComment: {
|
||||||
@@ -127,6 +142,7 @@ export default {
|
|||||||
this.result = res.data;
|
this.result = res.data;
|
||||||
this.dataList = res.data.content;
|
this.dataList = res.data.content;
|
||||||
this.loading = 'success';
|
this.loading = 'success';
|
||||||
|
this.$emit('on-loaded', this.dataList);
|
||||||
} else {
|
} else {
|
||||||
this.loading = 'error';
|
this.loading = 'error';
|
||||||
}
|
}
|
||||||
@@ -200,7 +216,7 @@ export default {
|
|||||||
position: relative;
|
position: relative;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding-left: 24rpx;
|
padding-left: 24rpx;
|
||||||
font-size: 34rpx;
|
font-size: 30rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
@@ -209,7 +225,7 @@ export default {
|
|||||||
left: 0rpx;
|
left: 0rpx;
|
||||||
top: 8rpx;
|
top: 8rpx;
|
||||||
width: 8rpx;
|
width: 8rpx;
|
||||||
height: 30rpx;
|
height: 26rpx;
|
||||||
background-color: rgb(3, 174, 252);
|
background-color: rgb(3, 174, 252);
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
// 获取博主信息
|
// 获取博主信息
|
||||||
bloggerInfo() {
|
bloggerInfo() {
|
||||||
let blogger = this.$tm.vx.getters().blogger.getBlogger;
|
let blogger = this.$tm.vx.getters().getBlogger;
|
||||||
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
|
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
|
||||||
return blogger;
|
return blogger;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
#如何使用
|
|
||||||
###js
|
|
||||||
```javascript
|
|
||||||
import lffBarrage from '@/components/lff-barrage/lff-barrage.vue'
|
|
||||||
components:{lffBarrage},
|
|
||||||
methods:{
|
|
||||||
colrdo(){ //插入一条弹幕
|
|
||||||
this.$refs.lffBarrage.add({item:'你好呀小伙子'});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
###HTML
|
|
||||||
```html
|
|
||||||
<lff-barrage ref="lffBarrage"></lff-barrage>
|
|
||||||
```
|
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
<template>
|
||||||
|
<view class="scroll-btn" :style="{ bottom: bottom }" @click.stop="fnScroll()">
|
||||||
|
<text v-if="_scrollTop >= 180" class="iconfont icon-long-arrow-up"></text>
|
||||||
|
<text v-else class="iconfont icon-long-arrow-down"></text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import throttle from '@/utils/throttle.js';
|
||||||
|
export default {
|
||||||
|
name: 'scroll-btn',
|
||||||
|
props: {
|
||||||
|
bottom: {
|
||||||
|
type: String,
|
||||||
|
default: '180rpx'
|
||||||
|
},
|
||||||
|
scrollTop: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return { timer: null, _scrollTop: 0 };
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
scrollTop(val) {
|
||||||
|
this._scrollTop = val;
|
||||||
|
this.$forceUpdate();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this._scrollTop = this.scrollTop;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fnScroll() {
|
||||||
|
throttle(() => {
|
||||||
|
this.$emit('on-status', false);
|
||||||
|
const isTop = this._scrollTop >= 180;
|
||||||
|
this._scrollTop = isTop ? 0 : 999999999999;
|
||||||
|
uni.pageScrollTo({
|
||||||
|
duration: 500,
|
||||||
|
scrollTop: this._scrollTop,
|
||||||
|
success: () => {
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
this.$emit('on-status', true);
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.$emit('update:scrollTop', this._scrollTop);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.scroll-btn {
|
||||||
|
position: fixed;
|
||||||
|
// bottom: 200rpx;
|
||||||
|
// right: -90rpx;
|
||||||
|
right: 52rpx;
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 4rpx solid #ffffff;
|
||||||
|
background-color: #bfe9ef;
|
||||||
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.1);
|
||||||
|
z-index: 99;
|
||||||
|
transition: right 0.5s ease-in-out;
|
||||||
|
|
||||||
|
&.is-show {
|
||||||
|
right: 52rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -15,6 +15,16 @@ export default {
|
|||||||
},
|
},
|
||||||
// 文章详情广告
|
// 文章详情广告
|
||||||
articleDetail: {
|
articleDetail: {
|
||||||
use: false, // 是否启用
|
// 微信广告/dclound申请的广告
|
||||||
|
use: true,
|
||||||
|
|
||||||
|
// 自定义广告
|
||||||
|
custom: {
|
||||||
|
use: true,
|
||||||
|
cover: 'https://b.925i.cn/uni_halo/uni_halo_ad_cover.png',
|
||||||
|
title: 'uni-halo 正式开源啦,欢迎来使用和体验!',
|
||||||
|
content: '基于 uni-app + halo1.x API 实现一款现代化的开源博客 / CMS 系统API开发的多端应用。功能包括:前台博客系统 和 后台管理系统,同时满足浏览和管理两端合一的需求,真正实现一个应用实现博客浏览和后台管理。',
|
||||||
|
url: 'https://uni-halo.925i.cn'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,19 +14,44 @@ export default {
|
|||||||
showAbout: true, // 显示关于项目入口
|
showAbout: true, // 显示关于项目入口
|
||||||
uni_halo_logo: 'https://b.925i.cn/uni_halo/uni_halo_logo.png', // uni-halo的logo
|
uni_halo_logo: 'https://b.925i.cn/uni_halo/uni_halo_logo.png', // uni-halo的logo
|
||||||
|
|
||||||
apiUrl: '', // Api基础域名(您的halo博客基础域名或者是Halo后台管理系统api地址)
|
apiUrl: '', // Api基础域名 [必填] :你的Halo博客基础域名
|
||||||
apiAuthorization: '', // Halo中-系统-博客设置-切换到高级选项-API设置-Access key
|
apiAuthorization: '', // Api认证key [必填]: Halo中-系统-博客设置-切换到高级选项-API设置-Access key
|
||||||
|
|
||||||
title: '', // 博客标题
|
title: '', // 博客标题 [建议必填]:在某些页面没有设置具体的页面名称时候,使用该值显示
|
||||||
indexImageUrl: '', // 开屏首页图片
|
miniCodeImageUrl: '', // 小程序的太阳码/二维码的图片地址 [建议必填]
|
||||||
miniCodeImageUrl: '', // 小程序码地址
|
|
||||||
|
|
||||||
author: {
|
aboutProfileImageUrl: '', // 关于页面中的资料卡背景图 [建议必填]
|
||||||
name: '', // 昵称
|
|
||||||
avatar: '', // 头像地址
|
// 启动页面的配置(页面地址`/pagesA/start/start`)
|
||||||
motto: '', // 格言
|
start: {
|
||||||
|
use: true, // 是否使用首次启动页:用户第一次使用你的应用会显示否则不显示
|
||||||
|
title: 'uni-halo', // 启动页面中的文字标题
|
||||||
|
bg: '', // 留空则使用默认 开屏首页背景,可以是颜色值或者图片图片地址
|
||||||
|
logo: 'https://b.925i.cn/uni_halo/uni_halo_logo.png', // logo
|
||||||
|
desc1: '全新UI,准备出发', // 描述信息1
|
||||||
|
desc2: '新触动 新感受 新体验', // 描述信息2
|
||||||
|
btnText: '全新触发' // 按钮文字
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 博主信息
|
||||||
|
author: {
|
||||||
|
use: true, // 是否启用这里配置的信息,不启用则获取PC端博客设置的信息
|
||||||
|
nickname: '', // 昵称
|
||||||
|
avatar: '', // 头像
|
||||||
|
email: '', // 邮箱
|
||||||
|
description: '', // 介绍
|
||||||
|
},
|
||||||
|
|
||||||
|
// 版权信息(用于文章详情)
|
||||||
|
copyright: {
|
||||||
|
use: true, // 是否使用版权描述
|
||||||
|
author: '', // 版权归属说明
|
||||||
|
description: '', // 版权描述
|
||||||
|
violation: '', // 侵权处理说明
|
||||||
|
},
|
||||||
|
|
||||||
|
// 社交信息(将会在`/pagesA/contact/contact`页面中展示)
|
||||||
|
// 具体的某个参数值留空则不展示
|
||||||
social: {
|
social: {
|
||||||
qq: "", // qq号
|
qq: "", // qq号
|
||||||
wechat: "", // 微信号
|
wechat: "", // 微信号
|
||||||
@@ -41,6 +66,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
defaultThumbnailUrl: '', // 默认封面图地址
|
defaultThumbnailUrl: '', // 默认封面图地址
|
||||||
|
defaultStaticThumbnailUrl: '', // 静态默认封面图(不可以是随机图地址)
|
||||||
defaultImageUrl: '', // 默认图片地址
|
defaultImageUrl: '', // 默认图片地址
|
||||||
defaultAvatarUrl: '', // 默认头像地址
|
defaultAvatarUrl: '', // 默认头像地址
|
||||||
|
|
||||||
@@ -55,8 +81,8 @@ export default {
|
|||||||
list: [],
|
list: [],
|
||||||
},
|
},
|
||||||
|
|
||||||
quickNav: { // 快捷导航配置
|
quickNav: { // 快捷导航配置(如不需要恋爱日记,请注释或删除94-101行的代码)
|
||||||
use: true,
|
use: true, // 是否在个人中心显示以下页面的入口
|
||||||
list: [{
|
list: [{
|
||||||
icon: 'halocoloricon-classify',
|
icon: 'halocoloricon-classify',
|
||||||
text: '文章归档',
|
text: '文章归档',
|
||||||
@@ -97,8 +123,8 @@ export default {
|
|||||||
title: '', // 小程序分享标题[非必填]
|
title: '', // 小程序分享标题[非必填]
|
||||||
desc: '', // 小程序分享描述[非必填]
|
desc: '', // 小程序分享描述[非必填]
|
||||||
imageUrl: '', // 小程序分享时候图片地址[非必填]
|
imageUrl: '', // 小程序分享时候图片地址[非必填]
|
||||||
path: '/pages/start/start', // 分享路径[非必填] - 基本不需要修改
|
path: '/pages/index/index', // 分享路径[非必填] - 基本不需要修改
|
||||||
copyLink: '/pages/start/start', // 复制链接[非必填] - 基本不需要修改
|
copyLink: '/pages/index/index', // 复制链接[非必填] - 基本不需要修改
|
||||||
query: {}, // 分享参数[非必填] - 基本不需要填写
|
query: {}, // 分享参数[非必填] - 基本不需要填写
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,148 @@
|
|||||||
|
/**
|
||||||
|
* 恋爱日记配置
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
waveImageUrl: 'https://b.925i.cn/uni_halo/uni_halo_about_wave.gif', // 波浪图片地址
|
||||||
|
bgImageUrl: 'https://b.925i.cn/uni_halo_love/love_bg1.png', // 背景图片
|
||||||
|
loveImageUrl: 'https://b.925i.cn/uni_halo_love/like.png', // 爱心图片
|
||||||
|
|
||||||
|
boy: {
|
||||||
|
name: '未知男主',
|
||||||
|
avatar: 'https://b.925i.cn/uni_halo_love/love_boy.png',
|
||||||
|
birthday: '2022-09-25', // 生日
|
||||||
|
},
|
||||||
|
|
||||||
|
girl: {
|
||||||
|
name: '未知女主',
|
||||||
|
avatar: 'https://b.925i.cn/uni_halo_love/love_girl.png',
|
||||||
|
birthday: '2022-04-19', // 生日
|
||||||
|
},
|
||||||
|
timeTitle: '这是我们一起走过的',
|
||||||
|
loveStartDate: '2022-04-10 13:14:20', // 恋爱开始时间
|
||||||
|
|
||||||
|
nav: [{
|
||||||
|
key: 'journey',
|
||||||
|
use: true,
|
||||||
|
iconImageUrl: 'https://b.925i.cn/uni_halo_love/diandian.png',
|
||||||
|
title: '关于我们',
|
||||||
|
desc: '我们一起度过的那些经历'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'album',
|
||||||
|
use: true,
|
||||||
|
iconImageUrl: 'https://b.925i.cn/uni_halo_love/diandian.png',
|
||||||
|
title: '恋爱相册',
|
||||||
|
desc: '定格了我们的那些小美好'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'list',
|
||||||
|
use: true,
|
||||||
|
iconImageUrl: 'https://b.925i.cn/uni_halo_love/diandian.png',
|
||||||
|
title: '恋爱清单',
|
||||||
|
desc: '你我之间的约定我们都在努力实现'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
// 关于我们:支持富文本内容
|
||||||
|
journey: `
|
||||||
|
准备晚安啦,睡觉前讲个故事吧~<p>槐树庄的村口有一棵大槐树,树下的村口第一家就是猫奶奶的家。</p><p>猫奶奶是一位孤寡老人,因为她经常收留和救治周围的流浪猫,所以村民就都管她叫“猫奶奶”。</p><p>一个月圆之夜,猫奶奶走到院门口,忽然发现门口石级上放着一个红毯子,里面包着一个啼(tí)哭的女婴。</p><p>猫奶奶找不到女婴的父母,只好收留了她,并给她起了个名字叫樱红。</p><p>猫奶奶辛苦地抚育着樱红成长,转眼之间,樱红已经九岁,上小学三年级了。</p><p>从樱红懂事起,猫奶奶就爱给她讲一个睡前故事,那是当地一个古老的传说。</p><p>在浓郁的树影深处有一个百花园,百花园里生长着奇花异草,还住了一个会唱歌的花仙子。花仙子的歌声美丽动人,能治百病。但是那里有一条奇怪的规矩,寻找花仙子的人在进入百花园后,见到花仙子之前,都不能发出一点声音,不然花仙子就不会出来见他。</p><p>受这个故事的影响,樱红特别喜欢唱歌。</p><p>这天晚上,樱红放学回家,家家户户炊烟袅(niǎo)袅,而自家烟囱却连一丝一缕(lǚ)的炊烟都没有。</p><p>樱红一惊,冲进院门一看,果然出事了!只见猫奶奶呻吟着倒在灶台前,双目紧闭,两只小脚也在不停地抽搐(chù)。</p><p>樱红慌了,好在有邻居的帮助,猫奶奶被送到了医院。经过抢救,猫奶奶总算醒过来,但是却半身不遂(suí),说话也不利落了。</p><p>猫奶奶不能下地行走做家务,小小的樱红,一夜之间就挑起了家庭的重担。</p><p>樱红一面求助于村委会,四处寻医问药,让猫奶奶获得进一步的治疗;一面在课余学做家务,悉心照顾猫奶奶,端水喂饭,不辞辛苦。</p><p>自从猫奶奶病倒以后,樱红每天早晨推开院门就会看见门前放着一朵小花,有时还会有一两尾鲜活的鲑(guī)鱼。</p><p>这样过了三个月,好奇的樱红在一个夜晚悄悄躲在院门的后面,想看看到底是谁。</p><p>到了午夜十二点,只见一只花猫衔着一棵风铃草来到院门前,把风铃草放下,转身就走。(浪漫童话小故事)樱红认出这只小花猫曾经被猫奶奶救助过,于是,她悄悄地尾随小花猫往前走。</p><p>不一会儿,她就发现自己进入了一个从未见过的世界:蔚蓝的天空飘着七色的云,阳光千丝万缕地落下来,鲜花盛开,彩蝶飞舞,百鸟齐鸣。</p><p>这到底是什么地方?她忽然想起了那个传说,这该不会就是花仙子住的百花园吧?</p><p>樱红几乎惊叫起来,但她立即想起了那条在见到花仙子之前,不能发出一点声音的规矩。于是她捂紧了嘴巴。</p><p>这时,她发现百花园里除了自己还有一个面色苍白的男孩子,闭着眼睛,右手攥着一根竹竿摸索着前行,应该是眼睛看不见了。</p><p>只见男孩子慢慢地偏离了路径,马上就要掉进路边的水沟里了。</p><p>樱红下意识地大声呼喊:“站住,小心脚底下!”一张口,樱红才想起来,自己已经坏了规矩!</p><p>此时,“轰隆”一声巨响后,眼前的一切都消失了,樱红仍然站在自家院门前的大槐树下。</p><p>真遗憾啊!樱红深深叹了口气,可为了救人,她并不觉得后悔。</p><p>第二天早上,樱红被一种美妙的歌声唤醒。</p><p>唱歌的人就是美丽的花仙子,她乘坐着奇花异草编成的花篮,飘进了她家的院子里。</p><p>奇迹发生了,只见猫奶奶起身下床,像健康人一样走出房门。</p><p>猫奶奶看到了花仙子,不敢相信地揉着眼睛说:“你就是传说中的花仙子吗?是你治好了我的病?”</p><p>花仙子说:“是的!是这个小女孩的善良打动了我,连我那不能出声的规矩都要为她破例了。”</p><p>樱红高兴地看着猫奶奶。从此,她和猫奶奶继续幸福地生活着。</p>
|
||||||
|
`,
|
||||||
|
// 恋爱相册
|
||||||
|
albumKeyName: '恋爱相册', // 对应后台的图库分组名称
|
||||||
|
// 恋爱清单
|
||||||
|
loveList: {
|
||||||
|
useApi: false, // 是否启用api接口
|
||||||
|
api: '', // api 接口(如果使用api接口的方式,则下方的data可以留空,但是api接口必须按照对应的数据格式返回)
|
||||||
|
data: [{
|
||||||
|
index: 0, // 序号
|
||||||
|
finish: true, // 是否已完成
|
||||||
|
title: '偷偷记录对方熟睡的模样', // 事件名称
|
||||||
|
desc: '偷偷观察对方熟睡的模样,记录下来', // 事件描述
|
||||||
|
detail: {
|
||||||
|
start: '2022年05月20日', // 计划开始时间
|
||||||
|
desc: '偷偷观察对方熟睡的模样,记录下来', // 事件详细描述
|
||||||
|
end: '每天', // 完成时间,
|
||||||
|
moment: '', // 完成瞬间的记录
|
||||||
|
other: '', // 其他说明
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
index: 1,
|
||||||
|
finish: false,
|
||||||
|
title: '陪对方过生日',
|
||||||
|
desc: '陪对方一起过生日',
|
||||||
|
detail: {
|
||||||
|
start: '2023年05月20日',
|
||||||
|
desc: '陪对方一起过生日,他和我的生日',
|
||||||
|
end: '',
|
||||||
|
moment: '',
|
||||||
|
other: '他 生日5月20日 我生日9月25日',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
index: 2,
|
||||||
|
finish: false,
|
||||||
|
title: '一起去旅行',
|
||||||
|
desc: '一起来一场说走就走的旅行,希望去的是大理',
|
||||||
|
detail: {
|
||||||
|
start: '',
|
||||||
|
desc: '',
|
||||||
|
end: '',
|
||||||
|
moment: '一起来一场说走就走的旅行,希望去的是大理',
|
||||||
|
other: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
index: 3,
|
||||||
|
finish: false,
|
||||||
|
title: '一起穿情侣装逛街',
|
||||||
|
desc: '一起穿情侣装逛街',
|
||||||
|
detail: {
|
||||||
|
start: '',
|
||||||
|
desc: '',
|
||||||
|
end: '',
|
||||||
|
moment: '',
|
||||||
|
other: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
index: 4,
|
||||||
|
finish: false,
|
||||||
|
title: '一起看日出',
|
||||||
|
desc: '一起看日出',
|
||||||
|
detail: {
|
||||||
|
start: '',
|
||||||
|
desc: '',
|
||||||
|
end: '',
|
||||||
|
moment: '',
|
||||||
|
other: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
index: 5,
|
||||||
|
finish: false,
|
||||||
|
title: '一起看日落',
|
||||||
|
desc: '一起看日落',
|
||||||
|
detail: {
|
||||||
|
start: '',
|
||||||
|
desc: '',
|
||||||
|
end: '',
|
||||||
|
moment: '',
|
||||||
|
other: '', // 其他说明
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
index: 6,
|
||||||
|
finish: false,
|
||||||
|
title: '一起买菜、做饭、刷碗',
|
||||||
|
desc: '一起买菜、做饭、刷碗',
|
||||||
|
detail: {
|
||||||
|
start: '',
|
||||||
|
desc: '',
|
||||||
|
end: '',
|
||||||
|
moment: '',
|
||||||
|
other: '',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
/**
|
||||||
|
* 恋爱日记配置
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
waveImageUrl: 'https://b.925i.cn/uni_halo/uni_halo_about_wave.gif', // 波浪图片地址
|
||||||
|
bgImageUrl: 'https://b.925i.cn/uni_halo_love/love_bg1.png', // 背景图片
|
||||||
|
loveImageUrl: 'https://b.925i.cn/uni_halo_love/like.png', // 爱心图片
|
||||||
|
|
||||||
|
boy: {
|
||||||
|
name: '未知男主',
|
||||||
|
avatar: 'https://b.925i.cn/uni_halo_love/love_boy.png',
|
||||||
|
birthday: '2022-09-25', // 生日
|
||||||
|
},
|
||||||
|
|
||||||
|
girl: {
|
||||||
|
name: '未知女主',
|
||||||
|
avatar: 'https://b.925i.cn/uni_halo_love/love_girl.png',
|
||||||
|
birthday: '2022-07-25', // 生日
|
||||||
|
},
|
||||||
|
|
||||||
|
timeTitle: '这是我们一起走过的', // 恋爱时间标题
|
||||||
|
loveStartDate: '2022-05-20 13:14:20', // 恋爱开始时间
|
||||||
|
|
||||||
|
// 恋爱日记首页导航(除了 key 以外都可以修改)
|
||||||
|
nav: [{
|
||||||
|
key: 'journey',
|
||||||
|
use: true,
|
||||||
|
iconImageUrl: 'https://b.925i.cn/uni_halo_love/diandian.png',
|
||||||
|
title: '关于我们',
|
||||||
|
desc: '我们一起度过的那些经历'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'album',
|
||||||
|
use: true,
|
||||||
|
iconImageUrl: 'https://b.925i.cn/uni_halo_love/diandian.png',
|
||||||
|
title: '恋爱相册',
|
||||||
|
desc: '定格了我们的那些小美好'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'list',
|
||||||
|
use: true,
|
||||||
|
iconImageUrl: 'https://b.925i.cn/uni_halo_love/diandian.png',
|
||||||
|
title: '恋爱清单',
|
||||||
|
desc: '你我之间的约定我们都在努力实现'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
// 关于我们:支持富文本内容
|
||||||
|
journey: `
|
||||||
|
<p>有一只马,它的邻居是一只驴。</p><p>有一天,马和驴都被主人牵到外面晒太阳,马和驴聊起了天。</p><p>马说:“我叫马,你呢?”</p><p>驴说:“我叫驴。(哄小宝贝睡觉的甜甜睡前故事)”</p><p>马说:“为什么我俩的名字不一样呢?”</p><p>驴说:“因为我和你不一样。”</p><p>马说:“我们俩什么地方不一样呢?”</p><p>驴说:“我身材小巧,而你却比较粗壮,不如我耐看。”马看了看比自已矮小很多的驴,认为驴说的话有点道理。</p><p>马说:“我们俩除了身材不一样,还有什么不同呢?”</p><p>驴说:“我们俩的声音不一样,我的声音多动听呀!”说着驴伸长脖子叫了两声。“不信,你也叫两声试试。”马也伸长脖子嘶鸣了两声,的确和驴的声音有点不同,马不好意思地低下了头。</p><p>过了一会儿,马又说:“我们俩除了身材和声音不一样外,还有什么不同呢?”</p><p>驴说:“我的步伐多么优雅呀。”说着,驴迈开蹄子走了两步,“而你呢,却昂首阔步,一点儿也不优雅,(如何哄女朋友睡觉的睡前故事爱情浪漫)不信你走两步试试。”</p><p>马听驴这么一说,就高昂着头走了两步,旋即,马飞奔了起来,转了一圈回来后,驴得意地说:“怎么样,我没说错罢,你就是急性子,和优雅不沾边。”马听了驴的话,有点感到惭愧。</p><p>最后,马又鼓起勇气说:“我们俩还有什么不同呢?”</p><p>驴说:“我的家庭意识比你强,主人抽我一鞭子,我就跟着主人回家,而你呢?恐怕不会吧……”</p><p>马还没有来得及回答,马和驴的主人同时来到了马和驴的身边。只见驴的主人抽了驴一鞭子后,驴乖乖地跟着主人回家了。马把这一切都看在了眼里,它为自已和驴的诸多不同而感到惭愧,只见马的主人也抽了马一鞭子,马犹豫了一下,终于象驴一样乖乖地跟着主人回了家。</p><p>一个伯乐站在远处看到了这一幕后,叹口气离开了。</p>
|
||||||
|
`,
|
||||||
|
// 恋爱相册
|
||||||
|
albumKeyName: '恋爱相册', // 对应后台的图库分组名称
|
||||||
|
// 恋爱清单
|
||||||
|
loveList: {
|
||||||
|
useApi: false, // 是否启用api接口
|
||||||
|
api: '', // api 接口(如果使用api接口的方式,则下方的data可以留空,但是api接口必须按照对应的数据格式返回)
|
||||||
|
data: [{
|
||||||
|
index: 0, // 序号
|
||||||
|
finish: true, // 是否已完成
|
||||||
|
title: '偷偷记录对方熟睡的模样', // 事件名称
|
||||||
|
desc: '偷偷观察对方熟睡的模样,记录下来', // 事件描述
|
||||||
|
detail: {
|
||||||
|
start: '2022年05月20日', // 计划开始时间
|
||||||
|
desc: '偷偷观察对方熟睡的模样,记录下来', // 事件详细描述
|
||||||
|
end: '每天', // 完成时间,
|
||||||
|
moment: '', // 完成瞬间的记录
|
||||||
|
other: '', // 其他说明
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
index: 1,
|
||||||
|
finish: false,
|
||||||
|
title: '陪对方过生日',
|
||||||
|
desc: '陪对方一起过生日',
|
||||||
|
detail: {
|
||||||
|
start: '2023年05月20日',
|
||||||
|
desc: '陪对方一起过生日,他和我的生日',
|
||||||
|
end: '',
|
||||||
|
moment: '',
|
||||||
|
other: '他 生日5月20日 我生日9月25日',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
index: 2,
|
||||||
|
finish: false,
|
||||||
|
title: '一起去旅行',
|
||||||
|
desc: '一起来一场说走就走的旅行,希望去的是大理',
|
||||||
|
detail: {
|
||||||
|
start: '',
|
||||||
|
desc: '',
|
||||||
|
end: '',
|
||||||
|
moment: '一起来一场说走就走的旅行,希望去的是大理',
|
||||||
|
other: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
index: 3,
|
||||||
|
finish: false,
|
||||||
|
title: '一起穿情侣装逛街',
|
||||||
|
desc: '一起穿情侣装逛街',
|
||||||
|
detail: {
|
||||||
|
start: '',
|
||||||
|
desc: '',
|
||||||
|
end: '',
|
||||||
|
moment: '',
|
||||||
|
other: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
index: 4,
|
||||||
|
finish: false,
|
||||||
|
title: '一起看日出',
|
||||||
|
desc: '一起看日出',
|
||||||
|
detail: {
|
||||||
|
start: '',
|
||||||
|
desc: '',
|
||||||
|
end: '',
|
||||||
|
moment: '',
|
||||||
|
other: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
index: 5,
|
||||||
|
finish: false,
|
||||||
|
title: '一起看日落',
|
||||||
|
desc: '一起看日落',
|
||||||
|
detail: {
|
||||||
|
start: '',
|
||||||
|
desc: '',
|
||||||
|
end: '',
|
||||||
|
moment: '',
|
||||||
|
other: '', // 其他说明
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
index: 6,
|
||||||
|
finish: false,
|
||||||
|
title: '一起买菜、做饭、刷碗',
|
||||||
|
desc: '一起买菜、做饭、刷碗',
|
||||||
|
detail: {
|
||||||
|
start: '',
|
||||||
|
desc: '',
|
||||||
|
end: '',
|
||||||
|
moment: '',
|
||||||
|
other: '',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
+215
-157
@@ -1,159 +1,217 @@
|
|||||||
{
|
{
|
||||||
"name": "uni-halo",
|
"name" : "uni-halo",
|
||||||
"appid": "__UNI__5748B6E",
|
"appid" : "__UNI__5748B6E",
|
||||||
"description": "uni-halo博客:基于halo开源博客系统API开发的多端博客。",
|
"description" : "uni-halo博客:基于halo开源博客系统API开发的多端博客。",
|
||||||
"versionName": "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
"versionCode": 100,
|
"versionCode" : 100,
|
||||||
"transformPx": false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus": {
|
"app-plus" : {
|
||||||
"usingComponents": true,
|
"usingComponents" : true,
|
||||||
"nvueStyleCompiler": "uni-app",
|
"nvueStyleCompiler" : "uni-app",
|
||||||
"compilerVersion": 3,
|
"compilerVersion" : 3,
|
||||||
"splashscreen": {
|
"splashscreen" : {
|
||||||
"alwaysShowBeforeRender": true,
|
"alwaysShowBeforeRender" : true,
|
||||||
"waiting": true,
|
"waiting" : true,
|
||||||
"autoclose": true,
|
"autoclose" : true,
|
||||||
"delay": 0
|
"delay" : 0
|
||||||
},
|
},
|
||||||
/* 模块配置 */
|
/* 模块配置 */
|
||||||
"modules": {
|
"modules" : {
|
||||||
"OAuth": {},
|
"OAuth" : {},
|
||||||
"Share": {}
|
"Share" : {}
|
||||||
},
|
},
|
||||||
/* 应用发布信息 */
|
/* 应用发布信息 */
|
||||||
"distribute": {
|
"distribute" : {
|
||||||
/* android打包配置 */
|
/* android打包配置 */
|
||||||
"android": {
|
"android" : {
|
||||||
"permissions": [
|
"permissions" : [
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CAPTURE_VIDEO_OUTPUT\"/>",
|
"<uses-permission android:name=\"android.permission.CAPTURE_VIDEO_OUTPUT\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
/* ios打包配置 */
|
/* ios打包配置 */
|
||||||
"ios": {
|
"ios" : {
|
||||||
"dSYMs": false,
|
"dSYMs" : false,
|
||||||
"capabilities": {
|
"capabilities" : {
|
||||||
"entitlements": {
|
"entitlements" : {
|
||||||
"com.apple.developer.associated-domains": [
|
"com.apple.developer.associated-domains" : [ "applinks:static-699a26a5-a6cd-4b54-b603-5155b312a5f5.bspapp.com" ]
|
||||||
"applinks:static-699a26a5-a6cd-4b54-b603-5155b312a5f5.bspapp.com"
|
}
|
||||||
]
|
}
|
||||||
}
|
},
|
||||||
}
|
/* SDK配置 */
|
||||||
},
|
"sdkConfigs" : {
|
||||||
/* SDK配置 */
|
"ad" : {
|
||||||
"sdkConfigs": {
|
"gdt" : {},
|
||||||
"ad": {
|
"csj" : {},
|
||||||
"gdt": {},
|
"360" : {},
|
||||||
"csj": {},
|
"ks" : {},
|
||||||
"360": {},
|
"sigmob" : {},
|
||||||
"ks": {},
|
"hw" : {},
|
||||||
"sigmob": {},
|
"bd" : {}
|
||||||
"hw": {},
|
},
|
||||||
"bd": {}
|
"oauth" : {
|
||||||
},
|
"weixin" : {
|
||||||
"oauth": {
|
"appid" : "wxd971954762ec4744",
|
||||||
"weixin": {
|
"UniversalLinks" : "https://static-699a26a5-a6cd-4b54-b603-5155b312a5f5.bspapp.com/uni-universallinks/__UNI__5748B6E/"
|
||||||
"appid": "wxd971954762ec4744",
|
}
|
||||||
"UniversalLinks": "https://static-699a26a5-a6cd-4b54-b603-5155b312a5f5.bspapp.com/uni-universallinks/__UNI__5748B6E/"
|
},
|
||||||
}
|
"share" : {
|
||||||
},
|
"weixin" : {
|
||||||
"share": {
|
"appid" : "wxd971954762ec4744",
|
||||||
"weixin": {
|
"UniversalLinks" : "https://static-699a26a5-a6cd-4b54-b603-5155b312a5f5.bspapp.com/uni-universallinks/__UNI__5748B6E/"
|
||||||
"appid": "wxd971954762ec4744",
|
}
|
||||||
"UniversalLinks": "https://static-699a26a5-a6cd-4b54-b603-5155b312a5f5.bspapp.com/uni-universallinks/__UNI__5748B6E/"
|
}
|
||||||
}
|
},
|
||||||
}
|
"icons" : {
|
||||||
},
|
"android" : {
|
||||||
"icons": {
|
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||||
"android": {
|
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||||
"hdpi": "unpackage/res/icons/72x72.png",
|
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||||
"xhdpi": "unpackage/res/icons/96x96.png",
|
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||||
"xxhdpi": "unpackage/res/icons/144x144.png",
|
},
|
||||||
"xxxhdpi": "unpackage/res/icons/192x192.png"
|
"ios" : {
|
||||||
},
|
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||||
"ios": {
|
"ipad" : {
|
||||||
"appstore": "unpackage/res/icons/1024x1024.png",
|
"app" : "unpackage/res/icons/76x76.png",
|
||||||
"ipad": {
|
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||||
"app": "unpackage/res/icons/76x76.png",
|
"notification" : "unpackage/res/icons/20x20.png",
|
||||||
"app@2x": "unpackage/res/icons/152x152.png",
|
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||||
"notification": "unpackage/res/icons/20x20.png",
|
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
"settings" : "unpackage/res/icons/29x29.png",
|
||||||
"proapp@2x": "unpackage/res/icons/167x167.png",
|
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||||
"settings": "unpackage/res/icons/29x29.png",
|
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||||
"spotlight": "unpackage/res/icons/40x40.png",
|
},
|
||||||
"spotlight@2x": "unpackage/res/icons/80x80.png"
|
"iphone" : {
|
||||||
},
|
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||||
"iphone": {
|
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||||
"app@2x": "unpackage/res/icons/120x120.png",
|
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||||
"app@3x": "unpackage/res/icons/180x180.png",
|
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||||
"notification@3x": "unpackage/res/icons/60x60.png",
|
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||||
"settings@3x": "unpackage/res/icons/87x87.png",
|
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||||
"spotlight@2x": "unpackage/res/icons/80x80.png",
|
}
|
||||||
"spotlight@3x": "unpackage/res/icons/120x120.png"
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
"uniStatistics" : {
|
||||||
}
|
"enable" : true
|
||||||
},
|
}
|
||||||
/* 快应用特有相关 */
|
},
|
||||||
"quickapp": {},
|
/* 快应用特有相关 */
|
||||||
/* 小程序特有相关 */
|
"quickapp" : {},
|
||||||
"mp-weixin": {
|
/* 小程序特有相关 */
|
||||||
"appid": "wx1bb161867082c72f",
|
"mp-weixin" : {
|
||||||
"setting": {
|
"appid" : "wx1bb161867082c72f",
|
||||||
"urlCheck": false,
|
"setting" : {
|
||||||
"minified": true
|
"urlCheck" : false,
|
||||||
},
|
"minified" : true
|
||||||
"usingComponents": true
|
},
|
||||||
},
|
"usingComponents" : true,
|
||||||
"mp-alipay": {
|
"uniStatistics" : {
|
||||||
"usingComponents": true
|
"enable" : true
|
||||||
},
|
}
|
||||||
"mp-baidu": {
|
},
|
||||||
"usingComponents": true
|
"mp-alipay" : {
|
||||||
},
|
"usingComponents" : true,
|
||||||
"mp-toutiao": {
|
"uniStatistics" : {
|
||||||
"usingComponents": true
|
"enable" : true
|
||||||
},
|
}
|
||||||
"uniStatistics": {
|
},
|
||||||
"enable": false
|
"mp-baidu" : {
|
||||||
},
|
"usingComponents" : true,
|
||||||
"vueVersion": "2",
|
"uniStatistics" : {
|
||||||
"h5": {
|
"enable" : true
|
||||||
"title": "uni-halo",
|
}
|
||||||
"devServer": {
|
},
|
||||||
"https": false,
|
"mp-toutiao" : {
|
||||||
"disableHostCheck": true,
|
"usingComponents" : true,
|
||||||
"proxy": {
|
"uniStatistics" : {
|
||||||
"/api": {
|
"enable" : true
|
||||||
"target": "https://b.925i.cn",
|
}
|
||||||
"changeOrigin": true,
|
},
|
||||||
"secure": false,
|
"uniStatistics" : {
|
||||||
"pathRewrite": {
|
"enable" : true,
|
||||||
"^/api": ""
|
"version" : "2"
|
||||||
}
|
},
|
||||||
}
|
"vueVersion" : "2",
|
||||||
}
|
"h5" : {
|
||||||
}
|
"title" : "uni-halo",
|
||||||
},
|
"devServer" : {
|
||||||
"_spaceID": "699a26a5-a6cd-4b54-b603-5155b312a5f5"
|
"disableHostCheck" : true,
|
||||||
|
"proxy" : {
|
||||||
|
"/api" : {
|
||||||
|
"target" : "https://b.925i.cn",
|
||||||
|
"changeOrigin" : true,
|
||||||
|
"secure" : false,
|
||||||
|
"pathRewrite" : {
|
||||||
|
"^/api" : "/api"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"optimization" : {
|
||||||
|
"preload" : true,
|
||||||
|
"treeShaking" : {
|
||||||
|
"enable" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uniStatistics" : {
|
||||||
|
"enable" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"_spaceID" : "699a26a5-a6cd-4b54-b603-5155b312a5f5",
|
||||||
|
"mp-qq" : {
|
||||||
|
"appid" : "1112285420",
|
||||||
|
"setting" : {
|
||||||
|
"minified" : true,
|
||||||
|
"postcss" : true,
|
||||||
|
"es6" : true
|
||||||
|
},
|
||||||
|
"uniStatistics" : {
|
||||||
|
"enable" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mp-jd" : {
|
||||||
|
"uniStatistics" : {
|
||||||
|
"enable" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mp-kuaishou" : {
|
||||||
|
"uniStatistics" : {
|
||||||
|
"enable" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mp-lark" : {
|
||||||
|
"uniStatistics" : {
|
||||||
|
"enable" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"quickapp-webview-huawei" : {
|
||||||
|
"uniStatistics" : {
|
||||||
|
"enable" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"quickapp-webview-union" : {
|
||||||
|
"uniStatistics" : {
|
||||||
|
"enable" : true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-7
@@ -1,9 +1,23 @@
|
|||||||
{
|
{
|
||||||
"devDependencies": {
|
"name": "uni-halo",
|
||||||
"vue-i18n": "^9.1.10"
|
"version": "1.0.0",
|
||||||
},
|
"description": "<p align=\"center\">\r <img alt=\"logo\" src=\"https://b.925i.cn/uni_halo/uni_halo_logo.png\" width=\"120\" height=\"120\" style=\"margin-bottom: 10px;\">\r </p>\r <h3 align=\"center\" style=\"margin: 30px 0 30px;font-weight: bold;font-size:40px;\">uni-halo</h3>\r <h3 align=\"center\">uni-halo 基于Halo一款现代化的开源博客/CMS系统API开发的可多端编译应用</h3>",
|
||||||
"dependencies": {
|
"repository": {
|
||||||
"uni-read-pages": "^1.0.5",
|
"type": "git",
|
||||||
"uni-simple-router": "^2.0.8-beta.4"
|
"url": "git+https://gitee.com/ialley-workshop-open/uni-halo.git"
|
||||||
}
|
},
|
||||||
|
"keywords": ["uni-halo", "小莫唐尼", "巷子工坊"],
|
||||||
|
"author": "巷子工坊丨小莫唐尼",
|
||||||
|
"license": "AGPL-3.0",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://gitee.com/ialley-workshop-open/uni-halo/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://uni-halo.925i.cn",
|
||||||
|
"devDependencies": {
|
||||||
|
"vue-i18n": "^9.1.10"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"uni-read-pages": "^1.0.5",
|
||||||
|
"uni-simple-router": "^2.0.8-beta.4"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+50
-7
@@ -110,7 +110,28 @@
|
|||||||
}, {
|
}, {
|
||||||
"path": "love/love",
|
"path": "love/love",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "恋爱日记",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"app-plus": {
|
||||||
|
"pullToRefresh": {
|
||||||
|
"color": "#03a9f4",
|
||||||
|
"style": "circle"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "love/list",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "恋爱清单",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
|
||||||
|
}, {
|
||||||
|
"path": "love/album",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "恋爱相册",
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"pullToRefresh": {
|
"pullToRefresh": {
|
||||||
@@ -119,7 +140,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"path": "love/journey",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "我们的故事",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "archives/archives",
|
"path": "archives/archives",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -201,8 +228,7 @@
|
|||||||
"path": "contact/contact",
|
"path": "contact/contact",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "联系博主",
|
"navigationBarTitleText": "联系博主",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "about/about",
|
"path": "about/about",
|
||||||
@@ -216,7 +242,24 @@
|
|||||||
"navigationBarTitleText": "设置",
|
"navigationBarTitleText": "设置",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"path": "tags/tags",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "tag-detail/tag-detail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "标签详情",
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"app-plus": {
|
||||||
|
"pullToRefresh": {
|
||||||
|
"color": "#03a9f4",
|
||||||
|
"style": "circle"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -506,7 +549,7 @@
|
|||||||
"backgroundColor": "#F8F8F8"
|
"backgroundColor": "#F8F8F8"
|
||||||
},
|
},
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
"backgroundColor": "white",
|
"backgroundColor": "#fff",
|
||||||
"borderStyle": "white",
|
"borderStyle": "white",
|
||||||
"color": "#303133",
|
"color": "#303133",
|
||||||
"selectedColor": "#03a9f4",
|
"selectedColor": "#03a9f4",
|
||||||
@@ -539,4 +582,4 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,11 +5,17 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fnCheckHadStarted();
|
this.fnCheckShowStarted();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 检查是否已经启动过
|
// 检查是否需要跳转到启动页
|
||||||
fnCheckHadStarted() {
|
fnCheckShowStarted() {
|
||||||
|
if (!getApp().globalData.start.use) {
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/tabbar/home/home'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (uni.getStorageSync('APP_HAS_STARTED')) {
|
if (uni.getStorageSync('APP_HAS_STARTED')) {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/tabbar/home/home'
|
url: '/pages/tabbar/home/home'
|
||||||
|
|||||||
+110
-24
@@ -1,11 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-page pb-24">
|
<view class="app-page pb-24">
|
||||||
<!-- 博主信息 -->
|
<!-- 博主信息 -->
|
||||||
<view class="blogger-info">
|
<view class="blogger-info" :style="[calcProfileStyle]">
|
||||||
<image class="avatar" :src="$utils.checkAvatarUrl(bloggerInfo.avatar)" mode="aspectFill" @click="miniProfileCard.show = true"></image>
|
<image class="avatar" :src="$utils.checkAvatarUrl(bloggerInfo.avatar)" mode="aspectFill"></image>
|
||||||
<view class="profile">
|
<view class="profile">
|
||||||
<view class="author mt-24 text-size-g text-weight-b">{{ bloggerInfo.nickname }}</view>
|
<view class="author mt-24 text-size-g text-weight-b">{{ bloggerInfo.nickname }}</view>
|
||||||
<view class="desc mt-24 text-size-m">{{ bloggerInfo.description || '一个爱凑热闹的、喜欢捣鼓前端的博主。' }}</view>
|
<view class="desc mt-24 text-size-m">
|
||||||
|
{{ bloggerInfo.description || '这个博主很懒,竟然没写介绍~' }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<image v-if="calcWaveUrl" :src="calcWaveUrl" mode="scaleToFill" class="gif-wave"></image>
|
<image v-if="calcWaveUrl" :src="calcWaveUrl" mode="scaleToFill" class="gif-wave"></image>
|
||||||
</view>
|
</view>
|
||||||
@@ -17,19 +19,34 @@
|
|||||||
<view class="statistics flex pt-24 pb-24" :class="{ 'has-solid': statisticsShowMore }">
|
<view class="statistics flex pt-24 pb-24" :class="{ 'has-solid': statisticsShowMore }">
|
||||||
<view class="item flex-1 text-align-center">
|
<view class="item flex-1 text-align-center">
|
||||||
<view class="number text-size-xl text-bg-gradient-orange-accent">
|
<view class="number text-size-xl text-bg-gradient-orange-accent">
|
||||||
<tm-flop :startVal="0" :decimals="0" :endVal="statistics.postCount" :duration="3000"></tm-flop>
|
<tm-flop
|
||||||
|
:startVal="0"
|
||||||
|
:decimals="0"
|
||||||
|
:endVal="statistics.postCount"
|
||||||
|
:duration="3000"
|
||||||
|
></tm-flop>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">文章总数</view>
|
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">文章总数</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item flex-1 text-align-center">
|
<view class="item flex-1 text-align-center">
|
||||||
<view class="number text-size-xl text-bg-gradient-blue-accent">
|
<view class="number text-size-xl text-bg-gradient-blue-accent">
|
||||||
<tm-flop :startVal="0" :decimals="0" :endVal="statistics.categoryCount" :duration="3000"></tm-flop>
|
<tm-flop
|
||||||
|
:startVal="0"
|
||||||
|
:decimals="0"
|
||||||
|
:endVal="statistics.categoryCount"
|
||||||
|
:duration="3000"
|
||||||
|
></tm-flop>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">分类总数</view>
|
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">分类总数</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item flex-1 text-align-center">
|
<view class="item flex-1 text-align-center">
|
||||||
<view class="number text-size-xl text-bg-gradient-green-accent">
|
<view class="number text-size-xl text-bg-gradient-green-accent">
|
||||||
<tm-flop :startVal="0" :decimals="0" :endVal="statistics.tagCount" :duration="3000"></tm-flop>
|
<tm-flop
|
||||||
|
:startVal="0"
|
||||||
|
:decimals="0"
|
||||||
|
:endVal="statistics.tagCount"
|
||||||
|
:duration="3000"
|
||||||
|
></tm-flop>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-6 text-size-s text-grey-darken-1">标签总数</view>
|
<view class="mt-6 text-size-s text-grey-darken-1">标签总数</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -37,19 +54,34 @@
|
|||||||
<view class="statistics solid-top has-solid flex pt-24 pb-24">
|
<view class="statistics solid-top has-solid flex pt-24 pb-24">
|
||||||
<view class="item flex-1 text-align-center">
|
<view class="item flex-1 text-align-center">
|
||||||
<view class="number text-size-xl text-bg-gradient-orange-accent">
|
<view class="number text-size-xl text-bg-gradient-orange-accent">
|
||||||
<tm-flop :startVal="0" :decimals="0" :endVal="statistics.commentCount" :duration="3000"></tm-flop>
|
<tm-flop
|
||||||
|
:startVal="0"
|
||||||
|
:decimals="0"
|
||||||
|
:endVal="statistics.commentCount"
|
||||||
|
:duration="3000"
|
||||||
|
></tm-flop>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">评论数量</view>
|
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">评论数量</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item flex-1 text-align-center">
|
<view class="item flex-1 text-align-center">
|
||||||
<view class="number text-size-xl text-bg-gradient-blue-accent">
|
<view class="number text-size-xl text-bg-gradient-blue-accent">
|
||||||
<tm-flop :startVal="0" :decimals="0" :endVal="statistics.linkCount" :duration="3000"></tm-flop>
|
<tm-flop
|
||||||
|
:startVal="0"
|
||||||
|
:decimals="0"
|
||||||
|
:endVal="statistics.linkCount"
|
||||||
|
:duration="3000"
|
||||||
|
></tm-flop>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">点赞数量</view>
|
<view class="mt-6 text-align-center text-size-s text-grey-darken-1">点赞数量</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item flex-1 text-align-center">
|
<view class="item flex-1 text-align-center">
|
||||||
<view class="number text-size-xl text-bg-gradient-green-accent">
|
<view class="number text-size-xl text-bg-gradient-green-accent">
|
||||||
<tm-flop :startVal="0" :decimals="0" :endVal="statistics.visitCount" :duration="3000"></tm-flop>
|
<tm-flop
|
||||||
|
:startVal="0"
|
||||||
|
:decimals="0"
|
||||||
|
:endVal="statistics.visitCount"
|
||||||
|
:duration="3000"
|
||||||
|
></tm-flop>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-6 text-size-s text-grey-darken-1">访客数量</view>
|
<view class="mt-6 text-size-s text-grey-darken-1">访客数量</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -60,7 +92,12 @@
|
|||||||
|
|
||||||
<!-- 快捷导航 -->
|
<!-- 快捷导航 -->
|
||||||
<view v-if="useQuickNav" class="quick-nav flex flex-between round-3 ma-24 pa-24 pl-40 pr-40">
|
<view v-if="useQuickNav" class="quick-nav flex flex-between round-3 ma-24 pa-24 pl-40 pr-40">
|
||||||
<view class="quick-nav-item flex flex-col flex-center" v-for="(nav, index) in quickNavList" :key="index" @click="fnToNavPage(nav)">
|
<view
|
||||||
|
class="quick-nav-item flex flex-col flex-center"
|
||||||
|
v-for="(nav, index) in quickNavList"
|
||||||
|
:key="index"
|
||||||
|
@click="fnToNavPage(nav)"
|
||||||
|
>
|
||||||
<view class="icon round-24 halocoloricon" :class="[nav.icon]"></view>
|
<view class="icon round-24 halocoloricon" :class="[nav.icon]"></view>
|
||||||
<view class="name text-size-s mt-8">{{ nav.text }}</view>
|
<view class="name text-size-s mt-8">{{ nav.text }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -80,7 +117,9 @@
|
|||||||
@click="fnOnNav(nav)"
|
@click="fnOnNav(nav)"
|
||||||
>
|
>
|
||||||
<template slot="rightValue">
|
<template slot="rightValue">
|
||||||
<button class="right-value-btn" v-if="nav.openType" :open-type="nav.openType">{{ nav.rightText }}</button>
|
<button class="right-value-btn" v-if="nav.openType" :open-type="nav.openType">
|
||||||
|
{{ nav.rightText }}
|
||||||
|
</button>
|
||||||
<text v-else>{{ nav.rightText }}</text>
|
<text v-else>{{ nav.rightText }}</text>
|
||||||
</template>
|
</template>
|
||||||
</tm-listitem>
|
</tm-listitem>
|
||||||
@@ -88,7 +127,9 @@
|
|||||||
</tm-grouplist>
|
</tm-grouplist>
|
||||||
</view>
|
</view>
|
||||||
<!-- 版权 -->
|
<!-- 版权 -->
|
||||||
<view v-if="showCopyright" class="copyright mt-40 text-size-xs text-align-center"><view class="">「 2022 uni-halo 丨 开源项目@小莫唐尼 」</view></view>
|
<view v-if="showCopyright" class="copyright mt-40 text-size-xs text-align-center">
|
||||||
|
<view class="">「 2022 uni-halo 丨 开源项目@小莫唐尼 」</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 名片 -->
|
<!-- 名片 -->
|
||||||
<tm-poup v-model="miniProfileCard.show" width="94vw" height="auto" :round="3" position="center">
|
<tm-poup v-model="miniProfileCard.show" width="94vw" height="auto" :round="3" position="center">
|
||||||
@@ -97,17 +138,35 @@
|
|||||||
<view class="left flex flex-col flex-center">
|
<view class="left flex flex-col flex-center">
|
||||||
<image class="avatar" :src="$utils.checkAvatarUrl(bloggerInfo.avatar)" mode="aspectFill"></image>
|
<image class="avatar" :src="$utils.checkAvatarUrl(bloggerInfo.avatar)" mode="aspectFill"></image>
|
||||||
<view class="name mt-10 text-size-m text-weight-b">{{ bloggerInfo.nickname }}</view>
|
<view class="name mt-10 text-size-m text-weight-b">{{ bloggerInfo.nickname }}</view>
|
||||||
<view class="mt-10 round-a-1 pa-2 pl-12 pr-12 text-size-s bg-gradient-light-blue-accent">前端摸鱼大师</view>
|
<view class="mt-10 round-a-1 pa-2 pl-12 pr-12 text-size-s bg-gradient-light-blue-accent">
|
||||||
<view class="mt-6 text-size-xs text-align-center text-grey-darken-2">一个爱凑热闹的、喜欢捣鼓前端的博主。</view>
|
前端摸鱼大师
|
||||||
|
</view>
|
||||||
|
<view class="mt-6 text-size-xs text-align-center text-grey-darken-2">
|
||||||
|
一个爱凑热闹的、喜欢捣鼓前端的博主。
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right flex flex-col pl-12">
|
<view class="right flex flex-col pl-12">
|
||||||
<view class="label text-size-s text-weight-b">爱好:摸鱼、打游戏、听音乐、逛B站</view>
|
<view class="label text-size-s text-weight-b">爱好:摸鱼、打游戏、听音乐、逛B站</view>
|
||||||
<view class="motto mt-12 text-size-s text-grey-darken-1">如果不是在空闲着的时候就能挣到钱,那就不算摸鱼!</view>
|
<view class="motto mt-12 text-size-s text-grey-darken-1">
|
||||||
|
如果不是在空闲着的时候就能挣到钱,那就不算摸鱼!
|
||||||
|
</view>
|
||||||
<view class="mt-12 text-size-m text-weight-b text-grey-darken-2">精选图片</view>
|
<view class="mt-12 text-size-m text-weight-b text-grey-darken-2">精选图片</view>
|
||||||
<view class="photos mt-6 flex ">
|
<view class="photos mt-6 flex ">
|
||||||
<image class="photos-img round-2" :src="$utils.checkAvatarUrl(bloggerInfo.avatar)" mode="aspectFill"></image>
|
<image
|
||||||
<image class="photos-img round-2" :src="$utils.checkAvatarUrl(bloggerInfo.avatar)" mode="aspectFill"></image>
|
class="photos-img round-2"
|
||||||
<image class="photos-img round-2" :src="$utils.checkAvatarUrl(bloggerInfo.avatar)" mode="aspectFill"></image>
|
:src="$utils.checkAvatarUrl(bloggerInfo.avatar)"
|
||||||
|
mode="aspectFill"
|
||||||
|
></image>
|
||||||
|
<image
|
||||||
|
class="photos-img round-2"
|
||||||
|
:src="$utils.checkAvatarUrl(bloggerInfo.avatar)"
|
||||||
|
mode="aspectFill"
|
||||||
|
></image>
|
||||||
|
<image
|
||||||
|
class="photos-img round-2"
|
||||||
|
:src="$utils.checkAvatarUrl(bloggerInfo.avatar)"
|
||||||
|
mode="aspectFill"
|
||||||
|
></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -168,7 +227,19 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
bloggerInfo() {
|
bloggerInfo() {
|
||||||
return this.$tm.vx.getters().blogger.getBlogger;
|
return this.$tm.vx.getters().getBlogger;
|
||||||
|
},
|
||||||
|
calcProfileStyle() {
|
||||||
|
let _imgUrlOr = getApp().globalData.aboutProfileImageUrl;
|
||||||
|
if (this.$utils.checkIsUrl(_imgUrlOr)) {
|
||||||
|
return {
|
||||||
|
backgroundImage: `url(${_imgUrlOr})`
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
background: _imgUrlOr
|
||||||
|
};
|
||||||
|
}
|
||||||
},
|
},
|
||||||
calcWaveUrl() {
|
calcWaveUrl() {
|
||||||
return getApp().globalData.waveImageUrl;
|
return getApp().globalData.waveImageUrl;
|
||||||
@@ -206,6 +277,10 @@ export default {
|
|||||||
},
|
},
|
||||||
fnGetNavList() {
|
fnGetNavList() {
|
||||||
const systemInfo = uni.getSystemInfoSync();
|
const systemInfo = uni.getSystemInfoSync();
|
||||||
|
let _isWx = false;
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
_isWx = true;
|
||||||
|
// #endif
|
||||||
this.navList = [
|
this.navList = [
|
||||||
{
|
{
|
||||||
key: 'disclaimers',
|
key: 'disclaimers',
|
||||||
@@ -239,7 +314,7 @@ export default {
|
|||||||
isAdmin: false,
|
isAdmin: false,
|
||||||
type: 'page',
|
type: 'page',
|
||||||
openType: 'contact',
|
openType: 'contact',
|
||||||
show: true
|
show: _isWx
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'feedback',
|
key: 'feedback',
|
||||||
@@ -251,7 +326,7 @@ export default {
|
|||||||
isAdmin: false,
|
isAdmin: false,
|
||||||
type: 'page',
|
type: 'page',
|
||||||
openType: 'feedback',
|
openType: 'feedback',
|
||||||
show: true
|
show: _isWx
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'about',
|
key: 'about',
|
||||||
@@ -374,7 +449,8 @@ export default {
|
|||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.clearStorageSync();
|
uni.clearStorageSync();
|
||||||
this.navList.find(x => x.key == 'cache').rightText = uni.getStorageInfoSync().currentSize + 'KB';
|
this.navList.find(x => x.key == 'cache').rightText =
|
||||||
|
uni.getStorageInfoSync().currentSize + 'KB';
|
||||||
})
|
})
|
||||||
.catch(err => {});
|
.catch(err => {});
|
||||||
break;
|
break;
|
||||||
@@ -405,6 +481,18 @@ export default {
|
|||||||
|
|
||||||
// 快捷导航页面跳转
|
// 快捷导航页面跳转
|
||||||
fnToNavPage(item) {
|
fnToNavPage(item) {
|
||||||
|
// 判断是内置页面还是网页
|
||||||
|
if (this.$utils.checkIsUrl(item.path)) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
'/pagesC/website/website?data=' +
|
||||||
|
JSON.stringify({
|
||||||
|
title: item.text || this.$haloConfig.title,
|
||||||
|
url: item.path
|
||||||
|
})
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case 'tabbar':
|
case 'tabbar':
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
@@ -437,10 +525,8 @@ export default {
|
|||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 600rpx;
|
height: 600rpx;
|
||||||
background-image: url('@/static/summer.jpg');
|
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
// box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.05);
|
|
||||||
&:before {
|
&:before {
|
||||||
content: '';
|
content: '';
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
+190
-185
@@ -11,19 +11,8 @@
|
|||||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="博主还没有文章分类~"></tm-empty>
|
<tm-empty icon="icon-shiliangzhinengduixiang-" label="博主还没有文章分类~"></tm-empty>
|
||||||
</view>
|
</view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<tm-sliderNav :list="categoryList" color="light-blue" rang-key="name" @change="fnOnCategoryChange"></tm-sliderNav>
|
<tm-sliderNav :list="categoryList" bg-color="white" color="light-blue" rang-key="name" @change="fnOnCategoryChange"></tm-sliderNav>
|
||||||
<scroll-view
|
<scroll-view class="right-content pt-12 pb-12" :scroll-y="true" :scroll-top="scrollTop" :scroll-with-animation="true" :refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="60" refresher-background="#fafafa" @refresherrefresh="fnGetData(true)" @scrolltolower="fnGetData(false)" @scroll="fnOnScroll" @touchmove.stop @touchstart="fnOnTouchStart" @touchend="fnOnTouchEnd" @touchcancel="fnOnTouchEnd">
|
||||||
class="right-content pt-12 pb-12"
|
|
||||||
:scroll-y="true"
|
|
||||||
:scroll-top="scrollTop"
|
|
||||||
:scroll-with-animation="true"
|
|
||||||
:refresher-enabled="true"
|
|
||||||
:refresher-triggered="triggered"
|
|
||||||
:refresher-threshold="60"
|
|
||||||
@refresherrefresh="fnGetData(true)"
|
|
||||||
@scrolltolower="fnGetData(false)"
|
|
||||||
@scroll="fnOnScroll"
|
|
||||||
>
|
|
||||||
<view v-if="dataList.length == 0" class="article-empty flex flex-center">
|
<view v-if="dataList.length == 0" class="article-empty flex flex-center">
|
||||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="该分类下暂无文章~"></tm-empty>
|
<tm-empty icon="icon-shiliangzhinengduixiang-" label="该分类下暂无文章~"></tm-empty>
|
||||||
</view>
|
</view>
|
||||||
@@ -31,7 +20,7 @@
|
|||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(article, index) in dataList" :key="article.createTime">
|
<block v-for="(article, index) in dataList" :key="article.createTime">
|
||||||
<!-- 文章卡片 -->
|
<!-- 文章卡片 -->
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<article-min-card :article="article" @on-click="fnToArticleDetail"></article-min-card>
|
<article-min-card :article="article" @on-click="fnToArticleDetail"></article-min-card>
|
||||||
</tm-translate>
|
</tm-translate>
|
||||||
</block>
|
</block>
|
||||||
@@ -45,185 +34,201 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import throttle from '@/utils/throttle.js';
|
import throttle from '@/utils/throttle.js';
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmFlowLayout from '@/tm-vuetify/components/tm-flowLayout/tm-flowLayout.vue';
|
import tmFlowLayout from '@/tm-vuetify/components/tm-flowLayout/tm-flowLayout.vue';
|
||||||
import tmSliderNav from '@/tm-vuetify/components/tm-sliderNav/tm-sliderNav.vue';
|
import tmSliderNav from '@/tm-vuetify/components/tm-sliderNav/tm-sliderNav.vue';
|
||||||
|
|
||||||
import ArticleMinCard from '@/components/article-min-card/article-min-card.vue';
|
import ArticleMinCard from '@/components/article-min-card/article-min-card.vue';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
tmFlowLayout,
|
tmFlowLayout,
|
||||||
tmSliderNav,
|
tmSliderNav,
|
||||||
ArticleMinCard
|
ArticleMinCard
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: 'loading',
|
loading: 'loading',
|
||||||
queryParams: {
|
queryParams: {
|
||||||
size: 10,
|
size: 10,
|
||||||
page: 0,
|
page: 0,
|
||||||
slug: ''
|
slug: ''
|
||||||
},
|
},
|
||||||
categoryList: [],
|
categoryList: [],
|
||||||
result: null,
|
result: null,
|
||||||
dataList: [],
|
dataList: [],
|
||||||
isLoadMore: false,
|
isLoadMore: false,
|
||||||
loadMoreText: '',
|
loadMoreText: '',
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
triggered: false
|
tempScrollTop: 0,
|
||||||
};
|
scrollTimeout: null,
|
||||||
},
|
triggered: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fnSetPageTitle('文章分类');
|
this.fnSetPageTitle('文章分类');
|
||||||
this.fnGetAllCategory();
|
this.fnGetAllCategory();
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.queryParams.page = 0;
|
this.queryParams.page = 0;
|
||||||
this.isLoadMore = false;
|
this.isLoadMore = false;
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
onReachBottom(e) {
|
|
||||||
if (this.result.hasNext) {
|
|
||||||
this.queryParams.page += 1;
|
|
||||||
this.isLoadMore = true;
|
|
||||||
this.fnGetData(false);
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '没有更多数据了'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
fnOnCategoryChange(e) {
|
|
||||||
this.queryParams.slug = this.categoryList[e].slug;
|
|
||||||
this.fnToTopScroll();
|
|
||||||
this.dataList = [];
|
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
},
|
},
|
||||||
|
onReachBottom(e) {
|
||||||
fnGetAllCategory() {
|
if (this.result.hasNext) {
|
||||||
this.loading = 'loading';
|
this.queryParams.page += 1;
|
||||||
uni.showLoading({
|
this.isLoadMore = true;
|
||||||
mask: true,
|
this.fnGetData(false);
|
||||||
title: '加载中...'
|
|
||||||
});
|
|
||||||
this.$httpApi
|
|
||||||
.getCategoryList({ more: true })
|
|
||||||
.then(res => {
|
|
||||||
this.categoryList = res.data;
|
|
||||||
if (res.data.length != 0) {
|
|
||||||
this.queryParams.slug = res.data[0].slug;
|
|
||||||
this.triggered = false;
|
|
||||||
this.loading = 'success';
|
|
||||||
this.fnGetData(true, false);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
this.loading = 'error';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fnGetData(isPulldownRefresh = true, triggered = true) {
|
|
||||||
if (!isPulldownRefresh) {
|
|
||||||
if (this.result.hasNext) {
|
|
||||||
this.queryParams.page += 1;
|
|
||||||
} else {
|
|
||||||
return uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '没有更多数据了'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.queryParams.page = 0;
|
uni.showToast({
|
||||||
if (triggered) {
|
icon: 'none',
|
||||||
this.triggered = true;
|
title: '没有更多数据了'
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$httpApi
|
|
||||||
.getCategoryPostList(this.queryParams.slug, this.queryParams)
|
|
||||||
.then(res => {
|
|
||||||
this.result = res.data;
|
|
||||||
|
|
||||||
if (!isPulldownRefresh) {
|
|
||||||
this.dataList = this.dataList.concat(res.data.content);
|
|
||||||
} else {
|
|
||||||
this.dataList = res.data.content;
|
|
||||||
}
|
|
||||||
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
this.loadMoreText = '加载失败!';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.triggered = false;
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//跳转文章详情
|
methods: {
|
||||||
fnToArticleDetail(article) {
|
fnOnCategoryChange(e) {
|
||||||
uni.navigateTo({
|
this.fnResetSetAniWaitIndex();
|
||||||
url: '/pagesA/article-detail/article-detail?articleId=' + article.id,
|
this.queryParams.slug = this.categoryList[e].slug;
|
||||||
animationType: 'slide-in-right'
|
this.fnToTopScroll();
|
||||||
});
|
this.dataList = [];
|
||||||
},
|
this.fnGetData();
|
||||||
fnOnScroll(e) {
|
},
|
||||||
throttle(() => {
|
|
||||||
this.scrollTop = e.detail.scrollTop;
|
fnGetAllCategory() {
|
||||||
}, 1000);
|
this.loading = 'loading';
|
||||||
},
|
// uni.showLoading({
|
||||||
fnToTopScroll() {
|
// mask: true,
|
||||||
uni.pageScrollTo({
|
// title: '加载中...'
|
||||||
scrollTop: 0,
|
// });
|
||||||
duration: 500
|
this.$httpApi
|
||||||
});
|
.getCategoryList({ more: true })
|
||||||
this.scrollTop = 0;
|
.then(res => {
|
||||||
|
this.categoryList = res.data;
|
||||||
|
if (res.data.length != 0) {
|
||||||
|
this.queryParams.slug = res.data[0].slug;
|
||||||
|
this.triggered = false;
|
||||||
|
this.loading = 'success';
|
||||||
|
this.fnGetData(true, false);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fnGetData(isPulldownRefresh = true, triggered = true) {
|
||||||
|
if (!isPulldownRefresh) {
|
||||||
|
if (this.result.hasNext) {
|
||||||
|
this.queryParams.page += 1;
|
||||||
|
} else {
|
||||||
|
return uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '没有更多数据了'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
if (triggered) {
|
||||||
|
this.triggered = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$httpApi
|
||||||
|
.getCategoryPostList(this.queryParams.slug, this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
this.result = res.data;
|
||||||
|
|
||||||
|
if (!isPulldownRefresh) {
|
||||||
|
this.dataList = this.dataList.concat(res.data.content);
|
||||||
|
} else {
|
||||||
|
this.dataList = res.data.content;
|
||||||
|
}
|
||||||
|
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
this.loadMoreText = '加载失败!';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.triggered = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//跳转文章详情
|
||||||
|
fnToArticleDetail(article) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesA/article-detail/article-detail?articleId=' + article.id,
|
||||||
|
animationType: 'slide-in-right'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fnOnScroll(e) {
|
||||||
|
this.tempScrollTop = e.detail.scrollTop;
|
||||||
|
},
|
||||||
|
fnToTopScroll() {
|
||||||
|
uni.pageScrollTo({
|
||||||
|
scrollTop: 0,
|
||||||
|
duration: 500
|
||||||
|
});
|
||||||
|
this.scrollTop = 0;
|
||||||
|
this.tempScrollTop = 0;
|
||||||
|
},
|
||||||
|
fnOnTouchStart() {
|
||||||
|
clearTimeout(this.scrollTimeout);
|
||||||
|
},
|
||||||
|
fnOnTouchEnd() {
|
||||||
|
this.scrollTimeout = setTimeout(() => {
|
||||||
|
this.scrollTop = this.tempScrollTop;
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
.content {
|
|
||||||
height: 100vh;
|
.content {
|
||||||
background-color: #fafafa;
|
height: 100vh;
|
||||||
}
|
background-color: #fafafa;
|
||||||
.category-empty {
|
}
|
||||||
width: 100%;
|
|
||||||
height: 70vh;
|
.category-empty {
|
||||||
}
|
width: 100%;
|
||||||
.article-empty {
|
height: 70vh;
|
||||||
width: 100%;
|
}
|
||||||
height: 70vh;
|
|
||||||
}
|
.article-empty {
|
||||||
.right-content {
|
width: 100%;
|
||||||
// width: calc(100vw - 144rpx);
|
height: 70vh;
|
||||||
width: calc(100vw - 190rpx);
|
}
|
||||||
height: 100vh;
|
|
||||||
background-color: #fff;
|
.right-content {
|
||||||
white-space: nowrap;
|
// width: calc(100vw - 144rpx);
|
||||||
}
|
width: calc(100vw - 190rpx);
|
||||||
.loading-wrap {
|
height: 100vh;
|
||||||
padding: 24rpx;
|
background-color: #fff;
|
||||||
}
|
white-space: nowrap;
|
||||||
</style>
|
background-color: #fafafa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-wrap {
|
||||||
|
padding: 24rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+218
-204
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-page" :class="{ 'is-balck grey-darken-6': isBlackTheme }">
|
<view class="app-page">
|
||||||
<!-- 顶部切换 -->
|
<!-- 顶部切换 -->
|
||||||
<view class="e-fixed" v-if="category.list.length > 2">
|
<view class="e-fixed" v-if="category.list.length > 2">
|
||||||
<tm-tabs color="light-blue" v-model="category.activeIndex" :list="category.list" align="left" @change="fnOnCategoryChange"></tm-tabs>
|
<tm-tabs color="light-blue" v-model="category.activeIndex" :list="category.list" align="left" @change="fnOnCategoryChange"></tm-tabs>
|
||||||
@@ -9,24 +9,22 @@
|
|||||||
<!-- 加载区域 -->
|
<!-- 加载区域 -->
|
||||||
<view v-if="loading != 'success'" class="loading-wrap">
|
<view v-if="loading != 'success'" class="loading-wrap">
|
||||||
<tm-skeleton model="card"></tm-skeleton>
|
<tm-skeleton model="card"></tm-skeleton>
|
||||||
<tm-skeleton model="cardActions"></tm-skeleton>
|
<tm-skeleton model="card"></tm-skeleton>
|
||||||
<tm-skeleton model="list"></tm-skeleton>
|
<tm-skeleton model="card"></tm-skeleton>
|
||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
<tm-skeleton model="card"></tm-skeleton>
|
||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
|
||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 内容区域 -->
|
<!-- 内容区域 -->
|
||||||
<view class="content" v-else>
|
<view class="content" v-else>
|
||||||
<view v-if="dataList.length == 0" class="content-empty">
|
<view v-if="dataList.length == 0" class="content-empty">
|
||||||
<!-- 空布局 -->
|
<!-- 空布局 -->
|
||||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="该分类下暂无数据"></tm-empty>
|
<tm-empty icon="icon-shiliangzhinengduixiang-" label="博主还没有分享图片~"></tm-empty>
|
||||||
</view>
|
</view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<tm-flowLayout v-if="globalAppSettings.gallery.useWaterfull" @click="fnOnClick" ref="wafll">
|
<tm-flowLayout v-if="globalAppSettings.gallery.useWaterfull" @click="fnOnClick" ref="wafll">
|
||||||
<template v-slot:left="{ hdata }">
|
<template v-slot:left="{ hdata }">
|
||||||
<tm-translate animation-name="fadeUp">
|
<tm-translate animation-name="fadeUp">
|
||||||
<view class="round-3 shadow-2 overflow white">
|
<view class="card round-3 overflow white">
|
||||||
<tm-images :previmage="true" :src="hdata.item.image"></tm-images>
|
<tm-images :previmage="false" :src="hdata.item.image" @click="fnPreview(hdata.item)"></tm-images>
|
||||||
<view class="pa-10 text-size-s">
|
<view class="pa-10 text-size-s">
|
||||||
<view class="text-overflow-2">
|
<view class="text-overflow-2">
|
||||||
<tm-tags color="bg-gradient-amber-accent" :shadow="0" :dense="true" size="s" model="fill">{{ hdata.item.team }}</tm-tags>
|
<tm-tags color="bg-gradient-amber-accent" :shadow="0" :dense="true" size="s" model="fill">{{ hdata.item.team }}</tm-tags>
|
||||||
@@ -50,8 +48,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-slot:right="{ hdata }">
|
<template v-slot:right="{ hdata }">
|
||||||
<tm-translate animation-name="fadeUp">
|
<tm-translate animation-name="fadeUp">
|
||||||
<view class="round-3 shadow-2 overflow white">
|
<view class="card round-3 overflow white">
|
||||||
<tm-images :previmage="true" :src="hdata.item.image"></tm-images>
|
<tm-images :previmage="false" :src="hdata.item.image" @click="fnPreview(hdata.item)"></tm-images>
|
||||||
<view class="pa-10 text-size-s">
|
<view class="pa-10 text-size-s">
|
||||||
<view class="text-overflow-2">
|
<view class="text-overflow-2">
|
||||||
<tm-tags :shadow="0" :dense="true" color="bg-gradient-amber-accent" size="s" model="fill">{{ hdata.item.team }}</tm-tags>
|
<tm-tags :shadow="0" :dense="true" color="bg-gradient-amber-accent" size="s" model="fill">{{ hdata.item.team }}</tm-tags>
|
||||||
@@ -76,9 +74,9 @@
|
|||||||
</tm-flowLayout>
|
</tm-flowLayout>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(item, index) in dataList" :key="index">
|
<block v-for="(item, index) in dataList" :key="index">
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<view class="round-3 shadow-2 overflow white mb-24">
|
<view class="round-3 shadow-2 overflow white mb-24">
|
||||||
<tm-images :previmage="false" :src="item.image" @click="fnPreview(item, index)"></tm-images>
|
<tm-images :previmage="false" :src="item.image" @click="fnPreview(item)"></tm-images>
|
||||||
<view class="pa-24 text-size-m">
|
<view class="pa-24 text-size-m">
|
||||||
<view class="text-overflow-2">
|
<view class="text-overflow-2">
|
||||||
<tm-tags :shadow="0" :dense="true" color="bg-gradient-amber-accent" size="s" model="fill">{{ item.team }}</tm-tags>
|
<tm-tags :shadow="0" :dense="true" color="bg-gradient-amber-accent" size="s" model="fill">{{ item.team }}</tm-tags>
|
||||||
@@ -109,209 +107,225 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue';
|
import tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue';
|
||||||
import tmImages from '@/tm-vuetify/components/tm-images/tm-images.vue';
|
import tmImages from '@/tm-vuetify/components/tm-images/tm-images.vue';
|
||||||
import tmFlowLayout from '@/tm-vuetify/components/tm-flowLayout/tm-flowLayout.vue';
|
import tmFlowLayout from '@/tm-vuetify/components/tm-flowLayout/tm-flowLayout.vue';
|
||||||
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmTags,
|
tmTags,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
tmIcons,
|
tmIcons,
|
||||||
tmImages,
|
tmImages,
|
||||||
tmFlowLayout,
|
tmFlowLayout,
|
||||||
tmTabs
|
tmTabs
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isBlackTheme: false,
|
isBlackTheme: false,
|
||||||
loading: 'loading',
|
loading: 'loading',
|
||||||
category: {
|
category: {
|
||||||
activeIndex: 0,
|
activeIndex: 0,
|
||||||
activeValue: '',
|
activeValue: '',
|
||||||
list: []
|
list: []
|
||||||
},
|
},
|
||||||
queryParams: {
|
queryParams: {
|
||||||
size: 10,
|
size: 10,
|
||||||
page: 0,
|
page: 0,
|
||||||
team: null,
|
team: null,
|
||||||
keyword: ''
|
keyword: ''
|
||||||
},
|
},
|
||||||
cache: {
|
cache: {
|
||||||
dataList: [],
|
dataList: [],
|
||||||
total: 0
|
total: 0
|
||||||
},
|
},
|
||||||
isLoadMore: false,
|
isLoadMore: false,
|
||||||
loadMoreText: '',
|
loadMoreText: '',
|
||||||
result: {},
|
result: {},
|
||||||
dataList: []
|
dataList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
filterTakeTime(val) {
|
filterTakeTime(val) {
|
||||||
return uni.$tm.dayjs(val).format('DD/MM/YYYY');
|
return uni.$tm.dayjs(val).format('DD/MM/YYYY');
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
globalAppSettings: {
|
|
||||||
deep: true,
|
|
||||||
handler() {
|
|
||||||
// this.isLoadMore = false;
|
|
||||||
// this.queryParams.page = 0;
|
|
||||||
// this.dataList = [];
|
|
||||||
// this.cache.list = [];
|
|
||||||
// this.cache.total = 0;
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
watch: {
|
||||||
onLoad() {
|
globalAppSettings: {
|
||||||
this.fnSetPageTitle('个人图库');
|
deep: true,
|
||||||
this.fnGetCategory();
|
handler() {
|
||||||
},
|
// this.isLoadMore = false;
|
||||||
created() {
|
// this.queryParams.page = 0;
|
||||||
this.fnGetData();
|
// this.dataList = [];
|
||||||
},
|
// this.cache.list = [];
|
||||||
onPullDownRefresh() {
|
// this.cache.total = 0;
|
||||||
this.isLoadMore = false;
|
}
|
||||||
this.queryParams.page = 0;
|
}
|
||||||
this.fnGetData();
|
},
|
||||||
},
|
onLoad() {
|
||||||
onReachBottom(e) {
|
this.fnSetPageTitle('个人图库');
|
||||||
if (this.result.hasNext) {
|
this.fnGetCategory();
|
||||||
this.queryParams.page += 1;
|
},
|
||||||
this.isLoadMore = true;
|
created() {
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
} else {
|
},
|
||||||
uni.showToast({
|
onPullDownRefresh() {
|
||||||
icon: 'none',
|
this.isLoadMore = false;
|
||||||
title: '没有更多数据了'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
fnOnCategoryChange(index) {
|
|
||||||
this.dataList = [];
|
|
||||||
if (index == 0) {
|
|
||||||
this.queryParams.team = null;
|
|
||||||
} else {
|
|
||||||
this.queryParams.team = this.category.list[index];
|
|
||||||
}
|
|
||||||
this.queryParams.page = 0;
|
this.queryParams.page = 0;
|
||||||
this.fnToTopPage();
|
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
},
|
},
|
||||||
fnGetCategory() {
|
onReachBottom(e) {
|
||||||
this.$httpApi.getPhotoTeams().then(res => {
|
if (this.result.hasNext) {
|
||||||
this.category.list = ['全部', ...res.data];
|
this.queryParams.page += 1;
|
||||||
});
|
this.isLoadMore = true;
|
||||||
},
|
this.fnGetData();
|
||||||
fnGetData() {
|
|
||||||
uni.showLoading({
|
|
||||||
mask: true,
|
|
||||||
title: '加载中...'
|
|
||||||
});
|
|
||||||
// 设置状态为加载中
|
|
||||||
if (!this.isLoadMore) {
|
|
||||||
this.loading = 'loading';
|
|
||||||
}
|
|
||||||
this.loadMoreText = '';
|
|
||||||
this.$httpApi
|
|
||||||
.getPhotoListByPage(this.queryParams)
|
|
||||||
.then(res => {
|
|
||||||
this.loading = 'success';
|
|
||||||
this.result = res.data;
|
|
||||||
if (res.data.content.length != 0) {
|
|
||||||
const _list = res.data.content.map((item, index) => {
|
|
||||||
item['image'] = this.$utils.checkImageUrl(item.thumbnail);
|
|
||||||
item['model'] = 'text';
|
|
||||||
item['takeTime'] = this.$tm.dayjs(item['takeTime']).format('DD/MM/YYYY');
|
|
||||||
return item;
|
|
||||||
});
|
|
||||||
this.fnCacheDataList(_list);
|
|
||||||
if (this.globalAppSettings.gallery.useWaterfull) {
|
|
||||||
this.dataList = _list;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.wafll.pushData(_list);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.dataList = this.dataList.concat(_list);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
this.loading = 'error';
|
|
||||||
this.waterfall.loading = 'finish';
|
|
||||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
}, 500);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 缓存数据
|
|
||||||
fnCacheDataList(dataList) {
|
|
||||||
if (this.queryParams.page == 0) {
|
|
||||||
this.cache.dataList = dataList;
|
|
||||||
} else {
|
} else {
|
||||||
this.cache.dataList = [...this.cache.dataList, ...dataList];
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '没有更多数据了'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
fnOnCategoryChange(index) {
|
||||||
|
this.fnResetSetAniWaitIndex();
|
||||||
|
this.dataList = [];
|
||||||
|
if (index == 0) {
|
||||||
|
this.queryParams.team = null;
|
||||||
|
} else {
|
||||||
|
this.queryParams.team = this.category.list[index];
|
||||||
|
}
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
this.fnToTopPage();
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
fnGetCategory() {
|
||||||
|
this.$httpApi.getPhotoTeams().then(res => {
|
||||||
|
this.category.list = ['全部', ...res.data];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fnGetData() {
|
||||||
|
// uni.showLoading({
|
||||||
|
// mask: true,
|
||||||
|
// title: '加载中...'
|
||||||
|
// });
|
||||||
|
// 设置状态为加载中
|
||||||
|
if (!this.isLoadMore) {
|
||||||
|
this.loading = 'loading';
|
||||||
|
}
|
||||||
|
this.loadMoreText = '';
|
||||||
|
this.$httpApi
|
||||||
|
.getPhotoListByPage(this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
this.loading = 'success';
|
||||||
|
this.result = res.data;
|
||||||
|
if (res.data.content.length != 0) {
|
||||||
|
const _list = res.data.content.map((item, index) => {
|
||||||
|
item['image'] = this.$utils.checkImageUrl(item.thumbnail);
|
||||||
|
item['model'] = 'text';
|
||||||
|
item['takeTime'] = this.$tm.dayjs(item['takeTime']).format('DD/MM/YYYY');
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
this.fnCacheDataList(_list);
|
||||||
|
if (this.globalAppSettings.gallery.useWaterfull) {
|
||||||
|
this.dataList = _list;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.wafll.pushData(_list);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.dataList = this.dataList.concat(_list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
|
} else {
|
||||||
|
this.loading = 'error';
|
||||||
|
this.waterfall.loading = 'finish';
|
||||||
|
this.loadMoreText = '';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
this.waterfall.loading = 'finish';
|
||||||
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 缓存数据
|
||||||
|
fnCacheDataList(dataList) {
|
||||||
|
if (this.queryParams.page == 0) {
|
||||||
|
this.cache.dataList = dataList;
|
||||||
|
} else {
|
||||||
|
this.cache.dataList = [...this.cache.dataList, ...dataList];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 瀑布流组件点击事件
|
// 瀑布流组件点击事件
|
||||||
fnOnClick(data) {
|
fnOnClick(data) {
|
||||||
console.log('点击数据', data);
|
console.log('点击数据', data);
|
||||||
},
|
},
|
||||||
// 预览
|
// 预览
|
||||||
fnPreview(item, index) {
|
fnPreview(item) {
|
||||||
uni.previewImage({
|
const index = this.cache.dataList.findIndex(x => x.id == item.id);
|
||||||
current: index,
|
uni.previewImage({
|
||||||
urls: this.dataList.map(x => x.image),
|
current: index,
|
||||||
indicator: 'number',
|
urls: this.cache.dataList.map(x => x.image),
|
||||||
loop: true
|
indicator: 'number',
|
||||||
});
|
loop: true
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
padding-bottom: 24rpx;
|
|
||||||
background-color: #fafafd;
|
|
||||||
|
|
||||||
&.is-balck {
|
|
||||||
background-color: #212121;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.content {
|
|
||||||
padding: 0 24rpx;
|
|
||||||
padding-top: 24rpx;
|
|
||||||
|
|
||||||
.content-empty {
|
|
||||||
height: 60vh;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
flex-direction: column;
|
||||||
justify-content: center;
|
padding-bottom: 24rpx;
|
||||||
|
background-color: #fafafa;
|
||||||
|
|
||||||
|
&.is-balck {
|
||||||
|
background-color: #212121;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.loading-wrap {
|
.content {
|
||||||
padding: 24rpx;
|
box-sizing: border-box;
|
||||||
}
|
padding: 0 24rpx;
|
||||||
</style>
|
padding-top: 24rpx;
|
||||||
|
|
||||||
|
.content-empty {
|
||||||
|
height: 60vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-wrap {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+356
-351
@@ -22,13 +22,7 @@
|
|||||||
<view class="bg-white pb-24">
|
<view class="bg-white pb-24">
|
||||||
<!-- 轮播图+广告 -->
|
<!-- 轮播图+广告 -->
|
||||||
<view class="banner bg-white ml-24 mr-24 mt-12 round-3" v-if="bannerList.length != 0">
|
<view class="banner bg-white ml-24 mr-24 mt-12 round-3" v-if="bannerList.length != 0">
|
||||||
<e-swiper
|
<e-swiper :dotPosition="globalAppSettings.banner.dotPosition" :autoplay="true" :useDot="globalAppSettings.banner.useDot" :list="bannerList" @on-click="fnOnBannerClick"></e-swiper>
|
||||||
:dotPosition="globalAppSettings.banner.dotPosition"
|
|
||||||
:autoplay="true"
|
|
||||||
:useDot="globalAppSettings.banner.useDot"
|
|
||||||
:list="bannerList"
|
|
||||||
@on-click="fnOnBannerClick"
|
|
||||||
></e-swiper>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 快捷导航 -->
|
<!-- 快捷导航 -->
|
||||||
<!-- <view v-if="useQuickNav" class="quick-nav flex-between round-3 flex mt-12 ml-12 mr-12 pa-24">
|
<!-- <view v-if="useQuickNav" class="quick-nav flex-between round-3 flex mt-12 ml-12 mr-12 pa-24">
|
||||||
@@ -73,7 +67,7 @@
|
|||||||
<block v-else>
|
<block v-else>
|
||||||
<view :class="globalAppSettings.layout.home">
|
<view :class="globalAppSettings.layout.home">
|
||||||
<block v-for="(article, index) in articleList" :key="article.createTime">
|
<block v-for="(article, index) in articleList" :key="article.createTime">
|
||||||
<tm-translate class="ani-item" animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate class="ani-item" animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<article-card from="home" :article="article" @on-click="fnToArticleDetail"></article-card>
|
<article-card from="home" :article="article" @on-click="fnToArticleDetail"></article-card>
|
||||||
<!-- 广告区域 -->
|
<!-- 广告区域 -->
|
||||||
<view v-if="haloAdConfig.home.use && (index + 1) % haloAdConfig.frequency == 0" class="ad-wrap ma-24">
|
<view v-if="haloAdConfig.home.use && (index + 1) % haloAdConfig.frequency == 0" class="ad-wrap ma-24">
|
||||||
@@ -96,369 +90,380 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmMenubars from '@/tm-vuetify/components/tm-menubars/tm-menubars.vue';
|
import tmMenubars from '@/tm-vuetify/components/tm-menubars/tm-menubars.vue';
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue';
|
import tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
|
|
||||||
import eSwiper from '@/components/e-swiper/e-swiper.vue';
|
import eSwiper from '@/components/e-swiper/e-swiper.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmMenubars,
|
tmMenubars,
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmIcons,
|
tmIcons,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
eSwiper
|
eSwiper
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: 'loading',
|
|
||||||
queryParams: {
|
|
||||||
size: 10,
|
|
||||||
page: 0
|
|
||||||
},
|
|
||||||
result: {},
|
|
||||||
isLoadMore: false,
|
|
||||||
loadMoreText: '加载中...',
|
|
||||||
bannerCurrent: 0,
|
|
||||||
bannerList: [],
|
|
||||||
noticeList: [],
|
|
||||||
articleList: [],
|
|
||||||
categoryList: [],
|
|
||||||
useQuickNav: false,
|
|
||||||
quickNavList: []
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
// 获取博主信息
|
|
||||||
bloggerInfo() {
|
|
||||||
let blogger = this.$tm.vx.getters().blogger.getBlogger;
|
|
||||||
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
|
|
||||||
return blogger;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.fnSetPageTitle();
|
|
||||||
this.useQuickNav = this.$haloConfig.quickNav.use;
|
|
||||||
},
|
|
||||||
|
|
||||||
created() {
|
|
||||||
this.fnQuery();
|
|
||||||
this.$httpApi
|
|
||||||
.getOptionList()
|
|
||||||
.then(result => {
|
|
||||||
console.log('配置列表:');
|
|
||||||
console.log(result);
|
|
||||||
})
|
|
||||||
.catch(err => {});
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
this.isLoadMore = false;
|
|
||||||
this.queryParams.page = 0;
|
|
||||||
this.fnQuery();
|
|
||||||
},
|
|
||||||
|
|
||||||
onReachBottom(e) {
|
|
||||||
if (this.result.hasNext) {
|
|
||||||
this.queryParams.page += 1;
|
|
||||||
this.isLoadMore = true;
|
|
||||||
this.fnGetArticleList();
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '没有更多数据了'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 查询数据
|
|
||||||
fnQuery() {
|
|
||||||
this.fnGetBanner();
|
|
||||||
this.fnGetArticleList();
|
|
||||||
this.fnGetCategoryList();
|
|
||||||
this.fnGetQuickNavList();
|
|
||||||
},
|
},
|
||||||
fnGetQuickNavList() {
|
data() {
|
||||||
this.useQuickNav = this.$haloConfig.quickNav.use;
|
return {
|
||||||
if (!this.$haloConfig.quickNav.use) return;
|
loading: 'loading',
|
||||||
const _quickNavList = this.$haloConfig.quickNav.list;
|
queryParams: {
|
||||||
this.quickNavList = _quickNavList.map(item => {
|
size: 10,
|
||||||
return item;
|
page: 0
|
||||||
});
|
},
|
||||||
},
|
result: {},
|
||||||
fnGetCategoryList() {
|
isLoadMore: false,
|
||||||
this.$httpApi
|
loadMoreText: '加载中...',
|
||||||
.getCategoryList({ more: true })
|
bannerCurrent: 0,
|
||||||
.then(res => {
|
bannerList: [],
|
||||||
this.categoryList = res.data;
|
noticeList: [],
|
||||||
setTimeout(() => {
|
articleList: [],
|
||||||
this.loading = 'success';
|
categoryList: [],
|
||||||
}, 500);
|
useQuickNav: false,
|
||||||
})
|
quickNavList: []
|
||||||
.catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
this.loading = 'error';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
}, 500);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 获取轮播图
|
|
||||||
fnGetBanner() {
|
|
||||||
const _this = this;
|
|
||||||
const _format = function(list, type) {
|
|
||||||
return list.map(item => {
|
|
||||||
switch (type) {
|
|
||||||
case 'list':
|
|
||||||
return {
|
|
||||||
id: '',
|
|
||||||
src: item
|
|
||||||
};
|
|
||||||
case 'article':
|
|
||||||
return {
|
|
||||||
mp4: '',
|
|
||||||
id: item.id,
|
|
||||||
nickname: _this.bloggerInfo.nickname,
|
|
||||||
avatar: _this.bloggerInfo.avatar,
|
|
||||||
address: '',
|
|
||||||
createTime: uni.$tm.dayjs(item.createTime).fromNow(),
|
|
||||||
title: item.title,
|
|
||||||
src: _this.$utils.checkImageUrl(item.thumbnail),
|
|
||||||
image: _this.$utils.checkImageUrl(item.thumbnail)
|
|
||||||
};
|
|
||||||
case 'banner':
|
|
||||||
return {
|
|
||||||
id: '',
|
|
||||||
src: item
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
switch (this.$haloConfig.banner.type) {
|
},
|
||||||
case 'list': // 手动配置的banner
|
|
||||||
this.bannerList = _format(this.$haloConfig.banner.list, 'list');
|
computed: {
|
||||||
break;
|
bloggerInfo() {
|
||||||
case 'article': // 来自热门文章的封面
|
let blogger = this.$tm.vx.getters().getBlogger;
|
||||||
this.$httpApi.getPostList({ page: 0, size: 6, sort: 'topPriority,visits,desc' }).then(res => {
|
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
|
||||||
this.bannerList = _format(res.data.content, 'article');
|
return blogger;
|
||||||
if (this.bannerList.length == 0) {
|
},
|
||||||
this.bannerList = _format(this.$haloConfig.banner.list, 'list');
|
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.fnSetPageTitle();
|
||||||
|
this.useQuickNav = this.$haloConfig.quickNav.use;
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.fnQuery();
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.isLoadMore = false;
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
this.fnQuery();
|
||||||
|
},
|
||||||
|
|
||||||
|
onReachBottom(e) {
|
||||||
|
if (this.result.hasNext) {
|
||||||
|
this.queryParams.page += 1;
|
||||||
|
this.isLoadMore = true;
|
||||||
|
this.fnGetArticleList();
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '没有更多数据了'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fnQuery() {
|
||||||
|
this.fnGetBanner();
|
||||||
|
this.fnGetArticleList();
|
||||||
|
this.fnGetCategoryList();
|
||||||
|
this.fnGetQuickNavList();
|
||||||
|
},
|
||||||
|
fnGetQuickNavList() {
|
||||||
|
this.useQuickNav = this.$haloConfig.quickNav.use;
|
||||||
|
if (!this.$haloConfig.quickNav.use) return;
|
||||||
|
const _quickNavList = this.$haloConfig.quickNav.list;
|
||||||
|
this.quickNavList = _quickNavList.map(item => {
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fnGetCategoryList() {
|
||||||
|
this.$httpApi
|
||||||
|
.getCategoryList({ more: true })
|
||||||
|
.then(res => {
|
||||||
|
this.categoryList = res.data.sort((a, b) => {
|
||||||
|
return b.postCount - a.postCount;
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.loading = 'success';
|
||||||
|
}, 500);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取轮播图
|
||||||
|
fnGetBanner() {
|
||||||
|
const _this = this;
|
||||||
|
const _format = function(list, type) {
|
||||||
|
return list.map((item, index) => {
|
||||||
|
switch (type) {
|
||||||
|
case 'list':
|
||||||
|
return {
|
||||||
|
id: index,
|
||||||
|
nickname: _this.bloggerInfo.nickname,
|
||||||
|
avatar: _this.bloggerInfo.avatar,
|
||||||
|
address: item.href || '',
|
||||||
|
title: item.title,
|
||||||
|
image: _this.$utils.checkImageUrl(item.thumbnail)
|
||||||
|
};
|
||||||
|
case 'article':
|
||||||
|
return {
|
||||||
|
mp4: '',
|
||||||
|
id: item.id,
|
||||||
|
nickname: _this.bloggerInfo.nickname,
|
||||||
|
avatar: _this.bloggerInfo.avatar,
|
||||||
|
address: '',
|
||||||
|
createTime: uni.$tm.dayjs(item.createTime).fromNow(),
|
||||||
|
title: item.title,
|
||||||
|
src: _this.$utils.checkImageUrl(item.thumbnail),
|
||||||
|
image: _this.$utils.checkImageUrl(item.thumbnail)
|
||||||
|
};
|
||||||
|
case 'banner':
|
||||||
|
return {
|
||||||
|
id: '',
|
||||||
|
src: item
|
||||||
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
};
|
||||||
case 'banner': // 来自后台配置的banner(暂未开放)
|
switch (this.$haloConfig.banner.type) {
|
||||||
this.bannerList = _format([], 'banner');
|
case 'list': // 手动配置的banner
|
||||||
break;
|
this.bannerList = _format(this.$haloConfig.banner.list, 'list');
|
||||||
}
|
break;
|
||||||
},
|
case 'article': // 来自热门文章的封面
|
||||||
fnOnBannerChange(e) {
|
this.$httpApi.getPostList({ page: 0, size: 6, sort: 'topPriority,visits,desc' }).then(res => {
|
||||||
this.bannerCurrent = e.current;
|
this.bannerList = _format(res.data.content, 'article');
|
||||||
},
|
if (this.bannerList.length == 0) {
|
||||||
fnOnBannerClick(item) {
|
this.bannerList = _format(this.$haloConfig.banner.list, 'list');
|
||||||
if (item.id == '') return;
|
}
|
||||||
this.fnToArticleDetail(item);
|
});
|
||||||
},
|
break;
|
||||||
// 文章列表
|
case 'banner': // 来自后台配置的banner(暂未开放)
|
||||||
fnGetArticleList() {
|
this.bannerList = _format([], 'banner');
|
||||||
uni.showLoading({
|
break;
|
||||||
mask: true,
|
}
|
||||||
title: '加载中...'
|
},
|
||||||
});
|
fnOnBannerChange(e) {
|
||||||
// 设置状态为加载中
|
this.bannerCurrent = e.current;
|
||||||
if (!this.isLoadMore) {
|
},
|
||||||
this.loading = 'loading';
|
fnOnBannerClick(item) {
|
||||||
}
|
if (item.id == '') return;
|
||||||
this.loadMoreText = '加载中...';
|
this.fnToArticleDetail(item);
|
||||||
this.$httpApi
|
},
|
||||||
.getPostList(this.queryParams)
|
// 文章列表
|
||||||
.then(res => {
|
fnGetArticleList() {
|
||||||
this.loading = 'success';
|
// uni.showLoading({
|
||||||
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
// mask: true,
|
||||||
this.result = res.data;
|
// title: '加载中...'
|
||||||
if (this.isLoadMore) {
|
// });
|
||||||
this.articleList = this.articleList.concat(res.data.content);
|
// 设置状态为加载中
|
||||||
} else {
|
if (!this.isLoadMore) {
|
||||||
this.articleList = res.data.content;
|
this.loading = 'loading';
|
||||||
}
|
}
|
||||||
this.loading = 'success';
|
this.loadMoreText = '加载中...';
|
||||||
})
|
this.$httpApi
|
||||||
.catch(err => {
|
.getPostList(this.queryParams)
|
||||||
this.loading = 'error';
|
.then(res => {
|
||||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
this.loading = 'success';
|
||||||
uni.$tm.toast(err.message || '数据加载失败!');
|
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
})
|
this.result = res.data;
|
||||||
.finally(() => {
|
if (this.isLoadMore) {
|
||||||
uni.hideLoading();
|
this.articleList = this.articleList.concat(res.data.content);
|
||||||
uni.stopPullDownRefresh();
|
} else {
|
||||||
|
this.articleList = res.data.content;
|
||||||
|
}
|
||||||
|
this.loading = 'success';
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
this.loading = 'error';
|
||||||
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
|
uni.$tm.toast(err.message || '数据加载失败!');
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//跳转文章详情
|
||||||
|
fnToArticleDetail(article) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesA/article-detail/article-detail?articleId=' + article.id,
|
||||||
|
animationType: 'slide-in-right'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 快捷导航页面跳转
|
||||||
|
fnToNavPage(item) {
|
||||||
|
switch (item.type) {
|
||||||
|
case 'tabbar':
|
||||||
|
uni.switchTab({
|
||||||
|
url: item.path
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 'page':
|
||||||
|
uni.navigateTo({
|
||||||
|
url: item.path
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 分类页面
|
||||||
|
fnToCategoryPage() {
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/tabbar/category/category'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 所有的文章列表页面
|
||||||
|
fnToArticlesPage() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesA/articles/articles'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
//跳转文章详情
|
// 根据slug查询分类下的文章
|
||||||
fnToArticleDetail(article) {
|
fnToCategoryBy(category) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesA/article-detail/article-detail?articleId=' + article.id,
|
url: `/pagesA/category-detail/category-detail?slug=${category.slug}&name=${category.name}`
|
||||||
animationType: 'slide-in-right'
|
});
|
||||||
});
|
},
|
||||||
},
|
|
||||||
// 快捷导航页面跳转
|
fnChangeMode() {
|
||||||
fnToNavPage(item) {
|
const isBlackTheme = this.$tm.vx.state().tmVuetify.black;
|
||||||
switch (item.type) {
|
this.$tm.theme.setBlack(!isBlackTheme);
|
||||||
case 'tabbar':
|
uni.setNavigationBarColor({
|
||||||
uni.switchTab({
|
backgroundColor: !isBlackTheme ? '#0a0a0a' : '#ffffff',
|
||||||
url: item.path
|
frontColor: !isBlackTheme ? '#ffffff' : '#0a0a0a'
|
||||||
});
|
});
|
||||||
break;
|
},
|
||||||
case 'page':
|
|
||||||
uni.navigateTo({
|
fnToSearch() {
|
||||||
url: item.path
|
uni.navigateTo({
|
||||||
});
|
url: '/pagesA/articles/articles'
|
||||||
break;
|
});
|
||||||
}
|
}
|
||||||
},
|
|
||||||
// 分类页面
|
|
||||||
fnToCategoryPage() {
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/tabbar/category/category'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 所有的文章列表页面
|
|
||||||
fnToArticlesPage() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pagesA/articles/articles'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 根据slug查询分类下的文章
|
|
||||||
fnToCategoryBy(category) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pagesA/category-detail/category-detail?slug=${category.slug}&name=${category.name}`
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
fnChangeMode() {
|
|
||||||
const isBlackTheme = this.$tm.vx.state().tmVuetify.black;
|
|
||||||
this.$tm.theme.setBlack(!isBlackTheme);
|
|
||||||
uni.setNavigationBarColor({
|
|
||||||
backgroundColor: !isBlackTheme ? '#0a0a0a' : '#ffffff',
|
|
||||||
frontColor: !isBlackTheme ? '#ffffff' : '#0a0a0a'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
fnToSearch() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pagesA/articles/articles'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
// background-color: #ffffff;
|
// background-color: #ffffff;
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
width: 60rpx;
|
width: 60rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep {
|
||||||
|
.tm-menubars .body .body_wk .left {
|
||||||
|
min-width: initial;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-wrap {
|
||||||
|
padding: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-input {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
align-items: center;
|
||||||
|
/* #ifdef MP-WEIXIN */
|
||||||
|
margin-right: 24rpx;
|
||||||
|
|
||||||
|
/* #endif */
|
||||||
|
&_icon {}
|
||||||
|
|
||||||
|
&_text {}
|
||||||
|
}
|
||||||
|
|
||||||
|
.show-more {
|
||||||
|
width: 42rpx;
|
||||||
|
height: 42rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep {
|
.banner {
|
||||||
.tm-menubars .body .body_wk .left {
|
overflow: hidden;
|
||||||
min-width: initial;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.loading-wrap {
|
|
||||||
padding: 24rpx;
|
|
||||||
}
|
|
||||||
.search-input {
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
align-items: center;
|
|
||||||
/* #ifdef MP-WEIXIN */
|
|
||||||
margin-right: 24rpx;
|
|
||||||
/* #endif */
|
|
||||||
&_icon {
|
|
||||||
}
|
|
||||||
&_text {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.show-more {
|
|
||||||
width: 42rpx;
|
|
||||||
height: 42rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.03);
|
|
||||||
}
|
|
||||||
.banner {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.quick-nav {
|
|
||||||
background-color: #fff;
|
|
||||||
box-sizing: border-box;
|
|
||||||
// box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
|
||||||
.name {
|
|
||||||
color: var(--main-text-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.category {
|
|
||||||
width: 94vw;
|
|
||||||
display: flex;
|
|
||||||
height: 200rpx;
|
|
||||||
white-space: nowrap;
|
|
||||||
margin: 0 24rpx;
|
|
||||||
.content {
|
|
||||||
display: inline-block;
|
|
||||||
padding-left: 24rpx;
|
|
||||||
&:first-child {
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.cate-empty {
|
|
||||||
height: inherit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-item {
|
.quick-nav {
|
||||||
&_title {
|
background-color: #fff;
|
||||||
position: relative;
|
box-sizing: border-box;
|
||||||
padding-left: 24rpx;
|
|
||||||
font-size: 32rpx;
|
// box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
z-index: 1;
|
.name {
|
||||||
color: var(--main-text-color);
|
color: var(--main-text-color);
|
||||||
&:before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
left: 0rpx;
|
|
||||||
top: 8rpx;
|
|
||||||
width: 8rpx;
|
|
||||||
height: 30rpx;
|
|
||||||
background-color: rgba(33, 150, 243, 1);
|
|
||||||
border-radius: 6rpx;
|
|
||||||
z-index: 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.h_row_col2 {
|
.category {
|
||||||
display: flex;
|
width: 94vw;
|
||||||
flex-wrap: wrap;
|
display: flex;
|
||||||
box-sizing: border-box;
|
height: 200rpx;
|
||||||
padding: 0 12rpx;
|
white-space: nowrap;
|
||||||
.ani-item {
|
margin: 0 24rpx;
|
||||||
width: 50%;
|
|
||||||
|
.content {
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: 24rpx;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cate-empty {
|
||||||
|
height: inherit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
.page-item {
|
||||||
|
&_title {
|
||||||
|
position: relative;
|
||||||
|
padding-left: 24rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
z-index: 1;
|
||||||
|
color: var(--main-text-color);
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0rpx;
|
||||||
|
top: 8rpx;
|
||||||
|
width: 8rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
background-color: rgba(33, 150, 243, 1);
|
||||||
|
border-radius: 6rpx;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.h_row_col2 {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 12rpx;
|
||||||
|
|
||||||
|
.ani-item {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+336
-266
@@ -7,75 +7,123 @@
|
|||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
</view>
|
</view>
|
||||||
<block v-else>
|
<view v-else class="content" :class="{ 'bg-white': result.length !== 0 }">
|
||||||
<!-- 空数据 -->
|
<!-- 空数据 -->
|
||||||
<view v-if="result.length == 0" class="empty flex flex-center"><tm-empty icon="icon-shiliangzhinengduixiang-" label="啊偶,博主还没有朋友呢~"></tm-empty></view>
|
<view v-if="result.length == 0" class="content-empty flex flex-center">
|
||||||
|
<tm-empty icon="icon-shiliangzhinengduixiang-" label="啊偶,博主还没有朋友呢~"></tm-empty>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 如果只有一个分组:使用列表的形式 result.length == 1 -->
|
<!-- 如果只有一个分组:使用列表的形式 result.length == 1 -->
|
||||||
<view v-else-if="result.length == 1" class="flex flex-col pb-24">
|
<view v-else-if="result.length == 1" class="flex flex-col pb-24">
|
||||||
<block v-for="(item, index) in result[0].children" :key="index">
|
<block v-for="(link, index) in result[0].children" :key="index">
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<view class="link-card one round-a-6 flex ma-24 mb-0 pa-24" @click="fnOnLinkEvent(item)">
|
<!-- 色彩版本 -->
|
||||||
<cache-image class="logo shadow-2" radius="12rpx" width="80rpx" height="80rpx" :url="item.logo" :fileMd5="item.logo" mode="aspectFill"></cache-image>
|
<view v-if="!globalAppSettings.links.useSimple" class="info flex pt-24 pb-24 pl-12 pr-12" :class="{ 'border-b-1': index != result[0].children.length - 1 }" @click="fnOnLinkEvent(link)">
|
||||||
|
<view class="link-logo">
|
||||||
|
<cache-image class="link-logo_img" radius="12rpx" :url="link.logo" :fileMd5="link.logo" mode="aspectFill"></cache-image>
|
||||||
|
</view>
|
||||||
|
<view class="flex flex-col pl-30 info-detail">
|
||||||
|
<view class="link-card_name text-size-l text-weight-b text-red">{{ link.name }}</view>
|
||||||
|
<view class="poup-tag ml--10 mt-6">
|
||||||
|
<tm-tags color="bg-gradient-amber-accent" :shadow="0" size="s" model="fill">
|
||||||
|
ID:{{ link.id }}
|
||||||
|
</tm-tags>
|
||||||
|
<tm-tags color=" bg-gradient-light-blue-lighten" :shadow="0" size="s" model="fill">
|
||||||
|
{{ link.team || '暂未分组' }}
|
||||||
|
</tm-tags>
|
||||||
|
</view>
|
||||||
|
<view class="link-card_desc text-overflow text-size-s mt-4">
|
||||||
|
博客简介:{{ link.description || '这个博主很懒,没写简介~' }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 简洁版本 -->
|
||||||
|
<view v-else class="link-card flex ml-24 mr-24 pt-24 pb-24" @click="fnOnLinkEvent(link)">
|
||||||
|
<image class="logo shadow-6" :src="link.logo" mode="aspectFill"></image>
|
||||||
<view class="info pl-24">
|
<view class="info pl-24">
|
||||||
<view class="name text-size-g">{{ item.name }}</view>
|
<view class="name text-size-g">{{ link.name }}</view>
|
||||||
<view class="desc mt-12 text-size-s text-grey-darken-1">{{ item.description }}</view>
|
<view class="desc mt-12 text-size-s text-grey-darken-1">{{ link.description }}</view>
|
||||||
<view class="link mt-12 text-size-m text-grey-darken-1">
|
<view v-if="false" class="link mt-12 text-size-m text-grey-darken-1">
|
||||||
<text class="iconfont icon-link mr-6 text-size-s"></text>
|
<text class="iconfont icon-link mr-6 text-size-s"></text>
|
||||||
{{ item.url }}
|
{{ link.url }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</tm-translate>
|
</tm-translate>
|
||||||
</block>
|
</block>
|
||||||
<!-- 返回顶部 -->
|
|
||||||
<tm-flotbutton @click="fnToTopPage" size="m" icon="icon-angle-up"></tm-flotbutton>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 如果大于一个分组:使用联系人的索引形式 result.length > 1 -->
|
<!-- 如果大于一个分组:使用联系人的索引形式 result.length > 1 -->
|
||||||
<block v-else-if="result.length > 1">
|
<block v-else>
|
||||||
<tm-quickIndex :list="result">
|
<block v-for="(team, index) in result" :key="index">
|
||||||
<template #cell="{ data }">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<!-- 艳丽版本 -->
|
<view class="grey-lighten-4 text text-size-s text-weight-b px-32 py-12">{{ team.title }}</view>
|
||||||
<view v-if="!globalAppSettings.links.useSimple" class="info flex pa-36 border-b-1" @click="fnOnLinkEvent(data.item)">
|
<block v-for="(link, linkIndex) in team.children" :key="link.id">
|
||||||
<view class="link-logo">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(linkIndex)">
|
||||||
<cache-image class="link-logo_img" radius="12rpx" :url="data.item.logo" :fileMd5="data.item.logo" mode="aspectFill"></cache-image>
|
<!-- 色彩版本 -->
|
||||||
</view>
|
<view v-if="!globalAppSettings.links.useSimple" class="info flex pt-24 pb-24 pl-12 pr-12" :class="{
|
||||||
<view class="flex flex-col pl-30 info-detail">
|
'border-b-1':
|
||||||
<view class="link-card_name text-size-l text-weight-b text-red">{{ data.item.name }}</view>
|
linkIndex != team.children.length - 1 || index == result.length - 1
|
||||||
<view class="poup-tag ml--10 mt-6">
|
}" @click="fnOnLinkEvent(link)">
|
||||||
<tm-tags color="bg-gradient-amber-accent" :shadow="0" size="s" model="fill">ID:{{ data.item.id }}</tm-tags>
|
<view class="link-logo">
|
||||||
<tm-tags color=" bg-gradient-light-blue-lighten" :shadow="0" size="s" model="fill">{{ data.item.team }}</tm-tags>
|
<cache-image class="link-logo_img" radius="12rpx" :url="link.logo" :fileMd5="link.logo" mode="aspectFill"></cache-image>
|
||||||
|
</view>
|
||||||
|
<view class="flex flex-col pl-30 info-detail">
|
||||||
|
<view class="link-card_name text-size-l text-weight-b text-red">
|
||||||
|
{{ link.name }}
|
||||||
|
</view>
|
||||||
|
<view class="poup-tag ml--10 mt-6">
|
||||||
|
<tm-tags color="bg-gradient-amber-accent" :shadow="0" size="s" model="fill">
|
||||||
|
ID:{{ link.id }}
|
||||||
|
</tm-tags>
|
||||||
|
<tm-tags color=" bg-gradient-light-blue-lighten" :shadow="0" size="s" model="fill">
|
||||||
|
{{ link.team || '暂未分组' }}
|
||||||
|
</tm-tags>
|
||||||
|
</view>
|
||||||
|
<view class="link-card_desc text-overflow text-size-s mt-4">
|
||||||
|
博客简介:{{ link.description || '这个博主很懒,没写简介~' }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="link-card_desc text-overflow text-size-s mt-4">博客简介:{{ data.item.description || '这个博主很懒,没写简介~' }}</view>
|
<!-- 简洁版本 -->
|
||||||
</view>
|
<view v-else class="link-card flex ml-24 mr-24 pt-24 pb-24" @click="fnOnLinkEvent(link)">
|
||||||
</view>
|
<image class="logo shadow-6" :src="link.logo" mode="aspectFill"></image>
|
||||||
<!-- 简洁版本 -->
|
<view class="info pl-24">
|
||||||
<view v-else class="link-card flex ml-24 mr-24 pt-24 pb-24" @click="fnOnLinkEvent(data.item)">
|
<view class="name text-size-g">{{ link.name }}</view>
|
||||||
<image class="logo shadow-6" :src="data.item.logo" mode="aspectFill"></image>
|
<view class="desc mt-12 text-size-s text-grey-darken-1">
|
||||||
<view class="info pl-24">
|
{{ link.description }}
|
||||||
<view class="name text-size-g">{{ data.item.name }}</view>
|
</view>
|
||||||
<view class="desc mt-12 text-size-s text-grey-darken-1">{{ data.item.description }}</view>
|
<view v-if="false" class="link mt-12 text-size-m text-grey-darken-1">
|
||||||
<view v-if="false" class="link mt-12 text-size-m text-grey-darken-1">
|
<text class="iconfont icon-link mr-6 text-size-s"></text>
|
||||||
<text class="iconfont icon-link mr-6 text-size-s"></text>
|
{{ link.url }}
|
||||||
{{ data.item.url }}
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</tm-translate>
|
||||||
</view>
|
</block>
|
||||||
</template>
|
</tm-translate>
|
||||||
</tm-quickIndex>
|
</block>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
|
<!-- 返回顶部 -->
|
||||||
|
<tm-flotbutton v-if="linkTotal > 10" color="light-blue" @click="fnToTopPage" size="m" icon="icon-angle-up"></tm-flotbutton>
|
||||||
|
|
||||||
<!-- 详情弹窗 -->
|
<!-- 详情弹窗 -->
|
||||||
<tm-poup v-model="detail.show" :width="640" height="auto" position="center" :round="6">
|
<tm-poup v-model="detail.show" :width="640" height="auto" position="center" :round="6">
|
||||||
<view class="poup pa-36">
|
<view class="poup pa-36">
|
||||||
<view class="info flex">
|
<view class="info flex">
|
||||||
<view class="poup-logo bg-gradient-amber-accent pa-4 shadow-24"><image class="poup-logo_img" :src="detail.data.logo" mode="aspectFill"></image></view>
|
<view class="poup-logo bg-gradient-amber-accent pa-4 shadow-24">
|
||||||
|
<image class="poup-logo_img" :src="detail.data.logo" mode="aspectFill"></image>
|
||||||
|
</view>
|
||||||
<view class="pl-24 info-detail">
|
<view class="pl-24 info-detail">
|
||||||
<view class="poup-name text-size-lg text-weight-b">{{ detail.data.name }}</view>
|
<view class="poup-name text-size-lg text-weight-b">{{ detail.data.name }}</view>
|
||||||
<view class="poup-tag ml--10">
|
<view class="poup-tag ml--10">
|
||||||
<tm-tags color="bg-gradient-amber-accent" size="n" model="fill">ID:{{ detail.data.id }}</tm-tags>
|
<tm-tags color="bg-gradient-amber-accent" size="n" model="fill">
|
||||||
<tm-tags color="bg-gradient-light-blue-lighten" size="n" model="fill">{{ detail.data.team }}</tm-tags>
|
ID:{{ detail.data.id }}
|
||||||
|
</tm-tags>
|
||||||
|
<tm-tags color="bg-gradient-light-blue-lighten" size="n" model="fill">
|
||||||
|
{{ detail.data.team || '暂未分组' }}
|
||||||
|
</tm-tags>
|
||||||
</view>
|
</view>
|
||||||
<view class="poup-link text-size-m" @click="fnCopyLink(detail.data)">
|
<view class="poup-link text-size-m" @click="fnCopyLink(detail.data)">
|
||||||
<text class="text-orange">{{ detail.data.url }}</text>
|
<text class="text-orange">{{ detail.data.url }}</text>
|
||||||
@@ -84,252 +132,274 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="poup-desc mt-20">博客简介:{{ detail.data.description || '这个博主很懒,没写简介~' }}</view>
|
<view class="poup-desc mt-20">
|
||||||
|
博客简介:{{ detail.data.description || '这个博主很懒,没写简介~' }}
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 博客预览图 -->
|
<!-- 博客预览图 -->
|
||||||
<view class="mt-24"><tm-images :width="568" :round="2" :src="caclSiteThumbnail(detail.data.url)" mode="aspectFill"></tm-images></view>
|
<view class="mt-24">
|
||||||
|
<tm-images :width="568" :round="2" :src="caclSiteThumbnail(detail.data.url)" mode="aspectFill"></tm-images>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</tm-poup>
|
</tm-poup>
|
||||||
</block>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmImages from '@/tm-vuetify/components/tm-images/tm-images.vue';
|
import tmImages from '@/tm-vuetify/components/tm-images/tm-images.vue';
|
||||||
import tmQuickIndex from '@/tm-vuetify/components/tm-quickIndex/tm-quickIndex.vue';
|
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
||||||
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
|
||||||
|
|
||||||
import { GetRandomNumberByRange } from '@/utils/random.js';
|
import { GetRandomNumberByRange } from '@/utils/random.js';
|
||||||
import findCnChart from '@/tm-vuetify/tool/function/findCnChart.js';
|
export default {
|
||||||
export default {
|
components: {
|
||||||
components: {
|
tmSkeleton,
|
||||||
tmSkeleton,
|
tmTranslate,
|
||||||
tmTranslate,
|
tmFlotbutton,
|
||||||
tmFlotbutton,
|
tmTags,
|
||||||
tmTags,
|
tmEmpty,
|
||||||
tmEmpty,
|
tmImages,
|
||||||
tmImages,
|
tmPoup
|
||||||
tmQuickIndex,
|
|
||||||
tmPoup
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: 'loading',
|
|
||||||
queryParams: {
|
|
||||||
size: 10,
|
|
||||||
page: 0,
|
|
||||||
sort: ''
|
|
||||||
},
|
|
||||||
result: [],
|
|
||||||
detail: {
|
|
||||||
show: false,
|
|
||||||
data: {}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
caclSiteThumbnail(val) {
|
|
||||||
return val => {
|
|
||||||
if (!val) return '';
|
|
||||||
if (val.charAt(val.length - 1) != '/') {
|
|
||||||
val = val + '/';
|
|
||||||
}
|
|
||||||
return 'https://image.thum.io/get/width/1000/crop/800/' + val;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.fnSetPageTitle('朋友圈');
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
fnRandomColor() {
|
|
||||||
const _r = GetRandomNumberByRange(0, this.$haloConfig.colors.length - 1);
|
|
||||||
return this.$haloConfig.colors[_r];
|
|
||||||
},
|
},
|
||||||
fnGetData() {
|
data() {
|
||||||
this.loading = 'loading';
|
return {
|
||||||
uni.showLoading({
|
loading: 'loading',
|
||||||
mask: true,
|
queryParams: {
|
||||||
title: '加载中...'
|
size: 10,
|
||||||
});
|
page: 0,
|
||||||
this.$httpApi
|
sort: ''
|
||||||
.getLinkListByTeam()
|
|
||||||
.then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
console.log('请求结果:');
|
|
||||||
console.log(res);
|
|
||||||
let resData = res.data;
|
|
||||||
// 处理数据
|
|
||||||
const _result = resData.map(item => {
|
|
||||||
const _team = item.team || '未分组';
|
|
||||||
const _firstChart = _team ? _team.substring(0, 1) : '';
|
|
||||||
const _links = item.links.map(link => {
|
|
||||||
link.logo = this.$utils.checkAvatarUrl(link.logo);
|
|
||||||
return link;
|
|
||||||
});
|
|
||||||
return {
|
|
||||||
title: _team,
|
|
||||||
index: findCnChart(_firstChart),
|
|
||||||
children: _links
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
this.result = _result.reverse();
|
|
||||||
setTimeout(() => {
|
|
||||||
this.loading = 'success';
|
|
||||||
}, 500);
|
|
||||||
} else {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.loading = 'error';
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
this.loading = 'error';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
}, 500);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
fnOnLinkEvent(link) {
|
|
||||||
this.detail.data = link;
|
|
||||||
this.detail.show = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
fnCopyLink(link) {
|
|
||||||
uni.setClipboardData({
|
|
||||||
data: `${link.name}:${link.url}`,
|
|
||||||
showToast: false,
|
|
||||||
success: () => {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '链接复制成功!'
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
fail: () => {
|
result: [],
|
||||||
uni.showToast({
|
detail: {
|
||||||
icon: 'none',
|
show: false,
|
||||||
title: '复制失败!'
|
data: {}
|
||||||
|
},
|
||||||
|
linkTotal: 0
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
caclSiteThumbnail(val) {
|
||||||
|
return val => {
|
||||||
|
if (!val) return '';
|
||||||
|
if (val.charAt(val.length - 1) != '/') {
|
||||||
|
val = val + '/';
|
||||||
|
}
|
||||||
|
return 'https://image.thum.io/get/width/1000/crop/800/' + val;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.fnSetPageTitle('朋友圈');
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fnRandomColor() {
|
||||||
|
const _r = GetRandomNumberByRange(0, this.$haloConfig.colors.length - 1);
|
||||||
|
return this.$haloConfig.colors[_r];
|
||||||
|
},
|
||||||
|
fnGetData() {
|
||||||
|
this.linkTotal = 0;
|
||||||
|
this.loading = 'loading';
|
||||||
|
// uni.showLoading({
|
||||||
|
// mask: true,
|
||||||
|
// title: '加载中...'
|
||||||
|
// });
|
||||||
|
this.$httpApi
|
||||||
|
.getLinkListByTeam()
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
console.log('请求结果:');
|
||||||
|
console.log(res);
|
||||||
|
// 处理数据
|
||||||
|
const _result = res.data.map(item => {
|
||||||
|
const _team = item.team || '未分组';
|
||||||
|
const _links = item.links.map(link => {
|
||||||
|
this.linkTotal += 1;
|
||||||
|
link.logo = this.$utils.checkAvatarUrl(link.logo);
|
||||||
|
return link;
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
title: _team,
|
||||||
|
children: _links
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
this.result = _result.reverse();
|
||||||
|
setTimeout(() => {
|
||||||
|
this.loading = 'success';
|
||||||
|
}, 500);
|
||||||
|
} else {
|
||||||
|
this.loading = 'error';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 500);
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
|
||||||
|
fnOnLinkEvent(link) {
|
||||||
|
this.detail.data = link;
|
||||||
|
this.detail.show = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
fnCopyLink(link) {
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: `${link.name}:${link.url}`,
|
||||||
|
showToast: false,
|
||||||
|
success: () => {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '链接复制成功!'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '复制失败!'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
background-color: #fafafd;
|
||||||
.loading-wrap {
|
}
|
||||||
padding: 24rpx;
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty {
|
.loading-wrap {
|
||||||
width: 100vw;
|
padding: 24rpx;
|
||||||
height: 60vh;
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.link-card {
|
.content {
|
||||||
border-bottom: 2rpx solid #f5f5f5;
|
padding: 0 24rpx;
|
||||||
background-color: #ffffff;
|
padding-top: 24rpx;
|
||||||
&.one {
|
|
||||||
border: 0;
|
.content-empty {
|
||||||
box-shadow: 0rpx 2rpx 24rpx 0rpx rgba(0, 0, 0, 0.03);
|
height: 60vh;
|
||||||
.logo {
|
display: flex;
|
||||||
box-shadow: 0rpx 2rpx 12rpx rgba(0, 0, 0, 0.1);
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.logo {
|
|
||||||
// width: 126rpx;
|
.link-card {
|
||||||
// height: 126rpx;
|
border-bottom: 2rpx solid #f5f5f5;
|
||||||
width: 80rpx;
|
background-color: #ffffff;
|
||||||
height: 80rpx;
|
|
||||||
border-radius: 50%;
|
&.one {
|
||||||
border: 6rpx solid #ffffff;
|
border: 0;
|
||||||
box-shadow: none;
|
box-shadow: 0rpx 2rpx 24rpx 0rpx rgba(0, 0, 0, 0.03);
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
box-shadow: 0rpx 2rpx 12rpx rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
// width: 126rpx;
|
||||||
|
// height: 126rpx;
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
border: 6rpx solid #ffffff;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
width: 0;
|
||||||
|
flex-grow: 1;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
color: #303133;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
color: #303133;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.info {
|
.link-card_name {
|
||||||
|
// color: #303133;
|
||||||
|
// color: #0080fe;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-card_desc {
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-logo {
|
||||||
|
width: 140rpx;
|
||||||
|
height: 140rpx;
|
||||||
|
|
||||||
|
&_img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.poup-logo {
|
||||||
|
width: 140rpx;
|
||||||
|
height: 140rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
|
||||||
|
&_img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-detail {
|
||||||
width: 0;
|
width: 0;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
.name {
|
justify-content: center;
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
color: #303133;
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.desc {
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
color: #303133;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.link-card_name {
|
.poup-desc {
|
||||||
// color: #303133;
|
font-size: 28rpx;
|
||||||
// color: #0080fe;
|
line-height: 1.6;
|
||||||
}
|
color: #555 !important;
|
||||||
.link-card_desc {
|
}
|
||||||
font-size: 24rpx;
|
|
||||||
line-height: 1.6;
|
.preview-site {
|
||||||
color: #303133;
|
|
||||||
}
|
|
||||||
.link-logo {
|
|
||||||
width: 140rpx;
|
|
||||||
height: 140rpx;
|
|
||||||
&_img {
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 300rpx;
|
||||||
}
|
}
|
||||||
}
|
</style>
|
||||||
.poup-logo {
|
|
||||||
width: 140rpx;
|
|
||||||
height: 140rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
&_img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.info-detail {
|
|
||||||
width: 0;
|
|
||||||
flex-grow: 1;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.poup-desc {
|
|
||||||
font-size: 28rpx;
|
|
||||||
line-height: 1.6;
|
|
||||||
color: #555 !important;
|
|
||||||
}
|
|
||||||
.preview-site {
|
|
||||||
width: 100%;
|
|
||||||
height: 300rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
</tm-grouplist>
|
</tm-grouplist>
|
||||||
</view>
|
</view>
|
||||||
<view class="copyright bg-white text-size-xs text-align-center text-grey-darken-1 pa-36">
|
<view class="copyright bg-white text-size-xs text-align-center text-grey-darken-1 pa-36">
|
||||||
<view class="">根据 MIT 许可证发布</view>
|
<view class="">根据 AGPL-3.0 协议开源</view>
|
||||||
<view class="mt-8">「 2022 uni-halo 丨 开源项目丨巷子工坊@小莫唐尼 」</view>
|
<view class="mt-8">「 2022 uni-halo 丨 开源项目丨巷子工坊@小莫唐尼 」</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
+271
-244
@@ -18,16 +18,8 @@
|
|||||||
<block v-for="(item, index) in dataList" :key="index">
|
<block v-for="(item, index) in dataList" :key="index">
|
||||||
<view class="tm-timeline-item tm-timeline-item--leftDir">
|
<view class="tm-timeline-item tm-timeline-item--leftDir">
|
||||||
<view style="width: 160rpx;">
|
<view style="width: 160rpx;">
|
||||||
<view
|
<view :style="{ width: '24rpx', height: '24rpx' }" :class="[black_tmeme ? 'bk' : '']" class="flex-center rounded tm-timeline-jidian border-white-a-2 grey-lighten-2 light-blue shadow-primary-4"></view>
|
||||||
:style="{ width: '24rpx', height: '24rpx' }"
|
<view :style="{ marginTop: '-24rpx' }" :class="[index !== dataList.length - 1 ? 'tm-timeline-item-boder' : '', black_tmeme ? 'bk' : '']" class="grey-lighten-2"></view>
|
||||||
:class="[black_tmeme ? 'bk' : '']"
|
|
||||||
class="flex-center rounded tm-timeline-jidian border-white-a-2 grey-lighten-2 light-blue shadow-primary-4"
|
|
||||||
></view>
|
|
||||||
<view
|
|
||||||
:style="{ marginTop: '-24rpx' }"
|
|
||||||
:class="[index !== dataList.length - 1 ? 'tm-timeline-item-boder' : '', black_tmeme ? 'bk' : '']"
|
|
||||||
class="grey-lighten-2"
|
|
||||||
></view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="tm-timeline-item-content relative">
|
<view class="tm-timeline-item-content relative">
|
||||||
<view class="tm-timeline-item-left">
|
<view class="tm-timeline-item-left">
|
||||||
@@ -38,7 +30,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<block v-if="item.posts.length != 0">
|
<block v-if="item.posts.length != 0">
|
||||||
<block v-for="(post, postIndex) in item.posts" :key="post.id">
|
<block v-for="(post, postIndex) in item.posts" :key="post.id">
|
||||||
<tm-translate animation-name="fadeUp" :wait="(postIndex + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(postIndex)">
|
||||||
<view class="flex post shadow-3 pa-24 mb-24" :class="[globalAppSettings.layout.cardType]" @click="fnToArticleDetail(post)">
|
<view class="flex post shadow-3 pa-24 mb-24" :class="[globalAppSettings.layout.cardType]" @click="fnToArticleDetail(post)">
|
||||||
<image class="post-thumbnail" :src="$utils.checkThumbnailUrl(post.thumbnail)" mode="aspectFill"></image>
|
<image class="post-thumbnail" :src="$utils.checkThumbnailUrl(post.thumbnail)" mode="aspectFill"></image>
|
||||||
<view class="post-info pl-20">
|
<view class="post-info pl-20">
|
||||||
@@ -67,274 +59,309 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmTabs,
|
tmTabs,
|
||||||
tmEmpty
|
tmEmpty
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: 'loading',
|
|
||||||
tab: {
|
|
||||||
activeIndex: 0,
|
|
||||||
list: ['按月份查看', '按年份查看']
|
|
||||||
},
|
|
||||||
queryParams: {
|
|
||||||
size: 10,
|
|
||||||
page: 0
|
|
||||||
},
|
|
||||||
result: null,
|
|
||||||
dataList: [],
|
|
||||||
api: 'getMonthArchives'
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
black_tmeme: function() {
|
|
||||||
return this.$tm.vx.state().tmVuetify.black;
|
|
||||||
},
|
},
|
||||||
color_tmeme: function() {
|
data() {
|
||||||
return this.$tm.vx.state().tmVuetify.color;
|
return {
|
||||||
}
|
loading: 'loading',
|
||||||
},
|
tab: {
|
||||||
created() {
|
activeIndex: 0,
|
||||||
this.fnGetData();
|
list: ['按月份查看', '按年份查看']
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
queryParams: {
|
||||||
this.fnGetData();
|
size: 10,
|
||||||
this.queryParams.page = 0;
|
page: 0
|
||||||
},
|
},
|
||||||
|
result: null,
|
||||||
methods: {
|
dataList: [],
|
||||||
fnOnTabChange(index) {
|
api: 'getMonthArchives'
|
||||||
// todo:
|
};
|
||||||
const _api = ['getMonthArchives', 'getYearArchives'];
|
},
|
||||||
this.api = _api[index];
|
computed: {
|
||||||
this.queryParams.page = 0;
|
black_tmeme: function() {
|
||||||
|
return this.$tm.vx.state().tmVuetify.black;
|
||||||
|
},
|
||||||
|
color_tmeme: function() {
|
||||||
|
return this.$tm.vx.state().tmVuetify.color;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
},
|
},
|
||||||
fnGetData() {
|
onPullDownRefresh() {
|
||||||
this.loading = 'loading';
|
this.fnGetData();
|
||||||
uni.showLoading({
|
this.queryParams.page = 0;
|
||||||
mask: true,
|
|
||||||
title: '加载中...'
|
|
||||||
});
|
|
||||||
this.$httpApi[this.api](this.queryParams)
|
|
||||||
.then(res => {
|
|
||||||
this.result = res.data;
|
|
||||||
this.dataList = res.data;
|
|
||||||
setTimeout(() => {
|
|
||||||
this.loading = 'success';
|
|
||||||
}, 500);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
this.loading = 'error';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
}, 500);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
//跳转文章详情
|
|
||||||
fnToArticleDetail(article) {
|
methods: {
|
||||||
uni.navigateTo({
|
fnOnTabChange(index) {
|
||||||
url: '/pagesA/article-detail/article-detail?articleId=' + article.id,
|
this.fnResetSetAniWaitIndex();
|
||||||
animationType: 'slide-in-right'
|
const _api = ['getMonthArchives', 'getYearArchives'];
|
||||||
});
|
this.api = _api[index];
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
fnGetData() {
|
||||||
|
this.loading = 'loading';
|
||||||
|
// uni.showLoading({
|
||||||
|
// mask: true,
|
||||||
|
// title: '加载中...'
|
||||||
|
// });
|
||||||
|
this.$httpApi[this.api](this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
this.result = res.data;
|
||||||
|
this.dataList = res.data;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.loading = 'success';
|
||||||
|
}, 500);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//跳转文章详情
|
||||||
|
fnToArticleDetail(article) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesA/article-detail/article-detail?articleId=' + article.id,
|
||||||
|
animationType: 'slide-in-right'
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background-color: #fafafd;
|
background-color: #fafafd;
|
||||||
}
|
}
|
||||||
.loading-wrap {
|
|
||||||
padding: 24rpx;
|
.loading-wrap {
|
||||||
}
|
padding: 24rpx;
|
||||||
.list-empty {
|
}
|
||||||
width: 100vw;
|
|
||||||
height: 100vh;
|
.list-empty {
|
||||||
}
|
width: 100vw;
|
||||||
.statistics {
|
height: 100vh;
|
||||||
background-color: #ffffff;
|
}
|
||||||
}
|
|
||||||
.e-timeline {
|
.statistics {
|
||||||
::v-deep {
|
background-color: #ffffff;
|
||||||
.tm-timeline-item > view:first-child {
|
}
|
||||||
width: 110rpx !important;
|
|
||||||
}
|
.e-timeline {
|
||||||
.tm-timeline-item-left {
|
::v-deep {
|
||||||
max-width: 580rpx !important;
|
.tm-timeline-item>view:first-child {
|
||||||
width: 100% !important;
|
width: 110rpx !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tm-timeline-item-left {
|
||||||
|
max-width: 580rpx !important;
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.tm-timeline {
|
.tm-timeline {
|
||||||
.tm-timeline-item {
|
.tm-timeline-item {
|
||||||
.tm-timeline-item-left,
|
|
||||||
.tm-timeline-item-right {
|
|
||||||
width: 200rpx;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tm-timeline-item-content {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: flex-start;
|
|
||||||
align-content: flex-start;
|
|
||||||
}
|
|
||||||
.tm-timeline-jidian {
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
&.tm-timeline-item--leftDir {
|
|
||||||
display: flex;
|
|
||||||
flex-flow: row;
|
|
||||||
&.endright {
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
.tm-timeline-item-left,
|
.tm-timeline-item-left,
|
||||||
.tm-timeline-item-right {
|
.tm-timeline-item-right {
|
||||||
width: auto;
|
width: 200rpx;
|
||||||
max-width: 400rpx;
|
flex-shrink: 0;
|
||||||
}
|
|
||||||
.tm-timeline-item-boder {
|
|
||||||
height: 100%;
|
|
||||||
width: 1px;
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
.tm-timeline-jidian {
|
|
||||||
position: relative;
|
|
||||||
margin: auto;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tm-timeline-item-content {
|
.tm-timeline-item-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: center;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
align-content: flex-start;
|
align-content: flex-start;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.post {
|
.tm-timeline-jidian {
|
||||||
width: 560rpx;
|
margin: auto;
|
||||||
border-radius: 12rpx;
|
}
|
||||||
background-color: #fff;
|
|
||||||
&.lr_image_text {
|
&.tm-timeline-item--leftDir {
|
||||||
}
|
display: flex;
|
||||||
&.lr_text_image {
|
flex-flow: row;
|
||||||
.post-thumbnail {
|
|
||||||
order: 2;
|
&.endright {
|
||||||
}
|
justify-content: flex-end;
|
||||||
.post-info {
|
}
|
||||||
order: 1;
|
|
||||||
padding-left: 0;
|
.tm-timeline-item-left,
|
||||||
padding-right: 24rpx;
|
.tm-timeline-item-right {
|
||||||
|
width: auto;
|
||||||
|
max-width: 400rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tm-timeline-item-boder {
|
||||||
|
height: 100%;
|
||||||
|
width: 1px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tm-timeline-jidian {
|
||||||
|
position: relative;
|
||||||
|
margin: auto;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tm-timeline-item-content {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: flex-start;
|
||||||
|
align-content: flex-start;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.tb_image_text {
|
|
||||||
flex-direction: column;
|
.post {
|
||||||
.post-thumbnail {
|
width: 560rpx;
|
||||||
width: 100%;
|
border-radius: 12rpx;
|
||||||
height: 220rpx;
|
background-color: #fff;
|
||||||
|
|
||||||
|
&.lr_image_text {}
|
||||||
|
|
||||||
|
&.lr_text_image {
|
||||||
|
.post-thumbnail {
|
||||||
|
order: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-info {
|
||||||
|
order: 1;
|
||||||
|
padding-left: 0;
|
||||||
|
padding-right: 24rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.post-info {
|
|
||||||
width: 100%;
|
&.tb_image_text {
|
||||||
padding-left: 0;
|
flex-direction: column;
|
||||||
&_title {
|
|
||||||
|
.post-thumbnail {
|
||||||
|
width: 100%;
|
||||||
|
height: 220rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-info {
|
||||||
|
width: 100%;
|
||||||
|
padding-left: 0;
|
||||||
|
|
||||||
|
&_title {
|
||||||
|
margin-top: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&_time {
|
||||||
|
.iconfont {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-label {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.tb_text_image {
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.post-thumbnail {
|
||||||
|
order: 2;
|
||||||
|
width: 100%;
|
||||||
|
height: 220rpx;
|
||||||
margin-top: 12rpx;
|
margin-top: 12rpx;
|
||||||
}
|
}
|
||||||
&_time {
|
|
||||||
.iconfont {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.time-label {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.tb_text_image {
|
|
||||||
flex-direction: column;
|
|
||||||
.post-thumbnail {
|
|
||||||
order: 2;
|
|
||||||
width: 100%;
|
|
||||||
height: 220rpx;
|
|
||||||
margin-top: 12rpx;
|
|
||||||
}
|
|
||||||
.post-info {
|
|
||||||
order: 1;
|
|
||||||
width: 100%;
|
|
||||||
padding-left: 0;
|
|
||||||
|
|
||||||
&_time {
|
.post-info {
|
||||||
.iconfont {
|
order: 1;
|
||||||
display: none;
|
width: 100%;
|
||||||
}
|
padding-left: 0;
|
||||||
.time-label {
|
|
||||||
display: inline-block;
|
&_time {
|
||||||
|
.iconfont {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-label {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
&.only_text {
|
&.only_text {
|
||||||
.post-info {
|
.post-info {
|
||||||
padding: 6rpx;
|
padding: 6rpx;
|
||||||
&_time {
|
|
||||||
margin-top: 20rpx;
|
&_time {
|
||||||
.iconfont {
|
margin-top: 20rpx;
|
||||||
display: none;
|
|
||||||
}
|
.iconfont {
|
||||||
.time-label {
|
display: none;
|
||||||
display: inline-block;
|
}
|
||||||
|
|
||||||
|
.time-label {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.post-thumbnail {
|
.post-thumbnail {
|
||||||
display: none;
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.post-thumbnail {
|
.post-thumbnail {
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
width: 200rpx;
|
width: 200rpx;
|
||||||
height: 170rpx;
|
height: 170rpx;
|
||||||
}
|
|
||||||
.post-info {
|
|
||||||
width: 0;
|
|
||||||
flex-grow: 1;
|
|
||||||
&_title {
|
|
||||||
color: #303133;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
}
|
||||||
&_summary {
|
|
||||||
display: -webkit-box;
|
.post-info {
|
||||||
line-height: 1.6;
|
width: 0;
|
||||||
}
|
flex-grow: 1;
|
||||||
&_time {
|
|
||||||
.time-label {
|
&_title {
|
||||||
display: none;
|
color: #303133;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
&_summary {
|
||||||
|
display: -webkit-box;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
&_time {
|
||||||
|
.time-label {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
</style>
|
||||||
</style>
|
|
||||||
File diff suppressed because it is too large
Load Diff
+141
-138
@@ -23,7 +23,7 @@
|
|||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(article, index) in dataList" :key="article.id">
|
<block v-for="(article, index) in dataList" :key="article.id">
|
||||||
<!-- 文章卡片 -->
|
<!-- 文章卡片 -->
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<article-card :article="article" @on-click="fnToArticleDetail"></article-card>
|
<article-card :article="article" @on-click="fnToArticleDetail"></article-card>
|
||||||
<!-- 广告区域 -->
|
<!-- 广告区域 -->
|
||||||
<view v-if="haloAdConfig.articles.use && (index + 1) % haloAdConfig.frequency == 0" class="ad-wrap ma-24">
|
<view v-if="haloAdConfig.articles.use && (index + 1) % haloAdConfig.frequency == 0" class="ad-wrap ma-24">
|
||||||
@@ -45,159 +45,162 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmSearch from '@/tm-vuetify/components/tm-search/tm-search.vue';
|
import tmSearch from '@/tm-vuetify/components/tm-search/tm-search.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmSearch,
|
tmSearch,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
tmTabs,
|
tmTabs,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmEmpty
|
tmEmpty
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isBlackTheme: false,
|
isBlackTheme: false,
|
||||||
loading: 'loading',
|
loading: 'loading',
|
||||||
tab: {
|
tab: {
|
||||||
activeIndex: 0,
|
activeIndex: 0,
|
||||||
list: ['全部', '最新文章', '热门文章', '最近更新', '最多点赞']
|
list: ['全部', '最新文章', '热门文章', '最近更新', '最多点赞']
|
||||||
},
|
},
|
||||||
queryParams: {
|
queryParams: {
|
||||||
size: 10,
|
size: 10,
|
||||||
page: 0,
|
page: 0,
|
||||||
sort: 'topPriority,createTime,desc',
|
sort: 'topPriority,createTime,desc',
|
||||||
keyword: ''
|
keyword: ''
|
||||||
},
|
},
|
||||||
cache: {
|
cache: {
|
||||||
dataList: [],
|
dataList: [],
|
||||||
total: 0
|
total: 0
|
||||||
},
|
},
|
||||||
isLoadMore: false,
|
isLoadMore: false,
|
||||||
loadMoreText: '加载中...',
|
loadMoreText: '加载中...',
|
||||||
result: {},
|
result: {},
|
||||||
dataList: []
|
dataList: []
|
||||||
};
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.fnSetPageTitle('文章列表');
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
this.isLoadMore = false;
|
|
||||||
this.queryParams.page = 0;
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
|
|
||||||
onReachBottom(e) {
|
|
||||||
if (this.result.hasNext) {
|
|
||||||
this.queryParams.page += 1;
|
|
||||||
this.isLoadMore = true;
|
|
||||||
this.fnGetData();
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '没有更多数据了'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
fnOnTabChange(index) {
|
|
||||||
this.dataList = [];
|
|
||||||
const _sorts = {
|
|
||||||
0: '',
|
|
||||||
1: 'topPriority,createTime,desc',
|
|
||||||
2: 'topPriority,visits,desc',
|
|
||||||
3: 'topPriority,updateTime,desc',
|
|
||||||
4: 'topPriority,likes,desc'
|
|
||||||
};
|
};
|
||||||
this.queryParams.sort = _sorts[index];
|
},
|
||||||
this.queryParams.page = 0;
|
onLoad() {
|
||||||
this.dataList = [];
|
this.fnSetPageTitle('文章列表');
|
||||||
this.fnToTopPage();
|
},
|
||||||
|
created() {
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
},
|
},
|
||||||
fnOnSearch() {
|
onPullDownRefresh() {
|
||||||
this.queryParams.page = 0;
|
|
||||||
this.isLoadMore = false;
|
this.isLoadMore = false;
|
||||||
|
this.queryParams.page = 0;
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
},
|
},
|
||||||
fnGetData() {
|
|
||||||
uni.showLoading({
|
|
||||||
mask: true,
|
|
||||||
title: '加载中...'
|
|
||||||
});
|
|
||||||
// 设置状态为加载中
|
|
||||||
if (!this.isLoadMore) {
|
|
||||||
this.loading = 'loading';
|
|
||||||
}
|
|
||||||
this.loadMoreText = '加载中...';
|
|
||||||
this.$httpApi
|
|
||||||
.getPostList(this.queryParams)
|
|
||||||
.then(res => {
|
|
||||||
console.log('请求结果:');
|
|
||||||
console.log(res);
|
|
||||||
|
|
||||||
this.loading = 'success';
|
onReachBottom(e) {
|
||||||
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
if (this.result.hasNext) {
|
||||||
// 处理数据
|
this.queryParams.page += 1;
|
||||||
this.result = res.data;
|
this.isLoadMore = true;
|
||||||
if (this.isLoadMore) {
|
this.fnGetData();
|
||||||
this.dataList = this.dataList.concat(res.data.content);
|
} else {
|
||||||
} else {
|
uni.showToast({
|
||||||
this.dataList = res.data.content;
|
icon: 'none',
|
||||||
}
|
title: '没有更多数据了'
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
this.loading = 'error';
|
|
||||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
}, 800);
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
fnOnTabChange(index) {
|
||||||
|
this.fnResetSetAniWaitIndex();
|
||||||
|
this.dataList = [];
|
||||||
|
const _sorts = {
|
||||||
|
0: '',
|
||||||
|
1: 'topPriority,createTime,desc',
|
||||||
|
2: 'topPriority,visits,desc',
|
||||||
|
3: 'topPriority,updateTime,desc',
|
||||||
|
4: 'topPriority,likes,desc'
|
||||||
|
};
|
||||||
|
this.queryParams.sort = _sorts[index];
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
this.dataList = [];
|
||||||
|
this.fnToTopPage();
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
fnOnSearch() {
|
||||||
|
this.fnResetSetAniWaitIndex();
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
this.isLoadMore = false;
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
fnGetData() {
|
||||||
|
// uni.showLoading({
|
||||||
|
// mask: true,
|
||||||
|
// title: '加载中...'
|
||||||
|
// });
|
||||||
|
// 设置状态为加载中
|
||||||
|
if (!this.isLoadMore) {
|
||||||
|
this.loading = 'loading';
|
||||||
|
}
|
||||||
|
this.loadMoreText = '加载中...';
|
||||||
|
this.$httpApi
|
||||||
|
.getPostList(this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
console.log('请求结果:');
|
||||||
|
console.log(res);
|
||||||
|
|
||||||
//跳转文章详情
|
this.loading = 'success';
|
||||||
fnToArticleDetail(article) {
|
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
uni.navigateTo({
|
// 处理数据
|
||||||
url: '/pagesA/article-detail/article-detail?articleId=' + article.id,
|
this.result = res.data;
|
||||||
animationType: 'slide-in-right'
|
if (this.isLoadMore) {
|
||||||
});
|
this.dataList = this.dataList.concat(res.data.content);
|
||||||
|
} else {
|
||||||
|
this.dataList = res.data.content;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 800);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//跳转文章详情
|
||||||
|
fnToArticleDetail(article) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesA/article-detail/article-detail?articleId=' + article.id,
|
||||||
|
animationType: 'slide-in-right'
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding-bottom: 24rpx;
|
padding-bottom: 24rpx;
|
||||||
background-color: #fafafd;
|
background-color: #fafafd;
|
||||||
|
|
||||||
&.is-balck {
|
&.is-balck {
|
||||||
background-color: #212121;
|
background-color: #212121;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.content {
|
|
||||||
padding-top: 24rpx;
|
|
||||||
|
|
||||||
.content-empty {
|
.content {
|
||||||
height: 60vh;
|
padding-top: 24rpx;
|
||||||
|
|
||||||
|
.content-empty {
|
||||||
|
height: 60vh;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
</style>
|
||||||
</style>
|
|
||||||
@@ -11,134 +11,136 @@
|
|||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(article, index) in dataList" :key="article.createTime">
|
<block v-for="(article, index) in dataList" :key="article.createTime">
|
||||||
<!-- 文章卡片 -->
|
<!-- 文章卡片 -->
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50"><article-card :article="article" @on-click="fnToArticleDetail"></article-card></tm-translate>
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)"><article-card :article="article" @on-click="fnToArticleDetail"></article-card></tm-translate>
|
||||||
</block>
|
</block>
|
||||||
<view class="load-text">{{ loadMoreText }}</view>
|
<view class="load-text">{{ loadMoreText }}</view>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<tm-flotbutton @click="fnToTopPage" size="m" icon="icon-angle-up"></tm-flotbutton>
|
<tm-flotbutton @click="fnToTopPage" color="light-blue" size="m" icon="icon-angle-up"></tm-flotbutton>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import ArticleCard from '@/components/article-card/article-card.vue';
|
import ArticleCard from '@/components/article-card/article-card.vue';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
ArticleCard
|
ArticleCard
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: 'loading',
|
|
||||||
queryParams: {
|
|
||||||
size: 10,
|
|
||||||
page: 0
|
|
||||||
},
|
|
||||||
slug: '',
|
|
||||||
pageTitle: '加载中...',
|
|
||||||
result: null,
|
|
||||||
dataList: [],
|
|
||||||
isLoadMore: false,
|
|
||||||
loadMoreText: ''
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
onLoad(e) {
|
|
||||||
this.slug = e.slug;
|
|
||||||
this.pageTitle = e.name;
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
this.isLoadMore = false;
|
|
||||||
this.queryParams.page = 0;
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
onReachBottom(e) {
|
|
||||||
if (this.result.hasNext) {
|
|
||||||
this.queryParams.page += 1;
|
|
||||||
this.isLoadMore = true;
|
|
||||||
this.fnGetData();
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '没有更多数据了'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
fnGetData() {
|
|
||||||
uni.showLoading({
|
|
||||||
mask: true,
|
|
||||||
title: '加载中...'
|
|
||||||
});
|
|
||||||
// 设置状态为加载中
|
|
||||||
if (!this.isLoadMore) {
|
|
||||||
this.loading = 'loading';
|
|
||||||
}
|
|
||||||
this.loadMoreText = '加载中...';
|
|
||||||
this.$httpApi
|
|
||||||
.getCategoryPostList(this.slug, this.queryParams)
|
|
||||||
.then(res => {
|
|
||||||
this.fnSetPageTitle(this.pageTitle + ` (共${res.data.total}篇)`);
|
|
||||||
this.result = res.data;
|
|
||||||
if (this.isLoadMore) {
|
|
||||||
this.dataList = this.dataList.concat(res.data.content);
|
|
||||||
} else {
|
|
||||||
this.dataList = res.data.content;
|
|
||||||
}
|
|
||||||
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
|
||||||
setTimeout(() => {
|
|
||||||
this.loading = 'success';
|
|
||||||
}, 500);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
this.loading = 'error';
|
|
||||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
}, 500);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
//跳转文章详情
|
data() {
|
||||||
fnToArticleDetail(article) {
|
return {
|
||||||
uni.navigateTo({
|
loading: 'loading',
|
||||||
url: '/pagesA/article-detail/article-detail?articleId=' + article.id,
|
queryParams: {
|
||||||
animationType: 'slide-in-right'
|
size: 10,
|
||||||
});
|
page: 0
|
||||||
|
},
|
||||||
|
slug: '',
|
||||||
|
pageTitle: '加载中...',
|
||||||
|
result: null,
|
||||||
|
dataList: [],
|
||||||
|
isLoadMore: false,
|
||||||
|
loadMoreText: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad(e) {
|
||||||
|
this.slug = e.slug;
|
||||||
|
this.pageTitle = e.name;
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.isLoadMore = false;
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
onReachBottom(e) {
|
||||||
|
if (this.result.hasNext) {
|
||||||
|
this.queryParams.page += 1;
|
||||||
|
this.isLoadMore = true;
|
||||||
|
this.fnGetData();
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '没有更多数据了'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fnGetData() {
|
||||||
|
// uni.showLoading({
|
||||||
|
// mask: true,
|
||||||
|
// title: '加载中...'
|
||||||
|
// });
|
||||||
|
// 设置状态为加载中
|
||||||
|
if (!this.isLoadMore) {
|
||||||
|
this.loading = 'loading';
|
||||||
|
}
|
||||||
|
this.loadMoreText = '加载中...';
|
||||||
|
this.$httpApi
|
||||||
|
.getCategoryPostList(this.slug, this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
this.fnSetPageTitle(`分类:${this.pageTitle} (共${res.data.total}篇)`);
|
||||||
|
this.result = res.data;
|
||||||
|
if (this.isLoadMore) {
|
||||||
|
this.dataList = this.dataList.concat(res.data.content);
|
||||||
|
} else {
|
||||||
|
this.dataList = res.data.content;
|
||||||
|
}
|
||||||
|
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
|
setTimeout(() => {
|
||||||
|
this.loading = 'success';
|
||||||
|
}, 500);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//跳转文章详情
|
||||||
|
fnToArticleDetail(article) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesA/article-detail/article-detail?articleId=' + article.id,
|
||||||
|
animationType: 'slide-in-right'
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 24rpx 0;
|
padding: 24rpx 0;
|
||||||
background-color: #fafafd;
|
background-color: #fafafd;
|
||||||
}
|
}
|
||||||
.loading-wrap {
|
|
||||||
padding: 0 24rpx;
|
.loading-wrap {
|
||||||
min-height: 100vh;
|
padding: 0 24rpx;
|
||||||
}
|
min-height: 100vh;
|
||||||
.empty {
|
}
|
||||||
height: 60vh;
|
|
||||||
display: flex;
|
.empty {
|
||||||
align-items: center;
|
height: 60vh;
|
||||||
justify-content: center;
|
display: flex;
|
||||||
}
|
align-items: center;
|
||||||
</style>
|
justify-content: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+123
-133
@@ -3,19 +3,7 @@
|
|||||||
<view class="content pt-24 pb-24 round-4">
|
<view class="content pt-24 pb-24 round-4">
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<tm-form @submit="fnOnSubmit">
|
<tm-form @submit="fnOnSubmit">
|
||||||
<tm-input
|
<tm-input :auto-focus="true" name="content" :vertical="true" required :height="220" input-type="textarea" bg-color="grey-lighten-5" :maxlength="200" :borderBottom="false" placeholder="请输入内容,不超过200字符..." v-model="form.content"></tm-input>
|
||||||
:auto-focus="true"
|
|
||||||
name="content"
|
|
||||||
:vertical="true"
|
|
||||||
required
|
|
||||||
:height="220"
|
|
||||||
input-type="textarea"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
:maxlength="200"
|
|
||||||
:borderBottom="false"
|
|
||||||
placeholder="请输入内容,不超过200字符..."
|
|
||||||
v-model="form.content"
|
|
||||||
></tm-input>
|
|
||||||
<tm-input name="author" align="right" required title="我的昵称" placeholder="请输入您的昵称..." v-model="form.author"></tm-input>
|
<tm-input name="author" align="right" required title="我的昵称" placeholder="请输入您的昵称..." v-model="form.author"></tm-input>
|
||||||
<tm-input name="email" align="right" title="邮箱地址" placeholder="请输入您的邮箱..." v-model="form.email"></tm-input>
|
<tm-input name="email" align="right" title="邮箱地址" placeholder="请输入您的邮箱..." v-model="form.email"></tm-input>
|
||||||
<tm-input name="authorUrl" align="right" title="我的网站" placeholder="请输入您的网址..." v-model="form.authorUrl"></tm-input>
|
<tm-input name="authorUrl" align="right" title="我的网站" placeholder="请输入您的网址..." v-model="form.authorUrl"></tm-input>
|
||||||
@@ -30,134 +18,136 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmForm from '@/tm-vuetify/components/tm-form/tm-form.vue';
|
import tmForm from '@/tm-vuetify/components/tm-form/tm-form.vue';
|
||||||
import tmInput from '@/tm-vuetify/components/tm-input/tm-input.vue';
|
import tmInput from '@/tm-vuetify/components/tm-input/tm-input.vue';
|
||||||
import tmSwitch from '@/tm-vuetify/components/tm-switch/tm-switch.vue';
|
import tmSwitch from '@/tm-vuetify/components/tm-switch/tm-switch.vue';
|
||||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmForm,
|
tmForm,
|
||||||
tmInput,
|
tmInput,
|
||||||
tmSwitch,
|
tmSwitch,
|
||||||
tmButton
|
tmButton
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
params: {
|
|
||||||
postId: '',
|
|
||||||
parentId: '',
|
|
||||||
title: '', // 被回复的标题 type=user =用户名 否则为文章标题
|
|
||||||
form: '',
|
|
||||||
formPage: '', // 来自哪个页面
|
|
||||||
type: 'post' // 来源文章/页面 还是用户 user=用户
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
allowNotification: true,
|
|
||||||
author: '', // 作者
|
|
||||||
avatar: '',
|
|
||||||
authorUrl: '', // 作者主页
|
|
||||||
content: '', // 评论内容
|
|
||||||
email: '', // 邮件
|
|
||||||
parentId: 0,
|
|
||||||
postId: 0
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
// 评论游客信息
|
|
||||||
wxLoginVisitorUser() {
|
|
||||||
return uni.$tm.vx.getters().user.getWxLoginInfo;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.params = this.$Route.query;
|
|
||||||
this.form.postId = this.params.id;
|
|
||||||
if (this.params.type == 'user') {
|
|
||||||
this.form.parentId = this.params.parentId;
|
|
||||||
this.fnSetPageTitle('回复用户:' + this.params.title);
|
|
||||||
} else {
|
|
||||||
this.form.parentId = 0;
|
|
||||||
this.fnSetPageTitle(this.params.title);
|
|
||||||
}
|
|
||||||
this.form.author = this.wxLoginVisitorUser.nickName;
|
|
||||||
this.form.avatar = this.wxLoginVisitorUser.avatarUrl;
|
|
||||||
this.form.email = this.wxLoginVisitorUser.email;
|
|
||||||
this.form.authorUrl = this.wxLoginVisitorUser.url;
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
fnOnSubmit(e) {
|
|
||||||
if (e === false) {
|
|
||||||
return uni.$tm.toast('请检查所有的必填项是否填写完整!');
|
|
||||||
}
|
|
||||||
if (this.form.allowNotification && !this.form.email) {
|
|
||||||
return uni.$tm.toast('未填写邮箱地址,将无法接收提醒!');
|
|
||||||
}
|
|
||||||
if (this.form.email && !uni.$tm.test.email(this.form.email)) {
|
|
||||||
return uni.$tm.toast('请填写正确的邮箱地址!');
|
|
||||||
}
|
|
||||||
if (this.form.authorUrl && !uni.$tm.test.url(this.form.authorUrl)) {
|
|
||||||
return uni.$tm.toast('请输入正确的Url地址!');
|
|
||||||
}
|
|
||||||
this.fnHandle();
|
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
fnHandle() {
|
return {
|
||||||
uni.showLoading({
|
params: {
|
||||||
title: '正在提交...'
|
postId: '',
|
||||||
});
|
parentId: '',
|
||||||
const _api = {
|
title: '', // 被回复的标题 type=user =用户名 否则为文章标题
|
||||||
sheets: this.$httpApi.postSheetsComments,
|
form: '',
|
||||||
posts: this.$httpApi.postCommentPost
|
formPage: '', // 来自哪个页面
|
||||||
|
type: 'post' // 来源文章/页面 还是用户 user=用户
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
allowNotification: true,
|
||||||
|
author: '', // 作者
|
||||||
|
avatar: '',
|
||||||
|
authorUrl: '', // 作者主页
|
||||||
|
content: '', // 评论内容
|
||||||
|
email: '', // 邮件
|
||||||
|
parentId: 0,
|
||||||
|
postId: 0
|
||||||
|
}
|
||||||
};
|
};
|
||||||
_api[this.params.from](this.form)
|
},
|
||||||
.then(res => {
|
computed: {
|
||||||
if (res.status == 200) {
|
// 评论游客信息
|
||||||
uni.$tm.toast('提交成功,待博主审核通过后即可展示!');
|
wxLoginVisitorUser() {
|
||||||
// 更新评论者信息
|
return uni.$tm.vx.getters().getWxLoginInfo;
|
||||||
uni.$tm.vx.commit('user/setWxLoginInfo', {
|
}
|
||||||
avatarUrl: this.wxLoginVisitorUser.avatarUrl,
|
},
|
||||||
nickName: this.form.author,
|
onLoad() {
|
||||||
email: this.form.email,
|
this.params = this.$Route.query;
|
||||||
url: this.form.authorUrl
|
this.form.postId = this.params.id;
|
||||||
});
|
if (this.params.type == 'user') {
|
||||||
// 清空评论内容
|
this.form.parentId = this.params.parentId;
|
||||||
this.form.content = '';
|
this.fnSetPageTitle('回复用户:' + this.params.title);
|
||||||
// 触发刷新评论(可能需要评论审核不会有改变)
|
} else {
|
||||||
// uni.$emit(this.params.formPage + '_refresh');
|
this.form.parentId = 0;
|
||||||
} else {
|
this.fnSetPageTitle(this.params.title);
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
}
|
||||||
}
|
this.form.author = this.wxLoginVisitorUser.nickName;
|
||||||
})
|
this.form.avatar = this.wxLoginVisitorUser.avatarUrl;
|
||||||
.catch(err => {
|
this.form.email = this.wxLoginVisitorUser.email;
|
||||||
uni.$tm.toast(err.message);
|
this.form.authorUrl = this.wxLoginVisitorUser.url;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fnOnSubmit(e) {
|
||||||
|
console.log('提交评论');
|
||||||
|
if (e === false) {
|
||||||
|
return uni.$tm.toast('请检查所有的必填项是否填写完整!');
|
||||||
|
}
|
||||||
|
if (this.form.allowNotification && !this.form.email) {
|
||||||
|
return uni.$tm.toast('未填写邮箱地址,将无法接收提醒!');
|
||||||
|
}
|
||||||
|
if (this.form.email && !uni.$tm.test.email(this.form.email)) {
|
||||||
|
return uni.$tm.toast('请填写正确的邮箱地址!');
|
||||||
|
}
|
||||||
|
if (this.form.authorUrl && !uni.$tm.test.url(this.form.authorUrl)) {
|
||||||
|
return uni.$tm.toast('请输入正确的Url地址!');
|
||||||
|
}
|
||||||
|
this.fnHandle();
|
||||||
|
},
|
||||||
|
|
||||||
|
fnHandle() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '正在提交...'
|
||||||
});
|
});
|
||||||
|
const _api = {
|
||||||
|
sheets: this.$httpApi.postSheetsComments,
|
||||||
|
posts: this.$httpApi.postCommentPost
|
||||||
|
};
|
||||||
|
_api[this.params.from](this.form)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.$tm.toast('提交成功,待博主审核通过后即可展示!');
|
||||||
|
// 更新评论者信息
|
||||||
|
uni.$tm.vx.commit('user/setWxLoginInfo', {
|
||||||
|
avatarUrl: this.wxLoginVisitorUser.avatarUrl,
|
||||||
|
nickName: this.form.author,
|
||||||
|
email: this.form.email,
|
||||||
|
url: this.form.authorUrl
|
||||||
|
});
|
||||||
|
// 清空评论内容
|
||||||
|
this.form.content = '';
|
||||||
|
// 触发刷新评论(可能需要评论审核不会有改变)
|
||||||
|
// uni.$emit(this.params.formPage + '_refresh');
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
uni.$tm.toast(err.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
// background-color: #fafafd;
|
// background-color: #fafafd;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
// box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.05);
|
// box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||||
}
|
|
||||||
}
|
|
||||||
.poup-content {
|
|
||||||
width: 500rpx;
|
|
||||||
|
|
||||||
::v-deep {
|
|
||||||
.slider_id {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
.poup-content {
|
||||||
|
width: 500rpx;
|
||||||
|
|
||||||
|
::v-deep {
|
||||||
|
.slider_id {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -2,24 +2,25 @@
|
|||||||
<view class="app-page flex flex-col felx-center bg-white">
|
<view class="app-page flex flex-col felx-center bg-white">
|
||||||
<!-- 信息 -->
|
<!-- 信息 -->
|
||||||
<view class="profile flex flex-col flex-center pa-36">
|
<view class="profile flex flex-col flex-center pa-36">
|
||||||
<view class="avatar">
|
<view class="avatar"><image class="avatar-img" :src="bloggerInfo.avatar" mode="aspectFill"></image></view>
|
||||||
<text v-if="false" class="icon flex flex-center"><text class="iconfont icon-check text-size-s"></text></text>
|
|
||||||
<image class="avatar-img" :src="bloggerInfo.avatar" mode="aspectFill"></image>
|
|
||||||
</view>
|
|
||||||
<view class="nickname mt-24 text-weight-b text-size-g">{{ bloggerInfo.nickname }}</view>
|
<view class="nickname mt-24 text-weight-b text-size-g">{{ bloggerInfo.nickname }}</view>
|
||||||
<view class="desc mt-24 text-size-m text-grey-darken-3">{{ bloggerInfo.description }}</view>
|
<view class="desc mt-24 text-size-m text-grey-darken-3">
|
||||||
|
{{ bloggerInfo.description || '这个博主很懒,竟然没写介绍~' }}
|
||||||
|
</view>
|
||||||
<!-- 联系图标 -->
|
<!-- 联系图标 -->
|
||||||
<view class="mt-24 contact-icons">
|
<view class="mt-24 contact-icons">
|
||||||
<!-- 放全部:似乎显得有点拥挤 -->
|
<!-- 放全部:似乎显得有点拥挤 -->
|
||||||
<!-- <block v-for="(item, index) in result" :key="index"><text v-if="item.value" class="halocoloricon" :class="[item.icon, { 'ml-12': index != 0 }]"></text></block> -->
|
<!-- <block v-for="(item, index) in result" :key="index"><text v-if="item.value" class="halocoloricon" :class="[item.icon, { 'ml-12': index != 0 }]"></text></block> -->
|
||||||
<!-- 考虑放几个常用的就行 -->
|
<!-- 考虑放几个常用的就行 -->
|
||||||
<text class="halocoloricon halocoloricon-qq"></text>
|
<text class="halocoloricon halocoloricon-qq"></text>
|
||||||
|
<!-- #ifndef MP-QQ -->
|
||||||
<text class="ml-12 halocoloricon halocoloricon-wechat"></text>
|
<text class="ml-12 halocoloricon halocoloricon-wechat"></text>
|
||||||
|
<!-- #endif -->
|
||||||
<text class="ml-12 halocoloricon halocoloricon-GitHub"></text>
|
<text class="ml-12 halocoloricon halocoloricon-GitHub"></text>
|
||||||
<text class="ml-12 halocoloricon halocoloricon-gitee"></text>
|
<text class="ml-12 halocoloricon halocoloricon-gitee"></text>
|
||||||
<text class="ml-12 halocoloricon halocoloricon-ic_email_round"></text>
|
<text class="ml-12 halocoloricon halocoloricon-ic_email_round"></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-24 ">
|
<view v-if="false" class="mt-24 ">
|
||||||
<tm-button theme="bg-gradient-light-blue-accent" size="m" openType="contact">在线客服联系</tm-button>
|
<tm-button theme="bg-gradient-light-blue-accent" size="m" openType="contact">在线客服联系</tm-button>
|
||||||
<tm-button theme="bg-gradient-orange-accent" size="m" @click="fnOnToWeb">访问PC端博客</tm-button>
|
<tm-button theme="bg-gradient-orange-accent" size="m" @click="fnOnToWeb">访问PC端博客</tm-button>
|
||||||
</view>
|
</view>
|
||||||
@@ -123,13 +124,13 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
// 获取博主信息
|
// 获取博主信息
|
||||||
bloggerInfo() {
|
bloggerInfo() {
|
||||||
let blogger = this.$tm.vx.getters().blogger.getBlogger;
|
let blogger = this.$tm.vx.getters().getBlogger;
|
||||||
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
|
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
|
||||||
return blogger;
|
return blogger;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fnSetPageTitle('❤');
|
this.fnSetPageTitle('联系博主');
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
@@ -185,19 +186,6 @@ export default {
|
|||||||
border: 6rpx solid #fff;
|
border: 6rpx solid #fff;
|
||||||
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.07);
|
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.07);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
.icon {
|
|
||||||
width: 42rpx;
|
|
||||||
height: 42rpx;
|
|
||||||
position: absolute;
|
|
||||||
right: 6rpx;
|
|
||||||
bottom: 0rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
color: #fff;
|
|
||||||
box-sizing: border-box;
|
|
||||||
background-color: #03b0fd;
|
|
||||||
border: 4rpx solid #fff;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
&-img {
|
&-img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
bloggerInfo() {
|
bloggerInfo() {
|
||||||
return this.$tm.vx.getters().blogger.getBlogger;
|
return this.$tm.vx.getters().getBlogger;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+97
-96
@@ -13,7 +13,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(journal, index) in dataList" :key="index">
|
<block v-for="(journal, index) in dataList" :key="index">
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<!-- 日记卡片 -->
|
<!-- 日记卡片 -->
|
||||||
<journal-card :journal="journal" :useLike="true"></journal-card>
|
<journal-card :journal="journal" :useLike="true"></journal-card>
|
||||||
</tm-translate>
|
</tm-translate>
|
||||||
@@ -27,107 +27,108 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MarkdownConfig from '@/common/markdown/markdown.config.js';
|
import MarkdownConfig from '@/common/markdown/markdown.config.js';
|
||||||
import mpHtml from '@/components/mp-html/components/mp-html/mp-html.vue';
|
import mpHtml from '@/components/mp-html/components/mp-html/mp-html.vue';
|
||||||
import journalCard from '@/components/journal-card/journal-card.vue';
|
import journalCard from '@/components/journal-card/journal-card.vue';
|
||||||
|
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { mpHtml, tmSkeleton, tmEmpty, tmTranslate, tmFlotbutton, journalCard },
|
components: { mpHtml, tmSkeleton, tmEmpty, tmTranslate, tmFlotbutton, journalCard },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: 'loading',
|
loading: 'loading',
|
||||||
markdownConfig: MarkdownConfig,
|
markdownConfig: MarkdownConfig,
|
||||||
queryParams: {
|
queryParams: {
|
||||||
size: 10,
|
size: 10,
|
||||||
page: 0
|
page: 0
|
||||||
},
|
},
|
||||||
result: null,
|
result: null,
|
||||||
dataList: [],
|
dataList: [],
|
||||||
isLoadMore: false,
|
isLoadMore: false,
|
||||||
loadMoreText: '加载中...'
|
loadMoreText: '加载中...'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fnSetPageTitle('个人日记');
|
this.fnSetPageTitle('个人日记');
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
this.isLoadMore = false;
|
|
||||||
this.queryParams.page = 0;
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
onReachBottom(e) {
|
|
||||||
if (this.result.hasNext) {
|
|
||||||
this.queryParams.page += 1;
|
|
||||||
this.isLoadMore = true;
|
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
} else {
|
},
|
||||||
uni.showToast({
|
onPullDownRefresh() {
|
||||||
icon: 'none',
|
this.isLoadMore = false;
|
||||||
title: '没有更多数据了'
|
this.queryParams.page = 0;
|
||||||
});
|
this.fnGetData();
|
||||||
}
|
},
|
||||||
},
|
onReachBottom(e) {
|
||||||
methods: {
|
if (this.result.hasNext) {
|
||||||
fnGetData() {
|
this.queryParams.page += 1;
|
||||||
uni.showLoading({
|
this.isLoadMore = true;
|
||||||
mask: true,
|
this.fnGetData();
|
||||||
title: '加载中...'
|
} else {
|
||||||
});
|
uni.showToast({
|
||||||
// 设置状态为加载中
|
icon: 'none',
|
||||||
if (!this.isLoadMore) {
|
title: '没有更多数据了'
|
||||||
this.loading = 'loading';
|
|
||||||
}
|
|
||||||
this.loadMoreText = '加载中...';
|
|
||||||
this.$httpApi
|
|
||||||
.getJournals(this.queryParams)
|
|
||||||
.then(res => {
|
|
||||||
this.loading = 'success';
|
|
||||||
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
|
||||||
// 处理数据
|
|
||||||
this.result = res.data;
|
|
||||||
if (this.isLoadMore) {
|
|
||||||
this.dataList = this.dataList.concat(res.data.content);
|
|
||||||
} else {
|
|
||||||
this.dataList = res.data.content;
|
|
||||||
}
|
|
||||||
this.loading = 'success';
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
this.loading = 'error';
|
|
||||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
}, 500);
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fnGetData() {
|
||||||
|
// uni.showLoading({
|
||||||
|
// mask: true,
|
||||||
|
// title: '加载中...'
|
||||||
|
// });
|
||||||
|
// 设置状态为加载中
|
||||||
|
if (!this.isLoadMore) {
|
||||||
|
this.loading = 'loading';
|
||||||
|
}
|
||||||
|
this.loadMoreText = '加载中...';
|
||||||
|
this.$httpApi
|
||||||
|
.getJournals(this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
this.loading = 'success';
|
||||||
|
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
|
// 处理数据
|
||||||
|
this.result = res.data;
|
||||||
|
if (this.isLoadMore) {
|
||||||
|
this.dataList = this.dataList.concat(res.data.content);
|
||||||
|
} else {
|
||||||
|
this.dataList = res.data.content;
|
||||||
|
}
|
||||||
|
this.loading = 'success';
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
.loading-wrap {
|
|
||||||
}
|
.loading-wrap {}
|
||||||
.app-page-content {
|
|
||||||
}
|
.app-page-content {}
|
||||||
.content-empty {
|
|
||||||
height: 60vh;
|
.content-empty {
|
||||||
}
|
height: 60vh;
|
||||||
</style>
|
}
|
||||||
|
</style>
|
||||||
+183
-189
@@ -4,33 +4,25 @@
|
|||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
</view>
|
</view>
|
||||||
<!-- 内容区域 -->
|
<!-- 内容区域 -->
|
||||||
<view v-else class="app-page-content bg-white pa-24">
|
<view v-else class="app-page-content pa-24" :class="{ 'bg-white': dataList.length !== 0 }">
|
||||||
<view v-if="dataList.length == 0" class="content-empty flex flex-center">
|
<view v-if="dataList.length == 0" class="content-empty flex flex-center">
|
||||||
<!-- 空布局 -->
|
<!-- 空布局 -->
|
||||||
<tm-empty icon="icon-shiliangzhinengduixiang-" label="该分类下暂无数据"></tm-empty>
|
<tm-empty icon="icon-shiliangzhinengduixiang-" label="啊偶,博主还没有留言~"></tm-empty>
|
||||||
</view>
|
</view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(item, index) in dataList" :key="index">
|
<block v-for="(item, index) in dataList" :key="index">
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<!-- 列表项 -->
|
<!-- 列表项 -->
|
||||||
<comment-item
|
<comment-item class="mb-12" :isChild="false" :comment="item" :postId="sheetId" :useSolid="false" @on-copy="fnCopyContent" @on-comment="fnToComment" @on-detail="fnOnShowCommentDetail"></comment-item>
|
||||||
class="mb-12"
|
|
||||||
:isChild="false"
|
|
||||||
:comment="item"
|
|
||||||
:postId="sheetId"
|
|
||||||
:useSolid="false"
|
|
||||||
@on-copy="fnCopyContent"
|
|
||||||
@on-comment="fnToComment"
|
|
||||||
@on-detail="fnOnShowCommentDetail"
|
|
||||||
></comment-item>
|
|
||||||
</tm-translate>
|
</tm-translate>
|
||||||
</block>
|
</block>
|
||||||
<tm-flotbutton :offset="[16, 80]" @click="fnToTopPage" size="m" color="light-blue" icon="icon-angle-up"></tm-flotbutton>
|
<tm-flotbutton :offset="[16, 80]" @click="fnToTopPage" size="m" color="light-blue" icon="icon-angle-up"></tm-flotbutton>
|
||||||
<tm-flotbutton actions-pos="left" :show-text="true" color="bg-gradient-orange-accent" @click="fnToComment(null)"></tm-flotbutton>
|
|
||||||
<view class="load-text">{{ loadMoreText }}</view>
|
<view class="load-text">{{ loadMoreText }}</view>
|
||||||
</block>
|
</block>
|
||||||
|
<tm-flotbutton actions-pos="left" :show-text="true" color="bg-gradient-orange-accent" @click="fnToComment(null)"></tm-flotbutton>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 评论详情 -->
|
<!-- 评论详情 -->
|
||||||
@@ -59,15 +51,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<comment-item
|
<comment-item v-for="(comment, index) in commentDetail.list" :useSolid="false" :useActions="false" :key="index" :isChild="false" :comment="comment" :postId="sheetId"></comment-item>
|
||||||
v-for="(comment, index) in commentDetail.list"
|
|
||||||
:useSolid="false"
|
|
||||||
:useActions="false"
|
|
||||||
:key="index"
|
|
||||||
:isChild="false"
|
|
||||||
:comment="comment"
|
|
||||||
:postId="sheetId"
|
|
||||||
></comment-item>
|
|
||||||
</block>
|
</block>
|
||||||
</block>
|
</block>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@@ -77,187 +61,197 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AppKeys from '@/config//keys.js';
|
import AppKeys from '@/config/keys.js';
|
||||||
import SheetConfig from '@/config/sheets.config.js';
|
import SheetConfig from '@/config/sheets.config.js';
|
||||||
|
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
||||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
import commentItem from '@/components/comment-item/comment-item.vue';
|
import commentItem from '@/components/comment-item/comment-item.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
tmPoup,
|
tmPoup,
|
||||||
tmButton,
|
tmButton,
|
||||||
commentItem
|
commentItem
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: 'loading',
|
|
||||||
queryParams: {
|
|
||||||
size: 10,
|
|
||||||
page: 0
|
|
||||||
},
|
|
||||||
result: null,
|
|
||||||
dataList: [],
|
|
||||||
isLoadMore: false,
|
|
||||||
loadMoreText: '加载中...',
|
|
||||||
sheetId: SheetConfig[AppKeys.SHEET_LEAVING],
|
|
||||||
commentDetail: {
|
|
||||||
loading: 'loading',
|
loading: 'loading',
|
||||||
show: false,
|
queryParams: {
|
||||||
comment: {},
|
size: 10,
|
||||||
postId: undefined,
|
page: 0
|
||||||
list: []
|
},
|
||||||
}
|
result: null,
|
||||||
};
|
dataList: [],
|
||||||
},
|
isLoadMore: false,
|
||||||
|
loadMoreText: '加载中...',
|
||||||
|
sheetId: SheetConfig[AppKeys.SHEET_LEAVING],
|
||||||
|
commentDetail: {
|
||||||
|
loading: 'loading',
|
||||||
|
show: false,
|
||||||
|
comment: {},
|
||||||
|
postId: undefined,
|
||||||
|
list: []
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fnSetPageTitle('留言板');
|
this.fnSetPageTitle('留言板');
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.fnGetData();
|
|
||||||
uni.$on('leaving_refresh', () => {
|
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
});
|
uni.$on('leaving_refresh', () => {
|
||||||
},
|
this.fnGetData();
|
||||||
onPullDownRefresh() {
|
});
|
||||||
this.isLoadMore = false;
|
},
|
||||||
this.queryParams.page = 0;
|
onPullDownRefresh() {
|
||||||
this.fnGetData();
|
this.isLoadMore = false;
|
||||||
},
|
this.queryParams.page = 0;
|
||||||
|
|
||||||
onReachBottom(e) {
|
|
||||||
if (this.result.hasNext) {
|
|
||||||
this.queryParams.page += 1;
|
|
||||||
this.isLoadMore = true;
|
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
} else {
|
},
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '没有更多数据了'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
onReachBottom(e) {
|
||||||
fnGetData() {
|
if (this.result.hasNext) {
|
||||||
uni.showLoading({
|
this.queryParams.page += 1;
|
||||||
mask: true,
|
this.isLoadMore = true;
|
||||||
title: '加载中...'
|
this.fnGetData();
|
||||||
});
|
} else {
|
||||||
// 设置状态为加载中
|
uni.showToast({
|
||||||
if (!this.isLoadMore) {
|
icon: 'none',
|
||||||
this.loading = 'loading';
|
title: '没有更多数据了'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
this.loadMoreText = '加载中...';
|
},
|
||||||
this.$httpApi
|
|
||||||
.getSheetsCommentsTreeBySheetId(this.sheetId, this.queryParams)
|
methods: {
|
||||||
.then(res => {
|
fnGetData() {
|
||||||
if (res.status == 200) {
|
// uni.showLoading({
|
||||||
this.loading = 'success';
|
// mask: true,
|
||||||
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
// title: '加载中...'
|
||||||
// 处理数据
|
// });
|
||||||
this.result = res.data;
|
// 设置状态为加载中
|
||||||
if (this.isLoadMore) {
|
if (!this.isLoadMore) {
|
||||||
this.dataList = this.dataList.concat(res.data.content);
|
this.loading = 'loading';
|
||||||
|
}
|
||||||
|
this.loadMoreText = '加载中...';
|
||||||
|
this.$httpApi
|
||||||
|
.getSheetsCommentsTreeBySheetId(this.sheetId, this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
this.loading = 'success';
|
||||||
|
// return;
|
||||||
|
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
|
// 处理数据
|
||||||
|
this.result = res.data;
|
||||||
|
if (this.isLoadMore) {
|
||||||
|
this.dataList = this.dataList.concat(res.data.content);
|
||||||
|
} else {
|
||||||
|
this.dataList = res.data.content;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.dataList = res.data.content;
|
this.loading = 'error';
|
||||||
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
}
|
}
|
||||||
} else {
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
this.loading = 'error';
|
this.loading = 'error';
|
||||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
}
|
})
|
||||||
})
|
.finally(() => {
|
||||||
.catch(err => {
|
setTimeout(() => {
|
||||||
console.error(err);
|
uni.hideLoading();
|
||||||
this.loading = 'error';
|
uni.stopPullDownRefresh();
|
||||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
}, 500);
|
||||||
})
|
});
|
||||||
.finally(() => {
|
},
|
||||||
setTimeout(() => {
|
fnToComment(data) {
|
||||||
uni.hideLoading();
|
let _comment = {};
|
||||||
uni.stopPullDownRefresh();
|
if (data) {
|
||||||
}, 500);
|
_comment = {
|
||||||
});
|
id: this.sheetId,
|
||||||
},
|
parentId: data.comment.id,
|
||||||
fnToComment(data) {
|
title: data.comment.author,
|
||||||
let _comment = {};
|
from: 'sheets',
|
||||||
if (data) {
|
formPage: 'leaving',
|
||||||
_comment = {
|
type: 'user'
|
||||||
id: this.sheetId,
|
};
|
||||||
parentId: data.comment.id,
|
} else {
|
||||||
title: data.comment.author,
|
_comment = {
|
||||||
from: 'sheets',
|
id: this.sheetId,
|
||||||
formPage: 'leaving',
|
parentId: 0,
|
||||||
type: 'user'
|
title: '留言板留言',
|
||||||
};
|
from: 'sheets',
|
||||||
} else {
|
formPage: 'leaving',
|
||||||
_comment = {
|
type: 'post'
|
||||||
id: this.sheetId,
|
};
|
||||||
parentId: 0,
|
}
|
||||||
title: '留言板留言',
|
|
||||||
from: 'sheets',
|
|
||||||
formPage: 'leaving',
|
|
||||||
type: 'post'
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
uni.$tm.vx.commit('comment/setCommentInfo', _comment);
|
uni.$tm.vx.commit('comment/setCommentInfo', _comment);
|
||||||
this.$Router.push({
|
this.$Router.push({
|
||||||
path: '/pagesA/comment/comment',
|
path: '/pagesA/comment/comment',
|
||||||
query: _comment
|
query: _comment
|
||||||
});
|
|
||||||
},
|
|
||||||
fnCopyContent(content) {
|
|
||||||
uni.$tm.u.setClipboardData(content);
|
|
||||||
uni.$tm.toast('内容已复制成功!');
|
|
||||||
},
|
|
||||||
fnOnShowCommentDetail(comment) {
|
|
||||||
this.commentDetail.comment = comment;
|
|
||||||
this.commentDetail.list = [];
|
|
||||||
this.commentDetail.show = true;
|
|
||||||
this.fnGetChildComments();
|
|
||||||
},
|
|
||||||
fnGetChildComments() {
|
|
||||||
this.commentDetail.loading = 'loading';
|
|
||||||
this.$httpApi
|
|
||||||
.getSheetsChildrenCommentList(this.sheetId, this.commentDetail.comment.id, {})
|
|
||||||
.then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
this.commentDetail.loading = 'success';
|
|
||||||
this.commentDetail.list = res.data;
|
|
||||||
} else {
|
|
||||||
this.commentDetail.loading = 'error';
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
this.commentDetail.loading = 'error';
|
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
fnCopyContent(content) {
|
||||||
|
uni.$tm.u.setClipboardData(content);
|
||||||
|
uni.$tm.toast('内容已复制成功!');
|
||||||
|
},
|
||||||
|
fnOnShowCommentDetail(comment) {
|
||||||
|
this.commentDetail.comment = comment;
|
||||||
|
this.commentDetail.list = [];
|
||||||
|
this.commentDetail.show = true;
|
||||||
|
this.fnGetChildComments();
|
||||||
|
},
|
||||||
|
fnGetChildComments() {
|
||||||
|
this.commentDetail.loading = 'loading';
|
||||||
|
this.$httpApi
|
||||||
|
.getSheetsChildrenCommentList(this.sheetId, this.commentDetail.comment.id, {})
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
this.commentDetail.loading = 'success';
|
||||||
|
this.commentDetail.list = res.data;
|
||||||
|
} else {
|
||||||
|
this.commentDetail.loading = 'error';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
this.commentDetail.loading = 'error';
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
background-color: #fafafd;
|
||||||
.app-page-content {
|
}
|
||||||
box-sizing: border-box;
|
|
||||||
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.05);
|
.app-page-content {
|
||||||
}
|
box-sizing: border-box;
|
||||||
.loading-wrap {
|
// box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||||
padding: 24rpx;
|
}
|
||||||
}
|
|
||||||
</style>
|
.content-empty {
|
||||||
|
width: 100%;
|
||||||
|
height: 60vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-wrap {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 24rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,377 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app-page">
|
||||||
|
<view v-if="loading != 'success'" class="loading-wrap">
|
||||||
|
<view v-if="loading == 'loading'" class="loading">
|
||||||
|
<view class="loading-icon flex flex-center"><text class="e-loading-icon iconfont icon-loading"></text></view>
|
||||||
|
<view class="loadig-text ">相册正在努力加载中啦~</view>
|
||||||
|
</view>
|
||||||
|
<tm-empty v-else icon="icon-shiliangzhinengduixiang-" color="red" label="啊偶,加载失败了呢~">
|
||||||
|
<tm-button theme="red" :shadow="0" size="m" @click="fnRefresh()">刷新试试</tm-button>
|
||||||
|
</tm-empty>
|
||||||
|
</view>
|
||||||
|
<!-- 内容区域 -->
|
||||||
|
<view v-else class="app-page-content">
|
||||||
|
<view v-if="dataList.length == 0" color="light-blue" class="content-empty flex flex-center">
|
||||||
|
<tm-empty icon="icon-shiliangzhinengduixiang-" label="相册暂时还没有数据~">
|
||||||
|
<tm-button :shadow="0" size="m" theme="light-blue" @click="fnRefresh()">刷新试试</tm-button>
|
||||||
|
</tm-empty>
|
||||||
|
</view>
|
||||||
|
<block v-else>
|
||||||
|
<swiper
|
||||||
|
class="swiper-album"
|
||||||
|
:current="swiperIndex"
|
||||||
|
:acceleration="true"
|
||||||
|
:circular="true"
|
||||||
|
:vertical="false"
|
||||||
|
:indicator-dots="false"
|
||||||
|
:autoplay="false"
|
||||||
|
@change="fnOnChange"
|
||||||
|
>
|
||||||
|
<block v-for="(item, index) in dataList" :key="index">
|
||||||
|
<swiper-item class="swiper-album-item">
|
||||||
|
<view class="scroll-wrap">
|
||||||
|
<view class="card">
|
||||||
|
<cache-image
|
||||||
|
class="card-image"
|
||||||
|
width="100%"
|
||||||
|
height="46vh"
|
||||||
|
radius="12rpx"
|
||||||
|
:url="item.image"
|
||||||
|
:fileMd5="item.image"
|
||||||
|
mode="aspectFill"
|
||||||
|
@on-click="fnOnPreview(item)"
|
||||||
|
></cache-image>
|
||||||
|
<view v-if="item.description" class="card-desc">{{ item.description }}</view>
|
||||||
|
<view v-else class="card-desc is-empty flex flex-col">
|
||||||
|
<view class="text-grey-darken-1">该照片没有记录任何信息</view>
|
||||||
|
<view class="text-size-m mt-24 text-grey-darken-1">记录一下拍照的瞬间,会更精彩哟</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</block>
|
||||||
|
</swiper>
|
||||||
|
<view class="tabbar">
|
||||||
|
<view class="pre" @click="fnChange(false)">
|
||||||
|
<text class="icon"><text class="iconfont icon-arrow-left"></text></text>
|
||||||
|
<text class="text">上一张</text>
|
||||||
|
</view>
|
||||||
|
<view class="refresh" @click="fnRefresh()">
|
||||||
|
<text class="refresh-text">点击</text>
|
||||||
|
<text class="refresh-heart iconfont icon-diagnose"></text>
|
||||||
|
<text class="refresh-text">刷新</text>
|
||||||
|
</view>
|
||||||
|
<view class="next" @click="fnChange(true)">
|
||||||
|
<text class="text">下一张</text>
|
||||||
|
<text class="icon"><text class="iconfont icon-arrow-right"></text></text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import LoveConfig from '@/config/love.config.js';
|
||||||
|
import throttle from '@/utils/throttle.js';
|
||||||
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
tmButton,
|
||||||
|
tmFlotbutton,
|
||||||
|
tmTranslate,
|
||||||
|
tmEmpty
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: 'loading',
|
||||||
|
loveConfig: LoveConfig,
|
||||||
|
queryParams: {
|
||||||
|
size: 99,
|
||||||
|
page: 0,
|
||||||
|
sort: 'takeTime',
|
||||||
|
team: LoveConfig.albumKeyName
|
||||||
|
},
|
||||||
|
result: {},
|
||||||
|
dataList: [],
|
||||||
|
cache: {
|
||||||
|
dataList: [],
|
||||||
|
total: 0
|
||||||
|
},
|
||||||
|
swiperIndex: 0,
|
||||||
|
tabbar: {
|
||||||
|
list: []
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad() {
|
||||||
|
this.fnSetPageTitle('恋爱相册');
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.fnRefresh();
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
fnRefresh() {
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
fnGetData() {
|
||||||
|
this.loading = 'loading';
|
||||||
|
this.$httpApi
|
||||||
|
.getPhotoListByPage(this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
this.loading = 'success';
|
||||||
|
if (res.data.content.length != 0) {
|
||||||
|
const _list = res.data.content.map((item, index) => {
|
||||||
|
item['image'] = this.$utils.checkImageUrl(item.thumbnail);
|
||||||
|
item['takeTime'] = this.$tm.dayjs(item['takeTime']).format('DD/MM/YYYY');
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
this.dataList = _list;
|
||||||
|
this.swiperIndex = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.loading = 'error';
|
||||||
|
uni.$tm.toast('加载失败,请下拉刷新重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
uni.$tm.toast('加载失败,请下拉刷新重试!');
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 200);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 缓存数据
|
||||||
|
fnCacheDataList(dataList) {
|
||||||
|
if (this.queryParams.page == 0) {
|
||||||
|
this.cache.dataList = dataList;
|
||||||
|
} else {
|
||||||
|
this.cache.dataList = [...this.cache.dataList, ...dataList];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fnOnPreview(item) {
|
||||||
|
uni.previewImage({
|
||||||
|
current: item.image,
|
||||||
|
urls: this.dataList.map(x => x.image)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fnOnChange(e) {
|
||||||
|
this.swiperIndex = e.detail.current;
|
||||||
|
},
|
||||||
|
fnChange(isNext) {
|
||||||
|
throttle(() => {
|
||||||
|
if (isNext) {
|
||||||
|
if (this.swiperIndex == this.dataList.length - 1) {
|
||||||
|
this.swiperIndex = 0;
|
||||||
|
} else {
|
||||||
|
this.swiperIndex += 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (this.swiperIndex == 0) {
|
||||||
|
this.swiperIndex = this.dataList.length - 1;
|
||||||
|
} else {
|
||||||
|
this.swiperIndex -= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.app-page {
|
||||||
|
width: 100vw;
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 24rpx 0;
|
||||||
|
padding-bottom: 144rpx;
|
||||||
|
background: linear-gradient(
|
||||||
|
-135deg,
|
||||||
|
rgba(247, 149, 51, 0.1),
|
||||||
|
rgba(243, 112, 85, 0.1) 15%,
|
||||||
|
rgba(239, 78, 123, 0.1) 30%,
|
||||||
|
rgba(161, 102, 171, 0.1) 44%,
|
||||||
|
rgba(80, 115, 184, 0.1) 58%,
|
||||||
|
rgba(16, 152, 173, 0.1) 72%,
|
||||||
|
rgba(7, 179, 155, 0.1) 86%,
|
||||||
|
rgba(109, 186, 130, 0.1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
.app-page-content {
|
||||||
|
}
|
||||||
|
.loading-wrap {
|
||||||
|
width: 100vw;
|
||||||
|
height: 60vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 36rpx;
|
||||||
|
|
||||||
|
::v-deep {
|
||||||
|
.tm-icons {
|
||||||
|
margin-right: -20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.e-loading-icon {
|
||||||
|
font-size: 120rpx;
|
||||||
|
// color: #f88ca2;
|
||||||
|
color: #56bbf9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loadig-text {
|
||||||
|
margin-top: 28rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
// color: #f88ca2;
|
||||||
|
color: #56bbf9;
|
||||||
|
}
|
||||||
|
.content-empty {
|
||||||
|
width: 100%;
|
||||||
|
height: 60vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-album {
|
||||||
|
width: 100vw;
|
||||||
|
height: calc(100vh - 24rpx - 144rpx);
|
||||||
|
}
|
||||||
|
.swiper-album-item {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 36rpx;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
padding-bottom: 110rpx;
|
||||||
|
/* #endif */
|
||||||
|
/* #ifndef H5 */
|
||||||
|
padding-bottom: 60rpx;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
.scroll-wrap {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 36rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
|
}
|
||||||
|
.card {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
// height: 65vh;
|
||||||
|
height: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
box-sizing: border-box;
|
||||||
|
// box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
::v-deep {
|
||||||
|
.cache-image {
|
||||||
|
height: initial !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-image {
|
||||||
|
width: 100%;
|
||||||
|
height: initial !important;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
&-desc {
|
||||||
|
margin-top: 24rpx;
|
||||||
|
line-height: 1.6;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: rgba(26, 26, 26, 0.9);
|
||||||
|
&.is-empty {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-grow: 1;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tabbar {
|
||||||
|
width: 90vw;
|
||||||
|
position: fixed;
|
||||||
|
left: 50%;
|
||||||
|
bottom: 40rpx;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
border-radius: 25rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 24rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
// background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
background-color: #ffffff;
|
||||||
|
color: #333;
|
||||||
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||||
|
.refresh {
|
||||||
|
animation: refreshAni 6s ease-in-out infinite;
|
||||||
|
color: #56bbf9;
|
||||||
|
&-heart {
|
||||||
|
font-size: 42rpx;
|
||||||
|
color: inherit;
|
||||||
|
margin: 0 6rpx;
|
||||||
|
}
|
||||||
|
&-text {
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.pre {
|
||||||
|
color: #56bbf9;
|
||||||
|
transition: transform 0.1s ease-in-out;
|
||||||
|
&:hover {
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
padding-left: 12rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.next {
|
||||||
|
color: #f88ca2;
|
||||||
|
transition: transform 0.1s ease-in-out;
|
||||||
|
&:hover {
|
||||||
|
transform: scale(1.03);
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
padding-right: 12rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes refreshAni {
|
||||||
|
0% {
|
||||||
|
color: #f88ca2;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
color: #56bbf9;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
color: #f88ca2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app-page">
|
||||||
|
<view class="page-title">我们的故事</view>
|
||||||
|
<view class="html-typed" v-html="html">内容渲染</view>
|
||||||
|
|
||||||
|
<scroll-btn bottom="160rpx" :scrollTop.sync="scrollTop"></scroll-btn>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import LoveConfig from '@/config/love.config.js';
|
||||||
|
import ScrollBtn from '@/components/scroll-btn/scroll-btn.vue';
|
||||||
|
export default {
|
||||||
|
components: { ScrollBtn },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
scrollTop: 0,
|
||||||
|
html: '',
|
||||||
|
timer: null
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.fnInit();
|
||||||
|
},
|
||||||
|
onPageScroll(e) {
|
||||||
|
this.scrollTop = e.scrollTop;
|
||||||
|
},
|
||||||
|
onBackPress() {
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fnInit() {
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
const _html = LoveConfig.journey;
|
||||||
|
let _index = 0;
|
||||||
|
const _typing = () => {
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
if (_index >= _html.length) {
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
} else {
|
||||||
|
this.html += _html.substring(_index, _index + 1);
|
||||||
|
_index += 1;
|
||||||
|
_typing();
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
};
|
||||||
|
_typing();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.app-page {
|
||||||
|
width: 100vw;
|
||||||
|
min-height: 100vh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 36rpx;
|
||||||
|
/* #ifdef APP-PLUS */
|
||||||
|
padding-top: 100rpx;
|
||||||
|
/* #endif */
|
||||||
|
/* #ifdef H5 */
|
||||||
|
padding-top: 80rpx;
|
||||||
|
/* #endif */
|
||||||
|
/* #ifdef MP-WEIXIN */
|
||||||
|
padding-top: 120rpx;
|
||||||
|
/* #endif */
|
||||||
|
background: linear-gradient(
|
||||||
|
-45deg,
|
||||||
|
rgba(247, 149, 51, 0.1),
|
||||||
|
rgba(243, 112, 85, 0.1) 15%,
|
||||||
|
rgba(239, 78, 123, 0.1) 30%,
|
||||||
|
rgba(161, 102, 171, 0.1) 44%,
|
||||||
|
rgba(80, 115, 184, 0.1) 58%,
|
||||||
|
rgba(16, 152, 173, 0.1) 72%,
|
||||||
|
rgba(7, 179, 155, 0.1) 86%,
|
||||||
|
rgba(109, 186, 130, 0.1)
|
||||||
|
);
|
||||||
|
color: rgba(26, 26, 26, 1);
|
||||||
|
}
|
||||||
|
.page-title {
|
||||||
|
font-size: 42rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
text-shadow: 0rpx 4rpx 24rpx #bfe9ef;
|
||||||
|
}
|
||||||
|
.html-typed {
|
||||||
|
margin-top: 52rpx;
|
||||||
|
line-height: 1.8;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,421 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app-page" @touchstart="fnOnTouchstart" @touchend="fnOnTouchend" @touchcancel="fnOnTouchend">
|
||||||
|
<view class="love-card" :class="{ ani: isDoAni }">
|
||||||
|
<view class="head">
|
||||||
|
<image class="avatar" :src="loveConfig.boy.avatar" mode="scaleToFill"></image>
|
||||||
|
<view class="love-days">
|
||||||
|
<view class="tip-text">相恋</view>
|
||||||
|
<view class="number">
|
||||||
|
<text class="boy">-</text>
|
||||||
|
<text class="days">{{ calcLoveDays }}</text>
|
||||||
|
<text class="girl">-</text>
|
||||||
|
</view>
|
||||||
|
<view class="tip-text">天</view>
|
||||||
|
</view>
|
||||||
|
<image class="avatar" :src="loveConfig.girl.avatar" mode="scaleToFill"></image>
|
||||||
|
</view>
|
||||||
|
<view class="foot">
|
||||||
|
<view class="text" v-if="false">
|
||||||
|
我们已经相恋
|
||||||
|
<text class="number">- {{ calcLoveDays }} -</text>
|
||||||
|
天啦
|
||||||
|
</view>
|
||||||
|
看看我们的恋爱清单都完成了哪些吧
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="list.length == 0" class="list empty">
|
||||||
|
<view class="card">
|
||||||
|
<image class="empty-image" :src="loveConfig.loveImageUrl" mode="scaleToFill"></image>
|
||||||
|
<view class="empty-text">暂时还没有恋爱清单,快去制定你们的恋爱清单吧~</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-else class="list">
|
||||||
|
<block v-for="(item, index) in list" :key="index">
|
||||||
|
<view class="card" :class="{ ani: isDoAni }" :style="{ '--delay': calcCardDelay(index) }">
|
||||||
|
<view class="head">
|
||||||
|
<view class="status">
|
||||||
|
<view v-if="!item.finish" class="text">进行中</view>
|
||||||
|
<view v-else class="text finish">已完成</view>
|
||||||
|
</view>
|
||||||
|
<view class="title">
|
||||||
|
<view class="title-name">{{ item.title }}</view>
|
||||||
|
<view class="title-desc">{{ item.desc }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="actions" @click="fnOnItemOpen(item)">
|
||||||
|
<text class="icon">{{ item.open ? '-' : '+' }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.open" class="body">
|
||||||
|
<view class="desc">
|
||||||
|
<view class="desc-label">开始时间:</view>
|
||||||
|
<view class="desc-value">{{ item.detail.start || '暂无计划' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="desc" v-if="item.detail.desc">
|
||||||
|
<view class="desc-label">事件描述:</view>
|
||||||
|
<view class="desc-value">{{ item.detail.desc }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="desc">
|
||||||
|
<view class="desc-label">完成时间:</view>
|
||||||
|
<view class="desc-value">{{ item.detail.end || '未开始或正在进行中...' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="desc">
|
||||||
|
<view class="desc-label">完成打卡:</view>
|
||||||
|
<view class="desc-value">{{ item.detail.moment || '未开始或正在进行中...' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="desc" v-if="item.detail.other">
|
||||||
|
<view class="desc-label">爱心备注:</view>
|
||||||
|
<view class="desc-value">{{ item.detail.other }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
<scroll-btn :scrollTop.sync="scrollTop" @on-status="fnOnScrollStatus"></scroll-btn>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import LoveConfig from '@/config/love.config.js';
|
||||||
|
import ScrollBtn from '@/components/scroll-btn/scroll-btn.vue';
|
||||||
|
export default {
|
||||||
|
components: { ScrollBtn },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isDoAni: true,
|
||||||
|
scrollTop: 0,
|
||||||
|
loveConfig: LoveConfig,
|
||||||
|
list: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
calcLoveDays() {
|
||||||
|
const formatStartDate = this.loveConfig.loveStartDate.replace(/-/g, '/');
|
||||||
|
const start = new Date(formatStartDate),
|
||||||
|
now = new Date();
|
||||||
|
const T = now.getTime() - start.getTime();
|
||||||
|
const i = 24 * 60 * 60 * 1000;
|
||||||
|
const d = T / i;
|
||||||
|
const D = Math.floor(d);
|
||||||
|
return D;
|
||||||
|
},
|
||||||
|
calcCardDelay() {
|
||||||
|
return index => {
|
||||||
|
return Math.random() * index + 1 + 's';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.fnGetList();
|
||||||
|
},
|
||||||
|
onPageScroll(e) {
|
||||||
|
this.scrollTop = e.scrollTop;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fnGetList() {
|
||||||
|
if (LoveConfig.loveList.useApi && LoveConfig.loveList.api) {
|
||||||
|
uni.request({
|
||||||
|
url: LoveConfig.loveList.api,
|
||||||
|
header: {
|
||||||
|
ContentType: 'application/json'
|
||||||
|
},
|
||||||
|
method: 'GET',
|
||||||
|
dataType: 'json',
|
||||||
|
success: res => {
|
||||||
|
if (res.statusCode == 200 && res.data.status == 200) {
|
||||||
|
this.list = res.data.data.map(item => {
|
||||||
|
item['open'] = false;
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('数据请求失败,请检查接口!');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
uni.$tm.toast('数据请求失败,请检查接口!');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.list = LoveConfig.loveList.data.map(item => {
|
||||||
|
item['open'] = false;
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fnOnItemOpen(item) {
|
||||||
|
item.open = !item.open;
|
||||||
|
this.$forceUpdate();
|
||||||
|
},
|
||||||
|
fnOnScrollStatus(isEnd) {
|
||||||
|
this.isDoAni = isEnd;
|
||||||
|
},
|
||||||
|
fnOnTouchstart() {
|
||||||
|
this.isDoAni = false;
|
||||||
|
},
|
||||||
|
fnOnTouchend() {
|
||||||
|
this.isDoAni = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.app-page {
|
||||||
|
width: 100vw;
|
||||||
|
min-height: 100vh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 36rpx;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
padding-top: 60rpx;
|
||||||
|
/* #endif */
|
||||||
|
/* #ifndef H5 */
|
||||||
|
padding-top: 180rpx;
|
||||||
|
/* #endif */
|
||||||
|
|
||||||
|
background: linear-gradient(
|
||||||
|
135deg,
|
||||||
|
rgba(247, 149, 51, 0.1),
|
||||||
|
rgba(243, 112, 85, 0.1) 15%,
|
||||||
|
rgba(239, 78, 123, 0.1) 30%,
|
||||||
|
rgba(161, 102, 171, 0.1) 44%,
|
||||||
|
rgba(80, 115, 184, 0.1) 58%,
|
||||||
|
rgba(16, 152, 173, 0.1) 72%,
|
||||||
|
rgba(7, 179, 155, 0.1) 86%,
|
||||||
|
rgba(109, 186, 130, 0.1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
.love-card {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
padding-top: 66rpx;
|
||||||
|
padding-bottom: 52rpx;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
border: 4rpx solid rgba(96, 77, 68, 0.9);
|
||||||
|
border-color: #faf8eb;
|
||||||
|
background-color: rgba(255, 199, 184, 0.9);
|
||||||
|
margin-bottom: 52rpx;
|
||||||
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.1);
|
||||||
|
&.ani {
|
||||||
|
animation: loveCardAni 3s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.head {
|
||||||
|
display: flex;
|
||||||
|
.avatar {
|
||||||
|
width: 150rpx;
|
||||||
|
height: 150rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 6rpx solid rgba(255, 255, 255, 0.7);
|
||||||
|
|
||||||
|
&.boy {
|
||||||
|
border-color: #56bbf9;
|
||||||
|
}
|
||||||
|
&.girl {
|
||||||
|
border-color: #f88ca2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.love-days {
|
||||||
|
margin: 0 12rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 26rpx;
|
||||||
|
.tip-text {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
.number {
|
||||||
|
font-size: 46rpx;
|
||||||
|
padding: 12rpx 0;
|
||||||
|
> .boy {
|
||||||
|
color: #56bbf9;
|
||||||
|
margin-right: 12rpx;
|
||||||
|
}
|
||||||
|
> .girl {
|
||||||
|
color: #f88ca2;
|
||||||
|
margin-left: 12rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.days {
|
||||||
|
animation: daysAni 6s ease-in-out infinite;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.foot {
|
||||||
|
display: none;
|
||||||
|
margin-top: 36rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes daysAni {
|
||||||
|
0% {
|
||||||
|
color: #f88ca2;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
color: #56bbf9;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
color: #f88ca2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes loveCardAni {
|
||||||
|
0% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: scale(1.03);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.empty {
|
||||||
|
height: calc(100vh - 180rpx - 280rpx - 36rpx);
|
||||||
|
.card {
|
||||||
|
height: 100%;
|
||||||
|
padding: 100rpx;
|
||||||
|
margin-bottom: 0;
|
||||||
|
text-align: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: rgba(96, 77, 68, 0.9);
|
||||||
|
}
|
||||||
|
&-image {
|
||||||
|
width: 300rpx;
|
||||||
|
height: 300rpx;
|
||||||
|
}
|
||||||
|
&-text {
|
||||||
|
margin-top: 36rpx;
|
||||||
|
line-height: 50rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.card {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 24rpx;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
border: 4rpx solid rgba(96, 77, 68, 0.9);
|
||||||
|
border-color: #fff;
|
||||||
|
// background-color: #faf8eb;
|
||||||
|
background-color: #ffffff;
|
||||||
|
margin-bottom: 36rpx;
|
||||||
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||||
|
animation-delay: var(--delay);
|
||||||
|
&.ani {
|
||||||
|
animation: cardAni 3s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
.head {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.status {
|
||||||
|
width: 100rpx;
|
||||||
|
display: flex;
|
||||||
|
.text {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: #ffc6ba;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 100rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #55423b;
|
||||||
|
&.finish {
|
||||||
|
background-color: #bfe9ef;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
width: 0;
|
||||||
|
flex-grow: 1;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-left: 30rpx;
|
||||||
|
padding-right: 24rpx;
|
||||||
|
&-name {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
&-desc {
|
||||||
|
margin-top: 8rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #555;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.actions {
|
||||||
|
width: 50rpx;
|
||||||
|
.icon {
|
||||||
|
display: inline-block;
|
||||||
|
width: 45rpx;
|
||||||
|
height: 45rpx;
|
||||||
|
background-color: rgba(96, 77, 68, 0.2);
|
||||||
|
border-radius: 50%;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 45rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
margin-top: 24rpx;
|
||||||
|
width: 100%;
|
||||||
|
background-color: #ffffff;
|
||||||
|
// background-color: #faf8eb;
|
||||||
|
background-color: rgba(96, 77, 68, 0.05);
|
||||||
|
border-radius: 24rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 24rpx;
|
||||||
|
padding-bottom: 12rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes cardAni {
|
||||||
|
0% {
|
||||||
|
transform: translateY(0rpx);
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
transform: translateY(-10rpx);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: translateY(0rpx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.desc {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
&-label {
|
||||||
|
color: #333;
|
||||||
|
width: 140rpx;
|
||||||
|
// font-weight: bold;
|
||||||
|
}
|
||||||
|
&-value {
|
||||||
|
width: 0;
|
||||||
|
flex-grow: 1;
|
||||||
|
line-height: 1.5;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+340
-4
@@ -1,22 +1,358 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-page bg-white flex flex-center"><text class="text-bg-gradient-red-accent-b">祝有情人👩❤👨终成眷属</text></view>
|
<view class="app-page bg-white">
|
||||||
|
<!-- 情侣信息 -->
|
||||||
|
<view class="lover-wrap" :style="[loveWrapStyle]">
|
||||||
|
<view class="lover-card">
|
||||||
|
<view class="boy">
|
||||||
|
<image class="avatar" :src="loveConfig.boy.avatar" mode="aspectFit"></image>
|
||||||
|
<view class="name">{{ loveConfig.boy.name }}</view>
|
||||||
|
</view>
|
||||||
|
<image class="like" :src="loveConfig.loveImageUrl" mode="scaleToFill"></image>
|
||||||
|
<view class="girl">
|
||||||
|
<image class="avatar" :src="loveConfig.girl.avatar" mode="aspectFit"></image>
|
||||||
|
<view class="name">{{ loveConfig.girl.name }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image class="wave-image" :src="loveConfig.waveImageUrl" mode="scaleToFill"></image>
|
||||||
|
</view>
|
||||||
|
<!-- 恋爱记时 -->
|
||||||
|
<view class="love-time-wrap">
|
||||||
|
<view class="title">{{ loveConfig.timeTitle }}</view>
|
||||||
|
<view class="content">
|
||||||
|
<text class="text">
|
||||||
|
第
|
||||||
|
<text class="number">{{ loveDayCount.d }}</text>
|
||||||
|
天
|
||||||
|
</text>
|
||||||
|
<text class="text">
|
||||||
|
<text class="number">{{ loveDayCount.h }}</text>
|
||||||
|
小时
|
||||||
|
</text>
|
||||||
|
<text class="text">
|
||||||
|
<text class="number">{{ loveDayCount.m }}</text>
|
||||||
|
分钟
|
||||||
|
</text>
|
||||||
|
<text class="text">
|
||||||
|
<text class="number">{{ loveDayCount.s }}</text>
|
||||||
|
秒
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 功能导航 -->
|
||||||
|
<view class="list-wrap">
|
||||||
|
<block v-for="(nav, index) in loveConfig.nav" :key="index">
|
||||||
|
<view v-if="nav.use" class="list-item" @click="fnToPage(nav.key)">
|
||||||
|
<view class="left"><image class="icon" :src="nav.iconImageUrl" mode="aspectFit"></image></view>
|
||||||
|
<view class="right">
|
||||||
|
<view class="name">{{ nav.title }}</view>
|
||||||
|
<view class="desc">{{ nav.desc }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import LoveConfig from '@/config/love.config.js';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
loveConfig: LoveConfig,
|
||||||
|
loveDayTimer: null,
|
||||||
|
loveDayCount: {
|
||||||
|
d: 0,
|
||||||
|
h: 0,
|
||||||
|
m: 0,
|
||||||
|
s: 0
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
loveWrapStyle() {
|
||||||
|
return {
|
||||||
|
backgroundImage: `url(${this.loveConfig.bgImageUrl})`
|
||||||
|
};
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fnSetPageTitle('恋爱日记');
|
this.fnSetPageTitle('恋爱日记');
|
||||||
|
this.fnInitLoveDayCount();
|
||||||
},
|
},
|
||||||
methods: {}
|
methods: {
|
||||||
|
fnInitLoveDayCount() {
|
||||||
|
clearTimeout(this.loveDayTimer);
|
||||||
|
const _countDownFn = () => {
|
||||||
|
this.loveDayTimer = setTimeout(_countDownFn, 1000);
|
||||||
|
const formatStartDate = this.loveConfig.loveStartDate.replace(/-/g, '/');
|
||||||
|
const start = new Date(formatStartDate),
|
||||||
|
now = new Date();
|
||||||
|
const T = now.getTime() - start.getTime();
|
||||||
|
const i = 24 * 60 * 60 * 1000;
|
||||||
|
const d = T / i;
|
||||||
|
const D = Math.floor(d);
|
||||||
|
const h = (d - D) * 24;
|
||||||
|
const H = Math.floor(h);
|
||||||
|
const m = (h - H) * 60;
|
||||||
|
const M = Math.floor(m);
|
||||||
|
const s = (m - M) * 60;
|
||||||
|
const S = Math.floor(s);
|
||||||
|
this.loveDayCount = {
|
||||||
|
d: D,
|
||||||
|
h: H,
|
||||||
|
m: M,
|
||||||
|
s: S
|
||||||
|
};
|
||||||
|
};
|
||||||
|
_countDownFn();
|
||||||
|
},
|
||||||
|
fnToPage(pageName) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pagesA/love/${pageName}`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
min-height: 100vh;
|
||||||
|
background: linear-gradient(
|
||||||
|
-45deg,
|
||||||
|
rgba(247, 149, 51, 0.1),
|
||||||
|
rgba(243, 112, 85, 0.1) 15%,
|
||||||
|
rgba(239, 78, 123, 0.1) 30%,
|
||||||
|
rgba(161, 102, 171, 0.1) 44%,
|
||||||
|
rgba(80, 115, 184, 0.1) 58%,
|
||||||
|
rgba(16, 152, 173, 0.1) 72%,
|
||||||
|
rgba(7, 179, 155, 0.1) 86%,
|
||||||
|
rgba(109, 186, 130, 0.1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
.lover-wrap {
|
||||||
|
position: relative;
|
||||||
|
width: 100vw;
|
||||||
|
height: 50vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background-size: cover;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: 50% 50%;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
content: '';
|
||||||
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
|
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAKUlEQVQImU3IMREAIAgAwJfNkQCEsH8cijjpMf6vnXlQaIiJFx+omEBfmqIEZLe2jzcAAAAASUVORK5CYII=);
|
||||||
|
z-index: 0;
|
||||||
|
backdrop-filter: blur(4rpx);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: -60rpx;
|
||||||
|
width: 100vw;
|
||||||
|
height: 60rpx;
|
||||||
|
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
|
||||||
|
}
|
||||||
|
.lover-card {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 58%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
width: 90vw;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
z-index: 2;
|
||||||
|
.avatar {
|
||||||
|
width: 180rpx;
|
||||||
|
height: 180rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
// border: 8rpx solid transparent;
|
||||||
|
// border: 8rpx solid rgba(255, 255, 255, 0.7) !important;
|
||||||
|
border: 8rpx solid rgba(255, 255, 255, 1) !important;
|
||||||
|
}
|
||||||
|
.name {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #ffffff;
|
||||||
|
text-align: center;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
.boy {
|
||||||
|
color: #3ab8e4;
|
||||||
|
.avatar {
|
||||||
|
border-color: rgba(58, 184, 228, 0.7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.girl {
|
||||||
|
color: #f57ab3;
|
||||||
|
.avatar {
|
||||||
|
border-color: rgba(245, 122, 179, 0.7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.like {
|
||||||
|
width: 120rpx;
|
||||||
|
height: 120rpx;
|
||||||
|
animation: likeani 1s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.wave-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 120rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
mix-blend-mode: screen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.love-time-wrap {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
width: 100vw;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 46rpx;
|
||||||
|
letter-spacing: 4rpx;
|
||||||
|
// background-image: linear-gradient(270deg, #ff4500, #ffa500, #ffd700, #90ee90, #00ffff, #1e90ff, #9370db, #ff69b4, #ff4500);
|
||||||
|
// -webkit-background-clip: text;
|
||||||
|
// color: #000;
|
||||||
|
color: #333;
|
||||||
|
font-size: 42rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
// animation: loveTimeTitleAni 80s linear infinite;
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
margin-top: 24rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
.number {
|
||||||
|
margin: 0 8rpx;
|
||||||
|
font-size: 46rpx;
|
||||||
|
// color: #ff69b4;
|
||||||
|
color: #f83856;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-wrap {
|
||||||
|
margin-top: 75rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 36rpx;
|
||||||
|
|
||||||
|
.list-item {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 28rpx 32rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
margin-bottom: 32rpx;
|
||||||
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
|
|
||||||
|
&:nth-child(1) {
|
||||||
|
animation: listItemAni1 3s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
&:nth-child(2) {
|
||||||
|
animation: listItemAni1 3s ease-in-out infinite;
|
||||||
|
animation-delay: 1.5s;
|
||||||
|
}
|
||||||
|
&:nth-child(3) {
|
||||||
|
animation: listItemAni1 3s ease-in-out infinite;
|
||||||
|
animation-delay: 2s;
|
||||||
|
}
|
||||||
|
.left {
|
||||||
|
width: 120rpx;
|
||||||
|
height: 120rpx;
|
||||||
|
.icon {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.right {
|
||||||
|
flex-grow: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-left: 40rpx;
|
||||||
|
.name {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
.desc {
|
||||||
|
margin-top: 8px;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #777777;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes likeani {
|
||||||
|
0% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
25% {
|
||||||
|
transform: scale(1.2);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
75% {
|
||||||
|
transform: scale(1.3);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes loveTimeTitleAni {
|
||||||
|
to {
|
||||||
|
background-position: -200rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes listItemAni1 {
|
||||||
|
0% {
|
||||||
|
transform: translateY(0rpx);
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
transform: translateY(-10rpx);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: translateY(0rpx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+86
-26
@@ -9,8 +9,8 @@
|
|||||||
<view class="sheet-content">内容区域</view>
|
<view class="sheet-content">内容区域</view>
|
||||||
</tm-sheet> -->
|
</tm-sheet> -->
|
||||||
<tm-sheet :shadow="6" :padding="[12, 24]" :margin="[24, 24]">
|
<tm-sheet :shadow="6" :padding="[12, 24]" :margin="[24, 24]">
|
||||||
<view class="py-12 px-24 mx-12 round-3 border-b-1 grey text">
|
<view class="py-12 px-24 mx-12 round-3 grey text">
|
||||||
<text class="text-size-n text-weight-b ">布局</text>
|
<text class="text-size-n text-weight-b text-grey-darken-3">布局</text>
|
||||||
<text class="text-grey text-size-xs px-10 ml-12">应用以及文章列表布局设置</text>
|
<text class="text-grey text-size-xs px-10 ml-12">应用以及文章列表布局设置</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="sheet-content">
|
<view class="sheet-content">
|
||||||
@@ -25,9 +25,10 @@
|
|||||||
<tm-input
|
<tm-input
|
||||||
name="status"
|
name="status"
|
||||||
required
|
required
|
||||||
title="首页布局"
|
title="首页文章布局"
|
||||||
placeholder="请选择首页布局"
|
placeholder="请选择首页文章布局"
|
||||||
disabled
|
disabled
|
||||||
|
align="right"
|
||||||
:value="homeLayout.selectLabel"
|
:value="homeLayout.selectLabel"
|
||||||
right-icon="icon-angle-right"
|
right-icon="icon-angle-right"
|
||||||
></tm-input>
|
></tm-input>
|
||||||
@@ -43,9 +44,10 @@
|
|||||||
<tm-input
|
<tm-input
|
||||||
name="status"
|
name="status"
|
||||||
required
|
required
|
||||||
title="卡片样式"
|
title="文章卡片样式"
|
||||||
placeholder="请选择文章卡片样式"
|
placeholder="请选择文章卡片样式"
|
||||||
disabled
|
disabled
|
||||||
|
align="right"
|
||||||
:value="articleCardStyle.selectLabel"
|
:value="articleCardStyle.selectLabel"
|
||||||
right-icon="icon-angle-right"
|
right-icon="icon-angle-right"
|
||||||
></tm-input>
|
></tm-input>
|
||||||
@@ -54,7 +56,7 @@
|
|||||||
</tm-sheet>
|
</tm-sheet>
|
||||||
|
|
||||||
<tm-sheet v-if="false" :shadow="24" :padding="[12, 24]" :margin="[24, 24]">
|
<tm-sheet v-if="false" :shadow="24" :padding="[12, 24]" :margin="[24, 24]">
|
||||||
<view class="py-12 px-24 mx-12 round-3 border-b-1 grey text">
|
<view class="py-12 px-24 mx-12 round-3 grey text">
|
||||||
<text class="text-size-n text-weight-b ">外观</text>
|
<text class="text-size-n text-weight-b ">外观</text>
|
||||||
<text class="text-grey text-size-xs px-10">设置应用主题色/暗黑模式等</text>
|
<text class="text-grey text-size-xs px-10">设置应用主题色/暗黑模式等</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -65,19 +67,11 @@
|
|||||||
</tm-sheet>
|
</tm-sheet>
|
||||||
|
|
||||||
<tm-sheet :shadow="6" :padding="[12, 24]" :margin="[24, 24]">
|
<tm-sheet :shadow="6" :padding="[12, 24]" :margin="[24, 24]">
|
||||||
<view class="py-12 px-24 mx-12 round-3 border-b-1 grey text">
|
<view class="py-12 px-24 mx-12 round-3 grey text">
|
||||||
<text class="text-size-n text-weight-b ">功能</text>
|
<text class="text-size-n text-weight-b text-grey-darken-3">功能</text>
|
||||||
<text class="text-grey text-size-xs px-10 ml-12">一些常用的功能性设置</text>
|
<text class="text-grey text-size-xs px-10 ml-12">一些常用的功能性设置</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="sheet-content">
|
<view class="sheet-content">
|
||||||
<view class="mx-32 my-24 border-b-1 pb-24 flex-between">
|
|
||||||
<text class="text-size-m">显示完整统计</text>
|
|
||||||
<tm-switch v-model="appSettings.about.showAllCount" color="light-blue" :text="['是', '否']"></tm-switch>
|
|
||||||
</view>
|
|
||||||
<view class="mx-32 my-24 border-b-1 pb-24 flex-between">
|
|
||||||
<text class="text-size-m ">链接直接打开</text>
|
|
||||||
<tm-switch v-model="appSettings.contact.isLinkCopy" color="light-blue" :text="['是', '否']"></tm-switch>
|
|
||||||
</view>
|
|
||||||
<view class="mx-32 my-24 border-b-1 pb-24 flex-between">
|
<view class="mx-32 my-24 border-b-1 pb-24 flex-between">
|
||||||
<text class="text-size-m ">图库瀑布流模式</text>
|
<text class="text-size-m ">图库瀑布流模式</text>
|
||||||
<tm-switch v-model="appSettings.gallery.useWaterfull" color="light-blue" :text="['是', '否']"></tm-switch>
|
<tm-switch v-model="appSettings.gallery.useWaterfull" color="light-blue" :text="['是', '否']"></tm-switch>
|
||||||
@@ -86,6 +80,33 @@
|
|||||||
<text class="text-size-m ">友链简洁模式</text>
|
<text class="text-size-m ">友链简洁模式</text>
|
||||||
<tm-switch v-model="appSettings.links.useSimple" color="light-blue" :text="['是', '否']"></tm-switch>
|
<tm-switch v-model="appSettings.links.useSimple" color="light-blue" :text="['是', '否']"></tm-switch>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="mx-32 mt-24 mb-0 border-b-1 pb-24 flex-between">
|
||||||
|
<text class="text-size-m">启用评论弹幕</text>
|
||||||
|
<tm-switch v-model="appSettings.barrage.use" color="light-blue" :text="['是', '否']"></tm-switch>
|
||||||
|
</view>
|
||||||
|
<tm-pickers
|
||||||
|
v-if="appSettings.barrage.use"
|
||||||
|
title="评论弹幕位置"
|
||||||
|
btn-color="light-blue"
|
||||||
|
:default-value.sync="barrage.selectDefault"
|
||||||
|
rang-key="name"
|
||||||
|
:list="barrage.list"
|
||||||
|
@confirm="fnOnBarrageConfirm"
|
||||||
|
>
|
||||||
|
<tm-input
|
||||||
|
name="status"
|
||||||
|
title="评论弹幕位置"
|
||||||
|
placeholder="请选择评论弹幕位置"
|
||||||
|
disabled
|
||||||
|
align="right"
|
||||||
|
:value="barrage.selectLabel"
|
||||||
|
right-icon="icon-angle-right"
|
||||||
|
></tm-input>
|
||||||
|
</tm-pickers>
|
||||||
|
<view class="mx-32 my-24 border-b-1 pb-24 flex-between">
|
||||||
|
<text class="text-size-m">是否圆形头像</text>
|
||||||
|
<tm-switch v-model="appSettings.isAvatarRadius" color="light-blue" :text="['是', '否']"></tm-switch>
|
||||||
|
</view>
|
||||||
<view class="mx-32 my-24 border-b-1 pb-24 flex-between">
|
<view class="mx-32 my-24 border-b-1 pb-24 flex-between">
|
||||||
<text class="text-size-m ">轮播图指示器</text>
|
<text class="text-size-m ">轮播图指示器</text>
|
||||||
<tm-switch v-model="appSettings.banner.useDot" color="light-blue" :text="['是', '否']"></tm-switch>
|
<tm-switch v-model="appSettings.banner.useDot" color="light-blue" :text="['是', '否']"></tm-switch>
|
||||||
@@ -104,6 +125,15 @@
|
|||||||
></tm-radio>
|
></tm-radio>
|
||||||
</tm-groupradio>
|
</tm-groupradio>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="mx-32 my-24 border-b-1 pb-24 flex-between">
|
||||||
|
<text class="text-size-m">显示完整统计</text>
|
||||||
|
<tm-switch v-model="appSettings.about.showAllCount" color="light-blue" :text="['是', '否']"></tm-switch>
|
||||||
|
</view>
|
||||||
|
<view class="mx-32 my-24 border-b-1 pb-24 flex-between">
|
||||||
|
<text class="text-size-m ">链接直接打开</text>
|
||||||
|
<tm-switch v-model="appSettings.contact.isLinkCopy" color="light-blue" :text="['是', '否']"></tm-switch>
|
||||||
|
</view>
|
||||||
<view class="mx-32 my-24 border-b-1 pb-24 flex-between">
|
<view class="mx-32 my-24 border-b-1 pb-24 flex-between">
|
||||||
<text class="text-size-m ">显示后台入口</text>
|
<text class="text-size-m ">显示后台入口</text>
|
||||||
<tm-switch v-model="appSettings.about.showAdmin" color="light-blue" :text="['是', '否']"></tm-switch>
|
<tm-switch v-model="appSettings.about.showAdmin" color="light-blue" :text="['是', '否']"></tm-switch>
|
||||||
@@ -148,6 +178,8 @@ export default {
|
|||||||
isBlackTheme: false,
|
isBlackTheme: false,
|
||||||
loading: true,
|
loading: true,
|
||||||
appSettings: {},
|
appSettings: {},
|
||||||
|
isSaved: true,
|
||||||
|
firstLoad: true,
|
||||||
homeLayout: {
|
homeLayout: {
|
||||||
list: [{ name: '一行一列', value: 'h_row_col1' }, { name: '一行两列', value: 'h_row_col2' }],
|
list: [{ name: '一行一列', value: 'h_row_col1' }, { name: '一行两列', value: 'h_row_col2' }],
|
||||||
selectDefault: ['一行一列'],
|
selectDefault: ['一行一列'],
|
||||||
@@ -166,18 +198,26 @@ export default {
|
|||||||
selectLabel: '左图右文',
|
selectLabel: '左图右文',
|
||||||
selectValue: 'lr_image_text'
|
selectValue: 'lr_image_text'
|
||||||
},
|
},
|
||||||
dotPositionList: [{ name: '右边', value: 'right', checked: true }, { name: '下边', value: 'bottom', checked: false }]
|
dotPositionList: [{ name: '右边', value: 'right', checked: true }, { name: '下边', value: 'bottom', checked: false }],
|
||||||
|
barrage: {
|
||||||
|
list: [{ name: '顶部', value: 'rightToLeft' }, { name: '左下', value: 'leftBottom' }],
|
||||||
|
selectDefault: ['顶部'],
|
||||||
|
selectLabel: '顶部',
|
||||||
|
selectValue: 'rightToLeft'
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
// 获取设置
|
|
||||||
_appSettings() {
|
|
||||||
return uni.$tm.vx.getters().setting.getSettings;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
watch: {
|
||||||
_appSettings(val) {
|
appSettings: {
|
||||||
this.appSettings = val;
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
if (this.firstLoad) {
|
||||||
|
this.firstLoad = false;
|
||||||
|
} else {
|
||||||
|
this.isSaved = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -185,7 +225,7 @@ export default {
|
|||||||
this.fnSetPageTitle('应用设置');
|
this.fnSetPageTitle('应用设置');
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.appSettings = this._appSettings;
|
this.appSettings = Object.assign({}, _DefaultAppSettings, uni.$tm.vx.getters().getSettings);
|
||||||
this.fnHandleFormatSelect();
|
this.fnHandleFormatSelect();
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中...',
|
title: '加载中...',
|
||||||
@@ -210,6 +250,11 @@ export default {
|
|||||||
this.articleCardStyle.selectDefault = [_articleCardStyle.name];
|
this.articleCardStyle.selectDefault = [_articleCardStyle.name];
|
||||||
this.articleCardStyle.selectLabel = _articleCardStyle.name;
|
this.articleCardStyle.selectLabel = _articleCardStyle.name;
|
||||||
this.articleCardStyle.selectValue = _articleCardStyle.value;
|
this.articleCardStyle.selectValue = _articleCardStyle.value;
|
||||||
|
|
||||||
|
const _barrage = this.fnFindObjInList(this.barrage.list, 'value', this.appSettings.barrage.type);
|
||||||
|
this.barrage.selectDefault = [_barrage.name];
|
||||||
|
this.barrage.selectLabel = _barrage.name;
|
||||||
|
this.barrage.selectValue = _barrage.value;
|
||||||
},
|
},
|
||||||
// 在集合中找匹配的对象
|
// 在集合中找匹配的对象
|
||||||
fnFindObjInList(list, key, value) {
|
fnFindObjInList(list, key, value) {
|
||||||
@@ -240,8 +285,17 @@ export default {
|
|||||||
this.articleCardStyle.selectValue = _select.value;
|
this.articleCardStyle.selectValue = _select.value;
|
||||||
this.appSettings.layout.cardType = _select.value;
|
this.appSettings.layout.cardType = _select.value;
|
||||||
},
|
},
|
||||||
|
// 弹幕设置
|
||||||
|
fnOnBarrageConfirm(e) {
|
||||||
|
const _select = e[0].data;
|
||||||
|
this.barrage.selectDefault = [_select.name];
|
||||||
|
this.barrage.selectLabel = _select.name;
|
||||||
|
this.barrage.selectValue = _select.value;
|
||||||
|
this.appSettings.barrage.type = _select.value;
|
||||||
|
},
|
||||||
// 保存
|
// 保存
|
||||||
fnOnSave() {
|
fnOnSave() {
|
||||||
|
this.isSaved = true;
|
||||||
this.$tm.vx.commit('setting/setSettings', this.appSettings);
|
this.$tm.vx.commit('setting/setSettings', this.appSettings);
|
||||||
uni.$tm.toast('保存成功,部分设置在重启后生效!');
|
uni.$tm.toast('保存成功,部分设置在重启后生效!');
|
||||||
},
|
},
|
||||||
@@ -257,12 +311,17 @@ export default {
|
|||||||
confirmColor: '#03a9f4'
|
confirmColor: '#03a9f4'
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
this.isSaved = true;
|
||||||
uni.$tm.vx.actions('setting/updateDefaultAppSettings');
|
uni.$tm.vx.actions('setting/updateDefaultAppSettings');
|
||||||
uni.$tm.toast('系统设置已恢复为默认配置,部分设置在重启后生效!');
|
uni.$tm.toast('系统设置已恢复为默认配置,部分设置在重启后生效!');
|
||||||
})
|
})
|
||||||
.catch(err => {});
|
.catch(err => {});
|
||||||
},
|
},
|
||||||
fnOnBack() {
|
fnOnBack() {
|
||||||
|
if (this.isSaved) {
|
||||||
|
uni.navigateBack();
|
||||||
|
return;
|
||||||
|
}
|
||||||
uni.$eShowModal({
|
uni.$eShowModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '您当前可能有未保存的数据,确定返回吗?',
|
content: '您当前可能有未保存的数据,确定返回吗?',
|
||||||
@@ -274,6 +333,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
|
this.isSaved = true;
|
||||||
})
|
})
|
||||||
.catch(err => {});
|
.catch(err => {});
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-8
@@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-page bg-gradient-blue-lighten-b">
|
<view class="app-page bg-gradient-blue-lighten-b" :style="pageStyle">
|
||||||
<!-- 流星-->
|
|
||||||
<view class="tn-satr">
|
<view class="tn-satr">
|
||||||
<view class="sky"></view>
|
<view class="sky"></view>
|
||||||
<view class="stars">
|
<view class="stars">
|
||||||
@@ -41,18 +40,19 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 头像用户信息 -->
|
|
||||||
<view class="user-info__container flex flex-col flex-center">
|
<view class="user-info__container flex flex-col flex-center">
|
||||||
<image class="user-info__avatar" src="https://blog-oss.925i.cn/blog-files/d500acd35e8b6d24bbfa2dabd2a605e6.png" mode="aspectFill"></image>
|
<image class="user-info__avatar" :src="startInfo.logo" mode="aspectFill"></image>
|
||||||
<view class="user-info__nick-name">「 uni-halo 」</view>
|
<view class="user-info__nick-name">「 {{ startInfo.title }} 」</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="text-align-center text-white" style="padding: 60vh 0 0 0;">
|
<view class="text-align-center text-white" style="padding: 60vh 0 0 0;">
|
||||||
<view class="" style="font-size: 44rpx;">全新UI,准备出发</view>
|
<view class="" style="font-size: 44rpx;" v-if="startInfo.desc1">{{ startInfo.desc1 }}</view>
|
||||||
<view class="mt-30 text-size-m">新触动 新感受 新体验</view>
|
<view class="mt-30 text-size-m" v-if="startInfo.desc2">{{ startInfo.desc2 }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="" style="padding: 120rpx 200rpx;z-index: 999;position: relative;"><view class="start-btn" @click="fnStart()">全新出发</view></view>
|
<view class="" style="padding: 120rpx 200rpx;z-index: 999;position: relative;">
|
||||||
|
<view class="start-btn" @click="fnStart()">{{ startInfo.btnText || '开始体验' }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 波浪效果 -->
|
<!-- 波浪效果 -->
|
||||||
<wave></wave>
|
<wave></wave>
|
||||||
@@ -63,6 +63,20 @@
|
|||||||
import wave from '@/components/wave/wave.vue';
|
import wave from '@/components/wave/wave.vue';
|
||||||
export default {
|
export default {
|
||||||
components: { wave },
|
components: { wave },
|
||||||
|
computed: {
|
||||||
|
startInfo() {
|
||||||
|
return getApp().globalData.start;
|
||||||
|
},
|
||||||
|
pageStyle() {
|
||||||
|
if (this.startInfo.bg) {
|
||||||
|
const _bg = this.$utils.checkIsUrl(this.startInfo.bg) ? `url(${this.startInfo.bg})` : this.startInfo.bg;
|
||||||
|
return {
|
||||||
|
background: _bg + '!important'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fnStart() {
|
fnStart() {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
|
|||||||
@@ -0,0 +1,146 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app-page">
|
||||||
|
<view v-if="loading != 'success'" class="loading-wrap">
|
||||||
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
|
</view>
|
||||||
|
<block v-else>
|
||||||
|
<view class="empty" v-if="dataList.length == 0"><tm-empty icon="icon-shiliangzhinengduixiang-" label="该标签下暂无文章"></tm-empty></view>
|
||||||
|
<block v-else>
|
||||||
|
<block v-for="(article, index) in dataList" :key="article.createTime">
|
||||||
|
<!-- 文章卡片 -->
|
||||||
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)"><article-card :article="article" @on-click="fnToArticleDetail"></article-card></tm-translate>
|
||||||
|
</block>
|
||||||
|
<view class="load-text">{{ loadMoreText }}</view>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<tm-flotbutton @click="fnToTopPage" color="light-blue" size="m" icon="icon-angle-up"></tm-flotbutton>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
|
import ArticleCard from '@/components/article-card/article-card.vue';
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
tmSkeleton,
|
||||||
|
tmTranslate,
|
||||||
|
tmFlotbutton,
|
||||||
|
tmEmpty,
|
||||||
|
ArticleCard
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: 'loading',
|
||||||
|
queryParams: {
|
||||||
|
size: 10,
|
||||||
|
page: 0
|
||||||
|
},
|
||||||
|
slug: '',
|
||||||
|
pageTitle: '加载中...',
|
||||||
|
result: null,
|
||||||
|
dataList: [],
|
||||||
|
isLoadMore: false,
|
||||||
|
loadMoreText: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad(e) {
|
||||||
|
this.slug = e.slug;
|
||||||
|
this.pageTitle = e.name;
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.isLoadMore = false;
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
onReachBottom(e) {
|
||||||
|
if (this.result.hasNext) {
|
||||||
|
this.queryParams.page += 1;
|
||||||
|
this.isLoadMore = true;
|
||||||
|
this.fnGetData();
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '没有更多数据了'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fnGetData() {
|
||||||
|
// uni.showLoading({
|
||||||
|
// mask: true,
|
||||||
|
// title: '加载中...'
|
||||||
|
// });
|
||||||
|
// 设置状态为加载中
|
||||||
|
if (!this.isLoadMore) {
|
||||||
|
this.loading = 'loading';
|
||||||
|
}
|
||||||
|
this.loadMoreText = '加载中...';
|
||||||
|
this.$httpApi
|
||||||
|
.getTagPostsList(this.slug, this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
this.fnSetPageTitle(`标签:${this.pageTitle} (共${res.data.total}篇)`);
|
||||||
|
this.result = res.data;
|
||||||
|
if (this.isLoadMore) {
|
||||||
|
this.dataList = this.dataList.concat(res.data.content);
|
||||||
|
} else {
|
||||||
|
this.dataList = res.data.content;
|
||||||
|
}
|
||||||
|
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
|
setTimeout(() => {
|
||||||
|
this.loading = 'success';
|
||||||
|
}, 500);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//跳转文章详情
|
||||||
|
fnToArticleDetail(article) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesA/article-detail/article-detail?articleId=' + article.id,
|
||||||
|
animationType: 'slide-in-right'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.app-page {
|
||||||
|
width: 100vw;
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 24rpx 0;
|
||||||
|
background-color: #fafafd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-wrap {
|
||||||
|
padding: 0 24rpx;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty {
|
||||||
|
height: 60vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<template>
|
||||||
|
<view>文章标签页面</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
methods: {}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
@@ -146,13 +146,12 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
bloggerInfo() {
|
bloggerInfo() {
|
||||||
return this.$tm.vx.getters().blogger.getBlogger;
|
return this.$tm.vx.getters().getBlogger;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// this.fnGetData();
|
// this.fnGetData();
|
||||||
this.fnSetPageTitle('欢迎登录工作台');
|
this.fnSetPageTitle('欢迎登录工作台');
|
||||||
console.log(this.bloggerInfo);
|
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
|
|||||||
@@ -151,7 +151,8 @@ export default {
|
|||||||
form: {
|
form: {
|
||||||
content: '',
|
content: '',
|
||||||
keepRaw: true,
|
keepRaw: true,
|
||||||
sourceContent: '',
|
originalContent: '',
|
||||||
|
formatContent: '',
|
||||||
type: 'PUBLIC'
|
type: 'PUBLIC'
|
||||||
},
|
},
|
||||||
modal: null,
|
modal: null,
|
||||||
@@ -532,16 +533,17 @@ export default {
|
|||||||
return uni.$tm.toast('请输入内容!');
|
return uni.$tm.toast('请输入内容!');
|
||||||
}
|
}
|
||||||
this.form.content = _content;
|
this.form.content = _content;
|
||||||
this.form.sourceContent = this.$refs.markdown.getText();
|
this.form.formatContent = _content;
|
||||||
|
this.form.originalContent = this.$refs.markdown.getText();
|
||||||
uni.setStorageSync('posts-content', _content);
|
uni.setStorageSync('posts-content', _content);
|
||||||
uni.setStorageSync('posts-content-source', this.form.sourceContent);
|
uni.setStorageSync('posts-content-source', this.form.originalContent);
|
||||||
if (this.form.id) {
|
if (this.form.id) {
|
||||||
this.$Router.push({
|
this.$Router.push({
|
||||||
path: '/pagesB/articles/article-setting',
|
path: '/pagesB/articles/article-setting',
|
||||||
query: { postsId: this.form.id, postTitle: this.form.title, isEdit: true, from: 'edit' }
|
query: { postsId: this.form.id, postTitle: this.form.title, isEdit: 1, from: 'edit' }
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$Router.push({ path: '/pagesB/articles/article-setting', query: { postsId: '', postTitle: '', isEdit: false, from: 'edit' } });
|
this.$Router.push({ path: '/pagesB/articles/article-setting', query: { postsId: '', postTitle: '', isEdit: 0, from: 'edit' } });
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -60,9 +60,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<tm-groupcheckbox name="categoryIds">
|
<tm-groupcheckbox name="categoryIds">
|
||||||
<tm-checkbox :dense="true" :name="item.id" v-for="(item, index) in categories" :key="index" v-model="item.checked">
|
<tm-checkbox :dense="true" :name="item.id" v-for="(item, index) in categories" :key="index" v-model="item.checked">
|
||||||
<template v-slot:default="{ checkData }">
|
<tm-button v-slot:default :flat="true" size="s" :theme="item.checked ? 'light-blue' : 'grey-lighten-4'" :plan="true">{{ item.name }}</tm-button>
|
||||||
<tm-button :flat="true" size="s" :theme="checkData.checked ? 'light-blue' : 'grey-lighten-4'" :plan="true">{{ item.name }}</tm-button>
|
|
||||||
</template>
|
|
||||||
</tm-checkbox>
|
</tm-checkbox>
|
||||||
</tm-groupcheckbox>
|
</tm-groupcheckbox>
|
||||||
</view>
|
</view>
|
||||||
@@ -76,9 +74,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<tm-groupcheckbox name="tagIds">
|
<tm-groupcheckbox name="tagIds">
|
||||||
<tm-checkbox :dense="true" :name="item.id" v-for="(item, index) in tags" :key="index" v-model="item.checked">
|
<tm-checkbox :dense="true" :name="item.id" v-for="(item, index) in tags" :key="index" v-model="item.checked">
|
||||||
<template v-slot:default="{ checkData }">
|
<tm-button v-slot:default :flat="true" size="s" :theme="item.checked ? 'light-blue' : 'grey-lighten-4'" :plan="true">{{ item.name }}</tm-button>
|
||||||
<tm-button :flat="true" size="s" :theme="checkData.checked ? 'light-blue' : 'grey-lighten-4'" :plan="true">{{ item.name }}</tm-button>
|
|
||||||
</template>
|
|
||||||
</tm-checkbox>
|
</tm-checkbox>
|
||||||
</tm-groupcheckbox>
|
</tm-groupcheckbox>
|
||||||
</view>
|
</view>
|
||||||
@@ -151,7 +147,7 @@
|
|||||||
<!-- 操作区域 -->
|
<!-- 操作区域 -->
|
||||||
<view class="btn-bar flex flex-center bg-white">
|
<view class="btn-bar flex flex-center bg-white">
|
||||||
<tm-button theme="blue" :shadow="0" block :height="70" @click="fnOnSave(false, false)">立即保存</tm-button>
|
<tm-button theme="blue" :shadow="0" block :height="70" @click="fnOnSave(false, false)">立即保存</tm-button>
|
||||||
<tm-button theme="light-blue" :shadow="0" block :height="70" @click="fnOnSave(false, true)">保存并返回</tm-button>
|
<tm-button v-if="isEdit" theme="light-blue" :shadow="0" block :height="70" @click="fnOnSave(false, true)">保存并返回</tm-button>
|
||||||
<!-- <block v-if="from == 'edit' && isEdit">
|
<!-- <block v-if="from == 'edit' && isEdit">
|
||||||
<tm-button
|
<tm-button
|
||||||
v-if="article.status == 'DRAFT' || article.status == 'INTIMATE' || article.status == 'RECYCLE'"
|
v-if="article.status == 'DRAFT' || article.status == 'INTIMATE' || article.status == 'RECYCLE'"
|
||||||
@@ -357,10 +353,21 @@ export default {
|
|||||||
list: ['常规', '高级', 'SEO']
|
list: ['常规', '高级', 'SEO']
|
||||||
},
|
},
|
||||||
article: {
|
article: {
|
||||||
|
title: '',
|
||||||
|
slug: '',
|
||||||
|
status: '',
|
||||||
content: '',
|
content: '',
|
||||||
keepRaw: true,
|
keepRaw: true,
|
||||||
sourceContent: '',
|
topPriority: 0,
|
||||||
type: 'PUBLIC'
|
summary: '',
|
||||||
|
password: '',
|
||||||
|
originalContent: '',
|
||||||
|
metaDescription: '',
|
||||||
|
formatContent: '',
|
||||||
|
editorType: 'MARKDOWN',
|
||||||
|
createTime: '',
|
||||||
|
categoryIds: [],
|
||||||
|
tagIds: []
|
||||||
},
|
},
|
||||||
articleStatus: {
|
articleStatus: {
|
||||||
list: [{ name: '发布', value: 'PUBLISHED' }, { name: '私有', value: 'INTIMATE' }, { name: '草稿', value: 'DRAFT' }, { name: '回收站', value: 'RECYCLE' }],
|
list: [{ name: '发布', value: 'PUBLISHED' }, { name: '私有', value: 'INTIMATE' }, { name: '草稿', value: 'DRAFT' }, { name: '回收站', value: 'RECYCLE' }],
|
||||||
@@ -393,7 +400,7 @@ export default {
|
|||||||
const from = this.$Route.query.from;
|
const from = this.$Route.query.from;
|
||||||
this.postsId = postsId;
|
this.postsId = postsId;
|
||||||
this.postTitle = postTitle || '';
|
this.postTitle = postTitle || '';
|
||||||
this.isEdit = isEdit;
|
this.isEdit = isEdit == 1 ? true : false;
|
||||||
this.from = from;
|
this.from = from;
|
||||||
this.createTime = uni.$tm.dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss');
|
this.createTime = uni.$tm.dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss');
|
||||||
this.fnGetSettings();
|
this.fnGetSettings();
|
||||||
@@ -533,7 +540,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.createTime = uni.$tm.dayjs(new Date(this.article.createTime).getTime()).format('YYYY-MM-DD HH:mm:ss');
|
this.createTime = uni.$tm.dayjs(new Date(this.article.createTime).getTime()).format('YYYY-MM-DD HH:mm:ss');
|
||||||
if (this.postTitle) {
|
if (this.postTitle) {
|
||||||
this.article.title = this.postTitle;
|
this.$set(this.article, 'title', this.postTitle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const _cateRes = res[1];
|
const _cateRes = res[1];
|
||||||
@@ -626,7 +633,8 @@ export default {
|
|||||||
// 设置文章内容
|
// 设置文章内容
|
||||||
if (this.from == 'edit') {
|
if (this.from == 'edit') {
|
||||||
this.article.content = uni.getStorageSync('posts-content');
|
this.article.content = uni.getStorageSync('posts-content');
|
||||||
this.article.sourceContent = uni.getStorageSync('posts-content-source');
|
this.article.formatContent = uni.getStorageSync('posts-content');
|
||||||
|
this.article.originalContent = uni.getStorageSync('posts-content-source');
|
||||||
}
|
}
|
||||||
if (this.articleStatus.selectValue != 'INTIMATE') {
|
if (this.articleStatus.selectValue != 'INTIMATE') {
|
||||||
this.article.password = '';
|
this.article.password = '';
|
||||||
@@ -651,8 +659,7 @@ export default {
|
|||||||
delta: 1
|
delta: 1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// uni.$emit('refresh-article-list');
|
||||||
uni.$emit('refresh-article-list');
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
} else {
|
} else {
|
||||||
uni.$tm.toast('保存失败,请重试!');
|
uni.$tm.toast('保存失败,请重试!');
|
||||||
@@ -662,13 +669,12 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.$tm.toast('保存失败,请重试!');
|
uni.$tm.toast(`保存失败,${err.message}!`);
|
||||||
if (isChangeStatus) {
|
if (isChangeStatus) {
|
||||||
this.article.status = this.article.status == 'DRAFT' ? 'PUBLISHED' : 'DRAFT';
|
this.article.status = this.article.status == 'DRAFT' ? 'PUBLISHED' : 'DRAFT';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.article.content = this.article.sourceContent = uni.getStorageInfoSync();
|
|
||||||
this.$httpApi.admin
|
this.$httpApi.admin
|
||||||
.createPosts(this.article)
|
.createPosts(this.article)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
@@ -678,12 +684,9 @@ export default {
|
|||||||
uni.setStorageSync('posts-content', '');
|
uni.setStorageSync('posts-content', '');
|
||||||
uni.setStorageSync('posts-content-source', '');
|
uni.setStorageSync('posts-content-source', '');
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (isBack) {
|
uni.navigateBack({
|
||||||
uni.navigateBack({
|
delta: 2
|
||||||
delta: 1
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
uni.$emit('refresh-article-list');
|
uni.$emit('refresh-article-list');
|
||||||
}, 1000);
|
}, 1000);
|
||||||
} else {
|
} else {
|
||||||
@@ -691,7 +694,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.$tm.toast('发布失败,请重试!');
|
uni.$tm.toast(`发布失败:${err.message}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
+279
-269
@@ -29,7 +29,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(article, index) in dataList" :key="index">
|
<block v-for="(article, index) in dataList" :key="index">
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<!-- 文章卡片 -->
|
<!-- 文章卡片 -->
|
||||||
<view class="article-card mt-24 bg-white pa-24 round-3">
|
<view class="article-card mt-24 bg-white pa-24 round-3">
|
||||||
<view class="thumbnail round-2" @click="fnToArticleDetail(article)">
|
<view class="thumbnail round-2" @click="fnToArticleDetail(article)">
|
||||||
@@ -110,295 +110,305 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmSearch from '@/tm-vuetify/components/tm-search/tm-search.vue';
|
import tmSearch from '@/tm-vuetify/components/tm-search/tm-search.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
||||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
import tmPickers from '@/tm-vuetify/components/tm-pickers/tm-pickers.vue';
|
import tmPickers from '@/tm-vuetify/components/tm-pickers/tm-pickers.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmSearch,
|
tmSearch,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
tmTabs,
|
tmTabs,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
tmTags,
|
tmTags,
|
||||||
tmButton,
|
tmButton,
|
||||||
tmPickers
|
tmPickers
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isBlackTheme: false,
|
isBlackTheme: false,
|
||||||
loading: 'loading',
|
|
||||||
tab: {
|
|
||||||
activeIndex: 0,
|
|
||||||
list: ['全部', '已发布', '私密', '草稿', '回收站']
|
|
||||||
},
|
|
||||||
queryParams: {
|
|
||||||
size: 10,
|
|
||||||
page: 0,
|
|
||||||
status: '',
|
|
||||||
keyword: '',
|
|
||||||
categoryId: undefined
|
|
||||||
},
|
|
||||||
cache: {
|
|
||||||
dataList: [],
|
|
||||||
total: 0
|
|
||||||
},
|
|
||||||
isLoadMore: false,
|
|
||||||
loadMoreText: '加载中...',
|
|
||||||
result: {},
|
|
||||||
dataList: [],
|
|
||||||
category: {
|
|
||||||
loading: 'loading',
|
loading: 'loading',
|
||||||
show: false,
|
tab: {
|
||||||
list: [],
|
activeIndex: 0,
|
||||||
selected: [0]
|
list: ['全部', '已发布', '私密', '草稿', '回收站']
|
||||||
}
|
},
|
||||||
};
|
queryParams: {
|
||||||
},
|
size: 10,
|
||||||
onLoad() {
|
page: 0,
|
||||||
this.fnSetPageTitle('文章管理');
|
status: '',
|
||||||
this.fnGetCategoryList();
|
keyword: '',
|
||||||
},
|
categoryId: undefined
|
||||||
created() {
|
},
|
||||||
this.fnGetData();
|
cache: {
|
||||||
uni.$on('refresh-article-list', () => {
|
dataList: [],
|
||||||
this.isLoadMore = false;
|
total: 0
|
||||||
this.queryParams.page = 0;
|
},
|
||||||
this.fnGetData();
|
isLoadMore: false,
|
||||||
});
|
loadMoreText: '加载中...',
|
||||||
},
|
result: {},
|
||||||
onPullDownRefresh() {
|
dataList: [],
|
||||||
this.isLoadMore = false;
|
category: {
|
||||||
this.queryParams.page = 0;
|
loading: 'loading',
|
||||||
this.fnGetData();
|
show: false,
|
||||||
},
|
list: [],
|
||||||
|
selected: [0]
|
||||||
onReachBottom(e) {
|
}
|
||||||
if (this.result.hasNext) {
|
|
||||||
this.queryParams.page += 1;
|
|
||||||
this.isLoadMore = true;
|
|
||||||
this.fnGetData();
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '没有更多数据了'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
fnOnTabChange(index) {
|
|
||||||
this.dataList = [];
|
|
||||||
const _status = {
|
|
||||||
0: '',
|
|
||||||
1: 'PUBLISHED',
|
|
||||||
2: 'INTIMATE',
|
|
||||||
3: 'DRAFT',
|
|
||||||
4: 'RECYCLE'
|
|
||||||
};
|
};
|
||||||
this.queryParams.status = _status[index];
|
},
|
||||||
this.queryParams.page = 0;
|
onLoad() {
|
||||||
this.fnToTopPage();
|
this.fnSetPageTitle('文章管理');
|
||||||
|
this.fnGetCategoryList();
|
||||||
|
},
|
||||||
|
created() {
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
|
uni.$on('refresh-article-list', () => {
|
||||||
|
this.isLoadMore = false;
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
this.fnGetData();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 获取分类列表
|
onPullDownRefresh() {
|
||||||
fnGetCategoryList() {
|
|
||||||
this.category.loading = 'loading';
|
|
||||||
this.$httpApi.admin
|
|
||||||
.getCategoryList()
|
|
||||||
.then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
let _list = res.data;
|
|
||||||
_list.unshift({ id: undefined, name: '全部' });
|
|
||||||
this.category.list = _list;
|
|
||||||
this.category.loading = 'success';
|
|
||||||
} else {
|
|
||||||
this.category.loading = 'error';
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
this.category.loading = 'error';
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 显示分类选择
|
|
||||||
fnOnCategoryConfirm(e) {
|
|
||||||
this.category.selected = [e[0].index];
|
|
||||||
this.queryParams.categoryId = e[0].data.id;
|
|
||||||
},
|
|
||||||
fnOnSearch() {
|
|
||||||
this.queryParams.page = 0;
|
|
||||||
this.isLoadMore = false;
|
this.isLoadMore = false;
|
||||||
this.fnToTopPage();
|
this.queryParams.page = 0;
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
},
|
},
|
||||||
fnGetData() {
|
|
||||||
uni.showLoading({
|
|
||||||
mask: true,
|
|
||||||
title: '加载中...'
|
|
||||||
});
|
|
||||||
// 设置状态为加载中
|
|
||||||
if (!this.isLoadMore) {
|
|
||||||
this.loading = 'loading';
|
|
||||||
}
|
|
||||||
this.loadMoreText = '加载中...';
|
|
||||||
this.$httpApi.admin
|
|
||||||
.getPostsByPage(this.queryParams)
|
|
||||||
.then(res => {
|
|
||||||
console.log('请求结果:');
|
|
||||||
console.log(res);
|
|
||||||
if (res.status == 200) {
|
|
||||||
// 处理数据
|
|
||||||
this.result = res.data;
|
|
||||||
const _dataList = res.data.content.map(item => {
|
|
||||||
item.hasThumbnail = item.thumbnail != '';
|
|
||||||
if (item.thumbnail) {
|
|
||||||
item.thumbnail = this.$utils.checkThumbnailUrl(item.thumbnail);
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
});
|
|
||||||
if (this.isLoadMore) {
|
|
||||||
this.dataList = this.dataList.concat(_dataList);
|
|
||||||
} else {
|
|
||||||
this.dataList = _dataList;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loading = 'success';
|
onReachBottom(e) {
|
||||||
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
if (this.result.hasNext) {
|
||||||
} else {
|
this.queryParams.page += 1;
|
||||||
this.loading = 'error';
|
this.isLoadMore = true;
|
||||||
this.loadMoreText = '呜呜,加载失败了~';
|
this.fnGetData();
|
||||||
}
|
} else {
|
||||||
})
|
uni.showToast({
|
||||||
.catch(err => {
|
icon: 'none',
|
||||||
console.error(err);
|
title: '没有更多数据了'
|
||||||
this.loading = 'error';
|
|
||||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
}, 800);
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
// 跳转文章详情(预览)
|
fnOnTabChange(index) {
|
||||||
fnToArticleDetail(article) {
|
this.dataList = [];
|
||||||
uni.navigateTo({
|
const _status = {
|
||||||
url: '/pagesA/article-detail/article-detail?articleId=' + article.id,
|
0: '',
|
||||||
animationType: 'slide-in-right'
|
1: 'PUBLISHED',
|
||||||
});
|
2: 'INTIMATE',
|
||||||
},
|
3: 'DRAFT',
|
||||||
// 新增
|
4: 'RECYCLE'
|
||||||
fnOnAddArticle() {
|
};
|
||||||
this.$Router.push({ path: '/pagesB/articles/article-edit', query: {} });
|
this.queryParams.status = _status[index];
|
||||||
},
|
this.queryParams.page = 0;
|
||||||
// 文章编辑
|
this.fnToTopPage();
|
||||||
fnOnEditArticle(article) {
|
this.fnGetData();
|
||||||
this.$Router.push({ path: '/pagesB/articles/article-edit', query: { postsId: article.id } });
|
},
|
||||||
},
|
// 获取分类列表
|
||||||
// 设置文章信息
|
fnGetCategoryList() {
|
||||||
fnOnSetArticle(article, index) {
|
this.category.loading = 'loading';
|
||||||
this.$Router.push({ path: '/pagesB/articles/article-setting', query: { postsId: article.id, postTitle: article.title, isEdit: true, from: 'list' } });
|
this.$httpApi.admin
|
||||||
},
|
.getCategoryList()
|
||||||
// 删除文章
|
.then(res => {
|
||||||
fnOnDelArticle(article, index) {
|
if (res.status == 200) {
|
||||||
uni.$eShowModal({
|
let _list = res.data;
|
||||||
title: '提示',
|
_list.unshift({ id: undefined, name: '全部' });
|
||||||
content: '是否确定要删除该文章?',
|
this.category.list = _list;
|
||||||
showCancel: true,
|
this.category.loading = 'success';
|
||||||
cancelText: '否',
|
} else {
|
||||||
cancelColor: '#999999',
|
this.category.loading = 'error';
|
||||||
confirmText: '是',
|
}
|
||||||
confirmColor: '#03a9f4'
|
})
|
||||||
})
|
.catch(err => {
|
||||||
.then(res => {
|
this.category.loading = 'error';
|
||||||
uni.showLoading({
|
|
||||||
mask: true,
|
|
||||||
title: '删除中...'
|
|
||||||
});
|
});
|
||||||
this.$httpApi.admin
|
},
|
||||||
.deletePostsByIds([article.id])
|
// 显示分类选择
|
||||||
.then(res => {
|
fnOnCategoryConfirm(e) {
|
||||||
if (res.status == 200) {
|
this.fnResetSetAniWaitIndex();
|
||||||
uni.$tm.toast('文章已删除成功!');
|
this.category.selected = [e[0].index];
|
||||||
this.dataList.splice(index, 1);
|
this.queryParams.categoryId = e[0].data.id;
|
||||||
|
},
|
||||||
|
fnOnSearch() {
|
||||||
|
this.fnResetSetAniWaitIndex();
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
this.isLoadMore = false;
|
||||||
|
this.fnToTopPage();
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
fnGetData() {
|
||||||
|
uni.showLoading({
|
||||||
|
mask: true,
|
||||||
|
title: '加载中...'
|
||||||
|
});
|
||||||
|
// 设置状态为加载中
|
||||||
|
if (!this.isLoadMore) {
|
||||||
|
this.loading = 'loading';
|
||||||
|
}
|
||||||
|
this.loadMoreText = '加载中...';
|
||||||
|
this.$httpApi.admin
|
||||||
|
.getPostsByPage(this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
console.log('请求结果:');
|
||||||
|
console.log(res);
|
||||||
|
if (res.status == 200) {
|
||||||
|
// 处理数据
|
||||||
|
this.result = res.data;
|
||||||
|
const _dataList = res.data.content.map(item => {
|
||||||
|
item.hasThumbnail = item.thumbnail != '';
|
||||||
|
if (item.thumbnail) {
|
||||||
|
item.thumbnail = this.$utils.checkThumbnailUrl(item.thumbnail);
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
if (this.isLoadMore) {
|
||||||
|
this.dataList = this.dataList.concat(_dataList);
|
||||||
} else {
|
} else {
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
this.dataList = _dataList;
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.catch(err => {
|
this.loading = 'success';
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
|
} else {
|
||||||
|
this.loading = 'error';
|
||||||
|
this.loadMoreText = '呜呜,加载失败了~';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 800);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 跳转文章详情(预览)
|
||||||
|
fnToArticleDetail(article) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesA/article-detail/article-detail?articleId=' + article.id,
|
||||||
|
animationType: 'slide-in-right'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 新增
|
||||||
|
fnOnAddArticle() {
|
||||||
|
this.$Router.push({ path: '/pagesB/articles/article-edit', query: {} });
|
||||||
|
},
|
||||||
|
// 文章编辑
|
||||||
|
fnOnEditArticle(article) {
|
||||||
|
this.$Router.push({ path: '/pagesB/articles/article-edit', query: { postsId: article.id } });
|
||||||
|
},
|
||||||
|
// 设置文章信息
|
||||||
|
fnOnSetArticle(article, index) {
|
||||||
|
this.$Router.push({ path: '/pagesB/articles/article-setting', query: { postsId: article.id, postTitle: article.title, isEdit: 1, from: 'list' } });
|
||||||
|
},
|
||||||
|
// 删除文章
|
||||||
|
fnOnDelArticle(article, index) {
|
||||||
|
uni.$eShowModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否确定要删除该文章?',
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '否',
|
||||||
|
cancelColor: '#999999',
|
||||||
|
confirmText: '是',
|
||||||
|
confirmColor: '#03a9f4'
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
uni.showLoading({
|
||||||
|
mask: true,
|
||||||
|
title: '删除中...'
|
||||||
});
|
});
|
||||||
})
|
this.$httpApi.admin
|
||||||
.catch(err => {});
|
.deletePostsByIds([article.id])
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.$tm.toast('文章已删除成功!');
|
||||||
|
this.dataList.splice(index, 1);
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(err => {});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding-bottom: 24rpx;
|
padding-bottom: 24rpx;
|
||||||
background-color: #fafafd;
|
background-color: #fafafd;
|
||||||
|
|
||||||
&.is-balck {
|
&.is-balck {
|
||||||
background-color: #212121;
|
background-color: #212121;
|
||||||
}
|
|
||||||
}
|
|
||||||
.app-page-content {
|
|
||||||
box-sizing: border-box;
|
|
||||||
.content-empty {
|
|
||||||
height: 60vh;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.article-card {
|
|
||||||
box-sizing: border-box;
|
|
||||||
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.05);
|
|
||||||
.thumbnail {
|
|
||||||
width: 100%;
|
|
||||||
height: 280rpx;
|
|
||||||
&-img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: rgba(0, 0, 0, 0.03);
|
|
||||||
}
|
|
||||||
&-not {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: rgba(0, 0, 0, 0.03);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.title {
|
|
||||||
overflow: hidden;
|
.app-page-content {
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
word-wrap: break-word;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
.summary {
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
-webkit-line-clamp: 3;
|
|
||||||
overflow: hidden;
|
|
||||||
word-wrap: break-word;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
.foot {
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-top: 2rpx solid rgba(0, 0, 0, 0.03);
|
|
||||||
|
.content-empty {
|
||||||
|
height: 60vh;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
.article-card {
|
||||||
|
box-sizing: border-box;
|
||||||
|
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||||
|
|
||||||
|
.thumbnail {
|
||||||
|
width: 100%;
|
||||||
|
height: 280rpx;
|
||||||
|
|
||||||
|
&-img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(0, 0, 0, 0.03);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-not {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(0, 0, 0, 0.03);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
word-wrap: break-word;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary {
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 3;
|
||||||
|
overflow: hidden;
|
||||||
|
word-wrap: break-word;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.foot {
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-top: 2rpx solid rgba(0, 0, 0, 0.03);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+620
-636
File diff suppressed because it is too large
Load Diff
+283
-308
@@ -16,7 +16,7 @@
|
|||||||
<view v-if="dataList.length == 0" class="content-empty flex flex-center"><tm-empty icon="icon-shiliangzhinengduixiang-" label="无数据"></tm-empty></view>
|
<view v-if="dataList.length == 0" class="content-empty flex flex-center"><tm-empty icon="icon-shiliangzhinengduixiang-" label="无数据"></tm-empty></view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(category, index) in dataList" :key="index">
|
<block v-for="(category, index) in dataList" :key="index">
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<view class="category-card flex round-3 bg-white pa-24 mb-24" @click="fnShowFormModal(category)">
|
<view class="category-card flex round-3 bg-white pa-24 mb-24" @click="fnShowFormModal(category)">
|
||||||
<text class="del-icon flex flex-center" @click.stop="fnDelete(category, index)">×</text>
|
<text class="del-icon flex flex-center" @click.stop="fnDelete(category, index)">×</text>
|
||||||
<view class="left">
|
<view class="left">
|
||||||
@@ -52,49 +52,13 @@
|
|||||||
<view class="poup-content">
|
<view class="poup-content">
|
||||||
<view class="poup-head text-align-center text-weight-b text-size-g ma-24">{{ form.id != undefined ? '编辑分类' : '新增分类' }}</view>
|
<view class="poup-head text-align-center text-weight-b text-size-g ma-24">{{ form.id != undefined ? '编辑分类' : '新增分类' }}</view>
|
||||||
<scroll-view class="poup-body pa-24 pt-0" :scroll-y="true" @touchmove.stop>
|
<scroll-view class="poup-body pa-24 pt-0" :scroll-y="true" @touchmove.stop>
|
||||||
<tm-input
|
<tm-input required :adjust-position="true" :round="3" :borderBottom="false" title="名称" bg-color="grey-lighten-5" v-model="form.name" placeholder="请输入分类名称"></tm-input>
|
||||||
required
|
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
:borderBottom="false"
|
|
||||||
title="名称"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.name"
|
|
||||||
placeholder="请输入分类名称"
|
|
||||||
></tm-input>
|
|
||||||
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:页面上所显示的名称</view>
|
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:页面上所显示的名称</view>
|
||||||
<tm-input
|
<tm-input :borderBottom="false" :adjust-position="true" :round="3" title="别名" bg-color="grey-lighten-5" v-model="form.slug" placeholder="请输入分类别名"></tm-input>
|
||||||
:borderBottom="false"
|
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
title="别名"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.slug"
|
|
||||||
placeholder="请输入分类别名"
|
|
||||||
></tm-input>
|
|
||||||
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:一般为单个分类页面的标识,最好为英文</view>
|
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:一般为单个分类页面的标识,最好为英文</view>
|
||||||
<tm-input
|
<tm-input :borderBottom="false" :adjust-position="true" :round="3" title="密码" bg-color="grey-lighten-5" v-model="form.password" placeholder="请输入分类密码"></tm-input>
|
||||||
:borderBottom="false"
|
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
title="密码"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.password"
|
|
||||||
placeholder="请输入分类密码"
|
|
||||||
></tm-input>
|
|
||||||
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:分类的访问密码</view>
|
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:分类的访问密码</view>
|
||||||
<tm-input
|
<tm-input :borderBottom="false" :vertical="true" :adjust-position="true" inputType="textarea" :round="3" title="描述" :height="160" bg-color="grey-lighten-5" v-model="form.description" placeholder="请输入分类描述"></tm-input>
|
||||||
:borderBottom="false"
|
|
||||||
:vertical="true"
|
|
||||||
:adjust-position="true"
|
|
||||||
inputType="textarea"
|
|
||||||
:round="3"
|
|
||||||
title="描述"
|
|
||||||
:height="160"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.description"
|
|
||||||
placeholder="请输入分类描述"
|
|
||||||
></tm-input>
|
|
||||||
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:分类的描述信息</view>
|
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:分类的描述信息</view>
|
||||||
<view class="ma-30 mt-12 pb-12">
|
<view class="ma-30 mt-12 pb-12">
|
||||||
<view class="mb-12">
|
<view class="mb-12">
|
||||||
@@ -122,207 +86,163 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
||||||
import tmInput from '@/tm-vuetify/components/tm-input/tm-input.vue';
|
import tmInput from '@/tm-vuetify/components/tm-input/tm-input.vue';
|
||||||
import AttachmentSelect from '@/components/attachment-select/attachment-select.vue';
|
import AttachmentSelect from '@/components/attachment-select/attachment-select.vue';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmButton,
|
tmButton,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmPoup,
|
tmPoup,
|
||||||
tmInput,
|
tmInput,
|
||||||
AttachmentSelect
|
AttachmentSelect
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: 'loading',
|
|
||||||
queryParams: {
|
|
||||||
size: 10,
|
|
||||||
page: 0,
|
|
||||||
more: true
|
|
||||||
},
|
|
||||||
dataList: [],
|
|
||||||
poupShow: false,
|
|
||||||
attachmentsSelectShow: false,
|
|
||||||
form: {
|
|
||||||
description: undefined,
|
|
||||||
password: undefined,
|
|
||||||
createTime: undefined,
|
|
||||||
fullPath: undefined,
|
|
||||||
id: undefined,
|
|
||||||
name: '',
|
|
||||||
slug: undefined,
|
|
||||||
thumbnail: undefined,
|
|
||||||
showThumbnail: undefined
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
onLoad() {
|
|
||||||
this.fnSetPageTitle('分类管理');
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
this.isLoadMore = false;
|
|
||||||
this.queryParams.page = 0;
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
fnGetData() {
|
|
||||||
uni.showLoading({
|
|
||||||
mask: true,
|
|
||||||
title: '加载中...'
|
|
||||||
});
|
|
||||||
// 设置状态为加载中
|
|
||||||
if (!this.isLoadMore) {
|
|
||||||
this.loading = 'loading';
|
|
||||||
}
|
|
||||||
this.loadMoreText = '加载中...';
|
|
||||||
this.$httpApi.admin
|
|
||||||
.getCategoryList(this.queryParams)
|
|
||||||
.then(res => {
|
|
||||||
console.log('getCategoryList:');
|
|
||||||
console.log(res);
|
|
||||||
if (res.status == 200) {
|
|
||||||
this.loading = 'success';
|
|
||||||
this.dataList = res.data.map(item => {
|
|
||||||
if (item.thumbnail) {
|
|
||||||
item['showThumbnail'] = this.$utils.checkThumbnailUrl(item.thumbnail);
|
|
||||||
} else {
|
|
||||||
item['showThumbnail'] = '';
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.loading = 'error';
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(this.dataList);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
this.loading = 'error';
|
|
||||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
}, 800);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
fnSelectColor() {
|
return {
|
||||||
this.$refs.colorPicker.open();
|
loading: 'loading',
|
||||||
},
|
queryParams: {
|
||||||
|
size: 10,
|
||||||
fnOnConfirmSelectColor(e) {
|
page: 0,
|
||||||
this.selectColor = e.rgba;
|
more: true
|
||||||
this.$set(this.form, 'color', e.hex);
|
},
|
||||||
},
|
dataList: [],
|
||||||
fnOnAttachmentsSelectClose() {
|
poupShow: false,
|
||||||
this.attachmentsSelectShow = false;
|
attachmentsSelectShow: false,
|
||||||
},
|
form: {
|
||||||
fnOnPoupChange(e) {
|
description: undefined,
|
||||||
if (!e) {
|
password: undefined,
|
||||||
this.fnResetForm();
|
createTime: undefined,
|
||||||
}
|
fullPath: undefined,
|
||||||
},
|
id: undefined,
|
||||||
// 监听附件选择
|
name: '',
|
||||||
fnOnAttachmentsSelect(file) {
|
slug: undefined,
|
||||||
this.form.thumbnail = file.path;
|
thumbnail: undefined,
|
||||||
this.form.showThumbnail = this.$utils.checkThumbnailUrl(file.path);
|
showThumbnail: undefined
|
||||||
this.attachmentsSelectShow = false;
|
|
||||||
},
|
|
||||||
fnShowFormModal(category) {
|
|
||||||
if (category) {
|
|
||||||
this.form = Object.assign({}, {}, category);
|
|
||||||
if (category.thumbnail) {
|
|
||||||
this.form.showThumbnail = this.$utils.checkThumbnailUrl(category.thumbnail);
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
this.fnResetForm();
|
|
||||||
}
|
|
||||||
this.poupShow = true;
|
|
||||||
},
|
|
||||||
fnResetForm() {
|
|
||||||
this.form = {
|
|
||||||
color: undefined,
|
|
||||||
createTime: undefined,
|
|
||||||
fullPath: undefined,
|
|
||||||
id: undefined,
|
|
||||||
name: '',
|
|
||||||
slug: undefined,
|
|
||||||
thumbnail: undefined,
|
|
||||||
showThumbnail: undefined
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
fnSubmit() {
|
|
||||||
if (this.form.name.trim() == '') {
|
onLoad() {
|
||||||
return uni.$tm.toast('分类名称未填写!');
|
this.fnSetPageTitle('分类管理');
|
||||||
}
|
|
||||||
if (this.form.id == undefined) {
|
|
||||||
this.$httpApi.admin
|
|
||||||
.createCategory(this.form)
|
|
||||||
.then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
uni.$tm.toast(`保存成功!`);
|
|
||||||
uni.startPullDownRefresh();
|
|
||||||
} else {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.$httpApi.admin
|
|
||||||
.updateCategoryById(this.form.id, this.form)
|
|
||||||
.then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
uni.$tm.toast(`保存成功!`);
|
|
||||||
let updateIndex = this.dataList.findIndex(x => x.id == this.form.id);
|
|
||||||
this.$set(this.dataList, updateIndex, this.form);
|
|
||||||
} else {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// 删除
|
created() {
|
||||||
fnDelete(category) {
|
this.fnGetData();
|
||||||
const _category = category || this.form;
|
},
|
||||||
uni.$eShowModal({
|
onPullDownRefresh() {
|
||||||
title: '提示',
|
this.isLoadMore = false;
|
||||||
content: `您是否要将 ${_category.name} 的分类删除?`,
|
this.queryParams.page = 0;
|
||||||
showCancel: true,
|
this.fnGetData();
|
||||||
cancelText: '否',
|
},
|
||||||
cancelColor: '#999999',
|
|
||||||
confirmText: '是',
|
methods: {
|
||||||
confirmColor: '#03a9f4'
|
fnGetData() {
|
||||||
})
|
uni.showLoading({
|
||||||
.then(res => {
|
mask: true,
|
||||||
|
title: '加载中...'
|
||||||
|
});
|
||||||
|
// 设置状态为加载中
|
||||||
|
if (!this.isLoadMore) {
|
||||||
|
this.loading = 'loading';
|
||||||
|
}
|
||||||
|
this.loadMoreText = '加载中...';
|
||||||
|
this.$httpApi.admin
|
||||||
|
.getCategoryList(this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
console.log('getCategoryList:');
|
||||||
|
console.log(res);
|
||||||
|
if (res.status == 200) {
|
||||||
|
this.loading = 'success';
|
||||||
|
this.dataList = res.data.map(item => {
|
||||||
|
if (item.thumbnail) {
|
||||||
|
item['showThumbnail'] = this.$utils.checkThumbnailUrl(item.thumbnail);
|
||||||
|
} else {
|
||||||
|
item['showThumbnail'] = '';
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.loading = 'error';
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(this.dataList);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 800);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
fnSelectColor() {
|
||||||
|
this.$refs.colorPicker.open();
|
||||||
|
},
|
||||||
|
|
||||||
|
fnOnConfirmSelectColor(e) {
|
||||||
|
this.selectColor = e.rgba;
|
||||||
|
this.$set(this.form, 'color', e.hex);
|
||||||
|
},
|
||||||
|
fnOnAttachmentsSelectClose() {
|
||||||
|
this.attachmentsSelectShow = false;
|
||||||
|
},
|
||||||
|
fnOnPoupChange(e) {
|
||||||
|
if (!e) {
|
||||||
|
this.fnResetForm();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 监听附件选择
|
||||||
|
fnOnAttachmentsSelect(file) {
|
||||||
|
this.form.thumbnail = file.path;
|
||||||
|
this.form.showThumbnail = this.$utils.checkThumbnailUrl(file.path);
|
||||||
|
this.attachmentsSelectShow = false;
|
||||||
|
},
|
||||||
|
fnShowFormModal(category) {
|
||||||
|
if (category) {
|
||||||
|
this.form = Object.assign({}, {}, category);
|
||||||
|
if (category.thumbnail) {
|
||||||
|
this.form.showThumbnail = this.$utils.checkThumbnailUrl(category.thumbnail);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.fnResetForm();
|
||||||
|
}
|
||||||
|
this.poupShow = true;
|
||||||
|
},
|
||||||
|
fnResetForm() {
|
||||||
|
this.form = {
|
||||||
|
color: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
fullPath: undefined,
|
||||||
|
id: undefined,
|
||||||
|
name: '',
|
||||||
|
slug: undefined,
|
||||||
|
thumbnail: undefined,
|
||||||
|
showThumbnail: undefined
|
||||||
|
};
|
||||||
|
},
|
||||||
|
fnSubmit() {
|
||||||
|
if (this.form.name.trim() == '') {
|
||||||
|
return uni.$tm.toast('分类名称未填写!');
|
||||||
|
}
|
||||||
|
if (this.form.id == undefined) {
|
||||||
this.$httpApi.admin
|
this.$httpApi.admin
|
||||||
.deleteCategoryById(_category.id)
|
.createCategory(this.form)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
uni.$tm.toast(`${_category.name} 分类已删除!`);
|
uni.$tm.toast(`保存成功!`);
|
||||||
const delIndex = this.dataList.findIndex(x => x.id == _category.id);
|
uni.startPullDownRefresh();
|
||||||
this.dataList.splice(delIndex, 1);
|
|
||||||
} else {
|
} else {
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
}
|
}
|
||||||
@@ -330,91 +250,146 @@ export default {
|
|||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
});
|
});
|
||||||
})
|
} else {
|
||||||
.catch(err => {});
|
this.$httpApi.admin
|
||||||
|
.updateCategoryById(this.form.id, this.form)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.$tm.toast(`保存成功!`);
|
||||||
|
let updateIndex = this.dataList.findIndex(x => x.id == this.form.id);
|
||||||
|
this.$set(this.dataList, updateIndex, this.form);
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
fnDelete(category) {
|
||||||
|
const _category = category || this.form;
|
||||||
|
uni.$eShowModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `您是否要将 ${_category.name} 的分类删除?`,
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '否',
|
||||||
|
cancelColor: '#999999',
|
||||||
|
confirmText: '是',
|
||||||
|
confirmColor: '#03a9f4'
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
this.$httpApi.admin
|
||||||
|
.deleteCategoryById(_category.id)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.$tm.toast(`${_category.name} 分类已删除!`);
|
||||||
|
const delIndex = this.dataList.findIndex(x => x.id == _category.id);
|
||||||
|
this.dataList.splice(delIndex, 1);
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(err => {});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
|
||||||
.loading-wrap {
|
|
||||||
.loading-error {
|
|
||||||
height: 65vh;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.content-empty {
|
|
||||||
width: 100%;
|
|
||||||
height: 60vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.poup-content {
|
.loading-wrap {
|
||||||
overflow: hidden;
|
.loading-error {
|
||||||
}
|
height: 65vh;
|
||||||
.poup-body {
|
|
||||||
height: 71vh;
|
|
||||||
box-sizing: border-box;
|
|
||||||
touch-action: none;
|
|
||||||
}
|
|
||||||
.thumbnail {
|
|
||||||
width: 100%;
|
|
||||||
height: 260rpx;
|
|
||||||
}
|
|
||||||
.category-card {
|
|
||||||
position: relative;
|
|
||||||
box-sizing: border-box;
|
|
||||||
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
|
||||||
.del-icon {
|
|
||||||
width: 46rpx;
|
|
||||||
height: 46rpx;
|
|
||||||
position: absolute;
|
|
||||||
right: 24rpx;
|
|
||||||
top: 24rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border: 4rpx solid #fff;
|
|
||||||
background-color: #ff8177;
|
|
||||||
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.05);
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.left {
|
|
||||||
width: 200rpx;
|
|
||||||
height: 190rpx;
|
|
||||||
|
|
||||||
.cover {
|
|
||||||
width: 100%;
|
|
||||||
height: inherit;
|
|
||||||
background-color: #607d8b;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.right {
|
|
||||||
width: 0;
|
.content-empty {
|
||||||
flex-grow: 1;
|
width: 100%;
|
||||||
|
height: 60vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.poup-content {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.poup-body {
|
||||||
|
height: 71vh;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
.color {
|
touch-action: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thumbnail {
|
||||||
|
width: 100%;
|
||||||
|
height: 260rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.category-card {
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
|
|
||||||
|
.del-icon {
|
||||||
|
width: 46rpx;
|
||||||
|
height: 46rpx;
|
||||||
|
position: absolute;
|
||||||
|
right: 24rpx;
|
||||||
|
top: 24rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border: 4rpx solid #fff;
|
||||||
|
background-color: #ff8177;
|
||||||
|
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||||
|
font-size: 32rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.desc-box {
|
.left {
|
||||||
box-sizing: border-box;
|
width: 200rpx;
|
||||||
.label {
|
height: 190rpx;
|
||||||
width: 86rpx;
|
|
||||||
|
.cover {
|
||||||
|
width: 100%;
|
||||||
|
height: inherit;
|
||||||
|
background-color: #607d8b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
width: 0;
|
||||||
|
flex-grow: 1;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.color {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.value {
|
|
||||||
width: 0;
|
.desc-box {
|
||||||
flex-grow: 1;
|
box-sizing: border-box;
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
.label {
|
||||||
text-overflow: ellipsis;
|
width: 86rpx;
|
||||||
word-wrap: break-word;
|
}
|
||||||
word-break: break-all;
|
|
||||||
|
.value {
|
||||||
|
width: 0;
|
||||||
|
flex-grow: 1;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
word-wrap: break-word;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
</style>
|
||||||
</style>
|
|
||||||
+331
-335
@@ -19,7 +19,7 @@
|
|||||||
<view v-if="dataList.length == 0" class="content-empty flex flex-center"><tm-empty icon="icon-shiliangzhinengduixiang-" label="无数据"></tm-empty></view>
|
<view v-if="dataList.length == 0" class="content-empty flex flex-center"><tm-empty icon="icon-shiliangzhinengduixiang-" label="无数据"></tm-empty></view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(comment, index) in dataList" :key="index">
|
<block v-for="(comment, index) in dataList" :key="index">
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<view class="comment-card bg-white round-3 pt-24 pb-24">
|
<view class="comment-card bg-white round-3 pt-24 pb-24">
|
||||||
<view class="head flex flex-between pl-24 pr-24">
|
<view class="head flex flex-between pl-24 pr-24">
|
||||||
<view class="left flex flex-center">
|
<view class="left flex flex-center">
|
||||||
@@ -96,17 +96,7 @@
|
|||||||
<view class="mb-24">评论内容</view>
|
<view class="mb-24">评论内容</view>
|
||||||
<view class="pa-24 pt-12 pb-12 grey-lighten-5 text-grey round-3">{{ reply.data.content }}</view>
|
<view class="pa-24 pt-12 pb-12 grey-lighten-5 text-grey round-3">{{ reply.data.content }}</view>
|
||||||
</view>
|
</view>
|
||||||
<tm-input
|
<tm-input :vertical="true" :borderBottom="false" input-type="textarea" title="我的回复" bg-color="grey-lighten-5" v-model="reply.form.content" :height="150" :focus="true" :adjustPosition="true"></tm-input>
|
||||||
:vertical="true"
|
|
||||||
:borderBottom="false"
|
|
||||||
input-type="textarea"
|
|
||||||
title="我的回复"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="reply.form.content"
|
|
||||||
:height="150"
|
|
||||||
:focus="true"
|
|
||||||
:adjustPosition="true"
|
|
||||||
></tm-input>
|
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<view class="btn-wrap flex flex-center">
|
<view class="btn-wrap flex flex-center">
|
||||||
<!-- 审核状态 -->
|
<!-- 审核状态 -->
|
||||||
@@ -129,348 +119,354 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
||||||
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
||||||
import tmInput from '@/tm-vuetify/components/tm-input/tm-input.vue';
|
import tmInput from '@/tm-vuetify/components/tm-input/tm-input.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmButton,
|
tmButton,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
tmTabs,
|
tmTabs,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmTags,
|
tmTags,
|
||||||
tmPoup,
|
tmPoup,
|
||||||
tmInput
|
tmInput
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: 'loading',
|
|
||||||
tab: {
|
|
||||||
adtiveIndex: 0,
|
|
||||||
list: ['文章评论', '页面评论', '日记评论']
|
|
||||||
},
|
|
||||||
queryParams: {
|
|
||||||
size: 10,
|
|
||||||
page: 0
|
|
||||||
},
|
|
||||||
result: {},
|
|
||||||
dataList: [],
|
|
||||||
queryType: 'Posts',
|
|
||||||
isLoadMore: false,
|
|
||||||
loadMoreText: '加载中...',
|
|
||||||
reply: {
|
|
||||||
show: false,
|
|
||||||
data: {},
|
|
||||||
form: {
|
|
||||||
allowNotification: true,
|
|
||||||
author: '',
|
|
||||||
authorUrl: '',
|
|
||||||
content: '',
|
|
||||||
email: '',
|
|
||||||
parentId: 0,
|
|
||||||
postId: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
// 获取博主信息
|
|
||||||
bloggerInfo() {
|
|
||||||
return this.$tm.vx.getters().blogger.getBlogger;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.fnSetPageTitle('评论管理');
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.fnGetData();
|
|
||||||
console.log(this.bloggerInfo);
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
this.isLoadMore = false;
|
|
||||||
this.queryParams.page = 0;
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
onReachBottom(e) {
|
|
||||||
if (this.result.hasNext) {
|
|
||||||
this.queryParams.page += 1;
|
|
||||||
this.isLoadMore = true;
|
|
||||||
this.fnGetData();
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '没有更多数据了'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
fnOnTabChange(index) {
|
|
||||||
this.fnResetReply();
|
|
||||||
this.dataList = [];
|
|
||||||
this.queryType = ['Posts', 'Sheets', 'Journals'][index];
|
|
||||||
this.fnToTopPage();
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
fnGetData() {
|
return {
|
||||||
uni.showLoading({
|
loading: 'loading',
|
||||||
mask: true,
|
tab: {
|
||||||
title: '加载中...'
|
adtiveIndex: 0,
|
||||||
});
|
list: ['文章评论', '页面评论', '日记评论']
|
||||||
// 设置状态为加载中
|
},
|
||||||
if (!this.isLoadMore) {
|
queryParams: {
|
||||||
this.loading = 'loading';
|
size: 10,
|
||||||
}
|
page: 0
|
||||||
this.loadMoreText = '加载中...';
|
},
|
||||||
this.$httpApi.admin[`get${this.queryType}Comments`](this.queryParams)
|
result: {},
|
||||||
.then(res => {
|
dataList: [],
|
||||||
console.log('请求结果:');
|
queryType: 'Posts',
|
||||||
console.log(res);
|
isLoadMore: false,
|
||||||
|
loadMoreText: '加载中...',
|
||||||
this.loading = 'success';
|
reply: {
|
||||||
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
show: false,
|
||||||
const _list = res.data.content.map(x => {
|
data: {},
|
||||||
x.avatar = this.$utils.checkAvatarUrl(x.avatar, x.isAdmin);
|
form: {
|
||||||
return x;
|
allowNotification: true,
|
||||||
});
|
author: '',
|
||||||
// 处理数据
|
authorUrl: '',
|
||||||
this.result = res.data;
|
content: '',
|
||||||
if (this.isLoadMore) {
|
email: '',
|
||||||
this.dataList = this.dataList.concat(_list);
|
parentId: 0,
|
||||||
} else {
|
postId: 0
|
||||||
this.dataList = _list;
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
this.loading = 'error';
|
|
||||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
}, 800);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fnShowReplyModal(comment) {
|
|
||||||
this.reply.data = comment;
|
|
||||||
this.reply.form.parentId = comment.id;
|
|
||||||
switch (this.queryType) {
|
|
||||||
case 'Posts':
|
|
||||||
this.reply.form.postId = comment.post.id;
|
|
||||||
break;
|
|
||||||
case 'Sheets':
|
|
||||||
this.reply.form.postId = comment.sheet.id;
|
|
||||||
break;
|
|
||||||
case 'Journals':
|
|
||||||
this.reply.form.postId = comment.journal.id;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
this.reply.show = true;
|
|
||||||
},
|
|
||||||
fnResetReply() {
|
|
||||||
this.reply = {
|
|
||||||
show: false,
|
|
||||||
data: {},
|
|
||||||
form: {
|
|
||||||
allowNotification: true,
|
|
||||||
author: '',
|
|
||||||
authorUrl: '',
|
|
||||||
content: '',
|
|
||||||
email: '',
|
|
||||||
parentId: 0,
|
|
||||||
postId: 0
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
// 审核通过
|
computed: {
|
||||||
fnReplyPass(comment) {
|
// 获取博主信息
|
||||||
uni.$eShowModal({
|
bloggerInfo() {
|
||||||
title: '提示',
|
return this.$tm.vx.getters().getBlogger;
|
||||||
content: `您是否要通过 ${comment.author} 的评论?`,
|
}
|
||||||
showCancel: true,
|
|
||||||
cancelText: '否',
|
|
||||||
cancelColor: '#999999',
|
|
||||||
confirmText: '是',
|
|
||||||
confirmColor: '#03a9f4'
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
this.$httpApi.admin[`update${this.queryType}CommentsStatus`](comment.id, 'PUBLISHED')
|
|
||||||
.then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
uni.$tm.toast(`操作成功!`);
|
|
||||||
comment.status = 'PUBLISHED';
|
|
||||||
// uni.startPullDownRefresh();
|
|
||||||
} else {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(err => {});
|
|
||||||
},
|
},
|
||||||
// 回复评论
|
onLoad() {
|
||||||
fnReplySubmit() {
|
this.fnSetPageTitle('评论管理');
|
||||||
this.reply.form.author = this.bloggerInfo.nickname;
|
},
|
||||||
this.reply.form.authorUrl = this.$haloConfig.social.blog || this.$haloConfig.apiUrl;
|
created() {
|
||||||
this.reply.form.email = this.bloggerInfo.email;
|
this.fnGetData();
|
||||||
|
},
|
||||||
uni.showLoading({
|
onPullDownRefresh() {
|
||||||
title: '正在回复中...'
|
this.isLoadMore = false;
|
||||||
});
|
this.queryParams.page = 0;
|
||||||
this.$httpApi.admin[`post${this.queryType}Comments`](this.reply.form)
|
this.fnGetData();
|
||||||
.then(res => {
|
},
|
||||||
if (res.status == 200) {
|
onReachBottom(e) {
|
||||||
uni.$tm.toast('回复成功');
|
if (this.result.hasNext) {
|
||||||
this.fnResetReply();
|
this.queryParams.page += 1;
|
||||||
this.fnToTopPage();
|
this.isLoadMore = true;
|
||||||
uni.startPullDownRefresh();
|
this.fnGetData();
|
||||||
} else {
|
} else {
|
||||||
uni.$tm.toast('回复失败,请重试!');
|
uni.showToast({
|
||||||
}
|
icon: 'none',
|
||||||
})
|
title: '没有更多数据了'
|
||||||
.catch(err => {
|
|
||||||
uni.$tm.toast('回复失败,请重试!');
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 还原
|
methods: {
|
||||||
fnRestore(comment) {
|
fnOnTabChange(index) {
|
||||||
uni.$eShowModal({
|
this.fnResetSetAniWaitIndex();
|
||||||
title: '提示',
|
this.fnResetReply();
|
||||||
content: `您是否要将 ${comment.author} 的评论还原?`,
|
this.dataList = [];
|
||||||
showCancel: true,
|
this.queryType = ['Posts', 'Sheets', 'Journals'][index];
|
||||||
cancelText: '否',
|
this.fnToTopPage();
|
||||||
cancelColor: '#999999',
|
this.fnGetData();
|
||||||
confirmText: '是',
|
},
|
||||||
confirmColor: '#03a9f4'
|
|
||||||
})
|
fnGetData() {
|
||||||
.then(res => {
|
uni.showLoading({
|
||||||
this.$httpApi.admin[`update${this.queryType}CommentsStatus`](comment.id, 'PUBLISHED')
|
mask: true,
|
||||||
.then(res => {
|
title: '加载中...'
|
||||||
if (res.status == 200) {
|
});
|
||||||
uni.$tm.toast(`已将 ${comment.author} 的评论还原!`);
|
// 设置状态为加载中
|
||||||
// uni.startPullDownRefresh();
|
if (!this.isLoadMore) {
|
||||||
comment.status = 'PUBLISHED';
|
this.loading = 'loading';
|
||||||
} else {
|
}
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
this.loadMoreText = '加载中...';
|
||||||
}
|
this.$httpApi.admin[`get${this.queryType}Comments`](this.queryParams)
|
||||||
})
|
.then(res => {
|
||||||
.catch(err => {
|
console.log('请求结果:');
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
console.log(res);
|
||||||
|
|
||||||
|
this.loading = 'success';
|
||||||
|
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
|
const _list = res.data.content.map(x => {
|
||||||
|
x.avatar = this.$utils.checkAvatarUrl(x.avatar, x.isAdmin);
|
||||||
|
return x;
|
||||||
});
|
});
|
||||||
})
|
// 处理数据
|
||||||
.catch(err => {});
|
this.result = res.data;
|
||||||
},
|
if (this.isLoadMore) {
|
||||||
// 移到回收站
|
this.dataList = this.dataList.concat(_list);
|
||||||
fnRecycle(comment) {
|
} else {
|
||||||
uni.$eShowModal({
|
this.dataList = _list;
|
||||||
title: '提示',
|
}
|
||||||
content: `您是否要将 ${comment.author} 的评论移到回收站?`,
|
})
|
||||||
showCancel: true,
|
.catch(err => {
|
||||||
cancelText: '否',
|
console.error(err);
|
||||||
cancelColor: '#999999',
|
this.loading = 'error';
|
||||||
confirmText: '是',
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
confirmColor: '#03a9f4'
|
})
|
||||||
})
|
.finally(() => {
|
||||||
.then(res => {
|
setTimeout(() => {
|
||||||
this.$httpApi.admin[`update${this.queryType}CommentsStatus`](comment.id, 'RECYCLE')
|
uni.hideLoading();
|
||||||
.then(res => {
|
uni.stopPullDownRefresh();
|
||||||
if (res.status == 200) {
|
}, 800);
|
||||||
uni.$tm.toast(`已将 ${comment.author} 的评论移到回收站!`);
|
});
|
||||||
comment.status = 'RECYCLE';
|
},
|
||||||
// uni.startPullDownRefresh();
|
fnShowReplyModal(comment) {
|
||||||
} else {
|
this.reply.data = comment;
|
||||||
|
this.reply.form.parentId = comment.id;
|
||||||
|
switch (this.queryType) {
|
||||||
|
case 'Posts':
|
||||||
|
this.reply.form.postId = comment.post.id;
|
||||||
|
break;
|
||||||
|
case 'Sheets':
|
||||||
|
this.reply.form.postId = comment.sheet.id;
|
||||||
|
break;
|
||||||
|
case 'Journals':
|
||||||
|
this.reply.form.postId = comment.journal.id;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.reply.show = true;
|
||||||
|
},
|
||||||
|
fnResetReply() {
|
||||||
|
this.reply = {
|
||||||
|
show: false,
|
||||||
|
data: {},
|
||||||
|
form: {
|
||||||
|
allowNotification: true,
|
||||||
|
author: '',
|
||||||
|
authorUrl: '',
|
||||||
|
content: '',
|
||||||
|
email: '',
|
||||||
|
parentId: 0,
|
||||||
|
postId: 0
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
// 审核通过
|
||||||
|
fnReplyPass(comment) {
|
||||||
|
uni.$eShowModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `您是否要通过 ${comment.author} 的评论?`,
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '否',
|
||||||
|
cancelColor: '#999999',
|
||||||
|
confirmText: '是',
|
||||||
|
confirmColor: '#03a9f4'
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
this.$httpApi.admin[`update${this.queryType}CommentsStatus`](comment.id, 'PUBLISHED')
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.$tm.toast(`操作成功!`);
|
||||||
|
comment.status = 'PUBLISHED';
|
||||||
|
// uni.startPullDownRefresh();
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
}
|
});
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {});
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
},
|
||||||
});
|
// 回复评论
|
||||||
})
|
fnReplySubmit() {
|
||||||
.catch(err => {});
|
this.reply.form.author = this.bloggerInfo.nickname;
|
||||||
},
|
this.reply.form.authorUrl = this.$haloConfig.social.blog || this.$haloConfig.apiUrl;
|
||||||
// 删除评论(永久删除)
|
this.reply.form.email = this.bloggerInfo.email;
|
||||||
fnDelete(comment) {
|
|
||||||
uni.$eShowModal({
|
uni.showLoading({
|
||||||
title: '提示',
|
title: '正在回复中...'
|
||||||
content: `您是否要将 ${comment.author} 的评论删除?`,
|
});
|
||||||
showCancel: true,
|
this.$httpApi.admin[`post${this.queryType}Comments`](this.reply.form)
|
||||||
cancelText: '否',
|
.then(res => {
|
||||||
cancelColor: '#999999',
|
if (res.status == 200) {
|
||||||
confirmText: '是',
|
uni.$tm.toast('回复成功');
|
||||||
confirmColor: '#03a9f4'
|
this.fnResetReply();
|
||||||
})
|
this.fnToTopPage();
|
||||||
.then(res => {
|
uni.startPullDownRefresh();
|
||||||
this.$httpApi.admin[`delete${this.queryType}CommentsById`](comment.id)
|
} else {
|
||||||
.then(res => {
|
uni.$tm.toast('回复失败,请重试!');
|
||||||
if (res.status == 200) {
|
}
|
||||||
uni.$tm.toast(`${comment.author} 的评论已删除!`);
|
})
|
||||||
const delIndex = this.dataList.findIndex(x => x.id == comment.id);
|
.catch(err => {
|
||||||
this.dataList.splice(delIndex, 1);
|
uni.$tm.toast('回复失败,请重试!');
|
||||||
// uni.startPullDownRefresh();
|
});
|
||||||
} else {
|
},
|
||||||
|
// 还原
|
||||||
|
fnRestore(comment) {
|
||||||
|
uni.$eShowModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `您是否要将 ${comment.author} 的评论还原?`,
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '否',
|
||||||
|
cancelColor: '#999999',
|
||||||
|
confirmText: '是',
|
||||||
|
confirmColor: '#03a9f4'
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
this.$httpApi.admin[`update${this.queryType}CommentsStatus`](comment.id, 'PUBLISHED')
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.$tm.toast(`已将 ${comment.author} 的评论还原!`);
|
||||||
|
// uni.startPullDownRefresh();
|
||||||
|
comment.status = 'PUBLISHED';
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
}
|
});
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {});
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
},
|
||||||
});
|
// 移到回收站
|
||||||
})
|
fnRecycle(comment) {
|
||||||
.catch(err => {});
|
uni.$eShowModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `您是否要将 ${comment.author} 的评论移到回收站?`,
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '否',
|
||||||
|
cancelColor: '#999999',
|
||||||
|
confirmText: '是',
|
||||||
|
confirmColor: '#03a9f4'
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
this.$httpApi.admin[`update${this.queryType}CommentsStatus`](comment.id, 'RECYCLE')
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.$tm.toast(`已将 ${comment.author} 的评论移到回收站!`);
|
||||||
|
comment.status = 'RECYCLE';
|
||||||
|
// uni.startPullDownRefresh();
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(err => {});
|
||||||
|
},
|
||||||
|
// 删除评论(永久删除)
|
||||||
|
fnDelete(comment) {
|
||||||
|
uni.$eShowModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `您是否要将 ${comment.author} 的评论删除?`,
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '否',
|
||||||
|
cancelColor: '#999999',
|
||||||
|
confirmText: '是',
|
||||||
|
confirmColor: '#03a9f4'
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
this.$httpApi.admin[`delete${this.queryType}CommentsById`](comment.id)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.$tm.toast(`${comment.author} 的评论已删除!`);
|
||||||
|
const delIndex = this.dataList.findIndex(x => x.id == comment.id);
|
||||||
|
this.dataList.splice(delIndex, 1);
|
||||||
|
// uni.startPullDownRefresh();
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(err => {});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
|
||||||
.loading-wrap {
|
|
||||||
padding: 24rpx;
|
|
||||||
.loading-error {
|
|
||||||
height: 65vh;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.content-empty {
|
|
||||||
width: 100%;
|
|
||||||
height: 60vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.comment-card {
|
.loading-wrap {
|
||||||
box-sizing: border-box;
|
padding: 24rpx;
|
||||||
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.05);
|
|
||||||
margin-bottom: 24rpx;
|
|
||||||
|
|
||||||
.avatar {
|
.loading-error {
|
||||||
width: 56rpx;
|
height: 65vh;
|
||||||
height: 56rpx;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-empty {
|
||||||
|
width: 100%;
|
||||||
|
height: 60vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-card {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 4rpx solid #fff;
|
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||||
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.15);
|
margin-bottom: 24rpx;
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
width: 56rpx;
|
||||||
|
height: 56rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border: 4rpx solid #fff;
|
||||||
|
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-content {
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.comment-content {
|
|
||||||
line-height: 1.6;
|
.poup-content {
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.poup-content {
|
.poup-body {
|
||||||
overflow: hidden;
|
height: 60vh;
|
||||||
}
|
box-sizing: border-box;
|
||||||
.poup-body {
|
}
|
||||||
height: 60vh;
|
</style>
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -177,7 +177,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
journalInfo() {
|
journalInfo() {
|
||||||
return uni.$tm.vx.getters().journal.getJournalInfo;
|
return uni.$tm.vx.getters().getJournalInfo;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
|||||||
+127
-132
@@ -17,16 +17,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(journal, index) in dataList" :key="journal.id">
|
<block v-for="(journal, index) in dataList" :key="journal.id">
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<journal-card
|
<journal-card :isAdmin="true" :journal="journal" :useLike="false" :useEdit="true" :useDel="true" @on-del="fnOnJournalDel" @on-edit="fnOnJournalEdit"></journal-card>
|
||||||
:isAdmin="true"
|
|
||||||
:journal="journal"
|
|
||||||
:useLike="false"
|
|
||||||
:useEdit="true"
|
|
||||||
:useDel="true"
|
|
||||||
@on-del="fnOnJournalDel"
|
|
||||||
@on-edit="fnOnJournalEdit"
|
|
||||||
></journal-card>
|
|
||||||
</tm-translate>
|
</tm-translate>
|
||||||
</block>
|
</block>
|
||||||
<tm-flotbutton :offset="[16, 80]" @click="fnToTopPage" color="light-blue" size="m" icon="icon-angle-up"></tm-flotbutton>
|
<tm-flotbutton :offset="[16, 80]" @click="fnToTopPage" color="light-blue" size="m" icon="icon-angle-up"></tm-flotbutton>
|
||||||
@@ -38,139 +30,142 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmButton,
|
tmButton,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
tmFlotbutton
|
tmFlotbutton
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: 'loading',
|
loading: 'loading',
|
||||||
queryParams: {
|
queryParams: {
|
||||||
size: 10,
|
size: 10,
|
||||||
page: 0
|
page: 0
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
status: true,
|
status: true,
|
||||||
content: '',
|
content: '',
|
||||||
keepRaw: true,
|
keepRaw: true,
|
||||||
sourceContent: '',
|
sourceContent: '',
|
||||||
type: 'PUBLIC'
|
type: 'PUBLIC'
|
||||||
},
|
},
|
||||||
result: {},
|
result: {},
|
||||||
dataList: [],
|
dataList: [],
|
||||||
isLoadMore: false,
|
isLoadMore: false,
|
||||||
loadMoreText: '加载中...'
|
loadMoreText: '加载中...'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fnSetPageTitle('日记管理');
|
this.fnSetPageTitle('日记管理');
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
uni.$on('journals_refresh', () => {
|
uni.$on('journals_refresh', () => {
|
||||||
|
this.isLoadMore = false;
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
this.fnGetData(false);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
this.isLoadMore = false;
|
this.isLoadMore = false;
|
||||||
this.queryParams.page = 0;
|
this.queryParams.page = 0;
|
||||||
this.fnGetData(false);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
this.isLoadMore = false;
|
|
||||||
this.queryParams.page = 0;
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
onReachBottom(e) {
|
|
||||||
if (this.result.hasNext) {
|
|
||||||
this.queryParams.page += 1;
|
|
||||||
this.isLoadMore = true;
|
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '没有更多数据了'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 调用编辑操作
|
|
||||||
fnOnToolBarEdit(e) {
|
|
||||||
this.$refs.article[e.currentTarget.dataset.method]();
|
|
||||||
},
|
},
|
||||||
fnGetData(useTip = true) {
|
onReachBottom(e) {
|
||||||
if (useTip) {
|
if (this.result.hasNext) {
|
||||||
uni.showLoading({
|
this.queryParams.page += 1;
|
||||||
mask: true,
|
this.isLoadMore = true;
|
||||||
title: '加载中...'
|
this.fnGetData();
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '没有更多数据了'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 设置状态为加载中
|
},
|
||||||
if (!this.isLoadMore) {
|
methods: {
|
||||||
this.loading = 'loading';
|
// 调用编辑操作
|
||||||
}
|
fnOnToolBarEdit(e) {
|
||||||
this.loadMoreText = '加载中...';
|
this.$refs.article[e.currentTarget.dataset.method]();
|
||||||
this.$httpApi
|
},
|
||||||
.getJournals(this.queryParams)
|
fnGetData(useTip = true) {
|
||||||
.then(res => {
|
if (useTip) {
|
||||||
this.loading = 'success';
|
uni.showLoading({
|
||||||
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
mask: true,
|
||||||
// 处理数据
|
title: '加载中...'
|
||||||
this.result = res.data;
|
});
|
||||||
if (this.isLoadMore) {
|
}
|
||||||
this.dataList = this.dataList.concat(res.data.content);
|
// 设置状态为加载中
|
||||||
} else {
|
if (!this.isLoadMore) {
|
||||||
this.dataList = res.data.content;
|
this.loading = 'loading';
|
||||||
}
|
}
|
||||||
this.loading = 'success';
|
this.loadMoreText = '加载中...';
|
||||||
})
|
this.$httpApi
|
||||||
.catch(err => {
|
.getJournals(this.queryParams)
|
||||||
console.error(err);
|
.then(res => {
|
||||||
this.loading = 'error';
|
this.loading = 'success';
|
||||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
})
|
// 处理数据
|
||||||
.finally(() => {
|
this.result = res.data;
|
||||||
setTimeout(() => {
|
if (this.isLoadMore) {
|
||||||
uni.hideLoading();
|
this.dataList = this.dataList.concat(res.data.content);
|
||||||
uni.stopPullDownRefresh();
|
} else {
|
||||||
}, 500);
|
this.dataList = res.data.content;
|
||||||
|
}
|
||||||
|
this.loading = 'success';
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fnOnJournalDel(journal) {
|
||||||
|
this.dataList.splice(this.dataList.findIndex(x => x.id == journal.id), 1);
|
||||||
|
},
|
||||||
|
fnOnJournalEdit(data) {
|
||||||
|
uni.$tm.vx.commit('journal/setJournalInfo', data);
|
||||||
|
this.$Router.push({
|
||||||
|
path: '/pagesB/journal/journal-edit',
|
||||||
|
query: data
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
fnOnJournalDel(journal) {
|
|
||||||
this.dataList.splice(this.dataList.findIndex(x => x.id == journal.id), 1);
|
|
||||||
},
|
|
||||||
fnOnJournalEdit(data) {
|
|
||||||
uni.$tm.vx.commit('journal/setJournalInfo', data);
|
|
||||||
this.$Router.push({
|
|
||||||
path: '/pagesB/journal/journal-edit',
|
|
||||||
query: data
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
|
||||||
.loading-wrap {
|
|
||||||
padding: 24rpx;
|
|
||||||
.loading-error {
|
|
||||||
height: 40vh;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.edit-wrap {
|
.loading-wrap {
|
||||||
box-sizing: border-box;
|
padding: 24rpx;
|
||||||
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.05);
|
|
||||||
}
|
.loading-error {
|
||||||
</style>
|
height: 40vh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-wrap {
|
||||||
|
box-sizing: border-box;
|
||||||
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+286
-317
@@ -23,10 +23,12 @@
|
|||||||
<view v-if="filterList.lenght == 0" class="empty"><tm-empty icon="icon-wind-cry" label="无数据"></tm-empty></view>
|
<view v-if="filterList.lenght == 0" class="empty"><tm-empty icon="icon-wind-cry" label="无数据"></tm-empty></view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(item, index) in filterList" :key="index">
|
<block v-for="(item, index) in filterList" :key="index">
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<view class="link-card round-3 bg-white flex flex-col mt-24 ml-24 mr-24 pa-24">
|
<view class="link-card round-3 bg-white flex flex-col mt-24 ml-24 mr-24 pa-24">
|
||||||
<view class="head flex">
|
<view class="head flex">
|
||||||
<view class="left round-2 flex flex-col flex-center"><image class="logo round-2 " :src="item.logo" mode="aspectFill"></image></view>
|
<view class="left round-2 flex flex-col flex-center">
|
||||||
|
<image class="logo round-2 " :src="item.logo" mode="aspectFill"></image>
|
||||||
|
</view>
|
||||||
<view class="right pl-24 text-size-m">
|
<view class="right pl-24 text-size-m">
|
||||||
<view class="title flex flex-between ">
|
<view class="title flex flex-between ">
|
||||||
<view class="name flex text-overflow mr-6 text-weight-b">
|
<view class="name flex text-overflow mr-6 text-weight-b">
|
||||||
@@ -71,27 +73,9 @@
|
|||||||
<view class="poup-content">
|
<view class="poup-content">
|
||||||
<view class="poup-head text-align-center text-weight-b text-size-g ma-24">{{ form.id != undefined ? '编辑友链' : '新增友链' }}</view>
|
<view class="poup-head text-align-center text-weight-b text-size-g ma-24">{{ form.id != undefined ? '编辑友链' : '新增友链' }}</view>
|
||||||
<scroll-view class="poup-body pa-24 pt-0" :scroll-y="true" @touchmove.stop>
|
<scroll-view class="poup-body pa-24 pt-0" :scroll-y="true" @touchmove.stop>
|
||||||
<tm-input
|
<tm-input required :adjust-position="true" :round="3" :borderBottom="false" title="网站名称" bg-color="grey-lighten-5" v-model="form.name" placeholder="请输入网站名称"></tm-input>
|
||||||
required
|
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
:borderBottom="false"
|
|
||||||
title="网站名称"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.name"
|
|
||||||
placeholder="请输入网站名称"
|
|
||||||
></tm-input>
|
|
||||||
|
|
||||||
<tm-input
|
<tm-input required :borderBottom="false" :adjust-position="true" :round="3" title="网站地址" bg-color="grey-lighten-5" v-model="form.url" placeholder="请输入网站地址"></tm-input>
|
||||||
required
|
|
||||||
:borderBottom="false"
|
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
title="网站地址"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.url"
|
|
||||||
placeholder="请输入网站地址"
|
|
||||||
></tm-input>
|
|
||||||
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:需要加上 http://</view>
|
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:需要加上 http://</view>
|
||||||
|
|
||||||
<tm-input :borderBottom="false" :round="3" bg-color="grey-lighten-5" title="网站分组" placeholder="请输入选择网站分组" :value="form.team">
|
<tm-input :borderBottom="false" :round="3" bg-color="grey-lighten-5" title="网站分组" placeholder="请输入选择网站分组" :value="form.team">
|
||||||
@@ -101,38 +85,10 @@
|
|||||||
</tm-pickers>
|
</tm-pickers>
|
||||||
</template>
|
</template>
|
||||||
</tm-input>
|
</tm-input>
|
||||||
<tm-input
|
<tm-input input-type="number" :borderBottom="false" :adjust-position="true" :round="3" title="排序编号" bg-color="grey-lighten-5" v-model.number="form.priority" placeholder="请输入排序"></tm-input>
|
||||||
input-type="number"
|
<tm-input :borderBottom="false" :vertical="true" :adjust-position="true" inputType="textarea" :round="3" title="网站描述" :height="120" bg-color="grey-lighten-5" v-model="form.description" placeholder="请输入描述"></tm-input>
|
||||||
:borderBottom="false"
|
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
title="排序编号"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model.number="form.priority"
|
|
||||||
placeholder="请输入排序"
|
|
||||||
></tm-input>
|
|
||||||
<tm-input
|
|
||||||
:borderBottom="false"
|
|
||||||
:vertical="true"
|
|
||||||
:adjust-position="true"
|
|
||||||
inputType="textarea"
|
|
||||||
:round="3"
|
|
||||||
title="网站描述"
|
|
||||||
:height="120"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.description"
|
|
||||||
placeholder="请输入描述"
|
|
||||||
></tm-input>
|
|
||||||
|
|
||||||
<tm-input
|
<tm-input :borderBottom="false" :adjust-position="true" :round="3" title="LOGO" bg-color="grey-lighten-5" v-model="form.logo" placeholder="请输入LOGO地址"></tm-input>
|
||||||
:borderBottom="false"
|
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
title="LOGO"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.logo"
|
|
||||||
placeholder="请输入LOGO地址"
|
|
||||||
></tm-input>
|
|
||||||
<view class="ma-30 mt-12 pb-12 bg-grey">
|
<view class="ma-30 mt-12 pb-12 bg-grey">
|
||||||
<image v-if="form.logo" class="thumbnail round-3" :src="form.logo" mode="aspectFill" @click="$utils.previewImage([form.logo])"></image>
|
<image v-if="form.logo" class="thumbnail round-3" :src="form.logo" mode="aspectFill" @click="$utils.previewImage([form.logo])"></image>
|
||||||
<view v-else class="thumbnail round-3 text-grey grey-lighten-5 flex flex-col flex-center ">
|
<view v-else class="thumbnail round-3 text-grey grey-lighten-5 flex flex-col flex-center ">
|
||||||
@@ -153,215 +109,172 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
||||||
import tmInput from '@/tm-vuetify/components/tm-input/tm-input.vue';
|
import tmInput from '@/tm-vuetify/components/tm-input/tm-input.vue';
|
||||||
import tmPickers from '@/tm-vuetify/components/tm-pickers/tm-pickers.vue';
|
import tmPickers from '@/tm-vuetify/components/tm-pickers/tm-pickers.vue';
|
||||||
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
||||||
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmButton,
|
tmButton,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmPoup,
|
tmPoup,
|
||||||
tmInput,
|
tmInput,
|
||||||
tmPickers,
|
tmPickers,
|
||||||
tmTags,
|
tmTags,
|
||||||
tmTabs,
|
tmTabs,
|
||||||
tmTranslate
|
tmTranslate
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: 'loading',
|
|
||||||
queryParams: {
|
|
||||||
size: 10,
|
|
||||||
page: 0
|
|
||||||
},
|
|
||||||
dataList: [],
|
|
||||||
filterList: [],
|
|
||||||
poupShow: false,
|
|
||||||
form: {
|
|
||||||
id: undefined,
|
|
||||||
description: '',
|
|
||||||
logo: '',
|
|
||||||
name: '',
|
|
||||||
team: '',
|
|
||||||
url: '',
|
|
||||||
priority: 0
|
|
||||||
},
|
|
||||||
tab: {
|
|
||||||
activeIndex: 0,
|
|
||||||
list: []
|
|
||||||
},
|
|
||||||
selectTeam: [],
|
|
||||||
teamList: []
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
onLoad() {
|
|
||||||
this.fnSetPageTitle('友链管理');
|
|
||||||
this.fnGetTeamData();
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
fnOnTabChange(index) {
|
|
||||||
this.fnToTopPage();
|
|
||||||
let _filterData = [];
|
|
||||||
if (index == 0) {
|
|
||||||
_filterData = this.dataList;
|
|
||||||
} else {
|
|
||||||
_filterData = this.dataList.filter(x => x.team == this.teamList[index - 1]);
|
|
||||||
}
|
|
||||||
this.filterList = JSON.parse(JSON.stringify(_filterData));
|
|
||||||
},
|
},
|
||||||
fnGetTeamData() {
|
data() {
|
||||||
this.$httpApi.admin
|
return {
|
||||||
.getLinkTeamList()
|
loading: 'loading',
|
||||||
.then(res => {
|
queryParams: {
|
||||||
if (res.status == 200) {
|
size: 10,
|
||||||
this.tab.list = ['全部', ...res.data];
|
page: 0
|
||||||
this.teamList = res.data;
|
},
|
||||||
} else {
|
dataList: [],
|
||||||
uni.$tm.toast('友链分组数据加载失败!');
|
filterList: [],
|
||||||
}
|
poupShow: false,
|
||||||
})
|
form: {
|
||||||
.catch(err => {
|
id: undefined,
|
||||||
uni.$tm.toast('友链分组数据加载失败!');
|
description: '',
|
||||||
});
|
logo: '',
|
||||||
},
|
name: '',
|
||||||
fnGetData() {
|
team: '',
|
||||||
this.loading = 'loading';
|
url: '',
|
||||||
uni.showLoading({
|
priority: 0
|
||||||
mask: true,
|
},
|
||||||
title: '加载中...'
|
tab: {
|
||||||
});
|
activeIndex: 0,
|
||||||
this.tab.activeIndex = 0;
|
list: []
|
||||||
this.$httpApi.admin
|
},
|
||||||
.getLinkList(this.queryParams)
|
selectTeam: [],
|
||||||
.then(res => {
|
teamList: []
|
||||||
if (res.status == 200) {
|
|
||||||
const _dataList = res.data.map(item => {
|
|
||||||
item.logo = this.$utils.checkUrl(item.logo);
|
|
||||||
return item;
|
|
||||||
});
|
|
||||||
this.dataList = _dataList;
|
|
||||||
this.filterList = _dataList;
|
|
||||||
this.loading = 'success';
|
|
||||||
} else {
|
|
||||||
this.loading = 'error';
|
|
||||||
uni.$tm.toast('加载失败,请重试!');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
this.loading = 'error';
|
|
||||||
uni.$tm.toast('加载失败,请重试!');
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fnOnPoupChange(e) {
|
|
||||||
if (!e) {
|
|
||||||
this.fnResetForm();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fnShowFormModal(link) {
|
|
||||||
if (link) {
|
|
||||||
this.form = Object.assign({}, {}, link);
|
|
||||||
if (link.team) {
|
|
||||||
this.selectTeam = [link.team];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.fnResetForm();
|
|
||||||
}
|
|
||||||
this.poupShow = true;
|
|
||||||
},
|
|
||||||
fnOnSelectTeam(e) {
|
|
||||||
this.form.team = e[0].data;
|
|
||||||
this.selectTeam = [e[0].data];
|
|
||||||
},
|
|
||||||
fnResetForm() {
|
|
||||||
this.form = {
|
|
||||||
id: undefined,
|
|
||||||
description: '',
|
|
||||||
logo: '',
|
|
||||||
name: '',
|
|
||||||
team: '',
|
|
||||||
url: '',
|
|
||||||
priority: 0
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
fnSubmit() {
|
|
||||||
if (this.form.name.trim() == '') {
|
onLoad() {
|
||||||
return uni.$tm.toast('友链名称未填写!');
|
this.fnSetPageTitle('友链管理');
|
||||||
}
|
this.fnGetTeamData();
|
||||||
if (this.form.id == undefined) {
|
|
||||||
this.$httpApi.admin
|
|
||||||
.addLink(this.form)
|
|
||||||
.then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
uni.$tm.toast(`保存成功!`);
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.startPullDownRefresh();
|
|
||||||
}, 1200);
|
|
||||||
} else {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.$httpApi.admin
|
|
||||||
.updateLink(this.form.id, this.form)
|
|
||||||
.then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
uni.$tm.toast(`保存成功!`);
|
|
||||||
let updateIndex = this.dataList.findIndex(x => x.id == this.form.id);
|
|
||||||
this.$set(this.dataList, updateIndex, this.form);
|
|
||||||
} else {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// 删除
|
created() {
|
||||||
fnDelete(link) {
|
this.fnGetData();
|
||||||
const _link = link || this.form;
|
},
|
||||||
uni.$eShowModal({
|
onPullDownRefresh() {
|
||||||
title: '提示',
|
this.fnGetData();
|
||||||
content: `您是否要将 ${_link.name} 删除?`,
|
},
|
||||||
showCancel: true,
|
methods: {
|
||||||
cancelText: '否',
|
fnOnTabChange(index) {
|
||||||
cancelColor: '#999999',
|
this.fnResetSetAniWaitIndex();
|
||||||
confirmText: '是',
|
this.fnToTopPage();
|
||||||
confirmColor: '#03a9f4'
|
let _filterData = [];
|
||||||
})
|
if (index == 0) {
|
||||||
.then(res => {
|
_filterData = this.dataList;
|
||||||
|
} else {
|
||||||
|
_filterData = this.dataList.filter(x => x.team == this.teamList[index - 1]);
|
||||||
|
}
|
||||||
|
this.filterList = JSON.parse(JSON.stringify(_filterData));
|
||||||
|
},
|
||||||
|
fnGetTeamData() {
|
||||||
|
this.$httpApi.admin
|
||||||
|
.getLinkTeamList()
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
this.tab.list = ['全部', ...res.data];
|
||||||
|
this.teamList = res.data;
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('友链分组数据加载失败!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
uni.$tm.toast('友链分组数据加载失败!');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fnGetData() {
|
||||||
|
this.loading = 'loading';
|
||||||
|
uni.showLoading({
|
||||||
|
mask: true,
|
||||||
|
title: '加载中...'
|
||||||
|
});
|
||||||
|
this.tab.activeIndex = 0;
|
||||||
|
this.$httpApi.admin
|
||||||
|
.getLinkList(this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
const _dataList = res.data.map(item => {
|
||||||
|
item.logo = this.$utils.checkUrl(item.logo);
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
this.dataList = _dataList;
|
||||||
|
this.filterList = _dataList;
|
||||||
|
this.loading = 'success';
|
||||||
|
} else {
|
||||||
|
this.loading = 'error';
|
||||||
|
uni.$tm.toast('加载失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
uni.$tm.toast('加载失败,请重试!');
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fnOnPoupChange(e) {
|
||||||
|
if (!e) {
|
||||||
|
this.fnResetForm();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fnShowFormModal(link) {
|
||||||
|
if (link) {
|
||||||
|
this.form = Object.assign({}, {}, link);
|
||||||
|
if (link.team) {
|
||||||
|
this.selectTeam = [link.team];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.fnResetForm();
|
||||||
|
}
|
||||||
|
this.poupShow = true;
|
||||||
|
},
|
||||||
|
fnOnSelectTeam(e) {
|
||||||
|
this.form.team = e[0].data;
|
||||||
|
this.selectTeam = [e[0].data];
|
||||||
|
},
|
||||||
|
fnResetForm() {
|
||||||
|
this.form = {
|
||||||
|
id: undefined,
|
||||||
|
description: '',
|
||||||
|
logo: '',
|
||||||
|
name: '',
|
||||||
|
team: '',
|
||||||
|
url: '',
|
||||||
|
priority: 0
|
||||||
|
};
|
||||||
|
},
|
||||||
|
fnSubmit() {
|
||||||
|
if (this.form.name.trim() == '') {
|
||||||
|
return uni.$tm.toast('友链名称未填写!');
|
||||||
|
}
|
||||||
|
if (this.form.id == undefined) {
|
||||||
this.$httpApi.admin
|
this.$httpApi.admin
|
||||||
.deleteLink(_link.id)
|
.addLink(this.form)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
uni.$tm.toast(`${_link.name} 已删除!`);
|
uni.$tm.toast(`保存成功!`);
|
||||||
const delIndex = this.dataList.findIndex(x => x.id == _link.id);
|
setTimeout(() => {
|
||||||
this.dataList.splice(delIndex, 1);
|
uni.startPullDownRefresh();
|
||||||
|
}, 1200);
|
||||||
} else {
|
} else {
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
}
|
}
|
||||||
@@ -369,78 +282,134 @@ export default {
|
|||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
});
|
});
|
||||||
})
|
} else {
|
||||||
.catch(err => {});
|
this.$httpApi.admin
|
||||||
|
.updateLink(this.form.id, this.form)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.$tm.toast(`保存成功!`);
|
||||||
|
let updateIndex = this.dataList.findIndex(x => x.id == this.form.id);
|
||||||
|
this.$set(this.dataList, updateIndex, this.form);
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
fnDelete(link) {
|
||||||
|
const _link = link || this.form;
|
||||||
|
uni.$eShowModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `您是否要将 ${_link.name} 删除?`,
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '否',
|
||||||
|
cancelColor: '#999999',
|
||||||
|
confirmText: '是',
|
||||||
|
confirmColor: '#03a9f4'
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
this.$httpApi.admin
|
||||||
|
.deleteLink(_link.id)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.$tm.toast(`${_link.name} 已删除!`);
|
||||||
|
const delIndex = this.dataList.findIndex(x => x.id == _link.id);
|
||||||
|
this.dataList.splice(delIndex, 1);
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(err => {});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
|
||||||
.loading-wrap {
|
|
||||||
padding: 24rpx;
|
|
||||||
.loading-error {
|
|
||||||
height: 65vh;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.link-card {
|
|
||||||
box-sizing: border-box;
|
|
||||||
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
|
||||||
.head {
|
|
||||||
.left {
|
|
||||||
width: 166rpx;
|
|
||||||
height: 166rpx;
|
|
||||||
.logo {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.right {
|
|
||||||
width: 0;
|
|
||||||
flex-grow: 1;
|
|
||||||
|
|
||||||
.name {
|
.loading-wrap {
|
||||||
width: 0;
|
padding: 24rpx;
|
||||||
flex-grow: 1;
|
|
||||||
display: flex;
|
.loading-error {
|
||||||
align-items: center;
|
height: 65vh;
|
||||||
}
|
|
||||||
.label {
|
|
||||||
width: 84rpx;
|
|
||||||
}
|
|
||||||
.value {
|
|
||||||
width: 0;
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.foot {
|
|
||||||
|
.link-card {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
// border-top: 2rpx solid rgba(0, 0, 0, 0.03);
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
|
|
||||||
|
.head {
|
||||||
|
.left {
|
||||||
|
width: 166rpx;
|
||||||
|
height: 166rpx;
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
width: 0;
|
||||||
|
flex-grow: 1;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
width: 0;
|
||||||
|
flex-grow: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
width: 84rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
width: 0;
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.foot {
|
||||||
|
box-sizing: border-box;
|
||||||
|
// border-top: 2rpx solid rgba(0, 0, 0, 0.03);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.poup-content {
|
.poup-content {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.poup-body {
|
|
||||||
height: 71vh;
|
|
||||||
box-sizing: border-box;
|
|
||||||
touch-action: none;
|
|
||||||
}
|
|
||||||
.thumbnail {
|
|
||||||
width: 100%;
|
|
||||||
height: 260rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.update-btn {
|
.poup-body {
|
||||||
background-color: rgba(240, 250, 255, 1);
|
height: 71vh;
|
||||||
}
|
box-sizing: border-box;
|
||||||
.del-btn {
|
touch-action: none;
|
||||||
background-color: rgba(254, 241, 240, 1) !important;
|
}
|
||||||
}
|
|
||||||
</style>
|
.thumbnail {
|
||||||
|
width: 100%;
|
||||||
|
height: 260rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.update-btn {
|
||||||
|
background-color: rgba(240, 250, 255, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.del-btn {
|
||||||
|
background-color: rgba(254, 241, 240, 1) !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -85,7 +85,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
bloggerInfo() {
|
bloggerInfo() {
|
||||||
return this.$tm.vx.getters().blogger.getBlogger;
|
return this.$tm.vx.getters().getBlogger;
|
||||||
},
|
},
|
||||||
showCopyright() {
|
showCopyright() {
|
||||||
return getApp().globalData.showCopyright;
|
return getApp().globalData.showCopyright;
|
||||||
|
|||||||
+234
-228
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(item, index) in dataList" :key="index">
|
<block v-for="(item, index) in dataList" :key="index">
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<view class="card mb-24 bg-white pa-24 round-3">
|
<view class="card mb-24 bg-white pa-24 round-3">
|
||||||
<view class="border-b-1 pb-20 text-size-l text-weight-b">
|
<view class="border-b-1 pb-20 text-size-l text-weight-b">
|
||||||
<tm-tags :dense="true" :shadow="0" color="bg-gradient-light-blue-accent" size="s" model="fill">ID:{{ item.id }}</tm-tags>
|
<tm-tags :dense="true" :shadow="0" color="bg-gradient-light-blue-accent" size="s" model="fill">ID:{{ item.id }}</tm-tags>
|
||||||
@@ -59,245 +59,251 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
||||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
tmButton,
|
tmButton,
|
||||||
tmTags,
|
tmTags,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmTranslate
|
tmTranslate
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: 'loading',
|
loading: 'loading',
|
||||||
|
|
||||||
queryParams: {
|
queryParams: {
|
||||||
size: 8,
|
size: 8,
|
||||||
page: 0,
|
page: 0,
|
||||||
sort: undefined
|
sort: undefined
|
||||||
},
|
},
|
||||||
|
|
||||||
result: {},
|
result: {},
|
||||||
dataList: [],
|
dataList: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
isLoadMore: false,
|
isLoadMore: false,
|
||||||
loadMoreText: '加载中...'
|
loadMoreText: '加载中...'
|
||||||
};
|
|
||||||
},
|
|
||||||
filters: {
|
|
||||||
formatLogType(val) {
|
|
||||||
const logTypes = {
|
|
||||||
BLOG_INITIALIZED: {
|
|
||||||
value: 0,
|
|
||||||
text: '博客初始化'
|
|
||||||
},
|
|
||||||
POST_PUBLISHED: {
|
|
||||||
value: 5,
|
|
||||||
text: '文章发布'
|
|
||||||
},
|
|
||||||
POST_EDITED: {
|
|
||||||
value: 15,
|
|
||||||
text: '文章修改'
|
|
||||||
},
|
|
||||||
POST_DELETED: {
|
|
||||||
value: 20,
|
|
||||||
text: '文章删除'
|
|
||||||
},
|
|
||||||
LOGGED_IN: {
|
|
||||||
value: 25,
|
|
||||||
text: '用户登录'
|
|
||||||
},
|
|
||||||
LOGGED_OUT: {
|
|
||||||
value: 30,
|
|
||||||
text: '注销登录'
|
|
||||||
},
|
|
||||||
LOGIN_FAILED: {
|
|
||||||
value: 35,
|
|
||||||
text: '登录失败'
|
|
||||||
},
|
|
||||||
PASSWORD_UPDATED: {
|
|
||||||
value: 40,
|
|
||||||
text: '修改密码'
|
|
||||||
},
|
|
||||||
PROFILE_UPDATED: {
|
|
||||||
value: 45,
|
|
||||||
text: '资料修改'
|
|
||||||
},
|
|
||||||
SHEET_PUBLISHED: {
|
|
||||||
value: 50,
|
|
||||||
text: '页面发布'
|
|
||||||
},
|
|
||||||
SHEET_EDITED: {
|
|
||||||
value: 55,
|
|
||||||
text: '页面修改'
|
|
||||||
},
|
|
||||||
SHEET_DELETED: {
|
|
||||||
value: 60,
|
|
||||||
text: '页面删除'
|
|
||||||
},
|
|
||||||
MFA_UPDATED: {
|
|
||||||
value: 65,
|
|
||||||
text: '两步验证'
|
|
||||||
},
|
|
||||||
LOGGED_PRE_CHECK: {
|
|
||||||
value: 70,
|
|
||||||
text: '登录验证'
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
return logTypes[val].text;
|
},
|
||||||
}
|
filters: {
|
||||||
},
|
formatLogType(val) {
|
||||||
|
const logTypes = {
|
||||||
onLoad() {
|
BLOG_INITIALIZED: {
|
||||||
this.fnSetPageTitle('日志管理');
|
value: 0,
|
||||||
},
|
text: '博客初始化'
|
||||||
created() {
|
},
|
||||||
this.fnGetData();
|
POST_PUBLISHED: {
|
||||||
},
|
value: 5,
|
||||||
onPullDownRefresh() {
|
text: '文章发布'
|
||||||
this.queryParams.page = 0;
|
},
|
||||||
this.dataList = [];
|
POST_EDITED: {
|
||||||
this.fnGetData();
|
value: 15,
|
||||||
},
|
text: '文章修改'
|
||||||
onReachBottom(e) {
|
},
|
||||||
if (this.result.hasNext) {
|
POST_DELETED: {
|
||||||
this.queryParams.page += 1;
|
value: 20,
|
||||||
this.isLoadMore = true;
|
text: '文章删除'
|
||||||
this.fnGetData();
|
},
|
||||||
} else {
|
LOGGED_IN: {
|
||||||
uni.showToast({
|
value: 25,
|
||||||
icon: 'none',
|
text: '用户登录'
|
||||||
title: '没有更多数据了'
|
},
|
||||||
});
|
LOGGED_OUT: {
|
||||||
}
|
value: 30,
|
||||||
},
|
text: '注销登录'
|
||||||
methods: {
|
},
|
||||||
fnGetData() {
|
LOGIN_FAILED: {
|
||||||
uni.showLoading({
|
value: 35,
|
||||||
mask: true,
|
text: '登录失败'
|
||||||
title: '加载中...'
|
},
|
||||||
});
|
PASSWORD_UPDATED: {
|
||||||
// 设置状态为加载中
|
value: 40,
|
||||||
if (!this.isLoadMore) {
|
text: '修改密码'
|
||||||
this.loading = 'loading';
|
},
|
||||||
}
|
PROFILE_UPDATED: {
|
||||||
this.loadMoreText = '加载中...';
|
value: 45,
|
||||||
this.$httpApi.admin
|
text: '资料修改'
|
||||||
.getLogsListByPage(this.queryParams)
|
},
|
||||||
.then(res => {
|
SHEET_PUBLISHED: {
|
||||||
if (res.status == 200) {
|
value: 50,
|
||||||
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
text: '页面发布'
|
||||||
this.result = res.data;
|
},
|
||||||
this.total = res.data.total;
|
SHEET_EDITED: {
|
||||||
const _tempDataList = res.data.content.map(item => {
|
value: 55,
|
||||||
item['time'] = uni.$tm.dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss');
|
text: '页面修改'
|
||||||
return item;
|
},
|
||||||
});
|
SHEET_DELETED: {
|
||||||
if (this.isLoadMore) {
|
value: 60,
|
||||||
this.dataList = this.dataList.concat(_tempDataList);
|
text: '页面删除'
|
||||||
} else {
|
},
|
||||||
this.dataList = _tempDataList;
|
MFA_UPDATED: {
|
||||||
}
|
value: 65,
|
||||||
this.loading = 'success';
|
text: '两步验证'
|
||||||
} else {
|
},
|
||||||
uni.$tm.toast('加载失败,请重试!');
|
LOGGED_PRE_CHECK: {
|
||||||
thi.loading = 'error';
|
value: 70,
|
||||||
|
text: '登录验证'
|
||||||
}
|
}
|
||||||
})
|
};
|
||||||
.catch(err => {
|
return logTypes[val].text;
|
||||||
console.error(err);
|
}
|
||||||
uni.$tm.toast('加载失败,请重试!');
|
|
||||||
this.loading = 'error';
|
|
||||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
}, 300);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除
|
onLoad() {
|
||||||
fnOnClear() {
|
this.fnSetPageTitle('日志管理');
|
||||||
uni.$eShowModal({
|
},
|
||||||
title: '提示',
|
created() {
|
||||||
content: `您确定要清空所有的日志记录吗?`,
|
this.fnGetData();
|
||||||
showCancel: true,
|
},
|
||||||
cancelText: '否',
|
onPullDownRefresh() {
|
||||||
cancelColor: '#999999',
|
this.queryParams.page = 0;
|
||||||
confirmText: '是',
|
this.dataList = [];
|
||||||
confirmColor: '#03a9f4'
|
this.fnGetData();
|
||||||
})
|
},
|
||||||
.then(res => {
|
onReachBottom(e) {
|
||||||
uni.showLoading({
|
if (this.result.hasNext) {
|
||||||
mask: true,
|
this.queryParams.page += 1;
|
||||||
title: '正在清空...'
|
this.isLoadMore = true;
|
||||||
});
|
this.fnGetData();
|
||||||
this.$httpApi.admin
|
} else {
|
||||||
.deleteAllLogs()
|
uni.showToast({
|
||||||
.then(res => {
|
icon: 'none',
|
||||||
if (res.status == 200) {
|
title: '没有更多数据了'
|
||||||
uni.$tm.toast('操作成功!');
|
});
|
||||||
setTimeout(() => {
|
}
|
||||||
this.queryParams.page = 0;
|
},
|
||||||
this.dataList = [];
|
methods: {
|
||||||
this.fnGetData();
|
fnGetData() {
|
||||||
}, 1000);
|
uni.showLoading({
|
||||||
|
mask: true,
|
||||||
|
title: '加载中...'
|
||||||
|
});
|
||||||
|
// 设置状态为加载中
|
||||||
|
if (!this.isLoadMore) {
|
||||||
|
this.loading = 'loading';
|
||||||
|
}
|
||||||
|
this.loadMoreText = '加载中...';
|
||||||
|
this.$httpApi.admin
|
||||||
|
.getLogsListByPage(this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
|
this.result = res.data;
|
||||||
|
this.total = res.data.total;
|
||||||
|
const _tempDataList = res.data.content.map(item => {
|
||||||
|
item['time'] = uni.$tm.dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
if (this.isLoadMore) {
|
||||||
|
this.dataList = this.dataList.concat(_tempDataList);
|
||||||
} else {
|
} else {
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
this.dataList = _tempDataList;
|
||||||
}
|
}
|
||||||
})
|
this.loading = 'success';
|
||||||
.catch(err => {
|
} else {
|
||||||
console.error(err);
|
uni.$tm.toast('加载失败,请重试!');
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
thi.loading = 'error';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
uni.$tm.toast('加载失败,请重试!');
|
||||||
|
this.loading = 'error';
|
||||||
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 300);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
fnOnClear() {
|
||||||
|
uni.$eShowModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `您确定要清空所有的日志记录吗?`,
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '否',
|
||||||
|
cancelColor: '#999999',
|
||||||
|
confirmText: '是',
|
||||||
|
confirmColor: '#03a9f4'
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
uni.showLoading({
|
||||||
|
mask: true,
|
||||||
|
title: '正在清空...'
|
||||||
});
|
});
|
||||||
})
|
this.$httpApi.admin
|
||||||
.catch(err => {});
|
.deleteAllLogs()
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.$tm.toast('操作成功!');
|
||||||
|
setTimeout(() => {
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
this.dataList = [];
|
||||||
|
this.fnGetData();
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(err => {});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
.loading-wrap {
|
|
||||||
padding: 24rpx;
|
.loading-wrap {
|
||||||
}
|
padding: 24rpx;
|
||||||
.page-content {
|
}
|
||||||
}
|
|
||||||
.content-empty {
|
.page-content {}
|
||||||
width: 100vw;
|
|
||||||
height: 65vh;
|
.content-empty {
|
||||||
}
|
width: 100vw;
|
||||||
.card {
|
height: 65vh;
|
||||||
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.05);
|
}
|
||||||
}
|
|
||||||
.desc-item {
|
.card {
|
||||||
.desc-label {
|
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||||
width: 150rpx;
|
}
|
||||||
position: relative;
|
|
||||||
&::after {
|
.desc-item {
|
||||||
content: ':';
|
.desc-label {
|
||||||
position: absolute;
|
width: 150rpx;
|
||||||
right: 0px;
|
position: relative;
|
||||||
top: 0rpx;
|
|
||||||
|
&::after {
|
||||||
|
content: ':';
|
||||||
|
position: absolute;
|
||||||
|
right: 0px;
|
||||||
|
top: 0rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc-value {
|
||||||
|
word-wrap: break-word;
|
||||||
|
word-break: break-all;
|
||||||
|
padding-left: 6rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.desc-value {
|
</style>
|
||||||
word-wrap: break-word;
|
|
||||||
word-break: break-all;
|
|
||||||
padding-left: 6rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
+355
-432
@@ -1,17 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-page flex flex-col">
|
<view class="app-page flex flex-col">
|
||||||
<view class="e-fixed shadow-2 bg-white">
|
<view class="e-fixed shadow-2 bg-white">
|
||||||
<tm-search
|
<tm-search :clear="true" v-model="queryParams.keyword" :round="24" :shadow="0" confirmText="搜索" color="light-blue" insertColor="light-blue" align="center" @confirm="fnOnSearch()"></tm-search>
|
||||||
:clear="true"
|
|
||||||
v-model="queryParams.keyword"
|
|
||||||
:round="24"
|
|
||||||
:shadow="0"
|
|
||||||
confirmText="搜索"
|
|
||||||
color="light-blue"
|
|
||||||
insertColor="light-blue"
|
|
||||||
align="center"
|
|
||||||
@confirm="fnOnSearch()"
|
|
||||||
></tm-search>
|
|
||||||
<tm-tabs v-if="team.list.length != 0" color="light-blue" :shadow="0" v-model="team.activeIndex" :list="team.list" align="center" @change="fnOnTabChange"></tm-tabs>
|
<tm-tabs v-if="team.list.length != 0" color="light-blue" :shadow="0" v-model="team.activeIndex" :list="team.list" align="center" @change="fnOnTabChange"></tm-tabs>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -35,7 +25,7 @@
|
|||||||
<view v-if="dataList.length == 0" class="content-empty flex flex-center"><tm-empty icon="icon-shiliangzhinengduixiang-" label="暂无任何图片"></tm-empty></view>
|
<view v-if="dataList.length == 0" class="content-empty flex flex-center"><tm-empty icon="icon-shiliangzhinengduixiang-" label="暂无任何图片"></tm-empty></view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(item, index) in dataList" :key="index">
|
<block v-for="(item, index) in dataList" :key="index">
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<view class="card mb-24 flex flex-col bg-white pa-24 round-3">
|
<view class="card mb-24 flex flex-col bg-white pa-24 round-3">
|
||||||
<view class="thumbnail round-2" @click="fnPreview(item, index)">
|
<view class="thumbnail round-2" @click="fnPreview(item, index)">
|
||||||
<image class="thumbnail-img round-2" :src="item.showThumbnail" mode="aspectFill"></image>
|
<image class="thumbnail-img round-2" :src="item.showThumbnail" mode="aspectFill"></image>
|
||||||
@@ -66,99 +56,23 @@
|
|||||||
<view class="poup-content">
|
<view class="poup-content">
|
||||||
<view class="poup-head text-align-center text-weight-b text-size-g ma-24">{{ form.id != undefined ? '编辑图片' : '新增图片' }}</view>
|
<view class="poup-head text-align-center text-weight-b text-size-g ma-24">{{ form.id != undefined ? '编辑图片' : '新增图片' }}</view>
|
||||||
<scroll-view :enable-flex="true" class="poup-body pa-24 pt-0 pb-0" :scroll-y="true" :scroll-top="poupBodyScrollTop" @touchmove.stop @scroll="fnOnPoupBodyScroll">
|
<scroll-view :enable-flex="true" class="poup-body pa-24 pt-0 pb-0" :scroll-y="true" :scroll-top="poupBodyScrollTop" @touchmove.stop @scroll="fnOnPoupBodyScroll">
|
||||||
<tm-input
|
<tm-input :adjust-position="true" :round="3" clear :borderBottom="false" title="图片名称" bg-color="grey-lighten-5" v-model="form.name" placeholder="请输入图片名称"></tm-input>
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
clear
|
|
||||||
:borderBottom="false"
|
|
||||||
title="图片名称"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.name"
|
|
||||||
placeholder="请输入图片名称"
|
|
||||||
></tm-input>
|
|
||||||
|
|
||||||
<tm-input
|
<tm-input name="team" :adjust-position="true" :round="3" bg-color="grey-lighten-5" :borderBottom="false" title="图片分组" placeholder="请选择输入或分组" v-model="form.team">
|
||||||
name="team"
|
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
:borderBottom="false"
|
|
||||||
title="图片分组"
|
|
||||||
placeholder="请选择输入或分组"
|
|
||||||
v-model="form.team"
|
|
||||||
>
|
|
||||||
<tm-pickers slot="rightBtn" rang-key="name" :default-value.sync="team.selected" :list="team.selectList" @confirm="fnOnSelectTeamConfirm">
|
<tm-pickers slot="rightBtn" rang-key="name" :default-value.sync="team.selected" :list="team.selectList" @confirm="fnOnSelectTeamConfirm">
|
||||||
<tm-button size="m" :dense="true" :shadow="0" theme="bg-gradient-light-blue-accent">选择</tm-button>
|
<tm-button size="m" :dense="true" :shadow="0" theme="bg-gradient-light-blue-accent">选择</tm-button>
|
||||||
</tm-pickers>
|
</tm-pickers>
|
||||||
</tm-input>
|
</tm-input>
|
||||||
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:图片分组可选择,也可以输入新的分组名称</view>
|
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:图片分组可选择,也可以输入新的分组名称</view>
|
||||||
<tm-pickersDate
|
<tm-pickersDate :full-number="true" :show-detail="{ year: true, month: true, day: true, hour: true, min: true, sec: true }" :default-value="takeTime" @confirm="fnOnTakeTimeConfirm">
|
||||||
:full-number="true"
|
<tm-input title="拍摄时间" :adjust-position="true" :round="3" bg-color="grey-lighten-5" :borderBottom="false" placeholder="请选择拍摄时间" disabled :value="takeTime"></tm-input>
|
||||||
:show-detail="{ year: true, month: true, day: true, hour: true, min: true, sec: true }"
|
|
||||||
:default-value="takeTime"
|
|
||||||
@confirm="fnOnTakeTimeConfirm"
|
|
||||||
>
|
|
||||||
<tm-input
|
|
||||||
title="拍摄时间"
|
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
:borderBottom="false"
|
|
||||||
placeholder="请选择拍摄时间"
|
|
||||||
disabled
|
|
||||||
:value="takeTime"
|
|
||||||
></tm-input>
|
|
||||||
</tm-pickersDate>
|
</tm-pickersDate>
|
||||||
<tm-input
|
<tm-input :borderBottom="false" :adjust-position="true" :round="3" clear title="拍摄地点" bg-color="grey-lighten-5" v-model="form.location" placeholder="请输入拍摄地点"></tm-input>
|
||||||
:borderBottom="false"
|
<tm-input :borderBottom="false" :vertical="false" clear :adjust-position="true" inputType="textarea" :round="3" title="图片描述" :height="160" bg-color="grey-lighten-5" v-model="form.description" placeholder="请输入图片描述"></tm-input>
|
||||||
:adjust-position="true"
|
<tm-input name="url" clear :borderBottom="false" :adjust-position="true" :round="3" title="图片地址" bg-color="grey-lighten-5" v-model="form.url" placeholder="请输入或选择图片" @clear="fnOnUrlInputChange" @blur="fnOnUrlInputChange" @input="fnOnUrlInputChange">
|
||||||
:round="3"
|
|
||||||
clear
|
|
||||||
title="拍摄地点"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.location"
|
|
||||||
placeholder="请输入拍摄地点"
|
|
||||||
></tm-input>
|
|
||||||
<tm-input
|
|
||||||
:borderBottom="false"
|
|
||||||
:vertical="false"
|
|
||||||
clear
|
|
||||||
:adjust-position="true"
|
|
||||||
inputType="textarea"
|
|
||||||
:round="3"
|
|
||||||
title="图片描述"
|
|
||||||
:height="160"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.description"
|
|
||||||
placeholder="请输入图片描述"
|
|
||||||
></tm-input>
|
|
||||||
<tm-input
|
|
||||||
name="url"
|
|
||||||
clear
|
|
||||||
:borderBottom="false"
|
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
title="图片地址"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.url"
|
|
||||||
placeholder="请输入或选择图片"
|
|
||||||
@clear="fnOnUrlInputChange"
|
|
||||||
@blur="fnOnUrlInputChange"
|
|
||||||
@input="fnOnUrlInputChange"
|
|
||||||
>
|
|
||||||
<tm-button slot="rightBtn" size="m" :dense="true" :shadow="0" theme="bg-gradient-light-blue-accent" @click="fnShowAttachmentsSelect('url')">选择</tm-button>
|
<tm-button slot="rightBtn" size="m" :dense="true" :shadow="0" theme="bg-gradient-light-blue-accent" @click="fnShowAttachmentsSelect('url')">选择</tm-button>
|
||||||
</tm-input>
|
</tm-input>
|
||||||
<tm-input
|
<tm-input name="thumbnail" :borderBottom="false" :adjust-position="true" :round="3" clear title="缩略图片" bg-color="grey-lighten-5" v-model="form.thumbnail" placeholder="请输入或选择缩略图">
|
||||||
name="thumbnail"
|
|
||||||
:borderBottom="false"
|
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
clear
|
|
||||||
title="缩略图片"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.thumbnail"
|
|
||||||
placeholder="请输入或选择缩略图"
|
|
||||||
>
|
|
||||||
<tm-button slot="rightBtn" size="m" :dense="true" :shadow="0" theme="bg-gradient-light-blue-accent" @click="fnShowAttachmentsSelect('thumbnail')">
|
<tm-button slot="rightBtn" size="m" :dense="true" :shadow="0" theme="bg-gradient-light-blue-accent" @click="fnShowAttachmentsSelect('thumbnail')">
|
||||||
选择
|
选择
|
||||||
</tm-button>
|
</tm-button>
|
||||||
@@ -181,316 +95,273 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import throttle from '@/utils/throttle.js';
|
import throttle from '@/utils/throttle.js';
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
import tmSearch from '@/tm-vuetify/components/tm-search/tm-search.vue';
|
import tmSearch from '@/tm-vuetify/components/tm-search/tm-search.vue';
|
||||||
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
||||||
import tmInput from '@/tm-vuetify/components/tm-input/tm-input.vue';
|
import tmInput from '@/tm-vuetify/components/tm-input/tm-input.vue';
|
||||||
import tmPickersDate from '@/tm-vuetify/components/tm-pickersDate/tm-pickersDate.vue';
|
import tmPickersDate from '@/tm-vuetify/components/tm-pickersDate/tm-pickersDate.vue';
|
||||||
import tmPickers from '@/tm-vuetify/components/tm-pickers/tm-pickers.vue';
|
import tmPickers from '@/tm-vuetify/components/tm-pickers/tm-pickers.vue';
|
||||||
|
|
||||||
import AttachmentSelect from '@/components/attachment-select/attachment-select.vue';
|
import AttachmentSelect from '@/components/attachment-select/attachment-select.vue';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmButton,
|
tmButton,
|
||||||
tmSearch,
|
tmSearch,
|
||||||
tmTabs,
|
tmTabs,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
tmPoup,
|
tmPoup,
|
||||||
tmInput,
|
tmInput,
|
||||||
tmPickersDate,
|
tmPickersDate,
|
||||||
tmPickers,
|
tmPickers,
|
||||||
AttachmentSelect
|
AttachmentSelect
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: 'loading',
|
loading: 'loading',
|
||||||
team: {
|
team: {
|
||||||
activeIndex: 0,
|
activeIndex: 0,
|
||||||
list: [],
|
list: [],
|
||||||
selected: [],
|
selected: [],
|
||||||
selectList: []
|
selectList: []
|
||||||
},
|
},
|
||||||
queryParams: {
|
queryParams: {
|
||||||
size: 10,
|
size: 10,
|
||||||
page: 0,
|
page: 0,
|
||||||
sort: 'createTime,desc',
|
sort: 'createTime,desc',
|
||||||
sort: 'id,asc'
|
sort: 'id,asc'
|
||||||
},
|
},
|
||||||
result: null,
|
result: null,
|
||||||
dataList: [],
|
dataList: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
isLoadMore: false,
|
isLoadMore: false,
|
||||||
loadMoreText: '加载中...',
|
loadMoreText: '加载中...',
|
||||||
|
|
||||||
poupShow: false,
|
poupShow: false,
|
||||||
attachmentsSelectShow: false,
|
attachmentsSelectShow: false,
|
||||||
selectAttachmentsType: 'url',
|
selectAttachmentsType: 'url',
|
||||||
takeTime: undefined,
|
|
||||||
form: {
|
|
||||||
id: undefined,
|
|
||||||
location: undefined,
|
|
||||||
name: undefined,
|
|
||||||
takeTime: undefined,
|
takeTime: undefined,
|
||||||
team: undefined,
|
form: {
|
||||||
thumbnail: undefined,
|
id: undefined,
|
||||||
url: undefined,
|
location: undefined,
|
||||||
description: undefined
|
name: undefined,
|
||||||
},
|
takeTime: undefined,
|
||||||
poupBodyScrollTop: 0
|
team: undefined,
|
||||||
};
|
thumbnail: undefined,
|
||||||
},
|
url: undefined,
|
||||||
|
description: undefined
|
||||||
|
},
|
||||||
|
poupBodyScrollTop: 0
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fnSetPageTitle('图库管理');
|
this.fnSetPageTitle('图库管理');
|
||||||
this.fnGetTeamList();
|
this.fnGetTeamList();
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
this.queryParams.page = 0;
|
|
||||||
this.dataList = [];
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
onReachBottom(e) {
|
|
||||||
if (this.result.hasNext) {
|
|
||||||
this.queryParams.page += 1;
|
|
||||||
this.isLoadMore = true;
|
|
||||||
this.fnGetData();
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '没有更多数据了'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 获取分类列表
|
|
||||||
fnGetTeamList() {
|
|
||||||
this.$httpApi.admin
|
|
||||||
.getPhotosTeams()
|
|
||||||
.then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
let _list = res.data;
|
|
||||||
this.team.selectList = _list.map((item, index) => {
|
|
||||||
return {
|
|
||||||
id: index,
|
|
||||||
name: item,
|
|
||||||
value: item
|
|
||||||
};
|
|
||||||
});
|
|
||||||
if (_list.length > 1) {
|
|
||||||
_list.unshift('全部');
|
|
||||||
this.team.list = _list;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {});
|
|
||||||
},
|
},
|
||||||
fnOnSearch() {
|
created() {
|
||||||
this.queryParams.page = 0;
|
|
||||||
this.isLoadMore = false;
|
|
||||||
this.fnToTopPage();
|
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
},
|
},
|
||||||
fnOnTabChange(index) {
|
onPullDownRefresh() {
|
||||||
this.queryParams.team = index == 0 ? undefined : this.team.list[index];
|
|
||||||
this.queryParams.page = 0;
|
this.queryParams.page = 0;
|
||||||
this.dataList = [];
|
this.dataList = [];
|
||||||
this.fnToTopPage();
|
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
},
|
},
|
||||||
fnOnTakeTimeConfirm(e) {
|
onReachBottom(e) {
|
||||||
this.takeTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.min}:${e.sec}`;
|
if (this.result.hasNext) {
|
||||||
this.form.takeTime = new Date(this.takeTime).getTime();
|
this.queryParams.page += 1;
|
||||||
},
|
this.isLoadMore = true;
|
||||||
fnOnSelectTeamConfirm(e) {
|
this.fnGetData();
|
||||||
const _select = e[0].data;
|
} else {
|
||||||
this.form.team = _select.value;
|
uni.showToast({
|
||||||
},
|
icon: 'none',
|
||||||
fnGetData() {
|
title: '没有更多数据了'
|
||||||
uni.showLoading({
|
});
|
||||||
mask: true,
|
|
||||||
title: '加载中...'
|
|
||||||
});
|
|
||||||
// 设置状态为加载中
|
|
||||||
if (!this.isLoadMore) {
|
|
||||||
this.loading = 'loading';
|
|
||||||
}
|
}
|
||||||
this.loadMoreText = '加载中...';
|
},
|
||||||
this.$httpApi.admin
|
methods: {
|
||||||
.getPhotos(this.queryParams)
|
// 获取分类列表
|
||||||
.then(res => {
|
fnGetTeamList() {
|
||||||
if (res.status == 200) {
|
this.$httpApi.admin
|
||||||
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
.getPhotosTeams()
|
||||||
this.result = res.data;
|
.then(res => {
|
||||||
this.total = res.data.total;
|
if (res.status == 200) {
|
||||||
let _list = res.data.content.map(item => {
|
let _list = res.data;
|
||||||
// 处理显示的图片
|
this.team.selectList = _list.map((item, index) => {
|
||||||
item['showThumbnail'] = this.$utils.checkThumbnailUrl(item.thumbnail);
|
return {
|
||||||
return item;
|
id: index,
|
||||||
});
|
name: item,
|
||||||
|
value: item
|
||||||
if (this.isLoadMore) {
|
};
|
||||||
this.dataList = this.dataList.concat(_list);
|
});
|
||||||
} else {
|
if (_list.length > 1) {
|
||||||
this.dataList = _list;
|
_list.unshift('全部');
|
||||||
|
this.team.list = _list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.loading = 'success';
|
})
|
||||||
} else {
|
.catch(err => {});
|
||||||
|
},
|
||||||
|
fnOnSearch() {
|
||||||
|
this.fnResetSetAniWaitIndex();
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
this.isLoadMore = false;
|
||||||
|
this.fnToTopPage();
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
fnOnTabChange(index) {
|
||||||
|
this.fnResetSetAniWaitIndex();
|
||||||
|
this.queryParams.team = index == 0 ? undefined : this.team.list[index];
|
||||||
|
this.queryParams.page = 0;
|
||||||
|
this.dataList = [];
|
||||||
|
this.fnToTopPage();
|
||||||
|
this.fnGetData();
|
||||||
|
},
|
||||||
|
fnOnTakeTimeConfirm(e) {
|
||||||
|
this.takeTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.min}:${e.sec}`;
|
||||||
|
this.form.takeTime = new Date(this.takeTime).getTime();
|
||||||
|
},
|
||||||
|
fnOnSelectTeamConfirm(e) {
|
||||||
|
const _select = e[0].data;
|
||||||
|
this.form.team = _select.value;
|
||||||
|
},
|
||||||
|
fnGetData() {
|
||||||
|
uni.showLoading({
|
||||||
|
mask: true,
|
||||||
|
title: '加载中...'
|
||||||
|
});
|
||||||
|
// 设置状态为加载中
|
||||||
|
if (!this.isLoadMore) {
|
||||||
|
this.loading = 'loading';
|
||||||
|
}
|
||||||
|
this.loadMoreText = '加载中...';
|
||||||
|
this.$httpApi.admin
|
||||||
|
.getPhotos(this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
this.loadMoreText = res.data.hasNext ? '上拉加载更多' : '呜呜,没有更多数据啦~';
|
||||||
|
this.result = res.data;
|
||||||
|
this.total = res.data.total;
|
||||||
|
let _list = res.data.content.map(item => {
|
||||||
|
// 处理显示的图片
|
||||||
|
item['showThumbnail'] = this.$utils.checkThumbnailUrl(item.thumbnail);
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.isLoadMore) {
|
||||||
|
this.dataList = this.dataList.concat(_list);
|
||||||
|
} else {
|
||||||
|
this.dataList = _list;
|
||||||
|
}
|
||||||
|
this.loading = 'success';
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('加载失败,请重试!');
|
||||||
|
this.loading = 'error';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
uni.$tm.toast('加载失败,请重试!');
|
uni.$tm.toast('加载失败,请重试!');
|
||||||
this.loading = 'error';
|
this.loading = 'error';
|
||||||
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 300);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fnOnAttachmentsSelectClose() {
|
||||||
|
this.attachmentsSelectShow = false;
|
||||||
|
},
|
||||||
|
fnOnPoupBodyScroll(e) {
|
||||||
|
throttle(() => {
|
||||||
|
this.poupBodyScrollTop = e.detail.scrollTop;
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
fnOnPoupChange(e) {
|
||||||
|
if (!e) {
|
||||||
|
this.fnResetForm();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fnOnUrlInputChange() {
|
||||||
|
if (this.form.url) {
|
||||||
|
this.$set(this.form, 'showThumbnail', this.$utils.checkThumbnailUrl(this.form.url));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fnShowAttachmentsSelect(type) {
|
||||||
|
this.selectAttachmentsType = type;
|
||||||
|
this.attachmentsSelectShow = true;
|
||||||
|
},
|
||||||
|
// 监听附件选择
|
||||||
|
fnOnAttachmentsSelect(file) {
|
||||||
|
if (this.selectAttachmentsType == 'url') {
|
||||||
|
this.form.url = file.path;
|
||||||
|
this.form.showThumbnail = this.$utils.checkThumbnailUrl(file.path);
|
||||||
|
if (!this.form.thumbnail) {
|
||||||
|
this.form.thumbnail = file.path;
|
||||||
}
|
}
|
||||||
})
|
} else {
|
||||||
.catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
uni.$tm.toast('加载失败,请重试!');
|
|
||||||
this.loading = 'error';
|
|
||||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
}, 300);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fnOnAttachmentsSelectClose() {
|
|
||||||
this.attachmentsSelectShow = false;
|
|
||||||
},
|
|
||||||
fnOnPoupBodyScroll(e) {
|
|
||||||
throttle(() => {
|
|
||||||
this.poupBodyScrollTop = e.detail.scrollTop;
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
fnOnPoupChange(e) {
|
|
||||||
if (!e) {
|
|
||||||
this.fnResetForm();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fnOnUrlInputChange() {
|
|
||||||
if (this.form.url) {
|
|
||||||
this.$set(this.form, 'showThumbnail', this.$utils.checkThumbnailUrl(this.form.url));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fnShowAttachmentsSelect(type) {
|
|
||||||
this.selectAttachmentsType = type;
|
|
||||||
this.attachmentsSelectShow = true;
|
|
||||||
},
|
|
||||||
// 监听附件选择
|
|
||||||
fnOnAttachmentsSelect(file) {
|
|
||||||
if (this.selectAttachmentsType == 'url') {
|
|
||||||
this.form.url = file.path;
|
|
||||||
this.form.showThumbnail = this.$utils.checkThumbnailUrl(file.path);
|
|
||||||
if (!this.form.thumbnail) {
|
|
||||||
this.form.thumbnail = file.path;
|
this.form.thumbnail = file.path;
|
||||||
}
|
}
|
||||||
} else {
|
this.attachmentsSelectShow = false;
|
||||||
this.form.thumbnail = file.path;
|
},
|
||||||
}
|
fnResetForm() {
|
||||||
this.attachmentsSelectShow = false;
|
this.form = { id: undefined, location: undefined, name: undefined, takeTime: undefined, team: undefined, thumbnail: undefined, url: undefined, description: undefined };
|
||||||
},
|
this.takeTime = uni.$tm.dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss');
|
||||||
fnResetForm() {
|
},
|
||||||
this.form = { id: undefined, location: undefined, name: undefined, takeTime: undefined, team: undefined, thumbnail: undefined, url: undefined, description: undefined };
|
fnEdit(item) {
|
||||||
this.takeTime = uni.$tm.dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss');
|
this.poupBodyScrollTop = 0;
|
||||||
},
|
if (!item.takeTime) {
|
||||||
fnEdit(item) {
|
item.takeTime = new Date().getTime();
|
||||||
this.poupBodyScrollTop = 0;
|
}
|
||||||
if (!item.takeTime) {
|
this.takeTime = uni.$tm.dayjs(item.takeTime).format('YYYY-MM-DD HH:mm:ss');
|
||||||
item.takeTime = new Date().getTime();
|
this.form = item;
|
||||||
}
|
if (this.form.team) {
|
||||||
this.takeTime = uni.$tm.dayjs(item.takeTime).format('YYYY-MM-DD HH:mm:ss');
|
this.team.selected = [this.team.selectList.findIndex(x => x.name == this.form.team)];
|
||||||
this.form = item;
|
} else {
|
||||||
if (this.form.team) {
|
this.team.selected = [];
|
||||||
this.team.selected = [this.team.selectList.findIndex(x => x.name == this.form.team)];
|
}
|
||||||
} else {
|
this.poupShow = true;
|
||||||
this.team.selected = [];
|
},
|
||||||
}
|
// 新增
|
||||||
this.poupShow = true;
|
fnAdd() {
|
||||||
},
|
this.fnResetForm();
|
||||||
// 新增
|
this.poupBodyScrollTop = 0;
|
||||||
fnAdd() {
|
this.poupShow = true;
|
||||||
this.fnResetForm();
|
},
|
||||||
this.poupBodyScrollTop = 0;
|
// 保存
|
||||||
this.poupShow = true;
|
fnSave() {
|
||||||
},
|
if (!this.form.name) {
|
||||||
// 保存
|
return uni.$tm.toast('请填写图片名称!');
|
||||||
fnSave() {
|
}
|
||||||
if (!this.form.name) {
|
if (!this.$utils.checkIsUrl(this.form.url)) {
|
||||||
return uni.$tm.toast('请填写图片名称!');
|
return uni.$tm.toast('请选择或输入正确的图片地址!');
|
||||||
}
|
}
|
||||||
if (!this.$utils.checkIsUrl(this.form.url)) {
|
if (!this.$utils.checkIsUrl(this.form.thumbnail)) {
|
||||||
return uni.$tm.toast('请选择或输入正确的图片地址!');
|
return uni.$tm.toast('请选择或输入正确的缩略图地址!');
|
||||||
}
|
}
|
||||||
if (!this.$utils.checkIsUrl(this.form.thumbnail)) {
|
if (this.form.id == undefined) {
|
||||||
return uni.$tm.toast('请选择或输入正确的缩略图地址!');
|
|
||||||
}
|
|
||||||
if (this.form.id == undefined) {
|
|
||||||
this.$httpApi.admin
|
|
||||||
.createPhotos(this.form)
|
|
||||||
.then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
uni.$tm.toast(`保存成功!`);
|
|
||||||
this.poupShow = false;
|
|
||||||
setTimeout(() => {
|
|
||||||
this.fnResetForm();
|
|
||||||
this.fnGetTeamList();
|
|
||||||
uni.startPullDownRefresh();
|
|
||||||
}, 1000);
|
|
||||||
} else {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.$httpApi.admin
|
|
||||||
.updatePhotosById(this.form.id, this.form)
|
|
||||||
.then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
uni.$tm.toast(`保存成功!`);
|
|
||||||
let updateIndex = this.dataList.findIndex(x => x.id == this.form.id);
|
|
||||||
this.$set(this.dataList, updateIndex, this.form);
|
|
||||||
setTimeout(() => {
|
|
||||||
this.fnGetTeamList();
|
|
||||||
}, 500);
|
|
||||||
} else {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 删除
|
|
||||||
fnDelete(item, index) {
|
|
||||||
uni.$eShowModal({
|
|
||||||
title: '提示',
|
|
||||||
content: `您是否删除名为 ${item.name} 的图片?`,
|
|
||||||
showCancel: true,
|
|
||||||
cancelText: '否',
|
|
||||||
cancelColor: '#999999',
|
|
||||||
confirmText: '是',
|
|
||||||
confirmColor: '#03a9f4'
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
this.$httpApi.admin
|
this.$httpApi.admin
|
||||||
.deletePhotosById(item.id)
|
.createPhotos(this.form)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
uni.$tm.toast(`${item.name} 分类已删除!`);
|
uni.$tm.toast(`保存成功!`);
|
||||||
this.dataList.splice(index, 1);
|
this.poupShow = false;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.fnResetForm();
|
||||||
|
this.fnGetTeamList();
|
||||||
|
uni.startPullDownRefresh();
|
||||||
|
}, 1000);
|
||||||
} else {
|
} else {
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
}
|
}
|
||||||
@@ -498,56 +369,108 @@ export default {
|
|||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
});
|
});
|
||||||
})
|
} else {
|
||||||
.catch(err => {});
|
this.$httpApi.admin
|
||||||
},
|
.updatePhotosById(this.form.id, this.form)
|
||||||
// 预览
|
.then(res => {
|
||||||
fnPreview(item, index) {
|
if (res.status == 200) {
|
||||||
uni.previewImage({
|
uni.$tm.toast(`保存成功!`);
|
||||||
current: index,
|
let updateIndex = this.dataList.findIndex(x => x.id == this.form.id);
|
||||||
urls: this.dataList.map(x => x.url),
|
this.$set(this.dataList, updateIndex, this.form);
|
||||||
indicator: 'number',
|
setTimeout(() => {
|
||||||
loop: true
|
this.fnGetTeamList();
|
||||||
});
|
}, 500);
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
fnDelete(item, index) {
|
||||||
|
uni.$eShowModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `您是否删除名为 ${item.name} 的图片?`,
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '否',
|
||||||
|
cancelColor: '#999999',
|
||||||
|
confirmText: '是',
|
||||||
|
confirmColor: '#03a9f4'
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
this.$httpApi.admin
|
||||||
|
.deletePhotosById(item.id)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.$tm.toast(`${item.name} 分类已删除!`);
|
||||||
|
this.dataList.splice(index, 1);
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(err => {});
|
||||||
|
},
|
||||||
|
// 预览
|
||||||
|
fnPreview(item, index) {
|
||||||
|
uni.previewImage({
|
||||||
|
current: index,
|
||||||
|
urls: this.dataList.map(x => x.url),
|
||||||
|
indicator: 'number',
|
||||||
|
loop: true
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
|
||||||
.loading-wrap {
|
|
||||||
padding: 24rpx;
|
|
||||||
.loading-error {
|
|
||||||
height: 65vh;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.btn-wrap {
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding-top: 12rpx;
|
|
||||||
padding-bottom: 12rpx;
|
|
||||||
box-shadow: 0rpx -4rpx 24rpx rgba(0, 0, 0, 0.05);
|
|
||||||
}
|
|
||||||
.card {
|
|
||||||
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.05);
|
|
||||||
}
|
|
||||||
.thumbnail {
|
|
||||||
width: 100%;
|
|
||||||
&-img {
|
|
||||||
width: 100%;
|
|
||||||
height: 300rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.poup-content {
|
.loading-wrap {
|
||||||
overflow: hidden;
|
padding: 24rpx;
|
||||||
}
|
|
||||||
.poup-body {
|
.loading-error {
|
||||||
height: 69vh;
|
height: 65vh;
|
||||||
box-sizing: border-box;
|
}
|
||||||
touch-action: none;
|
}
|
||||||
}
|
|
||||||
</style>
|
.btn-wrap {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-top: 12rpx;
|
||||||
|
padding-bottom: 12rpx;
|
||||||
|
box-shadow: 0rpx -4rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.thumbnail {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
&-img {
|
||||||
|
width: 100%;
|
||||||
|
height: 300rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.poup-content {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.poup-body {
|
||||||
|
height: 69vh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
touch-action: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -97,7 +97,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fnSetPageTitle('我的个人信息');
|
this.fnSetPageTitle('个人资料');
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
|
|||||||
+263
-279
@@ -14,7 +14,7 @@
|
|||||||
<view v-if="dataList.length == 0" class="content-empty flex flex-center"><tm-empty icon="icon-shiliangzhinengduixiang-" label="无数据"></tm-empty></view>
|
<view v-if="dataList.length == 0" class="content-empty flex flex-center"><tm-empty icon="icon-shiliangzhinengduixiang-" label="无数据"></tm-empty></view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(tag, index) in dataList" :key="index">
|
<block v-for="(tag, index) in dataList" :key="index">
|
||||||
<tm-translate animation-name="fadeUp" :wait="(index + 1) * 50">
|
<tm-translate animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<view class="tags-card flex round-3 bg-white pa-24 mb-24" @click="fnShowFormModal(tag)">
|
<view class="tags-card flex round-3 bg-white pa-24 mb-24" @click="fnShowFormModal(tag)">
|
||||||
<text class="del-icon flex flex-center" @click.stop="fnDelete(tag, index)">×</text>
|
<text class="del-icon flex flex-center" @click.stop="fnDelete(tag, index)">×</text>
|
||||||
<view class="left">
|
<view class="left">
|
||||||
@@ -46,36 +46,11 @@
|
|||||||
<view class="poup-content">
|
<view class="poup-content">
|
||||||
<view class="poup-head text-align-center text-weight-b text-size-g ma-24">{{ form.id != undefined ? '编辑标签' : '新增标签' }}</view>
|
<view class="poup-head text-align-center text-weight-b text-size-g ma-24">{{ form.id != undefined ? '编辑标签' : '新增标签' }}</view>
|
||||||
<scroll-view class="poup-body pa-24 pt-0" :scroll-y="true" @touchmove.stop>
|
<scroll-view class="poup-body pa-24 pt-0" :scroll-y="true" @touchmove.stop>
|
||||||
<tm-input
|
<tm-input required :adjust-position="true" :round="3" :borderBottom="false" title="名称" bg-color="grey-lighten-5" v-model="form.name" placeholder="请输入标签名称"></tm-input>
|
||||||
required
|
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
:borderBottom="false"
|
|
||||||
title="名称"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.name"
|
|
||||||
placeholder="请输入标签名称"
|
|
||||||
></tm-input>
|
|
||||||
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:页面上所显示的名称</view>
|
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:页面上所显示的名称</view>
|
||||||
<tm-input
|
<tm-input :borderBottom="false" :adjust-position="true" :round="3" title="别名" bg-color="grey-lighten-5" v-model="form.slug" placeholder="请输入标签别名"></tm-input>
|
||||||
:borderBottom="false"
|
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
title="别名"
|
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
v-model="form.slug"
|
|
||||||
placeholder="请输入标签别名"
|
|
||||||
></tm-input>
|
|
||||||
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:一般为单个标签页面的标识,最好为英文</view>
|
<view class="pl-32 mb-24 input-tips text-grey text-size-s">填写提示:一般为单个标签页面的标识,最好为英文</view>
|
||||||
<tm-input
|
<tm-input bg-color="grey-lighten-5" :border-bottom="false" :adjust-position="true" :round="3" title="颜色" placeholder="点击右侧选择标签颜色" v-model="form.color">
|
||||||
bg-color="grey-lighten-5"
|
|
||||||
:border-bottom="false"
|
|
||||||
:adjust-position="true"
|
|
||||||
:round="3"
|
|
||||||
title="颜色"
|
|
||||||
placeholder="点击右侧选择标签颜色"
|
|
||||||
v-model="form.color"
|
|
||||||
>
|
|
||||||
<template v-slot:rightBtn>
|
<template v-slot:rightBtn>
|
||||||
<tm-button class="ml-12" theme="bg-gradient-blue-accent" :round="3" :font-size="24" :height="66" block :width="120" @click="fnSelectColor">
|
<tm-button class="ml-12" theme="bg-gradient-blue-accent" :round="3" :font-size="24" :height="66" block :width="120" @click="fnSelectColor">
|
||||||
选择颜色
|
选择颜色
|
||||||
@@ -108,206 +83,162 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
||||||
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
||||||
import tmInput from '@/tm-vuetify/components/tm-input/tm-input.vue';
|
import tmInput from '@/tm-vuetify/components/tm-input/tm-input.vue';
|
||||||
import tColorPicker from '@/components/t-color-picker/t-color-picker.vue';
|
import tColorPicker from '@/components/t-color-picker/t-color-picker.vue';
|
||||||
import AttachmentSelect from '@/components/attachment-select/attachment-select.vue';
|
import AttachmentSelect from '@/components/attachment-select/attachment-select.vue';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmButton,
|
tmButton,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
tmTabs,
|
tmTabs,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmTags,
|
tmTags,
|
||||||
tmPoup,
|
tmPoup,
|
||||||
tmInput,
|
tmInput,
|
||||||
tColorPicker,
|
tColorPicker,
|
||||||
AttachmentSelect
|
AttachmentSelect
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: 'loading',
|
|
||||||
queryParams: {
|
|
||||||
size: 10,
|
|
||||||
page: 0,
|
|
||||||
more: true
|
|
||||||
},
|
|
||||||
dataList: [],
|
|
||||||
poupShow: false,
|
|
||||||
selectColor: { r: 255, g: 255, b: 255, a: 1 },
|
|
||||||
attachmentsSelectShow: false,
|
|
||||||
form: {
|
|
||||||
color: undefined,
|
|
||||||
createTime: undefined,
|
|
||||||
fullPath: undefined,
|
|
||||||
id: undefined,
|
|
||||||
name: '',
|
|
||||||
slug: undefined,
|
|
||||||
thumbnail: undefined,
|
|
||||||
showThumbnail: undefined
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
onLoad() {
|
|
||||||
this.fnSetPageTitle('标签管理');
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
this.isLoadMore = false;
|
|
||||||
this.queryParams.page = 0;
|
|
||||||
this.fnGetData();
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
fnGetData() {
|
|
||||||
uni.showLoading({
|
|
||||||
mask: true,
|
|
||||||
title: '加载中...'
|
|
||||||
});
|
|
||||||
// 设置状态为加载中
|
|
||||||
if (!this.isLoadMore) {
|
|
||||||
this.loading = 'loading';
|
|
||||||
}
|
|
||||||
this.loadMoreText = '加载中...';
|
|
||||||
this.$httpApi.admin
|
|
||||||
.getTagsList(this.queryParams)
|
|
||||||
.then(res => {
|
|
||||||
this.loading = 'success';
|
|
||||||
this.dataList = res.data.map(item => {
|
|
||||||
if (item.thumbnail) {
|
|
||||||
item['showThumbnail'] = this.$utils.checkThumbnailUrl(item.thumbnail);
|
|
||||||
} else {
|
|
||||||
item['showThumbnail'] = '';
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
this.loading = 'error';
|
|
||||||
this.loadMoreText = '加载失败,请下拉刷新!';
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
}, 800);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
fnSelectColor() {
|
return {
|
||||||
this.$refs.colorPicker.open();
|
loading: 'loading',
|
||||||
},
|
queryParams: {
|
||||||
|
size: 10,
|
||||||
fnOnConfirmSelectColor(e) {
|
page: 0,
|
||||||
this.selectColor = e.rgba;
|
more: true
|
||||||
this.$set(this.form, 'color', e.hex);
|
},
|
||||||
},
|
dataList: [],
|
||||||
fnOnAttachmentsSelectClose() {
|
poupShow: false,
|
||||||
this.attachmentsSelectShow = false;
|
selectColor: { r: 255, g: 255, b: 255, a: 1 },
|
||||||
console.log('this.attachmentsSelectShow', this.attachmentsSelectShow);
|
attachmentsSelectShow: false,
|
||||||
},
|
form: {
|
||||||
fnOnPoupChange(e) {
|
color: undefined,
|
||||||
if (!e) {
|
createTime: undefined,
|
||||||
this.fnResetForm();
|
fullPath: undefined,
|
||||||
}
|
id: undefined,
|
||||||
},
|
name: '',
|
||||||
// 监听附件选择
|
slug: undefined,
|
||||||
fnOnAttachmentsSelect(file) {
|
thumbnail: undefined,
|
||||||
this.form.thumbnail = file.path;
|
showThumbnail: undefined
|
||||||
this.form.showThumbnail = this.$utils.checkThumbnailUrl(file.path);
|
|
||||||
this.attachmentsSelectShow = false;
|
|
||||||
},
|
|
||||||
fnShowFormModal(tag) {
|
|
||||||
if (tag) {
|
|
||||||
this.form = Object.assign({}, {}, tag);
|
|
||||||
if (tag.thumbnail) {
|
|
||||||
this.form.showThumbnail = this.$utils.checkThumbnailUrl(tag.thumbnail);
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
this.fnResetForm();
|
|
||||||
}
|
|
||||||
this.poupShow = true;
|
|
||||||
},
|
|
||||||
fnResetForm() {
|
|
||||||
this.form = {
|
|
||||||
color: undefined,
|
|
||||||
createTime: undefined,
|
|
||||||
fullPath: undefined,
|
|
||||||
id: undefined,
|
|
||||||
name: '',
|
|
||||||
slug: undefined,
|
|
||||||
thumbnail: undefined,
|
|
||||||
showThumbnail: undefined
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
fnSubmit() {
|
|
||||||
if (this.form.name.trim() == '') {
|
onLoad() {
|
||||||
return uni.$tm.toast('标签名称未填写!');
|
this.fnSetPageTitle('标签管理');
|
||||||
}
|
|
||||||
if (this.form.id == undefined) {
|
|
||||||
this.$httpApi.admin
|
|
||||||
.createTags(this.form)
|
|
||||||
.then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
uni.$tm.toast(`保存成功!`);
|
|
||||||
uni.startPullDownRefresh();
|
|
||||||
} else {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.$httpApi.admin
|
|
||||||
.updateTagsById(this.form.id, this.form)
|
|
||||||
.then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
uni.$tm.toast(`保存成功!`);
|
|
||||||
let updateIndex = this.dataList.findIndex(x => x.id == this.form.id);
|
|
||||||
this.$set(this.dataList, updateIndex, this.form);
|
|
||||||
} else {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// 删除
|
created() {
|
||||||
fnDelete(tag) {
|
this.fnGetData();
|
||||||
const _tag = tag || this.form;
|
},
|
||||||
uni.$eShowModal({
|
onPullDownRefresh() {
|
||||||
title: '提示',
|
this.isLoadMore = false;
|
||||||
content: `您是否要将 ${_tag.name} 的标签删除?`,
|
this.queryParams.page = 0;
|
||||||
showCancel: true,
|
this.fnGetData();
|
||||||
cancelText: '否',
|
},
|
||||||
cancelColor: '#999999',
|
|
||||||
confirmText: '是',
|
methods: {
|
||||||
confirmColor: '#03a9f4'
|
fnGetData() {
|
||||||
})
|
uni.showLoading({
|
||||||
.then(res => {
|
mask: true,
|
||||||
|
title: '加载中...'
|
||||||
|
});
|
||||||
|
// 设置状态为加载中
|
||||||
|
if (!this.isLoadMore) {
|
||||||
|
this.loading = 'loading';
|
||||||
|
}
|
||||||
|
this.loadMoreText = '加载中...';
|
||||||
|
this.$httpApi.admin
|
||||||
|
.getTagsList(this.queryParams)
|
||||||
|
.then(res => {
|
||||||
|
this.loading = 'success';
|
||||||
|
this.dataList = res.data.map(item => {
|
||||||
|
if (item.thumbnail) {
|
||||||
|
item['showThumbnail'] = this.$utils.checkThumbnailUrl(item.thumbnail);
|
||||||
|
} else {
|
||||||
|
item['showThumbnail'] = '';
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
this.loading = 'error';
|
||||||
|
this.loadMoreText = '加载失败,请下拉刷新!';
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 800);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
fnSelectColor() {
|
||||||
|
this.$refs.colorPicker.open();
|
||||||
|
},
|
||||||
|
|
||||||
|
fnOnConfirmSelectColor(e) {
|
||||||
|
this.selectColor = e.rgba;
|
||||||
|
this.$set(this.form, 'color', e.hex);
|
||||||
|
},
|
||||||
|
fnOnAttachmentsSelectClose() {
|
||||||
|
this.attachmentsSelectShow = false;
|
||||||
|
console.log('this.attachmentsSelectShow', this.attachmentsSelectShow);
|
||||||
|
},
|
||||||
|
fnOnPoupChange(e) {
|
||||||
|
if (!e) {
|
||||||
|
this.fnResetForm();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 监听附件选择
|
||||||
|
fnOnAttachmentsSelect(file) {
|
||||||
|
this.form.thumbnail = file.path;
|
||||||
|
this.form.showThumbnail = this.$utils.checkThumbnailUrl(file.path);
|
||||||
|
this.attachmentsSelectShow = false;
|
||||||
|
},
|
||||||
|
fnShowFormModal(tag) {
|
||||||
|
if (tag) {
|
||||||
|
this.form = Object.assign({}, {}, tag);
|
||||||
|
if (tag.thumbnail) {
|
||||||
|
this.form.showThumbnail = this.$utils.checkThumbnailUrl(tag.thumbnail);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.fnResetForm();
|
||||||
|
}
|
||||||
|
this.poupShow = true;
|
||||||
|
},
|
||||||
|
fnResetForm() {
|
||||||
|
this.form = {
|
||||||
|
color: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
fullPath: undefined,
|
||||||
|
id: undefined,
|
||||||
|
name: '',
|
||||||
|
slug: undefined,
|
||||||
|
thumbnail: undefined,
|
||||||
|
showThumbnail: undefined
|
||||||
|
};
|
||||||
|
},
|
||||||
|
fnSubmit() {
|
||||||
|
if (this.form.name.trim() == '') {
|
||||||
|
return uni.$tm.toast('标签名称未填写!');
|
||||||
|
}
|
||||||
|
if (this.form.id == undefined) {
|
||||||
this.$httpApi.admin
|
this.$httpApi.admin
|
||||||
.deleteTagsById(_tag.id)
|
.createTags(this.form)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
uni.$tm.toast(`${_tag.name} 标签已删除!`);
|
uni.$tm.toast(`保存成功!`);
|
||||||
const delIndex = this.dataList.findIndex(x => x.id == _tag.id);
|
uni.startPullDownRefresh();
|
||||||
this.dataList.splice(delIndex, 1);
|
|
||||||
} else {
|
} else {
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
}
|
}
|
||||||
@@ -315,73 +246,126 @@ export default {
|
|||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.$tm.toast('操作失败,请重试!');
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
});
|
});
|
||||||
})
|
} else {
|
||||||
.catch(err => {});
|
this.$httpApi.admin
|
||||||
|
.updateTagsById(this.form.id, this.form)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.$tm.toast(`保存成功!`);
|
||||||
|
let updateIndex = this.dataList.findIndex(x => x.id == this.form.id);
|
||||||
|
this.$set(this.dataList, updateIndex, this.form);
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
fnDelete(tag) {
|
||||||
|
const _tag = tag || this.form;
|
||||||
|
uni.$eShowModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `您是否要将 ${_tag.name} 的标签删除?`,
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '否',
|
||||||
|
cancelColor: '#999999',
|
||||||
|
confirmText: '是',
|
||||||
|
confirmColor: '#03a9f4'
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
this.$httpApi.admin
|
||||||
|
.deleteTagsById(_tag.id)
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.$tm.toast(`${_tag.name} 标签已删除!`);
|
||||||
|
const delIndex = this.dataList.findIndex(x => x.id == _tag.id);
|
||||||
|
this.dataList.splice(delIndex, 1);
|
||||||
|
} else {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
uni.$tm.toast('操作失败,请重试!');
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(err => {});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
|
||||||
.loading-wrap {
|
|
||||||
.loading-error {
|
|
||||||
height: 65vh;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.content-empty {
|
|
||||||
width: 100%;
|
|
||||||
height: 60vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.poup-content {
|
.loading-wrap {
|
||||||
overflow: hidden;
|
.loading-error {
|
||||||
}
|
height: 65vh;
|
||||||
.poup-body {
|
|
||||||
height: 58vh;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.thumbnail {
|
|
||||||
width: 100%;
|
|
||||||
height: 260rpx;
|
|
||||||
}
|
|
||||||
.tags-card {
|
|
||||||
position: relative;
|
|
||||||
box-sizing: border-box;
|
|
||||||
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
|
||||||
.del-icon {
|
|
||||||
width: 46rpx;
|
|
||||||
height: 46rpx;
|
|
||||||
position: absolute;
|
|
||||||
right: 24rpx;
|
|
||||||
top: 24rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border: 4rpx solid #fff;
|
|
||||||
background-color: #ff8177;
|
|
||||||
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.05);
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.left {
|
|
||||||
width: 160rpx;
|
|
||||||
height: 140rpx;
|
|
||||||
|
|
||||||
.cover {
|
|
||||||
width: 100%;
|
|
||||||
height: inherit;
|
|
||||||
// background-color: #788ea7;
|
|
||||||
background-color: #607d8b;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.right {
|
|
||||||
|
.content-empty {
|
||||||
|
width: 100%;
|
||||||
|
height: 60vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.poup-content {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.poup-body {
|
||||||
|
height: 58vh;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
.color {
|
}
|
||||||
|
|
||||||
|
.thumbnail {
|
||||||
|
width: 100%;
|
||||||
|
height: 260rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tags-card {
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
|
||||||
|
|
||||||
|
.del-icon {
|
||||||
|
width: 46rpx;
|
||||||
|
height: 46rpx;
|
||||||
|
position: absolute;
|
||||||
|
right: 24rpx;
|
||||||
|
top: 24rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border: 4rpx solid #fff;
|
||||||
|
background-color: #ff8177;
|
||||||
|
box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||||
|
font-size: 32rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.left {
|
||||||
|
width: 160rpx;
|
||||||
|
height: 140rpx;
|
||||||
|
|
||||||
|
.cover {
|
||||||
|
width: 100%;
|
||||||
|
height: inherit;
|
||||||
|
// background-color: #788ea7;
|
||||||
|
background-color: #607d8b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.color {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
</style>
|
||||||
</style>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB |
+12
-12
@@ -10,6 +10,7 @@
|
|||||||
* 修改时间:
|
* 修改时间:
|
||||||
*/
|
*/
|
||||||
import Blogger from '@/api/blogger.js'
|
import Blogger from '@/api/blogger.js'
|
||||||
|
import HaloConfig from '@/config/halo.config.js';
|
||||||
export default {
|
export default {
|
||||||
state: {
|
state: {
|
||||||
blogger: {},
|
blogger: {},
|
||||||
@@ -25,18 +26,17 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
//通过actions提交更新数据
|
fnGetBlogger(context) {
|
||||||
fnGetBlogger({
|
if (HaloConfig.author.use) {
|
||||||
commit
|
context.commit("setBlogger", HaloConfig.author);
|
||||||
}) {
|
} else {
|
||||||
Blogger.getBloggerInfo().then((res) => {
|
Blogger.getBloggerInfo().then((res) => {
|
||||||
console.log('获取博主信息成功:');
|
context.commit("setBlogger", res.data);
|
||||||
console.log(res);
|
}).catch((err) => {
|
||||||
commit("setBlogger", res.data);
|
// 如果失败,则加载默认配置信息
|
||||||
}).catch((err) => {
|
context.commit("setBlogger", HaloConfig.author);
|
||||||
console.log('哈哈,获取博主信息失败啦!');
|
});
|
||||||
console.log(err);
|
}
|
||||||
});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
+2
-6
@@ -24,17 +24,13 @@ export default {
|
|||||||
mutations: {
|
mutations: {
|
||||||
setSettings(state, data) {
|
setSettings(state, data) {
|
||||||
state.settings = data;
|
state.settings = data;
|
||||||
console.log('设置:', data);
|
|
||||||
setAppSettings(data)
|
setAppSettings(data)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
// 设置默认的数据
|
// 设置默认的数据
|
||||||
updateDefaultAppSettings({
|
updateDefaultAppSettings(context) {
|
||||||
commit
|
context.commit('setSettings', JSON.parse(JSON.stringify(_DefaultAppSettings)))
|
||||||
}) {
|
|
||||||
console.log(_DefaultAppSettings);
|
|
||||||
commit('setSettings', JSON.parse(JSON.stringify(_DefaultAppSettings)))
|
|
||||||
},
|
},
|
||||||
// 检查并设置默认的数据
|
// 检查并设置默认的数据
|
||||||
checkAndSetDefaultAppSettings(context) {
|
checkAndSetDefaultAppSettings(context) {
|
||||||
|
|||||||
+4
-10
@@ -45,14 +45,11 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
// 登录
|
adminLogin(context, data) {
|
||||||
adminLogin({
|
|
||||||
commit
|
|
||||||
}, data) {
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
User.login(data).then((res) => {
|
User.login(data).then((res) => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
commit("setAdminToken", res.data);
|
context.commit("setAdminToken", res.data);
|
||||||
resolve(res)
|
resolve(res)
|
||||||
} else {
|
} else {
|
||||||
reject(err)
|
reject(err)
|
||||||
@@ -72,11 +69,8 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 登出
|
adminLogout(context) {
|
||||||
adminLogout({
|
context.commit("setAdminToken", null);
|
||||||
commit
|
|
||||||
}) {
|
|
||||||
commit("setAdminToken", null);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
|
## 2.0.1(2022-12-8)
|
||||||
|
* 修复 tm-icons在小程序下可能图标与文字无法对齐
|
||||||
|
* 优化 tm-album性能,修复可能在嵌套组件中,无法计算宽高信息.
|
||||||
|
* 优化 tm-dragList性能
|
||||||
|
* 优化 tm-row性能
|
||||||
|
* 优化 tm-segTabs性能
|
||||||
|
* 优化 tm-sheet性能
|
||||||
|
* 优化 tm-slider,tm-sliders性能
|
||||||
|
* 优化 tm-more性能
|
||||||
|
* 优化 tm-propress性能,修复可能在嵌套组件中,无法计算宽高信息.
|
||||||
|
* 优化 tm-dialog,tm-poup,动效及样式
|
||||||
|
* 微调 tm-button
|
||||||
|
* 美化了tm-calendar,tm-calendar-view,选中改成圆形,范围改成椭圆形。
|
||||||
|
* 修复 tm-countdown 完成的时机逻辑有误,修改后默认为完成状态。
|
||||||
|
* 增强 tm-upload 新增showSort属性,用于上传的文件排序功能。
|
||||||
|
* 修复 tm-swiper圆角失效。
|
||||||
|
* 修复 tm-weekbar日期问题。
|
||||||
|
* 修复 tm-dragGrid 动态修改数据后的判断逻辑问题。
|
||||||
|
* 优化 tm-grouplist 渲染性能,现在已经是秒渲染。
|
||||||
|
* 修复$tm.vx.getters()下的属性丢失。
|
||||||
## 2.0.0(2022-6-7)
|
## 2.0.0(2022-6-7)
|
||||||
* tm-card修复点击操作按钮时返回的参数非index,而是项目标题。修复动态配置一些属性不生效的问题。
|
* tm-card修复点击操作按钮时返回的参数非index,而是项目标题。修复动态配置一些属性不生效的问题。
|
||||||
* tm-dropDownMenu 优化,当重置项时,默认将使用你初始的选中数据来进行填充,默认选中。
|
* tm-dropDownMenu 优化,当重置项时,默认将使用你初始的选中数据来进行填充,默认选中。
|
||||||
|
|||||||
@@ -159,7 +159,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
await this.setInits();
|
this.setInits();
|
||||||
|
},
|
||||||
|
updated() {
|
||||||
|
this.setInits();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//处理数据,以标准化。
|
//处理数据,以标准化。
|
||||||
@@ -186,20 +189,16 @@
|
|||||||
async setInits(){
|
async setInits(){
|
||||||
this.$nextTick(async function() {
|
this.$nextTick(async function() {
|
||||||
let t = this;
|
let t = this;
|
||||||
this.$tm.sleep(150).then(async function(){
|
let p = await t.$Querey('.tm-album',t,0).catch(e =>{});
|
||||||
let p = await t.$Querey('.tm-album',t).catch(e =>{});
|
if (!p[0]) return;
|
||||||
if (!p[0]) return;
|
let grid = t.grid || 1;
|
||||||
let grid = t.grid || 1;
|
let size = (p[0].width+t.gutter)/grid;
|
||||||
let size = (p[0].width+t.gutter)/grid;
|
let gutter = t.gutter*2
|
||||||
let gutter = t.gutter*2
|
let ratio = 750/uni.upx2px(750);
|
||||||
let ratio = 750/uni.upx2px(750);
|
let blv = size * ratio - gutter;
|
||||||
let blv = size * ratio - gutter;
|
t.alb_body_size = size * ratio;
|
||||||
t.alb_body_size = size * ratio;
|
t.alb_wk_body_size = p[0].width*ratio+t.gutter*2+(grid*2);
|
||||||
t.alb_wk_body_size = p[0].width*ratio+t.gutter*2+(grid*2);
|
t.alb_size = blv;
|
||||||
t.alb_size = blv;
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="tm-button " :class="[block ? 'd-block' : 'd-inline-block ']">
|
<view class="tm-button " :class="[block ? 'd-block' : 'd-inline-block ']" hover-class="opacity-6">
|
||||||
<view
|
<view
|
||||||
class="flex-center tm-button-btn fulled-height"
|
class="flex-center tm-button-btn fulled-height"
|
||||||
:class="[block ? '' : customDense_puted ? '' : 'ma-10', block ? 'd-block' : 'd-inline-block', black_tmeme ? 'bk' : '', customStyleTm]"
|
:class="[block ? '' : customDense_puted ? '' : 'ma-10', block ? 'd-block' : 'd-inline-block', black_tmeme ? 'bk' : '', customStyleTm]"
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<block v-if="vtype == true">
|
<block v-if="vtype == true">
|
||||||
<text
|
<text
|
||||||
v-if="!fab && icon"
|
v-if="!fab && icon"
|
||||||
:class="[`${prefx_computed} ${icon}`, fontColor ? `text-${colors.color}` : '', black_tmeme ? 'opacity-6' : '', 'px-12']"
|
:class="[`${prefx_computed} ${icon}`, fontColor ? `text-${colors.color}` : '', black_tmeme ? 'opacity-6' : '', 'px-12','flex-shrink']"
|
||||||
:style="{
|
:style="{
|
||||||
fontSize: `${icon_size.px}px`,
|
fontSize: `${icon_size.px}px`,
|
||||||
lineHeight:'normal'
|
lineHeight:'normal'
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
></text>
|
></text>
|
||||||
<text
|
<text
|
||||||
v-if="fab && icon && !loading && !titl"
|
v-if="fab && icon && !loading && !titl"
|
||||||
:class="[`${prefx_computed} ${icon}`, fontColor ? `text-${colors.color}` : '', black_tmeme ? 'opacity-6' : '']"
|
:class="[`${prefx_computed} ${icon}`, fontColor ? `text-${colors.color}` : '', black_tmeme ? 'opacity-6' : '','flex-shrink']"
|
||||||
:style="{
|
:style="{
|
||||||
fontSize: `${icon_size.px}px`,
|
fontSize: `${icon_size.px}px`,
|
||||||
lineHeight:'normal'
|
lineHeight:'normal'
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
></text>
|
></text>
|
||||||
<text
|
<text
|
||||||
v-if="fab && icon && !loading && titl"
|
v-if="fab && icon && !loading && titl"
|
||||||
:class="[`${prefx_computed} ${icon}`, fontColor ? `text-${color_tmeme}` : '', black_tmeme ? 'opacity-6' : '']"
|
:class="[`${prefx_computed} ${icon}`, fontColor ? `text-${color_tmeme}` : '', black_tmeme ? 'opacity-6' : '','flex-shrink']"
|
||||||
:style="{
|
:style="{
|
||||||
fontSize: `${icon_size.px}px`,
|
fontSize: `${icon_size.px}px`,
|
||||||
lineHeight:'normal'
|
lineHeight:'normal'
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
<block v-if="vtype == false"><tm-icons :size="icon_size.upx" :name="icon"></tm-icons></block>
|
<block v-if="vtype == false"><tm-icons :size="icon_size.upx" :name="icon"></tm-icons></block>
|
||||||
</slot>
|
</slot>
|
||||||
|
|
||||||
<view v-if="!fab || showValue" class="d-inline-block tm-button-label flex-shrink" :style="{ fontSize: font_size }" :class="[fontColor ? `text-${colors.color}` : '']">
|
<view v-if="!fab || showValue" class="d-inline-block tm-button-label flex-shrink" :style="{ fontSize: font_size }" :class="[fontColor ? `text-${colors.color}` : '',vertical ? 'full ' : '',]">
|
||||||
<slot name="default" :data="label">{{ label }}</slot>
|
<slot name="default" :data="label">{{ label }}</slot>
|
||||||
</view>
|
</view>
|
||||||
</button>
|
</button>
|
||||||
@@ -556,11 +556,13 @@ export default {
|
|||||||
line-height: 88upx;
|
line-height: 88upx;
|
||||||
height: 88upx;
|
height: 88upx;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
// #endif
|
// #endif
|
||||||
.tm-button-label {
|
.tm-button-label {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
||||||
}
|
}
|
||||||
&::after {
|
&::after {
|
||||||
border: none;
|
border: none;
|
||||||
@@ -671,6 +673,7 @@ export default {
|
|||||||
}
|
}
|
||||||
&.showValue {
|
&.showValue {
|
||||||
line-height: inherit !important;
|
line-height: inherit !important;
|
||||||
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.noGutter {
|
&.noGutter {
|
||||||
|
|||||||
@@ -54,13 +54,21 @@
|
|||||||
:key="index+'_acv'"><text class="text-size-s py-16">{{item}}</text>
|
:key="index+'_acv'"><text class="text-size-s py-16">{{item}}</text>
|
||||||
</tm-col>
|
</tm-col>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<tm-col :round="(item.start||item.end||item.checked)?4:0" @click="day_danxuanclick(item,index)"
|
<tm-col
|
||||||
:color="item.beginEnd?(item.checked===true||item.start||item.end?color_tmeme+(black_tmeme?' bk ':''):(item.guocheng?color_tmeme+' text opacity-7 '+(black_tmeme?'bk':''):'')):''"
|
@click="day_danxuanclick(item,index)"
|
||||||
|
color=""
|
||||||
:custom-class="isSelectedDateClass(item)"
|
:custom-class="isSelectedDateClass(item)"
|
||||||
align="middle" width="14.28%" v-for="(item,index) in nowData"
|
justify="center" width="14.28%"
|
||||||
:key="index">
|
v-for="(item,index) in nowData"
|
||||||
|
:key="index"
|
||||||
<view class="tm-calendar-col flex-center flex-col py-4" :class="[black_tmeme&&!item.beginEnd?' opacity-2 ':'']">
|
>
|
||||||
|
<view class="tm-calendar-col flex-center flex-col "
|
||||||
|
:style="[mode=='rang'?{width:'100%',height:'90rpx'}:{width:'90rpx',height:'90rpx',overflow: 'hidden','border-radius': '50% !important'}]"
|
||||||
|
:class="[
|
||||||
|
item.start?'round-l-24':'',
|
||||||
|
item.end?'round-r-24':'',
|
||||||
|
item.beginEnd?(item.checked===true||item.start||item.end?color_tmeme+(black_tmeme?' bk ':''):(item.guocheng?color_tmeme+' text opacity-7 '+(black_tmeme?'bk':''):'')):'',
|
||||||
|
black_tmeme&&!item.beginEnd?' opacity-2 ':'']">
|
||||||
|
|
||||||
<text class="text-size-n "
|
<text class="text-size-n "
|
||||||
:class="[
|
:class="[
|
||||||
@@ -70,19 +78,14 @@
|
|||||||
!item.beginEnd?'text-grey-lighten-3':''
|
!item.beginEnd?'text-grey-lighten-3':''
|
||||||
]"
|
]"
|
||||||
>{{item.day}}</text>
|
>{{item.day}}</text>
|
||||||
<!--
|
|
||||||
!item.nowMonth&&!item.guocheng&&!item.checked&&!item.start&&!item.end?(black?'text-grey-darken-3':'text-grey-lighten-1'):'',
|
|
||||||
item.checked||item.start||item.end?'text-white':(item.guocheng?'':'text-grey-lighten-1'),
|
|
||||||
item.guocheng?'text-'+color:'',
|
|
||||||
!item.beginEnd?'text-grey-lighten-3':'',
|
|
||||||
-->
|
|
||||||
<view class="text-size-xs text_bl"
|
<view class="text-size-xs text_bl"
|
||||||
>
|
>
|
||||||
<block v-if="item.start">
|
<block v-if="item.start">
|
||||||
开始
|
始
|
||||||
</block>
|
</block>
|
||||||
<block v-if="item.end">
|
<block v-if="item.end">
|
||||||
结束
|
-止
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<block v-if="!item.start&&!item.end">
|
<block v-if="!item.start&&!item.end">
|
||||||
@@ -134,6 +137,11 @@
|
|||||||
import tmRow from "@/tm-vuetify/components/tm-row/tm-row.vue"
|
import tmRow from "@/tm-vuetify/components/tm-row/tm-row.vue"
|
||||||
import tmButton from "@/tm-vuetify/components/tm-button/tm-button.vue"
|
import tmButton from "@/tm-vuetify/components/tm-button/tm-button.vue"
|
||||||
import tmPoup from "@/tm-vuetify/components/tm-poup/tm-poup.vue"
|
import tmPoup from "@/tm-vuetify/components/tm-poup/tm-poup.vue"
|
||||||
|
import * as dayjs from "@/tm-vuetify/tool/function/dayjs/dayjs.min.js"
|
||||||
|
const calendar = require("@/tm-vuetify/tool/function/dayjs/calendar.js")
|
||||||
|
dayjs.extend(calendar)
|
||||||
|
const DayJs = dayjs.default
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{tmIcons,tmCol,tmRow,tmButton,tmPoup},
|
components:{tmIcons,tmCol,tmRow,tmButton,tmPoup},
|
||||||
name: "tm-calendar",
|
name: "tm-calendar",
|
||||||
@@ -262,7 +270,7 @@
|
|||||||
if(!this.cal) return;
|
if(!this.cal) return;
|
||||||
// 自动更新默认的显示时间。
|
// 自动更新默认的显示时间。
|
||||||
if(this.mode=='day'){
|
if(this.mode=='day'){
|
||||||
let d = new Date().toLocaleDateString().replace(/\//g,'-');
|
let d = DayJs().format("YYYY/MM/DD HH:mm:ss");
|
||||||
if(this.defaultValue){
|
if(this.defaultValue){
|
||||||
d = this.defaultValue;
|
d = this.defaultValue;
|
||||||
}
|
}
|
||||||
@@ -343,10 +351,9 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
watchRangeTime(){
|
watchRangeTime(){
|
||||||
|
let d = DayJs().format("YYYY/MM/DD HH:mm:ss")
|
||||||
let d = new Date().toLocaleDateString().replace(/\//g,'-');
|
|
||||||
if(this.defaultValue){
|
if(this.defaultValue){
|
||||||
d = this.defaultValue;
|
d = DayJs(this.defaultValue).format("YYYY/MM/DD HH:mm:ss");
|
||||||
}
|
}
|
||||||
this.cal = new this.$tm.calendar({value:d,start:this.timeStart,end:this.timeEnd})
|
this.cal = new this.$tm.calendar({value:d,start:this.timeStart,end:this.timeEnd})
|
||||||
if(this.txt){
|
if(this.txt){
|
||||||
@@ -366,8 +373,8 @@
|
|||||||
if(this.bingStart&&this.bingEnd){
|
if(this.bingStart&&this.bingEnd){
|
||||||
|
|
||||||
this.fanxuanxuanwuBydate(
|
this.fanxuanxuanwuBydate(
|
||||||
new Date(this.bingStart.replace(/-/g,'/')),
|
DayJs(this.bingStart),
|
||||||
new Date(this.bingEnd.replace(/-/g,'/')),
|
DayJs(this.bingEnd),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -609,13 +616,14 @@
|
|||||||
// 通过外围 时间默认的选中
|
// 通过外围 时间默认的选中
|
||||||
fanxuanxuanwuBydate(start,end){
|
fanxuanxuanwuBydate(start,end){
|
||||||
if(!start||!end) return;
|
if(!start||!end) return;
|
||||||
|
// .format("YYYY/MM/DD HH:mm:ss")
|
||||||
|
|
||||||
this.$nextTick(function(){
|
this.$nextTick(function(){
|
||||||
if(start.getTime()>end.getTime()) return;
|
if(start.valueOf()>end.valueOf()) return;
|
||||||
// 获取开始月份的数据。
|
// 获取开始月份的数据。
|
||||||
let sobj = new this.$tm.calendar({value:start.toLocaleDateString().replace(/\//g,'-')});
|
let sobj = new this.$tm.calendar({value:start.format("YYYY/MM/DD HH:mm:ss")});
|
||||||
// 获取结束月份的数据。
|
// 获取结束月份的数据。
|
||||||
let eobj = new this.$tm.calendar({value:end.toLocaleDateString().replace(/\//g,'-')});
|
let eobj = new this.$tm.calendar({value:end.format("YYYY/MM/DD HH:mm:ss")});
|
||||||
function findItemToindex_only(obj,type){
|
function findItemToindex_only(obj,type){
|
||||||
let item=null;
|
let item=null;
|
||||||
for(let i=0;i<obj.length;i++){
|
for(let i=0;i<obj.length;i++){
|
||||||
@@ -657,7 +665,7 @@
|
|||||||
this.start = start_obj
|
this.start = start_obj
|
||||||
this.end = end_obj
|
this.end = end_obj
|
||||||
// 如果结束和开始相等。
|
// 如果结束和开始相等。
|
||||||
if(start.getTime()==end.getTime()){
|
if(start.valueOf()==end.valueOf()){
|
||||||
this.start = {...this.start,start:true,end:true}
|
this.start = {...this.start,start:true,end:true}
|
||||||
this.end = {...this.end,start:true,end:true}
|
this.end = {...this.end,start:true,end:true}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,12 +48,21 @@
|
|||||||
:key="index"><text class="text-size-s py-16">{{item}}</text>
|
:key="index"><text class="text-size-s py-16">{{item}}</text>
|
||||||
</tm-col>
|
</tm-col>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<tm-col :round="(item.start||item.end||item.checked)?4:0" @click="day_danxuanclick(item,index)"
|
<tm-col
|
||||||
:color="item.beginEnd?(item.checked===true||item.start||item.end?color_tmeme+(black_tmeme?' bk ':''):(item.guocheng?color_tmeme+' text opacity-7 '+(black_tmeme?'bk':''):'')):''"
|
@click="day_danxuanclick(item,index)"
|
||||||
|
color=""
|
||||||
:custom-class="isSelectedDateClass(item)"
|
:custom-class="isSelectedDateClass(item)"
|
||||||
align="middle" width="14.28%" v-for="(item,index) in nowData"
|
justify="center" width="14.28%"
|
||||||
:key="index">
|
v-for="(item,index) in nowData"
|
||||||
<view class="tm-calendarView-col flex-center flex-col" :class="[black&&!item.beginEnd?' opacity-2 ':'']">
|
:key="index"
|
||||||
|
>
|
||||||
|
<view class="tm-calendar-col flex-center flex-col "
|
||||||
|
:style="[mode=='rang'?{width:'100%',height:'90rpx'}:{width:'90rpx',height:'90rpx',overflow: 'hidden','border-radius': '50% !important'}]"
|
||||||
|
:class="[
|
||||||
|
item.start?'round-l-24':'',
|
||||||
|
item.end?'round-r-24':'',
|
||||||
|
item.beginEnd?(item.checked===true||item.start||item.end?color_tmeme+(black_tmeme?' bk ':''):(item.guocheng?color_tmeme+' text opacity-7 '+(black_tmeme?'bk':''):'')):'',
|
||||||
|
black_tmeme&&!item.beginEnd?' opacity-2 ':'']">
|
||||||
<text class="text-size-n"
|
<text class="text-size-n"
|
||||||
:class="[
|
:class="[
|
||||||
!item.nowMonth&&!item.guocheng&&!item.checked&&!item.start&&!item.end?(black_tmeme?'text-grey-darken-3':'text-grey-lighten-1'):'',
|
!item.nowMonth&&!item.guocheng&&!item.checked&&!item.start&&!item.end?(black_tmeme?'text-grey-darken-3':'text-grey-lighten-1'):'',
|
||||||
@@ -65,10 +74,10 @@
|
|||||||
<view class="text-size-xs text_bl"
|
<view class="text-size-xs text_bl"
|
||||||
>
|
>
|
||||||
<block v-if="item.start">
|
<block v-if="item.start">
|
||||||
开始
|
始
|
||||||
</block>
|
</block>
|
||||||
<block v-if="item.end">
|
<block v-if="item.end">
|
||||||
结束
|
-止
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<block v-if="!item.start&&!item.end">
|
<block v-if="!item.start&&!item.end">
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
return ps;
|
return ps;
|
||||||
},
|
},
|
||||||
isfinish:function(){
|
isfinish:function(){
|
||||||
if(this.now == this.time) return true;
|
if(this.now == this.time||this.now==0) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -302,19 +302,19 @@ export default {
|
|||||||
.tm-dialog {
|
.tm-dialog {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 600;
|
z-index: 600;
|
||||||
background-color: rgba(0, 0, 0, 0.35);
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(3px);
|
||||||
transition: all 0.35s;
|
transition: all 0.24s;
|
||||||
.success {
|
.success {
|
||||||
animation: success 0.35s linear;
|
animation: success 0.24s ease;
|
||||||
|
|
||||||
// transform: scale(1);
|
// transform: scale(1);
|
||||||
}
|
}
|
||||||
.clickover {
|
.clickover {
|
||||||
animation: clickover 0.35s linear;
|
animation: clickover 0.24s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@keyframes clickover {
|
@keyframes clickover {
|
||||||
|
|||||||
@@ -253,10 +253,10 @@
|
|||||||
this.$emit('change',elList);
|
this.$emit('change',elList);
|
||||||
},
|
},
|
||||||
inits() {
|
inits() {
|
||||||
|
this.grid = this.list.length;
|
||||||
if(this.grid==0) return;
|
if(this.grid==0) return;
|
||||||
this.$nextTick(async function() {
|
this.$nextTick(async function() {
|
||||||
let p = await this.$Querey(".tm-dragGrid", this).catch(e => {})
|
let p = await this.$Querey(".tm-dragGrid", this).catch(e => {})
|
||||||
this.grid = this.list.length;
|
|
||||||
this.listData = [];
|
this.listData = [];
|
||||||
//组件的宽度
|
//组件的宽度
|
||||||
this.w = uni.upx2px(this.width) || p[0].width || 300;
|
this.w = uni.upx2px(this.width) || p[0].width || 300;
|
||||||
|
|||||||
@@ -140,7 +140,6 @@
|
|||||||
jishunTopData() {
|
jishunTopData() {
|
||||||
this.$nextTick(async function() {
|
this.$nextTick(async function() {
|
||||||
this.listData = [];
|
this.listData = [];
|
||||||
|
|
||||||
let p = await this.$Querey(".tm-dragList", this).catch(e => {})
|
let p = await this.$Querey(".tm-dragList", this).catch(e => {})
|
||||||
this.w = uni.upx2px(this.width) || p[0].width;
|
this.w = uni.upx2px(this.width) || p[0].width;
|
||||||
this.h = uni.upx2px(this.height)
|
this.h = uni.upx2px(this.height)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
@touchcancel="$emit('touchcancel', $event)"
|
@touchcancel="$emit('touchcancel', $event)"
|
||||||
:open-type="openType"
|
:open-type="openType"
|
||||||
@click="click"
|
@click="click"
|
||||||
|
:padding="[0,0]"
|
||||||
:showValue="showText" vertical :label="label" :fontSize="fontSize"
|
:showValue="showText" vertical :label="label" :fontSize="fontSize"
|
||||||
:iconSize="iconSize" :theme="color_tmeme" round="rouned" :font-color="fontColor" :bgcolor="bgcolor"
|
:iconSize="iconSize" :theme="color_tmeme" round="rouned" :font-color="fontColor" :bgcolor="bgcolor"
|
||||||
:size="size" :width="width" :height="width" :icon="icon" fab>
|
:size="size" :width="width" :height="width" :icon="icon" fab>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<view v-if="title&&title!='true'" class="px-32 py-16 text-weight-b " :class="[`text-size-${fontSize}`,titleTheme, black_tmeme ? 'bk' : '']">
|
<view v-if="title&&title!='true'" class="px-32 py-16 text-weight-b " :class="[`text-size-${fontSize}`,titleTheme, black_tmeme ? 'bk' : '']">
|
||||||
<slot name="title" :title="title">{{ title }}</slot>
|
<slot name="title" :title="title">{{ title }}</slot>
|
||||||
</view>
|
</view>
|
||||||
<view v-show="chuliWsok==true">
|
<view >
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -77,6 +77,20 @@ export default {
|
|||||||
return this.$tm.vx.state().tmVuetify.black;
|
return this.$tm.vx.state().tmVuetify.black;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
provide(){
|
||||||
|
let t = this;
|
||||||
|
return {
|
||||||
|
GroupListStyles:()=>{
|
||||||
|
return {
|
||||||
|
margin: [0,0],
|
||||||
|
padding: [32,24],
|
||||||
|
shadow: 0,
|
||||||
|
round: 0,
|
||||||
|
borderBottom: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
targ:'tm-grouplist',
|
targ:'tm-grouplist',
|
||||||
@@ -99,47 +113,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
inits(){
|
inits(){
|
||||||
let t = this;
|
|
||||||
this.$nextTick(function () {
|
|
||||||
let ch = this.$children;
|
|
||||||
// #ifdef H5
|
|
||||||
ch = [];
|
|
||||||
let cld = this.$children[0].$children
|
|
||||||
|
|
||||||
while(cld){
|
|
||||||
if(cld[0].$children.length>0){
|
|
||||||
let ods = cld[0].$children;
|
|
||||||
ch =ods[ods.length-1].$children;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}else{
|
|
||||||
cld = cld[0]?.$children
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
|
|
||||||
ch.forEach((item,index)=>{
|
|
||||||
|
|
||||||
if(item.$options.name==="tm-listitem"){
|
|
||||||
item.setConfig({
|
|
||||||
margin: [0,0],
|
|
||||||
padding: [32,24],
|
|
||||||
shadow: 0,
|
|
||||||
round: 0,
|
|
||||||
borderBottom: index===ch.length-1?false:t.borderBottom
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// #ifndef H5
|
|
||||||
setTimeout(function() {
|
|
||||||
t.chuliWsok = true;
|
|
||||||
}, 30);
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
// 事件一定是子项目tm-listitem为group模式时,才会触发。
|
// 事件一定是子项目tm-listitem为group模式时,才会触发。
|
||||||
change(vue_uid) {
|
change(vue_uid) {
|
||||||
|
|||||||
@@ -1,187 +1,190 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 图标 -->
|
<!-- 图标 -->
|
||||||
<view @click="onclick" v-if="name" class="tm-icons vertical-align-top" style="display: inline-block;font-size: 0;" >
|
<view @click="onclick" v-if="name" class="tm-icons " >
|
||||||
<view class="flex-center " :style="{
|
<view
|
||||||
width: sizes,
|
class="tm-icons-item "
|
||||||
height: sizes,
|
:style="{
|
||||||
lineHeight:sizes,
|
width: sizes,
|
||||||
|
height: sizes,
|
||||||
}">
|
lineHeight: sizes
|
||||||
|
}"
|
||||||
|
>
|
||||||
<block v-if="vtype == false">
|
<block v-if="vtype == false">
|
||||||
<image :src="name" :style="{
|
<image
|
||||||
|
:src="name"
|
||||||
|
:style="{
|
||||||
width: sizes,
|
width: sizes,
|
||||||
height: sizes
|
height: sizes
|
||||||
}" mode="scaleToFill"></image>
|
}"
|
||||||
|
mode="scaleToFill"
|
||||||
|
></image>
|
||||||
</block>
|
</block>
|
||||||
<block v-if="vtype == true">
|
<block v-if="vtype == true">
|
||||||
<!-- #ifdef APP-NVUE -->
|
<!-- #ifdef APP-NVUE -->
|
||||||
<text :style="{
|
<text
|
||||||
|
:style="{
|
||||||
fontSize: sizes,
|
fontSize: sizes,
|
||||||
fontFamily:'iconfontTM'
|
fontFamily: 'iconfontTM'
|
||||||
}" class="icons "
|
}"
|
||||||
:class="[ black_tmeme ? colors+'-bk':colors, dense ? '' : 'pa-10', black ? 'opacity-6' : '']">{{iconName}}</text>
|
class="icons "
|
||||||
|
:class="[black_tmeme ? colors + '-bk' : colors, dense ? '' : 'pa-10', black ? 'opacity-6' : '']"
|
||||||
|
>
|
||||||
|
{{ iconName }}
|
||||||
|
</text>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
<!-- #ifndef APP-NVUE -->
|
||||||
<!-- #ifdef MP -->
|
<text
|
||||||
<text :style="{
|
:style="{
|
||||||
fontSize: sizes,
|
fontSize: sizes,
|
||||||
}" class="icons mt--4"
|
|
||||||
:class="[prefx_computed, black_tmeme ? 'bk' : '', iconName, colorTheme ? colors : '', dense ? '' : 'pa-10', black ? 'opacity-6' : '']"></text>
|
}"
|
||||||
|
class="icons "
|
||||||
|
:class="[prefx_computed, black_tmeme ? 'bk' : '', iconName, colorTheme ? colors : '', dense ? '' : 'pa-10', black ? 'opacity-6' : '']"
|
||||||
|
></text>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifndef MP -->
|
|
||||||
<text :style="{
|
|
||||||
fontSize: sizes,
|
|
||||||
}" class="icons "
|
|
||||||
:class="[prefx_computed, black_tmeme ? 'bk' : '', iconName, colorTheme ? colors : '', dense ? '' : 'pa-10', black ? 'opacity-6' : '']"></text>
|
|
||||||
<!-- #endif -->
|
|
||||||
|
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* 图标组件
|
* 图标组件
|
||||||
* @property {Boolean} dense = [true|false] 默认false,是否去除边距
|
* @property {Boolean} dense = [true|false] 默认false,是否去除边距
|
||||||
* @property {String} prefx = [iconfont] 默认iconfont,默认图标的前缀,对自定义图标时有好处。
|
* @property {String} prefx = [iconfont] 默认iconfont,默认图标的前缀,对自定义图标时有好处。
|
||||||
* @property {String} name = [] 默认'',图标名称,注意不带前缀。
|
* @property {String} name = [] 默认'',图标名称,注意不带前缀。
|
||||||
* @property {String | Number} size = [] 默认28, 图标大小,单位是upx
|
* @property {String | Number} size = [] 默认28, 图标大小,单位是upx
|
||||||
* @property {String} color = [primary] 默认primary, 图标主题颜色名
|
* @property {String} color = [primary] 默认primary, 图标主题颜色名
|
||||||
* @property {Function} click 图标点击事件。
|
* @property {Function} click 图标点击事件。
|
||||||
* @example <tm-icons name='icon-clear'></tm-icons>
|
* @example <tm-icons name='icon-clear'></tm-icons>
|
||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
dense: {
|
dense: {
|
||||||
//是否小边距
|
//是否小边距
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
black: {
|
black: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
prefx: {
|
prefx: {
|
||||||
type: String, //前缀
|
type: String, //前缀
|
||||||
default: 'iconfont'
|
default: 'iconfont'
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
type: String, //图标名称。
|
type: String, //图标名称。
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
type: String | Number, //图标名称。
|
type: String | Number, //图标名称。
|
||||||
default: 28
|
default: 28
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
type: String, //颜色名称或者颜色值。
|
type: String|null, //颜色名称或者颜色值。
|
||||||
default: 'primary'
|
default: 'primary'
|
||||||
},
|
},
|
||||||
//强制转换图标类型,不通过内置判定,解决自己引用图片svg图标时当作字体图标的错误。
|
//强制转换图标类型,不通过内置判定,解决自己引用图片svg图标时当作字体图标的错误。
|
||||||
iconType: {
|
iconType: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '' //img|icon
|
default: '' //img|icon
|
||||||
},
|
},
|
||||||
// 跟随主题色的改变而改变。
|
// 跟随主题色的改变而改变。
|
||||||
fllowTheme: {
|
fllowTheme: {
|
||||||
type: Boolean | String,
|
type: Boolean | String,
|
||||||
default: false
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
iconName: function() {
|
||||||
|
// #ifdef APP-NVUE || APP-PLUS-NVUE
|
||||||
|
let fontList = require('@/tm-vuetify/scss/iconfonts/iconfont.json');
|
||||||
|
let name = this.name.replace('icon-', '');
|
||||||
|
|
||||||
|
// fontList.glyphs
|
||||||
|
let itemIcon = fontList.glyphs.find((item, index) => {
|
||||||
|
return item.font_class == name;
|
||||||
|
});
|
||||||
|
return eval('"\\u' + itemIcon.unicode + '"');
|
||||||
|
// #endif
|
||||||
|
return this.name;
|
||||||
|
},
|
||||||
|
prefx_computed() {
|
||||||
|
let prefix = this.name.split('-')[0];
|
||||||
|
if (prefix == 'icon') return 'iconfont';
|
||||||
|
if (prefix == 'mdi') return 'mdi';
|
||||||
|
|
||||||
|
return prefix;
|
||||||
|
},
|
||||||
|
black_tmeme: function() {
|
||||||
|
return this.$tm.vx.state().tmVuetify.black;
|
||||||
|
},
|
||||||
|
vtype: function() {
|
||||||
|
if (this.name[0] == '.' || this.name[0] == '/' || this.name.substring(0, 4) == 'http' || this.name.substring(0, 5) == 'https' || this.name.substring(0, 3) == 'ftp') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
sizes: function() {
|
||||||
|
if (typeof this.size === 'string') {
|
||||||
|
if (/[rpx|upx|rem|em|vx|vh|px]$/.test(this.size)) {
|
||||||
|
return this.size;
|
||||||
|
}
|
||||||
|
return uni.upx2px(parseInt(this.size)) + 'px';
|
||||||
|
}
|
||||||
|
if (typeof this.size === 'number' && !isNaN(this.size)) {
|
||||||
|
return uni.upx2px(this.size) + 'px';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
color_tmeme: function() {
|
||||||
iconName: function() {
|
if (this.$tm.vx.state().tmVuetify.color !== null && this.$tm.vx.state().tmVuetify.color && this.fllowTheme) {
|
||||||
// #ifdef APP-NVUE || APP-PLUS-NVUE
|
return this.$tm.vx.state().tmVuetify.color;
|
||||||
let fontList = require('@/tm-vuetify/scss/iconfonts/iconfont.json');
|
|
||||||
let name = this.name.replace('icon-', '');
|
|
||||||
|
|
||||||
// fontList.glyphs
|
|
||||||
let itemIcon = fontList.glyphs.find((item, index) => {
|
|
||||||
return item.font_class == name;
|
|
||||||
})
|
|
||||||
return eval('"\\u' + itemIcon.unicode + '"');
|
|
||||||
// #endif
|
|
||||||
return this.name;
|
|
||||||
},
|
|
||||||
prefx_computed(){
|
|
||||||
let prefix = this.name.split('-')[0];
|
|
||||||
if(prefix=='icon') return 'iconfont';
|
|
||||||
if(prefix=='mdi') return 'mdi';
|
|
||||||
|
|
||||||
return prefix;
|
|
||||||
},
|
|
||||||
black_tmeme: function() {
|
|
||||||
|
|
||||||
return this.$tm.vx.state().tmVuetify.black;
|
|
||||||
},
|
|
||||||
vtype: function() {
|
|
||||||
if (this.name[0] == "." ||
|
|
||||||
this.name[0] == "/" ||
|
|
||||||
this.name.substring(0, 4) == 'http' ||
|
|
||||||
this.name.substring(0, 5) == 'https' ||
|
|
||||||
this.name.substring(0, 3) == 'ftp'
|
|
||||||
) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
sizes: function() {
|
|
||||||
if (typeof this.size === 'string') {
|
|
||||||
if (/[rpx|upx|rem|em|vx|vh|px]$/.test(this.size)) {
|
|
||||||
return this.size;
|
|
||||||
}
|
|
||||||
return uni.upx2px(parseInt(this.size)) + 'px';
|
|
||||||
}
|
|
||||||
if (typeof this.size === 'number' && !isNaN(this.size)) {
|
|
||||||
return uni.upx2px(this.size) + 'px';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
color_tmeme: function() {
|
|
||||||
|
|
||||||
if (this.$tm.vx.state().tmVuetify.color !== null && this.$tm.vx.state().tmVuetify.color && this
|
|
||||||
.fllowTheme) {
|
|
||||||
return this.$tm.vx.state().tmVuetify.color;
|
|
||||||
}
|
|
||||||
return this.color;
|
|
||||||
},
|
|
||||||
colors: {
|
|
||||||
get: function() {
|
|
||||||
if (!this.color_tmeme) return 'text-primary';
|
|
||||||
if (!this.$TestColor(this.color_tmeme)) {
|
|
||||||
return this.color_tmeme;
|
|
||||||
}
|
|
||||||
return 'text-' + this.color_tmeme;
|
|
||||||
},
|
|
||||||
set: function() {
|
|
||||||
if (!this.$TestColor(this.color_tmeme)) {
|
|
||||||
this.colorTheme = false;
|
|
||||||
return this.color_tmeme;
|
|
||||||
}
|
|
||||||
this.colorTheme = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return this.color;
|
||||||
},
|
},
|
||||||
data() {
|
colors: {
|
||||||
return {
|
get: function() {
|
||||||
colorTheme: true
|
if (!this.color_tmeme) return 'text-primary';
|
||||||
};
|
if (!this.$TestColor(this.color_tmeme)) {
|
||||||
},
|
return this.color_tmeme;
|
||||||
methods: {
|
}
|
||||||
onclick(e) {
|
return 'text-' + this.color_tmeme;
|
||||||
this.$emit('click', e);
|
},
|
||||||
|
set: function() {
|
||||||
|
if (!this.$TestColor(this.color_tmeme)) {
|
||||||
|
this.colorTheme = false;
|
||||||
|
return this.color_tmeme;
|
||||||
|
}
|
||||||
|
this.colorTheme = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
colorTheme: true
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onclick(e) {
|
||||||
|
this.$emit('click', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.tm-icons {
|
.tm-icons {
|
||||||
vertical-align: middle;
|
display: inline-block;
|
||||||
|
.tm-icons-item{
|
||||||
.icons {
|
display: flex;
|
||||||
&.black {
|
justify-content: center;
|
||||||
color: #fff;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
.icons {
|
||||||
|
&.black {
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<view v-if="title" class="d-inline-block "
|
<view v-if="title" class="d-inline-block "
|
||||||
:style="{fontSize:title_size}"
|
:style="{fontSize:title_size}"
|
||||||
:class="[titleClass,black_tmeme?'bk text-grey-lighten-3':'']">
|
:class="[titleClass,black_tmeme?'bk text-grey-lighten-3':'']">
|
||||||
<text v-if="required" class="text-red">*</text>
|
<text v-if="_required" class="text-red">*</text>
|
||||||
<slot name="default" :title="title">
|
<slot name="default" :title="title">
|
||||||
{{title}}
|
{{title}}
|
||||||
</slot>
|
</slot>
|
||||||
@@ -368,6 +368,9 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
_required(){
|
||||||
|
return this.required
|
||||||
|
},
|
||||||
height_rpx:function(){
|
height_rpx:function(){
|
||||||
return this.height;
|
return this.height;
|
||||||
},
|
},
|
||||||
@@ -430,7 +433,7 @@
|
|||||||
set:function(val){
|
set:function(val){
|
||||||
this.$emit('input', val)
|
this.$emit('input', val)
|
||||||
this.$emit('update:value', val)
|
this.$emit('update:value', val)
|
||||||
if (this.required) {
|
if (this._required) {
|
||||||
this.$nextTick(function(){
|
this.$nextTick(function(){
|
||||||
this.verifyInput();
|
this.verifyInput();
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- 列表项目,类似单元格。 -->
|
<!-- 列表项目,类似单元格。 -->
|
||||||
<template>
|
<template>
|
||||||
<view class="tm-listitem ">
|
<view class="tm-listitem " :hover-class="url?'opacity-6':''">
|
||||||
<view
|
<view
|
||||||
|
|
||||||
@click="click"
|
@click="click"
|
||||||
@@ -280,9 +280,15 @@ export default {
|
|||||||
return this.$tm.vx.state().tmVuetify.color;
|
return this.$tm.vx.state().tmVuetify.color;
|
||||||
}
|
}
|
||||||
return this.leftIconColor;
|
return this.leftIconColor;
|
||||||
|
},
|
||||||
|
groupPublickStyle:function(){
|
||||||
|
if(!this.GroupListStyles) return null
|
||||||
|
return this.GroupListStyles()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
inject:{
|
||||||
|
GroupListStyles:{default:null}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pz_theme: {
|
pz_theme: {
|
||||||
@@ -296,13 +302,25 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.pz_themeCus = {
|
if(this.groupPublickStyle){
|
||||||
margin: this.margin,
|
this.pz_themeCus = {
|
||||||
padding: this.padding,
|
margin: this.groupPublickStyle.margin,
|
||||||
shadow: this.shadow,
|
padding: this.groupPublickStyle.padding,
|
||||||
round: this.round,
|
shadow: this.groupPublickStyle.shadow,
|
||||||
borderBottom: this.borderBottom
|
round: this.groupPublickStyle.round,
|
||||||
};
|
borderBottom: this.groupPublickStyle.borderBottom||this.borderBottom
|
||||||
|
};
|
||||||
|
}else{
|
||||||
|
this.pz_themeCus = {
|
||||||
|
margin: this.margin,
|
||||||
|
padding: this.padding,
|
||||||
|
shadow: this.shadow,
|
||||||
|
round: this.round,
|
||||||
|
borderBottom: this.borderBottom
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
<text class="iconfont icon-angle-left" :class="[`text-${fontColorTheme}`]" :style="{ fontSize: '28rpx' }"></text>
|
<text class="iconfont icon-angle-left" :class="[`text-${fontColorTheme}`]" :style="{ fontSize: '28rpx' }"></text>
|
||||||
</navigator>
|
</navigator>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<slot name="left" :data="{ style: widths, isTransparent: isTransparent, title: title }"></slot>
|
<slot name="left" :data="{ style: widths, isTransparent: isTransparent, title: title }"></slot>
|
||||||
</view>
|
</view>
|
||||||
<view class="center flex-center text-size-g text-overflow text-align-center" :class="[`text-${fontColorTheme}`]">
|
<view class="center flex-center text-size-g text-overflow text-align-center" :class="[`text-${fontColorTheme}`]">
|
||||||
@@ -36,6 +35,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -61,6 +61,9 @@
|
|||||||
components: {
|
components: {
|
||||||
tmIcons
|
tmIcons
|
||||||
},
|
},
|
||||||
|
options:{
|
||||||
|
multipleSlots: true
|
||||||
|
},
|
||||||
name: 'tm-menubars',
|
name: 'tm-menubars',
|
||||||
props: {
|
props: {
|
||||||
// 是否开启暗黑模式
|
// 是否开启暗黑模式
|
||||||
|
|||||||
@@ -109,18 +109,12 @@ import tmIcons from "@/tm-vuetify/components/tm-icons/tm-icons.vue"
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.$nextTick(function(){
|
this.$nextTick(function(){
|
||||||
this.downOpen = this.open;
|
this.downOpen = this.open;
|
||||||
|
this.getRect()
|
||||||
let t = this;
|
|
||||||
|
|
||||||
t.$Querey('.tm-more-content',t).then(syninfo=>{
|
|
||||||
if (syninfo[0].height - 40 <= t.hs) {
|
|
||||||
t.show = false;
|
|
||||||
}
|
|
||||||
}).catch(e => {});
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
updated() {
|
||||||
|
this.getRect()
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
hs: function() {
|
hs: function() {
|
||||||
return uni.upx2px(this.maxHeight) || 100;
|
return uni.upx2px(this.maxHeight) || 100;
|
||||||
@@ -131,6 +125,14 @@ import tmIcons from "@/tm-vuetify/components/tm-icons/tm-icons.vue"
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getRect(){
|
||||||
|
let t = this;
|
||||||
|
t.$Querey('.tm-more-content',t,0).then(syninfo=>{
|
||||||
|
if (syninfo[0].height - 40 <= t.hs) {
|
||||||
|
t.show = false;
|
||||||
|
}
|
||||||
|
}).catch(e => {});
|
||||||
|
},
|
||||||
openMore() {
|
openMore() {
|
||||||
this.$emit('click');
|
this.$emit('click');
|
||||||
if (this.disabled) return;
|
if (this.disabled) return;
|
||||||
|
|||||||
@@ -232,7 +232,7 @@
|
|||||||
this.aniData = '';
|
this.aniData = '';
|
||||||
let aniData = uni.createAnimation({
|
let aniData = uni.createAnimation({
|
||||||
duration:240,
|
duration:240,
|
||||||
timingFunction: 'linear',
|
timingFunction: 'ease',
|
||||||
})
|
})
|
||||||
this.aniData = aniData;
|
this.aniData = aniData;
|
||||||
if(pos=='bottom'){
|
if(pos=='bottom'){
|
||||||
@@ -327,15 +327,15 @@
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
&.blur {
|
&.blur {
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(3px);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.on {
|
&.on {
|
||||||
animation: opta 1s linear;
|
animation: opta 1s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.off {
|
&.off {
|
||||||
animation: opta_off 0.35s linear;
|
animation: opta_off 0.24s ease;
|
||||||
}
|
}
|
||||||
.tm-poup-wk {
|
.tm-poup-wk {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -393,7 +393,7 @@
|
|||||||
|
|
||||||
@keyframes opta {
|
@keyframes opta {
|
||||||
from {
|
from {
|
||||||
opacity: 0.6;
|
opacity: 0.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
@@ -495,7 +495,7 @@
|
|||||||
@keyframes Centerleft {
|
@keyframes Centerleft {
|
||||||
from {
|
from {
|
||||||
transform: scale(0.65);
|
transform: scale(0.65);
|
||||||
opacity: 0.65;
|
opacity: 0.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
@@ -512,7 +512,7 @@
|
|||||||
|
|
||||||
to {
|
to {
|
||||||
transform: scale(0.65);
|
transform: scale(0.65);
|
||||||
opacity: 0.65;
|
opacity: 0.3;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,19 +166,25 @@ export default {
|
|||||||
destroyed() {
|
destroyed() {
|
||||||
clearInterval(this.tmiddd)
|
clearInterval(this.tmiddd)
|
||||||
},
|
},
|
||||||
async mounted() {
|
mounted() {
|
||||||
|
this.getRect()
|
||||||
this.$nextTick(async function(){
|
|
||||||
let p = await this.$Querey(".tm-propress",this).catch(e=>{})
|
|
||||||
|
|
||||||
this.width_upx = p[0].width+'px';
|
|
||||||
if(this.loading){
|
|
||||||
await this.startAni();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
updated() {
|
||||||
|
this.getRect()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getRect(){
|
||||||
|
let t =this
|
||||||
|
this.$Querey(".tm-propress",this,0).then((p)=>{
|
||||||
|
if(!p) return;
|
||||||
|
if(!p[0].width) return;
|
||||||
|
t.width_upx = p[0].width+'px';
|
||||||
|
if(t.loading){
|
||||||
|
t.startAni();
|
||||||
|
}
|
||||||
|
}).catch(e=>{})
|
||||||
|
},
|
||||||
async startAni(){
|
async startAni(){
|
||||||
// clearInterval(this.tmiddd)
|
// clearInterval(this.tmiddd)
|
||||||
let t = this;
|
let t = this;
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view @click="$emit('click',$event)" :gutter="gutter" class="tm--row" :class="[preatClass]" >
|
<view @click="$emit('click',$event)" :gutter="gutter" class="tm--row" :class="[preatClass]" >
|
||||||
<view class="tm--row--body" :style="style" :class="[customClass]">
|
<view class="tm--row--body" :style="style" :class="[customClass]">
|
||||||
<view v-show="chuliWsok==true">
|
<slot></slot>
|
||||||
<slot></slot>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -64,30 +61,34 @@
|
|||||||
width_px:0,
|
width_px:0,
|
||||||
children_num:0,
|
children_num:0,
|
||||||
style:'',
|
style:'',
|
||||||
chuliWsok:false,//处理完宽度计算信息再进行显示内部内容。
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async mounted() {
|
updated() {
|
||||||
let t = this;
|
this.getContinaRect()
|
||||||
|
},
|
||||||
await this.$Querey('.tm--row',this).then(preantw=>{
|
mounted() {
|
||||||
t.width_px = preantw[0].width;
|
this.getContinaRect()
|
||||||
// #ifndef H5
|
},
|
||||||
t.children_num = t.$children.length;
|
methods:{
|
||||||
// #endif
|
getContinaRect(){
|
||||||
// #ifdef H5
|
let t = this;
|
||||||
t.children_num = t.$children[0].$children[0].$children[0].$children.length;
|
this.$Querey('.tm--row',this).then(preantw=>{
|
||||||
// #endif
|
t.width_px = preantw[0].width;
|
||||||
t.style = uni.$tm.objToString({
|
// #ifndef H5
|
||||||
'justify-content':t.justify,
|
t.children_num = t.$children.length;
|
||||||
'align-items':t.align,
|
// #endif
|
||||||
'width':t.width,
|
// #ifdef H5
|
||||||
'height':!t.height?'default':(uni.upx2px(t.height)+'px')
|
t.children_num = t.$children[0].$children[0].$children[0].$children.length;
|
||||||
},';');
|
// #endif
|
||||||
|
t.style = uni.$tm.objToString({
|
||||||
t.chuliWsok = true;
|
'justify-content':t.justify,
|
||||||
}).catch(e=>{})
|
'align-items':t.align,
|
||||||
|
'width':t.width,
|
||||||
|
'height':!t.height?'default':(uni.upx2px(t.height)+'px')
|
||||||
|
},';');
|
||||||
|
|
||||||
|
}).catch(e=>{})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -191,10 +191,10 @@
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
let t = this;
|
let t = this;
|
||||||
uni.$tm.sleep(30).then(()=>{
|
t.setInits();
|
||||||
t.setInits();
|
},
|
||||||
|
updated() {
|
||||||
})
|
this.setInits();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setInits() {
|
setInits() {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
]"
|
]"
|
||||||
|
|
||||||
>
|
>
|
||||||
<view class="fulled" v-if="showSheet">
|
<view class="fulled" >
|
||||||
<slot name="default"></slot>
|
<slot name="default"></slot>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -151,25 +151,7 @@ export default {
|
|||||||
return this.$tm.vx.state().tmVuetify.black;
|
return this.$tm.vx.state().tmVuetify.black;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
showSheet:true,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
// #ifdef APP-VUE || APP-PLUS || MP
|
|
||||||
this.showSheet = false;
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
let t= this;
|
|
||||||
|
|
||||||
// #ifdef APP-VUE || APP-PLUS || MP
|
|
||||||
setTimeout(function() {
|
|
||||||
t.showSheet = true;
|
|
||||||
}, 30);
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
@touchstart="touchstart"
|
@touchstart="touchstart"
|
||||||
@touchmove.stop.prevent="touchsmove"
|
@touchmove.stop.prevent="touchsmove"
|
||||||
@touchend="touchsend"
|
@touchend="touchsend"
|
||||||
|
|
||||||
@mousedown="touchstart"
|
@mousedown="touchstart"
|
||||||
@mousemove.stop.prevent="touchsmove"
|
@mousemove.stop.prevent="touchsmove"
|
||||||
@mouseup="touchsend"
|
@mouseup="touchsend"
|
||||||
|
|||||||
@@ -244,6 +244,17 @@
|
|||||||
this.barLeft = rdl >= this.sliderWidth || rdl < 0 ? this.sliderWidth : rdl;
|
this.barLeft = rdl >= this.sliderWidth || rdl < 0 ? this.sliderWidth : rdl;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
async updated() {
|
||||||
|
this.$nextTick(async function() {
|
||||||
|
await this.getwidth();
|
||||||
|
if (Math.abs(this.value) > Math.abs(this.max)) {
|
||||||
|
this.isError = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let rdl = this.sliderWidth * (Math.abs(this.value) / Math.abs(this.max));
|
||||||
|
this.barLeft = rdl >= this.sliderWidth || rdl < 0 ? this.sliderWidth : rdl;
|
||||||
|
});
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
barStart(e) {
|
barStart(e) {
|
||||||
|
|
||||||
@@ -306,7 +317,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
async getwidth() {
|
async getwidth() {
|
||||||
let res = await this.$Querey('.tm-slider-id', this).catch(e=>{});
|
let res = await this.$Querey('.tm-slider-id', this,0).catch(e=>{});
|
||||||
res[0].width = res[0].width||uni.upx2px(this.width);
|
res[0].width = res[0].width||uni.upx2px(this.width);
|
||||||
res[0].height = res[0].height||uni.upx2px(this.height);
|
res[0].height = res[0].height||uni.upx2px(this.height);
|
||||||
if (this.showLeft === false && this.showRight === false) {
|
if (this.showLeft === false && this.showRight === false) {
|
||||||
|
|||||||
@@ -297,6 +297,20 @@
|
|||||||
this.barLeft_1 = rdl_1 >= this.sliderWidth || rdl_1 < 0 ? this.sliderWidth : rdl_1;
|
this.barLeft_1 = rdl_1 >= this.sliderWidth || rdl_1 < 0 ? this.sliderWidth : rdl_1;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
updated() {
|
||||||
|
this.$nextTick(async function() {
|
||||||
|
await this.getwidth();
|
||||||
|
|
||||||
|
if (Math.abs(this.value[1]) > Math.abs(this.max)) {
|
||||||
|
this.isError = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let rdl = this.sliderWidth * (Math.abs(this.value[0]) / Math.abs(this.max));
|
||||||
|
this.barLeft = rdl >= this.sliderWidth || rdl < 0 ? this.sliderWidth : rdl;
|
||||||
|
let rdl_1 = this.sliderWidth * (Math.abs(this.value[1]) / Math.abs(this.max));
|
||||||
|
this.barLeft_1 = rdl_1 >= this.sliderWidth || rdl_1 < 0 ? this.sliderWidth : rdl_1;
|
||||||
|
});
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
barStart(e) {
|
barStart(e) {
|
||||||
if (this.disabled || this.isError) return;
|
if (this.disabled || this.isError) return;
|
||||||
@@ -407,7 +421,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
async getwidth() {
|
async getwidth() {
|
||||||
let res = await this.$Querey('.tm-slider-id', this).catch(e=>{});
|
let res = await this.$Querey('.tm-slider-id', this,0).catch(e=>{});
|
||||||
res[0].width = res[0].width||uni.upx2px(this.width);
|
res[0].width = res[0].width||uni.upx2px(this.width);
|
||||||
res[0].height = res[0].height||uni.upx2px(this.height);
|
res[0].height = res[0].height||uni.upx2px(this.height);
|
||||||
|
|
||||||
|
|||||||
@@ -1,83 +1,43 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="tm-swiper " :class="[inline ? 'd-inline-block' : '']">
|
<view class="tm-swiper " :class="[inline ? 'd-inline-block' : '']">
|
||||||
<swiper
|
<swiper :previous-margin="`${ani3d}rpx`" :next-margin="`${ani3d}rpx`" :style="{
|
||||||
:previous-margin="`${ani3d}rpx`"
|
|
||||||
:next-margin="`${ani3d}rpx`"
|
|
||||||
:style="{
|
|
||||||
width: w_s + 'rpx',
|
width: w_s + 'rpx',
|
||||||
height: h_s + 'rpx'
|
height: h_s + 'rpx'
|
||||||
}"
|
}" :vertical="vertical" :autoplay="autoplay&&!isPlayVedio" :circular="circular" :interval="interval" :duration="duration"
|
||||||
:vertical="vertical"
|
:indicator-active-color="color_tmeme" :current="nowIndex" @change="change" :class="[round_num > 0 ? ` round-${round_num} overflow` : '']">
|
||||||
:autoplay="autoplay && !isPlayVedio"
|
|
||||||
:circular="circular"
|
|
||||||
:interval="interval"
|
|
||||||
:duration="duration"
|
|
||||||
:indicator-active-color="color_tmeme"
|
|
||||||
:current="nowIndex"
|
|
||||||
@change="change"
|
|
||||||
>
|
|
||||||
<block v-for="(item, index) in dataList" :key="index">
|
<block v-for="(item, index) in dataList" :key="index">
|
||||||
<swiper-item
|
<swiper-item :style="{
|
||||||
:style="{
|
|
||||||
width: w_s + 'rpx',
|
width: w_s + 'rpx',
|
||||||
height: h_s + 'rpx'
|
height: h_s + 'rpx'
|
||||||
}"
|
}" class="shadow-24" :class="[round_num > 0 ? ` round-${round_num} overflow` : '']">
|
||||||
class="shadow-24"
|
|
||||||
:class="[round_num > 0 ? ` round-${round_num} overflow` : '']"
|
|
||||||
>
|
|
||||||
<view
|
<view
|
||||||
:class="[
|
:class="[nowIndex !== index&&ani3d>0?'a3d':'',round_num > 0 ? ` round-${round_num} overflow` : '',nowIndex<index&&ani3d>0?'a3dL':'',nowIndex>index&&ani3d>0?'a3dR':'']"
|
||||||
nowIndex !== index && ani3d > 0 ? 'a3d' : '',
|
class="tm-swiper-ik fulled fulled-height" :key="index">
|
||||||
round_num > 0 ? ` round-${round_num} overflow` : '',
|
|
||||||
nowIndex < index && ani3d > 0 ? 'a3dL' : '',
|
|
||||||
nowIndex > index && ani3d > 0 ? 'a3dR' : ''
|
|
||||||
]"
|
|
||||||
class="tm-swiper-ik fulled fulled-height"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<view class="actvieMarginDh">
|
<view class="actvieMarginDh">
|
||||||
<view class="actvieMarginDh-item" :class="[round_num > 0 ? ` round-${round_num} overflow` : '']">
|
<view class="actvieMarginDh-item"
|
||||||
<image
|
:class="[round_num > 0 ? ` round-${round_num} overflow` : '']">
|
||||||
v-if="item.dtype != 'video'"
|
<image v-if="item.dtype!='video'" @click="itemClick(item)" :style="{
|
||||||
@click="itemClick(item)"
|
|
||||||
:style="{
|
|
||||||
height: h_s + 'rpx',
|
height: h_s + 'rpx',
|
||||||
width: w_s - margin_px + 'rpx'
|
width: (w_s - margin_px) + 'rpx'
|
||||||
}"
|
}" @load="imgload($event, index)" :src="item.url"
|
||||||
@load="imgload($event, index)"
|
:class="[round_num > 0 ? ` round-${round_num} overflow` : '']"></image>
|
||||||
:src="item.url"
|
<video @play="isPlayVedio = true" @pause="isPlayVedio=false" @ended="isPlayVedio=false" :autoplay="nowIndex == index?true:false" :style="{
|
||||||
:class="[round_num > 0 ? ` round-${round_num} overflow` : '']"
|
|
||||||
></image>
|
|
||||||
<video
|
|
||||||
@play="isPlayVedio = true"
|
|
||||||
@pause="isPlayVedio = false"
|
|
||||||
@ended="isPlayVedio = false"
|
|
||||||
:autoplay="nowIndex == index ? true : false"
|
|
||||||
:style="{
|
|
||||||
height: h_s + 'rpx',
|
height: h_s + 'rpx',
|
||||||
width: w_s - margin_px + 'rpx'
|
width: (w_s - margin_px) + 'rpx'
|
||||||
}"
|
}" v-if="item.dtype=='video'" :src="item.url"></video>
|
||||||
v-if="item.dtype == 'video'"
|
|
||||||
:src="item.url"
|
|
||||||
></video>
|
|
||||||
|
|
||||||
<view
|
<view v-if="item.title" :style="{
|
||||||
v-if="item.title"
|
width: (w_s - margin_px) + 'rpx'
|
||||||
:style="{
|
}" class="flex-start relative ">
|
||||||
width: w_s - margin_px + 'rpx'
|
|
||||||
}"
|
|
||||||
class="flex-start relative "
|
|
||||||
>
|
|
||||||
<view
|
<view
|
||||||
class="text-size-s px-16 absolute b-0 l-0 zIndex-14 flex-start text-overflow text-white"
|
class="text-size-s px-16 absolute b-0 l-0 zIndex-14 flex-start text-overflow text-white"
|
||||||
:style="{
|
:style="{
|
||||||
height: '66rpx',
|
height: '66rpx',
|
||||||
width: w_s - margin_px - 32 + 'rpx',
|
width: (w_s - margin_px-32) + 'rpx',
|
||||||
lineHeight: '66rpx',
|
lineHeight:'66rpx',
|
||||||
background: 'rgba(0,0,0,0.4)'
|
background:'rgba(0,0,0,0.4)'
|
||||||
}"
|
}">
|
||||||
>
|
{{item.title}}
|
||||||
{{ item.title }}
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -86,24 +46,19 @@
|
|||||||
</swiper-item>
|
</swiper-item>
|
||||||
</block>
|
</block>
|
||||||
</swiper>
|
</swiper>
|
||||||
<view class="tm-swiper-dot" v-if="indicatorDots && nowshowDot" :class="[dotDirection]">
|
<view class="tm-swiper-dot" v-if="indicatorDots&&nowshowDot" :class="[dotDirection]">
|
||||||
|
|
||||||
<block v-if="dotModel != 'round'">
|
<block v-if="dotModel != 'round'">
|
||||||
<view
|
<view @click="nowIndex = index" v-for="(item, index) in dataList" :key="index"
|
||||||
@click="nowIndex = index"
|
|
||||||
v-for="(item, index) in dataList"
|
|
||||||
:key="index"
|
|
||||||
class="tm-swiper-dot-item flex-center mx-8"
|
class="tm-swiper-dot-item flex-center mx-8"
|
||||||
:class="[nowIndex == index ? color_tmeme : 'unactive', dotModel]"
|
:class="[nowIndex == index ? color_tmeme : 'unactive', dotModel]">
|
||||||
>
|
|
||||||
<text v-if="dotModel === 'number'" class="text-size-xs">{{ index + 1 }}</text>
|
<text v-if="dotModel === 'number'" class="text-size-xs">{{ index + 1 }}</text>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<block v-if="dotModel == 'round'">
|
<block v-if="dotModel == 'round'">
|
||||||
<view
|
<view :class="[dotModel]"
|
||||||
:class="[dotModel]"
|
|
||||||
class="text-size-xs balck text-white round-24 px-24 tm-swiper-dot-item flex-center flex-shrink"
|
class="text-size-xs balck text-white round-24 px-24 tm-swiper-dot-item flex-center flex-shrink"
|
||||||
:style="{ height: '40rpx', minWidth: '60rpx' }"
|
:style="{ height: '40rpx', minWidth: '60rpx' }">
|
||||||
>
|
|
||||||
{{ nowIndex + 1 + '/' + dataList.length }}
|
{{ nowIndex + 1 + '/' + dataList.length }}
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
@@ -112,353 +67,357 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* 图片轮播
|
* 图片轮播
|
||||||
* @description 很参数与原官方相同。
|
* @description 很参数与原官方相同。
|
||||||
* @property {Number} width = [] 默认:0,轮播宽度,0为自己计算。
|
* @property {Number} width = [] 默认:0,轮播宽度,0为自己计算。
|
||||||
* @property {Number} height = [] 默认:0,轮播高度,0为自己计算。
|
* @property {Number} height = [] 默认:0,轮播高度,0为自己计算。
|
||||||
* @property {Array} list = [] 默认:[],图片列表,可以是string数组或者object数组。
|
* @property {Array} list = [] 默认:[],图片列表,可以是string数组或者object数组。
|
||||||
* @property {String} rang-key = [] 默认:[],图片列表object数组时,需要提供图片地址 的键值。
|
* @property {String} rang-key = [] 默认:[],图片列表object数组时,需要提供图片地址 的键值。
|
||||||
* @property {Boolean} inline = [] 默认:false,是否内联,方便一排放多个轮播组件。
|
* @property {Boolean} inline = [] 默认:false,是否内联,方便一排放多个轮播组件。
|
||||||
* @property {Boolean} previmage = [] 默认:true,是否预览图片,点击图片时,放大预览。
|
* @property {Boolean} previmage = [] 默认:true,是否预览图片,点击图片时,放大预览。
|
||||||
* @property {Boolean} vertical = [] 默认:false,是否竖向滚动。
|
* @property {Boolean} vertical = [] 默认:false,是否竖向滚动。
|
||||||
* @property {Boolean} circular = [] 默认:false,是否采用衔接滑动,即播放到末尾后重新回到开头
|
* @property {Boolean} circular = [] 默认:false,是否采用衔接滑动,即播放到末尾后重新回到开头
|
||||||
* @property {Boolean} autoplay = [] 默认:false,是否自动切换
|
* @property {Boolean} autoplay = [] 默认:false,是否自动切换
|
||||||
* @property {Number} interval = [] 默认:3000,自动切换时间间隔
|
* @property {Number} interval = [] 默认:3000,自动切换时间间隔
|
||||||
* @property {Number} duration = [] 默认:500,滑动动画时长
|
* @property {Number} duration = [] 默认:500,滑动动画时长
|
||||||
* @property {Number} ani3d = [] 默认:0,开启3d缩放动画
|
* @property {Number} ani3d = [] 默认:0,开启3d缩放动画
|
||||||
* @property {Boolean} indicator-dots = [] 默认:true,是否显示指示
|
* @property {Boolean} indicator-dots = [] 默认:true,是否显示指示
|
||||||
* @property {String} color = [] 默认:primary,指示点的主题色。
|
* @property {String} color = [] 默认:primary,指示点的主题色。
|
||||||
* @property {Number} current = [] 默认:0,如果需要双向绑定请使用current.sync.
|
* @property {Number} current = [] 默认:0,如果需要双向绑定请使用current.sync.
|
||||||
* @property {String} dot-model = [dot|number|rect|round] 默认:dot,指示点的类型。
|
* @property {String} dot-model = [dot|number|rect|round] 默认:dot,指示点的类型。
|
||||||
* @property {String} dot-direction = [left|center|right] 默认:center,指示点的位置。
|
* @property {String} dot-direction = [left|center|right] 默认:center,指示点的位置。
|
||||||
* @property {Number} round = [] 默认:0,圆角,单位rpx
|
* @property {Number} round = [] 默认:0,圆角,单位rpx
|
||||||
* @property {Number} margin = [] 默认:0,单位rpx
|
* @property {Number} margin = [] 默认:0,单位rpx
|
||||||
* @property {Function} change 轮播切换时触发。参数返回当前播放位置。
|
* @property {Function} change 轮播切换时触发。参数返回当前播放位置。
|
||||||
* @property {Function} click 轮播项目被点击时触发发,返回项目数据
|
* @property {Function} click 轮播项目被点击时触发发,返回项目数据
|
||||||
* @example <tm-swiper :list="['https://picsum.photos/300?jv=3','https://picsum.photos/300?jv=3']" ></tm-swiper>
|
* @example <tm-swiper :list="['https://picsum.photos/300?jv=3','https://picsum.photos/300?jv=3']" ></tm-swiper>
|
||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
name: 'tm-swiper',
|
name: 'tm-swiper',
|
||||||
props: {
|
props: {
|
||||||
width: {
|
width: {
|
||||||
type: Number | String,
|
type: Number | String,
|
||||||
default: 0
|
default: 0
|
||||||
},
|
|
||||||
// 自定高度。
|
|
||||||
height: {
|
|
||||||
type: Number | String,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
list: {
|
|
||||||
type: Array,
|
|
||||||
default: () => {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
rangKey: {
|
|
||||||
type: String,
|
|
||||||
default: 'src'
|
|
||||||
},
|
|
||||||
// 是否内联。
|
|
||||||
inline: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
// 是否开启预览模式,即点击图片可以预览。
|
|
||||||
previmage: {
|
|
||||||
type: Boolean | String,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
vertical: false,
|
|
||||||
circular: false,
|
|
||||||
autoplay: false,
|
|
||||||
interval: {
|
|
||||||
type: Number,
|
|
||||||
default: 3000
|
|
||||||
},
|
|
||||||
duration: {
|
|
||||||
type: Number,
|
|
||||||
default: 500
|
|
||||||
},
|
|
||||||
// 是否显示指示
|
|
||||||
indicatorDots: false,
|
|
||||||
//指示点的主题色。
|
|
||||||
color: {
|
|
||||||
type: String,
|
|
||||||
default: 'primary'
|
|
||||||
},
|
|
||||||
// 当前位置。
|
|
||||||
current: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
ani3d: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
// 指示点的类型。
|
|
||||||
dotModel: {
|
|
||||||
type: String,
|
|
||||||
default: 'dot' //dot|number|rect
|
|
||||||
},
|
|
||||||
// 指示点的位置 。
|
|
||||||
dotDirection: {
|
|
||||||
type: String,
|
|
||||||
default: 'center' //left|center|right
|
|
||||||
},
|
|
||||||
round: {
|
|
||||||
type: Boolean | Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
margin: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
// 跟随主题色的改变而改变。
|
|
||||||
fllowTheme: {
|
|
||||||
type: Boolean | String,
|
|
||||||
default: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
current: function(newval) {
|
|
||||||
// if (newval >= this.dataList.length) {
|
|
||||||
// this.nowIndex = 0;
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// this.nowIndex = newval;
|
|
||||||
},
|
|
||||||
list: {
|
|
||||||
deep: true,
|
|
||||||
handler() {
|
|
||||||
this.chulidata();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
color_tmeme: function() {
|
|
||||||
if (this.$tm.vx.state().tmVuetify.color !== null && this.$tm.vx.state().tmVuetify.color && this.fllowTheme) {
|
|
||||||
return this.$tm.vx.state().tmVuetify.color;
|
|
||||||
}
|
|
||||||
return this.color;
|
|
||||||
},
|
|
||||||
round_num: function() {
|
|
||||||
if (typeof this.round === 'boolean') return 0;
|
|
||||||
return this.round;
|
|
||||||
},
|
|
||||||
nowIndex: {
|
|
||||||
get: function() {
|
|
||||||
return this.dotIndex;
|
|
||||||
},
|
},
|
||||||
set: function(val) {
|
// 自定高度。
|
||||||
this.dotIndex = val;
|
height: {
|
||||||
this.$emit('update:current', val);
|
type: Number | String,
|
||||||
this.$emit('change', val);
|
default: 0
|
||||||
}
|
|
||||||
},
|
|
||||||
nowshowDot: function() {
|
|
||||||
return this.showdot();
|
|
||||||
},
|
|
||||||
w_s: {
|
|
||||||
get: function() {
|
|
||||||
return this.w_w;
|
|
||||||
},
|
},
|
||||||
set: function(val) {
|
list: {
|
||||||
this.w_w = val;
|
type: Array,
|
||||||
}
|
default: () => {
|
||||||
},
|
return [];
|
||||||
h_s: {
|
}
|
||||||
get: function() {
|
|
||||||
return this.h_h;
|
|
||||||
},
|
},
|
||||||
set: function(val) {
|
rangKey: {
|
||||||
this.h_h = val;
|
type: String,
|
||||||
|
default: 'src'
|
||||||
|
},
|
||||||
|
// 是否内联。
|
||||||
|
inline: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
// 是否开启预览模式,即点击图片可以预览。
|
||||||
|
previmage: {
|
||||||
|
type: Boolean | String,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
vertical: false,
|
||||||
|
circular: false,
|
||||||
|
autoplay: false,
|
||||||
|
interval: {
|
||||||
|
type: Number,
|
||||||
|
default: 3000
|
||||||
|
},
|
||||||
|
duration: {
|
||||||
|
type: Number,
|
||||||
|
default: 500
|
||||||
|
},
|
||||||
|
// 是否显示指示
|
||||||
|
indicatorDots: false,
|
||||||
|
//指示点的主题色。
|
||||||
|
color: {
|
||||||
|
type: String,
|
||||||
|
default: 'primary'
|
||||||
|
},
|
||||||
|
// 当前位置。
|
||||||
|
current: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
ani3d: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
// 指示点的类型。
|
||||||
|
dotModel: {
|
||||||
|
type: String,
|
||||||
|
default: 'dot' //dot|number|rect
|
||||||
|
},
|
||||||
|
// 指示点的位置 。
|
||||||
|
dotDirection: {
|
||||||
|
type: String,
|
||||||
|
default: 'center' //left|center|right
|
||||||
|
},
|
||||||
|
round: {
|
||||||
|
type: Boolean | Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
margin: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
// 跟随主题色的改变而改变。
|
||||||
|
fllowTheme: {
|
||||||
|
type: Boolean | String,
|
||||||
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
margin_px: function() {
|
watch: {
|
||||||
return this.margin * 2;
|
current: function(newval) {
|
||||||
}
|
if (newval >= this.dataList.length) {
|
||||||
},
|
this.nowIndex = 0;
|
||||||
|
return;
|
||||||
data() {
|
}
|
||||||
return {
|
this.nowIndex = newval;
|
||||||
w_w: 0,
|
},
|
||||||
h_h: 0,
|
list: {
|
||||||
dataList: [],
|
deep: true,
|
||||||
dotIndex: 0,
|
handler() {
|
||||||
isPlayVedio: false
|
this.chulidata();
|
||||||
};
|
}
|
||||||
},
|
|
||||||
async mounted() {
|
|
||||||
// this.nowIndex = this.current;
|
|
||||||
|
|
||||||
let w = this.width;
|
|
||||||
if (String(w).indexOf('px') > -1 && typeof w == 'string') {
|
|
||||||
let p = parseInt(h);
|
|
||||||
let sy = 750 / uni.getSystemInfoSync().windowWidth;
|
|
||||||
w = p * sy;
|
|
||||||
}
|
|
||||||
if (typeof w == 'string') {
|
|
||||||
w = parseInt(w);
|
|
||||||
}
|
|
||||||
this.w_w = w;
|
|
||||||
|
|
||||||
let h = this.height;
|
|
||||||
if (String(h).indexOf('px') > -1 && typeof h == 'string') {
|
|
||||||
let p = parseInt(h);
|
|
||||||
let sy = 750 / uni.getSystemInfoSync().windowWidth;
|
|
||||||
h = p * sy;
|
|
||||||
}
|
|
||||||
if (typeof h == 'string') {
|
|
||||||
h = parseInt(h);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.h_h = h;
|
|
||||||
|
|
||||||
this.$nextTick(async function() {
|
|
||||||
await this.chulidata();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
showdot() {
|
|
||||||
if (typeof this.dataList[this.nowIndex] == 'string') return true;
|
|
||||||
if (typeof this.dataList[this.nowIndex] == 'object') {
|
|
||||||
if (this.dataList[this.nowIndex].dtype == 'video') return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
async chulidata() {
|
computed: {
|
||||||
let t = this;
|
color_tmeme: function() {
|
||||||
let tb = await this.$Querey('.tm-swiper', this).catch(ev => {});
|
if (this.$tm.vx.state().tmVuetify.color !== null && this.$tm.vx.state().tmVuetify.color && this
|
||||||
//console.log(uni.getSystemInfoSync());
|
.fllowTheme) {
|
||||||
let sy = 750 / uni.getSystemInfoSync().windowWidth;
|
return this.$tm.vx.state().tmVuetify.color;
|
||||||
let upxw = tb[0].width * sy;
|
}
|
||||||
let sw = this.w_s > 0 ? this.w_s : upxw > 0 ? upxw : 100;
|
return this.color;
|
||||||
this.w_s = sw;
|
},
|
||||||
let sh = this.h_s > 0 ? this.h_s : tb[0].height > 0 ? tb[0].height : 300;
|
round_num: function() {
|
||||||
this.h_s = sh;
|
if (typeof this.round === 'boolean') return 0;
|
||||||
let d = [];
|
return this.round;
|
||||||
this.list.forEach(item => {
|
},
|
||||||
if (typeof item === 'string') {
|
nowIndex: {
|
||||||
d.push({
|
get: function() {
|
||||||
width: sw,
|
return this.dotIndex;
|
||||||
height: sh,
|
},
|
||||||
url: item,
|
set: function(val) {
|
||||||
title: '',
|
this.dotIndex = val;
|
||||||
dtype: '',
|
this.$emit('update:current', val);
|
||||||
data: item
|
this.$emit('change', val);
|
||||||
});
|
}
|
||||||
} else if (typeof item === 'object') {
|
},
|
||||||
d.push({
|
nowshowDot:function(){
|
||||||
width: sw,
|
return this.showdot();
|
||||||
height: sh,
|
|
||||||
url: item[t.rangKey],
|
},
|
||||||
title: item['title'] || '',
|
w_s: {
|
||||||
dtype: item['type'] || '',
|
get: function() {
|
||||||
data: item
|
return this.w_w;
|
||||||
|
},
|
||||||
|
set: function(val) {
|
||||||
|
this.w_w = val;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
h_s: {
|
||||||
|
get: function() {
|
||||||
|
return this.h_h;
|
||||||
|
},
|
||||||
|
set: function(val) {
|
||||||
|
this.h_h = val;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
margin_px: function() {
|
||||||
|
return this.margin * 2;
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
w_w: 0,
|
||||||
|
h_h: 0,
|
||||||
|
dataList: [],
|
||||||
|
dotIndex: 0,
|
||||||
|
isPlayVedio:false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
this.nowIndex = this.current;
|
||||||
|
|
||||||
|
let w = this.width;
|
||||||
|
if (String(w).indexOf('px') > -1 && typeof w == 'string') {
|
||||||
|
let p = parseInt(h);
|
||||||
|
let sy = 750 / uni.getSystemInfoSync().windowWidth;
|
||||||
|
w = p * sy;
|
||||||
|
}
|
||||||
|
if (typeof w == 'string') {
|
||||||
|
w = parseInt(w);
|
||||||
|
}
|
||||||
|
this.w_w = w;
|
||||||
|
|
||||||
|
let h = this.height;
|
||||||
|
if (String(h).indexOf('px') > -1 && typeof h == 'string') {
|
||||||
|
let p = parseInt(h);
|
||||||
|
let sy = 750 / uni.getSystemInfoSync().windowWidth;
|
||||||
|
h = p * sy;
|
||||||
|
}
|
||||||
|
if (typeof h == 'string') {
|
||||||
|
h = parseInt(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.h_h = h;
|
||||||
|
|
||||||
|
this.$nextTick(async function() {
|
||||||
|
await this.chulidata();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
showdot(){
|
||||||
|
if(typeof this.dataList[this.nowIndex]=='string') return true;
|
||||||
|
if(typeof this.dataList[this.nowIndex]=='object'){
|
||||||
|
if(this.dataList[this.nowIndex].dtype=='video') return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
async chulidata() {
|
||||||
|
let t = this;
|
||||||
|
let tb = await this.$Querey('.tm-swiper', this).catch(ev => {});
|
||||||
|
//console.log(uni.getSystemInfoSync());
|
||||||
|
let sy = 750 / uni.getSystemInfoSync().windowWidth;
|
||||||
|
let upxw = tb[0].width * sy;
|
||||||
|
let sw = this.w_s > 0 ? this.w_s : upxw > 0 ? upxw : 100;
|
||||||
|
this.w_s = sw;
|
||||||
|
let sh = this.h_s > 0 ? this.h_s : tb[0].height > 0 ? tb[0].height : 300;
|
||||||
|
this.h_s = sh;
|
||||||
|
let d = [];
|
||||||
|
this.list.forEach(item => {
|
||||||
|
if (typeof item === 'string') {
|
||||||
|
d.push({
|
||||||
|
width: sw,
|
||||||
|
height: sh,
|
||||||
|
url: item,
|
||||||
|
title: '',
|
||||||
|
dtype: '',
|
||||||
|
data: item
|
||||||
|
});
|
||||||
|
} else if (typeof item === 'object') {
|
||||||
|
d.push({
|
||||||
|
width: sw,
|
||||||
|
height: sh,
|
||||||
|
url: item[t.rangKey],
|
||||||
|
title: item['title'] || '',
|
||||||
|
dtype: item['type'] || '',
|
||||||
|
data: item
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.dataList = d;
|
||||||
|
},
|
||||||
|
imgload(e, index) {},
|
||||||
|
change(event) {
|
||||||
|
this.nowIndex = event.detail.current;
|
||||||
|
},
|
||||||
|
itemClick(e) {
|
||||||
|
if (this.previmage) {
|
||||||
|
uni.previewImage({
|
||||||
|
current: e.url,
|
||||||
|
urls: [e.url]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
this.$emit('click', e);
|
||||||
this.dataList = d;
|
|
||||||
},
|
|
||||||
imgload(e, index) {},
|
|
||||||
change(event) {
|
|
||||||
this.nowIndex = event.detail.current;
|
|
||||||
},
|
|
||||||
itemClick(e) {
|
|
||||||
if (this.previmage) {
|
|
||||||
uni.previewImage({
|
|
||||||
current: e.url,
|
|
||||||
urls: [e.url]
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
this.$emit('click', e);
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<style></style>
|
<style></style>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.tm-swiper {
|
.tm-swiper {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.tm-swiper-ik {
|
.tm-swiper-ik {
|
||||||
transition: all 1s;
|
transition: all 1s;
|
||||||
}
|
|
||||||
|
|
||||||
.a3d {
|
|
||||||
transform: scale(0.76);
|
|
||||||
}
|
|
||||||
|
|
||||||
.a3dL {
|
|
||||||
transform: scale(0.76) translateX(-24rpx);
|
|
||||||
}
|
|
||||||
|
|
||||||
.a3dR {
|
|
||||||
transform: scale(0.76) translateX(24rpx);
|
|
||||||
}
|
|
||||||
|
|
||||||
.actvieMarginDh {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.actvieMarginDh-item {
|
|
||||||
overflow: hidden;
|
|
||||||
line-height: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tm-swiper-dot {
|
|
||||||
.tm-swiper-dot-item {
|
|
||||||
width: 16upx;
|
|
||||||
height: 16upx;
|
|
||||||
border-radius: 50%;
|
|
||||||
|
|
||||||
&.unactive {
|
|
||||||
background-color: rgba(255, 255, 255, 0.6);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.number {
|
|
||||||
width: 34upx;
|
|
||||||
height: 34upx;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.rect {
|
|
||||||
width: 24upx;
|
|
||||||
height: 6upx;
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.round {
|
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
width: 100%;
|
.a3d {
|
||||||
position: absolute;
|
transform: scale(0.76);
|
||||||
left: 0;
|
}
|
||||||
display: flex;
|
|
||||||
bottom: 20upx;
|
|
||||||
|
|
||||||
&.center {
|
.a3dL {
|
||||||
|
transform: scale(0.76) translateX(-24rpx)
|
||||||
|
}
|
||||||
|
|
||||||
|
.a3dR {
|
||||||
|
transform: scale(0.76) translateX(24rpx)
|
||||||
|
}
|
||||||
|
|
||||||
|
.actvieMarginDh {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
|
.actvieMarginDh-item {
|
||||||
|
overflow: hidden;
|
||||||
|
line-height: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.left {
|
.tm-swiper-dot {
|
||||||
display: flex;
|
.tm-swiper-dot-item {
|
||||||
justify-content: flex-start;
|
width: 16upx;
|
||||||
padding-left: 20upx;
|
height: 16upx;
|
||||||
width: calc(100% - 20upx);
|
border-radius: 50%;
|
||||||
}
|
|
||||||
|
|
||||||
&.right {
|
&.unactive {
|
||||||
|
background-color: rgba(255, 255, 255, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.number {
|
||||||
|
width: 34upx;
|
||||||
|
height: 34upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.rect {
|
||||||
|
width: 24upx;
|
||||||
|
height: 6upx;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.round {
|
||||||
|
background-color: rgba(0, 0, 0, 0.4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
bottom: 20upx;
|
||||||
padding-right: 20upx;
|
|
||||||
width: calc(100% - 20upx);
|
&.center {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.left {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
padding-left: 20upx;
|
||||||
|
width: calc(100% - 20upx);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.right {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding-right: 20upx;
|
||||||
|
width: calc(100% - 20upx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
* @property {Number} wait 延时
|
* @property {Number} wait 延时
|
||||||
* @property {String} animation-name = [fadeUp|fadeDown|fadeLeft|fadeRight|zoomIn|zoomOut|fadeIn|fadeOut] 动画效果名称.
|
* @property {String} animation-name = [fadeUp|fadeDown|fadeLeft|fadeRight|zoomIn|zoomOut|fadeIn|fadeOut] 动画效果名称.
|
||||||
* @property {String|Boolean} auto = [true|false] 默认:true,是否自动播放动画.
|
* @property {String|Boolean} auto = [true|false] 默认:true,是否自动播放动画.
|
||||||
* @example <tm-translate wait="500" animation-name="fadeUp"><tm-upload></tm-upload></tm-translate>
|
* @example <tm-translate wait="500" animation-name="fadeDown"><tm-upload></tm-upload></tm-translate>
|
||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
name:"tm-translate",
|
name:"tm-translate",
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user