Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8119933af | ||
|
|
c9c048e1ed | ||
|
|
d363547bf7 | ||
|
|
bc5a59c104 | ||
|
|
46d8fe8b70 | ||
|
|
108f204f03 | ||
|
|
77fee4ea46 | ||
|
|
0e04c560bc | ||
|
|
e6d8bff772 | ||
|
|
44093a5893 | ||
|
|
7f058ec10b | ||
|
|
c226263289 | ||
|
|
a59d10e7dc | ||
|
|
3523ce5599 | ||
|
|
41d9da4c7e | ||
|
|
733048e2c9 | ||
|
|
8c00c82e3f | ||
|
|
452f3e3327 | ||
|
|
61cecbe8e5 | ||
|
|
88147f3783 | ||
|
|
069f0fa413 | ||
|
|
6e14b8dd69 | ||
|
|
ed5792b860 | ||
|
|
98a142dba1 | ||
|
|
b3ae93633c | ||
|
|
cb5449eaac | ||
|
|
37c1277a83 | ||
|
|
36585188c4 | ||
|
|
2ee9876f01 | ||
|
|
1687f417d7 | ||
|
|
59dec5c11c | ||
|
|
d5d85d2cd2 | ||
|
|
708aa88914 | ||
|
|
dfb92b7332 | ||
|
|
df47b96e87 | ||
|
|
5d8ea0cbd5 | ||
|
|
f38ba76ac0 | ||
|
|
1845171a1e | ||
|
|
007e80bebb | ||
|
|
a427cfbb92 | ||
|
|
f1e063aab9 | ||
|
|
876e15b655 | ||
|
|
b0d8d3163e | ||
|
|
1e58a29d9b | ||
|
|
e6ff7fafce | ||
|
|
640d61fd49 | ||
|
|
6843be82cb | ||
|
|
c58f785304 | ||
|
|
2062046901 | ||
|
|
1adef8d00b | ||
|
|
62b227034f | ||
|
|
60c3e0f572 | ||
|
|
0f76d54e27 | ||
|
|
0369f0f1d3 | ||
|
|
085730bb9c | ||
|
|
d68f734f95 | ||
|
|
41d99e95f9 | ||
|
|
ae72fc0a8f | ||
|
|
8e00a1e477 | ||
|
|
75d4b43e5e | ||
|
|
62d8cfd13b | ||
|
|
96b175a562 | ||
|
|
230fe66e82 | ||
|
|
20c53f245c | ||
|
|
ac741f9339 | ||
|
|
f0284d1b06 | ||
|
|
3ac6fa4e14 | ||
|
|
691f8eabd0 | ||
|
|
b0e7628f65 | ||
|
|
920e7cc1dc | ||
|
|
f4539ccf4a | ||
|
|
f20e73e859 | ||
|
|
57fc90b030 | ||
|
|
6b09cf8a90 | ||
|
|
4670b51a5a | ||
|
|
e729fb3c94 | ||
|
|
c6ef03434e | ||
|
|
f7a3bdc3fe | ||
|
|
b636cd905b | ||
|
|
9102c47804 | ||
|
|
238f56ab11 | ||
|
|
e92027d74e | ||
|
|
90d908a959 | ||
|
|
3f0ca5e55e | ||
|
|
63bebfdb94 | ||
|
|
35f7127134 | ||
|
|
50fe0e78c8 | ||
|
|
9f843f3bba | ||
|
|
eb3db99cb8 | ||
|
|
d7aecbe755 | ||
|
|
23f3d8b994 | ||
|
|
663d8f06fb | ||
|
|
37ba270104 | ||
|
|
3cd6f29e32 | ||
|
|
51e9d8b966 | ||
|
|
50363edc6e | ||
|
|
2bc47e46f1 | ||
|
|
6c851d4f29 | ||
|
|
76a877f2c2 | ||
|
|
55ed80acbc | ||
|
|
956d7bf70b | ||
|
|
62e7776b64 | ||
|
|
8f7ff49641 | ||
|
|
6d963a5bc0 | ||
|
|
b4c1ea20ac | ||
|
|
ffadc6c501 | ||
|
|
47ac886d5d | ||
|
|
f72a68ccc3 | ||
|
|
73fa5e35d4 | ||
|
|
93c9445008 | ||
|
|
ea44413ac1 | ||
|
|
13a9b7a2f6 | ||
|
|
80078cae78 | ||
|
|
27ac2a086d | ||
|
|
df87d0f9c8 | ||
|
|
7aeff7ece1 | ||
|
|
8b36c419a3 | ||
|
|
7dcba7c04b | ||
|
|
3b70c6ddf0 | ||
|
|
f182d3b63a | ||
|
|
ffeb37456c | ||
|
|
c5a6ec0d21 | ||
|
|
46eff30230 | ||
|
|
7ee65297de | ||
|
|
785b59c2ad | ||
|
|
87f9efe143 | ||
|
|
1467bd7365 | ||
|
|
8ade9b36e6 | ||
|
|
6762944340 | ||
|
|
15ffeee122 | ||
|
|
d290ab6e8f | ||
|
|
be6b9d9316 | ||
|
|
f44b87dfbb | ||
|
|
4fbb35ea0d | ||
|
|
e4f4421799 | ||
|
|
aa686f86ba | ||
|
|
fb9b85645b | ||
|
|
46c35bc1b6 | ||
|
|
34d9e21896 | ||
|
|
492ad9e6d4 | ||
|
|
6e7ffa414e | ||
|
|
7a72c4e1da | ||
|
|
194ef2d711 | ||
|
|
69597f3959 | ||
|
|
98a9f10bbf | ||
|
|
c76e3b1e0a | ||
|
|
f3e8051983 | ||
|
|
1701241aa9 | ||
|
|
87dbaef360 | ||
|
|
6ae771ecf0 | ||
|
|
9f2fefbf28 | ||
|
|
50dfa0e585 | ||
|
|
13fb22d780 | ||
|
|
85c3e45dc9 | ||
|
|
04b6a8d384 | ||
|
|
0891b8029c | ||
|
|
26c5c4d115 | ||
|
|
11e69ea9c7 | ||
|
|
0e5c07b5da | ||
|
|
89e1e058cc | ||
|
|
7c70f65892 | ||
|
|
4c008f2b55 | ||
|
|
e05ceb0f68 | ||
|
|
758d3a2127 | ||
|
|
16fc923e4b | ||
|
|
f488fd4147 | ||
|
|
ad280253b8 | ||
|
|
e7182902ba | ||
|
|
0c738a2dc5 | ||
|
|
4eb12b7a70 | ||
|
|
48e037e44e | ||
|
|
4e0972f38a | ||
|
|
9c6aa2351b | ||
|
|
88d5421322 | ||
|
|
b72e7db15e | ||
|
|
dba726dc12 | ||
|
|
fe1cdf4dd5 | ||
|
|
778702a877 | ||
|
|
cf1f2791f6 | ||
|
|
7bf0344028 | ||
|
|
3826e11a3e | ||
|
|
1b4db7d4f8 | ||
|
|
e0dd9aa7ed | ||
|
|
656c27fdb8 | ||
|
|
2cddb59530 | ||
|
|
27924672a2 | ||
|
|
638eadb632 | ||
|
|
1e78f76be1 | ||
|
|
f113bf75be | ||
|
|
1453220d04 | ||
|
|
3c6c153cfd | ||
|
|
b1aad14d43 | ||
|
|
6ad916df62 | ||
|
|
292f2b2745 | ||
|
|
be8c2301f4 | ||
|
|
4c84a96e07 | ||
|
|
45b98c7bf1 | ||
|
|
71d9a8907b | ||
|
|
e50df3d893 | ||
|
|
b6703830cf | ||
|
|
5987d9254e | ||
|
|
c18030a3c3 | ||
|
|
7e8e888886 | ||
|
|
56d8fb78b2 | ||
|
|
85838b64a4 | ||
|
|
a896523128 | ||
|
|
0636c93695 | ||
|
|
e0e475c0d0 | ||
|
|
39a94a51ec | ||
|
|
cb607556e5 | ||
|
|
a5a2652f19 | ||
|
|
badd8eecc9 | ||
|
|
b0d49cc6d5 | ||
|
|
3a214a3b9d | ||
|
|
fe442424b0 | ||
|
|
933c6a3628 | ||
|
|
d0cff1e562 | ||
|
|
ac45a0dfee | ||
|
|
84e72f9313 | ||
|
|
05ef78870b | ||
|
|
de0699e705 | ||
|
|
b4935444b6 | ||
|
|
535a98e43a | ||
|
|
6caf9afcc0 | ||
|
|
d2a27c08e2 | ||
|
|
153df11ed4 | ||
|
|
58d21cafda | ||
|
|
9a27e2df49 | ||
|
|
bf31bf859e | ||
|
|
e982bc0595 | ||
|
|
c367a236c1 | ||
|
|
842ba2ff7f | ||
|
|
02e1015594 | ||
|
|
2da80cd30b | ||
|
|
ebe76499a5 | ||
|
|
a54b674e6f | ||
|
|
76eea8dcb4 | ||
|
|
aa44879dff | ||
|
|
5d7c3ac0c0 | ||
|
|
3f9463258e | ||
|
|
976dd1b096 | ||
|
|
cff3dba809 | ||
|
|
57410cc656 | ||
|
|
1f2a504086 | ||
|
|
da380c000f | ||
|
|
2f26d70a0e | ||
|
|
0a68bd1ca1 | ||
|
|
94df324fc5 | ||
|
|
59565871d9 | ||
|
|
a50d274a59 | ||
|
|
ced676832e | ||
|
|
69e5ba0169 | ||
|
|
91aad660e6 | ||
|
|
c3c0483625 | ||
|
|
6cb403c5d5 | ||
|
|
28ee55f9fd | ||
|
|
c8bf87aa4b | ||
|
|
53312c889e | ||
|
|
e3a69a708c | ||
|
|
a113312712 | ||
|
|
77f803ef10 | ||
|
|
52817b48a8 | ||
|
|
09a8d1b476 | ||
|
|
20ca6c988e | ||
|
|
092ef55293 | ||
|
|
a14d89efff | ||
|
|
9bf4febea6 | ||
|
|
3b8faf1eea | ||
|
|
898c3b74bc | ||
|
|
8a1a58d14a | ||
|
|
8f164cc6ef | ||
|
|
3b935811e3 | ||
|
|
0d1dfae3bd | ||
|
|
94b2af52d0 | ||
|
|
8c1aa62024 | ||
|
|
d3602c010e | ||
|
|
0202f14073 | ||
|
|
320bda6ed8 | ||
|
|
1f5e9f1a49 | ||
|
|
a863ee7c85 | ||
|
|
49580bc511 | ||
|
|
341d4d5c70 | ||
|
|
a86b416ed8 | ||
|
|
ef36b27c54 | ||
|
|
9c90600c82 | ||
|
|
b4b6fed1ab | ||
|
|
9dc63c2207 | ||
|
|
9fa58286e8 | ||
|
|
3e0940f42c | ||
|
|
0b8d5be0d0 | ||
|
|
505d383bff | ||
|
|
23af0da8fa | ||
|
|
e3316844e3 | ||
|
|
d0b0994184 | ||
|
|
7cc4cfea35 | ||
|
|
ceb2d2e09e | ||
|
|
d8725cd843 | ||
|
|
bf3a18cb4b | ||
|
|
e0ba6f7422 | ||
|
|
0ad78b11db | ||
|
|
b8413ab13f | ||
|
|
bca2513d22 | ||
|
|
1d8b75e2d2 | ||
|
|
8f6b2a23d1 | ||
|
|
8c4d588ffa | ||
|
|
9cbf35d693 | ||
|
|
2f5bb204bb | ||
|
|
2f5b17da92 | ||
|
|
017e4d065a | ||
|
|
4f2670ba01 | ||
|
|
9e9a058325 | ||
|
|
4dc16ed4ea | ||
|
|
3c2f1bc329 | ||
|
|
533a5fa8bd | ||
|
|
7dfd10760d | ||
|
|
bf3145a2a7 | ||
|
|
50a36877e5 | ||
|
|
f97a547bc0 | ||
|
|
e829b17e4e | ||
|
|
8df912d4fb | ||
|
|
bfec7dcf59 | ||
|
|
9aeb0a2c7c | ||
|
|
71803cdf80 | ||
|
|
8b2aa20cf9 | ||
|
|
f4c78b5e70 | ||
|
|
b474d55c8f | ||
|
|
24e20b16dd | ||
|
|
689fa6ffc1 | ||
|
|
8c5ef69979 | ||
|
|
aee2002a1e | ||
|
|
057a727c9e | ||
|
|
14e2fd9104 | ||
|
|
50f5de6601 | ||
|
|
c0afa773a4 | ||
|
|
cdf129430d | ||
|
|
9a1f737988 | ||
|
|
d91324c96b | ||
|
|
92782f45c0 | ||
|
|
5ef346e40f | ||
|
|
c4839cbc9a | ||
|
|
4a0e0119e2 | ||
|
|
204db18f8a | ||
|
|
1a1f8f8a69 | ||
|
|
8c15fd6712 | ||
|
|
e34a032795 | ||
|
|
b234cb4733 | ||
|
|
7993549bfd | ||
|
|
68a215e491 | ||
|
|
6e581da413 | ||
|
|
4cbeab62dc | ||
|
|
00832cbca5 | ||
|
|
d823b42a3c | ||
|
|
55cc76f58e | ||
|
|
24796348cc | ||
|
|
9234581c6e | ||
|
|
3f55102301 | ||
|
|
cdece3d92f | ||
|
|
2d964da4e3 | ||
|
|
c10a4bb722 | ||
|
|
7cc08491e8 | ||
|
|
a2f9ee2377 | ||
|
|
cb260c7b56 | ||
|
|
2073526a24 | ||
|
|
956fa0692d | ||
|
|
c625ab209a | ||
|
|
8d0847f957 | ||
|
|
754c36b53d | ||
|
|
447d7b7445 | ||
|
|
044beb3db5 | ||
|
|
1c68c9fb74 | ||
|
|
fb3fac914b | ||
|
|
874ec14028 | ||
|
|
5114132692 | ||
|
|
61f1973663 | ||
|
|
46008c261b | ||
|
|
601d2242b7 | ||
|
|
d55f7725a4 | ||
|
|
5f1ea960e2 | ||
|
|
685488f14e | ||
|
|
6546f53a3b | ||
|
|
b37b2bf4b8 | ||
|
|
2084dc9969 | ||
|
|
2568f045e5 | ||
|
|
b638a3aa66 | ||
|
|
990684840b | ||
|
|
23d5726ed1 | ||
|
|
a5edae4020 | ||
|
|
e53fbf2fc0 | ||
|
|
54bf1c5700 | ||
|
|
bb052d12fe | ||
|
|
b13bd416bb | ||
|
|
4e46dccdb8 | ||
|
|
20cea6ead7 | ||
|
|
c941d77c3d | ||
|
|
d1413066ac | ||
|
|
c66fac5992 | ||
|
|
e608382075 | ||
|
|
7091d7e124 | ||
|
|
9a647cffd6 | ||
|
|
ad70e3afed | ||
|
|
605cd4f054 | ||
|
|
6b849c5300 | ||
|
|
d0ca72c855 | ||
|
|
c33f9dfc12 | ||
|
|
732a21e17f | ||
|
|
be90afefe5 | ||
|
|
b572976e08 | ||
|
|
d6d8222831 | ||
|
|
86fc52a62e | ||
|
|
bdfc025094 | ||
|
|
0c682398c4 | ||
|
|
df024b8210 | ||
|
|
910a837638 | ||
|
|
39d9c1a76a | ||
|
|
23286ae940 | ||
|
|
810ee7f5b8 | ||
|
|
65ede45e47 | ||
|
|
4d595d07c1 | ||
|
|
0ac517f969 | ||
|
|
f486d35470 | ||
|
|
91f0657470 | ||
|
|
14abdb02b6 | ||
|
|
b7d6935e31 | ||
|
|
969ec9937a | ||
|
|
39edd3da1f | ||
|
|
2c7fa054d3 | ||
|
|
ad9181e4cb | ||
|
|
2b8f75e890 | ||
|
|
af347912b2 | ||
|
|
325df3d6ca | ||
|
|
99be70d7f6 | ||
|
|
c507176f8f | ||
|
|
86f1443b42 | ||
|
|
56c00e61aa | ||
|
|
5983c4d17e | ||
|
|
2abd6533ba | ||
|
|
cf4d198682 | ||
|
|
7b1ac89b5b | ||
|
|
2682ecaecd | ||
|
|
285224284f | ||
|
|
0304b93966 | ||
|
|
7eeb313931 | ||
|
|
3da6899db0 | ||
|
|
0072ccb2d1 | ||
|
|
cd0123f383 | ||
|
|
97291ac3ba | ||
|
|
eff6581680 | ||
|
|
5e31dde283 | ||
|
|
0593ff0f02 | ||
|
|
06bc1a740f | ||
|
|
557fd0dfe3 | ||
|
|
b6159d03ab | ||
|
|
4897edce74 | ||
|
|
84ddb0790e | ||
|
|
4332fe91db | ||
|
|
f61e611a51 | ||
|
|
e582b521fe | ||
|
|
7da3e2ae1a | ||
|
|
4412103c8a | ||
|
|
debcc2010a | ||
|
|
eb2fafdc6e | ||
|
|
12c32fbf51 | ||
|
|
ea79af5bd9 | ||
|
|
692468346d | ||
|
|
ea5f9cc628 | ||
|
|
79e23a66cf | ||
|
|
6f367223c5 | ||
|
|
0038846328 | ||
|
|
9b5847c4ce | ||
|
|
e90c3d38cc | ||
|
|
1c06f8af06 | ||
|
|
1780c4ff0a | ||
|
|
f4fcc7e8f5 | ||
|
|
1b79ae1678 | ||
|
|
e6c7b3d989 | ||
|
|
ae2853e60b | ||
|
|
f72477a247 | ||
|
|
97bb3b2ee6 | ||
|
|
8f88e1bbab | ||
|
|
0c07084775 | ||
|
|
3caa936e1e | ||
|
|
7153ce8e9e | ||
|
|
6a6da9b3a6 | ||
|
|
d70440b948 | ||
|
|
5ba8a653a7 | ||
|
|
36e9c5fca2 | ||
|
|
8e22a48789 | ||
|
|
254a9d0e57 | ||
|
|
a86ac4d6e5 | ||
|
|
84b8b21799 | ||
|
|
93c59abe13 | ||
|
|
2512db3e08 | ||
|
|
e269a3a7af | ||
|
|
00d630377e | ||
|
|
0fd11fe68d | ||
|
|
364972c25b | ||
|
|
d2e48bc16f | ||
|
|
5ec97e99b8 | ||
|
|
0292dbd056 | ||
|
|
f055036001 | ||
|
|
86ae127763 | ||
|
|
e05eb3e389 | ||
|
|
a6735d284e | ||
|
|
1f4ea5c0c8 | ||
|
|
eaa36dcf44 | ||
|
|
2f4d4510a5 | ||
|
|
07aec60ce9 | ||
|
|
1109861934 | ||
|
|
1ad946e7be | ||
|
|
52c72c97a7 | ||
|
|
23491dab19 | ||
|
|
9093167bbd | ||
|
|
7485208d31 | ||
|
|
949d33614a | ||
|
|
7afcf039b6 | ||
|
|
702d7c1891 | ||
|
|
9720c5d1f0 | ||
|
|
88f3223e41 | ||
|
|
970bfef484 | ||
|
|
41b33e3819 | ||
|
|
161e53cc15 | ||
|
|
d69c41e193 | ||
|
|
ef3cd4a610 | ||
|
|
7f9b228f64 | ||
|
|
8ea730c287 | ||
|
|
c877cf245a | ||
|
|
9db2bc3b68 | ||
|
|
2df1a79997 | ||
|
|
41a4b19f13 | ||
|
|
a64da0bc21 | ||
|
|
b82dc02177 | ||
|
|
677bf57d05 | ||
|
|
9778bfc1ac | ||
|
|
5204db106d | ||
|
|
d7864d3a38 | ||
|
|
b53e2d1eaa | ||
|
|
642139d0a2 | ||
|
|
824a9f93de | ||
|
|
b65301baa2 | ||
|
|
c6e4c88eb7 | ||
|
|
2a32e1f60a | ||
|
|
fe596ffff3 | ||
|
|
9de1574c86 | ||
|
|
4ff62c50a1 | ||
|
|
94536701e4 | ||
|
|
8c7df45451 | ||
|
|
3a2de38cfe | ||
|
|
3c1578e51f | ||
|
|
99f613148b | ||
|
|
7a44ed3265 | ||
|
|
aaa29ef0f6 | ||
|
|
b2121e71ef | ||
|
|
d43fc253c9 | ||
|
|
efd70ae003 | ||
|
|
cdf1f24b74 | ||
|
|
096b0cef0d | ||
|
|
19e598bce7 | ||
|
|
9c022a5a31 | ||
|
|
c9f3767cbd | ||
|
|
889b0de9b7 | ||
|
|
6e316a9f2c | ||
|
|
4686c6d87a | ||
|
|
896f8dee7f | ||
|
|
d9ee41d8f3 | ||
|
|
7a49c7c493 | ||
|
|
13dee18ef1 | ||
|
|
5a1d35bbf2 | ||
|
|
ac3be5ad00 | ||
|
|
d5ae4bb1b1 | ||
|
|
f884d1c764 | ||
|
|
31ce97db6a | ||
|
|
7786f88896 | ||
|
|
b260bb9e34 | ||
|
|
51ff86e4f8 | ||
|
|
3d8df506e0 | ||
|
|
2d8f2b16a9 | ||
|
|
1d34f4dd08 | ||
|
|
6658d8d617 | ||
|
|
ee9d3c1507 | ||
|
|
4e3d834820 | ||
|
|
8cc32b5a19 | ||
|
|
a98c1544bd | ||
|
|
ef2eb0cdeb | ||
|
|
fc8257b1e3 | ||
|
|
67d1e7e5ed | ||
|
|
8ed2563e33 | ||
|
|
21c6bc90c7 | ||
|
|
e475238946 | ||
|
|
19b9a26811 | ||
|
|
bc5f60d58c | ||
|
|
036ae02b7b | ||
|
|
8910281527 | ||
|
|
98472cb048 | ||
|
|
f12fb1012d | ||
|
|
e2802e8ca2 | ||
|
|
16d4f7d5e2 | ||
|
|
9739b0b4f1 | ||
|
|
fcb6b39060 | ||
|
|
80ed47d5eb | ||
|
|
7075b1d125 | ||
|
|
f87cf3277b | ||
|
|
6fb60ef712 | ||
|
|
6a526eb41c | ||
|
|
7cc2be3536 | ||
|
|
a2805ca58e | ||
|
|
349b3a3baa | ||
|
|
561b0968ab | ||
|
|
b8f9a250fb | ||
|
|
7bdca767d2 | ||
|
|
68eab96693 | ||
|
|
e3e8c37551 | ||
|
|
ec042122c8 | ||
|
|
a050e39099 | ||
|
|
0c9674e08d | ||
|
|
8943a83b10 | ||
|
|
5f367bb408 | ||
|
|
fe9f229738 | ||
|
|
bc10ad93c3 | ||
|
|
c7672655ea | ||
|
|
6ff20d9b2d | ||
|
|
f129d6cde4 | ||
|
|
abe9e4119e | ||
|
|
d169137ba2 | ||
|
|
d45b372aaa | ||
|
|
66cc8bfcbd | ||
|
|
b68379eabd | ||
|
|
2748950b81 | ||
|
|
9151f3326b | ||
|
|
bc53ad76fb | ||
|
|
b5b6bdd678 | ||
|
|
512915ea2a | ||
|
|
c0baf3166d | ||
|
|
deaea528f3 | ||
|
|
5829cb53f1 | ||
|
|
c2dcc99f1c | ||
|
|
79dacfe3f4 | ||
|
|
d4337d862a | ||
|
|
41a4b3f293 | ||
|
|
abadbcee66 | ||
|
|
c2ec209b2e | ||
|
|
e22c96549e | ||
|
|
08250f2cbc | ||
|
|
501f66aeb0 | ||
|
|
ee6e39a4b9 | ||
|
|
9f06b47de3 | ||
|
|
a084e8f0e3 | ||
|
|
403f5d8e76 | ||
|
|
25187f7393 | ||
|
|
47b62adb98 | ||
|
|
9d2f99a5dc | ||
|
|
e242a90f1a | ||
|
|
98ff194f6d | ||
|
|
cbd8760e5c | ||
|
|
1429b67c4c | ||
|
|
92ab44bef6 | ||
|
|
0e32575490 | ||
|
|
c10b5ac1fb | ||
|
|
7dbb2f51a7 | ||
|
|
bd2df37815 | ||
|
|
c975133fb8 | ||
|
|
33543f99d7 | ||
|
|
689d63e402 | ||
|
|
877b8d873c | ||
|
|
913899ea8b | ||
|
|
6ba5f06d0b | ||
|
|
6ca3e477d6 | ||
|
|
d24c176a89 | ||
|
|
ac6f854746 | ||
|
|
9e3c52f9c9 | ||
|
|
514a648b30 | ||
|
|
6e74542ac1 | ||
|
|
caa5b49ca0 | ||
|
|
ba78b712cb | ||
|
|
145a5c0dd1 | ||
|
|
3dbacb26d1 | ||
|
|
e7d1eb4dd7 | ||
|
|
f7cf56216b | ||
|
|
76d9d8ef33 | ||
|
|
869bf15f5c | ||
|
|
f08818a7d7 | ||
|
|
cebe0c75d4 | ||
|
|
4ec87ffdd5 | ||
|
|
e1a524a499 | ||
|
|
e501bf7564 | ||
|
|
eebe0f217b | ||
|
|
5c1561fe9e | ||
|
|
9cab437532 | ||
|
|
3f7a366a18 | ||
|
|
7a0073cd62 | ||
|
|
ff1c4b3313 | ||
|
|
d142a9df7a | ||
|
|
9972a3873a | ||
|
|
3052c6b920 | ||
|
|
4ff143ab29 | ||
|
|
670c6385e5 | ||
|
|
db23fb32a4 | ||
|
|
0fc99561f4 | ||
|
|
f73d7587f7 | ||
|
|
d1bbea6e9b | ||
|
|
705d64d238 | ||
|
|
25ca6799d5 | ||
|
|
bf4861f088 | ||
|
|
64db7b8cd4 | ||
|
|
46ef8c90cb | ||
|
|
fe3c8fec6d | ||
|
|
e3c74241b4 | ||
|
|
ac3d11ff2a | ||
|
|
9f529e00b7 | ||
|
|
6ffe3216d8 | ||
|
|
e559765260 | ||
|
|
1cffccebf3 | ||
|
|
ad2327a57e | ||
|
|
15c459de7e | ||
|
|
77d522c87b | ||
|
|
eddc57b835 | ||
|
|
6cfdd452ce | ||
|
|
11f665aecc | ||
|
|
52adbc07d9 | ||
|
|
9244c3215d | ||
|
|
0dd7b2ed2d | ||
|
|
c40ad9eebc | ||
|
|
51dea74ea9 | ||
|
|
ca7d004245 | ||
|
|
5d9c2e9358 | ||
|
|
6defc580d1 | ||
|
|
02a6351f55 | ||
|
|
3a6fa798b8 | ||
|
|
eb51a4ad36 | ||
|
|
50cfce81db | ||
|
|
44bb718431 | ||
|
|
810cf318aa | ||
|
|
881a1e1477 | ||
|
|
4d4760397d | ||
|
|
3eaa632c71 | ||
|
|
a250630512 | ||
|
|
5a5e83564b | ||
|
|
59489829c6 | ||
|
|
6b0011d73d | ||
|
|
562739eabd | ||
|
|
c69af507ec | ||
|
|
6e49848f9a | ||
|
|
ca8c08d4fd | ||
|
|
6c286900e3 | ||
|
|
2dd9430c8d | ||
|
|
5586afec97 | ||
|
|
55a5adf1d1 | ||
|
|
7eb7312ab0 | ||
|
|
77264b667e | ||
|
|
cd592355bf | ||
|
|
f32c04dc01 | ||
|
|
b94068317a | ||
|
|
a9a7a46807 | ||
|
|
a2250ccc9a | ||
|
|
c63fdf0f37 | ||
|
|
863b5776b6 | ||
|
|
33265e771e | ||
|
|
51c735f88e | ||
|
|
227e5297e2 | ||
|
|
d7cf3b5a07 | ||
|
|
15e52bfefe | ||
|
|
ea9e442e9b | ||
|
|
e206235988 | ||
|
|
6273dd48a2 | ||
|
|
e63e6b60c1 | ||
|
|
17f6867202 | ||
|
|
42a5ef715a | ||
|
|
0186ac0d0e | ||
|
|
914f39c2cf | ||
|
|
2882b54e16 | ||
|
|
2a20c45a4e | ||
|
|
9870970d28 | ||
|
|
f8c348279f | ||
|
|
6390bec944 | ||
|
|
615f7d9064 | ||
|
|
6df8cda11c | ||
|
|
9ddb0b53f3 | ||
|
|
26d8fb88c5 | ||
|
|
a99c9afaf1 | ||
|
|
db9dba4df8 | ||
|
|
251da432c9 | ||
|
|
177f61a969 | ||
|
|
5a0fbb8e71 | ||
|
|
7804f09fea | ||
|
|
0ef2d7d2ac | ||
|
|
4560b76f75 | ||
|
|
53b7bbd9bc | ||
|
|
4d95ba8b7b | ||
|
|
d7b8445c27 | ||
|
|
29799b8737 | ||
|
|
07618635f1 | ||
|
|
2640b049b5 | ||
|
|
7f9af40ab0 | ||
|
|
199912c4da | ||
|
|
3b3d39f460 | ||
|
|
5ea0b9f994 | ||
|
|
7984854b2b | ||
|
|
81d3bd0481 | ||
|
|
035f7fd668 | ||
|
|
a98d504ee9 | ||
|
|
443b929d84 | ||
|
|
85c5269ad9 | ||
|
|
57c62416c5 | ||
|
|
588fd5e687 | ||
|
|
498e62b289 | ||
|
|
4aeed9292b | ||
|
|
8bd83e7c7f | ||
|
|
f33507f902 | ||
|
|
e96339e7e2 | ||
|
|
2629e5d849 | ||
|
|
d774abbbc2 | ||
|
|
8d393f0ee8 | ||
|
|
a5b7959b13 | ||
|
|
dfc45aceb4 | ||
|
|
7c87232ce1 | ||
|
|
8fa2c055a4 | ||
|
|
6712cc844d | ||
|
|
1ec7c50240 | ||
|
|
02d4e45c8b | ||
|
|
adaaf8e8e3 | ||
|
|
3d914c8103 | ||
|
|
4dde92dd2e | ||
|
|
3208d4b076 | ||
|
|
0b4337e393 | ||
|
|
c4317ed20b | ||
|
|
efb7db993b | ||
|
|
693da0f77c | ||
|
|
ae1dc31408 | ||
|
|
fce887794c | ||
|
|
c25b73d845 | ||
|
|
5c14eb6e1e | ||
|
|
5a883ff1dc | ||
|
|
933bd0d64e | ||
|
|
8ded90e60d | ||
|
|
2d2f60a29e | ||
|
|
e1a9600565 | ||
|
|
180bc0c0ad | ||
|
|
21410c5f06 | ||
|
|
3f59801805 | ||
|
|
69132a4e48 | ||
|
|
6de73ad9ea | ||
|
|
ed354dd14b | ||
|
|
f7816f0d0c | ||
|
|
4ebce61781 | ||
|
|
4f0d7fb9cc | ||
|
|
0a667d2b49 | ||
|
|
431b363b3a | ||
|
|
fef3b7d446 | ||
|
|
b767f4193f | ||
|
|
26cf65ee50 | ||
|
|
e8886a6050 | ||
|
|
b129ed9641 | ||
|
|
34734e0b72 | ||
|
|
6028f3e02a | ||
|
|
632a17da6f | ||
|
|
383318eb6b | ||
|
|
a3fb2e5bcf | ||
|
|
9e7835ce0b | ||
|
|
9d345d525e | ||
|
|
aff7cfccc0 | ||
|
|
8f2d3b6aeb | ||
|
|
5cf21bf46c | ||
|
|
8b21a232fe | ||
|
|
3a0809dd22 | ||
|
|
dc5a7deefb | ||
|
|
b34906964e | ||
|
|
e20a5efc17 | ||
|
|
a7c320d406 | ||
|
|
19d247c41c | ||
|
|
195cd9405c | ||
|
|
2c19636b81 | ||
|
|
a3bf9df15d | ||
|
|
262b8c365f | ||
|
|
cc1b6fcc3f | ||
|
|
5c2e950bc4 | ||
|
|
c6fc97dacc | ||
|
|
03eb6ef677 | ||
|
|
16b8ad101e | ||
|
|
88c49d2add | ||
|
|
b34f481a2f | ||
|
|
d1cd9900d3 | ||
|
|
2e6b2d6c62 | ||
|
|
fd7793b3fb | ||
|
|
491aa8d0a3 | ||
|
|
db554f0dbc | ||
|
|
55ecf029a0 | ||
|
|
fbd33b4276 | ||
|
|
1dfabc1697 | ||
|
|
df500286e2 | ||
|
|
2d2b57d3d0 | ||
|
|
d0841f19fc | ||
|
|
b7cdcb10d3 | ||
|
|
46c91ef920 | ||
|
|
a1b0dbe456 | ||
|
|
7be4c52fb0 | ||
|
|
e89b80dee8 | ||
|
|
d28a2ebd20 | ||
|
|
29a6be7e38 | ||
|
|
7fdaeb1c5b | ||
|
|
8f28c33ba2 | ||
|
|
f801863241 | ||
|
|
67ce7f0543 | ||
|
|
375b5b1978 | ||
|
|
00ba2a3239 | ||
|
|
0ddb5451e5 | ||
|
|
ea5efb50c4 | ||
|
|
2ebd257a49 | ||
|
|
53457ba83c | ||
|
|
6e4a217873 | ||
|
|
d86a2272de | ||
|
|
f0a187f2b1 | ||
|
|
982fe87cc1 | ||
|
|
243460eb39 | ||
|
|
20fc34673d | ||
|
|
b13dd1d368 | ||
|
|
e9aae5e8ae | ||
|
|
f4b04d8a0e | ||
|
|
ec794b4d79 | ||
|
|
f25483bbb7 |
@@ -9,6 +9,9 @@
|
|||||||
|
|
||||||
#### 安装教程
|
#### 安装教程
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
1. xxxx
|
1. xxxx
|
||||||
2. xxxx
|
2. xxxx
|
||||||
3. xxxx
|
3. xxxx
|
||||||
|
|||||||
@@ -23,12 +23,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 输入框 -->
|
<!-- 输入框 -->
|
||||||
<view class="input-wrap flex-center-between">
|
<view class="input-wrap flex-center-between">
|
||||||
<input
|
<textarea
|
||||||
v-model.trim="prompt"
|
v-model.trim="prompt"
|
||||||
:show-confirm-bar="false"
|
:show-confirm-bar="false"
|
||||||
:adjust-position="true"
|
:adjust-position="true"
|
||||||
|
:auto-height="true"
|
||||||
:disabled="loading"
|
:disabled="loading"
|
||||||
:maxlength="-1"
|
:maxlength="500"
|
||||||
class="inp"
|
class="inp"
|
||||||
@confirm="sendHandle"
|
@confirm="sendHandle"
|
||||||
@focus="promptInputFocusHandle"
|
@focus="promptInputFocusHandle"
|
||||||
@@ -111,6 +112,10 @@ export default {
|
|||||||
keyboardHeight: {
|
keyboardHeight: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
|
},
|
||||||
|
voiceException: {
|
||||||
|
type: String,
|
||||||
|
default: '没有听清您说了什么,请再说一遍'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -120,6 +125,15 @@ export default {
|
|||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
// 输入模式:input-键盘,sound-语音
|
// 输入模式:input-键盘,sound-语音
|
||||||
inputModel: 'input',
|
inputModel: 'input',
|
||||||
|
/**
|
||||||
|
* 端午节送礼攻略
|
||||||
|
* 丽江逛吃攻略
|
||||||
|
* 云南非遗有哪些?
|
||||||
|
* 怎么申请地理标志保护产品?
|
||||||
|
* 想找个像《去有风的地方》那样的治愈县城
|
||||||
|
* 云南有哪些小众县城适合旅居?
|
||||||
|
* 查询最近一个月的订单
|
||||||
|
*/
|
||||||
prompt: '',
|
prompt: '',
|
||||||
recordManager: null,
|
recordManager: null,
|
||||||
// 录音权限是否开通
|
// 录音权限是否开通
|
||||||
@@ -252,11 +266,11 @@ export default {
|
|||||||
fail: err => {
|
fail: err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -272,7 +286,7 @@ export default {
|
|||||||
_this.getTransResultReq()
|
_this.getTransResultReq()
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getTransResultReq() {
|
getTransResultReq() {
|
||||||
@@ -286,7 +300,7 @@ export default {
|
|||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
_this.clearIntervalFn()
|
_this.clearIntervalFn()
|
||||||
if (data === '__NULL__') {
|
if (data === '__NULL__') {
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
} else {
|
} else {
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
const prompt = data[0].Text
|
const prompt = data[0].Text
|
||||||
@@ -298,7 +312,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
_this.$toast('没有听清您说了什么,请再说一遍')
|
_this.$toast(_this.voiceException)
|
||||||
})
|
})
|
||||||
}, 1000)
|
}, 1000)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-else class="no-data">
|
<view v-else class="no-data">
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/orderIcon/nodata1.png'"
|
:src="webUrl + '/aiChat/ai-chat-no-data.png'"
|
||||||
class="img"
|
class="img"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-else class="no-data">
|
<view v-else class="no-data">
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/orderIcon/nodata1.png'"
|
:src="webUrl + '/aiChat/ai-chat-no-data.png'"
|
||||||
class="img"
|
class="img"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-else class="no-data">
|
<view v-else class="no-data">
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/orderIcon/nodata1.png'"
|
:src="webUrl + '/aiChat/ai-chat-no-data.png'"
|
||||||
class="img"
|
class="img"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
@@ -112,7 +112,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
getChatList,
|
getChatList,
|
||||||
deleteChatListByType
|
deleteChatListByType,
|
||||||
|
getCountyAiChatList,
|
||||||
|
deleteCountyChatListByType
|
||||||
} from '@/api/chat/index'
|
} from '@/api/chat/index'
|
||||||
export default {
|
export default {
|
||||||
name: 'AiHistoryList',
|
name: 'AiHistoryList',
|
||||||
@@ -125,6 +127,10 @@ export default {
|
|||||||
formModule: {
|
formModule: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
|
},
|
||||||
|
countyId: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -142,7 +148,17 @@ export default {
|
|||||||
this.getChatListReq()
|
this.getChatListReq()
|
||||||
},
|
},
|
||||||
getChatListReq() {
|
getChatListReq() {
|
||||||
getChatList().then(res => {
|
let reqFn = null
|
||||||
|
let params = {}
|
||||||
|
if (this.countyId) {
|
||||||
|
reqFn = getCountyAiChatList
|
||||||
|
params = {
|
||||||
|
countyId: this.countyId
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
reqFn = getChatList
|
||||||
|
}
|
||||||
|
reqFn(params).then(res => {
|
||||||
const { success, data } = res
|
const { success, data } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
this.todayList = data['今天'] || []
|
this.todayList = data['今天'] || []
|
||||||
@@ -152,7 +168,15 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
deleteRecords(type) {
|
deleteRecords(type) {
|
||||||
deleteChatListByType(type).then(res => {
|
let reqFn = null
|
||||||
|
let params = ''
|
||||||
|
if (this.countyId) {
|
||||||
|
reqFn = deleteCountyChatListByType
|
||||||
|
params = `?countyId=${this.countyId}&type=${type}`
|
||||||
|
} else {
|
||||||
|
reqFn = deleteChatListByType
|
||||||
|
}
|
||||||
|
reqFn(type, params).then(res => {
|
||||||
const { success } = res
|
const { success } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
this.getChatListReq()
|
this.getChatListReq()
|
||||||
@@ -160,7 +184,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
historyItemClick(item) {
|
historyItemClick(item) {
|
||||||
const paramsStr = `?chatNumber=${item.chatNumber}&title=${item.title}&click=1`
|
const paramsStr = `?chatNumber=${item.chatNumber}&title=${item.title}&click=1&countyId=${this.countyId}`
|
||||||
if (!this.formModule) {
|
if (!this.formModule) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/aiChat/views/history' + paramsStr
|
url: '/aiChat/views/history' + paramsStr
|
||||||
@@ -170,6 +194,7 @@ export default {
|
|||||||
url: '/aiChat/views/history' + paramsStr
|
url: '/aiChat/views/history' + paramsStr
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
this.$emit('enterHistory')
|
||||||
this.closeLayer()
|
this.closeLayer()
|
||||||
},
|
},
|
||||||
closeLayer() {
|
closeLayer() {
|
||||||
|
|||||||
@@ -0,0 +1,263 @@
|
|||||||
|
<template>
|
||||||
|
<view
|
||||||
|
class="order-item"
|
||||||
|
>
|
||||||
|
<view class="order-header">
|
||||||
|
<view class="order-shop">
|
||||||
|
<view class="shop-name">
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/aiChat/icon-57.png'"
|
||||||
|
class="icon"
|
||||||
|
mode="widthFix"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
{{ item.merName }}
|
||||||
|
</view>
|
||||||
|
<view class="order-id">
|
||||||
|
订单号:{{ item.orderId }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="status">
|
||||||
|
{{ item.statusName }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.isGiftCardReceiveBlind === 0" class="product-info-wrap">
|
||||||
|
<view
|
||||||
|
v-for="cartItem in item.cartInfo"
|
||||||
|
:key="cartItem.productId"
|
||||||
|
class="product-info"
|
||||||
|
>
|
||||||
|
<view class="good-img">
|
||||||
|
<image
|
||||||
|
:src="cartItem.productInfo.image"
|
||||||
|
class="img"
|
||||||
|
mode="widthFix"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="name-wrap">
|
||||||
|
<view class="name one-t">
|
||||||
|
{{ cartItem.productInfo.storeName }}
|
||||||
|
</view>
|
||||||
|
<view class="attr">
|
||||||
|
规格:{{ cartItem.productInfo.attrInfo.sku || '' }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="price-num">
|
||||||
|
<view>
|
||||||
|
¥{{ cartItem.truePrice }}
|
||||||
|
</view>
|
||||||
|
<view class="num">
|
||||||
|
x{{ cartItem.cartNum }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-else class="product-info-wrap">
|
||||||
|
<view
|
||||||
|
class="product-info product-info2"
|
||||||
|
>
|
||||||
|
<view class="good-img">
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/orderIcon/盲盒礼包.png'"
|
||||||
|
class="img"
|
||||||
|
mode="widthFix"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="name-wrap">
|
||||||
|
<view class="name one-t">
|
||||||
|
盲盒礼物
|
||||||
|
</view>
|
||||||
|
<view class="attr">
|
||||||
|
待收货后展示商品信息
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="price-num">
|
||||||
|
<view style="color: #fff;">
|
||||||
|
¥0.00
|
||||||
|
</view>
|
||||||
|
<view class="num">
|
||||||
|
x1
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="order-bottom">
|
||||||
|
<view class="time-total">
|
||||||
|
<view class="time">
|
||||||
|
{{ formatDateTime(item.createTime) }}
|
||||||
|
</view>
|
||||||
|
<view class="total">
|
||||||
|
共{{ item.totalNum }}件商品
|
||||||
|
<text v-if="item.isGiftCardReceiveBlind === 0" class="total-txt">
|
||||||
|
总金额<text class="color-red">¥{{ item.payPrice }}</text>
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="btns">
|
||||||
|
<view class="btn" @click="viewOrderTrack">查看物流</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { formatDateTime } from '@/utils/index'
|
||||||
|
export default {
|
||||||
|
name: 'AiHistoryList',
|
||||||
|
props: {
|
||||||
|
item: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
webUrl: this.$VUE_APP_RESOURCES_URL
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
formatDateTime,
|
||||||
|
viewOrderTrack() {
|
||||||
|
this.$emit('viewOrderTrack', this.item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.order-item {
|
||||||
|
padding: 20rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0rpx 6rpx 20rpx rgba(101,101,101,0.16);
|
||||||
|
.order-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
.order-shop {
|
||||||
|
flex: 1;
|
||||||
|
width: calc(100% - 120rpx);
|
||||||
|
.shop-name {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: #333;
|
||||||
|
font-size: 28rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
.icon {
|
||||||
|
display: block;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.order-id {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
.status {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
text-align: center;
|
||||||
|
background: rgba(197,39,51,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.product-info {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
font-size: 28rpx;
|
||||||
|
.good-img {
|
||||||
|
.img {
|
||||||
|
display: block;
|
||||||
|
width: 120rpx;
|
||||||
|
height: 120rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.name-wrap {
|
||||||
|
height: 120rpx;
|
||||||
|
width: calc(100% - 260rpx);
|
||||||
|
.name {
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
.attr {
|
||||||
|
display: inline-block;
|
||||||
|
height: 50rpx;
|
||||||
|
max-width: 100%;
|
||||||
|
padding: 0 25rpx;
|
||||||
|
margin: 20rpx 0 0 0;
|
||||||
|
border-radius: 25rpx;
|
||||||
|
line-height: 50rpx;
|
||||||
|
color: #252525;
|
||||||
|
background: rgba(239,239,239,0.39);
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.price-num {
|
||||||
|
width: 100rpx;
|
||||||
|
text-align: right;
|
||||||
|
line-height: 40rpx;
|
||||||
|
.num {
|
||||||
|
font-size: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.product-info2 {
|
||||||
|
.name-wrap {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
.attr {
|
||||||
|
padding: 0;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.order-bottom {
|
||||||
|
.time-total {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
color: #999;
|
||||||
|
font-size: 22rpx;
|
||||||
|
.total-txt {
|
||||||
|
color: #333;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.color-red {
|
||||||
|
color: #C52733;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btns {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin: 24rpx 0 0 0;
|
||||||
|
.btn {
|
||||||
|
height: 44rpx;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
border-radius: 22rpx;
|
||||||
|
border: 1rpx solid #C52733;
|
||||||
|
color: #C52733;
|
||||||
|
font-size: 28rpx;
|
||||||
|
line-height: 44rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+265
-7
@@ -1,19 +1,46 @@
|
|||||||
import {
|
import {
|
||||||
getSseConfigV1,
|
getSseConfigV1,
|
||||||
getCompletionsV2,
|
getCompletionsV2,
|
||||||
deleteChatItemByConversationId
|
deleteChatItemByConversationId,
|
||||||
|
// getAnalyzeKeywordsV1,
|
||||||
|
getAnalyzeKeywordsChangeV1
|
||||||
} from '@/api/chat/index'
|
} from '@/api/chat/index'
|
||||||
import { VUE_APP_API_URL } from '@/config'
|
import { VUE_APP_API_URL } from '@/config'
|
||||||
import settings from '@/config/baseSetting.js'
|
import settings from '@/config/baseSetting.js'
|
||||||
import { formatAiMsgContent } from '../utils/aiChat'
|
import { formatAiMsgContent } from '../utils/aiChat'
|
||||||
import cookie from '@/utils/store/cookie'
|
import cookie from '@/utils/store/cookie'
|
||||||
import { handleLoginFailure } from '@/utils'
|
import { handleLoginFailure } from '@/utils'
|
||||||
|
const plugin = requirePlugin('WechatSI')
|
||||||
|
const removeMarkdown = require('remove-markdown')
|
||||||
export const chatMixins = {
|
export const chatMixins = {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
token: cookie.get('login_status'),
|
token: cookie.get('login_status'),
|
||||||
userInfo: cookie.get('userInfo'),
|
userInfo: cookie.get('userInfo'),
|
||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
|
bottomTools: Object.freeze([
|
||||||
|
{
|
||||||
|
icon: 'icon-50',
|
||||||
|
text: '我要送礼',
|
||||||
|
type: 'prompt',
|
||||||
|
prompt: '我要送礼,请给我推荐一些平台的礼品',
|
||||||
|
url: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'icon-51',
|
||||||
|
text: '订单查询',
|
||||||
|
type: 'prompt',
|
||||||
|
prompt: '订单查询',
|
||||||
|
url: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'icon-52',
|
||||||
|
text: '拍照识图',
|
||||||
|
type: 'link',
|
||||||
|
prompt: '',
|
||||||
|
url: '/aiChat/views/imageRecognition'
|
||||||
|
}
|
||||||
|
]),
|
||||||
scrollData: {},
|
scrollData: {},
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
isScrollToBottom: false,
|
isScrollToBottom: false,
|
||||||
@@ -44,7 +71,11 @@ export const chatMixins = {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
],
|
],
|
||||||
errorMsg: Object.freeze('您提的问题未能理解,云灵思想跑偏啦,重新整理一下问题或者重新提问,让云灵再试试!')
|
errorMsg: Object.freeze('您提的问题未能理解,云灵思想跑偏啦,重新整理一下问题或者重新提问,让云灵再试试!'),
|
||||||
|
audioAyy: [],
|
||||||
|
isPlayAudio: false,
|
||||||
|
audioContext: null,
|
||||||
|
audioPlayId: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -69,9 +100,8 @@ export const chatMixins = {
|
|||||||
}.bind(this)).exec()
|
}.bind(this)).exec()
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
|
this.audioStopHandle()
|
||||||
this.closeWsFn()
|
this.closeWsFn()
|
||||||
// console.log('在页面卸载时取消监听')
|
|
||||||
// wx.offKeyboardHeightChange()
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const _this = this
|
const _this = this
|
||||||
@@ -104,10 +134,21 @@ export const chatMixins = {
|
|||||||
copyContentHandle(data) {
|
copyContentHandle(data) {
|
||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
data,
|
data,
|
||||||
success: () =>
|
success: () => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '已复制'
|
title: '已复制'
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
copyMoreInfoHandle(item) {
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: JSON.stringify(item.showMoreInfo),
|
||||||
|
success: () => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '已复制'
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
shareHandle() {
|
shareHandle() {
|
||||||
@@ -131,6 +172,7 @@ export const chatMixins = {
|
|||||||
},
|
},
|
||||||
// 重新生成
|
// 重新生成
|
||||||
regenerateHandle(item) {
|
regenerateHandle(item) {
|
||||||
|
this.audioStopHandle()
|
||||||
deleteChatItemByConversationId(item.conversationId).then(res => {
|
deleteChatItemByConversationId(item.conversationId).then(res => {
|
||||||
const { success } = res
|
const { success } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
@@ -181,7 +223,8 @@ export const chatMixins = {
|
|||||||
conversationId: '',
|
conversationId: '',
|
||||||
prompt,
|
prompt,
|
||||||
listQuestion: [],
|
listQuestion: [],
|
||||||
type: -2
|
type: -2,
|
||||||
|
showMoreInfo: {}
|
||||||
})
|
})
|
||||||
_this.loading = true
|
_this.loading = true
|
||||||
_this.showCursor = false
|
_this.showCursor = false
|
||||||
@@ -207,6 +250,34 @@ export const chatMixins = {
|
|||||||
_this.chatErrorSetContent()
|
_this.chatErrorSetContent()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
/*
|
||||||
|
getAnalyzeKeywordsV1({
|
||||||
|
'chatNumber': _this.chatNumber,
|
||||||
|
conversationId,
|
||||||
|
prompt
|
||||||
|
}).then(keywordRes => {
|
||||||
|
if (keywordRes.success) {
|
||||||
|
const keywordResData = keywordRes.data
|
||||||
|
const show = (keywordResData.searchArtworks ||
|
||||||
|
keywordResData.searchDiscount ||
|
||||||
|
keywordResData.searchGoods ||
|
||||||
|
keywordResData.searchLandmark ||
|
||||||
|
keywordResData.searchTowns ||
|
||||||
|
keywordResData.searchTravelGuide
|
||||||
|
) && (keywordResData.resultItems && keywordResData.resultItems.length > 0)
|
||||||
|
_this.chatMessageList[_this.chatMessageListLength - 1].showMoreInfo = keywordResData
|
||||||
|
_this.chatMessageList[_this.chatMessageListLength - 1].showMoreInfo.show = show
|
||||||
|
// 展示类型
|
||||||
|
_this.chatMessageList[_this.chatMessageListLength - 1].showMoreInfo.showType = ''
|
||||||
|
if (show && keywordResData.resultItems) {
|
||||||
|
keywordResData.resultItems.map(resItem => {
|
||||||
|
_this.chatMessageList[_this.chatMessageListLength - 1].showMoreInfo.showType = resItem.type
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log(_this.chatMessageList[_this.chatMessageListLength - 1])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
*/
|
||||||
} else {
|
} else {
|
||||||
_this.chatErrorSetContent()
|
_this.chatErrorSetContent()
|
||||||
}
|
}
|
||||||
@@ -215,6 +286,68 @@ export const chatMixins = {
|
|||||||
_this.chatErrorSetContent()
|
_this.chatErrorSetContent()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
analyzeKeywordsChangeHandle(conversationId, showMoreInfo) {
|
||||||
|
getAnalyzeKeywordsChangeV1({
|
||||||
|
conversationId,
|
||||||
|
...showMoreInfo
|
||||||
|
}).then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
let resultItems = []
|
||||||
|
let idx = -1
|
||||||
|
this.chatMessageList.map((item, index) => {
|
||||||
|
if (item.conversationId === conversationId) {
|
||||||
|
resultItems = data.resultItems || []
|
||||||
|
idx = index
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (idx > -1) {
|
||||||
|
this.$set(this.chatMessageList[idx].showMoreInfo, 'resultItems', resultItems)
|
||||||
|
this.$forceUpdate()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
productItemClickHandle(item) {
|
||||||
|
this.audioStopHandle()
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pages/shop/GoodsCon/index',
|
||||||
|
query: {
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
hotelItemClickHandle(item) {
|
||||||
|
this.audioStopHandle()
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pagesInn/inn/innHome',
|
||||||
|
query: {
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
ichItemClickHandle(item) {
|
||||||
|
this.audioStopHandle()
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pkg_product/views/heritage/details',
|
||||||
|
query: {
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
qianxianItemClickHandle(item) {
|
||||||
|
this.audioStopHandle()
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pkg_product/views/famousQianxianShop',
|
||||||
|
query: {
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
prizeItemClickHandle() {
|
||||||
|
this.audioStopHandle()
|
||||||
|
this.$yrouter.push({ path: '/pkg-video/views/lottery' })
|
||||||
|
},
|
||||||
chatErrorSetContent() {
|
chatErrorSetContent() {
|
||||||
this.chatMessageList[this.chatMessageListLength - 1].isError = true
|
this.chatMessageList[this.chatMessageListLength - 1].isError = true
|
||||||
this.chatMessageList[this.chatMessageListLength - 1].content = this.errorMsg
|
this.chatMessageList[this.chatMessageListLength - 1].content = this.errorMsg
|
||||||
@@ -239,7 +372,7 @@ export const chatMixins = {
|
|||||||
const _this = this
|
const _this = this
|
||||||
console.log('------------------创建连接')
|
console.log('------------------创建连接')
|
||||||
uni.connectSocket({
|
uni.connectSocket({
|
||||||
url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.unionId}-${conversationId}`,
|
url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.uid}-${conversationId}`,
|
||||||
header: {
|
header: {
|
||||||
'content-type': 'application/json'
|
'content-type': 'application/json'
|
||||||
},
|
},
|
||||||
@@ -305,6 +438,131 @@ export const chatMixins = {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('send failed (' + err.code + ')')
|
console.log('send failed (' + err.code + ')')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
audioStopHandle() {
|
||||||
|
// Fix bug#4049
|
||||||
|
this.audioAyy = []
|
||||||
|
if (this.audioContext) {
|
||||||
|
this.audioContext.stop()
|
||||||
|
this.audioContext.destroy() // 强制销毁释放资源
|
||||||
|
this.audioContext = null
|
||||||
|
}
|
||||||
|
this.isPlayAudio = false
|
||||||
|
|
||||||
|
// 强制关闭微信小程序背景音频
|
||||||
|
if (typeof wx !== 'undefined' && wx.getBackgroundAudioManager) {
|
||||||
|
wx.getBackgroundAudioManager().stop()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ttsHandle(item) {
|
||||||
|
this.audioAyy = []
|
||||||
|
if (this.audioContext) {
|
||||||
|
this.audioContext.stop()
|
||||||
|
// this.audioContext.destroy()
|
||||||
|
}
|
||||||
|
// 如果正在播放,点击当前播放的则认为是暂停
|
||||||
|
if (this.isPlayAudio && item.conversationId === this.audioPlayId) {
|
||||||
|
this.isPlayAudio = false
|
||||||
|
this.audioPlayId = ''
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.isPlayAudio = false
|
||||||
|
this.audioPlayId = item.conversationId
|
||||||
|
const flag = 1
|
||||||
|
if (flag === 1) {
|
||||||
|
console.log(removeMarkdown(item.content).replace(/[\n\t\s]/g, ''))
|
||||||
|
uni.showLoading({
|
||||||
|
title: '合成中...'
|
||||||
|
})
|
||||||
|
this.splitAndSynthesize(removeMarkdown(item.content).replace(/[\n\t\s]/g, ''))
|
||||||
|
} else {
|
||||||
|
// 调试数据
|
||||||
|
this.audioAyy = [
|
||||||
|
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749075_2f71887cc48d9b3753c39d119862d4bb&filekey=871027724&source=miniapp_plugin',
|
||||||
|
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749077_0970508786c5e3edc3a68a5eb9de048c&filekey=871027724&source=miniapp_plugin',
|
||||||
|
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749079_e77cec52cc077ba981892887c3df4cdf&filekey=871027724&source=miniapp_plugin',
|
||||||
|
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749080_02db4235771f5561cdb73c06d8c67e53&filekey=871027724&source=miniapp_plugin',
|
||||||
|
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749082_534e455c5d6ac5e9a4192ecf9952851a&filekey=871027724&source=miniapp_plugin',
|
||||||
|
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749083_78c4a2fecad538561f81c48dc4ecd645&filekey=871027724&source=miniapp_plugin'
|
||||||
|
]
|
||||||
|
this.playNextChunk()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
splitAndSynthesize(text) {
|
||||||
|
const _this = this
|
||||||
|
if (text) {
|
||||||
|
const textLength = text.length
|
||||||
|
const chunkSize = 100
|
||||||
|
const chunk = text.slice(0, textLength > chunkSize ? chunkSize : textLength)
|
||||||
|
plugin.textToSpeech({
|
||||||
|
// 语言
|
||||||
|
lang: 'zh_CN',
|
||||||
|
tts: true,
|
||||||
|
// 要转换的文字
|
||||||
|
content: chunk,
|
||||||
|
success: function(res) {
|
||||||
|
console.log("语音文件路径:", res.filename)
|
||||||
|
_this.audioAyy.push(res.filename)
|
||||||
|
// 首次就立即播放,增强体验
|
||||||
|
if (!_this.isPlayAudio) {
|
||||||
|
_this.playNextChunk()
|
||||||
|
}
|
||||||
|
if (textLength > chunkSize) {
|
||||||
|
// 递归调用,播放一定要按照文本分割顺序
|
||||||
|
_this.splitAndSynthesize(text.substr(chunkSize, textLength))
|
||||||
|
} else {
|
||||||
|
// 最后一条合成,没有正在播放则立即播放
|
||||||
|
if (!_this.isPlayAudio) {
|
||||||
|
_this.playNextChunk()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uni.hideLoading()
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
console.log("转换失败:", err)
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
if (!_this.isPlayAudio) {
|
||||||
|
_this.playNextChunk()
|
||||||
|
}
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
playNextChunk() {
|
||||||
|
if (this.audioAyy.length > 0 && this.audioPlayId) {
|
||||||
|
const src = this.audioAyy.shift()
|
||||||
|
this.isPlayAudio = true
|
||||||
|
const audioContext = uni.createInnerAudioContext({
|
||||||
|
// 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项
|
||||||
|
useWebAudioImplement: false
|
||||||
|
})
|
||||||
|
this.audioContext = audioContext
|
||||||
|
audioContext.src = src
|
||||||
|
audioContext.onEnded(() => {
|
||||||
|
audioContext.destroy()
|
||||||
|
this.playNextChunk()
|
||||||
|
})
|
||||||
|
audioContext.play()
|
||||||
|
console.log('------------src:' + src)
|
||||||
|
} else {
|
||||||
|
console.log('------------end')
|
||||||
|
this.isPlayAudio = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
bottomToolClickHandle(item) {
|
||||||
|
if (item.type === 'prompt') {
|
||||||
|
this.streamReq({
|
||||||
|
prompt: item.prompt,
|
||||||
|
init: 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (item.type === 'link') {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: item.url
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,982 @@
|
|||||||
|
import {
|
||||||
|
getSseConfigV1,
|
||||||
|
getCompletionsV3,
|
||||||
|
deleteChatItemByConversationId,
|
||||||
|
// getAnalyzeKeywordsV1,
|
||||||
|
getAnalyzeKeywordsChangeV3,
|
||||||
|
getSseCountyAiConfigV1,
|
||||||
|
getCountyAiCompletionsV1,
|
||||||
|
getGiftRecommendOptions,
|
||||||
|
getGiftRecommendPrompt
|
||||||
|
} from '@/api/chat/index'
|
||||||
|
import {
|
||||||
|
getExceptionConfig,
|
||||||
|
getBottomNavigationConfigList
|
||||||
|
} from '@/api/public'
|
||||||
|
import {
|
||||||
|
getProductDetail,
|
||||||
|
postCartAdd
|
||||||
|
} from '@/api/store'
|
||||||
|
import { VUE_APP_API_URL } from '@/config'
|
||||||
|
import settings from '@/config/baseSetting.js'
|
||||||
|
import { formatAiMsgContent } from '../utils/aiChat'
|
||||||
|
import cookie from '@/utils/store/cookie'
|
||||||
|
import { handleLoginFailure } from '@/utils'
|
||||||
|
const plugin = requirePlugin('WechatSI')
|
||||||
|
const removeMarkdown = require('remove-markdown')
|
||||||
|
export const chatMixinsV2 = {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
token: cookie.get('login_status'),
|
||||||
|
userInfo: cookie.get('userInfo'),
|
||||||
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
|
bottomTools: [],
|
||||||
|
scrollData: {},
|
||||||
|
scrollTop: 0,
|
||||||
|
isScrollToBottom: false,
|
||||||
|
// 状态栏高度
|
||||||
|
statusBarHeight: 20,
|
||||||
|
bottomSafeDistance: 0,
|
||||||
|
fileHttpStr: Object.freeze(VUE_APP_API_URL + settings.sysPrefix),
|
||||||
|
keyboardHeight: 0,
|
||||||
|
optionsFrom: '',
|
||||||
|
onFocus: false,
|
||||||
|
loading: false,
|
||||||
|
chatNumber: '',
|
||||||
|
infoResData: {},
|
||||||
|
chatMessageList: [],
|
||||||
|
audioAyy: [],
|
||||||
|
isPlayAudio: false,
|
||||||
|
audioContext: null,
|
||||||
|
audioPlayId: '',
|
||||||
|
showGiftBtn: false,
|
||||||
|
buyLoading: false,
|
||||||
|
buyActionLock: false,
|
||||||
|
exceptionConfig: {
|
||||||
|
model_exception: '您提的问题未能理解,云灵思想跑偏啦,重新整理一下问题或者重新提问,让云灵再试试!',
|
||||||
|
voice_exception: ''
|
||||||
|
},
|
||||||
|
giftStepLoading: false,
|
||||||
|
onlyOneToAddCart: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
chatMessageListLength() {
|
||||||
|
return this.chatMessageList.length
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onPageScroll(e) {
|
||||||
|
this.scrollData = e
|
||||||
|
const scrollTop = e.scrollTop
|
||||||
|
this.scrollTop = scrollTop
|
||||||
|
const query = wx.createSelectorQuery().in(this)
|
||||||
|
query.select('#fixTbabarBody').boundingClientRect(function(rect) {
|
||||||
|
const contentHeight = rect.height
|
||||||
|
const windowInfo = wx.getWindowInfo()
|
||||||
|
const windowHeight = windowInfo.windowHeight
|
||||||
|
if (scrollTop + windowHeight + 30 >= contentHeight) {
|
||||||
|
this.isScrollToBottom = true
|
||||||
|
} else {
|
||||||
|
this.isScrollToBottom = false
|
||||||
|
}
|
||||||
|
}.bind(this)).exec()
|
||||||
|
},
|
||||||
|
onUnload() {
|
||||||
|
this.audioStopHandle()
|
||||||
|
this.closeWsFn()
|
||||||
|
},
|
||||||
|
onHide() {
|
||||||
|
this.audioStopHandle()
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
const _this = this
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (e) => {
|
||||||
|
let statusBar = 0
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
statusBar = e.statusBarHeight
|
||||||
|
const custom = uni.getMenuButtonBoundingClientRect()
|
||||||
|
_this.rightDistance = e.windowWidth - custom.left + 10
|
||||||
|
// #endif
|
||||||
|
// 状态栏高度
|
||||||
|
_this.statusBarHeight = statusBar
|
||||||
|
_this.bottomSafeDistance = e.safeAreaInsets.bottom
|
||||||
|
}
|
||||||
|
})
|
||||||
|
_this.createdCallbak()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
createdCallbak() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.scrollToBottomHandle()
|
||||||
|
getExceptionConfig().then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
this.exceptionConfig = data || {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// 县域AI没有底部快捷操作和送礼配置
|
||||||
|
if (!this.countyId) {
|
||||||
|
getBottomNavigationConfigList().then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
this.bottomTools = data || []
|
||||||
|
this.bottomTools.forEach(item => {
|
||||||
|
item.display = true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
getGiftRecommendOptions().then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
this.giftBuyOptions = data || {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.extraReqFn()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
extraReqFn() {
|
||||||
|
console.log('首页/历史详情页面单独请求接口逻辑')
|
||||||
|
},
|
||||||
|
inputFocusHandle(value) {
|
||||||
|
this.onFocus = value === 1
|
||||||
|
this.scrollToBottomHandle()
|
||||||
|
},
|
||||||
|
historyViewHandle() {
|
||||||
|
console.log(this.$refs.historyView)
|
||||||
|
this.$refs.historyView.showView()
|
||||||
|
},
|
||||||
|
copyContentHandle(data) {
|
||||||
|
uni.setClipboardData({
|
||||||
|
data,
|
||||||
|
success: () => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '已复制'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
copyMoreInfoHandle(item) {
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: JSON.stringify(item.showMoreInfo),
|
||||||
|
success: () => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '已复制'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
shareHandle() {
|
||||||
|
wx.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
menus: ['shareAppMessage', 'shareTimeline'],
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res)
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
scrollToBottomHandle() {
|
||||||
|
uni.pageScrollTo({
|
||||||
|
duration: 100,
|
||||||
|
selector: '#bottom_postion'
|
||||||
|
})
|
||||||
|
this.isScrollToBottom = true
|
||||||
|
},
|
||||||
|
// 重新生成
|
||||||
|
regenerateHandle(item) {
|
||||||
|
this.audioStopHandle()
|
||||||
|
deleteChatItemByConversationId(item.conversationId).then(res => {
|
||||||
|
const { success } = res
|
||||||
|
if (success) {
|
||||||
|
this.chatMessageList.splice(this.chatMessageListLength - 1, 1)
|
||||||
|
this.streamReq({
|
||||||
|
prompt: item.prompt,
|
||||||
|
init: 1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 建议提问
|
||||||
|
suggestionItemClickHandle(question) {
|
||||||
|
this.streamReq({
|
||||||
|
prompt: question,
|
||||||
|
init: 0
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 大家都在问
|
||||||
|
topicItemClickHandle(question) {
|
||||||
|
this.streamReq({
|
||||||
|
prompt: question,
|
||||||
|
init: 0
|
||||||
|
})
|
||||||
|
},
|
||||||
|
streamReq(params) {
|
||||||
|
const _this = this
|
||||||
|
// 需要校验登录状态
|
||||||
|
if (!_this.token) {
|
||||||
|
handleLoginFailure()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (params.prompt.length > 500) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "字数已超出限制",
|
||||||
|
icon: "none",
|
||||||
|
duration: 5000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.loading) return
|
||||||
|
const prompt = params.prompt.substr(0, 500)
|
||||||
|
if (params.init !== 1) {
|
||||||
|
_this.chatMessageList.push({
|
||||||
|
prompt,
|
||||||
|
type: -1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
_this.$nextTick(() => {
|
||||||
|
_this.scrollToBottomHandle()
|
||||||
|
})
|
||||||
|
_this.chatMessageList.push({
|
||||||
|
content: '',
|
||||||
|
nodes: '',
|
||||||
|
isError: false,
|
||||||
|
showCursor: false,
|
||||||
|
conversationId: '',
|
||||||
|
prompt,
|
||||||
|
listQuestion: [],
|
||||||
|
// 特产商品
|
||||||
|
goodsList: [],
|
||||||
|
// 礼品商品
|
||||||
|
giftGoodsList: [],
|
||||||
|
// 非遗文化
|
||||||
|
ichList: [],
|
||||||
|
// 千县名品
|
||||||
|
qianxianList: [],
|
||||||
|
// 抽奖
|
||||||
|
prizeList: [],
|
||||||
|
// 店铺
|
||||||
|
shopList: [],
|
||||||
|
// 地标好物--屏蔽原因:实现此功能时,后端通过AI动态返回的图片不满足需求,后面就不要了
|
||||||
|
landmarksList: [],
|
||||||
|
// 订单
|
||||||
|
orderList: [],
|
||||||
|
type: -2,
|
||||||
|
showMoreInfo: {},
|
||||||
|
currentSwiperIndex: 0,
|
||||||
|
showChangeBtn: true,
|
||||||
|
changeIsRotate: false
|
||||||
|
})
|
||||||
|
_this.loading = true
|
||||||
|
_this.showCursor = false
|
||||||
|
let reqFn = null
|
||||||
|
let postData = {}
|
||||||
|
if (_this.countyId) {
|
||||||
|
reqFn = getSseCountyAiConfigV1
|
||||||
|
postData = {
|
||||||
|
'countyId': _this.countyId,
|
||||||
|
'chatNumber': _this.chatNumber,
|
||||||
|
prompt
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
reqFn = getSseConfigV1
|
||||||
|
postData = {
|
||||||
|
'chatNumber': _this.chatNumber,
|
||||||
|
prompt
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reqFn(postData).then(resConfig => {
|
||||||
|
const conversationId = resConfig.data.conversationId
|
||||||
|
_this.chatNumber = resConfig.data.chatNumber || ''
|
||||||
|
_this.chatMessageList[_this.chatMessageListLength - 1].showCursor = true
|
||||||
|
_this.chatMessageList[_this.chatMessageListLength - 1].conversationId = conversationId
|
||||||
|
if (conversationId) {
|
||||||
|
_this.initWebSocket(conversationId, () => {
|
||||||
|
|
||||||
|
let completionsReqFn = null
|
||||||
|
let completionsPostData = {}
|
||||||
|
if (_this.countyId) {
|
||||||
|
completionsReqFn = getCountyAiCompletionsV1
|
||||||
|
completionsPostData = {
|
||||||
|
conversationId,
|
||||||
|
countyId: _this.countyId,
|
||||||
|
ws: true,
|
||||||
|
isNoNeedPublicErrorNotification: 1
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
completionsReqFn = getCompletionsV3
|
||||||
|
completionsPostData = {
|
||||||
|
conversationId,
|
||||||
|
ws: true,
|
||||||
|
isNoNeedPublicErrorNotification: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
completionsReqFn(completionsPostData).then(sseRes => {
|
||||||
|
console.log(sseRes)
|
||||||
|
// _this.closeWsFn()
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
_this.chatErrorSetContent()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
_this.chatErrorSetContent()
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
_this.chatErrorSetContent()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
initWebSocket(conversationId, cb) {
|
||||||
|
const _this = this
|
||||||
|
console.log('------------------创建连接')
|
||||||
|
uni.connectSocket({
|
||||||
|
url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.uid}-${conversationId}`,
|
||||||
|
header: {
|
||||||
|
'content-type': 'application/json'
|
||||||
|
},
|
||||||
|
timeout: 10 * 1000,
|
||||||
|
success: () => {
|
||||||
|
console.log('------------WebSocket初始化成功')
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
uni.showModal({
|
||||||
|
showCancel: false,
|
||||||
|
content: err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
uni.onSocketMessage(res => {
|
||||||
|
_this.websocketOnmessage(res)
|
||||||
|
})
|
||||||
|
uni.onSocketOpen(() => {
|
||||||
|
cb && cb()
|
||||||
|
_this.websocketOnopen()
|
||||||
|
})
|
||||||
|
uni.onSocketError(err => {
|
||||||
|
_this.websocketOnerror(err)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
websocketOnmessage(res) {
|
||||||
|
console.log('-------------监听 WebSocket 接受到服务器的消息事件')
|
||||||
|
const resData = JSON.parse(res.data)
|
||||||
|
if (resData) {
|
||||||
|
const message = resData.message
|
||||||
|
console.log(message)
|
||||||
|
if (message && this.chatMessageListLength > 1) {
|
||||||
|
const mesContent = message.content
|
||||||
|
const contentType = message.contentType
|
||||||
|
const finish = message.finish
|
||||||
|
if (contentType === 'text') {
|
||||||
|
if (!finish && mesContent) {
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].nodes = formatAiMsgContent(mesContent)
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].content = mesContent
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].listQuestion = message.listQuestion || []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (contentType === 'order') {
|
||||||
|
if (!finish && message.listCards) {
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].orderList = message.listCards || []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (contentType === 'shop') {
|
||||||
|
if (!finish && message.listCards) {
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].shopList = message.listCards || []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (contentType === 'gift') {
|
||||||
|
if (!finish && message.listCards) {
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].giftGoodsList = message.listCards || []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (contentType === 'discount') {
|
||||||
|
if (!finish && message.listCards) {
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].prizeList = message.listCards || []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (contentType === 'goods') {
|
||||||
|
if (!finish && message.listCards) {
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].goodsList = message.listCards || []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (contentType === 'famous') {
|
||||||
|
if (!finish && message.listCards) {
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].qianxianList = message.listCards || []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (contentType === 'ich') {
|
||||||
|
if (!finish && message.listCards) {
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].ichList = message.listCards || []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (contentType === 'landmarks') {
|
||||||
|
if (!finish && message.listCards) {
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].landmarksList = message.listCards || []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$forceUpdate()
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.scrollToBottomHandle()
|
||||||
|
if (finish) {
|
||||||
|
this.closeWsFn()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
websocketOnopen() {
|
||||||
|
console.log('------------------监听 WebSocket 连接打开事件')
|
||||||
|
// this.websocketSend(JSON.stringify({ msg: '1' }))
|
||||||
|
},
|
||||||
|
websocketOnerror(e) {
|
||||||
|
console.log('-----------------监听 WebSocket 错误事件')
|
||||||
|
console.log(e)
|
||||||
|
},
|
||||||
|
websocketSend(msg) {
|
||||||
|
// 数据发送
|
||||||
|
try {
|
||||||
|
uni.sendSocketMessage({
|
||||||
|
data: msg,
|
||||||
|
success: () => {
|
||||||
|
console.log('-----------发送消息成功了')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} catch (err) {
|
||||||
|
console.log('send failed (' + err.code + ')')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onSwiperChange(index, e) {
|
||||||
|
this.chatMessageList[index].currentSwiperIndex = e.detail.current
|
||||||
|
},
|
||||||
|
analyzeKeywordsChangeHandle(conversationId, item) {
|
||||||
|
let idx = -1
|
||||||
|
this.chatMessageList.map((item, index) => {
|
||||||
|
if (item.conversationId === conversationId) {
|
||||||
|
idx = index
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (idx > -1) {
|
||||||
|
if (this.chatMessageList[idx].changeIsRotate) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$set(this.chatMessageList[idx], 'changeIsRotate', true)
|
||||||
|
}
|
||||||
|
let listKey = ''
|
||||||
|
// 抽奖和订单查询没有换一换
|
||||||
|
if (item.goodsList.length > 0) {
|
||||||
|
listKey = 'goodsList'
|
||||||
|
}
|
||||||
|
if (item.giftGoodsList.length > 0) {
|
||||||
|
listKey = 'giftGoodsList'
|
||||||
|
}
|
||||||
|
if (item.ichList.length > 0) {
|
||||||
|
listKey = 'ichList'
|
||||||
|
}
|
||||||
|
if (item.qianxianList.length > 0) {
|
||||||
|
listKey = 'qianxianList'
|
||||||
|
}
|
||||||
|
if (item.shopList.length > 0) {
|
||||||
|
listKey = 'shopList'
|
||||||
|
}
|
||||||
|
getAnalyzeKeywordsChangeV3({
|
||||||
|
conversationId
|
||||||
|
}).then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
let changeList = []
|
||||||
|
this.chatMessageList.map((item) => {
|
||||||
|
if (item.conversationId === conversationId) {
|
||||||
|
changeList = data.list || []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (idx > -1 && listKey) {
|
||||||
|
this.$set(this.chatMessageList[idx], listKey, changeList)
|
||||||
|
this.$forceUpdate()
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$set(this.chatMessageList[idx], 'changeIsRotate', false)
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
this.$set(this.chatMessageList[idx], 'changeIsRotate', false)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
productItemClickHandle(item) {
|
||||||
|
this.audioStopHandle()
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pages/shop/GoodsCon/index',
|
||||||
|
query: {
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
productItemSupplierClickHandle(item) {
|
||||||
|
if (!item.storeId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.audioStopHandle()
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pagesInn/inn/innHome',
|
||||||
|
query: {
|
||||||
|
id: item.storeId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
productItemBuyNowClickHandle(item) {
|
||||||
|
this.showGiftBtn = false
|
||||||
|
this.productItemBuyNowOrGiftBuy(item, 1)
|
||||||
|
},
|
||||||
|
productItemGiftBuyClickHandle(item) {
|
||||||
|
this.showGiftBtn = true
|
||||||
|
this.productItemBuyNowOrGiftBuy(item, 2)
|
||||||
|
},
|
||||||
|
productItemBuyNowOrGiftBuy(item, BuyNowOrGiftBuyType) {
|
||||||
|
if (this.buyActionLock) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.buyActionLock = true
|
||||||
|
this.audioStopHandle()
|
||||||
|
this.cart_num = 1
|
||||||
|
this.m_id = item.id
|
||||||
|
getProductDetail(item.id).then(res => {
|
||||||
|
const { data } = res
|
||||||
|
this.storeInfo = {...data.storeInfo}
|
||||||
|
if(data.storeInfo.stock === 0) {
|
||||||
|
this.buyActionLock = false
|
||||||
|
uni.showToast({
|
||||||
|
title: "产品库存不足,请选择其他商品",
|
||||||
|
icon: "none",
|
||||||
|
duration: 5000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.isWenwan = data.isWenwan
|
||||||
|
this.qualifications = data.qualifications || []
|
||||||
|
// 给 attr 赋值,将请求回来的规格赋值给 attr
|
||||||
|
if (this.source !== 'pre' && this.source !== 'day' && this.source !== 'kill' && this.source !== 'spe') {
|
||||||
|
this.attr.productAttr = data.productAttr || []
|
||||||
|
this.productValueArr = []
|
||||||
|
for (const key in data.productValue) {
|
||||||
|
this.productValueArr.push({
|
||||||
|
attrItemkey: key,
|
||||||
|
...data.productValue[key]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 初始化认为所有的规格都是可以选的
|
||||||
|
this.attr.productAttr.map(item => {
|
||||||
|
item.attrValue.map(subItem => {
|
||||||
|
subItem.canUsed = true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.attr.defaultSku = data.defaultSku
|
||||||
|
this.attr.defaultSkuIndex = data.defaultSkuIndex
|
||||||
|
this.DefaultSelect()
|
||||||
|
// 是否单一规格
|
||||||
|
const onlyOne = Object.keys(data.productValue).length === 1
|
||||||
|
|
||||||
|
if(onlyOne) {
|
||||||
|
this.buyNowOrGiftBuyReq(BuyNowOrGiftBuyType)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.attr.cartAttr = !this.isOpen ? true : false
|
||||||
|
this.buyActionLock = false
|
||||||
|
}).catch(error => {
|
||||||
|
this.buyActionLock = false
|
||||||
|
uni.showToast({
|
||||||
|
title: error.msg || '操作失败,请稍后重试',
|
||||||
|
icon: "none",
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
buyNowOrGiftBuyReq(type) {
|
||||||
|
const _this = this
|
||||||
|
if (_this.buyLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_this.buyLoading = true
|
||||||
|
postCartAdd({
|
||||||
|
productId: _this.m_id,
|
||||||
|
cartNum: _this.attr.productSelect.cart_num,
|
||||||
|
new: 1,
|
||||||
|
uniqueId: _this.attr.productSelect !== undefined ? _this.attr.productSelect.unique : ''
|
||||||
|
}).then(function (res) {
|
||||||
|
try {
|
||||||
|
_this.closeAttrWindow()
|
||||||
|
const { cartId } = res.data
|
||||||
|
if (type === 1) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/order/OrderSubmission/index?id=' + cartId
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(type === 2) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pkg_user/views/gift/gift?cartId=' + cartId
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
uni.showToast({
|
||||||
|
title: error.msg,
|
||||||
|
icon: "none",
|
||||||
|
duration: 5000
|
||||||
|
})
|
||||||
|
}).finally(() => {
|
||||||
|
_this.buyLoading = false
|
||||||
|
_this.buyActionLock = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
closeAttrWindow() {
|
||||||
|
this.$set(this.attr, 'cartAttr', false)
|
||||||
|
},
|
||||||
|
hotelItemClickHandle(item) {
|
||||||
|
this.audioStopHandle()
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pagesInn/inn/innHome',
|
||||||
|
query: {
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
ichItemClickHandle(item) {
|
||||||
|
this.audioStopHandle()
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pkg_product/views/heritage/details',
|
||||||
|
query: {
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
qianxianItemClickHandle(item) {
|
||||||
|
this.audioStopHandle()
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pkg_product/views/famousQianxianShop',
|
||||||
|
query: {
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
prizeItemClickHandle() {
|
||||||
|
this.audioStopHandle()
|
||||||
|
this.$yrouter.push({ path: '/pkg-video/views/lottery' })
|
||||||
|
},
|
||||||
|
chatErrorSetContent() {
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].isError = true
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].content = this.exceptionConfig.model_exception
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].nodes = this.exceptionConfig.model_exception
|
||||||
|
this.closeWsFn()
|
||||||
|
},
|
||||||
|
closeWsFn() {
|
||||||
|
this.loading = false
|
||||||
|
if (this.chatMessageListLength) {
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].showCursor = false
|
||||||
|
}
|
||||||
|
uni.closeSocket({
|
||||||
|
success: () => {
|
||||||
|
console.log('-----关闭连接')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.scrollToBottomHandle()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
audioStopHandle() {
|
||||||
|
// 强制关闭微信小程序背景音频
|
||||||
|
try {
|
||||||
|
const bgAudio = wx.getBackgroundAudioManager ? wx.getBackgroundAudioManager() : null
|
||||||
|
if (bgAudio && typeof bgAudio.stop === 'function') {
|
||||||
|
bgAudio.stop()
|
||||||
|
bgAudio.src = ''
|
||||||
|
bgAudio.title = ''
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('stop background audio failed', e)
|
||||||
|
}
|
||||||
|
this.audioPlayId = ''
|
||||||
|
// Fix bug#4049
|
||||||
|
this.audioAyy = []
|
||||||
|
if (this.audioContext) {
|
||||||
|
this.audioContext.stop()
|
||||||
|
this.audioContext.destroy() // 强制销毁释放资源
|
||||||
|
this.audioContext = null
|
||||||
|
}
|
||||||
|
this.isPlayAudio = false
|
||||||
|
},
|
||||||
|
ttsHandle(item) {
|
||||||
|
this.audioAyy = []
|
||||||
|
if (this.audioContext) {
|
||||||
|
this.audioContext.stop()
|
||||||
|
// this.audioContext.destroy()
|
||||||
|
}
|
||||||
|
// 如果正在播放,点击当前播放的则认为是暂停
|
||||||
|
if (this.isPlayAudio && [item.conversationId, item.messageId, item.parentMessageId].includes(this.audioPlayId)) {
|
||||||
|
this.isPlayAudio = false
|
||||||
|
this.audioPlayId = ''
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.isPlayAudio = false
|
||||||
|
this.audioPlayId = item.conversationId || item.messageId || item.parentMessageId
|
||||||
|
const flag = 1
|
||||||
|
if (flag === 1) {
|
||||||
|
console.log(removeMarkdown(item.content).replace(/[\n\t\s]/g, ''))
|
||||||
|
uni.showLoading({
|
||||||
|
title: '合成中...'
|
||||||
|
})
|
||||||
|
this.splitAndSynthesize(removeMarkdown(item.content).replace(/[\n\t\s]/g, ''))
|
||||||
|
} else {
|
||||||
|
// 调试数据
|
||||||
|
this.audioAyy = [
|
||||||
|
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749075_2f71887cc48d9b3753c39d119862d4bb&filekey=871027724&source=miniapp_plugin',
|
||||||
|
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749077_0970508786c5e3edc3a68a5eb9de048c&filekey=871027724&source=miniapp_plugin',
|
||||||
|
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749079_e77cec52cc077ba981892887c3df4cdf&filekey=871027724&source=miniapp_plugin',
|
||||||
|
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749080_02db4235771f5561cdb73c06d8c67e53&filekey=871027724&source=miniapp_plugin',
|
||||||
|
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749082_534e455c5d6ac5e9a4192ecf9952851a&filekey=871027724&source=miniapp_plugin',
|
||||||
|
'https://ae.weixin.qq.com/cgi-bin/mmasrai-bin/getmedia?filename=1750749083_78c4a2fecad538561f81c48dc4ecd645&filekey=871027724&source=miniapp_plugin'
|
||||||
|
]
|
||||||
|
this.playNextChunk()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
splitAndSynthesize(text) {
|
||||||
|
const _this = this
|
||||||
|
if (text) {
|
||||||
|
const textLength = text.length
|
||||||
|
const chunkSize = 100
|
||||||
|
const chunk = text.slice(0, textLength > chunkSize ? chunkSize : textLength)
|
||||||
|
plugin.textToSpeech({
|
||||||
|
// 语言
|
||||||
|
lang: 'zh_CN',
|
||||||
|
tts: true,
|
||||||
|
// 要转换的文字
|
||||||
|
content: chunk,
|
||||||
|
success: function(res) {
|
||||||
|
console.log("语音文件路径:", res.filename)
|
||||||
|
_this.audioAyy.push(res.filename)
|
||||||
|
// 首次就立即播放,增强体验
|
||||||
|
if (!_this.isPlayAudio) {
|
||||||
|
_this.playNextChunk()
|
||||||
|
}
|
||||||
|
if (textLength > chunkSize) {
|
||||||
|
// 递归调用,播放一定要按照文本分割顺序
|
||||||
|
_this.splitAndSynthesize(text.substr(chunkSize, textLength))
|
||||||
|
} else {
|
||||||
|
// 最后一条合成,没有正在播放则立即播放
|
||||||
|
if (!_this.isPlayAudio) {
|
||||||
|
_this.playNextChunk()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uni.hideLoading()
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
console.log("转换失败:", err)
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
if (!_this.isPlayAudio) {
|
||||||
|
_this.playNextChunk()
|
||||||
|
}
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
playNextChunk() {
|
||||||
|
if (!this.audioAyy.length || !this.audioPlayId) {
|
||||||
|
this.isPlayAudio = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 销毁旧实例
|
||||||
|
if (this.audioContext) {
|
||||||
|
this.audioContext.stop()
|
||||||
|
this.audioContext.destroy()
|
||||||
|
this.audioContext = null
|
||||||
|
}
|
||||||
|
|
||||||
|
const src = this.audioAyy.shift()
|
||||||
|
this.isPlayAudio = true
|
||||||
|
|
||||||
|
const audioContext = uni.createInnerAudioContext({
|
||||||
|
useWebAudioImplement: true // 短音频建议 true
|
||||||
|
})
|
||||||
|
|
||||||
|
this.audioContext = audioContext
|
||||||
|
audioContext.src = src
|
||||||
|
|
||||||
|
audioContext.onPlay(() => {
|
||||||
|
console.log('audio play:', src)
|
||||||
|
})
|
||||||
|
|
||||||
|
audioContext.onEnded(() => {
|
||||||
|
this.audioContext = null
|
||||||
|
audioContext.destroy()
|
||||||
|
this.playNextChunk()
|
||||||
|
})
|
||||||
|
|
||||||
|
audioContext.onError((err) => {
|
||||||
|
console.error('audio error', err)
|
||||||
|
this.audioContext = null
|
||||||
|
audioContext.destroy()
|
||||||
|
this.playNextChunk()
|
||||||
|
})
|
||||||
|
|
||||||
|
audioContext.play()
|
||||||
|
},
|
||||||
|
bottomToolClickHandle(item) {
|
||||||
|
// 非界面跳转的需要校验登录状态
|
||||||
|
if (!this.token && item.navType !== 'url') {
|
||||||
|
handleLoginFailure()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const idx = this.bottomTools.findIndex((i) => i.giftCardEnabled === 1)
|
||||||
|
if (item.giftCardEnabled === 1) {
|
||||||
|
// 新建会话
|
||||||
|
this.createNewHandle('giftChat')
|
||||||
|
this.$set(this, 'showGiftSteps', true)
|
||||||
|
if (idx > -1) {
|
||||||
|
this.$set(this.bottomTools[idx], 'display', false)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$set(this, 'showGiftSteps', false)
|
||||||
|
if (idx > -1) {
|
||||||
|
this.$set(this.bottomTools[idx], 'display', true)
|
||||||
|
}
|
||||||
|
if (item.navType === 'prompt') {
|
||||||
|
this.streamReq({
|
||||||
|
prompt: item.promptContent,
|
||||||
|
init: 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (item.navType === 'url') {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: item.url
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
viewOrderTrackHandle(order) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesOrder/order/OrderDetails/index?id=' + order.orderId
|
||||||
|
})
|
||||||
|
},
|
||||||
|
isGiftOptionSelected(configId, optionId) {
|
||||||
|
if (!this.giftSelections[configId]) return false
|
||||||
|
return this.giftSelections[configId].includes(optionId)
|
||||||
|
},
|
||||||
|
toggleGiftOption(configId, optionId) {
|
||||||
|
if (!this.giftSelections[configId]) {
|
||||||
|
this.$set(this.giftSelections, configId, [])
|
||||||
|
}
|
||||||
|
const index = this.giftSelections[configId].indexOf(optionId)
|
||||||
|
if (index > -1) {
|
||||||
|
this.giftSelections[configId].splice(index, 1)
|
||||||
|
} else {
|
||||||
|
this.giftSelections[configId].push(optionId)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
prevGiftStep() {
|
||||||
|
if (this.currentGiftStepIndex > 0) {
|
||||||
|
this.currentGiftStepIndex--
|
||||||
|
}
|
||||||
|
},
|
||||||
|
clearCurrentGiftStepData() {
|
||||||
|
const currentStep = this.giftBuyOptions[this.currentGiftStepIndex]
|
||||||
|
if (!currentStep) return
|
||||||
|
|
||||||
|
if (currentStep.type === 'option_card') {
|
||||||
|
const nextSelections = { ...this.giftSelections }
|
||||||
|
delete nextSelections[currentStep.id]
|
||||||
|
this.giftSelections = nextSelections
|
||||||
|
} else if (currentStep.type === 'price_input') {
|
||||||
|
this.giftBudget = ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
nextGiftStep() {
|
||||||
|
const currentStep = this.giftBuyOptions[this.currentGiftStepIndex]
|
||||||
|
let hasSelection = false
|
||||||
|
|
||||||
|
// 校验是否已选择
|
||||||
|
if (currentStep.type === 'option_card') {
|
||||||
|
const selectedIds = this.giftSelections[currentStep.id] || []
|
||||||
|
hasSelection = selectedIds.length > 0
|
||||||
|
} else if (currentStep.type === 'price_input') {
|
||||||
|
hasSelection = !!this.giftBudget
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasSelection) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请完善信息后再点击下一步',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.currentGiftStepIndex < this.giftBuyOptions.length - 1) {
|
||||||
|
this.currentGiftStepIndex++
|
||||||
|
} else {
|
||||||
|
this.finishGiftSteps()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
skipGiftStep() {
|
||||||
|
this.clearCurrentGiftStepData()
|
||||||
|
if (this.currentGiftStepIndex < this.giftBuyOptions.length - 1) {
|
||||||
|
this.currentGiftStepIndex++
|
||||||
|
} else {
|
||||||
|
this.finishGiftSteps()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
finishGiftSteps() {
|
||||||
|
if (this.giftStepLoading || this.loading) return
|
||||||
|
const selectedSteps = []
|
||||||
|
this.giftBuyOptions.forEach(step => {
|
||||||
|
if (step.type === 'option_card') {
|
||||||
|
const selectedIds = this.giftSelections[step.id] || []
|
||||||
|
if (selectedIds.length > 0) {
|
||||||
|
const selectedNames = step.options.filter(opt => selectedIds.includes(opt.id)).map(opt => opt.optionName)
|
||||||
|
selectedSteps.push({
|
||||||
|
sort: step.sort,
|
||||||
|
title: step.title,
|
||||||
|
type: step.type,
|
||||||
|
options: selectedNames
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else if (step.type === 'price_input') {
|
||||||
|
if (this.giftBudget) {
|
||||||
|
selectedSteps.push({
|
||||||
|
sort: step.sort,
|
||||||
|
title: step.title,
|
||||||
|
type: step.type,
|
||||||
|
options: [this.giftBudget]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(selectedSteps)
|
||||||
|
uni.showLoading()
|
||||||
|
this.giftStepLoading = true
|
||||||
|
getGiftRecommendPrompt(selectedSteps).then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
this.showGiftSteps = false
|
||||||
|
this.streamReq({
|
||||||
|
prompt: data.prompt || '我想送礼',
|
||||||
|
init: 0
|
||||||
|
})
|
||||||
|
// 清空所有送礼选项
|
||||||
|
this.giftSelections = {}
|
||||||
|
this.giftBudget = ''
|
||||||
|
this.currentGiftStepIndex = 0
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
this.giftStepLoading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+379
-18
@@ -33,6 +33,16 @@
|
|||||||
{{ item.prompt }}
|
{{ item.prompt }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="item-right-tools">
|
||||||
|
<view class="btn" @click="copyContentHandle(item.prompt)">
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/aiChat/icon-02.png'"
|
||||||
|
class="icon"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
复制
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="item.type === -2" class="chat-message-body">
|
<view v-if="item.type === -2" class="chat-message-body">
|
||||||
<view class="avatar">
|
<view class="avatar">
|
||||||
@@ -57,7 +67,7 @@
|
|||||||
space="nbsp"
|
space="nbsp"
|
||||||
/>
|
/>
|
||||||
<view v-if="!(item.nodes && item.nodes.length) && loading" class="loader-wrap">
|
<view v-if="!(item.nodes && item.nodes.length) && loading" class="loader-wrap">
|
||||||
<div class="loader" />
|
<div class="loading2" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
@@ -97,9 +107,233 @@
|
|||||||
/>
|
/>
|
||||||
重新生成
|
重新生成
|
||||||
</view>
|
</view>
|
||||||
|
<view
|
||||||
|
:class="{
|
||||||
|
'playing': [item.conversationId, item.messageId, item.parentMessageId].includes(audioPlayId) && isPlayAudio
|
||||||
|
}"
|
||||||
|
class="item"
|
||||||
|
@click="ttsHandle(item)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/aiChat/' + (([item.conversationId, item.messageId, item.parentMessageId].includes(audioPlayId) && isPlayAudio) ? 'audio-on' : 'audio-off') +'.png'"
|
||||||
|
class="icon"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
语音播放
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 换一换 -->
|
||||||
|
<view
|
||||||
|
v-if="!item.showCursor &&
|
||||||
|
!item.isError &&
|
||||||
|
(item.orderList.length > 0 ||
|
||||||
|
item.giftGoodsList.length > 0 ||
|
||||||
|
item.goodsList.length > 0 ||
|
||||||
|
item.shopList.length > 0 ||
|
||||||
|
item.prizeList.length > 0 ||
|
||||||
|
item.ichList.length > 0 ||
|
||||||
|
item.qianxianList.length > 0
|
||||||
|
)
|
||||||
|
"
|
||||||
|
class="change-list-wrap"
|
||||||
|
>
|
||||||
|
<!-- 礼品 -->
|
||||||
|
<view
|
||||||
|
v-if="item.giftGoodsList.length > 0"
|
||||||
|
class="recommend-goods-wrap"
|
||||||
|
>
|
||||||
|
<swiper
|
||||||
|
class="goods-swiper"
|
||||||
|
:indicator-dots="false"
|
||||||
|
:autoplay="false"
|
||||||
|
:current="item.currentSwiperIndex"
|
||||||
|
previous-margin="120rpx"
|
||||||
|
next-margin="120rpx"
|
||||||
|
circular
|
||||||
|
@change="e => onSwiperChange(index, e)"
|
||||||
|
>
|
||||||
|
<swiper-item
|
||||||
|
v-for="(goodItem, goodIndex) in item.giftGoodsList"
|
||||||
|
:key="goodIndex"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
:class="{ 'active': item.currentSwiperIndex === goodIndex }"
|
||||||
|
class="goods-item"
|
||||||
|
@click="productItemClickHandle(goodItem)"
|
||||||
|
>
|
||||||
|
<view class="supplier" @click.stop="productItemSupplierClickHandle(goodItem)">
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/aiChat/icon-57.png'"
|
||||||
|
class="icon"
|
||||||
|
mode="widthFix"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
<text class="s-name">{{ goodItem.merName ||goodItem.storeName }}</text>
|
||||||
|
<u-icon name="arrow-right" color="#999" size="12"></u-icon>
|
||||||
|
</view>
|
||||||
|
<view class="title one-t">{{ goodItem.name }}</view>
|
||||||
|
<image :src="goodItem.img" class="p-img" mode="aspectFill" lazy-load />
|
||||||
|
<view class="price">
|
||||||
|
<text class="unit">¥</text>
|
||||||
|
<text class="num">{{ goodItem.price }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="actions">
|
||||||
|
<view class="btn-buy" @click.stop="productItemBuyNowClickHandle(goodItem)">立即下单</view>
|
||||||
|
<view class="btn-gift" @click.stop="productItemGiftBuyClickHandle(goodItem)">送给朋友</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
</view>
|
||||||
|
<!-- 特产商品 -->
|
||||||
|
<view v-if="item.goodsList.length > 0" class="list-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(productItem, productIndex) in item.goodsList"
|
||||||
|
:key="productIndex"
|
||||||
|
class="product-item"
|
||||||
|
@click="productItemClickHandle(productItem)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="productItem.img"
|
||||||
|
class="img"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
<view class="product-info">
|
||||||
|
<view class="name one-t">
|
||||||
|
{{ productItem.name }}
|
||||||
|
</view>
|
||||||
|
<view class="price-wrap">
|
||||||
|
<view class="price">
|
||||||
|
<text class="txt">¥</text>{{ productItem.price }}
|
||||||
|
</view>
|
||||||
|
<view class="btn">立即查看</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 店铺 -->
|
||||||
|
<view v-if="item.shopList.length > 0" class="list-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(hotel, hotelIndex) in item.shopList"
|
||||||
|
:key="hotelIndex"
|
||||||
|
class="product-item"
|
||||||
|
@click="hotelItemClickHandle(hotel)"
|
||||||
|
>
|
||||||
|
<view class="hotel-type">
|
||||||
|
{{ hotel.hotelTypeName }}
|
||||||
|
</view>
|
||||||
|
<image
|
||||||
|
:src="hotel.img + ((hotel.img && hotel.img.indexOf('.mp4') > -1) ? '?vframe/jpg/offset/1' : '')"
|
||||||
|
class="img"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
<view class="product-info">
|
||||||
|
<view class="name one-t">
|
||||||
|
{{ hotel.name }}
|
||||||
|
</view>
|
||||||
|
<view class="desc-wrap one-t">
|
||||||
|
{{ hotel.description || '' }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 非遗 -->
|
||||||
|
<view v-if="item.ichList.length > 0" class="list-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(ich, ichIndex) in item.ichList"
|
||||||
|
:key="ichIndex"
|
||||||
|
class="product-item"
|
||||||
|
@click="ichItemClickHandle(ich)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="ich.img"
|
||||||
|
class="img"
|
||||||
|
/>
|
||||||
|
<view class="product-info">
|
||||||
|
<view class="name one-t">
|
||||||
|
{{ ich.name }}
|
||||||
|
</view>
|
||||||
|
<view class="desc-wrap one-t">
|
||||||
|
{{ ich.description || '' }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 千县 -->
|
||||||
|
<view v-if="item.qianxianList.length > 0" class="list-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(qianxian, qianxianIndex) in item.qianxianList"
|
||||||
|
:key="qianxianIndex"
|
||||||
|
class="product-item"
|
||||||
|
@click="qianxianItemClickHandle(qianxian)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="qianxian.img"
|
||||||
|
class="img"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
<view class="product-info">
|
||||||
|
<view class="name name2 one-t">
|
||||||
|
{{ qianxian.name }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 抽奖 -->
|
||||||
|
<view v-if="item.prizeList.length > 0" class="list-wrap prize-list-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(prize, prizeIndex) in item.prizeList"
|
||||||
|
:key="prizeIndex"
|
||||||
|
class="prize-item"
|
||||||
|
@click="prizeItemClickHandle(prize)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="prize.img"
|
||||||
|
class="img"
|
||||||
|
mode="widthFix"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 订单 -->
|
||||||
|
<view v-if="item.orderList.length > 0" class="order-list-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(order, orderIndex) in item.orderList"
|
||||||
|
:key="orderIndex"
|
||||||
|
class="order-item-wrap"
|
||||||
|
>
|
||||||
|
<order-item
|
||||||
|
:item="order"
|
||||||
|
@viewOrderTrack="viewOrderTrackHandle"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
v-if="(item.shopList.length > 0 ||
|
||||||
|
item.goodsList.length > 0 ||
|
||||||
|
item.giftGoodsList.length > 0 ||
|
||||||
|
item.ichList.length > 0 ||
|
||||||
|
item.qianxianList.length > 0 ||
|
||||||
|
item.shopList.length > 0) && item.showChangeBtn
|
||||||
|
"
|
||||||
|
class="change-btn"
|
||||||
|
>
|
||||||
|
<view class="change-btn-content" @click="analyzeKeywordsChangeHandle(item.conversationId, item)">
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/aiChat/icon-53.png'"
|
||||||
|
:class="{
|
||||||
|
'rotate': item.changeIsRotate
|
||||||
|
}"
|
||||||
|
class="icon"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
换一换
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 建议提问 -->
|
||||||
<view
|
<view
|
||||||
v-if="index === (chatMessageListLength - 1) && item.listQuestion.length > 0"
|
v-if="index === (chatMessageListLength - 1) && item.listQuestion.length > 0"
|
||||||
class="suggestion-wrap"
|
class="suggestion-wrap"
|
||||||
@@ -136,29 +370,57 @@
|
|||||||
}"
|
}"
|
||||||
class="page-to-bottom"
|
class="page-to-bottom"
|
||||||
>
|
>
|
||||||
|
<view class="down-icon-wrap">
|
||||||
|
<image
|
||||||
|
v-if="chatMessageListLength > 0 && !isScrollToBottom && !loading"
|
||||||
|
:src="webUrl + '/aiChat/down.png'"
|
||||||
|
class="icon down-icon"
|
||||||
|
mode="widthFix"
|
||||||
|
@click="scrollToBottomHandle"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
<view
|
<view
|
||||||
|
:class="{
|
||||||
|
'container-county': !!countyId
|
||||||
|
}"
|
||||||
|
class="container"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
v-if="chatNumber"
|
||||||
class="new-chat"
|
class="new-chat"
|
||||||
@click="createNewHandle"
|
@click="createNewHandle"
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/aiChat/icon-05.png'"
|
:src="webUrl + '/aiChat/icon-54.png'"
|
||||||
class="btn-icon"
|
class="btn-icon"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
开启新对话
|
开启新对话
|
||||||
</view>
|
</view>
|
||||||
|
<view
|
||||||
|
v-if="!countyId"
|
||||||
|
v-for="(item, index) in bottomTools"
|
||||||
|
:key="index"
|
||||||
|
:class="{
|
||||||
|
'hide': !item.display
|
||||||
|
}"
|
||||||
|
class="bottom-tool-item"
|
||||||
|
@click="bottomToolClickHandle(item)"
|
||||||
|
>
|
||||||
<image
|
<image
|
||||||
v-if="chatMessageListLength > 0 && !isScrollToBottom && !loading"
|
:src="item.icon"
|
||||||
:src="webUrl + '/aiChat/down.png'"
|
class="tool-icon"
|
||||||
class="icon"
|
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
@click="scrollToBottomHandle"
|
|
||||||
/>
|
/>
|
||||||
|
{{ item.name }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<bottom-send
|
<bottom-send
|
||||||
ref="bottomSend"
|
ref="bottomSend"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:keyboard-height="keyboardHeight"
|
:keyboard-height="keyboardHeight"
|
||||||
|
:voice-exception="exceptionConfig.voice_exception"
|
||||||
@send="streamReq"
|
@send="streamReq"
|
||||||
@history="historyViewHandle"
|
@history="historyViewHandle"
|
||||||
@focus="inputFocusHandle"
|
@focus="inputFocusHandle"
|
||||||
@@ -166,41 +428,70 @@
|
|||||||
<AiHistoryList
|
<AiHistoryList
|
||||||
ref="historyView"
|
ref="historyView"
|
||||||
:status-bar-height="statusBarHeight"
|
:status-bar-height="statusBarHeight"
|
||||||
|
:county-id="countyId"
|
||||||
form-module="history"
|
form-module="history"
|
||||||
|
@enter-history="audioStopHandle"
|
||||||
|
/>
|
||||||
|
<ProductWindow
|
||||||
|
ref="attrWindow"
|
||||||
|
:attr="attr"
|
||||||
|
:cart-num="cart_num"
|
||||||
|
:show-ok="!showGiftBtn"
|
||||||
|
:is-gift="showGiftBtn"
|
||||||
|
:padding-bottom="'60px'"
|
||||||
|
class-name="ai-product-window"
|
||||||
|
ok-text="立即购买"
|
||||||
|
@changeFun="changeFun"
|
||||||
|
@ok="buyNowOrGiftBuyReq(1)"
|
||||||
|
@gift="buyNowOrGiftBuyReq(2)"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { chatMixins } from '../mixins/chatMixins.js'
|
import { chatMixinsV2 } from '../mixins/chatMixinsV2.js'
|
||||||
|
import goCartMixin from '@/mixins/goCartMixins'
|
||||||
import AiHistoryList from '../components/historyList'
|
import AiHistoryList from '../components/historyList'
|
||||||
import BottomSend from '../components/bottomSend.vue'
|
import BottomSend from '../components/bottomSend.vue'
|
||||||
|
import OrderItem from '../components/orderItem.vue'
|
||||||
|
import ProductWindow from '@/components/ProductWindow'
|
||||||
import {
|
import {
|
||||||
historyChatMessage
|
historyChatMessage,
|
||||||
|
getCountyAiHistoryChatMessage
|
||||||
} from '@/api/chat/index'
|
} from '@/api/chat/index'
|
||||||
import { formatAiMsgContent } from '../utils/aiChat'
|
import { formatAiMsgContent } from '../utils/aiChat'
|
||||||
export default {
|
export default {
|
||||||
name: 'AiChatHistoryPage',
|
name: 'AiChatHistoryPage',
|
||||||
components: {
|
components: {
|
||||||
AiHistoryList,
|
AiHistoryList,
|
||||||
BottomSend
|
BottomSend,
|
||||||
|
OrderItem,
|
||||||
|
ProductWindow
|
||||||
},
|
},
|
||||||
mixins: [chatMixins],
|
mixins: [chatMixinsV2, goCartMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageTitle: ''
|
pageTitle: '',
|
||||||
|
countyId: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.chatNumber = options.chatNumber
|
this.chatNumber = options.chatNumber
|
||||||
this.pageTitle = options.title
|
this.pageTitle = options.title || ''
|
||||||
|
this.countyId = options.countyId || ''
|
||||||
this.pageTitle = this.pageTitle.length > 8 ? (this.pageTitle.substring(0, 8) + '...') : this.pageTitle
|
this.pageTitle = this.pageTitle.length > 8 ? (this.pageTitle.substring(0, 8) + '...') : this.pageTitle
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
historyChatMessage({
|
let reqFn = null
|
||||||
|
if (this.countyId) {
|
||||||
|
reqFn = getCountyAiHistoryChatMessage
|
||||||
|
} else {
|
||||||
|
reqFn = historyChatMessage
|
||||||
|
}
|
||||||
|
reqFn({
|
||||||
chatNumber: this.chatNumber
|
chatNumber: this.chatNumber
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const { success, data = [] } = res
|
const { success, data = [] } = res
|
||||||
@@ -214,18 +505,70 @@ export default {
|
|||||||
prompt: item.content
|
prompt: item.content
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if (item.contentType === 'text') {
|
if (['text', 'skill_list'].includes(item.contentType)) {
|
||||||
this.chatMessageList.push({
|
const tempItemData = {
|
||||||
...item,
|
...item,
|
||||||
nodes: formatAiMsgContent(item.content),
|
nodes: formatAiMsgContent(item.content),
|
||||||
prompt: this.getParentPrompt(data, item.parentMessageId),
|
prompt: this.getParentPrompt(data, item.parentMessageId),
|
||||||
conversationId: item.messageId,
|
conversationId: item.messageId,
|
||||||
showCursor: false,
|
showCursor: false,
|
||||||
listQuestion: item.listQuestion || [],
|
listQuestion: item.listQuestion || [],
|
||||||
type: -2
|
// 特产商品
|
||||||
|
goodsList: [],
|
||||||
|
// 礼品商品
|
||||||
|
giftGoodsList: [],
|
||||||
|
// 非遗文化
|
||||||
|
ichList: [],
|
||||||
|
// 千县名品
|
||||||
|
qianxianList: [],
|
||||||
|
// 抽奖
|
||||||
|
prizeList: [],
|
||||||
|
// 店铺
|
||||||
|
shopList: [],
|
||||||
|
// 地标好物--屏蔽原因:实现此功能时,后端通过AI动态返回的图片不满足需求,后面就不要了
|
||||||
|
landmarksList: [],
|
||||||
|
// 订单
|
||||||
|
orderList: [],
|
||||||
|
type: -2,
|
||||||
|
showMoreInfo: {},
|
||||||
|
currentSwiperIndex: 0,
|
||||||
|
showChangeBtn: false,
|
||||||
|
changeIsRotate: false
|
||||||
|
}
|
||||||
|
if (item.cardData) {
|
||||||
|
const { contentType, finish, items = [] } = item.cardData
|
||||||
|
if (contentType === 'order') {
|
||||||
|
tempItemData.orderList = items || []
|
||||||
|
}
|
||||||
|
if (contentType === 'shop') {
|
||||||
|
tempItemData.shopList = items || []
|
||||||
|
}
|
||||||
|
if (contentType === 'gift') {
|
||||||
|
tempItemData.giftGoodsList = items || []
|
||||||
|
}
|
||||||
|
if (contentType === 'discount') {
|
||||||
|
tempItemData.prizeList = items || []
|
||||||
|
}
|
||||||
|
if (contentType === 'goods') {
|
||||||
|
tempItemData.goodsList = items || []
|
||||||
|
}
|
||||||
|
if (contentType === 'famous') {
|
||||||
|
tempItemData.qianxianList = items || []
|
||||||
|
}
|
||||||
|
if (contentType === 'ich') {
|
||||||
|
tempItemData.ichList = items || []
|
||||||
|
}
|
||||||
|
if (contentType === 'landmarks') {
|
||||||
|
tempItemData.landmarksList = items || []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.chatMessageList.push(tempItemData)
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
console.log(this.chatMessageList)
|
||||||
}
|
this.$nextTick(() => {
|
||||||
|
this.scrollToBottomHandle()
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
@@ -252,6 +595,24 @@ export default {
|
|||||||
createNewHandle() {
|
createNewHandle() {
|
||||||
uni.setStorageSync('addNewChat', '1')
|
uni.setStorageSync('addNewChat', '1')
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
|
},
|
||||||
|
bottomToolClickHandle(item) {
|
||||||
|
if (item.giftCardEnabled === 1) {
|
||||||
|
uni.setStorageSync('addNewChat', '2')
|
||||||
|
uni.navigateBack()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (item.navType === 'prompt') {
|
||||||
|
this.streamReq({
|
||||||
|
prompt: item.promptContent,
|
||||||
|
init: 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (item.navType === 'url') {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: item.url
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,227 @@
|
|||||||
|
<template>
|
||||||
|
<view
|
||||||
|
:style="{ 'background-image': 'url(' + webUrl + '/aiChat/bg-05.png)' }"
|
||||||
|
class="image-recognition-page"
|
||||||
|
>
|
||||||
|
<hx-navbar
|
||||||
|
:back="true"
|
||||||
|
:fixed="true"
|
||||||
|
:statusBar="true"
|
||||||
|
left-icon="arrowleft"
|
||||||
|
color="#333"
|
||||||
|
transparent="auto"
|
||||||
|
barPlaceholder="hidden"
|
||||||
|
title="云灵"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<view
|
||||||
|
class="main-content"
|
||||||
|
:style="{ 'padding-top': (44 + statusBarHeight) + 'px' }"
|
||||||
|
>
|
||||||
|
<!-- 拍照区域 -->
|
||||||
|
<view class="camera-section" @click="takePhoto">
|
||||||
|
<view class="dashed-border-box">
|
||||||
|
<view class="icon-wrap">
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/aiChat/icon-55.png'"
|
||||||
|
class="camera-icon"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="main-title">对准商品拍照</view>
|
||||||
|
<view class="sub-tip">示例:特产/零食/茶叶/纪念品</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 底部相册上传按钮 -->
|
||||||
|
<view class="bottom-action">
|
||||||
|
<button class="album-btn" @click="chooseImage">
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/aiChat/icon-56.png'"
|
||||||
|
class="upload-icon"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
<text>从相册上传图片进行识别</text>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { chatMixins } from '../mixins/chatMixins.js'
|
||||||
|
import { VUE_APP_API_URL } from '@/config'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AiChatImageRecognitionPage',
|
||||||
|
mixins: [chatMixins],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
createdCallbak() {
|
||||||
|
// 覆盖 mixins 中的 createdCallbak,避免触发默认逻辑
|
||||||
|
},
|
||||||
|
takePhoto() {
|
||||||
|
if (this.loading) return
|
||||||
|
uni.chooseImage({
|
||||||
|
count: 1,
|
||||||
|
sizeType: ['compressed'],
|
||||||
|
sourceType: ['camera'],
|
||||||
|
success: (res) => {
|
||||||
|
this.handleUpload(res.tempFilePaths[0])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
chooseImage() {
|
||||||
|
if (this.loading) return
|
||||||
|
uni.chooseImage({
|
||||||
|
count: 1,
|
||||||
|
sizeType: ['compressed'],
|
||||||
|
sourceType: ['album'],
|
||||||
|
success: (res) => {
|
||||||
|
this.handleUpload(res.tempFilePaths[0])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleUpload(filePath) {
|
||||||
|
const _this = this
|
||||||
|
uni.showLoading({ title: '识别中...' })
|
||||||
|
_this.loading = true
|
||||||
|
|
||||||
|
uni.uploadFile({
|
||||||
|
url: `${VUE_APP_API_URL}/api/upload`,
|
||||||
|
filePath: filePath,
|
||||||
|
header: {
|
||||||
|
Authorization: 'Bearer ' + (_this.token || '')
|
||||||
|
},
|
||||||
|
name: 'file',
|
||||||
|
success: (uploadRes) => {
|
||||||
|
const resData = JSON.parse(uploadRes.data)
|
||||||
|
if (resData.link) {
|
||||||
|
_this.performRecognition(resData.link)
|
||||||
|
} else {
|
||||||
|
uni.hideLoading()
|
||||||
|
_this.loading = false
|
||||||
|
_this.$toast('上传失败,请重试')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.log('Upload Error:', err)
|
||||||
|
uni.hideLoading()
|
||||||
|
_this.loading = false
|
||||||
|
_this.$toast('网络异常,请重试')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
performRecognition(imageUrl) {
|
||||||
|
// 存储识别到的图片URL
|
||||||
|
uni.setStorageSync('recognitionImage', imageUrl)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/aiChat/views/imageRecognitionResult'
|
||||||
|
})
|
||||||
|
uni.hideLoading()
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.image-recognition-page {
|
||||||
|
height: 100vh;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
|
||||||
|
.main-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
padding: 60rpx 40rpx;
|
||||||
|
height: 100vh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.camera-section {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 60rpx;
|
||||||
|
|
||||||
|
.dashed-border-box {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 600rpx;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 80rpx;
|
||||||
|
border: 2rpx dashed #DCDFE6;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
background-color: rgba(255, 255, 255, 0.5);
|
||||||
|
|
||||||
|
.icon-wrap {
|
||||||
|
width: 160rpx;
|
||||||
|
height: 160rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 6rpx solid #7A3DF1;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
|
||||||
|
.camera-icon {
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-title {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub-tip {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-action {
|
||||||
|
width: 100%;
|
||||||
|
padding-bottom: 60rpx;
|
||||||
|
|
||||||
|
.album-btn {
|
||||||
|
width: 100%;
|
||||||
|
height: 100rpx;
|
||||||
|
background: #3D4CF1;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 32rpx;
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0 8rpx 20rpx rgba(61, 76, 241, 0.3);
|
||||||
|
|
||||||
|
.upload-icon {
|
||||||
|
width: 36rpx;
|
||||||
|
height: 36rpx;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,358 @@
|
|||||||
|
<template>
|
||||||
|
<view class="image-recognition-result-page">
|
||||||
|
<view
|
||||||
|
class="page-body"
|
||||||
|
>
|
||||||
|
<view class="header">
|
||||||
|
<view
|
||||||
|
class="header-bg"
|
||||||
|
:style="{ 'background-image': imageUrl ? `url(${imageUrl})` : '' }"
|
||||||
|
/>
|
||||||
|
<view class="header-mask" />
|
||||||
|
<view class="scan-wrap">
|
||||||
|
<image
|
||||||
|
v-if="imageUrl"
|
||||||
|
:src="imageUrl"
|
||||||
|
class="scan-image"
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
<view class="corner tl" />
|
||||||
|
<view class="corner tr" />
|
||||||
|
<view class="corner bl" />
|
||||||
|
<view class="corner br" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="sheet">
|
||||||
|
<view class="sheet-thumb-row">
|
||||||
|
<image
|
||||||
|
v-if="imageUrl && confidenceFlag"
|
||||||
|
:src="imageUrl"
|
||||||
|
class="sheet-thumb"
|
||||||
|
mode="aspectFill"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
<view v-else class="empty-state">
|
||||||
|
<view class="empty-text">未识别到物品,请重新尝试</view>
|
||||||
|
<view class="empty-title">为你推荐</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="sheet-divider" />
|
||||||
|
<view v-if="!loaded" class="loading-state">
|
||||||
|
<u-loading-icon mode="circle" size="36" text="正在识别中..." vertical textSize="14"></u-loading-icon>
|
||||||
|
</view>
|
||||||
|
<view v-else class="goods-grid">
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in goodsList"
|
||||||
|
:key="index"
|
||||||
|
class="goods-card"
|
||||||
|
@click="goGoods(item)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="item.img"
|
||||||
|
class="goods-img"
|
||||||
|
mode="aspectFill"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
<view class="goods-title">
|
||||||
|
{{ item.name }}
|
||||||
|
</view>
|
||||||
|
<view class="goods-price-row">
|
||||||
|
<view class="price-left">
|
||||||
|
<text class="price-symbol">¥</text>
|
||||||
|
<text class="price-val">{{ item.price }}</text>
|
||||||
|
</view>
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/home/icon-cart.png'"
|
||||||
|
class="cart-btn"
|
||||||
|
mode="aspectFit"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.similarityScore > 0" class="goods-desc">
|
||||||
|
相似度{{ item.similarityScore }}%
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getAnalyzeByImageV3 } from '@/api/chat'
|
||||||
|
import Recommend from '@/components/Recommend'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AiChatImageRecognitionResultPage',
|
||||||
|
components: {
|
||||||
|
Recommend
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loaded: false,
|
||||||
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
|
statusBarHeight: 20,
|
||||||
|
imageUrl: '',
|
||||||
|
goodsList: [],
|
||||||
|
confidenceFlag: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
const urlFromQuery = options.imageUrl || ''
|
||||||
|
const urlFromStorage = uni.getStorageSync('recognitionImage') || ''
|
||||||
|
this.imageUrl = urlFromQuery || urlFromStorage || ''
|
||||||
|
if (urlFromStorage) {
|
||||||
|
// uni.removeStorageSync('recognitionImage')
|
||||||
|
}
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
this.loaded = false
|
||||||
|
getAnalyzeByImageV3({
|
||||||
|
imageUrl: this.imageUrl
|
||||||
|
}).then(res => {
|
||||||
|
const { data, success } = res
|
||||||
|
if (success) {
|
||||||
|
this.goodsList = data.cards || []
|
||||||
|
this.confidenceFlag = data.success
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.loaded = true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goGoods(item) {
|
||||||
|
if (!item || !item.id) return
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/shop/GoodsCon/index?id=${item.id}`
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addToCart() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.image-recognition-result-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
.page-body {
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
position: relative;
|
||||||
|
height: 480rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-bg {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: #DDE6FF;
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
filter: blur(18rpx);
|
||||||
|
transform: scale(1.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-mask {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.18);
|
||||||
|
}
|
||||||
|
|
||||||
|
.scan-wrap {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 45%;
|
||||||
|
width: 320rpx;
|
||||||
|
height: 320rpx;
|
||||||
|
transform: translate(-50%, -52%);
|
||||||
|
border-radius: 24rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
// box-shadow: 0 18rpx 48rpx rgba(0, 0, 0, 0.18);
|
||||||
|
}
|
||||||
|
|
||||||
|
.scan-image {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
transform: scale(0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.corner {
|
||||||
|
position: absolute;
|
||||||
|
width: 44rpx;
|
||||||
|
height: 44rpx;
|
||||||
|
border: 6rpx solid rgba(255, 255, 255, 0.95);
|
||||||
|
}
|
||||||
|
|
||||||
|
.corner.tl {
|
||||||
|
left: 16rpx;
|
||||||
|
top: 16rpx;
|
||||||
|
border-right: 0;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
.corner.tr {
|
||||||
|
right: 16rpx;
|
||||||
|
top: 16rpx;
|
||||||
|
border-left: 0;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
.corner.bl {
|
||||||
|
left: 16rpx;
|
||||||
|
bottom: 16rpx;
|
||||||
|
border-right: 0;
|
||||||
|
border-top: 0;
|
||||||
|
}
|
||||||
|
.corner.br {
|
||||||
|
right: 16rpx;
|
||||||
|
bottom: 16rpx;
|
||||||
|
border-left: 0;
|
||||||
|
border-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sheet {
|
||||||
|
position: relative;
|
||||||
|
margin-top: -70rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-top-left-radius: 42rpx;
|
||||||
|
border-top-right-radius: 42rpx;
|
||||||
|
padding-bottom: calc(env(safe-area-inset-bottom) + 28rpx);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sheet-thumb-row {
|
||||||
|
padding: 28rpx 0 18rpx 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sheet-thumb {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
display: block;
|
||||||
|
box-shadow: 0 10rpx 24rpx rgba(0, 0, 0, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sheet-divider {
|
||||||
|
height: 2rpx;
|
||||||
|
background: #EDEDED;
|
||||||
|
margin: 0 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-state {
|
||||||
|
padding: 120rpx 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-state {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-text {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
.empty-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-grid {
|
||||||
|
padding: 28rpx 24rpx 0 24rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-card {
|
||||||
|
width: 344rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 22rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-bottom: 22rpx;
|
||||||
|
box-shadow: 0 10rpx 24rpx rgba(0, 0, 0, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-img {
|
||||||
|
width: 344rpx;
|
||||||
|
height: 344rpx;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-title {
|
||||||
|
padding: 14rpx 14rpx 0 14rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
line-height: 38rpx;
|
||||||
|
color: #333;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
min-height: 76rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-price-row {
|
||||||
|
padding: 10rpx 14rpx 16rpx 14rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.goods-desc {
|
||||||
|
padding: 10rpx 14rpx 20rpx 14rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price-symbol {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #C52733;
|
||||||
|
line-height: 1;
|
||||||
|
margin-right: 2rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price-val {
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #C52733;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.origin-price {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
line-height: 1;
|
||||||
|
margin-left: 12rpx;
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-btn {
|
||||||
|
width: 52rpx;
|
||||||
|
height: 52rpx;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+650
-94
@@ -1,6 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view
|
<view
|
||||||
:class="scrollTop > 0 ? 'page-scroll' : ''"
|
:class="{
|
||||||
|
'page-scroll': scrollTop > 0,
|
||||||
|
'new-chat': chatMessageListLength === 0
|
||||||
|
}"
|
||||||
class="fix-tabbar-page"
|
class="fix-tabbar-page"
|
||||||
>
|
>
|
||||||
<hx-navbar
|
<hx-navbar
|
||||||
@@ -12,8 +15,8 @@
|
|||||||
color="#333"
|
color="#333"
|
||||||
transparent="auto"
|
transparent="auto"
|
||||||
barPlaceholder="hidden"
|
barPlaceholder="hidden"
|
||||||
title="云灵AI智能助手"
|
title="云灵"
|
||||||
@click-left="clickBackHandle"
|
@click-left="pageContainerBeforeleave"
|
||||||
/>
|
/>
|
||||||
<page-container
|
<page-container
|
||||||
:show="true"
|
:show="true"
|
||||||
@@ -21,8 +24,9 @@
|
|||||||
:z-index="1"
|
:z-index="1"
|
||||||
@beforeleave="pageContainerBeforeleave"
|
@beforeleave="pageContainerBeforeleave"
|
||||||
>
|
>
|
||||||
<view style="opacity: 0;"></view>
|
<view style="opacity: 0;">
|
||||||
遮罩层,用于监听实体键返回
|
遮罩层,用于监听实体键返回
|
||||||
|
</view>
|
||||||
</page-container>
|
</page-container>
|
||||||
<view
|
<view
|
||||||
id="fixTbabarBody"
|
id="fixTbabarBody"
|
||||||
@@ -31,45 +35,96 @@
|
|||||||
}"
|
}"
|
||||||
class="fix-tabbar-body"
|
class="fix-tabbar-body"
|
||||||
>
|
>
|
||||||
|
<!-- <button @click="ttsHandle({
|
||||||
|
content: '是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项。临床试验统计分析结果生成系统是服务于医学研究的数据处理平台。系统聚焦临床试验数据,可对患者入组信息、疗效指标、安全性数据等进行标准化统计分析,自动生成包含描述性统计、假设检验、生存分析等内容的结果报告。支持可视化图表输出,如疗效对比柱状图、不良事件分布饼图等,直观呈现数据特征。具备灵活的参数配置功能,可适配不同试验设计与分析需求,助力研究者高效完成数据解读,为药物研发、临床研究结论输出提供精准的统计支持。',
|
||||||
|
conversationId: '123'
|
||||||
|
})">播放</button> -->
|
||||||
<block v-if="chatMessageListLength < 1">
|
<block v-if="chatMessageListLength < 1">
|
||||||
|
<view
|
||||||
|
:class="{
|
||||||
|
'county-home-wrap': !!countyId
|
||||||
|
}"
|
||||||
|
class="home-wrap"
|
||||||
|
>
|
||||||
<view class="home-focus-wrap">
|
<view class="home-focus-wrap">
|
||||||
<view class="focus-guide-wrap">
|
<view class="focus-guide-wrap">
|
||||||
<view class="guide-left">
|
<view class="guide-left">
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/aiChat/logo-01.gif'"
|
:src="webUrl + '/aiChat/logo-transition.png'"
|
||||||
class="avatar"
|
:class="{
|
||||||
|
'county-avatar': !!countyId
|
||||||
|
}"
|
||||||
|
class="avatar avatar-bounce"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="guide-right">
|
<view v-if="!showGiftSteps" class="guide-right">
|
||||||
<view class="trangle" />
|
|
||||||
<view class="title">{{ settingInfo.helloMessageTitle }}</view>
|
<view class="title">{{ settingInfo.helloMessageTitle }}</view>
|
||||||
<view class="content">{{ settingInfo.helloMessageContent }}</view>
|
<view class="content">{{ settingInfo.helloMessageContent }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="topic-wrap">
|
<!-- 这里实现商品轮播 -->
|
||||||
|
<!-- <view class="recommend-goods-wrap" v-if="recommendGoodsList.length > 0">
|
||||||
|
<swiper
|
||||||
|
class="goods-swiper"
|
||||||
|
:indicator-dots="false"
|
||||||
|
:autoplay="false"
|
||||||
|
previous-margin="120rpx"
|
||||||
|
next-margin="120rpx"
|
||||||
|
circular
|
||||||
|
@change="onSwiperChange"
|
||||||
|
>
|
||||||
|
<swiper-item
|
||||||
|
v-for="(item, index) in recommendGoodsList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="goods-item"
|
||||||
|
:class="{ 'active': currentSwiperIndex === index }"
|
||||||
|
@click="productItemClickHandle(item)"
|
||||||
|
>
|
||||||
|
<view class="supplier">
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/aiChat/icon-57.png'"
|
||||||
|
class="icon"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
<text class="s-name">{{ item.supplierName || '供应商名称' }}</text>
|
||||||
|
<u-icon name="arrow-right" color="#999" size="12"></u-icon>
|
||||||
|
</view>
|
||||||
|
<view class="title one-t">{{ item.productName || item.name || '商品名称' }}</view>
|
||||||
|
<image :src="item.image || item.img" class="p-img" mode="aspectFill" />
|
||||||
|
<view class="price">
|
||||||
|
<text class="unit">¥</text>
|
||||||
|
<text class="num">{{ item.price || '0.00' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="actions">
|
||||||
|
<view class="btn-buy" @click.stop="productItemBuyNowClickHandle(item)">立即下单</view>
|
||||||
|
<view class="btn-gift" @click.stop="productItemGiftBuyClickHandle(item)">送给朋友</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
</view> -->
|
||||||
|
<!-- 大家都在问 -->
|
||||||
|
<view v-if="!showGiftSteps && !countyId" class="topic-wrap">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
|
<view class="title-left">大家都在问</view>
|
||||||
|
<view class="title-right" @click="loadData('click')">
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/aiChat/icon-01.png'"
|
:src="webUrl + '/aiChat/icon-53.png'"
|
||||||
class="icon"
|
:class="{
|
||||||
mode="widthFix"
|
'rotate': topicIsRotate
|
||||||
/>
|
}"
|
||||||
<view class="txt">#大家都在问</view>
|
|
||||||
<image
|
|
||||||
:src="webUrl + '/aiChat/icon-01.png'"
|
|
||||||
class="icon"
|
class="icon"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
|
换一换
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list-wrap">
|
<view class="list-wrap">
|
||||||
<view
|
<view class="list-cont">
|
||||||
:style="{
|
|
||||||
'width': animationWidth,
|
|
||||||
'animation': animationStr
|
|
||||||
}"
|
|
||||||
class="list-cont"
|
|
||||||
>
|
|
||||||
<view
|
<view
|
||||||
v-for="(item, index) in topicList"
|
v-for="(item, index) in topicList"
|
||||||
:key="index"
|
:key="index"
|
||||||
@@ -87,9 +142,70 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 县域 -->
|
||||||
|
<view v-if="!showGiftSteps && countyId" class="county-tools-wrap">
|
||||||
|
<view class="list-cont">
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in countyTools"
|
||||||
|
:key="index"
|
||||||
|
class="list-item"
|
||||||
|
@click="countyToolItemClickHandle(item)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="item.icon"
|
||||||
|
class="icon"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
<view class="name">{{ item.name }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 在这里实现送礼步骤 -->
|
||||||
|
<view v-if="showGiftSteps" class="gift-steps-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in giftBuyOptions"
|
||||||
|
:key="index"
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
<view v-show="currentGiftStepIndex === index" class="gift-step-item">
|
||||||
|
<view class="gift-step-title">{{ item.title }}</view>
|
||||||
|
<view v-if="item.type === 'option_card'" class="gift-options">
|
||||||
|
<view
|
||||||
|
v-for="opt in item.options"
|
||||||
|
:key="opt.id"
|
||||||
|
class="gift-option-item"
|
||||||
|
:class="{ active: isGiftOptionSelected(item.id, opt.id) }"
|
||||||
|
@click="toggleGiftOption(item.id, opt.id)"
|
||||||
|
>
|
||||||
|
{{ opt.optionName }}
|
||||||
|
<image v-if="isGiftOptionSelected(item.id, opt.id)" :src="webUrl + '/aiChat/gift-options-check.png'" class="icon-check" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.type === 'price_input'" class="gift-price-input">
|
||||||
|
<view class="input-wrap">
|
||||||
|
<text class="label">价格预算:</text>
|
||||||
|
<input
|
||||||
|
v-model="giftBudget"
|
||||||
|
:placeholder="item.guideContent || '例如100以内/300~500元'"
|
||||||
|
class="input-budget"
|
||||||
|
placeholder-style="color: #ccc;"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="gift-step-actions">
|
||||||
|
<view class="action-btn-group">
|
||||||
|
<view v-if="currentGiftStepIndex > 0" class="btn btn-prev" @click="prevGiftStep">上一步</view>
|
||||||
|
<view class="btn btn-next" :class="{'full-width': currentGiftStepIndex === 0}" @click="nextGiftStep">下一步</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn-skip" @click="skipGiftStep">跳过</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<view class="chat-wrap">
|
<view v-if="chatMessageListLength > 0" class="chat-wrap">
|
||||||
<view v-if="chatMessageListLength > 0" class="chat-list-wrap">
|
<view class="chat-list-wrap">
|
||||||
<view
|
<view
|
||||||
v-for="(item, index) in chatMessageList"
|
v-for="(item, index) in chatMessageList"
|
||||||
:key="index"
|
:key="index"
|
||||||
@@ -101,6 +217,16 @@
|
|||||||
{{ item.prompt }}
|
{{ item.prompt }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="item-right-tools">
|
||||||
|
<view class="btn" @click="copyContentHandle(item.prompt)">
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/aiChat/icon-02.png'"
|
||||||
|
class="icon"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
复制
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="item.type === -2" class="chat-message-body">
|
<view v-if="item.type === -2" class="chat-message-body">
|
||||||
<view class="avatar">
|
<view class="avatar">
|
||||||
@@ -165,9 +291,235 @@
|
|||||||
/>
|
/>
|
||||||
重新生成
|
重新生成
|
||||||
</view>
|
</view>
|
||||||
|
<view
|
||||||
|
:class="{
|
||||||
|
'playing': [item.conversationId, item.messageId, item.parentMessageId].includes(audioPlayId) && isPlayAudio
|
||||||
|
}"
|
||||||
|
class="item"
|
||||||
|
@click="ttsHandle(item)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/aiChat/' + (([item.conversationId, item.messageId, item.parentMessageId].includes(audioPlayId) && isPlayAudio) ? 'audio-on' : 'audio-off') +'.png'"
|
||||||
|
class="icon"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
语音播放
|
||||||
|
</view>
|
||||||
|
<view class="item item2" @click="copyMoreInfoHandle(item)">拷贝</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 换一换 -->
|
||||||
|
<view
|
||||||
|
v-if="!item.showCursor &&
|
||||||
|
!item.isError &&
|
||||||
|
(item.orderList.length > 0 ||
|
||||||
|
item.giftGoodsList.length > 0 ||
|
||||||
|
item.goodsList.length > 0 ||
|
||||||
|
item.shopList.length > 0 ||
|
||||||
|
item.prizeList.length > 0 ||
|
||||||
|
item.ichList.length > 0 ||
|
||||||
|
item.qianxianList.length > 0
|
||||||
|
)
|
||||||
|
"
|
||||||
|
class="change-list-wrap"
|
||||||
|
>
|
||||||
|
<!-- 礼品 -->
|
||||||
|
<view
|
||||||
|
v-if="item.giftGoodsList.length > 0"
|
||||||
|
class="recommend-goods-wrap"
|
||||||
|
>
|
||||||
|
<swiper
|
||||||
|
class="goods-swiper"
|
||||||
|
:indicator-dots="false"
|
||||||
|
:autoplay="false"
|
||||||
|
:current="item.currentSwiperIndex"
|
||||||
|
previous-margin="120rpx"
|
||||||
|
next-margin="120rpx"
|
||||||
|
circular
|
||||||
|
@change="e => onSwiperChange(index, e)"
|
||||||
|
>
|
||||||
|
<swiper-item
|
||||||
|
v-for="(goodItem, goodIndex) in item.giftGoodsList"
|
||||||
|
:key="goodIndex"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
:class="{ 'active': item.currentSwiperIndex === goodIndex }"
|
||||||
|
class="goods-item"
|
||||||
|
@click="productItemClickHandle(goodItem)"
|
||||||
|
>
|
||||||
|
<view class="supplier" @click.stop="productItemSupplierClickHandle(goodItem)">
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/aiChat/icon-57.png'"
|
||||||
|
class="icon"
|
||||||
|
mode="widthFix"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
<text class="s-name">{{ goodItem.merName ||goodItem.storeName }}</text>
|
||||||
|
<u-icon name="arrow-right" color="#999" size="12"></u-icon>
|
||||||
|
</view>
|
||||||
|
<view class="title one-t">{{ goodItem.name }}</view>
|
||||||
|
<image :src="goodItem.img" class="p-img" mode="aspectFill" lazy-load />
|
||||||
|
<view class="price">
|
||||||
|
<text class="unit">¥</text>
|
||||||
|
<text class="num">{{ goodItem.price }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="actions">
|
||||||
|
<view class="btn-buy" @click.stop="productItemBuyNowClickHandle(goodItem)">立即下单</view>
|
||||||
|
<view class="btn-gift" @click.stop="productItemGiftBuyClickHandle(goodItem)">送给朋友</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
</view>
|
||||||
|
<!-- 特产商品 -->
|
||||||
|
<view v-if="item.goodsList.length > 0" class="list-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(productItem, productIndex) in item.goodsList"
|
||||||
|
:key="productIndex"
|
||||||
|
class="product-item"
|
||||||
|
@click="productItemClickHandle(productItem)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="productItem.img"
|
||||||
|
class="img"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
<view class="product-info">
|
||||||
|
<view class="name one-t">
|
||||||
|
{{ productItem.name }}
|
||||||
|
</view>
|
||||||
|
<view class="price-wrap">
|
||||||
|
<view class="price">
|
||||||
|
<text class="txt">¥</text>{{ productItem.price }}
|
||||||
|
</view>
|
||||||
|
<view class="btn">立即查看</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 店铺 -->
|
||||||
|
<view v-if="item.shopList.length > 0" class="list-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(hotel, hotelIndex) in item.shopList"
|
||||||
|
:key="hotelIndex"
|
||||||
|
class="product-item"
|
||||||
|
@click="hotelItemClickHandle(hotel)"
|
||||||
|
>
|
||||||
|
<view class="hotel-type">
|
||||||
|
{{ hotel.hotelTypeName }}
|
||||||
|
</view>
|
||||||
|
<image
|
||||||
|
:src="hotel.img + ((hotel.img && hotel.img.indexOf('.mp4') > -1) ? '?vframe/jpg/offset/1' : '')"
|
||||||
|
class="img"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
<view class="product-info">
|
||||||
|
<view class="name one-t">
|
||||||
|
{{ hotel.name }}
|
||||||
|
</view>
|
||||||
|
<view class="desc-wrap one-t">
|
||||||
|
{{ hotel.description || '' }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 非遗 -->
|
||||||
|
<view v-if="item.ichList.length > 0" class="list-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(ich, ichIndex) in item.ichList"
|
||||||
|
:key="ichIndex"
|
||||||
|
class="product-item"
|
||||||
|
@click="ichItemClickHandle(ich)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="ich.img"
|
||||||
|
class="img"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
<view class="product-info">
|
||||||
|
<view class="name one-t">
|
||||||
|
{{ ich.name }}
|
||||||
|
</view>
|
||||||
|
<view class="desc-wrap one-t">
|
||||||
|
{{ ich.description || '' }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 千县 -->
|
||||||
|
<view v-if="item.qianxianList.length > 0" class="list-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(qianxian, qianxianIndex) in item.qianxianList"
|
||||||
|
:key="qianxianIndex"
|
||||||
|
class="product-item"
|
||||||
|
@click="qianxianItemClickHandle(qianxian)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="qianxian.img"
|
||||||
|
class="img"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
<view class="product-info">
|
||||||
|
<view class="name name2 one-t">
|
||||||
|
{{ qianxian.name }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 抽奖 -->
|
||||||
|
<view v-if="item.prizeList.length > 0" class="list-wrap prize-list-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(prize, prizeIndex) in item.prizeList"
|
||||||
|
:key="prizeIndex"
|
||||||
|
class="prize-item"
|
||||||
|
@click="prizeItemClickHandle(prize)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="prize.img"
|
||||||
|
class="img"
|
||||||
|
mode="widthFix"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 订单 -->
|
||||||
|
<view v-if="item.orderList.length > 0" class="order-list-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(order, orderIndex) in item.orderList"
|
||||||
|
:key="orderIndex"
|
||||||
|
class="order-item-wrap"
|
||||||
|
>
|
||||||
|
<order-item
|
||||||
|
:item="order"
|
||||||
|
@viewOrderTrack="viewOrderTrackHandle"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
v-if="item.shopList.length > 0 ||
|
||||||
|
item.goodsList.length > 0 ||
|
||||||
|
item.giftGoodsList.length > 0 ||
|
||||||
|
item.ichList.length > 0 ||
|
||||||
|
item.qianxianList.length > 0 ||
|
||||||
|
item.shopList.length > 0
|
||||||
|
"
|
||||||
|
class="change-btn"
|
||||||
|
>
|
||||||
|
<view class="change-btn-content" @click="analyzeKeywordsChangeHandle(item.conversationId, item)">
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/aiChat/icon-53.png'"
|
||||||
|
:class="{
|
||||||
|
'rotate': item.changeIsRotate
|
||||||
|
}"
|
||||||
|
class="icon"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
换一换
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 建议提问 -->
|
||||||
<view
|
<view
|
||||||
v-if="index === (chatMessageListLength - 1) && item.listQuestion.length > 0"
|
v-if="index === (chatMessageListLength - 1) && item.listQuestion.length > 0"
|
||||||
class="suggestion-wrap"
|
class="suggestion-wrap"
|
||||||
@@ -195,7 +547,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view id="bottom_postion" class="bottom-postion" />
|
<view
|
||||||
|
v-if="chatNumber"
|
||||||
|
id="bottom_postion"
|
||||||
|
class="bottom-postion"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
@@ -204,30 +560,57 @@
|
|||||||
}"
|
}"
|
||||||
class="page-to-bottom"
|
class="page-to-bottom"
|
||||||
>
|
>
|
||||||
|
<view class="down-icon-wrap">
|
||||||
|
<image
|
||||||
|
v-if="chatMessageListLength > 0 && !isScrollToBottom && !loading"
|
||||||
|
:src="webUrl + '/aiChat/down.png'"
|
||||||
|
class="icon down-icon"
|
||||||
|
mode="widthFix"
|
||||||
|
@click="scrollToBottomHandle"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
<view
|
<view
|
||||||
v-if="chatNumber"
|
:class="{
|
||||||
|
'container-county': !!countyId
|
||||||
|
}"
|
||||||
|
class="container"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
v-if="chatNumber || showGiftSteps"
|
||||||
class="new-chat"
|
class="new-chat"
|
||||||
@click="createNewHandle"
|
@click="createNewHandle"
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/aiChat/icon-05.png'"
|
:src="webUrl + '/aiChat/icon-54.png'"
|
||||||
class="btn-icon"
|
class="btn-icon"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
开启新对话
|
开启新对话
|
||||||
</view>
|
</view>
|
||||||
|
<view
|
||||||
|
v-if="!countyId"
|
||||||
|
v-for="(item, index) in bottomTools"
|
||||||
|
:key="index"
|
||||||
|
:class="{
|
||||||
|
'hide': !item.display
|
||||||
|
}"
|
||||||
|
class="bottom-tool-item"
|
||||||
|
@click="bottomToolClickHandle(item)"
|
||||||
|
>
|
||||||
<image
|
<image
|
||||||
v-if="chatMessageListLength > 0 && !isScrollToBottom && !loading"
|
:src="item.icon"
|
||||||
:src="webUrl + '/aiChat/down.png'"
|
class="tool-icon"
|
||||||
class="icon"
|
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
@click="scrollToBottomHandle"
|
|
||||||
/>
|
/>
|
||||||
|
{{ item.name }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<bottom-send
|
<bottom-send
|
||||||
ref="bottomSend"
|
ref="bottomSend"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:keyboard-height="keyboardHeight"
|
:keyboard-height="keyboardHeight"
|
||||||
|
:voice-exception="exceptionConfig.voice_exception"
|
||||||
@send="streamReq"
|
@send="streamReq"
|
||||||
@add="createNewHandle"
|
@add="createNewHandle"
|
||||||
@history="historyViewHandle"
|
@history="historyViewHandle"
|
||||||
@@ -236,49 +619,103 @@
|
|||||||
<AiHistoryList
|
<AiHistoryList
|
||||||
ref="historyView"
|
ref="historyView"
|
||||||
:status-bar-height="statusBarHeight"
|
:status-bar-height="statusBarHeight"
|
||||||
|
:county-id="countyId"
|
||||||
|
@enter-history="audioStopHandle"
|
||||||
|
/>
|
||||||
|
<ProductWindow
|
||||||
|
ref="attrWindow"
|
||||||
|
:attr="attr"
|
||||||
|
:cart-num="cart_num"
|
||||||
|
:show-ok="!showGiftBtn"
|
||||||
|
:is-gift="showGiftBtn"
|
||||||
|
:padding-bottom="'60px'"
|
||||||
|
class-name="ai-product-window"
|
||||||
|
ok-text="立即购买"
|
||||||
|
@changeFun="changeFun"
|
||||||
|
@ok="buyNowOrGiftBuyReq(1)"
|
||||||
|
@gift="buyNowOrGiftBuyReq(2)"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { chatMixins } from '../mixins/chatMixins.js'
|
import { chatMixinsV2 } from '../mixins/chatMixinsV2.js'
|
||||||
|
import goCartMixin from '@/mixins/goCartMixins'
|
||||||
import {
|
import {
|
||||||
getAiSystemInfoSetting,
|
getAiSystemInfoSetting,
|
||||||
getAiSystemInfoTopic
|
getAiSystemInfoTopic
|
||||||
} from '@/api/public'
|
} from '@/api/public'
|
||||||
|
import {
|
||||||
|
getCountyAiDetail
|
||||||
|
} from '@/api/chat/index'
|
||||||
import AiHistoryList from '../components/historyList'
|
import AiHistoryList from '../components/historyList'
|
||||||
import BottomSend from '../components/bottomSend.vue'
|
import BottomSend from '../components/bottomSend.vue'
|
||||||
|
import OrderItem from '../components/orderItem.vue'
|
||||||
|
import ProductWindow from '@/components/ProductWindow'
|
||||||
export default {
|
export default {
|
||||||
name: 'AiChatIndexPage',
|
name: 'AiChatIndexPage',
|
||||||
components: {
|
components: {
|
||||||
AiHistoryList,
|
AiHistoryList,
|
||||||
BottomSend
|
BottomSend,
|
||||||
|
OrderItem,
|
||||||
|
ProductWindow
|
||||||
},
|
},
|
||||||
mixins: [chatMixins],
|
mixins: [chatMixinsV2, goCartMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
cityName: '',
|
||||||
|
countyId: '',
|
||||||
animationWidth: '150%',
|
animationWidth: '150%',
|
||||||
animationStr: '',
|
animationStr: '',
|
||||||
settingInfo: {},
|
settingInfo: {},
|
||||||
topicList: []
|
topicList: [],
|
||||||
|
topicIsRotate: false,
|
||||||
|
showGiftSteps: false,
|
||||||
|
currentGiftStepIndex: 0,
|
||||||
|
giftSelections: {},
|
||||||
|
giftBudget: '',
|
||||||
|
giftBuyOptions: [],
|
||||||
|
countyTools: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.cityName = options.cityName || ''
|
||||||
|
this.countyId = options.countyId || ''
|
||||||
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
const addNewChat = uni.getStorageSync('addNewChat') === '1'
|
// 1-新对话,2-我要送礼
|
||||||
|
const addNewChat = uni.getStorageSync('addNewChat') || ''
|
||||||
// 从历史界面点击新增对话
|
// 从历史界面点击新增对话
|
||||||
if (addNewChat && this.chatNumber) {
|
if (addNewChat) {
|
||||||
console.log(addNewChat)
|
if (addNewChat === '1' && (this.chatNumber || this.showGiftSteps)) {
|
||||||
uni.removeStorageSync('addNewChat')
|
|
||||||
this.createNewHandle()
|
this.createNewHandle()
|
||||||
}
|
}
|
||||||
},
|
if (addNewChat === '2') {
|
||||||
onUnload() {
|
const giftOptionItem = this.bottomTools.find((i) => i.giftCardEnabled === 1)
|
||||||
this.closeWsFn()
|
if (giftOptionItem) {
|
||||||
|
this.bottomToolClickHandle(giftOptionItem)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uni.removeStorageSync('addNewChat')
|
||||||
|
}
|
||||||
|
this.audioStopHandle()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
createdCallbak() {
|
extraReqFn() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.scrollToBottomHandle()
|
this.scrollToBottomHandle()
|
||||||
|
if (this.countyId) {
|
||||||
|
getCountyAiDetail({
|
||||||
|
countyId: this.countyId
|
||||||
|
}).then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
this.settingInfo.helloMessageTitle = data.title || ''
|
||||||
|
this.settingInfo.helloMessageContent = data.introduction || ''
|
||||||
|
this.countyTools = data.modules || []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
getAiSystemInfoSetting().then(res => {
|
getAiSystemInfoSetting().then(res => {
|
||||||
const { success, data } = res
|
const { success, data } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
@@ -287,26 +724,65 @@ export default {
|
|||||||
this.animationStr = `TranslateXSwiper-${data.systemTopicDivMaxWidth * 10} ${data.systemTopicDivScrollDuration}s infinite linear alternate`
|
this.animationStr = `TranslateXSwiper-${data.systemTopicDivMaxWidth * 10} ${data.systemTopicDivScrollDuration}s infinite linear alternate`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.loadData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
loadData(type = '') {
|
||||||
|
if (this.topicIsRotate) return
|
||||||
|
if (type === 'click') {
|
||||||
|
this.topicIsRotate = true
|
||||||
|
}
|
||||||
getAiSystemInfoTopic().then(res => {
|
getAiSystemInfoTopic().then(res => {
|
||||||
const { success, data } = res
|
const { success, data } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
this.topicList = data || []
|
// 返回数据先过滤this.topicList,随机保留三条数据
|
||||||
|
let list = data || []
|
||||||
|
if (this.topicList && this.topicList.length > 0) {
|
||||||
|
const currentTitles = this.topicList.map(item => item.title)
|
||||||
|
const filtered = list.filter(item => !currentTitles.includes(item.title))
|
||||||
|
// 如果过滤后的数据不够3条,就不进行过滤
|
||||||
|
if (filtered.length >= 3) {
|
||||||
|
list = filtered
|
||||||
|
}
|
||||||
|
}
|
||||||
|
list.sort(() => Math.random() - 0.5)
|
||||||
|
this.topicList = list.slice(0, 3)
|
||||||
|
setTimeout(() => {
|
||||||
|
this.topicIsRotate = false
|
||||||
|
}, 1000)
|
||||||
}
|
}
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 创建新会话
|
// 创建新会话
|
||||||
createNewHandle() {
|
createNewHandle(type = '') {
|
||||||
if (!this.chatNumber) return
|
this.closeAttrWindow()
|
||||||
|
if (this.audioContext) {
|
||||||
|
this.audioContext.stop()
|
||||||
|
}
|
||||||
|
wx.getBackgroundAudioManager().stop()
|
||||||
this.closeWsFn()
|
this.closeWsFn()
|
||||||
this.chatNumber = ''
|
this.chatNumber = ''
|
||||||
this.showCursor = false
|
this.showCursor = false
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.getConfigLoading = false
|
this.getConfigLoading = false
|
||||||
this.chatMessageList = []
|
this.chatMessageList = []
|
||||||
|
this.loadData()
|
||||||
|
// 清空所有送礼选项
|
||||||
|
this.giftSelections = {}
|
||||||
|
this.giftBudget = ''
|
||||||
|
this.currentGiftStepIndex = 0
|
||||||
|
if (type !== 'giftChat') {
|
||||||
|
const idx = this.bottomTools.findIndex((i) => i.giftCardEnabled === 1)
|
||||||
|
this.$set(this, 'showGiftSteps', false)
|
||||||
|
if (idx > -1) {
|
||||||
|
this.$set(this.bottomTools[idx], 'display', true)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
/*
|
||||||
clickBackHandle() {
|
clickBackHandle() {
|
||||||
if (!this.chatNumber) {
|
if (!this.chatNumber && !this.showGiftSteps) {
|
||||||
if (getCurrentPages().length > 1) {
|
if (getCurrentPages().length > 1) {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} else {
|
} else {
|
||||||
@@ -318,8 +794,9 @@ export default {
|
|||||||
this.createNewHandle()
|
this.createNewHandle()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
*/
|
||||||
pageContainerBeforeleave() {
|
pageContainerBeforeleave() {
|
||||||
if (!this.chatNumber) {
|
if (!this.chatNumber && !this.showGiftSteps) {
|
||||||
if (getCurrentPages().length > 1) {
|
if (getCurrentPages().length > 1) {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} else {
|
} else {
|
||||||
@@ -330,6 +807,19 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.createNewHandle()
|
this.createNewHandle()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
countyToolItemClickHandle(item) {
|
||||||
|
if (item.moduleType === 'prompt') {
|
||||||
|
this.streamReq({
|
||||||
|
prompt: item.promptContent,
|
||||||
|
init: 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (item.moduleType === 'url') {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: item.url
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -368,43 +858,53 @@ export default {
|
|||||||
opacity: 0.0;
|
opacity: 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.home-wrap {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
min-height: calc(100vh - 240rpx);
|
||||||
|
height: auto;
|
||||||
|
padding: 0 0 240rpx 0;
|
||||||
|
padding-bottom: calc(240rpx + constant(safe-area-inset-bottom));
|
||||||
|
padding-bottom: calc(240rpx + env(safe-area-inset-bottom));
|
||||||
|
box-sizing: border-box;
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
.gift-steps-wrap {
|
||||||
|
padding-bottom: 40rpx;
|
||||||
|
padding-bottom: calc(40rpx + constant(safe-area-inset-bottom));
|
||||||
|
padding-bottom: calc(40rpx + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
.focus-guide-wrap {
|
.focus-guide-wrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 60rpx 40rpx;
|
flex-direction: column;
|
||||||
.guide-left {
|
.guide-left {
|
||||||
.avatar {
|
.avatar {
|
||||||
display: block;
|
display: block;
|
||||||
width: 267rpx;
|
width: 400rpx;
|
||||||
height: 530rpx;
|
}
|
||||||
|
.county-avatar {
|
||||||
|
width: 360rpx;
|
||||||
|
}
|
||||||
|
.avatar-bounce {
|
||||||
|
animation: bounce 2s infinite ease-in-out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.guide-right {
|
.guide-right {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 30rpx;
|
width: 100%;
|
||||||
margin: 0 0 0 40rpx;
|
padding: 30rpx 0;
|
||||||
border-radius: 20rpx;
|
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
background-color: #fff;
|
text-align: center;
|
||||||
box-shadow: 0rpx 12rpx 30rpx rgba(0,0,0,0.1);
|
|
||||||
.trangle {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 120rpx;
|
|
||||||
left: -15rpx;
|
|
||||||
width: 30rpx;
|
|
||||||
height: 30rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
box-shadow: -30rpx 12rpx 30rpx rgba(0,0,0,0.1);
|
|
||||||
transform: rotate(45deg);
|
|
||||||
}
|
|
||||||
.title {
|
.title {
|
||||||
width: 110%;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
font-size: 34rpx;
|
||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
padding: 30rpx 0 0 0;
|
padding: 30rpx 24rpx 0 24rpx;
|
||||||
color: #999;
|
color: #3D4CF0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -413,46 +913,48 @@ export default {
|
|||||||
.title {
|
.title {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: space-between;
|
||||||
.txt {
|
padding: 0 24rpx;
|
||||||
width: 186rpx;
|
color: #3D4CF0;
|
||||||
height: 46rpx;
|
|
||||||
margin: 0 20rpx;
|
|
||||||
border-radius: 24rpx;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 46rpx;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
background-color: #3D4CF1;
|
.title-left {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.title-right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
.icon {
|
.icon {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 40rpx;
|
width: 32rpx;
|
||||||
height: 32rpx;
|
height: 32rpx;
|
||||||
|
margin: 0 8rpx 0 0;
|
||||||
|
&.rotate {
|
||||||
|
animation: spin-icon 1s linear;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.list-wrap {
|
.list-wrap {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 60rpx 0 0 0;
|
padding: 40rpx 0 0 0;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
.list-cont {
|
.list-cont {
|
||||||
display: flex;
|
padding: 0 24rpx;
|
||||||
flex-wrap: wrap;
|
|
||||||
width: 750 * 1.5rpx;
|
|
||||||
padding: 0 0 0 24rpx;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
// animation: translateXSwiper 10s infinite linear alternate;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
.list-item {
|
.list-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 48rpx;
|
padding: 6rpx 12rpx;
|
||||||
padding: 0 18rpx;
|
margin: 0 0 24rpx 0;
|
||||||
margin: 0 30rpx 30rpx 0;
|
border-radius: 12rpx;
|
||||||
border-radius: 24rpx;
|
border: 1rpx solid #ddd;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
background: rgba(255,255,255,0.39);
|
background-color: #fff;
|
||||||
box-shadow: 0rpx 6rpx 12rpx rgba(0,0,0,0.1);
|
|
||||||
.icon {
|
.icon {
|
||||||
display: block;
|
display: block;
|
||||||
width: 24rpx;
|
width: 24rpx;
|
||||||
@@ -471,4 +973,58 @@ export default {
|
|||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes bounce {
|
||||||
|
0%, 100% {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: translateY(-20rpx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.county-home-wrap {
|
||||||
|
justify-content: flex-start;
|
||||||
|
.guide-right {
|
||||||
|
.content {
|
||||||
|
padding: 30rpx 32rpx 0 32rpx;
|
||||||
|
color: #666;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.county-tools-wrap {
|
||||||
|
width: 100%;
|
||||||
|
padding: 40rpx 0 0 0;
|
||||||
|
.list-cont {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 60rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.list-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 28%;
|
||||||
|
padding: 20rpx 0 12rpx 0;
|
||||||
|
margin: 0 0 24rpx 0;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0 0 12rpx rgba(0, 0, 0, 0.1);
|
||||||
|
.icon {
|
||||||
|
display: block;
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
margin: 0 8rpx 0 0;
|
||||||
|
}
|
||||||
|
.name {
|
||||||
|
padding: 8rpx 0 0 0;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -12,6 +12,16 @@ export function getCompletionsV2(params) {
|
|||||||
return request.get('/v1/chat/sse/completions2', params, { login: true })
|
return request.get('/v1/chat/sse/completions2', params, { login: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 通过关键字-搜索列表
|
||||||
|
export function getAnalyzeKeywordsV1(data) {
|
||||||
|
return request.post('/v1/chat/analyzeKeywords', data, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 通过关键字-搜索列表-换一换
|
||||||
|
export function getAnalyzeKeywordsChangeV1(data) {
|
||||||
|
return request.post('/v1/chat/aiSearch', data, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
export function deleteChatItemByConversationId(id) {
|
export function deleteChatItemByConversationId(id) {
|
||||||
return request.delete('/v1/chat/message/' + id, {}, { login: true })
|
return request.delete('/v1/chat/message/' + id, {}, { login: true })
|
||||||
}
|
}
|
||||||
@@ -27,3 +37,59 @@ export function historyChatMessage(params) {
|
|||||||
export function deleteChatListByType(type) {
|
export function deleteChatListByType(type) {
|
||||||
return request.delete('/v1/chat/type/' + type, {}, { login: true })
|
return request.delete('/v1/chat/type/' + type, {}, { login: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function deleteCountyChatListByType(type, params) {
|
||||||
|
return request.delete('/county-ai/chat/type/' + type + params, {}, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getWeatherData(params) {
|
||||||
|
return request.get('/v1/chat/weatherData', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getHolidayData(params) {
|
||||||
|
return request.get('/v1/chat/holidayData', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCompletionsV3(params) {
|
||||||
|
return request.get('/v1/chat/intent/recognize', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 通过关键字-搜索列表-换一换
|
||||||
|
export function getAnalyzeKeywordsChangeV3(data) {
|
||||||
|
return request.post('/v1/chat/skill/refresh', data, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 以图搜索商品
|
||||||
|
export function getAnalyzeByImageV3(data) {
|
||||||
|
return request.post('/v1/chat/image/recognition', data, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取送礼选项配置
|
||||||
|
export function getGiftRecommendOptions(params) {
|
||||||
|
return request.get('/ai/gift-recommend/options', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取县域AI详情
|
||||||
|
export function getCountyAiDetail(params) {
|
||||||
|
return request.get('/county-ai/detail', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getSseCountyAiConfigV1(data) {
|
||||||
|
return request.post('/county-ai/chat', data, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCountyAiCompletionsV1(params) {
|
||||||
|
return request.get('/county-ai/chat/recognize', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCountyAiChatList(params) {
|
||||||
|
return request.get('/county-ai/chat/list', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCountyAiHistoryChatMessage(params) {
|
||||||
|
return request.get('/county-ai/chat/message', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getGiftRecommendPrompt(data) {
|
||||||
|
return request.post('/ai/gift-recommend/build-prompt', data, { login: true })
|
||||||
|
}
|
||||||
|
|||||||
+96
@@ -64,3 +64,99 @@ export function getGiftCardResend(data) {
|
|||||||
export function getGiftCardSendBackground(data) {
|
export function getGiftCardSendBackground(data) {
|
||||||
return request.get("giftCard/giftCardBackgroundImage", data);
|
return request.get("giftCard/giftCardBackgroundImage", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建团购礼品
|
||||||
|
* @param {*} data
|
||||||
|
*/
|
||||||
|
export function createGroupBuyGift(data) {
|
||||||
|
return request.post("/travel/giftCardOrder/confirm", data);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 旅居团购礼品卡订单创建
|
||||||
|
* @param {*} data
|
||||||
|
*/
|
||||||
|
export function createSojoumGroupBuyGift(key, data) {
|
||||||
|
return request.post("/travel/giftCardOrder/create/" + key, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居团购礼品卡订单详情
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function fetchSojoumGroupBuyGiftDetail(params) {
|
||||||
|
return request.get("/travel/giftCard/info",params, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领取旅居团购礼品卡
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function receiveSojoumGroupBuyGift(params) {
|
||||||
|
return request.post("/travel/giftCard/receive", params, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居礼品卡送礼入口轮播图
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function fetchSojoumGroupBuyGiftCarousel(params) {
|
||||||
|
return request.get("/travel/giftCardTravelBanner",params, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算旅居团购礼品订单价格
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function computedSojoumGroupBuyGiftOrderPrice(params) {
|
||||||
|
return request.post("/travel/giftCardOrder/computed/" + params.key, params, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文生图发起生成
|
||||||
|
* @param {*} data
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function aiGiftImageGenerate(data) {
|
||||||
|
return request.post("/aiGiftImage/generate", data, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文生图状态查询
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function aiGiftImageStatus(params) {
|
||||||
|
return request.get("/aiGiftImage/" + params.productId, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商品以前使用过的AI礼品卡图片
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function aiGiftImageHistory(params) {
|
||||||
|
return request.get("/giftCard/aiGiftImages/history?productId=" + params.productId, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -79,3 +79,11 @@ export function getRecipe(params) {
|
|||||||
export function getBanner() {
|
export function getBanner() {
|
||||||
return request.get("/wellness/exhibition/banner")
|
return request.get("/wellness/exhibition/banner")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 康养生活-康养旅居顶部配置
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getWellnessTopImage() {
|
||||||
|
return request.get("/wellness/topImage")
|
||||||
|
}
|
||||||
|
|||||||
+17
@@ -191,6 +191,10 @@ export function getHotelTypeList() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getHotelBanner(params) {
|
||||||
|
return request.get("/hotelBanner", params);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺详情海报
|
* 店铺详情海报
|
||||||
* @param id 店铺ID int
|
* @param id 店铺ID int
|
||||||
@@ -273,4 +277,17 @@ export function getMerchantApply() {
|
|||||||
return request.get("/merchantApply/userHotels", {}, {login: true})
|
return request.get("/merchantApply/userHotels", {}, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户评论列表
|
||||||
|
*/
|
||||||
|
export function getCommentList(params) {
|
||||||
|
return request.get("/user/reply/list", params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加用户评论
|
||||||
|
*/
|
||||||
|
export function addComment(data) {
|
||||||
|
return request.post("/user/reply/add", data, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
+109
-12
@@ -11,16 +11,14 @@ export function getImages() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 商户申请页面数据
|
// 商户申请页面数据
|
||||||
export function getShopData(partnerId) {
|
export function getShopData(params) {
|
||||||
let param = {};
|
return request.get("/merchantApply/index", params, {login: true})
|
||||||
if (partnerId) param.partnerId = partnerId;
|
|
||||||
return request.get("/merchantApply/index", param, {login: true})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查看商户申请
|
// 查看商户申请
|
||||||
// 1-特产供应商 2-店铺 3-文玩供应商
|
// 1-特产供应商 2-店铺 3-文玩供应商
|
||||||
export function getShopInfo() {
|
export function getShopInfo(params) {
|
||||||
return request.get("/merchantApply/info", {}, {login: true})
|
return request.get("/merchantApply/info", params, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4-采购批发商
|
// 4-采购批发商
|
||||||
@@ -29,33 +27,132 @@ export function getWholesaler() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 提交店铺入驻申请
|
// 提交店铺入驻申请
|
||||||
export function saveShop(hotelInfo, captcha, partnerId) {
|
export function saveShop(hotelInfo, partnerId = '', promoterUid = '') {
|
||||||
let param = {hotelInfo, captcha: hotelInfo.captcha};
|
let param = {hotelInfo, captcha: hotelInfo.captcha};
|
||||||
if (partnerId && partnerId.length > 0) param.partnerId = partnerId;
|
if (partnerId && partnerId.length > 0) {
|
||||||
|
param.partnerId = partnerId;
|
||||||
|
}
|
||||||
|
if (promoterUid && promoterUid.length > 0) {
|
||||||
|
param.promoterUid = promoterUid;
|
||||||
|
}
|
||||||
return request.post("/merchantApply/hotel/submit", param, {login: true})
|
return request.post("/merchantApply/hotel/submit", param, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保存店铺入驻草稿
|
||||||
|
export function saveHotelDraft(hotelInfo, partnerId = '', promoterUid = '') {
|
||||||
|
let param = {hotelInfo, captcha: hotelInfo.captcha};
|
||||||
|
if (partnerId && partnerId.length > 0) {
|
||||||
|
param.partnerId = partnerId;
|
||||||
|
}
|
||||||
|
if (promoterUid && promoterUid.length > 0) {
|
||||||
|
param.promoterUid = promoterUid;
|
||||||
|
}
|
||||||
|
return request.post("/merchantApply/hotel/saveDraft", param, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
// 提交特产供应商入驻申请
|
// 提交特产供应商入驻申请
|
||||||
export function saveSupplier(hotelInfo, supplierInfo, partnerId) {
|
export function saveSupplier(hotelInfo, supplierInfo, partnerId = '', promoterUid = '') {
|
||||||
let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha};
|
let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha};
|
||||||
if (partnerId && partnerId.length > 0) param.partnerId = partnerId;
|
if (partnerId && partnerId.length > 0) {
|
||||||
|
param.partnerId = partnerId;
|
||||||
|
}
|
||||||
|
if (promoterUid && promoterUid.length > 0) {
|
||||||
|
param.promoterUid = promoterUid;
|
||||||
|
}
|
||||||
return request.post("/merchantApply/goodSupplier/submit", param, {login: true})
|
return request.post("/merchantApply/goodSupplier/submit", param, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提交文玩供应商入驻申请
|
// 提交文玩供应商入驻申请
|
||||||
export function saveWenwanSupplier(hotelInfo, supplierInfo, partnerId) {
|
export function saveWenwanSupplier(hotelInfo, supplierInfo, partnerId = '', promoterUid = '') {
|
||||||
let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha};
|
let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha};
|
||||||
if (partnerId && partnerId.length > 0) param.partnerId = partnerId;
|
if (partnerId && partnerId.length > 0) {
|
||||||
|
param.partnerId = partnerId;
|
||||||
|
}
|
||||||
|
if (promoterUid && promoterUid.length > 0) {
|
||||||
|
param.promoterUid = promoterUid;
|
||||||
|
}
|
||||||
return request.post("/merchantApply/wenwanSupplier/submit", param, {login: true})
|
return request.post("/merchantApply/wenwanSupplier/submit", param, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保存供应商入驻草稿(特产/文玩共用)
|
||||||
|
export function saveSupplierDraft(hotelInfo, supplierInfo, partnerId = '', promoterUid = '') {
|
||||||
|
let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha};
|
||||||
|
if (partnerId && partnerId.length > 0) {
|
||||||
|
param.partnerId = partnerId;
|
||||||
|
}
|
||||||
|
if (promoterUid && promoterUid.length > 0) {
|
||||||
|
param.promoterUid = promoterUid;
|
||||||
|
}
|
||||||
|
return request.post("/merchantApply/supplier/saveDraft", param, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
// 提交采购批发商入驻申请
|
// 提交采购批发商入驻申请
|
||||||
export function saveWholesaler(wholesalerInfo) {
|
export function saveWholesaler(wholesalerInfo) {
|
||||||
let param = {wholesalerInfo, captcha: wholesalerInfo.captcha};
|
let param = {wholesalerInfo, captcha: wholesalerInfo.captcha};
|
||||||
return request.post("/merchantApply/wholesaler/submit", param, {login: true})
|
return request.post("/merchantApply/wholesaler/submit", param, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保存采购批发商入驻草稿
|
||||||
|
export function saveWholesalerDraft(wholesalerInfo) {
|
||||||
|
let param = {wholesalerInfo, captcha: wholesalerInfo.captcha};
|
||||||
|
return request.post("/merchantApply/wholesaler/saveDraft", param, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function saveExperienceStore(params) {
|
||||||
|
return request.post("/merchantApply/experienceStore/submit", params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function saveExperienceStoreDraft(params) {
|
||||||
|
return request.post("/merchantApply/experienceStore/saveDraft", params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getExperienceStoreCategoryList() {
|
||||||
|
return request.get("/experienceStore/categoryList", {}, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getExperienceStoreInfo(params) {
|
||||||
|
return request.get("merchantApply/info/experienceStore", params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
// 撤销入驻申请
|
// 撤销入驻申请
|
||||||
export function removeApply() {
|
export function removeApply() {
|
||||||
return request.post("/merchantApply/revoke")
|
return request.post("/merchantApply/revoke")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 特色店铺入驻信息
|
||||||
|
export function getHotelInfo(params) {
|
||||||
|
return request.get("merchantApply/info/hotel", params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取千县名品店铺类型列表
|
||||||
|
export function getCountyFamousHotelType(params) {
|
||||||
|
return request.get("/countyFamous/hotelType", params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居管家入驻申请详情
|
||||||
|
*/
|
||||||
|
export function getTravelInfo(params) {
|
||||||
|
return request.get("merchantApply/info/travel", params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交旅居管家入驻申请
|
||||||
|
*/
|
||||||
|
export function saveTravel(params) {
|
||||||
|
return request.post("/merchantApply/travel/submit", params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居管家申请草稿保存
|
||||||
|
*/
|
||||||
|
export function saveTravelDraft(params) {
|
||||||
|
return request.post("/merchantApply/travel/saveDraft", params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居管家撤销申请
|
||||||
|
*/
|
||||||
|
export function revokeTravel(params) {
|
||||||
|
return request.post("/merchantApply/travel/revoke", params, {login: true})
|
||||||
|
}
|
||||||
|
|||||||
+114
-4
@@ -3,15 +3,77 @@ import request from '@/utils/request'
|
|||||||
/**
|
/**
|
||||||
* 抽奖活动信息
|
* 抽奖活动信息
|
||||||
* */
|
* */
|
||||||
export function getDetail() {
|
export function getDetail(params = {}) {
|
||||||
return request.get('/lottery/dice/detail')
|
return request.get('/lottery/dice/detail', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 抽奖
|
* 抽奖
|
||||||
* */
|
* */
|
||||||
export function getPrize() {
|
export function getPrize(data = {}) {
|
||||||
return request.post('/lottery/dice/draw')
|
return request.post('/lottery/dice/draw', data)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 县域抽奖活动详情
|
||||||
|
* @param activityId 抽奖活动ID
|
||||||
|
*/
|
||||||
|
export function getDrawActivityInfo(activityId) {
|
||||||
|
return request.get('/draw/activityInfo', { activityId })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 县域抽奖活动规则
|
||||||
|
*/
|
||||||
|
export function getDrawRuleConfig() {
|
||||||
|
return request.get('/draw/ruleConfig')
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的抽奖码列表
|
||||||
|
* @param status 抽奖码状态(0:等待开奖, 1:已中奖, 2:未中奖, -1:已失效)
|
||||||
|
*/
|
||||||
|
export function getDrawMyTickets(status) {
|
||||||
|
const params = {}
|
||||||
|
if (status !== undefined && status !== null && status !== '') {
|
||||||
|
params.status = status
|
||||||
|
}
|
||||||
|
return request.get('/draw/myTickets', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抽奖活动中奖记录
|
||||||
|
* @param activityId 抽奖活动ID
|
||||||
|
*/
|
||||||
|
export function getActivityWinRecord(activityId) {
|
||||||
|
return request.get('/draw/activityWinRecord', { activityId })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取最新中奖名单
|
||||||
|
* @param activityId 抽奖活动ID(可选)
|
||||||
|
*/
|
||||||
|
export function getDrawLatestWinners(activityId) {
|
||||||
|
const params = {}
|
||||||
|
if (activityId !== undefined && activityId !== null && activityId !== '') {
|
||||||
|
params.activityId = activityId
|
||||||
|
}
|
||||||
|
return request.get('/draw/latestWinners', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 历史抽奖活动列表
|
||||||
|
* 用于在中奖名单页面切换历史抽奖活动
|
||||||
|
*/
|
||||||
|
export function getDrawHistoryActivities() {
|
||||||
|
return request.get('/draw/historyActivities')
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取抽奖相关显示配置
|
||||||
|
*/
|
||||||
|
export function getDrawConfig() {
|
||||||
|
return request.get('/draw/config')
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,3 +98,51 @@ export function getLogs(page = 1, limit = 10) {
|
|||||||
export function getLotteryShareInfo() {
|
export function getLotteryShareInfo() {
|
||||||
return request.get('/lottery/shareImage')
|
return request.get('/lottery/shareImage')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单支付完成后检查抽奖码
|
||||||
|
* @param orderId 订单号
|
||||||
|
*/
|
||||||
|
export function getDrawTicketByOrder(orderId) {
|
||||||
|
return request.get('/draw/ticketCheck', { orderId })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验抽奖活动是否到开奖时间
|
||||||
|
* @param activityId 抽奖活动ID
|
||||||
|
*/
|
||||||
|
export function checkDrawTime(activityId) {
|
||||||
|
return request.get('/draw/checkTime', { activityId })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领取优惠券奖品
|
||||||
|
* @param ticketId 抽奖券ID
|
||||||
|
*/
|
||||||
|
export function claimCoupon(ticketId) {
|
||||||
|
return request.post('/draw/claimCoupon', { ticketId })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领取实物奖品
|
||||||
|
* @param ticketId 抽奖券ID
|
||||||
|
* @param addressId 用户收货地址ID
|
||||||
|
*/
|
||||||
|
export function claimPrize(ticketId, addressId) {
|
||||||
|
return request.post('/draw/claimPrize', { ticketId, addressId })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取实名认证信息
|
||||||
|
*/
|
||||||
|
export function getDrawRealname() {
|
||||||
|
return request.get('/draw/realname')
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交实名认证
|
||||||
|
* @param data { realName, idCard, phone }
|
||||||
|
*/
|
||||||
|
export function submitDrawRealname(data = {}) {
|
||||||
|
return request.post('/draw/realname', data)
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
* */
|
* */
|
||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取默认地址
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
export function getAddressDefaultSelected() {
|
||||||
|
return request.get("/address/defaultSelected")
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过购物车 id 获取订单信息
|
* 通过购物车 id 获取订单信息
|
||||||
* @param cartId
|
* @param cartId
|
||||||
@@ -94,6 +102,17 @@ export function postOrderRefund(data) {
|
|||||||
return request.post("/order/refund/verify", data);
|
return request.post("/order/refund/verify", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消退款申请
|
||||||
|
* @param uni
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
export function cancelOrderRefund(uni) {
|
||||||
|
return request.post("/order/refund/cancel", {
|
||||||
|
uni
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认收货
|
* 确认收货
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
@@ -179,3 +198,30 @@ export function aginConfirm(params) {
|
|||||||
export function editAddress(params) {
|
export function editAddress(params) {
|
||||||
return request.post('/order/editAddress', params)
|
return request.post('/order/editAddress', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请修改订单收货地址
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function applyEditAddress(params) {
|
||||||
|
return request.post('/order/applyEditAddress', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单预计到达时间
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function orderExpectedArrivalTime(params) {
|
||||||
|
return request.post('/order/express/estimatedTime', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居团购订单详情
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function groupOrderDetail(params) {
|
||||||
|
return request.post('/travel/travelGroupOrder/detail/' + params.key, params)
|
||||||
|
}
|
||||||
|
|||||||
@@ -160,3 +160,31 @@ export function hadView(data) {
|
|||||||
export function getShareImg(id) {
|
export function getShareImg(id) {
|
||||||
return request.get('/landmarkGoods/poster/' + id, {}, {login: false})
|
return request.get('/landmarkGoods/poster/' + id, {}, {login: false})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getLatestExperienceCoupon() {
|
||||||
|
return request.get('/experienceCoupon/latest', {}, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getExperienceCouponList() {
|
||||||
|
return request.get('/experienceCoupon/list', {}, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getExperienceCouponItems(params) {
|
||||||
|
return request.get('/experienceCoupon/items', params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getExperienceCouponCategoryList(params) {
|
||||||
|
return request.get('/experienceCoupon/categoryList', params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createExperienceCouponOrder(data) {
|
||||||
|
return request.post('/experienceCoupon/order/create', data, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getExperienceCouponOrderDetail(orderId) {
|
||||||
|
return request.get(`/experienceCoupon/order/detail/${orderId}`, {}, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function checkExperienceCoupon(params) {
|
||||||
|
return request.get('/experienceCoupon/check', params, {login: true})
|
||||||
|
}
|
||||||
|
|||||||
@@ -222,3 +222,18 @@ export function getAiSystemInfoSetting() {
|
|||||||
export function getAiSystemInfoTopic() {
|
export function getAiSystemInfoTopic() {
|
||||||
return request.get('/ai/systemTopic', {}, { login: false })
|
return request.get('/ai/systemTopic', {}, { login: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取异常提示配置
|
||||||
|
export function getExceptionConfig() {
|
||||||
|
return request.get('/ai/exceptionConfig', {}, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取已启用的底部导航配置列表
|
||||||
|
export function getBottomNavigationConfigList() {
|
||||||
|
return request.get('/ai/bottom-navigation/list', {}, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取通用分享配置
|
||||||
|
export function getWeixinShareConfig() {
|
||||||
|
return request.get('/weixinShareConfig', {}, { login: false })
|
||||||
|
}
|
||||||
|
|||||||
+191
-6
@@ -60,6 +60,11 @@ export function getCountyFamousCityGuideContent(param) {
|
|||||||
return request.get('/countyFamous/guide/content', param, { login: true })
|
return request.get('/countyFamous/guide/content', param, { login: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取千县名品县城图文攻略详情
|
||||||
|
export function getCountyFamousGraphicGuideContent(param) {
|
||||||
|
return request.get('/countyFamous/guide/graphic/content', param, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
// 获取千县名品县城重点产业列表
|
// 获取千县名品县城重点产业列表
|
||||||
export function getCountyFamousIndustry(param) {
|
export function getCountyFamousIndustry(param) {
|
||||||
return request.get('/countyFamous/industry', param, { login: true })
|
return request.get('/countyFamous/industry', param, { login: true })
|
||||||
@@ -105,12 +110,12 @@ export function getSaleList(params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 旅居列表
|
// 旅居列表
|
||||||
export function getJiaLouList(params) {
|
// export function getJiaLouList(params) {
|
||||||
return request.get('/countyFamous/sojourn', params, {login: true})
|
// return request.get('/countyFamous/sojourn', params, {login: true})
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 旅居详情
|
// 旅居详情
|
||||||
export function getJiaLouDetail(id) {
|
export function getJiaLouDetail1(id) {
|
||||||
return request.get('/countyFamous/sojourn/' + id, {}, {login: true})
|
return request.get('/countyFamous/sojourn/' + id, {}, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,15 +146,195 @@ export function postJiaLouZan(data) {
|
|||||||
|
|
||||||
// 旅居资讯查看
|
// 旅居资讯查看
|
||||||
export function postJiaLouNewsView(data) {
|
export function postJiaLouNewsView(data) {
|
||||||
return request.post('/countyFamous/news/view', data, {login: true})
|
return request.post('/travel/news/view', data, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 旅居资讯点赞
|
// 旅居资讯点赞
|
||||||
export function postJiaLouNewsZan(data) {
|
export function postJiaLouNewsZan(data) {
|
||||||
return request.post('/countyFamous/news/zan', data, {login: true})
|
return request.post('/travel/news/zan', data, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分享旅居
|
// 分享旅居
|
||||||
export function postJiaLouShare(id) {
|
export function postJiaLouShare(id) {
|
||||||
return request.get('/countyFamous/sojourn/poster/' + id, {login: true})
|
return request.get('/countyFamous/sojourn/poster/' + id, {login: true})
|
||||||
}
|
}
|
||||||
|
// 分享旅居1
|
||||||
|
export function postTravelShare(id) {
|
||||||
|
return request.get('/travel/poster/' + id, {login: true})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取旅居列表
|
||||||
|
* countyId int 县城ID
|
||||||
|
shopType string 所属板块(countyFamous-千县;wellness-康养)
|
||||||
|
wellnessPlaceCateId int 康养圣地分类ID
|
||||||
|
name string 名称
|
||||||
|
page int 页码
|
||||||
|
limit int 每页数量
|
||||||
|
*/
|
||||||
|
export function getJiaLouList(params) {
|
||||||
|
return request.get('/travel/merchantList', params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取旅居详情
|
||||||
|
* @param {*} id
|
||||||
|
*/
|
||||||
|
export function getJiaLouDetail(id) {
|
||||||
|
return request.get('/travel/merchant/' + id, {}, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居团购产品列表
|
||||||
|
merId int 商户ID
|
||||||
|
page int 页码
|
||||||
|
limit int 每页数量
|
||||||
|
*/
|
||||||
|
export function getJiaLouProductList(params) {
|
||||||
|
return request.get('/travel/products', params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居团购产品详情
|
||||||
|
* @param {*} id 产品ID
|
||||||
|
*/
|
||||||
|
export function getJiaLouProductDetail(id) {
|
||||||
|
return request.get('/travel/product/' + id, {}, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居团购产品评论列表
|
||||||
|
* travelGroupProductId int 旅居团购产品ID
|
||||||
|
* type int 0-全部 1-好评 2-中评 3-差评
|
||||||
|
* page int 页码
|
||||||
|
* limit int 每页数量
|
||||||
|
*/
|
||||||
|
export function getJiaLouProductReply(params) {
|
||||||
|
return request.get('/travel/product/reply', params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取旅居团购产品评论统计
|
||||||
|
* travelGroupProductId int 旅居团购产品ID
|
||||||
|
*/
|
||||||
|
export function getJiaLouProductReplyCount(params) {
|
||||||
|
return request.get('/travel/product/reply/count', params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getTravelGroupOrderAgreement() {
|
||||||
|
return request.get('/travel/travelGroupOrderAgreement', {}, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管家列表
|
||||||
|
* merId int 商户ID
|
||||||
|
page int 页码
|
||||||
|
limit int 每页数量
|
||||||
|
*/
|
||||||
|
export function getJiaLouStewardList(params) {
|
||||||
|
return request.get('/travel/steward', params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定月份可预约日期
|
||||||
|
* @param {*} params
|
||||||
|
* travelGroupProductId int 旅居团购产品ID
|
||||||
|
month string 月份(yyyy-MM)
|
||||||
|
*/
|
||||||
|
export function getJiaLouCalendar(params) {
|
||||||
|
return request.get('/travel/product/calendar', params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取预定必读
|
||||||
|
*/
|
||||||
|
export function getJiaLouBookingRules() {
|
||||||
|
return request.get('/travel/orderRule', {}, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建订单
|
||||||
|
* @param {*} params
|
||||||
|
* travelGroupProductId int 旅居团购产品ID
|
||||||
|
orderStartDate string 订单开始日期(yyyy-MM-dd)
|
||||||
|
orderEndDate string 订单结束日期(yyyy-MM-dd)
|
||||||
|
*/
|
||||||
|
export function createJiaLouOrder(params) {
|
||||||
|
return request.post('/travel/travelGroupOrder/confirm', params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居团购订单创建
|
||||||
|
* @param {*} params
|
||||||
|
*/
|
||||||
|
export function createJiaLouOrderPay(params) {
|
||||||
|
return request.post('/travel/travelGroupOrder/create/' + params.key, params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居资讯列表
|
||||||
|
* merId int 旅居管家商户ID
|
||||||
|
page int 页码
|
||||||
|
limit int 每页条数
|
||||||
|
*/
|
||||||
|
export function getJiaLouNewsList(params) {
|
||||||
|
return request.get('/travel/news', params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分享管家
|
||||||
|
*/
|
||||||
|
export function getShareHousekeeper(id) {
|
||||||
|
return request.get('/travel/steward/poster/' + id, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管家详情
|
||||||
|
*/
|
||||||
|
export function getJiaLouStewardDetail(id) {
|
||||||
|
return request.get('/travel/steward/' + id, {}, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取县城资讯详情
|
||||||
|
*/
|
||||||
|
export function getCityNewsDetail(id) {
|
||||||
|
return request.get('/countyFamous/news/' + id, {}, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取县城资讯类别
|
||||||
|
*/
|
||||||
|
export function getCityNewsCategory() {
|
||||||
|
return request.get('/countyFamous/newsCategory', {}, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取县城店铺列表
|
||||||
|
*/
|
||||||
|
export function getCityShopList(params) {
|
||||||
|
return request.get('/countyFamous/hotel', params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCountyFamousHotelType(params) {
|
||||||
|
return request.get('/countyFamous/hotelType', params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ������б�
|
||||||
|
* travelMerchantId int �þ��̻�ID
|
||||||
|
* experienceStoreCategoryId int ��������ID
|
||||||
|
*/
|
||||||
|
export function getExperienceStoreList(params) {
|
||||||
|
return request.get('/experienceStore/list', params, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getExperienceStoreProject(experienceMerchantId) {
|
||||||
|
return request.get('/experienceStoreProject/' + experienceMerchantId, {}, { login: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getExperienceStoreDetail(id) {
|
||||||
|
return request.get('/experienceStore/detail/' + id, {}, { login: true })
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import request from "@/utils/request";
|
||||||
|
/**
|
||||||
|
* 获取未读消息数量
|
||||||
|
*/
|
||||||
|
export function getUnreadMessageCount() {
|
||||||
|
return request.get("/user/reply/messages/unreadCount", {}, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标记消息为已读
|
||||||
|
*/
|
||||||
|
export function markMessagesAsRead() {
|
||||||
|
return request.post("/user/reply/messages/readAll", {}, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取消息列表
|
||||||
|
*/
|
||||||
|
export function getMessageList(params) {
|
||||||
|
return request.get("/user/reply/messages", params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回复消息
|
||||||
|
*/
|
||||||
|
export function replyMessage(data) {
|
||||||
|
return request.post("/user/reply/add", data, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
import request from "@/utils/request";
|
||||||
|
/**
|
||||||
|
* 旅居团购订单详情
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function fetchSojoumOrderDetail(params) {
|
||||||
|
return request.get("/travel/travelGroupOrder/detail/" + params.key, params, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居团购订单退款
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function sojoumOrderRefund(params) {
|
||||||
|
return request.post("/travel/travelGroupOrder/refund", params, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居团购订单修改入住时间
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function sojoumOrderCheckInTime(params) {
|
||||||
|
return request.post("/travel/travelGroupOrder/changeDate", params, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取产品指定月份的预约日历
|
||||||
|
* @param {*} params
|
||||||
|
* travelGroupProductId int 旅居团购产品ID
|
||||||
|
month string 月份(yyyy-MM)
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function sojoumOrderCalendar(params) {
|
||||||
|
return request.get("/travel/product/calendar", params, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居团购订单退款信息
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function sojoumOrderRefundInfo(params) {
|
||||||
|
return request.post("/travel/travelGroupOrder/refundInfo", params, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 旅居团购订单检查日期是否可预约
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function sojoumOrderCheckDate(params) {
|
||||||
|
return request.post("/travel/travelGroupOrder/checkDate", params, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function sojoumOrderComment(params) {
|
||||||
|
return request.post("/travel/travelGroupOrder/comment", params, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
+12
@@ -578,6 +578,10 @@ export function getHistory(params) {
|
|||||||
return request.get('/history/list', params)
|
return request.get('/history/list', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function deleteHistory(id) {
|
||||||
|
return request.delete(`/history/${id}`)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购物车猜你喜欢
|
* 购物车猜你喜欢
|
||||||
* @param {*} params
|
* @param {*} params
|
||||||
@@ -599,3 +603,11 @@ export function queryUserGuide(params) {
|
|||||||
export function setUserGuide(params) {
|
export function setUserGuide(params) {
|
||||||
return request.post('/user/guide/status', params)
|
return request.post('/user/guide/status', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提现规则
|
||||||
|
*/
|
||||||
|
export function getWithdrawalRules() {
|
||||||
|
return request.get('/extract/rule')
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
+604
-23
@@ -9,13 +9,21 @@ page {
|
|||||||
}
|
}
|
||||||
.fix-tabbar-page {
|
.fix-tabbar-page {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: 0;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
|
background: transparent;
|
||||||
|
isolation: isolate;
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: -1;
|
||||||
|
pointer-events: none;
|
||||||
background: linear-gradient(155deg, rgba(61, 76, 241, 0.15) 0%, rgba(255,255,255,1) 25%, rgba(255,255,255,1) 75%, rgba(61, 76, 241, 0.15) 100%);
|
background: linear-gradient(155deg, rgba(61, 76, 241, 0.15) 0%, rgba(255,255,255,1) 25%, rgba(255,255,255,1) 75%, rgba(61, 76, 241, 0.15) 100%);
|
||||||
// background-color: #fff;
|
}
|
||||||
// background-size: 100% 100vh;
|
|
||||||
// background-image: url(https://wxapp.xdd618.com/api/file/pic/aiChat/bg.png);
|
|
||||||
// background-repeat: no-repeat;
|
|
||||||
// background-attachment: fixed;
|
|
||||||
.fix-tabbar-header {
|
.fix-tabbar-header {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -90,28 +98,42 @@ page {
|
|||||||
}
|
}
|
||||||
.page-to-bottom {
|
.page-to-bottom {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 180rpx;
|
bottom: 160rpx;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 8;
|
z-index: 8;
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding: 0 24rpx;
|
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
&.focus {
|
&.focus {
|
||||||
transform: translateY(-40rpx);
|
transform: translateY(-40rpx);
|
||||||
}
|
}
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
padding: 24rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
.container-county {
|
||||||
|
justify-content: flex-end;
|
||||||
|
.new-chat {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
.new-chat {
|
.new-chat {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 68rpx;
|
flex-shrink: 0;
|
||||||
|
height: 64rpx;
|
||||||
padding: 0 24rpx;
|
padding: 0 24rpx;
|
||||||
border-radius: 40rpx;
|
margin: 0 20rpx 0 0;
|
||||||
line-height: 68rpx;
|
border-radius: 16rpx;
|
||||||
|
line-height: 64rpx;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
background-color: #fff;
|
color: #fff;
|
||||||
box-shadow: 0rpx 6rpx 12rpx rgba(0,0,0,0.16);
|
background-color: #3D4CF1;
|
||||||
|
box-shadow: 0rpx 0 12rpx rgba(74,74,74,0.2);
|
||||||
.btn-icon {
|
.btn-icon {
|
||||||
display: block;
|
display: block;
|
||||||
width: 40rpx;
|
width: 40rpx;
|
||||||
@@ -119,13 +141,48 @@ page {
|
|||||||
margin: 0 8rpx 0 0;
|
margin: 0 8rpx 0 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.down-icon-wrap {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 0 24rpx 0 0;
|
||||||
|
}
|
||||||
.icon {
|
.icon {
|
||||||
display: block;
|
display: block;
|
||||||
width: 68rpx;
|
flex-shrink: 0;
|
||||||
height: 68rpx;
|
width: 64rpx;
|
||||||
margin: 0 0 0 24rpx;
|
height: 64rpx;
|
||||||
border-radius: 50%;
|
border-radius: 16rpx;
|
||||||
box-shadow: 0rpx 6rpx 12rpx rgba(0,0,0,0.16);
|
background-color: #fff;
|
||||||
|
box-shadow: 0rpx 0 12rpx rgba(74,74,74,0.2);
|
||||||
|
}
|
||||||
|
.bottom-tool-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
height: 64rpx;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
margin: 0 20rpx 0 0;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #333;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0rpx 6rpx 20rpx rgba(74,74,74,0.1);
|
||||||
|
&:last-child {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
&.hide {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.tool-icon {
|
||||||
|
display: block;
|
||||||
|
width: 32rpx;
|
||||||
|
height: 32rpx;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0 12rpx 0 0;
|
||||||
|
background-color: none;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.fix-page-bottom {
|
.fix-page-bottom {
|
||||||
@@ -159,7 +216,7 @@ page {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
height: 100rpx;
|
min-height: 100rpx;
|
||||||
width: calc(100% - 122rpx);
|
width: calc(100% - 122rpx);
|
||||||
padding: 6rpx 6rpx 6rpx 24rpx;
|
padding: 6rpx 6rpx 6rpx 24rpx;
|
||||||
border-radius: 30rpx;
|
border-radius: 30rpx;
|
||||||
@@ -182,11 +239,13 @@ page {
|
|||||||
z-index: 5;
|
z-index: 5;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
|
max-height: 220rpx;
|
||||||
border: 0;
|
border: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
line-height: 88rpx;
|
line-height: 48rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
.placeholder-txt {
|
.placeholder-txt {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -469,7 +528,7 @@ page {
|
|||||||
.txt {
|
.txt {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
padding: 20rpx 32rpx;
|
padding: 20rpx 32rpx;
|
||||||
border-radius: 40rpx 40rpx 0 40rpx;
|
border-radius: 40rpx 0 40rpx 40rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
@@ -487,7 +546,22 @@ page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.item-right-tools {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 20rpx 0 0 0;
|
||||||
|
.btn {
|
||||||
|
display: flex;
|
||||||
|
font-size: 24rpx;
|
||||||
|
.icon {
|
||||||
|
display: block;
|
||||||
|
width: 36rpx;
|
||||||
|
margin: 0 8rpx 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.bottom-btns {
|
.bottom-btns {
|
||||||
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
padding: 20rpx 0 0 0;
|
padding: 20rpx 0 0 0;
|
||||||
@@ -510,6 +584,16 @@ page {
|
|||||||
margin: 0 6rpx 0 0;
|
margin: 0 6rpx 0 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.item2 {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: 0;
|
||||||
|
color: transparent;
|
||||||
|
}
|
||||||
|
.playing {
|
||||||
|
color: #3D4CF1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -920,3 +1004,500 @@ page {
|
|||||||
height: 20rpx;
|
height: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.change-list-wrap {
|
||||||
|
.list-wrap {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
width: 100%;
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 40rpx 0;
|
||||||
|
overflow-x: auto;
|
||||||
|
.product-item {
|
||||||
|
position: relative;
|
||||||
|
width: 240rpx;
|
||||||
|
margin: 0 24rpx 0 0;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0rpx 6rpx 12rpx rgba(0,0,0,0.16);
|
||||||
|
&:last-child {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.img {
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
display: block;
|
||||||
|
width: 240rpx;
|
||||||
|
height: 240rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
.product-info {
|
||||||
|
padding: 12rpx;
|
||||||
|
.name {
|
||||||
|
height: 34rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #333;
|
||||||
|
line-height: 34rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
transition: all linear 0.2s;
|
||||||
|
}
|
||||||
|
.name2 {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.price-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 12rpx;
|
||||||
|
.price {
|
||||||
|
color: #C52733;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
.txt {
|
||||||
|
font-size: 16rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
height: 30rpx;
|
||||||
|
padding: 0 12rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 22rpx;
|
||||||
|
background-color: #C52733;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.desc-wrap {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
line-height: 34rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.hotel-type {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 5;
|
||||||
|
height: 40rpx;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
border-top-left-radius: 20rpx;
|
||||||
|
border-bottom-right-radius: 20rpx;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.prize-list-wrap {
|
||||||
|
display: block;
|
||||||
|
.prize-item {
|
||||||
|
.img {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.change-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 0 0 20rpx 0;
|
||||||
|
.change-btn-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #3D4CF0;
|
||||||
|
font-size: 28rpx;
|
||||||
|
.icon {
|
||||||
|
display: block;
|
||||||
|
width: 32rpx;
|
||||||
|
height: 32rpx;
|
||||||
|
margin: 0 8rpx 0 0;
|
||||||
|
&.rotate {
|
||||||
|
animation: spin-icon 1s linear;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.weather-holiday-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: stretch;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 0 24rpx 48rpx 24rpx;
|
||||||
|
.data-wrap {
|
||||||
|
flex: 1;
|
||||||
|
padding: 20rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0rpx 0rpx 20rpx rgba(0,0,0,0.16);
|
||||||
|
}
|
||||||
|
.weather-data {
|
||||||
|
.title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: #3D4CF1;
|
||||||
|
.icon {
|
||||||
|
display: block;
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
margin: 0 12rpx 0 0;
|
||||||
|
}
|
||||||
|
.tem-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
.tem {
|
||||||
|
font-size: 70rpx;
|
||||||
|
line-height: 70rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.unit {
|
||||||
|
font-size: 36rpx;
|
||||||
|
line-height: 36rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.loca {
|
||||||
|
display: flex;
|
||||||
|
padding: 24rpx 0;
|
||||||
|
font-size: 26rpx;
|
||||||
|
line-height: 36rpx;
|
||||||
|
color: #333;
|
||||||
|
.addr {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.icon {
|
||||||
|
display: block;
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
margin: 0 4rpx 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tem-range {
|
||||||
|
padding: 0 0 0 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content + .content {
|
||||||
|
padding: 12rpx 0 0 0;
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
color: #3D4CF1;
|
||||||
|
font-size: 26rpx;
|
||||||
|
line-height: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.txt-loading {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
min-height: 200rpx;
|
||||||
|
}
|
||||||
|
.no-weather {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100%;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999;
|
||||||
|
line-height: 38rpx;
|
||||||
|
.img {
|
||||||
|
display: block;
|
||||||
|
width: 226rpx;
|
||||||
|
height: 130rpx;
|
||||||
|
margin: 0 0 12rpx 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.holiday-data {
|
||||||
|
.title {
|
||||||
|
display: flex;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #333;
|
||||||
|
line-height: 36rpx;
|
||||||
|
.day {
|
||||||
|
margin: 0 8rpx 0 0;
|
||||||
|
color: #3D4CF1;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.desc {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #333;
|
||||||
|
line-height: 36rpx;
|
||||||
|
}
|
||||||
|
.tip {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
padding: 20rpx 0 0 0;
|
||||||
|
.label {
|
||||||
|
display: block;
|
||||||
|
width: 32rpx;
|
||||||
|
height: 32rpx;
|
||||||
|
margin: 0 12rpx 0 0;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 32rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #fff;
|
||||||
|
background-color: #3D4CF1;
|
||||||
|
}
|
||||||
|
.label2 {
|
||||||
|
background-color: #C52733;
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
width: calc(100% - 44rpx);
|
||||||
|
margin: -6rpx 0 0 0;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.recommend-goods-wrap {
|
||||||
|
width: calc(100% + 48rpx);
|
||||||
|
padding: 24rpx 0;
|
||||||
|
margin: 0 -24rpx;
|
||||||
|
.goods-swiper {
|
||||||
|
width: 100%;
|
||||||
|
height: 750rpx;
|
||||||
|
}
|
||||||
|
.goods-item {
|
||||||
|
display: block;
|
||||||
|
width: 460rpx;
|
||||||
|
margin: 24rpx auto 0 auto;
|
||||||
|
padding: 24rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
box-shadow: 0rpx 0 24rpx rgba(0,0,0,0.16);
|
||||||
|
white-space: normal;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
transform: scale(0.9);
|
||||||
|
opacity: 0.8;
|
||||||
|
&.active {
|
||||||
|
transform: scale(1);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
.supplier {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #666;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
.icon {
|
||||||
|
display: block;
|
||||||
|
width: 28rpx;
|
||||||
|
height: 28rpx;
|
||||||
|
}
|
||||||
|
.s-name {
|
||||||
|
flex: 1;
|
||||||
|
margin: 0 8rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
.p-img {
|
||||||
|
width: 412rpx;
|
||||||
|
height: 412rpx;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
.price {
|
||||||
|
color: #C52733;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
.unit {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.num {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
.btn-buy {
|
||||||
|
width: 160rpx;
|
||||||
|
height: 56rpx;
|
||||||
|
margin: 0 12rpx;
|
||||||
|
line-height: 56rpx;
|
||||||
|
text-align: center;
|
||||||
|
background: #C52733;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-radius: 28rpx;
|
||||||
|
}
|
||||||
|
.btn-gift {
|
||||||
|
width: 160rpx;
|
||||||
|
height: 56rpx;
|
||||||
|
margin: 0 12rpx;
|
||||||
|
line-height: 52rpx;
|
||||||
|
text-align: center;
|
||||||
|
background: #fff;
|
||||||
|
color: #C52733;
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-radius: 28rpx;
|
||||||
|
border: 2rpx solid #C52733;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.order-list-wrap {
|
||||||
|
width: 100%;
|
||||||
|
padding: 24rpx 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.order-item-wrap + .order-item-wrap {
|
||||||
|
margin: 24rpx 0 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin-icon {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: rotate(720deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.gift-steps-wrap {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 80rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.gift-step-title {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 60rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gift-options {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.gift-option-item {
|
||||||
|
width: 48%;
|
||||||
|
height: 72rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background-color: #f2f4ff;
|
||||||
|
color: #333;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
position: relative;
|
||||||
|
transition: all 0.2s;
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
background-color: #3D4CF0;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-check {
|
||||||
|
margin-left: 8rpx;
|
||||||
|
width: 32rpx;
|
||||||
|
height: 32rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.gift-price-input {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
|
||||||
|
.input-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
height: 88rpx;
|
||||||
|
background-color: #f2f4ff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
|
||||||
|
.label {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-budget {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
padding-left: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.gift-step-actions {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.action-btn-group {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
height: 62rpx;
|
||||||
|
line-height: 62rpx;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
|
||||||
|
&-prev {
|
||||||
|
width: 48%;
|
||||||
|
background-color: #fff;
|
||||||
|
color: #3D4CF0;
|
||||||
|
border: 2rpx solid #3D4CF0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-next {
|
||||||
|
width: 48%;
|
||||||
|
background-color: #3D4CF0;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
&.full-width {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-skip {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #3D4CF0;
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -296,3 +296,7 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked {
|
|||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #C2C5CC;
|
color: #C2C5CC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg-color-hui {
|
||||||
|
background-color: #999 !important;
|
||||||
|
}
|
||||||
@@ -127,6 +127,25 @@
|
|||||||
height: 52vh;
|
height: 52vh;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
margin: 30rpx 0;
|
margin: 30rpx 0;
|
||||||
|
|
||||||
|
// 小程序rich-text内块级标签无默认段间距,补充与后台富文本编辑器一致的段落格式
|
||||||
|
rich-text {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
p, div, ul, ol {
|
||||||
|
display: block;
|
||||||
|
margin: 0 0 16rpx;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin: 0 0 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.agree-box {
|
.agree-box {
|
||||||
|
|||||||
@@ -37,6 +37,12 @@ input{line-height: normal; box-sizing:border-box;}
|
|||||||
.line1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width: 100%;}
|
.line1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width: 100%;}
|
||||||
.line2{word-break:break-all;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
|
.line2{word-break:break-all;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
|
||||||
.mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:55;background-color:rgba(0,0,0,0.5);}
|
.mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:55;background-color:rgba(0,0,0,0.5);}
|
||||||
|
.ai-product-window.product-window {
|
||||||
|
z-index: 1002;
|
||||||
|
}
|
||||||
|
.ai-product-window.mask {
|
||||||
|
z-index: 1001;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8231,3 +8231,192 @@ rich-text {
|
|||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.draw-ticket-mask {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 1000;
|
||||||
|
background: rgba(0, 0, 0, 0.45);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 24rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.draw-ticket-popup {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 640rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
padding: 50rpx 40rpx 60rpx;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.draw-ticket-close {
|
||||||
|
position: absolute;
|
||||||
|
top: 30rpx;
|
||||||
|
right: 30rpx;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border: 4rpx solid #333;
|
||||||
|
border-radius: 50%;
|
||||||
|
color: #333;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
z-index: 10;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.draw-ticket-icon {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-icon-box {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-icon-check {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.draw-ticket-title {
|
||||||
|
font-size: 56rpx;
|
||||||
|
color: #222;
|
||||||
|
font-weight: 800;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 24rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card-container {
|
||||||
|
margin-top: 50rpx;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-badge {
|
||||||
|
background-color: #fff9eb;
|
||||||
|
border: 6rpx solid #111;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
padding: 12rpx 40rpx;
|
||||||
|
font-size: 46rpx;
|
||||||
|
font-weight: 800;
|
||||||
|
color: #222;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
margin-bottom: -36rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-badge-arrow {
|
||||||
|
position: absolute;
|
||||||
|
bottom: -22rpx;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-left: 22rpx solid transparent;
|
||||||
|
border-right: 22rpx solid transparent;
|
||||||
|
border-top: 22rpx solid #111;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: -26rpx;
|
||||||
|
left: -16rpx;
|
||||||
|
border-left: 16rpx solid transparent;
|
||||||
|
border-right: 16rpx solid transparent;
|
||||||
|
border-top: 16rpx solid #fff9eb;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card {
|
||||||
|
width: 100%;
|
||||||
|
background: #c23326;
|
||||||
|
border-radius: 36rpx;
|
||||||
|
padding: 70rpx 36rpx 40rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card-subtitle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card-subtitle-text {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
border: 2rpx solid #fff;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
padding: 8rpx 50rpx;
|
||||||
|
letter-spacing: 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card-code-box {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
margin-top: 36rpx;
|
||||||
|
padding: 36rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card-code {
|
||||||
|
color: #c23326;
|
||||||
|
font-size: 72rpx;
|
||||||
|
font-weight: 800;
|
||||||
|
letter-spacing: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticket-card-time {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 30rpx;
|
||||||
|
margin-top: 36rpx;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.draw-ticket-actions {
|
||||||
|
margin-top: 60rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
gap: 20rpx;
|
||||||
|
|
||||||
|
.action-btn {
|
||||||
|
flex: 1;
|
||||||
|
height: 86rpx;
|
||||||
|
border-radius: 44rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
&.home-btn {
|
||||||
|
color: #c23326;
|
||||||
|
border: 2rpx solid #c23326;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.primary {
|
||||||
|
color: #fff;
|
||||||
|
background: #c23326;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
@dark-color: #333333;
|
@dark-color: #333333;
|
||||||
@white-color: #fff;
|
@white-color: #fff;
|
||||||
|
|
||||||
@colors: #C52733, #333333, #fff, #666, #F0F0F0, #999999, #E92727, #FFC543, #69C573;
|
@colors: #C52733, #333333, #fff, #666, #F0F0F0, #999999, #E92727, #FFC543, #69C573, #A5A5A5;
|
||||||
@classnames: primary, dark, white, secondary-dark, grey, dark1, red, yellow, success;
|
@classnames: primary, dark, white, secondary-dark, grey, dark1, red, yellow, success, dark2;
|
||||||
/*=====================================*/
|
/*=====================================*/
|
||||||
|
|
||||||
each(@colors, {
|
each(@colors, {
|
||||||
|
|||||||
@@ -42,9 +42,20 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
goSupplierMini() {
|
goSupplierMini() {
|
||||||
|
// 区分当前小程序环境:正式版跳正式版,体验版/开发版跳体验版
|
||||||
|
let envVersion = 'release'
|
||||||
|
try {
|
||||||
|
const accountInfo = uni.getAccountInfoSync()
|
||||||
|
if (accountInfo && accountInfo.miniProgram && accountInfo.miniProgram.envVersion !== 'release') {
|
||||||
|
envVersion = 'trial'
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
envVersion = 'release'
|
||||||
|
}
|
||||||
uni.navigateToMiniProgram({
|
uni.navigateToMiniProgram({
|
||||||
appId: "wx9ca93d1f2a9c8156",
|
appId: "wx9ca93d1f2a9c8156",
|
||||||
path: "pages/auth/login",
|
path: "pages/auth/login",
|
||||||
|
envVersion,
|
||||||
success(msg) {
|
success(msg) {
|
||||||
console.log("success", msg)
|
console.log("success", msg)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="components-checkbox-icon jc-center ai-center" :class="{'isSelected':isSelected}" @click="change"
|
|
||||||
v-if="ready">
|
|
||||||
<image class="icon-hook" :src="webUrl+'/20240109175325131970.png'" mode="scaleToFill" v-if="isSelected"/>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import {computed, getCurrentInstance, onMounted, ref} from '@vue/composition-api'
|
|
||||||
import {VUE_APP_RESOURCES_URL} from '../config/index'
|
|
||||||
|
|
||||||
const webUrl = VUE_APP_RESOURCES_URL
|
|
||||||
|
|
||||||
const emit = defineEmits(['change'])
|
|
||||||
const {proxy} = getCurrentInstance()
|
|
||||||
const props = defineProps({
|
|
||||||
defaultState: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
mark: Array
|
|
||||||
})
|
|
||||||
|
|
||||||
const ready = ref(false)
|
|
||||||
onMounted(() => {
|
|
||||||
ready.value = true
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
const isSelected = computed(() => {
|
|
||||||
return props.defaultState
|
|
||||||
})
|
|
||||||
const change = () => {
|
|
||||||
emit('change', !isSelected.value, props.mark)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="less">
|
|
||||||
.components-checkbox-icon {
|
|
||||||
display: inline-flex;
|
|
||||||
width: 32rpx;
|
|
||||||
height: 32rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border: 2rpx solid #D5D7D8;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-hook {
|
|
||||||
width: 24rpx;
|
|
||||||
height: 24rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.isSelected {
|
|
||||||
border: 3px solid #FD5749;
|
|
||||||
background: #FD5749;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
class="coupons__cover"
|
class="coupons__cover"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<view @click="selectCoupon" class="check-radio" :class="{'v12-primary': data.checked}">
|
<view @click="selectCoupon" class="check-radio" :class="{'v12-primary': data.checked}" v-if="showRadio">
|
||||||
<radio
|
<radio
|
||||||
v-if="radioModel && data.status === 0"
|
v-if="radioModel && data.status === 0"
|
||||||
:value="data.id"
|
:value="data.id"
|
||||||
@@ -50,6 +50,10 @@
|
|||||||
export default {
|
export default {
|
||||||
name: "Coupons",
|
name: "Coupons",
|
||||||
props: {
|
props: {
|
||||||
|
showRadio: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {
|
default: () => {
|
||||||
|
|||||||
+38
-11
@@ -14,7 +14,8 @@
|
|||||||
@change="changeNav"
|
@change="changeNav"
|
||||||
v-if="showTab"
|
v-if="showTab"
|
||||||
/>
|
/>
|
||||||
<view class="v12-radius-20 v12-white v12-align-center v12-justify-around v12-pa-3" v-else>
|
<!-- 先隐藏 -->
|
||||||
|
<!-- <view class="v12-radius-20 v12-white v12-justify-around v12-pa-3" style="align-items: flex-end;" v-if="!showTab && showRadio">
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="v12-text-center v12-font-28">
|
<view class="v12-text-center v12-font-28">
|
||||||
券后价
|
券后价
|
||||||
@@ -29,7 +30,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="v12-text-center v12-font-44">
|
<view class="v12-text-center v12-font-44">
|
||||||
=
|
<view class="v12-text-center v12-font-28">
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="v12-mt-3 v12-text-center">=</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="v12-text-center v12-font-28">
|
<view class="v12-text-center v12-font-28">
|
||||||
@@ -45,7 +49,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="v12-text-center v12-font-44">
|
<view class="v12-text-center v12-font-44">
|
||||||
-
|
<view class="v12-text-center v12-font-28">
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="v12-mt-3 v12-text-center">-</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="v12-text-center">
|
<view class="v12-text-center">
|
||||||
@@ -55,12 +62,13 @@
|
|||||||
{{ selectItem.couponPrice || 0 }}
|
{{ selectItem.couponPrice || 0 }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<view class="list-box">
|
<view class="list-box">
|
||||||
<view class="larg-one v12-mb-3">
|
<view class="larg-one v12-mb-3">
|
||||||
<Coupons
|
<Coupons
|
||||||
:data="largOne"
|
:data="largOne"
|
||||||
|
:showRadio="showRadio"
|
||||||
:radio-model="current === 0"
|
:radio-model="current === 0"
|
||||||
@change="selectCoupon"
|
@change="selectCoupon"
|
||||||
/>
|
/>
|
||||||
@@ -75,6 +83,7 @@
|
|||||||
>
|
>
|
||||||
<Coupons
|
<Coupons
|
||||||
:data="item"
|
:data="item"
|
||||||
|
:showRadio="showRadio"
|
||||||
:radio-model="current === 0"
|
:radio-model="current === 0"
|
||||||
@change="selectCoupon"
|
@change="selectCoupon"
|
||||||
v-if="index !== maxIndex"
|
v-if="index !== maxIndex"
|
||||||
@@ -93,7 +102,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<button disabled></button>
|
<button disabled></button>
|
||||||
<view
|
<view
|
||||||
v-if="current === 0"
|
v-if="current === 0 && showRadio"
|
||||||
:class="{ 'btn-disabled': current === 1 }"
|
:class="{ 'btn-disabled': current === 1 }"
|
||||||
class="btn-done bold flex jc-center ai-center v12-primary"
|
class="btn-done bold flex jc-center ai-center v12-primary"
|
||||||
@click="setCoupon"
|
@click="setCoupon"
|
||||||
@@ -111,6 +120,10 @@ export default {
|
|||||||
name: 'CouponsPopup',
|
name: 'CouponsPopup',
|
||||||
components: { SubSection, Coupons },
|
components: { SubSection, Coupons },
|
||||||
props: {
|
props: {
|
||||||
|
showRadio: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
twoList: {
|
twoList: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {
|
default: {
|
||||||
@@ -129,6 +142,10 @@ export default {
|
|||||||
id: {
|
id: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
|
},
|
||||||
|
couponId1: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -142,10 +159,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
id: {
|
couponId1: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(value) {
|
handler(value) {
|
||||||
console.log('couponId', value);
|
console.log(value);
|
||||||
|
|
||||||
if(value) {
|
if(value) {
|
||||||
this.selectCoupon(value)
|
this.selectCoupon(value)
|
||||||
}
|
}
|
||||||
@@ -156,7 +174,7 @@ export default {
|
|||||||
list() {
|
list() {
|
||||||
const temp = this.current === 0 ? this.twoList['usable'] : this.twoList['unusable']
|
const temp = this.current === 0 ? this.twoList['usable'] : this.twoList['unusable']
|
||||||
if (this.current === 0) {
|
if (this.current === 0) {
|
||||||
const localCouponId = uni.getStorageSync('couponId') || 0
|
const localCouponId = this.couponId1 || 0
|
||||||
temp.map(item => {
|
temp.map(item => {
|
||||||
item.checked = localCouponId === item.id
|
item.checked = localCouponId === item.id
|
||||||
})
|
})
|
||||||
@@ -180,8 +198,8 @@ export default {
|
|||||||
},
|
},
|
||||||
largOne() {
|
largOne() {
|
||||||
if(this.list[this.maxIndex]) {
|
if(this.list[this.maxIndex]) {
|
||||||
this.selectCoupon(this.list[this.maxIndex].id)
|
// this.selectCoupon(this.list[this.maxIndex].id)
|
||||||
uni.setStorageSync('couponId', this.list[this.maxIndex].id)
|
// uni.setStorageSync('couponId', this.list[this.maxIndex].id)
|
||||||
}
|
}
|
||||||
// this.$emit('max', this.list[this.maxIndex] || {})
|
// this.$emit('max', this.list[this.maxIndex] || {})
|
||||||
return this.list[this.maxIndex] || {}
|
return this.list[this.maxIndex] || {}
|
||||||
@@ -193,7 +211,17 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
|
|
||||||
|
this.couponId = this.couponId1
|
||||||
|
this.selectItem = this.list.find(e => e.id === this.couponId1) || {}
|
||||||
|
// this.$emit('select', this.selectItem)
|
||||||
|
this.list.map(item => {
|
||||||
|
item.checked = this.couponId1 === item.id
|
||||||
|
})
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
|
// uni.setStorageSync('couponId', this.couponId)
|
||||||
|
// this.$emit('change', this.selectItem || {})
|
||||||
|
// this.$emit('ok', this.couponId)
|
||||||
},
|
},
|
||||||
force2Decimal(value) {
|
force2Decimal(value) {
|
||||||
return this.$force2Decimal(value);
|
return this.$force2Decimal(value);
|
||||||
@@ -211,7 +239,6 @@ export default {
|
|||||||
},
|
},
|
||||||
setCoupon() {
|
setCoupon() {
|
||||||
if (this.current === 1) return
|
if (this.current === 1) return
|
||||||
console.log(this.current, '====1=======');
|
|
||||||
uni.setStorageSync('couponId', this.couponId)
|
uni.setStorageSync('couponId', this.couponId)
|
||||||
this.$emit('change', this.selectItem || {})
|
this.$emit('change', this.selectItem || {})
|
||||||
this.$emit('ok', this.couponId)
|
this.$emit('ok', this.couponId)
|
||||||
|
|||||||
@@ -0,0 +1,813 @@
|
|||||||
|
<template>
|
||||||
|
<view class="date-range-picker">
|
||||||
|
<u-popup :show="show" @close="handleClose" mode="center" round="16" closeable>
|
||||||
|
<view class="picker-container">
|
||||||
|
<view class="picker-header">
|
||||||
|
<text class="title">查看可预约日期</text>
|
||||||
|
</view>
|
||||||
|
<view class="v12-align-center v12-justify-between">
|
||||||
|
<view class="v12-my-3">
|
||||||
|
<text class="v12-font-24 v12-dark-text v12-mr-3">请选择入住日期</text>
|
||||||
|
<text class="v12-font-24 v12-primary-text">{{ ` 共计${minBookingDays}天 ` }}</text>
|
||||||
|
</view>
|
||||||
|
<view v-if="originDate" class="v12-font-24 v12-primary-text">
|
||||||
|
原定时间:{{ originDate }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="calendar" @touchstart="onTouchStart" @touchend="onTouchEnd">
|
||||||
|
<view class="calendar-header">
|
||||||
|
<view class="month-nav">
|
||||||
|
<text class="nav-btn" @click="changeMonth(-1)">〈</text>
|
||||||
|
<text class="month-text">{{ currentYear }}年{{ currentMonth + 1 }}月</text>
|
||||||
|
<text class="nav-btn" @click="changeMonth(1)">〉</text>
|
||||||
|
</view>
|
||||||
|
<view class="weekdays">
|
||||||
|
<text v-for="day in ['日', '一', '二', '三', '四', '五', '六']" :key="day" class="weekday v12-dark-text">
|
||||||
|
{{ day }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="calendar-body">
|
||||||
|
<view class="days" :class="[isAnimating ? 'absolute ' + transitionMode + '-enter' : '']">
|
||||||
|
<view
|
||||||
|
v-for="(day, index) in calendarDays"
|
||||||
|
:key="index"
|
||||||
|
class="day"
|
||||||
|
:class="{
|
||||||
|
'empty': !day,
|
||||||
|
'selected': isSelected(day),
|
||||||
|
'in-range': isInRange(day),
|
||||||
|
'start-date': isStartDate(day),
|
||||||
|
'end-date': isEndDate(day),
|
||||||
|
'selecting-start': isSelectingStart(day),
|
||||||
|
'disabled': isDisabled(day),
|
||||||
|
'booked': getDateStatus(day) === '已被预约',
|
||||||
|
'unavailable': getDateStatus(day) === '不可预约',
|
||||||
|
'available': getDateStatus(day) === '可预约'
|
||||||
|
}"
|
||||||
|
@click="selectDate(day)"
|
||||||
|
>
|
||||||
|
<text>{{ day || '' }}</text>
|
||||||
|
<view class="v12-font-20" v-if="day && getDateStatus(day) !== null">{{ getDateStatus(day) }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="days absolute" v-if="isAnimating" :class="[transitionMode + '-leave']">
|
||||||
|
<view
|
||||||
|
v-for="(day, index) in prevMonthDays"
|
||||||
|
:key="'prev-' + index"
|
||||||
|
class="day"
|
||||||
|
:class="{
|
||||||
|
'empty': !day,
|
||||||
|
'selected': isSelected(day, prevYear, prevMonth),
|
||||||
|
'in-range': isInRange(day, prevYear, prevMonth),
|
||||||
|
'start-date': isStartDate(day, prevYear, prevMonth),
|
||||||
|
'end-date': isEndDate(day, prevYear, prevMonth),
|
||||||
|
'selecting-start': isSelectingStart(day, prevYear, prevMonth),
|
||||||
|
'disabled': isDisabled(day, prevYear, prevMonth),
|
||||||
|
'booked': getDateStatus(day, prevYear, prevMonth) === '已被预约',
|
||||||
|
'unavailable': getDateStatus(day, prevYear, prevMonth) === '不可预约',
|
||||||
|
'available': getDateStatus(day, prevYear, prevMonth) === '可预约'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<text>{{ day || '' }}</text>
|
||||||
|
<view class="v12-font-20" v-if="day && getDateStatus(day, prevYear, prevMonth) !== null">{{ getDateStatus(day, prevYear, prevMonth) }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="picker-footer">
|
||||||
|
<button class="btn btn-confirm" @click="confirmSelect">立即预订</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { sojoumOrderCalendar, sojoumOrderCheckDate } from "@/api/sojoumOrder";
|
||||||
|
export default {
|
||||||
|
name: 'DateRangePicker',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
originDate: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
show: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [null, null]
|
||||||
|
},
|
||||||
|
minDate: {
|
||||||
|
type: [String, Date],
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
maxDate: {
|
||||||
|
type: [String, Date],
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
format: {
|
||||||
|
type: String,
|
||||||
|
default: 'YYYY-MM-DD'
|
||||||
|
},
|
||||||
|
travelGroupProductId: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
minBookingDays: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
currentYear: new Date().getFullYear(),
|
||||||
|
currentMonth: new Date().getMonth(),
|
||||||
|
startDate: null,
|
||||||
|
endDate: null,
|
||||||
|
activeCalendar: 'start', // 'start' or 'end'
|
||||||
|
tempStartDate: null,
|
||||||
|
tempEndDate: null,
|
||||||
|
dateStatusMap: {}, // 存储日期状态
|
||||||
|
selectionState: 'initial', // 'initial' | 'selecting' | 'completed'
|
||||||
|
touchStartX: 0,
|
||||||
|
touchStartY: 0,
|
||||||
|
// 动画相关状态
|
||||||
|
isAnimating: false,
|
||||||
|
transitionMode: '', // 'next' or 'prev'
|
||||||
|
prevYear: null,
|
||||||
|
prevMonth: null,
|
||||||
|
prevMonthDays: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
calendarDays() {
|
||||||
|
const days = []
|
||||||
|
const firstDay = new Date(this.currentYear, this.currentMonth, 1)
|
||||||
|
const lastDay = new Date(this.currentYear, this.currentMonth + 1, 0)
|
||||||
|
|
||||||
|
// 填充月初空白天数
|
||||||
|
for (let i = 0; i < firstDay.getDay(); i++) {
|
||||||
|
days.push(null)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填充当月天数
|
||||||
|
for (let i = 1; i <= lastDay.getDate(); i++) {
|
||||||
|
days.push(i)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填充月末空白天数
|
||||||
|
const remainingDays = 42 - days.length // 保持6行固定高度
|
||||||
|
for (let i = 0; i < remainingDays; i++) {
|
||||||
|
days.push(null)
|
||||||
|
}
|
||||||
|
|
||||||
|
return days
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
show(newVal) {
|
||||||
|
if (newVal) {
|
||||||
|
this.initDates()
|
||||||
|
this.getDays()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
currentMonth() {
|
||||||
|
this.getDays()
|
||||||
|
},
|
||||||
|
currentYear() {
|
||||||
|
this.getDays()
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
handler(newVal) {
|
||||||
|
if (newVal && newVal.length === 2) {
|
||||||
|
this.startDate = newVal[0] ? new Date(newVal[0]) : null
|
||||||
|
this.endDate = newVal[1] ? new Date(newVal[1]) : null
|
||||||
|
this.tempStartDate = this.startDate
|
||||||
|
this.tempEndDate = this.endDate
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getDays(){
|
||||||
|
// uni.showLoading({
|
||||||
|
// title: '加载中...',
|
||||||
|
// mask: true,
|
||||||
|
// })
|
||||||
|
sojoumOrderCalendar({
|
||||||
|
travelGroupProductId: this.travelGroupProductId,
|
||||||
|
month: `${this.currentYear}-${String(this.currentMonth + 1).padStart(2, '0')}`
|
||||||
|
}).then(res => {
|
||||||
|
if (res.data) {
|
||||||
|
// 更新日期状态映射,使用合并而不是覆盖,以支持动画时的旧数据显示
|
||||||
|
const newStatusMap = {}
|
||||||
|
res.data.forEach(day => {
|
||||||
|
// inventoryStatus int 状态 (0:可预约, 1:已被预约, 2:不可预约)
|
||||||
|
newStatusMap[day.date] = day.inventoryStatus === 0 ? '可预约' : day.inventoryStatus === 1 ? '已被预约' : '不可预约'
|
||||||
|
})
|
||||||
|
this.dateStatusMap = { ...this.dateStatusMap, ...newStatusMap }
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getDateStatus(day, year, month) {
|
||||||
|
if (!day) return null
|
||||||
|
const date = this.formatDate(this.getDateFromDay(day, year, month))
|
||||||
|
return this.dateStatusMap[date]
|
||||||
|
},
|
||||||
|
|
||||||
|
isDisabled(day, year, month) {
|
||||||
|
|
||||||
|
if (!day) return true
|
||||||
|
const date = this.getDateFromDay(day, year, month)
|
||||||
|
// 禁用过去的日期(今天之前的日期)
|
||||||
|
const today = new Date()
|
||||||
|
today.setHours(0, 0, 0, 0)
|
||||||
|
if (date < today) return true
|
||||||
|
|
||||||
|
// 检查最小和最大日期限制
|
||||||
|
if (this.minDate && date < new Date(this.minDate)) return true
|
||||||
|
if (this.maxDate && date > new Date(this.maxDate)) return true
|
||||||
|
|
||||||
|
// 检查预约状态
|
||||||
|
const status = this.getDateStatus(day, year, month)
|
||||||
|
// 只允许选择可预约的日期(状态为"可预约"),其他状态都禁用
|
||||||
|
|
||||||
|
return status !== '可预约'
|
||||||
|
},
|
||||||
|
initDates() {
|
||||||
|
this.tempStartDate = this.startDate
|
||||||
|
this.tempEndDate = this.endDate
|
||||||
|
|
||||||
|
// 根据当前选择状态设置selectionState
|
||||||
|
if (this.tempStartDate && this.tempEndDate) {
|
||||||
|
this.selectionState = 'completed'
|
||||||
|
this.activeCalendar = 'start'
|
||||||
|
} else if (this.tempStartDate) {
|
||||||
|
this.selectionState = 'selecting'
|
||||||
|
this.activeCalendar = 'end'
|
||||||
|
} else {
|
||||||
|
this.selectionState = 'initial'
|
||||||
|
this.activeCalendar = 'start'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.startDate) {
|
||||||
|
this.currentYear = this.startDate.getFullYear()
|
||||||
|
this.currentMonth = this.startDate.getMonth()
|
||||||
|
} else {
|
||||||
|
const now = new Date()
|
||||||
|
this.currentYear = now.getFullYear()
|
||||||
|
this.currentMonth = now.getMonth()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
changeMonth(delta) {
|
||||||
|
if (this.isAnimating) return
|
||||||
|
|
||||||
|
// Setup animation state
|
||||||
|
this.prevYear = this.currentYear
|
||||||
|
this.prevMonth = this.currentMonth
|
||||||
|
this.prevMonthDays = [...this.calendarDays]
|
||||||
|
this.transitionMode = delta > 0 ? 'next' : 'prev'
|
||||||
|
this.isAnimating = true
|
||||||
|
|
||||||
|
let newMonth = this.currentMonth + delta
|
||||||
|
if (newMonth < 0) {
|
||||||
|
this.currentYear--
|
||||||
|
newMonth = 11
|
||||||
|
} else if (newMonth > 11) {
|
||||||
|
this.currentYear++
|
||||||
|
newMonth = 0
|
||||||
|
}
|
||||||
|
this.currentMonth = newMonth
|
||||||
|
|
||||||
|
// Reset animation state after transition
|
||||||
|
setTimeout(() => {
|
||||||
|
this.isAnimating = false
|
||||||
|
this.prevMonthDays = []
|
||||||
|
}, 300)
|
||||||
|
},
|
||||||
|
|
||||||
|
onTouchStart(e) {
|
||||||
|
if (!e || !e.changedTouches || !e.changedTouches.length) return
|
||||||
|
this.touchStartX = e.changedTouches[0].clientX
|
||||||
|
this.touchStartY = e.changedTouches[0].clientY
|
||||||
|
},
|
||||||
|
|
||||||
|
onTouchEnd(e) {
|
||||||
|
if (!e || !e.changedTouches || !e.changedTouches.length) return
|
||||||
|
const touchEndX = e.changedTouches[0].clientX
|
||||||
|
const touchEndY = e.changedTouches[0].clientY
|
||||||
|
const deltaX = touchEndX - this.touchStartX
|
||||||
|
const deltaY = touchEndY - this.touchStartY
|
||||||
|
if (Math.abs(deltaX) <= Math.abs(deltaY)) return
|
||||||
|
const minDistance = 50
|
||||||
|
if (Math.abs(deltaX) < minDistance) return
|
||||||
|
if (deltaX < 0) {
|
||||||
|
this.changeMonth(1)
|
||||||
|
} else {
|
||||||
|
this.changeMonth(-1)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
formatDate(date) {
|
||||||
|
if (!date) return ''
|
||||||
|
const year = date.getFullYear()
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(date.getDate()).padStart(2, '0')
|
||||||
|
return `${year}-${month}-${day}`
|
||||||
|
},
|
||||||
|
|
||||||
|
getDateFromDay(day, year, month) {
|
||||||
|
const y = year !== undefined ? year : this.currentYear
|
||||||
|
const m = month !== undefined ? month : this.currentMonth
|
||||||
|
return day ? new Date(y, m, day) : null
|
||||||
|
},
|
||||||
|
|
||||||
|
// isDisabled(day) {
|
||||||
|
// if (!day) return true
|
||||||
|
// const date = this.getDateFromDay(day)
|
||||||
|
|
||||||
|
// // 禁用过去的日期(今天之前的日期)
|
||||||
|
// const today = new Date()
|
||||||
|
// today.setHours(0, 0, 0, 0)
|
||||||
|
// if (date < today) return true
|
||||||
|
|
||||||
|
// // 检查最小和最大日期限制
|
||||||
|
// if (this.minDate && date < new Date(this.minDate)) return true
|
||||||
|
// if (this.maxDate && date > new Date(this.maxDate)) return true
|
||||||
|
|
||||||
|
// return false
|
||||||
|
// },
|
||||||
|
|
||||||
|
isSelected(day, year, month) {
|
||||||
|
if (!day) return false
|
||||||
|
// const date = this.getDateFromDay(day, year, month) // Unused?
|
||||||
|
return this.isStartDate(day, year, month) || this.isEndDate(day, year, month)
|
||||||
|
},
|
||||||
|
|
||||||
|
isStartDate(day, year, month) {
|
||||||
|
if (!day || !this.tempStartDate) return false
|
||||||
|
const date = this.getDateFromDay(day, year, month)
|
||||||
|
return date.getTime() === this.tempStartDate.getTime()
|
||||||
|
},
|
||||||
|
|
||||||
|
isEndDate(day, year, month) {
|
||||||
|
if (!day || !this.tempEndDate) return false
|
||||||
|
const date = this.getDateFromDay(day, year, month)
|
||||||
|
return date.getTime() === this.tempEndDate.getTime()
|
||||||
|
},
|
||||||
|
|
||||||
|
isInRange(day, year, month) {
|
||||||
|
if (!day || !this.tempStartDate || !this.tempEndDate) return false
|
||||||
|
const date = this.getDateFromDay(day, year, month)
|
||||||
|
return date > this.tempStartDate && date < this.tempEndDate
|
||||||
|
},
|
||||||
|
|
||||||
|
isSelectingStart(day, year, month) {
|
||||||
|
if (!day || !this.tempStartDate || this.tempEndDate) return false
|
||||||
|
// 只有在选择状态且只有开始日期时才显示特殊样式
|
||||||
|
if (this.selectionState !== 'selecting') return false
|
||||||
|
const date = this.getDateFromDay(day, year, month)
|
||||||
|
return date.getTime() === this.tempStartDate.getTime()
|
||||||
|
},
|
||||||
|
|
||||||
|
selectDate(day, year, month) {
|
||||||
|
if (!day || this.isDisabled(day, year, month)) return
|
||||||
|
|
||||||
|
const selectedDate = this.getDateFromDay(day, year, month)
|
||||||
|
|
||||||
|
// 如果设置了最小预订天数,则自动计算结束日期
|
||||||
|
if (this.minBookingDays > 0) {
|
||||||
|
this.tempStartDate = selectedDate
|
||||||
|
const endDate = new Date(selectedDate)
|
||||||
|
endDate.setDate(selectedDate.getDate() + this.minBookingDays - 1)
|
||||||
|
this.tempEndDate = endDate
|
||||||
|
this.selectionState = 'completed'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果已有完整的日期区间(开始日期和结束日期都存在),重置选择
|
||||||
|
if (this.tempStartDate && this.tempEndDate && this.selectionState === 'completed') {
|
||||||
|
// 重置选择状态,将点击的日期作为新的开始日期
|
||||||
|
this.tempStartDate = selectedDate
|
||||||
|
this.tempEndDate = null
|
||||||
|
this.activeCalendar = 'end'
|
||||||
|
this.selectionState = 'selecting'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果点击已选择的开始日期,则取消选择
|
||||||
|
if (this.tempStartDate && selectedDate.getTime() === this.tempStartDate.getTime()) {
|
||||||
|
this.tempStartDate = null
|
||||||
|
this.tempEndDate = null
|
||||||
|
this.activeCalendar = 'start'
|
||||||
|
this.selectionState = 'initial'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果点击已选择的结束日期,则只清除结束日期
|
||||||
|
if (this.tempEndDate && selectedDate.getTime() === this.tempEndDate.getTime()) {
|
||||||
|
this.tempEndDate = null
|
||||||
|
this.activeCalendar = 'end'
|
||||||
|
this.selectionState = 'selecting'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.activeCalendar === 'start' || this.selectionState === 'initial') {
|
||||||
|
// 选择开始日期
|
||||||
|
this.tempStartDate = selectedDate
|
||||||
|
this.tempEndDate = null
|
||||||
|
this.activeCalendar = 'end'
|
||||||
|
this.selectionState = 'selecting'
|
||||||
|
} else if (this.activeCalendar === 'end') {
|
||||||
|
if (selectedDate < this.tempStartDate) {
|
||||||
|
// 如果选择的结束日期小于开始日期,将其设为开始日期
|
||||||
|
this.tempStartDate = selectedDate
|
||||||
|
this.tempEndDate = null
|
||||||
|
this.selectionState = 'selecting'
|
||||||
|
} else {
|
||||||
|
// 设置结束日期,完成选择
|
||||||
|
this.tempEndDate = selectedDate
|
||||||
|
this.selectionState = 'completed'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
clearDates() {
|
||||||
|
this.tempStartDate = null
|
||||||
|
this.tempEndDate = null
|
||||||
|
this.activeCalendar = 'start'
|
||||||
|
this.selectionState = 'initial'
|
||||||
|
},
|
||||||
|
|
||||||
|
confirmSelect() {
|
||||||
|
// 验证选择的日期数量
|
||||||
|
if (!this.tempStartDate || !this.tempEndDate) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请选择起始和结束日期',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算选择的天数
|
||||||
|
const daysDiff = Math.floor((this.tempEndDate - this.tempStartDate) / (1000 * 60 * 60 * 24)) + 1
|
||||||
|
|
||||||
|
// 必须要选够天数
|
||||||
|
if (daysDiff !== this.minBookingDays) {
|
||||||
|
uni.showToast({
|
||||||
|
title: `此套餐预约需连续选择${this.minBookingDays}天`,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证选择的日期范围内是否包含禁用日期
|
||||||
|
// const currentDate = new Date(this.tempStartDate)
|
||||||
|
// while (currentDate <= this.tempEndDate) {
|
||||||
|
// const day = currentDate.getDate()
|
||||||
|
// if (this.isDisabled(day)) {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: '所选日期范围包含不可预约日期,请重新选择',
|
||||||
|
// icon: 'none'
|
||||||
|
// })
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// currentDate.setDate(currentDate.getDate() + 1)
|
||||||
|
// }
|
||||||
|
sojoumOrderCheckDate({
|
||||||
|
travelGroupProductId: this.travelGroupProductId,
|
||||||
|
orderStartDate: this.formatDate(this.tempStartDate),
|
||||||
|
orderEndDate: this.formatDate(this.tempEndDate)
|
||||||
|
}).then(res => {
|
||||||
|
if (res.status === 200) {
|
||||||
|
// 验证通过,更新日期并关闭弹窗
|
||||||
|
this.startDate = this.tempStartDate
|
||||||
|
this.endDate = this.tempEndDate
|
||||||
|
this.selectionState = 'completed'
|
||||||
|
this.$emit('input', [
|
||||||
|
this.startDate ? this.formatDate(this.startDate) : null,
|
||||||
|
this.endDate ? this.formatDate(this.endDate) : null
|
||||||
|
])
|
||||||
|
this.handleClose(false)
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg || '所选日期范围包含不可预约日期,请重新选择',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
handleClose(shouldClear = false) {
|
||||||
|
if (shouldClear) {
|
||||||
|
this.clearDates()
|
||||||
|
this.startDate = null
|
||||||
|
this.endDate = null
|
||||||
|
this.$emit('input', [null, null])
|
||||||
|
} else {
|
||||||
|
// 恢复到原始状态
|
||||||
|
this.tempStartDate = this.startDate
|
||||||
|
this.tempEndDate = this.endDate
|
||||||
|
if (this.startDate && this.endDate) {
|
||||||
|
this.selectionState = 'completed'
|
||||||
|
} else if (this.startDate) {
|
||||||
|
this.selectionState = 'selecting'
|
||||||
|
} else {
|
||||||
|
this.selectionState = 'initial'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$emit('update:show', false)
|
||||||
|
this.$emit('close')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.date-range-picker {
|
||||||
|
.picker-container {
|
||||||
|
width: 690rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-header {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-display {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
background: #F8F8F8;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
|
||||||
|
.date-input {
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.label {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-bottom: 8rpx;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
|
||||||
|
&.placeholder {
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.separator {
|
||||||
|
margin: 0 20rpx;
|
||||||
|
color: #999999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.calendar {
|
||||||
|
.calendar-header {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
|
.month-nav {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
|
||||||
|
.month-text {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-btn {
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
color: #666666;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.weekdays {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
|
||||||
|
.weekday {
|
||||||
|
width: 14.28%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.days {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
.day {
|
||||||
|
width: 14.28%;
|
||||||
|
height: 80rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
position: relative;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
&:not(.selected):not(.disabled) {
|
||||||
|
color: #4B97EB;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-dot {
|
||||||
|
width: 8rpx;
|
||||||
|
height: 8rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-top: 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.empty {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
color: #CCCCCC;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.selected {
|
||||||
|
background: #C52733;
|
||||||
|
color: #FFFFFF;
|
||||||
|
.status-dot {
|
||||||
|
background: #FFFFFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.selecting-start {
|
||||||
|
background: #4B97EB;
|
||||||
|
color: #FFFFFF;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: -2rpx;
|
||||||
|
left: -2rpx;
|
||||||
|
right: -2rpx;
|
||||||
|
bottom: -2rpx;
|
||||||
|
border: 2rpx solid #4B97EB;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
animation: pulse 1.5s infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-dot {
|
||||||
|
background: #FFFFFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.in-range {
|
||||||
|
background: rgba(197, 39, 51, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.start-date {
|
||||||
|
border-top-left-radius: 8rpx;
|
||||||
|
border-bottom-left-radius: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.end-date {
|
||||||
|
border-top-right-radius: 8rpx;
|
||||||
|
border-bottom-right-radius: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.available .status-dot {
|
||||||
|
background: #4CAF50;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.booked .status-dot {
|
||||||
|
background: #FF9800;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.unavailable .status-dot {
|
||||||
|
background: #F44336;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-footer {
|
||||||
|
margin-top: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
width: 100%;
|
||||||
|
height: 80rpx;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
&.btn-clear {
|
||||||
|
background: #F8F8F8;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.btn-confirm {
|
||||||
|
background: #C52733;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes pulse {
|
||||||
|
0% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
opacity: 0.7;
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Animation Styles
|
||||||
|
.calendar-body {
|
||||||
|
position: relative;
|
||||||
|
height: 480rpx; // 6 rows * 80rpx
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.days.absolute {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
// height: 100%;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Keyframes for sliding
|
||||||
|
@keyframes slide-next-enter {
|
||||||
|
from { transform: translateX(100%); }
|
||||||
|
to { transform: translateX(0); }
|
||||||
|
}
|
||||||
|
@keyframes slide-next-leave {
|
||||||
|
from { transform: translateX(0); }
|
||||||
|
to { transform: translateX(-100%); }
|
||||||
|
}
|
||||||
|
@keyframes slide-prev-enter {
|
||||||
|
from { transform: translateX(-100%); }
|
||||||
|
to { transform: translateX(0); }
|
||||||
|
}
|
||||||
|
@keyframes slide-prev-leave {
|
||||||
|
from { transform: translateX(0); }
|
||||||
|
to { transform: translateX(100%); }
|
||||||
|
}
|
||||||
|
|
||||||
|
.next-enter { animation: slide-next-enter 0.3s forwards; }
|
||||||
|
.next-leave { animation: slide-next-leave 0.3s forwards; }
|
||||||
|
.prev-enter { animation: slide-prev-enter 0.3s forwards; }
|
||||||
|
.prev-leave { animation: slide-prev-leave 0.3s forwards; }
|
||||||
|
</style>
|
||||||
@@ -82,7 +82,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
routerGo(cart) {
|
routerGo(cart) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/shop/GoodsEvaluate/index",
|
path: "/pagesShop/shop/GoodsEvaluate/index",
|
||||||
query: { id: cart.unique }
|
query: { id: cart.unique }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="product-window" :class="attr.cartAttr === true ? 'on' : ''" :style="{paddingBottom: paddingBottom}">
|
<view
|
||||||
|
:class="[{ on: attr.cartAttr === true }, className]"
|
||||||
|
:style="{ paddingBottom: paddingBottom }"
|
||||||
|
class="product-window"
|
||||||
|
>
|
||||||
<view class="textpic acea-row row-between-wrapper">
|
<view class="textpic acea-row row-between-wrapper">
|
||||||
<view class="pictrue" @click="previewImg(attrObj.productSelect.image)">
|
<view class="pictrue" @click="previewImg(attrObj.productSelect.image)">
|
||||||
<image :src="attrObj.productSelect.image" class="image" />
|
<image :src="attrObj.productSelect.image" class="image" />
|
||||||
@@ -31,8 +35,7 @@
|
|||||||
v-for="(subItem, subIndex) in item.attrValue"
|
v-for="(subItem, subIndex) in item.attrValue"
|
||||||
:key="subIndex"
|
:key="subIndex"
|
||||||
:class="{
|
:class="{
|
||||||
'actived': subItem.check,
|
'actived': subItem.check
|
||||||
'disabled': !subItem.canUsed
|
|
||||||
}"
|
}"
|
||||||
class="itemn v12-radius-40"
|
class="itemn v12-radius-40"
|
||||||
@click="tapAttr(index, subIndex, subItem)"
|
@click="tapAttr(index, subIndex, subItem)"
|
||||||
@@ -45,7 +48,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="cart v12-justify-between v12-align-center">
|
<view class="cart v12-justify-between v12-align-center">
|
||||||
<view class="titlev12-dark-text f12-font-32">购买数量</view>
|
<view class="titlev12-dark-text f12-font-32">购买数量</view>
|
||||||
<view class="carnum acea-row row-left">
|
<view v-if="!hideQuantityControls" class="carnum acea-row row-left">
|
||||||
<view style="border-radius: 40rpx 0rpx 0rpx 40rpx" class="cart-btn item reduce v12-font-36 v12-font-bold v12-white-text v12-dark1 v12-dark1-border" :class="cartNum <= 1 ? 'on' : ''" @click="CartNumDes">-</view>
|
<view style="border-radius: 40rpx 0rpx 0rpx 40rpx" class="cart-btn item reduce v12-font-36 v12-font-bold v12-white-text v12-dark1 v12-dark1-border" :class="cartNum <= 1 ? 'on' : ''" @click="CartNumDes">-</view>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
@@ -66,25 +69,32 @@
|
|||||||
@click="CartNumAdd"
|
@click="CartNumAdd"
|
||||||
>+</view>
|
>+</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else class="v12-font-28 v12-dark-text">x1</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="v12-px-2 v12-mt-3" v-if="showOk">
|
<view class="v12-px-2 v12-mt-3" v-if="showOk">
|
||||||
<u-button
|
<u-button
|
||||||
shape="circle"
|
shape="circle"
|
||||||
color="#C52733"
|
:color="(attr.productSelect.stock === 0 && attr.cartAttr) ? '#9D9D9D' : '#C52733'"
|
||||||
@click="$emit('ok')"
|
@click="$emit('ok')"
|
||||||
:disabled="(attr.productSelect.stock === 0 && attr.cartAttr)"
|
:disabled="(attr.productSelect.stock === 0 && attr.cartAttr)"
|
||||||
>加入购物车</u-button>
|
>{{ okText }}</u-button>
|
||||||
</view>
|
</view>
|
||||||
<view class="v12-px-2 v12-mt-3" v-if="isGift">
|
<view class="v12-px-2 v12-mt-3" v-if="isGift">
|
||||||
<u-button
|
<u-button
|
||||||
shape="circle"
|
shape="circle"
|
||||||
color="#C52733"
|
:color="(attr.productSelect.stock === 0 && attr.cartAttr) ? '#9D9D9D' : '#C52733'"
|
||||||
@click="$emit('gift')"
|
@click="$emit('gift')"
|
||||||
:disabled="(attr.productSelect.stock === 0 && attr.cartAttr)"
|
:disabled="(attr.productSelect.stock === 0 && attr.cartAttr)"
|
||||||
>送给朋友</u-button>
|
>送给朋友</u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view>
|
<view
|
||||||
|
:hidden="attr.cartAttr === false"
|
||||||
|
:class="className"
|
||||||
|
class="mask"
|
||||||
|
@touchmove.prevent
|
||||||
|
@click="closeAttr"
|
||||||
|
></view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -118,6 +128,18 @@ export default {
|
|||||||
cartNum: {
|
cartNum: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: () => 1
|
default: () => 1
|
||||||
|
},
|
||||||
|
okText: {
|
||||||
|
type: String,
|
||||||
|
default: '加入购物车'
|
||||||
|
},
|
||||||
|
className: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
hideQuantityControls: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -130,12 +152,22 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
'attr.cartAttr': {
|
||||||
|
handler(val) {
|
||||||
|
console.log(val);
|
||||||
|
if(!val) {
|
||||||
|
this.cartNumber = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true
|
||||||
|
},
|
||||||
cartNum: {
|
cartNum: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
console.log(val, 'cardNum');
|
|
||||||
this.cartNumber = val || 1
|
this.cartNumber = val || 1
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true,
|
||||||
|
immediate: true
|
||||||
},
|
},
|
||||||
cartNumber(val) {
|
cartNumber(val) {
|
||||||
if (val > this.attrObj.productSelect.stock) {
|
if (val > this.attrObj.productSelect.stock) {
|
||||||
@@ -173,7 +205,7 @@ export default {
|
|||||||
this.$emit("changeFun", { action: "changeattr", value: false })
|
this.$emit("changeFun", { action: "changeattr", value: false })
|
||||||
},
|
},
|
||||||
CartNumDes() {
|
CartNumDes() {
|
||||||
if(this.cartNumber === 1) return
|
if(this.cartNumber <= 1) return
|
||||||
console.log(this.cartNumber, 'cartNumber');
|
console.log(this.cartNumber, 'cartNumber');
|
||||||
this.cartNumber--
|
this.cartNumber--
|
||||||
this.$emit("changeFun", { action: "ChangeCartNum", value: this.cartNumber })
|
this.$emit("changeFun", { action: "ChangeCartNum", value: this.cartNumber })
|
||||||
@@ -185,9 +217,9 @@ export default {
|
|||||||
},
|
},
|
||||||
tapAttr(index, subIndex, subItem) {
|
tapAttr(index, subIndex, subItem) {
|
||||||
// 缺货的点击了没效果
|
// 缺货的点击了没效果
|
||||||
if (!subItem.canUsed || subItem.check) {
|
// if (!subItem.canUsed || subItem.check) {
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
this.attrObj.productAttr[index].attrValue.map((subItem, subIdx) => {
|
this.attrObj.productAttr[index].attrValue.map((subItem, subIdx) => {
|
||||||
subItem.check= false
|
subItem.check= false
|
||||||
if (subIndex === subIdx) {
|
if (subIndex === subIdx) {
|
||||||
@@ -222,6 +254,15 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scope>
|
<style scope>
|
||||||
|
.btn-car-disabled {
|
||||||
|
border: 2rpx solid #9D9D9D !important;
|
||||||
|
color: #9D9D9D !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-buy-disabled {
|
||||||
|
background: #9D9D9D !important;
|
||||||
|
color: #FFFFFF !important;
|
||||||
|
}
|
||||||
.itemn{
|
.itemn{
|
||||||
margin: 28rpx 0 0 34rpx !important;
|
margin: 28rpx 0 0 34rpx !important;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
|||||||
+141
-33
@@ -3,13 +3,14 @@
|
|||||||
<view
|
<view
|
||||||
v-for="(item, evaluateWtapperIndex) in reply"
|
v-for="(item, evaluateWtapperIndex) in reply"
|
||||||
:key="evaluateWtapperIndex"
|
:key="evaluateWtapperIndex"
|
||||||
class="evaluateItem"
|
class="evaluateItem v12-pt-3"
|
||||||
>
|
>
|
||||||
<view class="pic-text acea-row row-middle">
|
<!-- 用户信息头部 -->
|
||||||
<view class="pictrue">
|
<view class="user-header v12-px-4">
|
||||||
<image :src="item.avatar" class="image" />
|
<view class="avatar-box">
|
||||||
|
<image :src="item.avatar" class="avatar" mode="aspectFill" />
|
||||||
</view>
|
</view>
|
||||||
<view class="acea-row row-middle">
|
<view class="user-info">
|
||||||
<view class="name line1">{{ item.nickname }}</view>
|
<view class="name line1">{{ item.nickname }}</view>
|
||||||
<view class="time">{{ item.createTime }}</view>
|
<view class="time">{{ item.createTime }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -18,8 +19,13 @@
|
|||||||
<view class="v12-secondary-dark-text v12-font-24 attr-bg"> {{ item.sku }}</view>
|
<view class="v12-secondary-dark-text v12-font-24 attr-bg"> {{ item.sku }}</view>
|
||||||
<view class="start" :class="'star' + item.star"></view>
|
<view class="start" :class="'star' + item.star"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="evaluate-infor v12-font-24">{{ item.comment }}</view>
|
|
||||||
<view class="imgList acea-row">
|
<!-- 评论内容 -->
|
||||||
|
<view class="evaluate-infor">{{ item.comment || '此用户没有填写评价'}}</view>
|
||||||
|
|
||||||
|
<!-- 图片/视频列表 -->
|
||||||
|
<view class="imgList">
|
||||||
|
<!-- 视频 -->
|
||||||
<view v-if="item.video" class="pictrue">
|
<view v-if="item.video" class="pictrue">
|
||||||
<view
|
<view
|
||||||
@click="pauseOtherVideo('video' + evaluateWtapperIndex)"
|
@click="pauseOtherVideo('video' + evaluateWtapperIndex)"
|
||||||
@@ -32,37 +38,39 @@
|
|||||||
v-if="activeVideo !== 'video' + evaluateWtapperIndex"
|
v-if="activeVideo !== 'video' + evaluateWtapperIndex"
|
||||||
:src="item.video + '?vframe/jpg/offset/1'"
|
:src="item.video + '?vframe/jpg/offset/1'"
|
||||||
class="image"
|
class="image"
|
||||||
|
mode="aspectFill"
|
||||||
@click="pauseOtherVideo('video' + evaluateWtapperIndex)"
|
@click="pauseOtherVideo('video' + evaluateWtapperIndex)"
|
||||||
>
|
/>
|
||||||
|
|
||||||
</image>
|
|
||||||
<video
|
<video
|
||||||
v-else
|
v-else
|
||||||
:src="item.video"
|
:src="item.video"
|
||||||
:poster="item.video + '?vframe/jpg/offset/1'"
|
:poster="item.video + '?vframe/jpg/offset/1'"
|
||||||
controls
|
controls
|
||||||
autoplay
|
autoplay
|
||||||
play-btn-position="center"
|
|
||||||
:id="'video' + evaluateWtapperIndex"
|
|
||||||
class="image"
|
class="image"
|
||||||
|
:id="'video' + evaluateWtapperIndex"
|
||||||
@play="pauseOtherVideo('video' + evaluateWtapperIndex)"
|
@play="pauseOtherVideo('video' + evaluateWtapperIndex)"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 图片 -->
|
||||||
<view
|
<view
|
||||||
v-for="(itemn, eq) in item.picturesArr"
|
v-for="(pic, idx) in item.picturesArr"
|
||||||
:key="eq"
|
:key="idx"
|
||||||
class="pictrue"
|
class="pictrue"
|
||||||
>
|
>
|
||||||
<image :src="itemn" class="image" @click="previewImage(item.picturesArr, eq)" />
|
<image :src="pic" class="image" mode="aspectFill" @click="previewImage(item.picturesArr, idx)" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 商家回复 -->
|
||||||
<view class="reply" v-if="item.merchantReplyContent">
|
<view class="reply" v-if="item.merchantReplyContent">
|
||||||
<span class="font-color-red">店小二</span>
|
<text class="font-color-red">店小二</text>
|
||||||
:{{item.merchantReplyContent}}
|
:{{item.merchantReplyContent}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { dataFormat } from "@/utils";
|
import { dataFormat } from "@/utils";
|
||||||
|
|
||||||
@@ -105,28 +113,128 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
.evaluateWtapper {
|
||||||
|
.evaluateItem {
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
border-bottom: 1px solid #f5f5f5;
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
|
||||||
|
.avatar-box {
|
||||||
|
margin-right: 20rpx;
|
||||||
|
.avatar {
|
||||||
|
width: 70rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-info {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-row {
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
.default-tag {
|
||||||
|
display: inline-block;
|
||||||
|
background: #FFF0F1;
|
||||||
|
color: #FE5261;
|
||||||
|
font-size: 20rpx;
|
||||||
|
padding: 4rpx 12rpx;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.star-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
.star-icon {
|
||||||
|
margin-right: 4rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.evaluate-infor {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
line-height: 1.6;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imgList {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
.pictrue {
|
||||||
|
width: 220rpx;
|
||||||
|
height: 220rpx;
|
||||||
|
margin-right: 15rpx;
|
||||||
|
margin-bottom: 15rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
background: #f5f5f5;
|
||||||
|
|
||||||
|
&:nth-child(3n) {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.play-icon {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.reply {
|
||||||
|
background: #F5F5F5;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #666;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
.attr-bg{
|
.attr-bg{
|
||||||
background: rgba(197,39,51,0.1);
|
background: rgba(197,39,51,0.1);
|
||||||
padding: 7rpx 5px;
|
padding: 7rpx 5px;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
}
|
}
|
||||||
.time{
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
.evaluateWtapper .evaluateItem .imgList .pictrue{
|
|
||||||
position: relative;
|
|
||||||
width: 300rpx;
|
|
||||||
.play-icon {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
margin: auto;
|
|
||||||
width: 80rpx;
|
|
||||||
height: 80rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -13,12 +13,26 @@
|
|||||||
import {
|
import {
|
||||||
getAiSystemInfoSetting
|
getAiSystemInfoSetting
|
||||||
} from '@/api/public'
|
} from '@/api/public'
|
||||||
|
import {
|
||||||
|
getCountyAiDetail
|
||||||
|
} from '@/api/chat/index'
|
||||||
export default {
|
export default {
|
||||||
name: 'AiEntrance',
|
name: 'AiEntrance',
|
||||||
|
props: {
|
||||||
|
cityName: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
countyId: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showImg: false,
|
showImg: false,
|
||||||
settingInfo: {}
|
settingInfo: {},
|
||||||
|
localCityName: uni.getStorageSync('locationCityName') || ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -26,6 +40,19 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
|
if (this.countyId) {
|
||||||
|
getCountyAiDetail({
|
||||||
|
countyId: this.countyId
|
||||||
|
}).then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
const aiImage = data.aiImage || ''
|
||||||
|
this.settingInfo.mainImage = aiImage
|
||||||
|
this.showImg = !!aiImage
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
getAiSystemInfoSetting().then(res => {
|
getAiSystemInfoSetting().then(res => {
|
||||||
const { success, data } = res
|
const { success, data } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
@@ -36,7 +63,7 @@ export default {
|
|||||||
},
|
},
|
||||||
enterAiChat() {
|
enterAiChat() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/aiChat/views/index?click=1'
|
url: '/aiChat/views/index?click=1&cityName=' + (this.cityName || this.localCityName) + '&countyId=' + (this.countyId || '')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,485 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="c_total">资讯评论</view>
|
||||||
|
<template v-if="dataList && dataList.length">
|
||||||
|
<view class="c_comment" v-for="(item1, index1) in dataList" :key="item1.id">
|
||||||
|
<!-- 一级评论 -->
|
||||||
|
<CommonComp
|
||||||
|
:data="item1"
|
||||||
|
@likeClick="() => likeClick({ item1, index1 })"
|
||||||
|
@replyClick="() => replyClick({ item1, index1 })"
|
||||||
|
@deleteClick="() => deleteClick({ item1, index1 })"
|
||||||
|
/>
|
||||||
|
<view class="children_item" v-if="item1.children && item1.children.length">
|
||||||
|
<!-- 二级评论 -->
|
||||||
|
<CommonComp
|
||||||
|
v-for="(item2, index2) in item1.childrenShow"
|
||||||
|
:key="item2.id"
|
||||||
|
:data="item2"
|
||||||
|
:pData="item1"
|
||||||
|
@likeClick="() => likeClick({ item1, index1, item2, index2 })"
|
||||||
|
@replyClick="() => replyClick({ item1, index1, item2, index2 })"
|
||||||
|
@deleteClick="() => deleteClick({ item1, index1, item2, index2 })"
|
||||||
|
/>
|
||||||
|
<!-- 展开二级评论 -->
|
||||||
|
<view
|
||||||
|
class="expand_reply"
|
||||||
|
v-if="expandTxtShow({ item1, index1 })"
|
||||||
|
@tap="() => expandReplyFun({ item1, index1 })"
|
||||||
|
>
|
||||||
|
<span class="txt"> 展开{{ item1.children.length - item1.childrenShow.length }}条回复 </span>
|
||||||
|
<uni-icons type="down" size="24" color="#007aff"></uni-icons>
|
||||||
|
</view>
|
||||||
|
<!-- 折叠二级评论 -->
|
||||||
|
<view
|
||||||
|
class="shrink_reply"
|
||||||
|
v-if="shrinkTxtShow({ item1, index1 })"
|
||||||
|
@tap="() => shrinkReplyFun({ item1, index1 })"
|
||||||
|
>
|
||||||
|
<span class="txt"> 收起回复内容 </span>
|
||||||
|
<uni-icons type="up" size="24" color="#007aff"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<!-- 空盒子 -->
|
||||||
|
<view class="empty_box" v-else>
|
||||||
|
<uni-icons type="chatboxes" size="36" color="#c0c0c0"></uni-icons>
|
||||||
|
<view>
|
||||||
|
<span class="txt"> 这里是一片荒草地, </span>
|
||||||
|
<span class="txt click" @click="() => newCommentFun()">说点什么...</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 评论弹窗 -->
|
||||||
|
<uni-popup ref="cPopupRef" type="bottom" @change="popChange">
|
||||||
|
<view class="c_popup_box">
|
||||||
|
<view class="reply_text">
|
||||||
|
<template v-if="Object.keys(replyTemp).length">
|
||||||
|
<span class="text_aid">回复给</span>
|
||||||
|
<img
|
||||||
|
class="user_avatar"
|
||||||
|
:src="replyTemp.item2 ? replyTemp.item2.user_avatar : replyTemp.item1.user_avatar"
|
||||||
|
/>
|
||||||
|
<span class="text_main">{{ replyTemp.item2 ? replyTemp.item2.user_name : replyTemp.item1.user_name }}</span>
|
||||||
|
</template>
|
||||||
|
<span v-else class="text_main">发表新评论</span>
|
||||||
|
</view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="text_area">
|
||||||
|
<uni-easyinput
|
||||||
|
class="text_area"
|
||||||
|
type="textarea"
|
||||||
|
v-model="commentValue"
|
||||||
|
:placeholder="commentPlaceholder"
|
||||||
|
:focus="focus"
|
||||||
|
trim
|
||||||
|
autoHeight
|
||||||
|
maxlength="300"
|
||||||
|
></uni-easyinput>
|
||||||
|
</view>
|
||||||
|
<view class="send_btn" @tap="() => sendClick()">发送</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
<!-- 删除弹窗 -->
|
||||||
|
<uni-popup ref="delPopupRef" type="dialog">
|
||||||
|
<uni-popup-dialog
|
||||||
|
mode="base"
|
||||||
|
title=""
|
||||||
|
content="确定删除这条评论吗?"
|
||||||
|
:before-close="true"
|
||||||
|
@close="delCloseFun"
|
||||||
|
@confirm="delConfirmFun"
|
||||||
|
></uni-popup-dialog>
|
||||||
|
</uni-popup>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import CommonComp from "./componets/common";
|
||||||
|
export default {
|
||||||
|
components: { CommonComp },
|
||||||
|
props: {
|
||||||
|
/** 登陆用户信息
|
||||||
|
* id: number // 登陆用户id
|
||||||
|
* user_name: number // 登陆用户名
|
||||||
|
* user_avatar: string // 登陆用户头像地址
|
||||||
|
*/
|
||||||
|
myInfo: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {},
|
||||||
|
},
|
||||||
|
/** 文章作者信息
|
||||||
|
* id: number // 文章作者id
|
||||||
|
* user_name: number // 文章作者名
|
||||||
|
* user_avatar: string // 文章作者头像地址
|
||||||
|
*/
|
||||||
|
userInfo: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {},
|
||||||
|
},
|
||||||
|
/** 评论列表
|
||||||
|
* id: number // 评论id
|
||||||
|
* parent_id: number // 父级评论id
|
||||||
|
* reply_id: number // 被回复人评论id
|
||||||
|
* reply_name: string // 被回复人名称
|
||||||
|
* user_name: string // 用户名
|
||||||
|
* user_avatar: string // 评论者头像地址
|
||||||
|
* user_content: string // 评论内容
|
||||||
|
* is_like: boolean // 是否点赞
|
||||||
|
* like_count: number // 点赞数统计
|
||||||
|
* create_time: string // 创建时间
|
||||||
|
*/
|
||||||
|
tableData: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
// 评论总数
|
||||||
|
tableTotal: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
// 评论删除模式
|
||||||
|
// bind - 当被删除的一级评论存在回复评论, 那么该评论内容变更显示为[当前评论内容已被移除]
|
||||||
|
// only - 仅删除当前评论(后端删除相关联的回复评论, 否则总数显示不对)
|
||||||
|
// all - 删除所有评论包括回复评论
|
||||||
|
deleteMode: {
|
||||||
|
type: String,
|
||||||
|
default: "all",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dataList: [], // 渲染数据(前端的格式)
|
||||||
|
replyTemp: {}, // 回复临时数据
|
||||||
|
isNewComment: false, // 是否为新评论
|
||||||
|
focus: false, // 评论弹窗
|
||||||
|
commentValue: "", // 输入框值
|
||||||
|
commentPlaceholder: "说点什么...", // 输入框占位符
|
||||||
|
delTemp: {}, // 删除临时数据
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
tableData: {
|
||||||
|
handler(newVal) {
|
||||||
|
if (newVal.length !== this.dataList.length) {
|
||||||
|
this.dataList = this.treeTransForm(newVal);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
// 数据转换
|
||||||
|
treeTransForm(data) {
|
||||||
|
let newData = JSON.parse(JSON.stringify(data));
|
||||||
|
let result = [];
|
||||||
|
let map = {};
|
||||||
|
newData.forEach((item, i) => {
|
||||||
|
item.owner = item.user_id === this.myInfo.user_id; // 是否为当前登陆用户 可以对自己的评论进行删除 不能回复
|
||||||
|
item.author = item.user_id === this.userInfo.user_id; // 是否为作者 显示标记
|
||||||
|
map[item.id] = item;
|
||||||
|
});
|
||||||
|
newData.forEach((item) => {
|
||||||
|
let parent = map[item.parent_id];
|
||||||
|
if (parent) {
|
||||||
|
(parent.children || (parent.children = [])).push(item); // 所有回复
|
||||||
|
if (parent.children.length === 1) {
|
||||||
|
(parent.childrenShow = []).push(item); // 显示的回复
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
result.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
// 点赞
|
||||||
|
setLike(item) {
|
||||||
|
item.is_like = !item.is_like;
|
||||||
|
item.like_count = item.is_like ? item.like_count + 1 : item.like_count - 1;
|
||||||
|
},
|
||||||
|
likeClick({ item1, index1, item2, index2 }) {
|
||||||
|
let item = item2 || item1;
|
||||||
|
this.setLike(item);
|
||||||
|
this.$emit("likeFun", { params: item }, (res) => {
|
||||||
|
// 请求后端失败, 重置点赞
|
||||||
|
setLike(item);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 回复
|
||||||
|
replyClick({ item1, index1, item2, index2 }) {
|
||||||
|
this.replyTemp = JSON.parse(JSON.stringify({ item1, index1, item2, index2 }));
|
||||||
|
this.$refs["cPopupRef"].open();
|
||||||
|
},
|
||||||
|
// 发起新评论
|
||||||
|
newCommentFun() {
|
||||||
|
this.isNewComment = true;
|
||||||
|
this.$refs["cPopupRef"].open();
|
||||||
|
},
|
||||||
|
// 评论弹窗
|
||||||
|
popChange(e) {
|
||||||
|
// 关闭弹窗
|
||||||
|
if (!e.show) {
|
||||||
|
this.commentValue = ""; // 清空输入框值
|
||||||
|
this.replyTemp = {}; // 清空被回复人信息
|
||||||
|
this.isNewComment = false; // 恢复是否为新评论默认值
|
||||||
|
}
|
||||||
|
this.focus = e.show;
|
||||||
|
},
|
||||||
|
// 发送评论
|
||||||
|
sendClick({ item1, index1, item2, index2 } = this.replyTemp) {
|
||||||
|
let item = item2 || item1;
|
||||||
|
let params = {};
|
||||||
|
// 新评论
|
||||||
|
if (this.isNewComment) {
|
||||||
|
params = {
|
||||||
|
id: Math.random(), // 评论id
|
||||||
|
parent_id: null, // 父级评论id
|
||||||
|
reply_id: null, // 被回复评论id
|
||||||
|
reply_name: null, // 被回复人名称
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// 回复评论
|
||||||
|
params = {
|
||||||
|
id: Math.random(), // 评论id
|
||||||
|
parent_id: item?.parent_id ?? item.id, // 父级评论id
|
||||||
|
reply_id: item.id, // 被回复评论id
|
||||||
|
reply_name: item.user_name, // 被回复人名称
|
||||||
|
};
|
||||||
|
}
|
||||||
|
params = {
|
||||||
|
...params,
|
||||||
|
user_id: this.myInfo.user_id, // 用户id
|
||||||
|
user_name: this.myInfo.user_name, // 用户名
|
||||||
|
user_avatar: this.myInfo.user_avatar, // 用户头像地址
|
||||||
|
user_content: this.commentValue, // 用户评论内容
|
||||||
|
is_like: false, // 是否点赞
|
||||||
|
like_count: 0, // 点赞数统计
|
||||||
|
create_time: "刚刚", // 创建时间
|
||||||
|
owner: true, // 是否为所有者 所有者可以进行删除 管理员默认true
|
||||||
|
};
|
||||||
|
|
||||||
|
uni.showLoading({
|
||||||
|
title: "正在发送",
|
||||||
|
mask: true,
|
||||||
|
});
|
||||||
|
this.$emit("replyFun", { params }, (res) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
// 拿到后端返回的id赋值, 因为删除要用到id
|
||||||
|
params = { ...params, id: res.id };
|
||||||
|
// 新评论
|
||||||
|
if (this.isNewComment) {
|
||||||
|
this.dataList.push(params);
|
||||||
|
} else {
|
||||||
|
// 回复
|
||||||
|
let c_data = this.dataList[index1];
|
||||||
|
(c_data.children || (c_data.children = [])).push(params);
|
||||||
|
// 如果已展开所有回复, 那么此时插入children长度会大于childrenShow长度1, 所以就直接展开显示即可
|
||||||
|
if (c_data.children.length === (c_data.childrenShow || (c_data.childrenShow = [])).length + 1) {
|
||||||
|
c_data.childrenShow.push(params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$emit("update:tableTotal", this.tableTotal + 1);
|
||||||
|
this.$refs["cPopupRef"].close();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//删除
|
||||||
|
deleteClick({ item1, index1, item2, index2 }) {
|
||||||
|
this.delTemp = JSON.parse(JSON.stringify({ item1, index1, item2, index2 }));
|
||||||
|
this.$refs["delPopupRef"].open();
|
||||||
|
},
|
||||||
|
// 关闭删除弹窗
|
||||||
|
delCloseFun() {
|
||||||
|
this.delTemp = {};
|
||||||
|
this.$refs["delPopupRef"].close();
|
||||||
|
},
|
||||||
|
// 确定删除
|
||||||
|
delConfirmFun({ item1, index1, item2, index2 } = this.delTemp) {
|
||||||
|
const deleteMode = this.deleteMode;
|
||||||
|
let c_data = this.dataList[index1];
|
||||||
|
uni.showLoading({
|
||||||
|
title: "正在删除",
|
||||||
|
mask: true,
|
||||||
|
});
|
||||||
|
// 删除二级评论
|
||||||
|
if (index2 >= 0) {
|
||||||
|
this.$emit("deleteFun", { params: [c_data.children[index2].id], mode: deleteMode }, (res) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
this.$emit("update:tableTotal", this.tableTotal - 1);
|
||||||
|
c_data.children.splice(index2, 1);
|
||||||
|
c_data.childrenShow.splice(index2, 1);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 删除一级评论
|
||||||
|
if (c_data?.children?.length) {
|
||||||
|
// 如果一级评论包含回复评论
|
||||||
|
switch (deleteMode) {
|
||||||
|
case "bind":
|
||||||
|
// 一级评论内容展示修改为: 当前评论内容已被移除
|
||||||
|
this.$emit(
|
||||||
|
"deleteFun",
|
||||||
|
{
|
||||||
|
params: [c_data.id],
|
||||||
|
mode: deleteMode,
|
||||||
|
},
|
||||||
|
(res) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
c_data.user_content = "当前评论内容已被移除";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case "only":
|
||||||
|
// 后端自行根据删除的一级评论id, 查找关联的子评论进行删除
|
||||||
|
this.$emit(
|
||||||
|
"deleteFun",
|
||||||
|
{
|
||||||
|
params: [c_data.id],
|
||||||
|
mode: deleteMode,
|
||||||
|
},
|
||||||
|
(res) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
this.$emit("update:tableTotal", this.tableTotal - c_data.children.length + 1);
|
||||||
|
this.dataList.splice(index1, 1);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// all
|
||||||
|
// 收集子评论id, 提交给后端统一删除
|
||||||
|
let delIdArr = [c_data.id];
|
||||||
|
c_data.children.forEach((_, i) => {
|
||||||
|
delIdArr.push(_.id);
|
||||||
|
});
|
||||||
|
this.$emit("deleteFun", { params: delIdArr, mode: deleteMode }, (res) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
this.$emit("update:tableTotal", this.tableTotal - c_data.children.length + 1);
|
||||||
|
this.dataList.splice(index1, 1);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 一级评论无回复, 直接删除
|
||||||
|
this.$emit("deleteFun", { params: [c_data.id], mode: deleteMode }, (res) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
this.$emit("update:tableTotal", this.tableTotal - 1);
|
||||||
|
this.dataList.splice(index1, 1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.delCloseFun();
|
||||||
|
},
|
||||||
|
// 展开评论if
|
||||||
|
expandTxtShow({ item1, index1 }) {
|
||||||
|
return item1.childrenShow?.length && item1.children.length - item1.childrenShow.length;
|
||||||
|
},
|
||||||
|
// 展开更多评论
|
||||||
|
expandReplyFun({ item1, index1 }) {
|
||||||
|
let csLen = this.dataList[index1].childrenShow.length;
|
||||||
|
this.dataList[index1].childrenShow.push(
|
||||||
|
...this.dataList[index1].children.slice(csLen, csLen + 6) // 截取5条评论
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
// 收起评论if
|
||||||
|
shrinkTxtShow({ item1, index1 }) {
|
||||||
|
return item1.childrenShow?.length >= 2 && item1.children.length - item1.childrenShow.length === 0;
|
||||||
|
},
|
||||||
|
// 收起更多评论
|
||||||
|
shrinkReplyFun({ item1, index1 }) {
|
||||||
|
this.dataList[index1].childrenShow = [];
|
||||||
|
this.dataList[index1].childrenShow.push(
|
||||||
|
...this.dataList[index1].children.slice(0, 1) // 截取1条评论
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
////////////////////////
|
||||||
|
.center {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
////////////////////////
|
||||||
|
.c_total {
|
||||||
|
padding: 20rpx 30rpx 0 30rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
.empty_box {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 150rpx 10rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
.txt {
|
||||||
|
color: $uni-text-color-disable;
|
||||||
|
}
|
||||||
|
.click {
|
||||||
|
color: $uni-color-primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.c_comment {
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
.children_item {
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
margin-left: 80rpx;
|
||||||
|
background-color: $uni-bg-color-grey;
|
||||||
|
.expand_reply,
|
||||||
|
.shrink_reply {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
margin-left: 80rpx;
|
||||||
|
.txt {
|
||||||
|
font-weight: 600;
|
||||||
|
color: $uni-color-primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.c_popup_box {
|
||||||
|
background-color: #fff;
|
||||||
|
.reply_text {
|
||||||
|
@extend .center;
|
||||||
|
padding: 20rpx 20rpx 0 20rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
.text_aid {
|
||||||
|
color: $uni-text-color-grey;
|
||||||
|
margin-right: 5rpx;
|
||||||
|
}
|
||||||
|
.user_avatar {
|
||||||
|
width: 48rpx;
|
||||||
|
height: 48rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 6rpx;
|
||||||
|
margin-left: 12rpx;
|
||||||
|
}
|
||||||
|
.text_main {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
@extend .center;
|
||||||
|
.text_area {
|
||||||
|
flex: 1;
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
.send_btn {
|
||||||
|
@extend .center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 120rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #fff;
|
||||||
|
background-color: $uni-color-primary;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
margin-left: 5rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,182 @@
|
|||||||
|
<template>
|
||||||
|
<view class="comment_item">
|
||||||
|
<view class="top">
|
||||||
|
<view class="top_left">
|
||||||
|
<img class="user_avatar" :src="data.user_avatar" />
|
||||||
|
<uni-tag v-if="data.author" class="tag" type="primary" :inverted="false" text="作者" size="mini" circle />
|
||||||
|
<span class="user_name">{{ data.user_name }}</span>
|
||||||
|
<span class="user_name">{{ cReplyName }}</span>
|
||||||
|
</view>
|
||||||
|
<view class="top_right" @click="likeClick(data)">
|
||||||
|
<span :class="[data.is_like ? 'active' : '', 'like_count']">{{ cLikeCount }}</span>
|
||||||
|
<uni-icons v-show="data.is_like" type="hand-up-filled" size="24" color="#007aff"></uni-icons>
|
||||||
|
<uni-icons v-show="!data.is_like" type="hand-up" size="24" color="#999"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="content" @click="replyClick(data)">
|
||||||
|
{{ c_content }}
|
||||||
|
<span class="shrink" v-if="isShrink" @click.stop="expandContentFun(data.user_content)">...展开</span>
|
||||||
|
<span
|
||||||
|
class="shrink"
|
||||||
|
v-if="!isShrink && user_content.length > contentShowLength"
|
||||||
|
@click.stop="shrinkContentFun(data.user_content)"
|
||||||
|
>
|
||||||
|
收起</span
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
<view class="bottom">
|
||||||
|
<span class="create_time">{{ data.create_time }}</span>
|
||||||
|
<span v-if="data.owner" class="delete" @click="deleteClick(data)">删除</span>
|
||||||
|
<!-- <span v-else class="reply" @click="replyClick(props.data)"
|
||||||
|
>回复</span
|
||||||
|
> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
// 评论数据
|
||||||
|
data: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 评论过长处理
|
||||||
|
contentShowLength: 70, // 默认显示评论字符
|
||||||
|
user_content: "",
|
||||||
|
isShrink: false, // 是否收缩评论
|
||||||
|
c_content: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
// 被回复人名称
|
||||||
|
cReplyName: function () {
|
||||||
|
return this.data?.reply_name ? ` ▸ ` + this.data?.reply_name : "";
|
||||||
|
},
|
||||||
|
// 点赞数显示
|
||||||
|
cLikeCount: function () {
|
||||||
|
return this.data.like_count === 0 ? "" : this.$formatCount(this.data.like_count);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
// 删除变更显示定制
|
||||||
|
"data.user_content": function (newVal, oldVal) {
|
||||||
|
if (newVal !== oldVal) {
|
||||||
|
this.c_content = newVal;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 监听isShrink变化,更新c_content
|
||||||
|
isShrink: function (newVal) {
|
||||||
|
this.c_content = newVal ? this.user_content.slice(0, this.contentShowLength + 1) : this.user_content;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 展开文字
|
||||||
|
expandContentFun() {
|
||||||
|
this.isShrink = false;
|
||||||
|
},
|
||||||
|
// 收起文字
|
||||||
|
shrinkContentFun() {
|
||||||
|
this.isShrink = true;
|
||||||
|
},
|
||||||
|
// 点赞
|
||||||
|
likeClick(item) {
|
||||||
|
this.$emit("likeClick", item);
|
||||||
|
},
|
||||||
|
// 回复
|
||||||
|
replyClick(item) {
|
||||||
|
// 自己不能回复自己
|
||||||
|
if (item.owner) return;
|
||||||
|
this.$emit("replyClick", item);
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
deleteClick(item) {
|
||||||
|
this.$emit("deleteClick", item);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.user_content = this.data.user_content;
|
||||||
|
this.isShrink = this.user_content.length > this.contentShowLength;
|
||||||
|
this.c_content = this.isShrink ? this.user_content.slice(0, this.contentShowLength + 1) : this.user_content;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
////////////////////
|
||||||
|
.center {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.ellipsis {
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
////////////////////
|
||||||
|
.comment_item {
|
||||||
|
font-size: 28rpx;
|
||||||
|
.top {
|
||||||
|
@extend .center;
|
||||||
|
justify-content: space-between;
|
||||||
|
.top_left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
overflow: hidden;
|
||||||
|
.user_avatar {
|
||||||
|
width: 68rpx;
|
||||||
|
height: 68rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 12rpx;
|
||||||
|
}
|
||||||
|
.tag {
|
||||||
|
margin-right: 6rpx;
|
||||||
|
}
|
||||||
|
.user_name {
|
||||||
|
@extend .ellipsis;
|
||||||
|
max-width: 180rpx;
|
||||||
|
color: #8c8c8c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.top_right {
|
||||||
|
@extend .center;
|
||||||
|
.like_count {
|
||||||
|
color: #8c8c8c;
|
||||||
|
&.active {
|
||||||
|
color: #007aff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
padding: 10rpx;
|
||||||
|
margin-left: 70rpx;
|
||||||
|
color: #333;
|
||||||
|
&:active {
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
}
|
||||||
|
.shrink {
|
||||||
|
padding: 20rpx 20rpx 20rpx 0rpx;
|
||||||
|
color: #007aff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bottom {
|
||||||
|
padding-left: 80rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
.create_time {
|
||||||
|
color: #8c8c8c;
|
||||||
|
}
|
||||||
|
.delete {
|
||||||
|
padding: 20rpx 20rpx 0 20rpx;
|
||||||
|
color: #c0c0c0;
|
||||||
|
}
|
||||||
|
.reply {
|
||||||
|
color: #007aff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,343 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<view class="upload">
|
|
||||||
<block v-for="(upload,index) in uploads" :key="index">
|
|
||||||
<view class="uplode-file">
|
|
||||||
<image v-if="types == 'image'" class="uploade-img" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'" :src="upload" :data-src="upload" @tap="previewImage"></image>
|
|
||||||
<image v-if="types == 'image'" class="clear-one-icon" :src="clearIcon" @tap="delImage(index)"></image>
|
|
||||||
<video v-if="types == 'video'" class="uploade-img" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'" :src="upload" controls>
|
|
||||||
<cover-image v-if="types == 'video'" class="clear-one-icon" :src="clearIcon" @tap="delImage(index)"></cover-image>
|
|
||||||
</video>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
<view v-if="uploads.length < uploadCount" :class="uploadIcon ? 'uploader-icon' : 'uploader-input-box'" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'" >
|
|
||||||
<view v-if="!uploadIcon" class="uploader-input" @tap="chooseUploads"></view>
|
|
||||||
<image v-else class="image-cion" :src="uploadIcon" @tap="chooseUploads"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- <button type="primary" v-if="types == 'image' && !autoUpload" @tap="unifiedUpload">上传</button> -->
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default{
|
|
||||||
props: {
|
|
||||||
header:{
|
|
||||||
type:Object,
|
|
||||||
default:{}
|
|
||||||
},
|
|
||||||
types: {
|
|
||||||
type: String,
|
|
||||||
default: 'image'
|
|
||||||
},
|
|
||||||
dataList: {
|
|
||||||
type: Array,
|
|
||||||
default: function() {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
clearIcon: {
|
|
||||||
type: String,
|
|
||||||
default: 'http://img1.imgtn.bdimg.com/it/u=451604666,2295832001&fm=26&gp=0.jpg'
|
|
||||||
},
|
|
||||||
uploadIcon: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
uploadUrl: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
deleteUrl: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
uploadCount: {
|
|
||||||
type: Number,
|
|
||||||
default: 1
|
|
||||||
},
|
|
||||||
//上传图片大小 默认3M
|
|
||||||
upload_max: {
|
|
||||||
type: Number,
|
|
||||||
default: 3
|
|
||||||
},
|
|
||||||
//上传视频大小 默认30M
|
|
||||||
upload_video_max: {
|
|
||||||
type: Number,
|
|
||||||
default: 50
|
|
||||||
},
|
|
||||||
// 图片/选择宽高
|
|
||||||
upload_img_wh: {
|
|
||||||
type: Number,
|
|
||||||
default: 210
|
|
||||||
},
|
|
||||||
autoUpload: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data(){
|
|
||||||
return {
|
|
||||||
//上传的图片地址
|
|
||||||
uploadImages: [],
|
|
||||||
//展示的图片地址
|
|
||||||
uploads: [],
|
|
||||||
// 超出限制数组
|
|
||||||
exceeded_list: [],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch:{
|
|
||||||
dataList:{
|
|
||||||
handler(val){
|
|
||||||
this.uploads = val;
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
previewImage (e) {
|
|
||||||
var current = e.target.dataset.src
|
|
||||||
uni.previewImage({
|
|
||||||
current: current,
|
|
||||||
urls: this.dataList
|
|
||||||
})
|
|
||||||
},
|
|
||||||
chooseUploads(){
|
|
||||||
switch (this.types){
|
|
||||||
case 'image':
|
|
||||||
uni.chooseImage({
|
|
||||||
count: this.uploadCount - this.uploads.length, //默认9
|
|
||||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
||||||
sourceType: ['album', 'camera'], //从相册选择
|
|
||||||
success: (res) => {
|
|
||||||
for(let i = 0; i< res.tempFiles.length; i++){
|
|
||||||
if(Math.ceil(res.tempFiles[i].size / 1024) < this.upload_max * 1024){
|
|
||||||
this.uploads.push(res.tempFiles[i].path)
|
|
||||||
console.log(this.uploads);
|
|
||||||
if(this.autoUpload){
|
|
||||||
this.uploadFile(res.tempFiles[i].path)
|
|
||||||
}else{
|
|
||||||
this.uploadImages.push(res.tempFiles[i].path);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
this.exceeded_list.push(i === 0 ? 1 : i + 1);
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: `第${[...new Set(this.exceeded_list)].join(',')}张图片超出限制${this.upload_max}MB,已过滤`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
uni.showModal({
|
|
||||||
content: JSON.stringify(err)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'video' :
|
|
||||||
uni.chooseVideo({
|
|
||||||
sourceType: ['camera', 'album'],
|
|
||||||
success: (res) => {
|
|
||||||
if(Math.ceil(res.size / 1024) < this.upload_video_max * 1024){
|
|
||||||
this.uploads.push(res.tempFilePath)
|
|
||||||
uni.uploadFile({
|
|
||||||
url: this.uploadUrl, //仅为示例,非真实的接口地址
|
|
||||||
filePath: res.tempFilePath,
|
|
||||||
name: 'file',
|
|
||||||
//请求参数
|
|
||||||
formData: {
|
|
||||||
'user': 'test'
|
|
||||||
},
|
|
||||||
success: (uploadFileRes) => {
|
|
||||||
this.$emit('successVideo',uploadFileRes)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}else {
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: `第${[...new Set(this.exceeded_list)].join(',')}张视频超出限制${this.upload_max}MB,已过滤`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
uni.showModal({
|
|
||||||
content: JSON.stringify(err)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
delImage(index){
|
|
||||||
|
|
||||||
this.uploads.splice(index,1)
|
|
||||||
//如果不自动上传
|
|
||||||
if(!this.autoUpload){
|
|
||||||
this.uploadImages.splice(index,1)
|
|
||||||
}
|
|
||||||
|
|
||||||
// //第一个是判断app或者h5的 第二个是判断小程序的
|
|
||||||
// if(this.uploads[index].substring(0,4) !== 'http' || this.uploads[index].substring(0,11) == 'http://tmp/'){
|
|
||||||
// this.uploads.splice(index,1)
|
|
||||||
// //如果不自动上传
|
|
||||||
// if(!this.autoUpload){
|
|
||||||
// this.uploadImages.splice(index,1)
|
|
||||||
// }
|
|
||||||
// return;
|
|
||||||
// };
|
|
||||||
|
|
||||||
// if(!this.deleteUrl) {
|
|
||||||
// uni.showModal({
|
|
||||||
// content: '请填写删除接口'
|
|
||||||
// });
|
|
||||||
// return;
|
|
||||||
// };
|
|
||||||
// uni.request({
|
|
||||||
// url: this.deleteUrl,
|
|
||||||
// method: 'DELETE',
|
|
||||||
// data: {
|
|
||||||
// image: this.dataList[index]
|
|
||||||
// },
|
|
||||||
// success: res => {
|
|
||||||
// if(res.data.status == 1) {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '删除成功'
|
|
||||||
// })
|
|
||||||
// this.uploads.splice(index,1)
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
},
|
|
||||||
uploadFile(path){
|
|
||||||
// uni.uploadFile({
|
|
||||||
// url: this.uploadUrl, //仅为示例,非真实的接口地址
|
|
||||||
// filePath: path,
|
|
||||||
// name: 'file',
|
|
||||||
// //自定义请求参数
|
|
||||||
// formData: {
|
|
||||||
// 'user': 'test'
|
|
||||||
// },
|
|
||||||
// success: (uploadFileRes) => {
|
|
||||||
// this.$emit('successImage',uploadFileRes)
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
uni.uploadFile({
|
|
||||||
url: this.uploadUrl,
|
|
||||||
filePath: path,
|
|
||||||
header: this.header,
|
|
||||||
name: "file",
|
|
||||||
success: res => {
|
|
||||||
console.log(res);
|
|
||||||
|
|
||||||
this.$emit('successImage',uploadFileRes)
|
|
||||||
},
|
|
||||||
fail: err => {
|
|
||||||
|
|
||||||
console.log(err);
|
|
||||||
|
|
||||||
},
|
|
||||||
complete: res => {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
unifiedUpload(){
|
|
||||||
if(!this.uploadUrl) {
|
|
||||||
uni.showModal({
|
|
||||||
content: '请填写上传接口'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
};
|
|
||||||
for (let i of this.uploadImages) {
|
|
||||||
this.uploadFile(i)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.upload {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
.uplode-file {
|
|
||||||
margin: 10rpx;
|
|
||||||
/* width: 210upx;
|
|
||||||
height: 210upx; */
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.uploade-img {
|
|
||||||
display: block;
|
|
||||||
/* width: 210upx;
|
|
||||||
height: 210upx; */
|
|
||||||
}
|
|
||||||
.clear-one{
|
|
||||||
position: absolute;
|
|
||||||
top: -10rpx;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
.clear-one-icon{
|
|
||||||
position: absolute;
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 9;
|
|
||||||
}
|
|
||||||
.uploader-input-box {
|
|
||||||
position: relative;
|
|
||||||
margin:10upx;
|
|
||||||
/* width: 208upx;
|
|
||||||
height: 208upx; */
|
|
||||||
border: 2upx solid #D9D9D9;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.uploader-input-box:before,
|
|
||||||
.uploader-input-box:after {
|
|
||||||
content: " ";
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
-webkit-transform: translate(-50%, -50%);
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
background-color: #D9D9D9;
|
|
||||||
}
|
|
||||||
.uploader-input-box:before {
|
|
||||||
width: 4upx;
|
|
||||||
height: 79upx;
|
|
||||||
}
|
|
||||||
.uploader-input-box:after {
|
|
||||||
width: 79upx;
|
|
||||||
height: 4upx;
|
|
||||||
}
|
|
||||||
.uploader-input-box:active {
|
|
||||||
border-color: #999999;
|
|
||||||
}
|
|
||||||
.uploader-input-box:active:before,
|
|
||||||
.uploader-input-box:active:after {
|
|
||||||
background-color: #999999;
|
|
||||||
}
|
|
||||||
.uploader-input {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 1;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
.uploader-icon{
|
|
||||||
position: relative;
|
|
||||||
margin:10upx;
|
|
||||||
/* width: 208upx;
|
|
||||||
height: 208upx; */
|
|
||||||
}
|
|
||||||
.uploader-icon .image-cion{
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
### easy-upload 组件
|
|
||||||
|
|
||||||
使用方法
|
|
||||||
```js
|
|
||||||
<easy-upload
|
|
||||||
:dataList="dataList"
|
|
||||||
uploadUrl="http://localhost:3000/upload"
|
|
||||||
deleteUrl='http://localhost:3000/upload'
|
|
||||||
:types="types"
|
|
||||||
@successImage="successImage"
|
|
||||||
@successVideo="successvideo"
|
|
||||||
/>
|
|
||||||
|
|
||||||
//使用 hbuilderX (easycom) 可以直接使用 或
|
|
||||||
import easyUpload from '@/components/easy-upload/easy-upload.vue'
|
|
||||||
export default {
|
|
||||||
//用easycom 则省略注册组件
|
|
||||||
components:{
|
|
||||||
easyUpload
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dataList: [],
|
|
||||||
types: 'image'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
| 参数 | 类型 | 是否必填 | 参数描述
|
|
||||||
| ---- | ---- | ---- | ----
|
|
||||||
| types | String | 否 | 上传类型 image/video
|
|
||||||
| autoUpload | Boolean | 否 | 自动上传 默认false
|
|
||||||
| dataList | Array | 否 | 图片/视频数据展示
|
|
||||||
| clearIcon | String | 否 | 删除图标(可以换成自己的图片)
|
|
||||||
| uploadIcon | String | 否 | 上传图标(可以换成自己的图片)
|
|
||||||
| uploadUrl | String | 否 | 上传的接口
|
|
||||||
| deleteUrl | String | 否 | 删除的接口
|
|
||||||
| uploadCount | Number | 否 | 上传图片最大个数(默认为一张)
|
|
||||||
| upload_max | Number | 否 | 上传大小(默认为3M)
|
|
||||||
| upload_max | Number | 否 | 上传大小(默认为3M)
|
|
||||||
| upload_max | Number | 否 | 上传大小(默认为3M)
|
|
||||||
|
|
||||||
| 事件 | 是否必填 | 参数描述
|
|
||||||
| ---- | ---- | ----
|
|
||||||
| successImage | 否 | 上传图片成功事件
|
|
||||||
| successVideo | 否 | 上传视频成功回调
|
|
||||||
|
|
||||||
示例项目中有简单的服务端代码 /server (node.js)
|
|
||||||
如果本地测试可以先运行一下服务端的代码
|
|
||||||
|
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
<template>
|
||||||
|
<u-popup
|
||||||
|
:show="showShare"
|
||||||
|
mode="center"
|
||||||
|
bgColor="transparent"
|
||||||
|
closeable
|
||||||
|
@close="closeShare"
|
||||||
|
>
|
||||||
|
<view class="box-share">
|
||||||
|
<view class="box-img">
|
||||||
|
<image :src="posterUrl" class="main-img" mode="widthFix" />
|
||||||
|
</view>
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/20230608112210135038.png'"
|
||||||
|
mode="widthFix"
|
||||||
|
class="btn"
|
||||||
|
@click="saveImg"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
|
posterUrl: '',
|
||||||
|
showShare: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
closeShare() {
|
||||||
|
this.showShare = false
|
||||||
|
},
|
||||||
|
showView(url) {
|
||||||
|
this.posterUrl = url
|
||||||
|
this.showShare = true
|
||||||
|
},
|
||||||
|
saveImg() {
|
||||||
|
const _this = this
|
||||||
|
uni.getSetting({
|
||||||
|
success: getRes => {
|
||||||
|
if (getRes.authSetting["scope.writePhotosAlbum"]) {
|
||||||
|
_this.downloadImage()
|
||||||
|
} else {
|
||||||
|
uni.authorize({
|
||||||
|
scope: "scope.writePhotosAlbum",
|
||||||
|
success: () => {
|
||||||
|
_this.downloadImage()
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni.openSetting({
|
||||||
|
success: openRes => {
|
||||||
|
console.log(typeof openRes, openRes)
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请在设置中打开对应权限",
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.log(err, 2)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
downloadImage() {
|
||||||
|
const _this = this
|
||||||
|
const randomID = () => Math.random().toString(36).substring(2)
|
||||||
|
uni.downloadFile({
|
||||||
|
url: this.posterUrl, // 网络图片的地址
|
||||||
|
filePath: wx.env.USER_DATA_PATH + "/share_" + randomID() + ".png", // 指定的本地文件路径
|
||||||
|
success: downRes => {
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: downRes.filePath, // 临时文件地址
|
||||||
|
success: function () {
|
||||||
|
uni.showToast({
|
||||||
|
title: "保存成功",
|
||||||
|
icon: "success",
|
||||||
|
success() {
|
||||||
|
_this.showShare = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: function (err) {
|
||||||
|
uni.showToast({
|
||||||
|
title: err,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: function (err) {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.errMsg,
|
||||||
|
icon: "error"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.box-share {
|
||||||
|
width: 600rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.box-img {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
width: 100%;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,143 +0,0 @@
|
|||||||
/* eslint-disable */
|
|
||||||
var provinceData = [{
|
|
||||||
"label": "北京市",
|
|
||||||
"value": "11"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "天津市",
|
|
||||||
"value": "12"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "河北省",
|
|
||||||
"value": "13"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "山西省",
|
|
||||||
"value": "14"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "内蒙古自治区",
|
|
||||||
"value": "15"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "辽宁省",
|
|
||||||
"value": "21"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "吉林省",
|
|
||||||
"value": "22"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "黑龙江省",
|
|
||||||
"value": "23"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "上海市",
|
|
||||||
"value": "31"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "江苏省",
|
|
||||||
"value": "32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "浙江省",
|
|
||||||
"value": "33"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "安徽省",
|
|
||||||
"value": "34"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "福建省",
|
|
||||||
"value": "35"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "江西省",
|
|
||||||
"value": "36"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "山东省",
|
|
||||||
"value": "37"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "河南省",
|
|
||||||
"value": "41"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "湖北省",
|
|
||||||
"value": "42"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "湖南省",
|
|
||||||
"value": "43"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "广东省",
|
|
||||||
"value": "44"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "广西壮族自治区",
|
|
||||||
"value": "45"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "海南省",
|
|
||||||
"value": "46"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "重庆市",
|
|
||||||
"value": "50"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "四川省",
|
|
||||||
"value": "51"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "贵州省",
|
|
||||||
"value": "52"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "云南省",
|
|
||||||
"value": "53"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "西藏自治区",
|
|
||||||
"value": "54"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "陕西省",
|
|
||||||
"value": "61"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "甘肃省",
|
|
||||||
"value": "62"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "青海省",
|
|
||||||
"value": "63"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "宁夏回族自治区",
|
|
||||||
"value": "64"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "新疆维吾尔自治区",
|
|
||||||
"value": "65"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "台湾",
|
|
||||||
"value": "66"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "香港",
|
|
||||||
"value": "67"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "澳门",
|
|
||||||
"value": "68"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "钓鱼岛",
|
|
||||||
"value": "69"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
export default provinceData;
|
|
||||||
@@ -1,381 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="simple-address" v-if="showPopup" @touchmove.stop.prevent="clear">
|
|
||||||
<!-- 遮罩层 -->
|
|
||||||
<view
|
|
||||||
class="simple-address-mask"
|
|
||||||
@touchmove.stop.prevent="clear"
|
|
||||||
v-if="maskClick"
|
|
||||||
:class="[ani + '-mask', animation ? 'mask-ani' : '']"
|
|
||||||
:style="{
|
|
||||||
'background-color': maskBgColor
|
|
||||||
}"
|
|
||||||
@tap="hideMask(true)"
|
|
||||||
></view>
|
|
||||||
|
|
||||||
<view class="simple-address-content simple-address--fixed" :class="[type, ani + '-content', animation ? 'content-ani' : '']">
|
|
||||||
<view class="simple-address__header">
|
|
||||||
<view class="simple-address__header-btn-box" @click="pickerCancel"><text class="simple-address__header-text">取消</text></view>
|
|
||||||
<view class="simple-address__header-btn-box" @click="pickerConfirm"><text class="simple-address__header-text" :style="{ color: themeColor }">确定</text></view>
|
|
||||||
</view>
|
|
||||||
<view class="simple-address__box">
|
|
||||||
<picker-view indicator-style="height: 70rpx;" class="simple-address-view" :value="pickerValue" @change="pickerChange">
|
|
||||||
<picker-view-column>
|
|
||||||
<!-- #ifndef APP-NVUE -->
|
|
||||||
<view class="picker-item" v-for="(item, index) in provinceDataList" :key="index">{{ item.label }}</view>
|
|
||||||
<!-- #endif -->
|
|
||||||
<!-- #ifdef APP-NVUE -->
|
|
||||||
<text class="picker-item" v-for="(item, index) in provinceDataList" :key="index">{{ item.label }}</text>
|
|
||||||
<!-- #endif -->
|
|
||||||
</picker-view-column>
|
|
||||||
<picker-view-column>
|
|
||||||
<!-- #ifndef APP-NVUE -->
|
|
||||||
<view class="picker-item" v-for="(item, index) in cityDataList" :key="index">{{ item.label }}</view>
|
|
||||||
<!-- #endif -->
|
|
||||||
<!-- #ifdef APP-NVUE -->
|
|
||||||
<text class="picker-item" v-for="(item, index) in cityDataList" :key="index">{{ item.label }}</text>
|
|
||||||
<!-- #endif -->
|
|
||||||
</picker-view-column>
|
|
||||||
<picker-view-column>
|
|
||||||
<!-- #ifndef APP-NVUE -->
|
|
||||||
<view class="picker-item" v-for="(item, index) in areaDataList" :key="index">{{ item.label }}</view>
|
|
||||||
<!-- #endif -->
|
|
||||||
<!-- #ifdef APP-NVUE -->
|
|
||||||
<text class="picker-item" v-for="(item, index) in areaDataList" :key="index">{{ item.label }}</text>
|
|
||||||
<!-- #endif -->
|
|
||||||
</picker-view-column>
|
|
||||||
</picker-view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import provinceData from './city-data/province.js';
|
|
||||||
import cityData from './city-data/city.js';
|
|
||||||
import areaData from './city-data/area.js';
|
|
||||||
export default {
|
|
||||||
name: 'simpleAddress',
|
|
||||||
props: {
|
|
||||||
mode: {
|
|
||||||
// 地址类型
|
|
||||||
// default 则代表老版本根据index索引获取数据
|
|
||||||
//
|
|
||||||
type: String,
|
|
||||||
default: 'default'
|
|
||||||
},
|
|
||||||
// 开启动画
|
|
||||||
animation: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
/* 弹出层类型,可选值;
|
|
||||||
bottom:底部弹出层
|
|
||||||
*/
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: 'bottom'
|
|
||||||
},
|
|
||||||
// maskClick
|
|
||||||
maskClick: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
show: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
maskBgColor: {
|
|
||||||
type: String,
|
|
||||||
default: 'rgba(0, 0, 0, 0.4)' //背景颜色 rgba(0, 0, 0, 0.4) 为空则调用 uni.scss
|
|
||||||
},
|
|
||||||
themeColor: {
|
|
||||||
type: String,
|
|
||||||
default: '' // 主题色
|
|
||||||
},
|
|
||||||
/* 默认值 */
|
|
||||||
pickerValueDefault: {
|
|
||||||
type: Array,
|
|
||||||
default() {
|
|
||||||
return [0, 0, 0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
ani: '',
|
|
||||||
showPopup: false,
|
|
||||||
pickerValue: [0, 0, 0],
|
|
||||||
provinceDataList: [],
|
|
||||||
cityDataList: [],
|
|
||||||
areaDataList: []
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
show(newValue) {
|
|
||||||
if (newValue) {
|
|
||||||
this.open();
|
|
||||||
} else {
|
|
||||||
this.close();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
pickerValueDefault() {
|
|
||||||
this.init();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.init();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init() {
|
|
||||||
this.handPickValueDefault(); // 对 pickerValueDefault 做兼容处理
|
|
||||||
this.provinceDataList = provinceData;
|
|
||||||
this.cityDataList = cityData[this.pickerValueDefault[0]];
|
|
||||||
this.areaDataList = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]];
|
|
||||||
this.pickerValue = this.pickerValueDefault;
|
|
||||||
},
|
|
||||||
handPickValueDefault() {
|
|
||||||
if (this.pickerValueDefault !== [0, 0, 0]) {
|
|
||||||
if (this.pickerValueDefault[0] > provinceData.length - 1) {
|
|
||||||
this.pickerValueDefault[0] = provinceData.length - 1;
|
|
||||||
}
|
|
||||||
if (this.pickerValueDefault[1] > cityData[this.pickerValueDefault[0]].length - 1) {
|
|
||||||
this.pickerValueDefault[1] = cityData[this.pickerValueDefault[0]].length - 1;
|
|
||||||
}
|
|
||||||
if (this.pickerValueDefault[2] > areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1) {
|
|
||||||
this.pickerValueDefault[2] = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
pickerChange(e) {
|
|
||||||
let changePickerValue = e.detail.value;
|
|
||||||
if (this.pickerValue[0] !== changePickerValue[0]) {
|
|
||||||
// 第一级发生滚动
|
|
||||||
this.cityDataList = cityData[changePickerValue[0]];
|
|
||||||
this.areaDataList = areaData[changePickerValue[0]][0];
|
|
||||||
changePickerValue[1] = 0;
|
|
||||||
changePickerValue[2] = 0;
|
|
||||||
} else if (this.pickerValue[1] !== changePickerValue[1]) {
|
|
||||||
// 第二级滚动
|
|
||||||
this.areaDataList = areaData[changePickerValue[0]][changePickerValue[1]];
|
|
||||||
changePickerValue[2] = 0;
|
|
||||||
}
|
|
||||||
this.pickerValue = changePickerValue;
|
|
||||||
this._$emit('onChange');
|
|
||||||
},
|
|
||||||
_$emit(emitName) {
|
|
||||||
let pickObj = {
|
|
||||||
label: this._getLabel(),
|
|
||||||
value: this.pickerValue,
|
|
||||||
cityCode: this._getCityCode(),
|
|
||||||
areaCode: this._getAreaCode(),
|
|
||||||
provinceCode: this._getProvinceCode(),
|
|
||||||
labelArr:this._getLabel().split('-')
|
|
||||||
};
|
|
||||||
console.log(this._getLabel().split('-'));
|
|
||||||
this.$emit(emitName, pickObj);
|
|
||||||
},
|
|
||||||
_getLabel() {
|
|
||||||
let pcikerLabel =
|
|
||||||
this.provinceDataList[this.pickerValue[0]].label + '-' + this.cityDataList[this.pickerValue[1]].label + '-' + this.areaDataList[this.pickerValue[2]].label;
|
|
||||||
return pcikerLabel;
|
|
||||||
},
|
|
||||||
_getCityCode() {
|
|
||||||
return this.cityDataList[this.pickerValue[1]].value;
|
|
||||||
},
|
|
||||||
_getProvinceCode() {
|
|
||||||
return this.provinceDataList[this.pickerValue[0]].value;
|
|
||||||
},
|
|
||||||
_getAreaCode() {
|
|
||||||
return this.areaDataList[this.pickerValue[2]].value;
|
|
||||||
},
|
|
||||||
queryIndex(params = [], type = 'value') {
|
|
||||||
// params = [ 11 ,1101,110101 ];
|
|
||||||
// 1.获取省份的index
|
|
||||||
let provinceIndex = provinceData.findIndex(res => res[type] == params[0]);
|
|
||||||
let cityIndex = cityData[provinceIndex].findIndex(res => res[type] == params[1]);
|
|
||||||
let areaIndex = areaData[provinceIndex][cityIndex].findIndex(res => res[type] == params[2]);
|
|
||||||
return {
|
|
||||||
index: [provinceIndex, cityIndex, areaIndex],
|
|
||||||
data: {
|
|
||||||
province: provinceData[provinceIndex],
|
|
||||||
city: cityData[provinceIndex][cityIndex],
|
|
||||||
area: areaData[cityIndex][0][areaIndex]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
clear() {},
|
|
||||||
hideMask() {
|
|
||||||
this._$emit('onCancel');
|
|
||||||
this.close();
|
|
||||||
},
|
|
||||||
pickerCancel() {
|
|
||||||
this._$emit('onCancel');
|
|
||||||
this.close();
|
|
||||||
},
|
|
||||||
pickerConfirm() {
|
|
||||||
this._$emit('onConfirm');
|
|
||||||
this.close();
|
|
||||||
},
|
|
||||||
open() {
|
|
||||||
this.showPopup = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.ani = 'simple-' + this.type;
|
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
close(type) {
|
|
||||||
if (!this.maskClick && type) return;
|
|
||||||
this.ani = '';
|
|
||||||
this.$nextTick(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.showPopup = false;
|
|
||||||
}, 300);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.simple-address {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address-mask {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
|
|
||||||
transition-property: opacity;
|
|
||||||
transition-duration: 0.3s;
|
|
||||||
opacity: 0;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
z-index: 99;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.mask-ani {
|
|
||||||
transition-property: opacity;
|
|
||||||
transition-duration: 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-bottom-mask {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-center-mask {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address--fixed {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
transition-property: transform;
|
|
||||||
transition-duration: 0.3s;
|
|
||||||
transform: translateY(460rpx);
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
z-index: 99;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address-content {
|
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-content-bottom {
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
transform: translateY(500rpx);
|
|
||||||
}
|
|
||||||
|
|
||||||
.content-ani {
|
|
||||||
transition-property: transform, opacity;
|
|
||||||
transition-duration: 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-bottom-content {
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-center-content {
|
|
||||||
transform: scale(1);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address__header {
|
|
||||||
position: relative;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
justify-content: space-between;
|
|
||||||
border-bottom-color: #f2f2f2;
|
|
||||||
border-bottom-style: solid;
|
|
||||||
border-bottom-width: 1rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address--fixed-top {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-between;
|
|
||||||
border-top-color: $uni-border-color;
|
|
||||||
border-top-style: solid;
|
|
||||||
border-top-width: 1rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address__header-btn-box {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
height: 70rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address__header-text {
|
|
||||||
text-align: center;
|
|
||||||
font-size: $uni-font-size-base;
|
|
||||||
color: #1aad19;
|
|
||||||
line-height: 70rpx;
|
|
||||||
padding-left: 40rpx;
|
|
||||||
padding-right: 40rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address__box {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple-address-view {
|
|
||||||
position: relative;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
width: 100%;
|
|
||||||
/* #endif */
|
|
||||||
/* #ifdef APP-NVUE */
|
|
||||||
width: 750rpx;
|
|
||||||
/* #endif */
|
|
||||||
height: 408rpx;
|
|
||||||
background-color: rgba(255, 255, 255, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.picker-item {
|
|
||||||
text-align: center;
|
|
||||||
line-height: 70rpx;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<uni-popup ref="popup" type="bottom">
|
<u-popup :closeOnClickOverlay="true" :show="show" ref="popup" type="bottom">
|
||||||
<view class="tpf-time-range-section">
|
<view class="tpf-time-range-section">
|
||||||
<view class="tpf-time-range-title-section flex flex-align-center flex-pack-justify">
|
<view class="tpf-time-range-title-section flex flex-align-center flex-pack-justify">
|
||||||
<text class="tpf-time-range-title-txt tpf-time-range-cancel" @tap="closePopup('cancel')">取消</text>
|
<text class="tpf-time-range-title-txt tpf-time-range-cancel" @tap="closePopup('cancel')">取消</text>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</u-popup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -98,6 +98,7 @@ export default{
|
|||||||
return {
|
return {
|
||||||
startDefaultTimeArr:[0,0],
|
startDefaultTimeArr:[0,0],
|
||||||
endDefaultTimeArr:[0,0],
|
endDefaultTimeArr:[0,0],
|
||||||
|
show: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
@@ -110,11 +111,11 @@ export default{
|
|||||||
if(this.compareTwoTimeRange(this.startDefaultTimeArr,e.detail.value)) this.startDefaultTimeArr = e.detail.value;
|
if(this.compareTwoTimeRange(this.startDefaultTimeArr,e.detail.value)) this.startDefaultTimeArr = e.detail.value;
|
||||||
},
|
},
|
||||||
open(){
|
open(){
|
||||||
this.$refs.popup.open();
|
this.show = true;
|
||||||
},
|
},
|
||||||
closePopup(action=""){
|
closePopup(action=""){
|
||||||
if(action == "cancel"){
|
if(action == "cancel"){
|
||||||
this.$refs.popup.close();
|
this.show = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(this.compareTwoTimeRange(this.startDefaultTimeArr , this.endDefaultTimeArr)){
|
if(this.compareTwoTimeRange(this.startDefaultTimeArr , this.endDefaultTimeArr)){
|
||||||
@@ -129,7 +130,7 @@ export default{
|
|||||||
this.$emit('timeRange',[
|
this.$emit('timeRange',[
|
||||||
startTime,endTime
|
startTime,endTime
|
||||||
]);
|
]);
|
||||||
this.$refs.popup.close();
|
this.show = false;
|
||||||
},
|
},
|
||||||
compareTwoTimeRange(arr1=[],arr2=[]){
|
compareTwoTimeRange(arr1=[],arr2=[]){
|
||||||
if(arr1[0]>arr2[0] || (arr1[0] == arr2[0] && arr1[1] > arr2[1])) return true;
|
if(arr1[0]>arr2[0] || (arr1[0] == arr2[0] && arr1[1] > arr2[1])) return true;
|
||||||
|
|||||||
@@ -1,134 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view :class="[styleType === 'text'?'segmented-control--text' : 'segmented-control--button' ]" :style="{ borderColor: styleType === 'text' ? '' : activeColor }"
|
|
||||||
class="segmented-control">
|
|
||||||
<view v-for="(item, index) in values" :class="[ styleType === 'text'?'segmented-control__item--text': 'segmented-control__item--button' , index === currentIndex&&styleType === 'button'?'segmented-control__item--button--active': '' , index === 0&&styleType === 'button'?'segmented-control__item--button--first': '',index === values.length - 1&&styleType === 'button'?'segmented-control__item--button--last': '' ]"
|
|
||||||
:key="index" :style="{
|
|
||||||
backgroundColor: index === currentIndex && styleType === 'button' ? activeColor : '',borderColor: index === currentIndex&&styleType === 'text'||styleType === 'button'?activeColor:'transparent'
|
|
||||||
}"
|
|
||||||
class="segmented-control__item" @click="_onClick(index)">
|
|
||||||
<text :style="{color:
|
|
||||||
index === currentIndex
|
|
||||||
? styleType === 'text'
|
|
||||||
? activeColor
|
|
||||||
: '#fff'
|
|
||||||
: styleType === 'text'
|
|
||||||
? '#000'
|
|
||||||
: activeColor}"
|
|
||||||
class="segmented-control__text">{{ item }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
/**
|
|
||||||
* SegmentedControl 分段器
|
|
||||||
* @description 用作不同视图的显示
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=54
|
|
||||||
* @property {Number} current 当前选中的tab索引值,从0计数
|
|
||||||
* @property {String} styleType = [button|text] 分段器样式类型
|
|
||||||
* @value button 按钮类型
|
|
||||||
* @value text 文字类型
|
|
||||||
* @property {String} activeColor 选中的标签背景色与边框颜色
|
|
||||||
* @property {Array} values 选项数组
|
|
||||||
* @event {Function} clickItem 组件触发点击事件时触发,e={currentIndex}
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: 'UniSegmentedControl',
|
|
||||||
props: {
|
|
||||||
current: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
values: {
|
|
||||||
type: Array,
|
|
||||||
default () {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
activeColor: {
|
|
||||||
type: String,
|
|
||||||
default: '#007aff'
|
|
||||||
},
|
|
||||||
styleType: {
|
|
||||||
type: String,
|
|
||||||
default: 'button'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
currentIndex: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
current(val) {
|
|
||||||
if (val !== this.currentIndex) {
|
|
||||||
this.currentIndex = val
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.currentIndex = this.current
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
_onClick(index) {
|
|
||||||
if (this.currentIndex !== index) {
|
|
||||||
this.currentIndex = index
|
|
||||||
this.$emit('clickItem', {
|
|
||||||
currentIndex: index
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.segmented-control {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
height: 50rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
/* #ifdef H5 */
|
|
||||||
cursor: pointer;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
.segmented-control__item {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: inline-flex;
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* #endif */
|
|
||||||
position: relative;
|
|
||||||
flex: 1;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
padding: 10rpx;
|
|
||||||
}
|
|
||||||
.segmented-control__item--button {
|
|
||||||
border-style: solid;
|
|
||||||
border-top-width: 1px;
|
|
||||||
border-bottom-width: 1px;
|
|
||||||
border-right-width: 1px;
|
|
||||||
border-left-width: 0;
|
|
||||||
}
|
|
||||||
.segmented-control__item--button--first {
|
|
||||||
border-left-width: 1px;
|
|
||||||
border-top-left-radius: 5px;
|
|
||||||
border-bottom-left-radius: 5px;
|
|
||||||
}
|
|
||||||
.segmented-control__item--button--last {
|
|
||||||
border-top-right-radius: 5px;
|
|
||||||
border-bottom-right-radius: 5px;
|
|
||||||
}
|
|
||||||
.segmented-control__item--text {
|
|
||||||
border-bottom-style: solid;
|
|
||||||
border-bottom-width: 3px;
|
|
||||||
}
|
|
||||||
.segmented-control__text {
|
|
||||||
font-size: 28rpx;
|
|
||||||
line-height: 28rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -5,13 +5,15 @@
|
|||||||
v-if="!item.isFarmerShop"
|
v-if="!item.isFarmerShop"
|
||||||
:src="item[imageKey]"
|
:src="item[imageKey]"
|
||||||
class="img"
|
class="img"
|
||||||
|
lazy-load
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
:src="item.farmerShopCover"
|
:src="item.farmerShopCover"
|
||||||
v-if="item.farmerShopCoverType === 1 && item.isFarmerShop"
|
v-if="item.farmerShopCoverType === 1 && item.isFarmerShop"
|
||||||
class="img"
|
class="img"
|
||||||
mode="heightFix|widthFix">
|
mode="heightFix|widthFix"
|
||||||
</image>
|
lazy-load
|
||||||
|
/>
|
||||||
<image
|
<image
|
||||||
:src="item.farmerShopCover + '?vframe/jpg/offset/1'"
|
:src="item.farmerShopCover + '?vframe/jpg/offset/1'"
|
||||||
mode="heightFix|widthFix"
|
mode="heightFix|widthFix"
|
||||||
@@ -20,24 +22,35 @@
|
|||||||
:show-fullscreen-btn="false"
|
:show-fullscreen-btn="false"
|
||||||
:show-play-btn="false"
|
:show-play-btn="false"
|
||||||
class="img"
|
class="img"
|
||||||
:poster="item.farmerShopCover + '?vframe/jpg/offset/1'">
|
:poster="item.farmerShopCover + '?vframe/jpg/offset/1'"
|
||||||
</image>
|
lazy-load
|
||||||
|
/>
|
||||||
|
|
||||||
<image
|
<image
|
||||||
v-if="item.isOldBrand"
|
v-if="item.isOldBrand"
|
||||||
:src="webUrl + '/home/old-mark.png'"
|
:src="webUrl + '/home/old-mark.png'"
|
||||||
class="mark-img"
|
class="mark-img"
|
||||||
|
lazy-load
|
||||||
|
/>
|
||||||
|
<image
|
||||||
|
v-if="item.isGiftCard"
|
||||||
|
style="left: 0;width: 120rpx;"
|
||||||
|
:src="webUrl + '/home/gift-tag.png'"
|
||||||
|
class="mark-img"
|
||||||
|
lazy-load
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-if="item.isLandmarkGoods"
|
v-if="item.isLandmarkGoods"
|
||||||
:src="webUrl + '/home/mark-land.png'"
|
:src="webUrl + '/home/mark-land.png'"
|
||||||
class="mark-img"
|
class="mark-img"
|
||||||
style="right: 20rpx"
|
style="right: 20rpx"
|
||||||
|
lazy-load
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-if="item.isCountyFamous"
|
v-if="item.isCountyFamous"
|
||||||
:src="webUrl + '/home/qixian-mark.png'"
|
:src="webUrl + '/home/qixian-mark.png'"
|
||||||
class="mark-img"
|
class="mark-img"
|
||||||
|
lazy-load
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-if="item.isIch"
|
v-if="item.isIch"
|
||||||
@@ -49,6 +62,7 @@
|
|||||||
v-if="item.isFarmerShop"
|
v-if="item.isFarmerShop"
|
||||||
:src="webUrl + '/orderIcon/nm.png'"
|
:src="webUrl + '/orderIcon/nm.png'"
|
||||||
class="mark-img-nm"
|
class="mark-img-nm"
|
||||||
|
lazy-load
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="item.isFarmerShop" class="more-t v12-pt-2 v12-font-bold v12-font-28 v12-px-2" >{{ item.farmerShopContent }}</view>
|
<view v-if="item.isFarmerShop" class="more-t v12-pt-2 v12-font-bold v12-font-28 v12-px-2" >{{ item.farmerShopContent }}</view>
|
||||||
@@ -65,12 +79,26 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="price-wrap">
|
<view class="price-wrap">
|
||||||
<view class="price">
|
<view class="price">
|
||||||
<text class="price-txt price-red">¥{{ item[priceKey] }}</text>
|
<view
|
||||||
|
v-if="item.isNegotiable === 1"
|
||||||
|
class="v12-primary-text v12-font-28 v12-font-weight"
|
||||||
|
>
|
||||||
|
价格面议
|
||||||
</view>
|
</view>
|
||||||
<view class="btn" @click.stop="$emit('add', item)">
|
<text
|
||||||
|
v-else
|
||||||
|
class="price-txt price-red">
|
||||||
|
<text class="v12-font-20">
|
||||||
|
¥
|
||||||
|
</text>
|
||||||
|
{{ item[priceKey] }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.isNegotiable === 0" class="btn" @click.stop="$emit('add', item)">
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/home/icon-cart.png'"
|
:src="webUrl + '/home/icon-cart.png'"
|
||||||
class="img"
|
class="img"
|
||||||
|
lazy-load
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -79,7 +107,7 @@
|
|||||||
v-if="item.isFarmerShop"
|
v-if="item.isFarmerShop"
|
||||||
class="v12-justify-start v12-align-center v12-pt-2 v12-px-2 v12-pb-2">
|
class="v12-justify-start v12-align-center v12-pt-2 v12-px-2 v12-pb-2">
|
||||||
<view class="btn v12-mr-2">
|
<view class="btn v12-mr-2">
|
||||||
<image :src="item.farmerShopLogo" class="nm-img-logo v12-radius-100"></image>
|
<image :src="item.farmerShopLogo" class="nm-img-logo v12-radius-100" lazy-load />
|
||||||
</view>
|
</view>
|
||||||
<view class="one-t v12-font-24 v12-dark1-text" style="width:230rpx">{{ item.farmerShopName }}/{{ item.farmerShopCityName || '-' }}</view>
|
<view class="one-t v12-font-24 v12-dark1-text" style="width:230rpx">{{ item.farmerShopName }}/{{ item.farmerShopCityName || '-' }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<view
|
<view
|
||||||
:class="currIndex === 4 ? 'curr' : ''"
|
:class="currIndex === 4 ? 'curr' : ''"
|
||||||
class="name"
|
class="name"
|
||||||
>寻趣味</view>
|
>吃喝玩乐</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tabbar-list">
|
<view class="tabbar-list">
|
||||||
<view
|
<view
|
||||||
@@ -30,7 +30,6 @@
|
|||||||
@click="gotoPage(item.url, item.type, item.index)"
|
@click="gotoPage(item.url, item.type, item.index)"
|
||||||
>
|
>
|
||||||
<view class="img-wrap">
|
<view class="img-wrap">
|
||||||
<!-- 预加载两张图片,可以在点击切换的时候不闪屏 -->
|
|
||||||
<image
|
<image
|
||||||
:src="item.onIcon"
|
:src="item.onIcon"
|
||||||
class="img on"
|
class="img on"
|
||||||
@@ -41,6 +40,12 @@
|
|||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="name">{{ item.name }}</view>
|
<view class="name">{{ item.name }}</view>
|
||||||
|
<view
|
||||||
|
v-if="item.name === '消息' && showUnreadBadge"
|
||||||
|
class="badge"
|
||||||
|
>
|
||||||
|
{{ unreadCountText }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -48,6 +53,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import store from '@/store'
|
||||||
|
import { getUnreadMessageCount, getUnreadMessageCountForSeller } from '@/api/rooms'
|
||||||
export default {
|
export default {
|
||||||
name: 'XddTabbar',
|
name: 'XddTabbar',
|
||||||
props: {
|
props: {
|
||||||
@@ -93,14 +100,57 @@ export default {
|
|||||||
type: 1,
|
type: 1,
|
||||||
index: 3
|
index: 3
|
||||||
}
|
}
|
||||||
]]
|
]],
|
||||||
|
unreadCount: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isLogin() {
|
||||||
|
return store.getters.isLogin
|
||||||
|
},
|
||||||
|
showUnreadBadge() {
|
||||||
|
return this.isLogin && this.unreadCount > 0
|
||||||
|
},
|
||||||
|
unreadCountText() {
|
||||||
|
if (this.unreadCount > 99) {
|
||||||
|
return '99+'
|
||||||
|
}
|
||||||
|
return this.unreadCount
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
isLogin(val) {
|
||||||
|
if (val) {
|
||||||
|
this.fetchUnreadCount()
|
||||||
|
} else {
|
||||||
|
this.unreadCount = 0
|
||||||
|
uni.$emit('updateUnreadMessageCount', 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getElementData('#quweiIcon')
|
this.getElementData('#quweiIcon')
|
||||||
this.getIconData('#icon1')
|
this.getIconData('#icon1')
|
||||||
|
if (this.isLogin) {
|
||||||
|
this.fetchUnreadCount()
|
||||||
|
}
|
||||||
|
uni.$on('updateUnreadMessageCount', this.handleUpdateUnreadMessageCount)
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
uni.$off('updateUnreadMessageCount', this.handleUpdateUnreadMessageCount)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleUpdateUnreadMessageCount(count) {
|
||||||
|
if (!this.isLogin) {
|
||||||
|
this.unreadCount = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (typeof count === 'number') {
|
||||||
|
this.unreadCount = count
|
||||||
|
} else {
|
||||||
|
this.fetchUnreadCount()
|
||||||
|
}
|
||||||
|
},
|
||||||
getElementData(el) {
|
getElementData(el) {
|
||||||
const query = uni.createSelectorQuery().in(this)
|
const query = uni.createSelectorQuery().in(this)
|
||||||
query.select(el).boundingClientRect().exec((res)=> {
|
query.select(el).boundingClientRect().exec((res)=> {
|
||||||
@@ -117,10 +167,37 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
fetchUnreadCount() {
|
||||||
* 跳转至目标页面
|
uni.request({
|
||||||
* type: 1-tabbar页面,2-非tabbar页面
|
url: this.$SERVICE_API_URL + '/unread-num',
|
||||||
*/
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
uid: store.getters.userInfo.uid
|
||||||
|
},
|
||||||
|
success:(res)=>{
|
||||||
|
if(res.data.status_code === 200) {
|
||||||
|
const count = res.data.content || 0
|
||||||
|
getUnreadMessageCount().then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success) {
|
||||||
|
const _count = data || 0
|
||||||
|
this.unreadCount = count + _count
|
||||||
|
uni.$emit('updateUnreadMessageCount', this.unreadCount)
|
||||||
|
} else {
|
||||||
|
this.unreadCount = 0
|
||||||
|
uni.$emit('updateUnreadMessageCount', 0)
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.unreadCount = 0
|
||||||
|
uni.$emit('updateUnreadMessageCount', 0)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.unreadCount = 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
gotoPage(url, type = 1, index) {
|
gotoPage(url, type = 1, index) {
|
||||||
if (this.currIndex === index) return
|
if (this.currIndex === index) return
|
||||||
if (type === 1) {
|
if (type === 1) {
|
||||||
@@ -149,7 +226,7 @@ export default {
|
|||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
.center-img {
|
.center-img {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -16rpx;
|
top: -20rpx;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
@@ -199,6 +276,7 @@ export default {
|
|||||||
}
|
}
|
||||||
.item {
|
.item {
|
||||||
width: 140rpx;
|
width: 140rpx;
|
||||||
|
position: relative;
|
||||||
&.curr {
|
&.curr {
|
||||||
.name {
|
.name {
|
||||||
color: #C52733;
|
color: #C52733;
|
||||||
@@ -211,6 +289,21 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.badge {
|
||||||
|
position: absolute;
|
||||||
|
top: -4rpx;
|
||||||
|
right: 32rpx;
|
||||||
|
min-width: 28rpx;
|
||||||
|
padding: 0 6rpx;
|
||||||
|
height: 28rpx;
|
||||||
|
line-height: 28rpx;
|
||||||
|
border-radius: 14rpx;
|
||||||
|
background-color: #FF564A;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -257,7 +257,7 @@
|
|||||||
}
|
}
|
||||||
.keyboard-item {
|
.keyboard-item {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 250rpx;
|
width: 33.333%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -12,7 +12,14 @@ const settings = {
|
|||||||
/* 系统接口前缀,没有统一的填空字符串 */
|
/* 系统接口前缀,没有统一的填空字符串 */
|
||||||
sysPrefix: '/',
|
sysPrefix: '/',
|
||||||
/* 是否收集错误日志 */
|
/* 是否收集错误日志 */
|
||||||
collectRequestError: false
|
collectRequestError: false,
|
||||||
|
/* 订阅消息模板ID */
|
||||||
|
SubscribeMessageTmplIds: [
|
||||||
|
'7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE',
|
||||||
|
'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU',
|
||||||
|
'9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU',
|
||||||
|
'v0GegDmzjpqiinmdj7dOwRK1MaTAPVyCOpqn8hJ3Y3Q'
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
export default settings
|
export default settings
|
||||||
|
|||||||
@@ -10,6 +10,14 @@ if (NODE_ENV === 'development' || NODE_ENV === 'test') {
|
|||||||
enableDebug: false
|
enableDebug: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (NODE_ENV === 'fix') {
|
||||||
|
BASE_URL = 'https://shop-pre.xdd618.com/api'
|
||||||
|
SERVICE_URL = 'https://service-pre.xdd618.com/api'
|
||||||
|
SERVICE_WS_URL = 'wss://service-pre.xdd618.com/ws'
|
||||||
|
wx.setEnableDebug({
|
||||||
|
enableDebug: false
|
||||||
|
})
|
||||||
|
}
|
||||||
if (NODE_ENV === 'prod') {
|
if (NODE_ENV === 'prod') {
|
||||||
BASE_URL = 'https://wxapp.xdd618.com/api'
|
BASE_URL = 'https://wxapp.xdd618.com/api'
|
||||||
SERVICE_URL = 'https://service.xdd618.com/api'
|
SERVICE_URL = 'https://service.xdd618.com/api'
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { subscribeMessage } from '@/libs/order'
|
// import { subscribeMessage } from '@/libs/order'
|
||||||
import { getProvider } from '@/utils'
|
import { getProvider } from '@/utils'
|
||||||
import WechatJSSDK from 'wechat-jssdk/dist/client.umd'
|
import WechatJSSDK from 'wechat-jssdk/dist/client.umd'
|
||||||
import { getWechatConfig, wechatAuth } from '@/api/public'
|
import { getWechatConfig, wechatAuth } from '@/api/public'
|
||||||
@@ -65,7 +65,7 @@ export const weappPay = option => {
|
|||||||
resolve(success)
|
resolve(success)
|
||||||
}, 3000)
|
}, 3000)
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
subscribeMessage()
|
// subscribeMessage()
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
fail: error => {
|
fail: error => {
|
||||||
|
|||||||
@@ -75,6 +75,18 @@ const force2Decimal = function change2Decimal(value) {
|
|||||||
return forceToDecimal(value, 2)
|
return forceToDecimal(value, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const formatCount = function(value) {
|
||||||
|
if (!value) return 0;
|
||||||
|
const num = parseFloat(value);
|
||||||
|
if (isNaN(num)) return 0;
|
||||||
|
if (num >= 10000) {
|
||||||
|
let val = num / 10000;
|
||||||
|
val = parseFloat(val.toFixed(1));
|
||||||
|
return val + '万';
|
||||||
|
}
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
const toast = (title = '', position = 'center', success = function() {}) => {
|
const toast = (title = '', position = 'center', success = function() {}) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title,
|
title,
|
||||||
@@ -88,6 +100,7 @@ const toast = (title = '', position = 'center', success = function() {}) => {
|
|||||||
|
|
||||||
Vue.prototype.$force2Decimal = force2Decimal
|
Vue.prototype.$force2Decimal = force2Decimal
|
||||||
Vue.prototype.$forceToDecimal = forceToDecimal
|
Vue.prototype.$forceToDecimal = forceToDecimal
|
||||||
|
Vue.prototype.$formatCount = formatCount
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
App.mpType = 'app'
|
App.mpType = 'app'
|
||||||
|
|||||||
+8
-1
@@ -5,6 +5,7 @@
|
|||||||
"versionName" : "4.0.0",
|
"versionName" : "4.0.0",
|
||||||
"versionCode" : 4,
|
"versionCode" : 4,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
|
"sassImplementationName" : "node-sass",
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"usingComponents" : true,
|
"usingComponents" : true,
|
||||||
@@ -134,7 +135,8 @@
|
|||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
"appid" : "wx9417047e1a0c340b",
|
"appid" : "wx9417047e1a0c340b",
|
||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : false
|
"urlCheck" : true,
|
||||||
|
"minified" : true
|
||||||
},
|
},
|
||||||
"usingComponents" : true,
|
"usingComponents" : true,
|
||||||
"permission" : {
|
"permission" : {
|
||||||
@@ -148,6 +150,11 @@
|
|||||||
"version" : "1.3.5",
|
"version" : "1.3.5",
|
||||||
// 最新直播组件版本号
|
// 最新直播组件版本号
|
||||||
"provider" : "wx2b03c6e691cd7370"
|
"provider" : "wx2b03c6e691cd7370"
|
||||||
|
},
|
||||||
|
"WechatSI" : {
|
||||||
|
"version" : "0.3.6",
|
||||||
|
// TTS版本号
|
||||||
|
"provider" : "wx069ba97219f66d99"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 直播appid
|
// 直播appid
|
||||||
|
|||||||
+26
-9
@@ -14,7 +14,7 @@ export default {
|
|||||||
isOpen: false,
|
isOpen: false,
|
||||||
attrTxt: '',
|
attrTxt: '',
|
||||||
attrValue: '',
|
attrValue: '',
|
||||||
id: null,
|
m_id: null,
|
||||||
productValueArr: [],
|
productValueArr: [],
|
||||||
attr: {
|
attr: {
|
||||||
cartAttr: false,
|
cartAttr: false,
|
||||||
@@ -33,12 +33,27 @@ export default {
|
|||||||
unique: ''
|
unique: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
cart_num: 1
|
cart_num: 1,
|
||||||
|
CartCount: 0,
|
||||||
|
// 只有一个规格时直接加入购物车;AI聊天界面则不直接加入购物车,每次都要显示规格选择弹窗
|
||||||
|
onlyOneToAddCart: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 获取购物车数量
|
||||||
|
getCartCount () {
|
||||||
|
const isLogin = this.isLogin
|
||||||
|
if (isLogin) {
|
||||||
|
getCartCount({
|
||||||
|
numType: 0
|
||||||
|
}).then(res => {
|
||||||
|
this.CartCount = res.data.count
|
||||||
|
this.$forceUpdate()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
getSkuActiveStatus(selectedSku) {
|
getSkuActiveStatus(selectedSku) {
|
||||||
getProductSkuBySelected({ id: this.id, selectedSku }).then(res => {
|
getProductSkuBySelected({ id: this.m_id, selectedSku }).then(res => {
|
||||||
const { success, data } = res
|
const { success, data } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
for (const key in data) {
|
for (const key in data) {
|
||||||
@@ -62,7 +77,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
productCon() {
|
productCon() {
|
||||||
getProductDetail(this.id).then(res => {
|
getProductDetail(this.m_id).then(res => {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
this.storeInfo = {...data.storeInfo}
|
this.storeInfo = {...data.storeInfo}
|
||||||
if(data.storeInfo.stock === 0) {
|
if(data.storeInfo.stock === 0) {
|
||||||
@@ -99,8 +114,8 @@ export default {
|
|||||||
// 是否单一规格
|
// 是否单一规格
|
||||||
const onlyOne = Object.keys(data.productValue).length === 1
|
const onlyOne = Object.keys(data.productValue).length === 1
|
||||||
|
|
||||||
if(onlyOne) {
|
if(onlyOne && this.onlyOneToAddCart) {
|
||||||
this.handleOk()
|
this.handleOk(() => this.getCartCount())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.attr.cartAttr = !this.isOpen ? true : false
|
this.attr.cartAttr = !this.isOpen ? true : false
|
||||||
@@ -222,7 +237,7 @@ export default {
|
|||||||
// 点击加入购物车按钮
|
// 点击加入购物车按钮
|
||||||
addToCart(item, id = 'id') {
|
addToCart(item, id = 'id') {
|
||||||
console.log(item, 'addToCart --------- item');
|
console.log(item, 'addToCart --------- item');
|
||||||
this.id = item[id]
|
this.m_id = item[id]
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.productCon()
|
this.productCon()
|
||||||
@@ -233,7 +248,7 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
handleOk() {
|
handleOk(cb) {
|
||||||
const productSelect = this.getAttrItemData(this.attrValue)
|
const productSelect = this.getAttrItemData(this.attrValue)
|
||||||
// 如果有属性,没有选择,提示用户选择
|
// 如果有属性,没有选择,提示用户选择
|
||||||
const hasNo = (this.attr.productAttr.length && productSelect === undefined && this.isOpen) || productSelect.stock === 0
|
const hasNo = (this.attr.productAttr.length && productSelect === undefined && this.isOpen) || productSelect.stock === 0
|
||||||
@@ -246,7 +261,7 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const q = {
|
const q = {
|
||||||
productId: this.id,
|
productId: this.m_id,
|
||||||
cartNum: this.attr.productSelect.cart_num,
|
cartNum: this.attr.productSelect.cart_num,
|
||||||
new: 0,
|
new: 0,
|
||||||
uniqueId: this.attr.productSelect !== undefined ? this.attr.productSelect.unique : ''
|
uniqueId: this.attr.productSelect !== undefined ? this.attr.productSelect.unique : ''
|
||||||
@@ -261,9 +276,11 @@ export default {
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
})
|
})
|
||||||
|
cb && cb()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
ChangeCartNum(changeValue) {
|
ChangeCartNum(changeValue) {
|
||||||
|
if(changeValue === 0) return
|
||||||
// changeValue:是否 加|减
|
// changeValue:是否 加|减
|
||||||
// 获取当前变动属性
|
// 获取当前变动属性
|
||||||
const productSelect = this.getAttrItemData(this.attrValue)
|
const productSelect = this.getAttrItemData(this.attrValue)
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
import { getDrawTicketByOrder } from '@/api/lottery'
|
||||||
|
export const orderPaySuccessToCheckDrawStatus = {
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
drawTicketPopup: {
|
||||||
|
show: false,
|
||||||
|
ticketCode: '',
|
||||||
|
drawTime: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
setDrawTicketPopupFromQuery(ticketData = '') {
|
||||||
|
const drawTicketData = ticketData || this.$yroute.query.drawTicketData
|
||||||
|
if (!drawTicketData) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let result = {}
|
||||||
|
try {
|
||||||
|
result = typeof drawTicketData === 'string' ? JSON.parse(decodeURIComponent(drawTicketData)) : drawTicketData
|
||||||
|
console.log(result)
|
||||||
|
} catch (e) {
|
||||||
|
result = {}
|
||||||
|
}
|
||||||
|
const hasTicket = Number(result.hasTicket || 0) === 1
|
||||||
|
const howPopup = Number(result.showPopup || 0) === 1
|
||||||
|
if (!hasTicket || !howPopup) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.drawTicketPopup = {
|
||||||
|
show: true,
|
||||||
|
ticketCode: result.ticketCode || result.code || '',
|
||||||
|
drawTime: result.drawTime || ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
closeDrawTicketPopup() {
|
||||||
|
this.drawTicketPopup.show = false
|
||||||
|
},
|
||||||
|
goHomeFromPopup() {
|
||||||
|
this.drawTicketPopup.show = false
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/home/index'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goTicketsFromPopup() {
|
||||||
|
this.drawTicketPopup.show = false
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pkg-video/views/county-my-tickets'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
buildOrderDetailQuery(orderId, drawTicketResult = {}) {
|
||||||
|
return {
|
||||||
|
id: orderId,
|
||||||
|
drawTicketData: encodeURIComponent(JSON.stringify(drawTicketResult || {}))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async afterPaySuccess(orderId, fallback) {
|
||||||
|
if (!orderId) {
|
||||||
|
fallback && fallback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const res = await getDrawTicketByOrder(orderId)
|
||||||
|
const result = (res && res.data) || {}
|
||||||
|
fallback && fallback(result)
|
||||||
|
return
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
fallback && fallback({})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+17
-6
@@ -1,21 +1,30 @@
|
|||||||
|
import { getWeixinShareConfig } from '@/api/public'
|
||||||
export default{
|
export default{
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
//设置默认的分享参数
|
//设置默认的分享参数
|
||||||
|
sharePagePath: '/pages/home/index',
|
||||||
share:{
|
share:{
|
||||||
title: '云南香道滇官方商城',
|
title: '云南香道滇官方商城',
|
||||||
path:'/pages/Loading/index',
|
path: this.sharePagePath,
|
||||||
imageUrl:'http://admin-api.xdd618.com/file/pic/20210617211221217375.jpg',
|
imageUrl: this.$VUE_APP_RESOURCES_URL + '/20210617211221217375.jpg?' + new Date().getTime(),
|
||||||
desc: '',
|
desc: '',
|
||||||
content: ''
|
content: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShareAppMessage(res) {
|
onShareAppMessage(res) {
|
||||||
return {
|
uni.updateShareMenu({
|
||||||
title:this.share.title,
|
isPrivateMessage: false,
|
||||||
path:this.share.path,
|
withShareTicket: false
|
||||||
imageUrl:this.share.imageUrl,
|
})
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
|
const { success, data } = await getWeixinShareConfig()
|
||||||
|
if (success) {
|
||||||
|
resolve({
|
||||||
|
title: data.title || this.share.title,
|
||||||
|
path: data.url || this.share.path,
|
||||||
|
imageUrl: data.image || this.share.imageUrl,
|
||||||
desc: this.share.desc,
|
desc: this.share.desc,
|
||||||
content: this.share.content,
|
content: this.share.content,
|
||||||
success(res){
|
success(res){
|
||||||
@@ -29,6 +38,8 @@ export default{
|
|||||||
icon:'none'
|
icon:'none'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Generated
+1721
-1716
File diff suppressed because it is too large
Load Diff
@@ -79,6 +79,7 @@
|
|||||||
"miniapp-color-thief": "^1.0.5",
|
"miniapp-color-thief": "^1.0.5",
|
||||||
"number-precision": "^1.5.2",
|
"number-precision": "^1.5.2",
|
||||||
"regenerator-runtime": "^0.12.1",
|
"regenerator-runtime": "^0.12.1",
|
||||||
|
"remove-markdown": "^0.6.2",
|
||||||
"uview-ui": "2.0.36",
|
"uview-ui": "2.0.36",
|
||||||
"vconsole": "^3.14.6",
|
"vconsole": "^3.14.6",
|
||||||
"vue": "^2.6.11",
|
"vue": "^2.6.11",
|
||||||
@@ -132,6 +133,17 @@
|
|||||||
"CUSTOM-CONST": true
|
"CUSTOM-CONST": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"mp-weixin-fix": {
|
||||||
|
"title": "微信小程序(Fix环境)",
|
||||||
|
"env": {
|
||||||
|
"UNI_PLATFORM": "mp-weixin",
|
||||||
|
"VUE_APP_ENV": "fix",
|
||||||
|
"UNI_OUTPUT_DIR": "dist"
|
||||||
|
},
|
||||||
|
"define": {
|
||||||
|
"CUSTOM-CONST": true
|
||||||
|
}
|
||||||
|
},
|
||||||
"mp-weixin": {
|
"mp-weixin": {
|
||||||
"title": "微信小程序(生产环境)",
|
"title": "微信小程序(生产环境)",
|
||||||
"env": {
|
"env": {
|
||||||
|
|||||||
+383
-239
@@ -22,12 +22,6 @@
|
|||||||
"navigationBarTitleText": "登录"
|
"navigationBarTitleText": "登录"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/user/RetrievePassword/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "重置密码"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/home/index",
|
"path": "pages/home/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -51,7 +45,7 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/home/newZone",
|
"path": "pages/home/newZone",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "新品专区",
|
"navigationBarTitleText": "甄选好礼",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -82,24 +76,12 @@
|
|||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/shop/StoreList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商家列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/shop/GoodsList/index",
|
"path": "pages/shop/GoodsList/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "搜索"
|
"navigationBarTitleText": "搜索"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/NotDefined/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "404"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/cloud/haveFun",
|
"path": "pages/cloud/haveFun",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -122,36 +104,6 @@
|
|||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/shop/GoodsCollection/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商品收藏"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/EvaluateList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "评价列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/GoodsEvaluate/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商品评价"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/GoodsPromotion/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "促销商品"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/shop/HotNewGoods/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "热门商品"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/shop/GoodsCon/index",
|
"path": "pages/shop/GoodsCon/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -173,129 +125,24 @@
|
|||||||
"navigationBarTitleText": "新增收货地址"
|
"navigationBarTitleText": "新增收货地址"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/user/UserAccount/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "账户余额"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/user/address/AddressManagement/index",
|
"path": "pages/user/address/AddressManagement/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "收货地址"
|
"navigationBarTitleText": "收货地址"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/Poster/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "推广名片"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/signIn/Sign/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "签到"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/signIn/SignRecord/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "签到记录"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/CashAudit/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "提现结果"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/PromoterOrder/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "分销详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/PromoterList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "分销列表",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/UserPromotion/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "团队管理",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/History/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商品足迹",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/UserBill/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "账单记录"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/CommissionDetails/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "佣金明细"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/user/signIn/Integral/index",
|
"path": "pages/user/signIn/Integral/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的积分"
|
"navigationBarTitleText": "我的积分"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/user/UserVip/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "用户vip"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/promotion/UserCash/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "提现"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/CustomerList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "客服列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/Recharge/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "充值"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/order/MyOrder/index",
|
"path": "pages/order/MyOrder/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的订单",
|
"navigationBarTitleText": "我的订单",
|
||||||
"navigationBarBackgroundColor": "#fff"
|
"navigationBarBackgroundColor": "#fff",
|
||||||
}
|
"navigationStyle": "custom"
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/order/Logistics/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "查看物流"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/order/OrderDetails/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "订单详情"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -305,55 +152,16 @@
|
|||||||
"navigationBarBackgroundColor": "#fff"
|
"navigationBarBackgroundColor": "#fff"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/order/PaymentStatus/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "支付状态"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/order/GoodsReturn/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "商品退货"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/order/ReturnList/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "退货列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/map/index",
|
"path": "pages/map/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "地图"
|
"navigationBarTitleText": "地图"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/user/Message/Message",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "消息",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/MessageDetail/MessageDetail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "消息详情",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/MemberUpgradeIntro/MemberUpgradeIntro",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "升级说明",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/VideoPlayBackList/VideoPlayBackList",
|
"path": "pages/VideoPlayBackList/VideoPlayBackList",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "寻看点",
|
"navigationBarTitleText": "使用指南",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -363,43 +171,6 @@
|
|||||||
"navigationBarTitleText": "视频详情",
|
"navigationBarTitleText": "视频详情",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/UpgradeElectronicProtocol/UpgradeElectronicProtocol",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "升级",
|
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/UpgradeProtocolDetail/UpgradeProtocolDetail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "共享股东协议"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/LiveAndShortVideo/LiveAndShortVideo",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "直播/视频"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/LiveBroadcastList/LiveBroadcastList",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "直播列表"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/UserFavorite/UserFavorite",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "我的喜欢"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/user/Points/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "积分"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"subPackages": [
|
"subPackages": [
|
||||||
@@ -447,7 +218,8 @@
|
|||||||
{
|
{
|
||||||
"path": "inn/innInfoDetail",
|
"path": "inn/innInfoDetail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "资讯详情"
|
"navigationBarTitleText": "资讯详情",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -479,11 +251,47 @@
|
|||||||
"navigationBarTitleText": "抽奖"
|
"navigationBarTitleText": "抽奖"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "views/county-lottery",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "抽奖"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "views/lottery-log",
|
"path": "views/lottery-log",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "抽奖记录"
|
"navigationBarTitleText": "抽奖记录"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/county-lottery-rules",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "活动规则"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/county-my-tickets",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "我的抽奖码"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/county-winners",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "中奖名单"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/county-claim-address",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "填写收货地址"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/county-realname",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "实名认证"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -508,6 +316,13 @@
|
|||||||
"navigationBarTitleText": "历史会话"
|
"navigationBarTitleText": "历史会话"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "views/message",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "互动消息",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "views/xiaoZhi",
|
"path": "views/xiaoZhi",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -540,7 +355,21 @@
|
|||||||
{
|
{
|
||||||
"path": "views/wholesaler",
|
"path": "views/wholesaler",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "采购批发商入驻"
|
"navigationBarTitleText": "礼品集采中心入驻"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/travelResidence",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "旅居商家入驻",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/experienceStore",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "体验店入驻",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -597,7 +426,7 @@
|
|||||||
"path": "views/healthFoods",
|
"path": "views/healthFoods",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "康养旅居",
|
"navigationBarTitleText": "康养旅居",
|
||||||
"navigationBarBackgroundColor": "#FAEED8"
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -661,7 +490,7 @@
|
|||||||
{
|
{
|
||||||
"path": "views/giftList",
|
"path": "views/giftList",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "特色礼品"
|
"navigationBarTitleText": "全国礼品"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -690,6 +519,12 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "views/newsInfo",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "资讯详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "views/famousQianxianTheme",
|
"path": "views/famousQianxianTheme",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -697,6 +532,13 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "views/famousQianxianGraphicGuide",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "攻略详情",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "views/famousQianxianVillageShop",
|
"path": "views/famousQianxianVillageShop",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -711,6 +553,28 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "views/oldSojumStore",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/housekeeperDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/groupBuyDetails",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "团购详情",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "views/famousQianxianInvestment",
|
"path": "views/famousQianxianInvestment",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -766,6 +630,58 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "时令尝鲜"
|
"navigationBarTitleText": "时令尝鲜"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/experienceCoupon",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "体验券详情",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/experienceCouponOrderDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "订单核销",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/experienceProjectDetail",
|
||||||
|
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "体验项目详情",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/storeLicense",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "营业执照",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/submitOrder",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "提交订单",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/sojoumOrderDetails",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "订单详情",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/sojoumOrderRefund",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "申请退款",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -790,6 +706,13 @@
|
|||||||
"navigationBarTitleText": "好友赠送的礼包"
|
"navigationBarTitleText": "好友赠送的礼包"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "views/gift/receiveDone",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "收礼完成",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "views/myFavorite",
|
"path": "views/myFavorite",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -855,7 +778,7 @@
|
|||||||
{
|
{
|
||||||
"path": "views/index",
|
"path": "views/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "云灵AI智能助手",
|
"navigationBarTitleText": "云灵",
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
}
|
}
|
||||||
@@ -863,10 +786,24 @@
|
|||||||
{
|
{
|
||||||
"path": "views/history",
|
"path": "views/history",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "云灵AI智能助手",
|
"navigationBarTitleText": "云灵",
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/imageRecognition",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "拍照识图",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTextStyle": "white"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "views/imageRecognitionResult",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "云灵"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -964,6 +901,213 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"root": "pagesOrder",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "order/GoodsReturn/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "申请退款"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "order/Logistics/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "查看物流"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "order/OrderDetails/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "订单详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "order/ReturnList/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "退货列表"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"root": "pagesShop",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "shop/EvaluateList/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "评价列表"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "shop/GoodsCollection/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商品收藏"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "shop/GoodsEvaluate/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商品评价"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "shop/GoodsPromotion/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商品促销"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "shop/StoreList/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商家列表"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"root": "pagesUser",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "user/CustomerList/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "客服列表"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/History/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商品足迹",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/MemberUpgradeIntro/MemberUpgradeIntro",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "升级介绍"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/Message/Message",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "消息",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/MessageDetail/MessageDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "消息详情",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/ModifyPayPassword/ModifyPayPassword",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "评价列表"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/Points/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "积分"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/Recharge/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "充值"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/RetrievePassword/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "找回密码"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/UpgradeElectronicProtocol/UpgradeElectronicProtocol",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "升级电子协议"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/UpgradeProtocolDetail/UpgradeProtocolDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "升级电子协议详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/UserAccount/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "账户余额"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/UserBill/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "账单记录"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/UserFavorite/UserFavorite",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "我的喜欢"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/UserVip/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "用户等级"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/promotion/CashAudit/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "提现审核"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/promotion/CommissionDetails/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "提现审核"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/promotion/Poster/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "海报生成"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/promotion/PromoterList/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "分销列表",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/promotion/PromoterOrder/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "分销详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/promotion/UserCash/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "提现"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "user/promotion/UserPromotion/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "团队管理",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"preloadRule": {
|
"preloadRule": {
|
||||||
|
|||||||
+8
-15
@@ -49,21 +49,18 @@ export default {
|
|||||||
// 注释下面一行,会停留在启动页
|
// 注释下面一行,会停留在启动页
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.toLaunch();
|
this.toLaunch();
|
||||||
}, 2000)
|
}, 5000)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 未登录:静默处理登录,5秒后跳转业务页面
|
||||||
cookie.get("spread");
|
cookie.get("spread");
|
||||||
// this.toLaunch();
|
if (this.$deviceType != "app") {
|
||||||
if (this.$deviceType == "app") {
|
|
||||||
// this.toLaunch();
|
|
||||||
this.$yrouter.switchTab({
|
|
||||||
path: "/pages/home/index"
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//检查授权信息
|
//检查授权信息
|
||||||
this.checkUserInfo();
|
this.checkUserInfo();
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.toLaunch();
|
||||||
|
}, 5000);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(["changeAuthorization", "setUserInfo"]),
|
...mapActions(["changeAuthorization", "setUserInfo"]),
|
||||||
@@ -89,11 +86,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
login(loginInfo).finally(() => {
|
login(loginInfo);
|
||||||
this.$yrouter.switchTab({
|
|
||||||
path: "/pages/home/index"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="">
|
<view class="">
|
||||||
<video class="video" :show-fullscreen-btn="false" id="myVideo" autoplay :src="curPlayVideoUrl" @error="videoErrorCallback" controls></video>
|
<video
|
||||||
|
class="video"
|
||||||
|
:show-fullscreen-btn="false"
|
||||||
|
:direction="videoDirection"
|
||||||
|
id="myVideo"
|
||||||
|
autoplay
|
||||||
|
:src="curPlayVideoUrl"
|
||||||
|
@loadedmetadata="handleLoadedMetadata"
|
||||||
|
@error="videoErrorCallback"
|
||||||
|
controls
|
||||||
|
></video>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -15,12 +25,14 @@ export default {
|
|||||||
return {
|
return {
|
||||||
curPlayVideoUrl:'',
|
curPlayVideoUrl:'',
|
||||||
isVideoPopupShow:false,
|
isVideoPopupShow:false,
|
||||||
pageKeyId: ''
|
pageKeyId: '',
|
||||||
|
videoDirection: 90,
|
||||||
|
hasLoadedMetadata: false,
|
||||||
|
hasRequestedFullscreen: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onReady(res) {
|
onReady(res) {
|
||||||
this.videoContext = uni.createVideoContext('myVideo');
|
this.videoContext = uni.createVideoContext('myVideo');
|
||||||
this.videoContext.requestFullScreen();
|
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
if (!options.click) {
|
if (!options.click) {
|
||||||
@@ -32,6 +44,29 @@ export default {
|
|||||||
this.pageKeyId = `findVideo_videoId_${id}`
|
this.pageKeyId = `findVideo_videoId_${id}`
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleLoadedMetadata(e) {
|
||||||
|
const detail = e.detail || {}
|
||||||
|
const width = Number(detail.width) || 0
|
||||||
|
const height = Number(detail.height) || 0
|
||||||
|
|
||||||
|
if (height > width && width > 0) {
|
||||||
|
this.videoDirection = 0
|
||||||
|
} else {
|
||||||
|
this.videoDirection = 90
|
||||||
|
}
|
||||||
|
|
||||||
|
this.hasLoadedMetadata = true
|
||||||
|
this.enterFullScreen()
|
||||||
|
},
|
||||||
|
enterFullScreen() {
|
||||||
|
if (!this.videoContext || !this.hasLoadedMetadata || this.hasRequestedFullscreen) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.hasRequestedFullscreen = true
|
||||||
|
this.videoContext.requestFullScreen({
|
||||||
|
direction: this.videoDirection
|
||||||
|
})
|
||||||
|
},
|
||||||
videoErrorCallback: function(e) {
|
videoErrorCallback: function(e) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
content: e.target.errMsg,
|
content: e.target.errMsg,
|
||||||
|
|||||||
@@ -6,25 +6,44 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="list" v-if="list.length">
|
<view class="list" v-show="hasList">
|
||||||
<custom-waterfalls-flow :value="list" imageKey="cover">
|
<view class="video-waterfalls-wrap">
|
||||||
<view class="item" v-for="(item,index) in list" :key="index" slot="slot{{index}}" @click="goDetail(item)">
|
<view class="waterfalls-column">
|
||||||
<image class="cover" :src="item.cover" mode="widthFix"></image>
|
<view class="item" v-for="(lItem,lIndex) in leftList" :key="lIndex" @click="goDetail(lItem)">
|
||||||
|
<image class="cover" :src="lItem.cover" mode="widthFix" lazy-load></image>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="title more-t">{{ item.title }}</view>
|
<view class="title more-t">{{ lItem.title }}</view>
|
||||||
<view class="footer flex jc-between ai-center">
|
<view class="footer flex jc-between ai-center">
|
||||||
<view class="visit flex ai-center">
|
<view class="visit flex ai-center">
|
||||||
<image class="icon" style="margin-right: 8rpx" :src="item.storeLogo" mode="scaleToFill"></image>
|
<image class="icon" style="margin-right: 8rpx" :src="lItem.storeLogo" mode="scaleToFill"></image>
|
||||||
{{ item.storeName }}
|
{{ lItem.storeName }}
|
||||||
</view>
|
</view>
|
||||||
<image class="icon flex-0" :src="webUrl+'/20210806121203835373.png'" mode="scaleToFill"></image>
|
<image class="icon flex-0" :src="webUrl+'/20210806121203835373.png'" mode="scaleToFill"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</custom-waterfalls-flow>
|
</view>
|
||||||
|
<view class="waterfalls-column">
|
||||||
|
<view class="item" v-for="(rItem,rIndex) in rightList" :key="rIndex" @click="goDetail(rItem)">
|
||||||
|
<image class="cover" :src="rItem.cover" mode="widthFix" lazy-load></image>
|
||||||
|
<view class="content">
|
||||||
|
<view class="title more-t">{{ rItem.title }}</view>
|
||||||
|
<view class="footer flex jc-between ai-center">
|
||||||
|
<view class="visit flex ai-center">
|
||||||
|
<image class="icon" style="margin-right: 8rpx" :src="rItem.storeLogo" mode="scaleToFill"></image>
|
||||||
|
{{ rItem.storeName }}
|
||||||
|
</view>
|
||||||
|
<image class="icon flex-0" :src="webUrl+'/20210806121203835373.png'" mode="scaleToFill"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="v4-nodata" v-else>
|
<view class="loading-more" v-show="isWait">加载中...</view>
|
||||||
|
|
||||||
|
<view class="v4-nodata" v-show="showEmpty">
|
||||||
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/>
|
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/>
|
||||||
<view class="text">暂无数据</view>
|
<view class="text">暂无数据</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -36,6 +55,11 @@ import {getStoreVideoType, getArticleList} from '@/api/public'
|
|||||||
import {getVideoList} from '@/api/user'
|
import {getVideoList} from '@/api/user'
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
|
|
||||||
|
// 封面固定宽度(rpx)
|
||||||
|
const COVER_WIDTH = 332
|
||||||
|
// 每项除封面外的文字内容预估高度(rpx)
|
||||||
|
const TEXT_HEIGHT = 120
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [pageListenMixins],
|
mixins: [pageListenMixins],
|
||||||
data() {
|
data() {
|
||||||
@@ -46,11 +70,23 @@ export default {
|
|||||||
page: 1,
|
page: 1,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
keyword: '',
|
keyword: '',
|
||||||
list: [],
|
leftList: [],
|
||||||
|
rightList: [],
|
||||||
|
leftHeight: 0,
|
||||||
|
rightHeight: 0,
|
||||||
isWait: false,
|
isWait: false,
|
||||||
|
requestId: 0,
|
||||||
pageKeyId: Object.freeze('findVideoList')
|
pageKeyId: Object.freeze('findVideoList')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
hasList() {
|
||||||
|
return this.leftList.length + this.rightList.length > 0
|
||||||
|
},
|
||||||
|
showEmpty() {
|
||||||
|
return !this.isWait && !this.hasList
|
||||||
|
}
|
||||||
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
if (!options.click) {
|
if (!options.click) {
|
||||||
uni.switchTab({ url: '/pages/home/index' })
|
uni.switchTab({ url: '/pages/home/index' })
|
||||||
@@ -76,26 +112,72 @@ export default {
|
|||||||
changeType(item) {
|
changeType(item) {
|
||||||
this.type = item.value
|
this.type = item.value
|
||||||
this.page = 1
|
this.page = 1
|
||||||
this.list = []
|
// 使进行中的请求失效并解锁,避免切换时被上一次请求阻塞
|
||||||
|
this.requestId++
|
||||||
|
this.isWait = false
|
||||||
this.fetchList()
|
this.fetchList()
|
||||||
},
|
},
|
||||||
fetchList() {
|
resetList() {
|
||||||
|
this.leftList = []
|
||||||
|
this.rightList = []
|
||||||
|
this.leftHeight = 0
|
||||||
|
this.rightHeight = 0
|
||||||
|
},
|
||||||
|
async fetchList() {
|
||||||
if (this.isWait) return
|
if (this.isWait) return
|
||||||
|
const requestId = ++this.requestId
|
||||||
this.isWait = true
|
this.isWait = true
|
||||||
const params = {
|
const params = {
|
||||||
type: this.type,
|
type: this.type,
|
||||||
page: this.page,
|
page: this.page,
|
||||||
limit: this.limit
|
limit: this.limit
|
||||||
}
|
}
|
||||||
getVideoList(params).then(res => {
|
try {
|
||||||
|
const res = await getVideoList(params)
|
||||||
|
// 请求已被更新的请求(如切换分类)取代,丢弃本次结果
|
||||||
|
if (requestId !== this.requestId) return
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
for (let i = 0; i < res.data.length; i++) {
|
const items = res.data
|
||||||
res.data[i].hide = true
|
for (let i = 0; i < items.length; i++) {
|
||||||
this.list.push(res.data[i])
|
items[i].hide = true
|
||||||
}
|
}
|
||||||
}
|
// 并行获取所有封面高度,完成后一次性替换列表,避免闪现空列表
|
||||||
this.isWait = false
|
const heights = await Promise.all(items.map(item => this.getImageHeight(item.cover)))
|
||||||
|
if (requestId !== this.requestId) return
|
||||||
|
if (this.page === 1) this.resetList()
|
||||||
|
items.forEach((item, i) => {
|
||||||
|
this.pushToColumn(item, heights[i] + TEXT_HEIGHT)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// 忽略请求或图片尺寸获取失败
|
||||||
|
} finally {
|
||||||
|
if (requestId === this.requestId) {
|
||||||
|
this.isWait = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getImageHeight(src) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
uni.getImageInfo({
|
||||||
|
src,
|
||||||
|
success: res => {
|
||||||
|
resolve(res.height / res.width * COVER_WIDTH)
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
resolve(COVER_WIDTH)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
pushToColumn(item, height) {
|
||||||
|
if (this.leftHeight <= this.rightHeight) {
|
||||||
|
this.leftList.push(item)
|
||||||
|
this.leftHeight += height
|
||||||
|
} else {
|
||||||
|
this.rightList.push(item)
|
||||||
|
this.rightHeight += height
|
||||||
|
}
|
||||||
},
|
},
|
||||||
goDetail(item) {
|
goDetail(item) {
|
||||||
this.$yrouter.push("/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl=" + item.video + '&id=' + item.id + '&click=1')
|
this.$yrouter.push("/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl=" + item.video + '&id=' + item.id + '&click=1')
|
||||||
@@ -114,6 +196,7 @@ export default {
|
|||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.active {
|
.active {
|
||||||
@@ -125,13 +208,23 @@ export default {
|
|||||||
.list {
|
.list {
|
||||||
margin: 28rpx 32rpx;
|
margin: 28rpx 32rpx;
|
||||||
|
|
||||||
|
.video-waterfalls-wrap {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.waterfalls-column {
|
||||||
|
width: 332rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
border-radius: 4rpx;
|
border-radius: 4rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
|
||||||
.cover {
|
.cover {
|
||||||
width: 332rpx;
|
width: 332rpx;
|
||||||
//height: 200rpx;
|
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,4 +267,11 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loading-more {
|
||||||
|
padding: 24rpx 0;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
+144
-24
@@ -102,11 +102,14 @@
|
|||||||
<view class="v12-primary-border v12-radius-8 v12-px-1">{{ item.couponName }}</view>
|
<view class="v12-primary-border v12-radius-8 v12-px-1">{{ item.couponName }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="v12-justify-between v12-align-center">
|
<view class="v12-justify-between v12-align-center">
|
||||||
<view class="v12-font-40 v12-font-bold v12-primary-text">
|
<view class="v12-font-40 v12-font-bold v12-primary-text" v-if="!item.isNegotiable">
|
||||||
<text class="">¥</text>
|
<text class="">¥</text>
|
||||||
<text class="price-txt price-red">{{ item.price }}</text>
|
<text class="price-txt price-red">{{ item.price }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn">
|
<view v-if="item.isNegotiable === 1" class="v12-primary-text v12-font-32 v12-font-weight" @clicks.stop="goRoom(item)">
|
||||||
|
价格面议
|
||||||
|
</view>
|
||||||
|
<view class="btn" @click.stop="addToCart(item, 'productId')">
|
||||||
<image
|
<image
|
||||||
:src="webUrl + '/home/icon-cart.png'"
|
:src="webUrl + '/home/icon-cart.png'"
|
||||||
class="img-icon"
|
class="img-icon"
|
||||||
@@ -157,11 +160,18 @@
|
|||||||
>
|
>
|
||||||
<view class="v12-align-center">
|
<view class="v12-align-center">
|
||||||
<CheckboxIcon
|
<CheckboxIcon
|
||||||
|
v-if="good['truePrice'] !== null || isEdit"
|
||||||
:default-state="good['state']"
|
:default-state="good['state']"
|
||||||
:mark="[index, gIndex]"
|
:mark="[index, gIndex]"
|
||||||
style="margin-right: 24rpx;"
|
style="margin-right: 24rpx;"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
/>
|
/>
|
||||||
|
<CheckboxIcon
|
||||||
|
v-else
|
||||||
|
:default-state="good['state']"
|
||||||
|
:mark="[index, gIndex]"
|
||||||
|
style="margin-right: 24rpx;"
|
||||||
|
/>
|
||||||
<image
|
<image
|
||||||
v-if="good['productInfo']['attrInfo']['image']"
|
v-if="good['productInfo']['attrInfo']['image']"
|
||||||
:src="good['productInfo']['attrInfo']['image']"
|
:src="good['productInfo']['attrInfo']['image']"
|
||||||
@@ -224,7 +234,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:input>
|
<template v-slot:input>
|
||||||
<view class="num-input tc v12-num-input">{{ good['cartNum'] }}</view>
|
<input type="number" class="num-input tc v12-num-input" v-model="good['cartNum']" @change="e => inputChangeHandle(index, gIndex, good, e)"/>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:plus>
|
<template v-slot:plus>
|
||||||
<view class="v12-plus-btn v12-font-bold flex jc-center ai-center v12-primary">
|
<view class="v12-plus-btn v12-font-bold flex jc-center ai-center v12-primary">
|
||||||
@@ -299,14 +309,14 @@
|
|||||||
:key="attr"
|
:key="attr"
|
||||||
:class="{
|
:class="{
|
||||||
'on': attr.check,
|
'on': attr.check,
|
||||||
'disabled': getAttrItemData(attr.attr).stock === 0
|
'disabled': getAttrItemData1(attr.attr).stock === 0
|
||||||
}"
|
}"
|
||||||
class="attr"
|
class="attr"
|
||||||
@click="attrItemClick(attr, attrIndex, index)"
|
@click="attrItemClick(attr, attrIndex, index)"
|
||||||
>
|
>
|
||||||
{{ attr.attr }}
|
{{ attr.attr }}
|
||||||
<text
|
<text
|
||||||
v-if="getAttrItemData(attr.attr).stock === 0"
|
v-if="getAttrItemData1(attr.attr).stock === 0"
|
||||||
class="tag"
|
class="tag"
|
||||||
>缺货</text>
|
>缺货</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -358,28 +368,41 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
<ProductWindow
|
||||||
|
ref="attrWindow"
|
||||||
|
:attr="attr"
|
||||||
|
:cartNum="cart_num"
|
||||||
|
:showOk="true"
|
||||||
|
@changeFun="changeFun"
|
||||||
|
@ok="handleOk(() => this.getCart())"
|
||||||
|
/>
|
||||||
<xdd-tabbar :curr-index="2" />
|
<xdd-tabbar :curr-index="2" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import XddTabbar from '@/components/xdd-tabbar'
|
import XddTabbar from '@/components/xdd-tabbar'
|
||||||
|
import ProductWindow from '@/components/ProductWindow'
|
||||||
import {getAddressList, getUserLike} from "@/api/user";
|
import {getAddressList, getUserLike} from "@/api/user";
|
||||||
import {
|
import {
|
||||||
changeCartNum,
|
changeCartNum,
|
||||||
getCartGroup,
|
getCartGroup,
|
||||||
postCartDel,
|
postCartDel,
|
||||||
|
postCartAdd,
|
||||||
getCartGoodAttr,
|
getCartGoodAttr,
|
||||||
cartGoodChangeAttr
|
cartGoodChangeAttr
|
||||||
} from '@/api/store'
|
} from '@/api/store'
|
||||||
import CheckboxIcon from '@/components/CheckboxIcon.vue'
|
import CheckboxIcon from '@/components/CheckboxIcon.vue'
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
|
import goCartMixin from '@/mixins/goCartMixins'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
import cookie from "@/utils/store/cookie"
|
import cookie from "@/utils/store/cookie"
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
CheckboxIcon,
|
CheckboxIcon,
|
||||||
XddTabbar
|
XddTabbar,
|
||||||
|
ProductWindow
|
||||||
},
|
},
|
||||||
mixins: [pageListenMixins],
|
mixins: [pageListenMixins, goCartMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
@@ -396,15 +419,18 @@ export default {
|
|||||||
},
|
},
|
||||||
showAttr: false,
|
showAttr: false,
|
||||||
pageKeyId: Object.freeze('landmarkGoodsIndex'),
|
pageKeyId: Object.freeze('landmarkGoodsIndex'),
|
||||||
|
cartSelectedIdsCacheKey: Object.freeze('cartSelectedIds'),
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
addressList:[],
|
addressList:[],
|
||||||
addressInfo: {},
|
addressInfo: {},
|
||||||
userLikeList: [],
|
userLikeList: [],
|
||||||
|
selectedCartIds: [],
|
||||||
// 是否已登录
|
// 是否已登录
|
||||||
isNoLogin: false
|
isNoLogin: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapGetters(['isLogin']),
|
||||||
total() {
|
total() {
|
||||||
let price = 0
|
let price = 0
|
||||||
this.list.forEach(item => {
|
this.list.forEach(item => {
|
||||||
@@ -425,11 +451,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.selectedCartIds = this.getSelectedCartIds()
|
||||||
this.getCart()
|
this.getCart()
|
||||||
this.getAddress()
|
this.getAddress()
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.isEdit = false
|
this.isEdit = false
|
||||||
|
uni.$emit('updateUnreadMessageCount')
|
||||||
if (!this.isLoad) {
|
if (!this.isLoad) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -448,6 +476,25 @@ export default {
|
|||||||
this.pageToHideHandle()
|
this.pageToHideHandle()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
goRoom(item) {
|
||||||
|
return
|
||||||
|
console.log(item);
|
||||||
|
const params = {
|
||||||
|
goodsId: item.id,
|
||||||
|
goodsName: item.storeName,
|
||||||
|
skuStr: '',
|
||||||
|
price: item.price,
|
||||||
|
seckillId: '',
|
||||||
|
cover: item.image,
|
||||||
|
goodsData: '',
|
||||||
|
seckillData: '',
|
||||||
|
isNegotiable: item.isNegotiable
|
||||||
|
}
|
||||||
|
const name = ''
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pkg_common/views/room?id=${this.storeInfo.merId}&name=${name}¶ms=${JSON.stringify(params)}`
|
||||||
|
})
|
||||||
|
},
|
||||||
toLoginHandle() {
|
toLoginHandle() {
|
||||||
cookie.set('redirect', '/pages/cart')
|
cookie.set('redirect', '/pages/cart')
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
@@ -551,22 +598,75 @@ export default {
|
|||||||
isInvalid: true
|
isInvalid: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.list = res.data['valid'].concat(invalid)
|
this.list = this.restoreCartState(res.data['valid'].concat(invalid))
|
||||||
this.handleAll(false)
|
|
||||||
const _res = await getUserLike()
|
const _res = await getUserLike()
|
||||||
this.userLikeList = _res.data
|
this.userLikeList = _res.data
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleAll(state) {
|
getSelectedCartIds() {
|
||||||
this.isAll = state
|
const ids = uni.getStorageSync(this.cartSelectedIdsCacheKey)
|
||||||
|
return Array.isArray(ids) ? ids : []
|
||||||
|
},
|
||||||
|
syncSelectedCartIds() {
|
||||||
|
const ids = []
|
||||||
|
this.list.forEach(item => {
|
||||||
|
item.carts.forEach(good => {
|
||||||
|
if (good.state) {
|
||||||
|
ids.push(good.id)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.selectedCartIds = ids
|
||||||
|
uni.setStorageSync(this.cartSelectedIdsCacheKey, ids)
|
||||||
|
},
|
||||||
|
refreshSelectionState() {
|
||||||
|
let hasSelectableGoods = false
|
||||||
|
let isAll = true
|
||||||
this.list = this.list.map(item => {
|
this.list = this.list.map(item => {
|
||||||
item.state = state
|
const selectableCarts = item.carts.filter(() => !item.isInvalid || this.isEdit)
|
||||||
|
if (selectableCarts.length > 0) {
|
||||||
|
hasSelectableGoods = true
|
||||||
|
}
|
||||||
|
item.state = selectableCarts.length > 0 && selectableCarts.every(good => good.state)
|
||||||
|
if (selectableCarts.length > 0 && !item.state) {
|
||||||
|
isAll = false
|
||||||
|
}
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
this.isAll = hasSelectableGoods && isAll
|
||||||
|
this.syncSelectedCartIds()
|
||||||
|
},
|
||||||
|
restoreCartState(list) {
|
||||||
|
const selectedCartIds = new Set(this.selectedCartIds)
|
||||||
|
const nextList = list.map(item => {
|
||||||
|
const canSelect = !item.isInvalid || this.isEdit
|
||||||
|
const carts = item.carts.map(good => {
|
||||||
|
return {
|
||||||
|
...good,
|
||||||
|
state: canSelect ? selectedCartIds.has(good.id) : false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
carts,
|
||||||
|
state: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.list = nextList
|
||||||
|
this.refreshSelectionState()
|
||||||
|
return this.list
|
||||||
|
},
|
||||||
|
handleAll(state) {
|
||||||
|
this.list = this.list.map(item => {
|
||||||
|
const canSelect = !item.isInvalid || this.isEdit
|
||||||
|
item.state = canSelect ? state : false
|
||||||
item.carts = item.carts.map(good => {
|
item.carts = item.carts.map(good => {
|
||||||
good.state = state
|
good.state = canSelect ? state : false
|
||||||
return good
|
return good
|
||||||
})
|
})
|
||||||
return item
|
return item
|
||||||
})
|
})
|
||||||
|
this.refreshSelectionState()
|
||||||
},
|
},
|
||||||
navToStore(id) {
|
navToStore(id) {
|
||||||
if (id === 0) {
|
if (id === 0) {
|
||||||
@@ -585,6 +685,7 @@ export default {
|
|||||||
if (mark.length === 1) {
|
if (mark.length === 1) {
|
||||||
if (mark[0] === -1) {
|
if (mark[0] === -1) {
|
||||||
this.handleAll(state)
|
this.handleAll(state)
|
||||||
|
return
|
||||||
} else {
|
} else {
|
||||||
this.list[mark[0]]['state'] = state
|
this.list[mark[0]]['state'] = state
|
||||||
this.list[mark[0]]['carts'] = this.list[mark[0]]['carts'].map(good => {
|
this.list[mark[0]]['carts'] = this.list[mark[0]]['carts'].map(good => {
|
||||||
@@ -604,15 +705,34 @@ export default {
|
|||||||
})
|
})
|
||||||
this.list[mark[0]]['state'] = count === length
|
this.list[mark[0]]['state'] = count === length
|
||||||
}
|
}
|
||||||
let shopCheckNumber = 0
|
this.refreshSelectionState()
|
||||||
this.list.map(item => {
|
},
|
||||||
if (item.state) {
|
inputChangeHandle(index, gIndex, good, e) {
|
||||||
shopCheckNumber++
|
|
||||||
|
if(+good.cartNum > good['productInfo']['attrInfo']['stock']) {
|
||||||
|
good.cartNum = good['productInfo']['attrInfo']['stock']
|
||||||
}
|
}
|
||||||
|
if(good.cartNum < 1) {
|
||||||
|
good.cartNum = 1
|
||||||
|
}
|
||||||
|
const value = +good.cartNum
|
||||||
|
console.log('index', value);
|
||||||
|
const id = good.id
|
||||||
|
// uni.showLoading()
|
||||||
|
changeCartNum(id, value).then(res => {
|
||||||
|
const { success } = res
|
||||||
|
if (success) {
|
||||||
|
// uni.hideLoading()
|
||||||
|
this.$set(this.list[index].carts[gIndex], 'cartNum', value)
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
}, 3000)
|
||||||
})
|
})
|
||||||
this.isAll = shopCheckNumber === this.list.length
|
|
||||||
},
|
},
|
||||||
changeNumHandle(index, gIndex, good, e) {
|
changeNumHandle(index, gIndex, good, e) {
|
||||||
|
console.log(good);
|
||||||
const { type } = e
|
const { type } = e
|
||||||
const value = good.cartNum + (type === 'plus' ? 1 : -1)
|
const value = good.cartNum + (type === 'plus' ? 1 : -1)
|
||||||
console.log('index', value);
|
console.log('index', value);
|
||||||
@@ -711,7 +831,7 @@ export default {
|
|||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getAttrItemData(attr) {
|
getAttrItemData1(attr) {
|
||||||
let result = {
|
let result = {
|
||||||
stock: 0
|
stock: 0
|
||||||
}
|
}
|
||||||
@@ -850,8 +970,8 @@ export default {
|
|||||||
border-radius: 28rpx 0rpx 0rpx 28rpx;
|
border-radius: 28rpx 0rpx 0rpx 28rpx;
|
||||||
border: 1px solid #E6E6E6;
|
border: 1px solid #E6E6E6;
|
||||||
background-color: rgba(208,208,208,0.39);
|
background-color: rgba(208,208,208,0.39);
|
||||||
height: 40rpx;
|
height: 44rpx;
|
||||||
width: 40rpx;
|
width: 44rpx;
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
@@ -859,8 +979,8 @@ export default {
|
|||||||
border-radius: 0rpx 28rpx 28rpx 0rpx;
|
border-radius: 0rpx 28rpx 28rpx 0rpx;
|
||||||
border: 1px solid #C52733;
|
border: 1px solid #C52733;
|
||||||
background-color: #C52733;
|
background-color: #C52733;
|
||||||
height: 40rpx;
|
height: 44rpx;
|
||||||
width: 40rpx;
|
width: 44rpx;
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
@@ -971,7 +1091,7 @@ view {
|
|||||||
right: 0;
|
right: 0;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
border-radius: 26rpx;
|
border-radius: 26rpx;
|
||||||
|
z-index: 9;
|
||||||
.btn-submit {
|
.btn-submit {
|
||||||
width: 196rpx;
|
width: 196rpx;
|
||||||
height: 64rpx;
|
height: 64rpx;
|
||||||
|
|||||||
@@ -341,10 +341,11 @@ export default {
|
|||||||
},
|
},
|
||||||
async getMapData() {
|
async getMapData() {
|
||||||
const map = await getLocation()
|
const map = await getLocation()
|
||||||
if (map) {
|
if (map.length > 1) {
|
||||||
const {latitude, longitude} = map[1]
|
const {latitude, longitude} = map[1]
|
||||||
const address = await getCurAddress(latitude, longitude)
|
getCurAddress(latitude, longitude, address => {
|
||||||
this.location = address[1].data.result.ad_info.city
|
this.location = address.city
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
@@ -383,20 +384,23 @@ export default {
|
|||||||
this.mescroll && this.mescroll.triggerDownScroll()
|
this.mescroll && this.mescroll.triggerDownScroll()
|
||||||
},
|
},
|
||||||
search() {
|
search() {
|
||||||
if(this.keyword === '') return
|
const keyword = (this.keyword || '').trim()
|
||||||
this.listGroup.findIndex((group, index) => {
|
if (!keyword) return
|
||||||
let result
|
const matchIndex = this.listGroup.findIndex(group => {
|
||||||
group.city.forEach(item => {
|
const cityList = Array.isArray(group.city) ? group.city : []
|
||||||
result = item.cityName.indexOf(this.keyword, 0)
|
return cityList.some(item => item && item.cityName && item.cityName.indexOf(keyword) !== -1)
|
||||||
if (result !== -1) {
|
|
||||||
this.asideTap(index);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
if (result !== -1) {
|
if (matchIndex !== -1) {
|
||||||
return result
|
this.keyword = keyword
|
||||||
|
this.asideTap(matchIndex)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
if (matchIndex === -1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '未找到该城市,请重新输入城市名称',
|
||||||
|
icon: 'none'
|
||||||
})
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
select(item) {
|
select(item) {
|
||||||
if (this.type === 0 && item.hasData === 0) return
|
if (this.type === 0 && item.hasData === 0) return
|
||||||
|
|||||||
+9
-46
@@ -74,7 +74,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import config from '@/utils/mapConfig'
|
import { getCurAddress, getLocation } from "@/utils/common"
|
||||||
import {
|
import {
|
||||||
getHotelTypeList,
|
getHotelTypeList,
|
||||||
getHotelList
|
getHotelList
|
||||||
@@ -124,56 +124,19 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取当前定位地址
|
//获取当前定位地址
|
||||||
getCurAddress() {
|
async getCurAddressFn() {
|
||||||
const that = this
|
const that = this
|
||||||
//定位
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '定位中...'
|
title: '定位中...'
|
||||||
})
|
})
|
||||||
uni.getLocation({
|
const map = await getLocation()
|
||||||
type: 'wgs84',
|
if (map.length > 1) {
|
||||||
success: function(res) {
|
const {latitude, longitude} = map[1]
|
||||||
let latitude = res.latitude
|
getCurAddress(latitude, longitude, address => {
|
||||||
let longitude = res.longitude
|
that.cityName = address.city
|
||||||
// #ifdef H5
|
that.paramCity = address.city
|
||||||
Vue.jsonp(
|
|
||||||
'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude + '&key=' +
|
|
||||||
config.key, {
|
|
||||||
output: 'jsonp',
|
|
||||||
}).then(json => {
|
|
||||||
// Success.
|
|
||||||
uni.hideLoading();
|
|
||||||
that.cityName = json.result.ad_info.city
|
|
||||||
that.paramCity = json.result.ad_info.city
|
|
||||||
//定位成功刷新数据
|
|
||||||
that.fetchList()
|
|
||||||
}).catch(err => {
|
|
||||||
uni.hideLoading()
|
|
||||||
})
|
})
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifndef H5
|
|
||||||
uni.request({
|
|
||||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude +
|
|
||||||
'&key=' + config.key,
|
|
||||||
success: function(res) {
|
|
||||||
uni.hideLoading();
|
|
||||||
|
|
||||||
that.cityName = res.data.result.ad_info.city
|
|
||||||
that.paramCity = res.data.result.ad_info.city
|
|
||||||
//定位成功刷新数据
|
|
||||||
that.fetchList()
|
|
||||||
},
|
|
||||||
fail: function(res) {
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
fail: function(res) {
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
fetchTypeList() {
|
fetchTypeList() {
|
||||||
this.hotelList = []
|
this.hotelList = []
|
||||||
@@ -195,7 +158,7 @@ export default {
|
|||||||
this.fetchList()
|
this.fetchList()
|
||||||
uni.removeStorageSync('cityName')
|
uni.removeStorageSync('cityName')
|
||||||
} else {
|
} else {
|
||||||
this.getCurAddress()
|
this.getCurAddressFn()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
+78
-18
@@ -76,7 +76,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="type-banner-wrap">
|
<view class="type-banner-wrap" v-if="typeIndex !== -1">
|
||||||
<view v-if="currType.titleImage" class="title">
|
<view v-if="currType.titleImage" class="title">
|
||||||
<image
|
<image
|
||||||
:src="currType.titleImage"
|
:src="currType.titleImage"
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
class="img"
|
class="img"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="currType.carousel" class="slider-wrap">
|
<view v-if="hotelBanner.length" class="slider-wrap">
|
||||||
<swiper
|
<swiper
|
||||||
indicatorDots="true"
|
indicatorDots="true"
|
||||||
indicator-color="rgba(255, 255, 255, .3)"
|
indicator-color="rgba(255, 255, 255, .3)"
|
||||||
@@ -94,12 +94,12 @@
|
|||||||
style="height: 330rpx;"
|
style="height: 330rpx;"
|
||||||
>
|
>
|
||||||
<block
|
<block
|
||||||
v-for="(item, bannerIndex) in currType.carousel"
|
v-for="(item, bannerIndex) in hotelBanner"
|
||||||
:key="bannerIndex"
|
:key="bannerIndex"
|
||||||
>
|
>
|
||||||
<swiper-item>
|
<swiper-item>
|
||||||
<view class="swiper-item" @click="typeBannerItemClick(item)">
|
<view class="swiper-item" @click="typeBannerItemClick(item)">
|
||||||
<image :src="item.carouselImage" class="img" />
|
<image :src="item.bannerImage" class="img" />
|
||||||
</view>
|
</view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</block>
|
</block>
|
||||||
@@ -114,15 +114,16 @@
|
|||||||
<view class="icon-box"><u-icon name="arrow-rightward" color="#fff" size="8"></u-icon></view>
|
<view class="icon-box"><u-icon name="arrow-rightward" color="#fff" size="8"></u-icon></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="v4-nodata" v-if="townList.length === 0">
|
<goo-skeleton v-if="!townLoaded" :show-avatar="false"/>
|
||||||
|
<view class="v4-nodata" v-else-if="townList.length === 0">
|
||||||
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/>
|
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/>
|
||||||
<view class="text">暂无数据</view>
|
<view class="text">暂无数据</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="body" v-else>
|
<view class="body" v-else>
|
||||||
<view class="v12-justify-between v12-align-center">
|
<view class="v12-justify-between v12-align-center" v-if="hotelList.length > 0">
|
||||||
<text class="v12-font-bold" v-if="currType.carousel">推荐</text>
|
<text class="v12-font-bold" v-if="hotelBanner.length">推荐</text>
|
||||||
<view class="v12-dark1-text v12-font-28 v12-align-center" @click="handleRefresh">
|
<view class="v12-dark1-text v12-font-28 v12-align-center refresh-btn" @click="handleRefresh">
|
||||||
<u-icon name="reload"></u-icon>
|
<u-icon name="reload"></u-icon>
|
||||||
换一换
|
换一换
|
||||||
</view>
|
</view>
|
||||||
@@ -163,22 +164,28 @@
|
|||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<FunctionGuide @hide="setGuide('findFunIndex')" :maxStep="3" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
|
<FunctionGuide @hide="setGuide('findFunIndex')" :maxStep="3" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
|
||||||
|
<AiEntrance
|
||||||
|
:city-name="cityName"
|
||||||
|
/>
|
||||||
<xdd-tabbar :curr-index="4" />
|
<xdd-tabbar :curr-index="4" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getHotelList, getHotelTypeList, getAncientTownIcon, getAncientTownList } from "@/api/inn.js"
|
import { getHotelList, getHotelTypeList, getAncientTownIcon, getAncientTownList, getHotelBanner } from "@/api/inn.js"
|
||||||
|
import { fetchCity } from "@/api/wenwan"
|
||||||
import { getCurAddress, getLocation } from "@/utils/common"
|
import { getCurAddress, getLocation } from "@/utils/common"
|
||||||
import FunHotelItem from './components/HotelItem'
|
import FunHotelItem from './components/HotelItem'
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
import XddTabbar from '@/components/xdd-tabbar'
|
import XddTabbar from '@/components/xdd-tabbar'
|
||||||
import FunctionGuide from '@/components/FunctionGuide'
|
import FunctionGuide from '@/components/FunctionGuide'
|
||||||
|
import AiEntrance from '@/components/aiChat/entrance'
|
||||||
import GuideMixins from '@/mixins/GuideMixins'
|
import GuideMixins from '@/mixins/GuideMixins'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
FunHotelItem,
|
FunHotelItem,
|
||||||
XddTabbar,
|
XddTabbar,
|
||||||
FunctionGuide
|
FunctionGuide,
|
||||||
|
AiEntrance
|
||||||
},
|
},
|
||||||
mixins: [pageListenMixins, GuideMixins],
|
mixins: [pageListenMixins, GuideMixins],
|
||||||
data() {
|
data() {
|
||||||
@@ -197,7 +204,11 @@ export default {
|
|||||||
isNext: false,
|
isNext: false,
|
||||||
townConfig: {},
|
townConfig: {},
|
||||||
townList: [],
|
townList: [],
|
||||||
randomSeed: null
|
townLoaded: false,
|
||||||
|
randomSeed: null,
|
||||||
|
hotelBanner: [],
|
||||||
|
goodCityId: '',
|
||||||
|
cityOptions: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -218,8 +229,12 @@ export default {
|
|||||||
this.fetchList(random, this.randomSeed)
|
this.fetchList(random, this.randomSeed)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
this.currType = {}
|
this.currType = {}
|
||||||
|
if (options && options.city) {
|
||||||
|
this.goodCityId = options.city
|
||||||
|
}
|
||||||
|
this.initGoodCity()
|
||||||
getHotelTypeList().then(({data}) => {
|
getHotelTypeList().then(({data}) => {
|
||||||
this.typeList = data
|
this.typeList = data
|
||||||
this.currType = this.typeIndex === -1 ? {} : data[this.typeIndex]
|
this.currType = this.typeIndex === -1 ? {} : data[this.typeIndex]
|
||||||
@@ -229,6 +244,7 @@ export default {
|
|||||||
this.queryGuide('findFunIndex')
|
this.queryGuide('findFunIndex')
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
uni.$emit('updateUnreadMessageCount')
|
||||||
const memCityName = uni.getStorageSync('cityName')
|
const memCityName = uni.getStorageSync('cityName')
|
||||||
// this.typeIndex = 0
|
// this.typeIndex = 0
|
||||||
this.name = ''
|
this.name = ''
|
||||||
@@ -242,6 +258,7 @@ export default {
|
|||||||
cityName: {
|
cityName: {
|
||||||
handler(value) {
|
handler(value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
|
this.updateGoodCityId()
|
||||||
this.search()
|
this.search()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -440,6 +457,27 @@ export default {
|
|||||||
this.townConfig = res.data
|
this.townConfig = res.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
initGoodCity() {
|
||||||
|
fetchCity(2).then(({ data }) => {
|
||||||
|
const group = data && data.group ? data.group : []
|
||||||
|
const list = []
|
||||||
|
group.forEach(item => {
|
||||||
|
if (item.city && item.city.length) {
|
||||||
|
list.push(...item.city)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.cityOptions = list
|
||||||
|
this.updateGoodCityId()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
updateGoodCityId() {
|
||||||
|
if (!this.cityOptions.length || !this.cityName) return
|
||||||
|
const found = this.cityOptions.find(item => item.cityName === this.cityName)
|
||||||
|
if (found) {
|
||||||
|
this.goodCityId = found.id || found.cityId || this.goodCityId
|
||||||
|
this.fetchHotelBanner()
|
||||||
|
}
|
||||||
|
},
|
||||||
goCity() {
|
goCity() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/chose-city/chose-city?type=2&city=${this.cityName}`
|
url: `/pages/chose-city/chose-city?type=2&city=${this.cityName}`
|
||||||
@@ -452,13 +490,11 @@ export default {
|
|||||||
},
|
},
|
||||||
async getMapData() {
|
async getMapData() {
|
||||||
const map = await getLocation()
|
const map = await getLocation()
|
||||||
if (map.length > 1) {
|
if (map.length > 1 && !this.cityName) {
|
||||||
const {latitude, longitude} = map[1]
|
const {latitude, longitude} = map[1]
|
||||||
const address = await getCurAddress(latitude, longitude)
|
getCurAddress(latitude, longitude, address => {
|
||||||
if(!this.cityName) {
|
this.cityName = address.city
|
||||||
this.cityName = address[1].data.result.ad_info.city
|
})
|
||||||
}
|
|
||||||
// this.search()
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tapType(index) {
|
tapType(index) {
|
||||||
@@ -485,6 +521,8 @@ export default {
|
|||||||
}
|
}
|
||||||
getAncientTownList(params).then(res => {
|
getAncientTownList(params).then(res => {
|
||||||
this.townList = res.data.records
|
this.townList = res.data.records
|
||||||
|
}).finally(() => {
|
||||||
|
this.townLoaded = true
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -528,6 +566,24 @@ export default {
|
|||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
fetchHotelBanner() {
|
||||||
|
if (!this.goodCityId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const params = {
|
||||||
|
goodCityId: this.goodCityId
|
||||||
|
}
|
||||||
|
getHotelBanner(params).then(res => {
|
||||||
|
const { success, data } = res
|
||||||
|
if (success && data) {
|
||||||
|
if (Array.isArray(data.hotelBanner)) {
|
||||||
|
this.hotelBanner = data.hotelBanner
|
||||||
|
} else if (Array.isArray(data)) {
|
||||||
|
this.hotelBanner = data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
typeBannerItemClick(item) {
|
typeBannerItemClick(item) {
|
||||||
if (!item.hotelId) return
|
if (!item.hotelId) return
|
||||||
uni.navigateTo({ url: `/pagesInn/inn/innHome?id=${item.hotelId}` })
|
uni.navigateTo({ url: `/pagesInn/inn/innHome?id=${item.hotelId}` })
|
||||||
@@ -708,6 +764,10 @@ export default {
|
|||||||
background: #f5f5f5;
|
background: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.refresh-btn {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.city-box {
|
.city-box {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
:src="webUrl + '/20230803152147141807.png'"
|
:src="webUrl + '/20230803152147141807.png'"
|
||||||
class="icon"
|
class="icon"
|
||||||
/>
|
/>
|
||||||
<text class="seeNum-txt v12-font-28">{{ item.pv }}</text>
|
<text class="seeNum-txt v12-font-28">{{ $formatCount(item.pv) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<image
|
<image
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
v-show="item.zan > 0"
|
v-show="item.zan > 0"
|
||||||
:class="item.hasZan ? 'on' : ''"
|
:class="item.hasZan ? 'on' : ''"
|
||||||
class="seeNum-txt v12-font-28 v12-ml-1"
|
class="seeNum-txt v12-font-28 v12-ml-1"
|
||||||
>{{ item.zan }}</text
|
>{{ $formatCount(item.zan) }}</text
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
+426
-797
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,454 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="pkg-product-land-mark" v-if="mapData">
|
|
||||||
<view class="top-box" :style="{'backgroundColor':topBoxBgColor}">
|
|
||||||
<view class="view-box">
|
|
||||||
<view class="search-box flex ai-center">
|
|
||||||
<input
|
|
||||||
v-model="keyword"
|
|
||||||
type="text"
|
|
||||||
placeholder="搜索商品"
|
|
||||||
placeholder-style="color:#999"
|
|
||||||
@confirm="search()"
|
|
||||||
/>
|
|
||||||
<image
|
|
||||||
:src="webUrl+'/20231223183627184005.png'"
|
|
||||||
mode="scaleToFill"
|
|
||||||
style="width:30rpx;height:30rpx"
|
|
||||||
@click="search()"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="map-box">
|
|
||||||
<image class="img-map" :src="mapData.mapImage" mode="widthFix"/>
|
|
||||||
|
|
||||||
<view
|
|
||||||
v-for="(item, index) in mapLocations"
|
|
||||||
:key="index"
|
|
||||||
class="item"
|
|
||||||
:style="{'left':item.gx+'rpx','top':item.gy+'rpx'}"
|
|
||||||
@click="goGoods(item.productId)"
|
|
||||||
>
|
|
||||||
<view class="round">
|
|
||||||
<view class="line" :class="'line-'+directionClass[item.labelDirection]"></view>
|
|
||||||
</view>
|
|
||||||
<view class="label flex ai-end" :class="'label-'+directionClass[item.labelDirection]">
|
|
||||||
<image class="cover flex-0" :src="item.mapImage" mode="scaleToFill" v-if="item.labelDirection===4"/>
|
|
||||||
<view class="title flex ai-center">{{ item.mapTitle }}</view>
|
|
||||||
<image class="cover flex-0" :src="item.mapImage" mode="scaleToFill" v-if="item.labelDirection!==4"/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="nav flex">
|
|
||||||
<view class="flex flex-0 ai-center" :class="{'active': navIndex===index}" v-for="(item,index) in navList"
|
|
||||||
:key="index" @click="changeNav(index)">{{ item.provinceName }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="main-box" v-if="mapData.recommended.storeImage"
|
|
||||||
@click="goGoods(mapData.recommended.productId)">
|
|
||||||
<image class="bg-main" :src="mapData.recommended.storeImage" mode="scaleToFill"/>
|
|
||||||
<view class="box-mask flex flex-col jc-end">
|
|
||||||
<view class="one-t bold">{{ mapData.recommended.title }}</view>
|
|
||||||
<view class="more-t">{{ mapData.recommended.description }}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="list-box flex flex-wrap">
|
|
||||||
<view class="item" v-for="item in goods" :key="item.id" @click="goGoods(item.productId)">
|
|
||||||
<image :src="item.storeImage" mode="scaleToFill"/>
|
|
||||||
<view class="content flex flex-col jc-between">
|
|
||||||
<view class="more-t bold">{{ item.title }}</view>
|
|
||||||
<view class="flex jc-between ai-center">
|
|
||||||
<text class="price">¥{{ item.price }}</text>
|
|
||||||
<image class="btn" :src="webUrl+'/20231114151028082368.png'" mode="scaleToFill"/>
|
|
||||||
<!-- <view class="btn flex jc-center ai-center">立即购买</view>-->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<image class="img-nodata" :src="webUrl+'/20231023131208675588.png'" mode="scaleToFill"
|
|
||||||
v-if="goods.length===0"/>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {getProvince, getProvinceGoods, getProvinceList} from "@/api/product";
|
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'LandMarkPage',
|
|
||||||
mixins: [pageListenMixins],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
|
||||||
keyword: '',
|
|
||||||
page: 1,
|
|
||||||
navList: [],
|
|
||||||
navIndex: 0,
|
|
||||||
mapData: null,
|
|
||||||
mapLocations: [],
|
|
||||||
goods: [],
|
|
||||||
directionClass: ['', 'up', 'right', 'down', 'left'],
|
|
||||||
pageKeyId: Object.freeze('landmarkGoodsIndex')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
topBoxBgColor() {
|
|
||||||
return this.navList.length > 0 ? this.navList[this.navIndex]['backgroundColor'] : '#FFFFFF';
|
|
||||||
},
|
|
||||||
viewBoxBgColor() {
|
|
||||||
return this.mapData?.backgroundColor || '#FFFFFF';
|
|
||||||
},
|
|
||||||
scale() {
|
|
||||||
return 718 / (this.mapData?.mapImageWidth || 1);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.getNavList();
|
|
||||||
},
|
|
||||||
onHide() {
|
|
||||||
this.pageToHideHandle()
|
|
||||||
},
|
|
||||||
onReachBottom() {
|
|
||||||
this.page++;
|
|
||||||
this.fetchGoods();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getNavList() {
|
|
||||||
getProvinceList().then(({data}) => {
|
|
||||||
this.navList = data;
|
|
||||||
this.changeNav(this.navIndex);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
search() {
|
|
||||||
this.page = 1;
|
|
||||||
this.fetchGoods();
|
|
||||||
},
|
|
||||||
|
|
||||||
changeNav(index) {
|
|
||||||
this.navIndex = index;
|
|
||||||
this.page = 1;
|
|
||||||
this.getMap();
|
|
||||||
this.fetchGoods();
|
|
||||||
},
|
|
||||||
|
|
||||||
getMap() {
|
|
||||||
const id = this.navList[this.navIndex]['id']
|
|
||||||
getProvince(id).then(({data}) => {
|
|
||||||
this.mapData = data;
|
|
||||||
this.mapLocations = data.mapLocations;
|
|
||||||
this.calcPosition();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 计算位置
|
|
||||||
calcPosition() {
|
|
||||||
this.mapLocations?.forEach(item => {
|
|
||||||
item.gx = item.x * this.scale;
|
|
||||||
item.gy = item.y * this.scale;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
fetchGoods() {
|
|
||||||
const id = this.navList[this.navIndex]['id']
|
|
||||||
getProvinceGoods(id, this.keyword, this.page).then(({data}) => {
|
|
||||||
if (this.page === 1) this.goods = [];
|
|
||||||
for (let i = 0; i < data.length; i++) {
|
|
||||||
this.goods.push(data[i]);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
goGoods(id) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/shop/GoodsCon/index?id=${id}&from=landmark`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="less">
|
|
||||||
.pkg-product-land-mark {
|
|
||||||
background: #F7F3ED;
|
|
||||||
|
|
||||||
image {
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top-box {
|
|
||||||
padding: 32rpx 0 20rpx;
|
|
||||||
|
|
||||||
.view-box {
|
|
||||||
position: relative;
|
|
||||||
margin: 0 16rpx;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.search-box {
|
|
||||||
position: absolute;
|
|
||||||
top: 20rpx;
|
|
||||||
left: 34rpx;
|
|
||||||
width: 650rpx;
|
|
||||||
height: 64rpx;
|
|
||||||
padding: 0 32rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border-radius: 32rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
z-index: 10;
|
|
||||||
|
|
||||||
input {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
line-height: 64rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.map-box {
|
|
||||||
position: relative;
|
|
||||||
width: 718rpx;
|
|
||||||
|
|
||||||
.img-map {
|
|
||||||
width: 718rpx;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
position: absolute;
|
|
||||||
|
|
||||||
.round {
|
|
||||||
width: 8rpx;
|
|
||||||
height: 8rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
box-shadow: 0 0 0 8rpx rgba(225, 38, 65, .4);;
|
|
||||||
background: #E12641;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line {
|
|
||||||
position: relative;
|
|
||||||
border: 2rpx solid #E12641;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line-up {
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -100%);
|
|
||||||
width: 0;
|
|
||||||
height: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line-right {
|
|
||||||
top: 50%;
|
|
||||||
transform: translate(0, -50%);
|
|
||||||
width: 30rpx;
|
|
||||||
height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line-down {
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, 0);
|
|
||||||
width: 0;
|
|
||||||
height: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line-left {
|
|
||||||
top: 50%;
|
|
||||||
transform: translate(-100%, -50%);
|
|
||||||
width: 30rpx;
|
|
||||||
height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.label {
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.cover {
|
|
||||||
width: 60rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border: 6rpx solid #E12641;
|
|
||||||
border-radius: 50%;
|
|
||||||
z-index: 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
height: 32rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
padding: 0 16rpx;
|
|
||||||
background: #E12641;
|
|
||||||
color: #FFFFFF;
|
|
||||||
font-size: 22rpx;
|
|
||||||
line-height: 32rpx;
|
|
||||||
white-space: nowrap;
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.label-up {
|
|
||||||
top: -80rpx;
|
|
||||||
left: -50%;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
margin-right: -9rpx;
|
|
||||||
border-radius: 20rpx 0 0 20rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.label-right {
|
|
||||||
top: -40rpx;
|
|
||||||
left: 32rpx;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
margin-right: -9rpx;
|
|
||||||
border-radius: 20rpx 0 0 20rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.label-down {
|
|
||||||
left: -50%;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
margin-right: -9rpx;
|
|
||||||
border-radius: 20rpx 0 0 20rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.label-left {
|
|
||||||
left: -100%;
|
|
||||||
transform: translate(-30rpx, -40rpx);
|
|
||||||
|
|
||||||
.title {
|
|
||||||
margin-left: -9rpx;
|
|
||||||
border-radius: 0 20rpx 20rpx 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav {
|
|
||||||
padding: 30rpx 20rpx 0;
|
|
||||||
overflow-x: scroll;
|
|
||||||
|
|
||||||
view {
|
|
||||||
height: 52rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 0 18rpx;
|
|
||||||
border: 4rpx solid transparent;
|
|
||||||
color: #FFFFFF;
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
border-color: #FFFFFF;
|
|
||||||
border-radius: 26rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-box {
|
|
||||||
position: relative;
|
|
||||||
width: 718rpx;
|
|
||||||
height: 360rpx;
|
|
||||||
margin: 24rpx 16rpx;
|
|
||||||
border-radius: 16rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.bg-main {
|
|
||||||
width: 718rpx;
|
|
||||||
height: 360rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box-mask {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 200rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 20rpx 16rpx 16rpx;
|
|
||||||
background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000000 100%);
|
|
||||||
color: #FFFFFF;
|
|
||||||
|
|
||||||
.one-t {
|
|
||||||
margin-bottom: 16rpx;
|
|
||||||
font-size: 46rpx;
|
|
||||||
line-height: 52rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.more-t {
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding-top: 10rpx;
|
|
||||||
border-top: 1rpx solid #FFFFFF;
|
|
||||||
font-size: 28rpx;
|
|
||||||
line-height: 32rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-box {
|
|
||||||
margin-top: 24rpx;
|
|
||||||
padding: 0 16rpx 34rpx;
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: 234rpx;
|
|
||||||
height: 380rpx;
|
|
||||||
margin-right: 8rpx;
|
|
||||||
margin-bottom: 24rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 234rpx;
|
|
||||||
height: 234rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
height: 122rpx;
|
|
||||||
margin: 6rpx 6rpx 18rpx;
|
|
||||||
|
|
||||||
.more-t {
|
|
||||||
font-size: 28rpx;
|
|
||||||
line-height: 36rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.price {
|
|
||||||
font-size: 28rpx;
|
|
||||||
line-height: 36rpx;
|
|
||||||
color: #DC1616;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
width: 118rpx;
|
|
||||||
height: 42rpx;
|
|
||||||
//background: linear-gradient(180deg, #EFEDC7 0%, #EAC94B 100%);
|
|
||||||
//border-radius: 4rpx;
|
|
||||||
//color: #764A00;
|
|
||||||
//font-size: 24rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-child(3n) {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.img-nodata {
|
|
||||||
position: relative;
|
|
||||||
top: 0;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, 0);
|
|
||||||
width: 352rpx;
|
|
||||||
height: 338rpx;
|
|
||||||
margin-bottom: 60rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
+112
-6
@@ -29,8 +29,42 @@
|
|||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="v12-align-center tabs-wrap v1-py-1 v12-my-4">
|
||||||
|
<view class="tab-item v12-font-bold" v-for="(tab, index) in tabs" :key="index" @click="handleClick(index, tab)">
|
||||||
|
{{ tab.cateName }}
|
||||||
|
<view class="tab-line" v-if="activeIndex == index"></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="v12-mt-2 v12-align-center">
|
</view>
|
||||||
|
<view v-if="products.length > 0" class="product-wrap v12-mt-3">
|
||||||
|
<view class="product-card" v-for="(item, index) in products" :key="index" @click="toGoods(item)">
|
||||||
|
<image :src="item.productImage" class="product-card-img" mode="heightFix|widthFix"></image>
|
||||||
|
<view class="new-info">
|
||||||
|
<view class="v12-font-26 more-t" style="width: 100%;">{{ item.productName }}</view>
|
||||||
|
<view style="width: 100%;" class="v12-font-bold v12-primary-text v12-align-center v12-justify-between">
|
||||||
|
<view>
|
||||||
|
<text>¥</text>
|
||||||
|
<text class=" v12-font-36">{{ item.productPrice }}</text>
|
||||||
|
</view>
|
||||||
|
<view @click.stop="addToCart(item, 'productId')">
|
||||||
|
<u-icon :name="webUrl + '/home/icon-cart.png'" size="24"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-else class="empty-wrap">
|
||||||
|
<view class="empty-text">暂无数据</view>
|
||||||
|
</view>
|
||||||
|
<ProductWindow
|
||||||
|
ref="attrWindow"
|
||||||
|
:attr="attr"
|
||||||
|
:cartNum="cart_num"
|
||||||
|
:showOk="true"
|
||||||
|
@changeFun="changeFun"
|
||||||
|
@ok="handleOk(() => this.getCartCount())"
|
||||||
|
/>
|
||||||
|
<!-- <view class="v12-mt-2 v12-align-center">
|
||||||
<view class="primary-title" v-if="details.contentTitle">
|
<view class="primary-title" v-if="details.contentTitle">
|
||||||
{{ details.contentTitle }}
|
{{ details.contentTitle }}
|
||||||
<view class="title-line"></view>
|
<view class="title-line"></view>
|
||||||
@@ -42,30 +76,51 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="cover-img v12-mt-2" v-for="(item, index) in details.contents" :key="index" @click="toGoods(item)">
|
<view class="cover-img v12-mt-2" v-for="(item, index) in details.contents" :key="index" @click="toGoods(item)">
|
||||||
<image :src="item.contentImage" class="cover-img" mode="heightFix|widthFix"></image>
|
<image :src="item.contentImage" class="cover-img" mode="heightFix|widthFix"></image>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { queryNewZone } from '@/api/activity'
|
import { queryNewZone } from '@/api/activity'
|
||||||
|
import ProductWindow from '@/components/ProductWindow'
|
||||||
|
import goCartMixin from '@/mixins/goCartMixins'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
export default{
|
export default{
|
||||||
|
components: {
|
||||||
|
ProductWindow
|
||||||
|
},
|
||||||
|
mixins: [goCartMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
details: {},
|
details: {},
|
||||||
current: 0,
|
current: 0,
|
||||||
|
tabs: [],
|
||||||
|
activeIndex: 0,
|
||||||
|
products: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
queryNewZone().then(res => {
|
queryNewZone().then(res => {
|
||||||
this.details = res.data
|
this.details = res.data
|
||||||
|
this.tabs = Array.isArray(res.data.categories) ? res.data.categories : []
|
||||||
|
if (this.tabs.length > 0) {
|
||||||
|
this.handleClick(0, this.tabs[0])
|
||||||
|
} else {
|
||||||
|
this.products = []
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapGetters(['isLogin', 'location', 'userInfo']),
|
||||||
bannerImage() {
|
bannerImage() {
|
||||||
return this.details.newProducts && this.details.newProducts[this.current] && this.details.newProducts[this.current].bannerImage
|
return this.details.newProducts && this.details.newProducts[this.current] && this.details.newProducts[this.current].bannerImage
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleClick(index, tab) {
|
||||||
|
this.activeIndex = index
|
||||||
|
this.products = Array.isArray(tab && tab.products) ? tab.products : []
|
||||||
|
},
|
||||||
handleChange(e) {
|
handleChange(e) {
|
||||||
this.current = e.detail.current
|
this.current = e.detail.current
|
||||||
},
|
},
|
||||||
@@ -78,10 +133,61 @@ export default{
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.product-card{
|
||||||
|
width: 342rpx;
|
||||||
|
height: 520rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
.product-card-img{
|
||||||
|
width: 344rpx;
|
||||||
|
height: 344rpx;
|
||||||
|
background: rgba(169,56,56,0.39);
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
.product-wrap{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.empty-wrap{
|
||||||
|
min-height: 260rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.empty-text{
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999999;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.tab-line{
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 6rpx;
|
||||||
|
background: linear-gradient(to right, #C52733 0%, rgba(202,56,67,0.92) 51%, rgba(255,255,255,0) 100%);
|
||||||
|
border-radius: 6rpx;
|
||||||
|
}
|
||||||
|
.tabs-wrap{
|
||||||
|
overflow: auto;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.tab-item{
|
||||||
|
margin-right: 20rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
position: relative;
|
||||||
|
&:last-child{
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
.new-info{
|
.new-info{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
padding: 20rpx;
|
||||||
}
|
}
|
||||||
.box-emp{
|
.box-emp{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -92,7 +198,7 @@ export default{
|
|||||||
width: fit-content;
|
width: fit-content;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background: #C52733;
|
background: #C52733;
|
||||||
font-size: 28rpx;
|
font-size: 30rpx;
|
||||||
padding: 4rpx 20rpx;
|
padding: 4rpx 20rpx;
|
||||||
}
|
}
|
||||||
.swiper-wrap{
|
.swiper-wrap{
|
||||||
@@ -104,7 +210,7 @@ export default{
|
|||||||
}
|
}
|
||||||
.new-card{
|
.new-card{
|
||||||
width: 220rpx;
|
width: 220rpx;
|
||||||
height: 240rpx;
|
// height: 240rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -160,7 +266,7 @@ export default{
|
|||||||
}
|
}
|
||||||
.new-zone-page{
|
.new-zone-page{
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background-color: #fff;
|
// background-color: #fff;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
}
|
}
|
||||||
.banner-zone{
|
.banner-zone{
|
||||||
|
|||||||
+1701
-227
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="order-submission" style="padding: 30rpx;">
|
<view class="order-submission" style="padding: 30rpx;">
|
||||||
<view class="allAddress" style="background-color: #f6f6f6;">
|
<view class="allAddress" style="background-color: #f6f6f6;">
|
||||||
|
|
||||||
<view
|
<view
|
||||||
|
v-if="shipping_type === 0"
|
||||||
class="address acea-row v12-align-start"
|
class="address acea-row v12-align-start"
|
||||||
style="flex-wrap: nowrap;margin: 0 0 30rpx 0;border-radius: 16rpx;"
|
style="flex-wrap: nowrap;margin: 0 0 30rpx 0;border-radius: 16rpx;"
|
||||||
v-if="shipping_type === 0"
|
|
||||||
@click="addressTap"
|
@click="addressTap"
|
||||||
>
|
>
|
||||||
<image style="flex-shrink: 0;width: 36rpx;height: 36rpx;margin-right: 20rpx;"
|
<image
|
||||||
:src="webUrl+'/orderIcon/map.png'" mode=""></image>
|
:src="webUrl+'/orderIcon/map.png'"
|
||||||
|
style="flex-shrink: 0;width: 36rpx;height: 36rpx;margin-right: 20rpx;"
|
||||||
|
/>
|
||||||
<view class="acea-row row-between-wrapper" style="flex-wrap: nowrap;flex-grow: 1;">
|
<view class="acea-row row-between-wrapper" style="flex-wrap: nowrap;flex-grow: 1;">
|
||||||
<view class="addressCon" v-if="addressInfo.realName">
|
<view class="addressCon" v-if="addressInfo.realName">
|
||||||
<view class="more-t">
|
<view class="more-t">
|
||||||
@@ -25,32 +26,35 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<div style="flex-wrap: nowrap;" class="address acea-row row-middle" v-else @click="showStoreList">
|
<div
|
||||||
|
v-else
|
||||||
<image style="flex-shrink: 0;width: 48rpx;height: 48rpx;margin-right: 20rpx;"
|
style="flex-wrap: nowrap;"
|
||||||
:src="webUrl+'/20230304135530688212.png'" mode=""></image>
|
class="address acea-row row-middle"
|
||||||
|
@click="showStoreList"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="webUrl+'/20230304135530688212.png'"
|
||||||
|
style="flex-shrink: 0;width: 48rpx;height: 48rpx;margin-right: 20rpx;"
|
||||||
|
/>
|
||||||
<view class="acea-row row-between-wrapper" style="flex-wrap: nowrap;flex-grow: 1;">
|
<view class="acea-row row-between-wrapper" style="flex-wrap: nowrap;flex-grow: 1;">
|
||||||
<div class="addressCon">
|
<div class="addressCon">
|
||||||
<div class="name">
|
<div class="name">
|
||||||
{{ isNullOrEmpty(storeItems) ? systemStore.name : storeItems.name }}
|
{{ isNullOrEmpty(storeItems) ? systemStore.name : storeItems.name }}
|
||||||
<span
|
<span class="phone">{{ isNullOrEmpty(storeItems) ? systemStore.phone : storeItems.phone }}</span>
|
||||||
class="phone"
|
|
||||||
>{{ isNullOrEmpty(storeItems) ? systemStore.phone : storeItems.phone }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div>{{ isNullOrEmpty(storeItems) ? systemStore.address : storeItems.address }}</div>
|
<div>{{ isNullOrEmpty(storeItems) ? systemStore.address : storeItems.address }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="iconfont icon-jiantou"></div>
|
<div class="iconfont icon-jiantou"></div>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
|
<OrderGoods
|
||||||
<OrderGoods :evaluate="0" :cartInfo="orderGroupInfo.cartInfo" title="商品信息"></OrderGoods>
|
:evaluate="0"
|
||||||
|
:cartInfo="orderGroupInfo.cartInfo"
|
||||||
|
title="商品信息"
|
||||||
|
/>
|
||||||
<view class="wrapper" style="margin:0;border-radius:0 0 20rpx 20rpx">
|
<view class="wrapper" style="margin:0;border-radius:0 0 20rpx 20rpx">
|
||||||
|
<view v-if="shipping_type === 0" class="v12-pa-2 acea-row row-between-wrapper" style="flex-wrap: nowrap;">
|
||||||
|
|
||||||
<view class="v12-pa-2 acea-row row-between-wrapper" style="flex-wrap: nowrap;" v-if="shipping_type === 0">
|
|
||||||
<view class="acea-row row-middle" style="flex-wrap: nowrap;">
|
<view class="acea-row row-middle" style="flex-wrap: nowrap;">
|
||||||
<!-- <image style="width: 32rpx;height: 32rpx;margin-right: 12rpx;" :src="webUrl+'/20210807230820761721.png'"
|
<!-- <image style="width: 32rpx;height: 32rpx;margin-right: 12rpx;" :src="webUrl+'/20210807230820761721.png'"
|
||||||
mode=""></image> -->
|
mode=""></image> -->
|
||||||
@@ -64,13 +68,22 @@
|
|||||||
<view class="v12-pa-2 acea-row row-between-wrapper">
|
<view class="v12-pa-2 acea-row row-between-wrapper">
|
||||||
<view class="v12-font-24 v12-secondary-dark-text v12-pr-3 v12-text-right" style="width: 140rpx">联系人</view>
|
<view class="v12-font-24 v12-secondary-dark-text v12-pr-3 v12-text-right" style="width: 140rpx">联系人</view>
|
||||||
<view class="discount">
|
<view class="discount">
|
||||||
<input class="v12-font-24" type="text" placeholder="请填写您的联系姓名" v-model="contacts"/>
|
<input
|
||||||
|
v-model="contacts"
|
||||||
|
class="v12-font-24"
|
||||||
|
type="text"
|
||||||
|
placeholder="请填写您的联系姓名"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="v12-pa-2 acea-row row-between-wrapper">
|
<view class="v12-pa-2 acea-row row-between-wrapper">
|
||||||
<view class="v12-font-24 v12-secondary-dark-text v12-pr-3 v12-text-right" style="width: 140rpx">联系电话</view>
|
<view class="v12-font-24 v12-secondary-dark-text v12-pr-3 v12-text-right" style="width: 140rpx">联系电话</view>
|
||||||
<view class="discount">
|
<view class="discount">
|
||||||
<input type="text" placeholder="请填写您的联系电话" v-model="contactsTel"/>
|
<input
|
||||||
|
v-model="contactsTel"
|
||||||
|
type="text"
|
||||||
|
placeholder="请填写您的联系电话"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -80,7 +93,11 @@
|
|||||||
mode=""></image> -->
|
mode=""></image> -->
|
||||||
<text class="v12-font-24 v12-secondary-dark-text v12-pr-3 v12-text-right" style="width: 140rpx;">备注</text>
|
<text class="v12-font-24 v12-secondary-dark-text v12-pr-3 v12-text-right" style="width: 140rpx;">备注</text>
|
||||||
</view>
|
</view>
|
||||||
<textarea v-model="mark" placeholder="建议与商家协商一致" class="mark v12-font-24 "></textarea>
|
<textarea
|
||||||
|
v-model="mark"
|
||||||
|
placeholder="建议与商家协商一致"
|
||||||
|
class="mark v12-font-24 "
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- v12 -->
|
<!-- v12 -->
|
||||||
@@ -100,7 +117,7 @@
|
|||||||
<text class="v12-font-28">{{ force2Decimal(orderPrice.payPostage) }}</text>
|
<text class="v12-font-28">{{ force2Decimal(orderPrice.payPostage) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="v12-justify-between v12-align-center v12-py-1">
|
<view v-if="!isLotteryOrder()" class="v12-justify-between v12-align-center v12-py-1">
|
||||||
<view class="v12-font-24 v12-dark-text v12-align-center">
|
<view class="v12-font-24 v12-dark-text v12-align-center">
|
||||||
<text>优惠券</text>
|
<text>优惠券</text>
|
||||||
<view class="v12-align-center v12-ml-1" v-if="couponTitle">
|
<view class="v12-align-center v12-ml-1" v-if="couponTitle">
|
||||||
@@ -113,7 +130,7 @@
|
|||||||
<text class="v12-dark-text v12-font-24" >{{ couponList.usable.length === 0 ? '无' : '去选择' }}</text>
|
<text class="v12-dark-text v12-font-24" >{{ couponList.usable.length === 0 ? '无' : '去选择' }}</text>
|
||||||
<text class="iconfont icon-jiantou v12-font-24 v12-dark-text"></text>
|
<text class="iconfont icon-jiantou v12-font-24 v12-dark-text"></text>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="v12-secondary-dark-text v12-align-center" @click="changeCoupons">
|
<view class="v12-secondary-dark-text v12-align-center" @click="showCouponsPopup">
|
||||||
<text class="v12-font-22 ">-¥</text>
|
<text class="v12-font-22 ">-¥</text>
|
||||||
<text class="v12-font-28">{{ force2Decimal(orderPrice.couponPrice) }}</text>
|
<text class="v12-font-28">{{ force2Decimal(orderPrice.couponPrice) }}</text>
|
||||||
<text class="iconfont icon-jiantou v12-font-24 v12-dark-text"></text>
|
<text class="iconfont icon-jiantou v12-font-24 v12-dark-text"></text>
|
||||||
@@ -180,11 +197,11 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="list" style="margin-top: 0;">
|
<view class="list" style="margin-top: 0;">
|
||||||
<view
|
<view
|
||||||
class="payItem acea-row row-middle"
|
|
||||||
:class="active === 'weixin' ? 'on' : ''"
|
|
||||||
v-show="isWeixin"
|
v-show="isWeixin"
|
||||||
@click="payItem('weixin')"
|
:class="active === 'weixin' ? 'on' : ''"
|
||||||
|
class="payItem acea-row row-middle"
|
||||||
style="flex-wrap: nowrap; margin-top: 0"
|
style="flex-wrap: nowrap; margin-top: 0"
|
||||||
|
@click="payItem('weixin')"
|
||||||
>
|
>
|
||||||
<view class="name acea-row v12-font-24">
|
<view class="name acea-row v12-font-24">
|
||||||
<!-- <view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view> -->
|
<!-- <view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view> -->
|
||||||
@@ -198,11 +215,11 @@
|
|||||||
</label>
|
</label>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="payItem acea-row row-middle"
|
|
||||||
:class="active === 'weixin' ? 'on' : ''"
|
|
||||||
@click="payItem('weixin')"
|
|
||||||
v-show="!isWeixin"
|
v-show="!isWeixin"
|
||||||
|
:class="active === 'weixin' ? 'on' : ''"
|
||||||
|
class="payItem acea-row row-middle"
|
||||||
style="flex-wrap: nowrap; margin-top: 20rpx"
|
style="flex-wrap: nowrap; margin-top: 20rpx"
|
||||||
|
@click="payItem('weixin')"
|
||||||
>
|
>
|
||||||
<view class="name acea-row v12-font-24">
|
<view class="name acea-row v12-font-24">
|
||||||
<!-- <view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view> -->
|
<!-- <view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view> -->
|
||||||
@@ -214,13 +231,12 @@
|
|||||||
<radio style="transform: scale(0.7);" value="" :checked="active === 'weixin'" color="#C52733"/>
|
<radio style="transform: scale(0.7);" value="" :checked="active === 'weixin'" color="#C52733"/>
|
||||||
<text></text>
|
<text></text>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="payItem acea-row row-middle v12-justify-between"
|
|
||||||
:class="active === 'yue' ? 'on' : ''"
|
:class="active === 'yue' ? 'on' : ''"
|
||||||
@click="payItem('yue')"
|
class="payItem acea-row row-middle v12-justify-between"
|
||||||
style="flex-wrap: nowrap;"
|
style="flex-wrap: nowrap;"
|
||||||
|
@click="payItem('yue')"
|
||||||
>
|
>
|
||||||
<view class="name acea-row v12-font-24">
|
<view class="name acea-row v12-font-24">
|
||||||
<!-- <view style="background-color: #007AFF;" class="iconfont icon-icon-test"
|
<!-- <view style="background-color: #007AFF;" class="iconfont icon-icon-test"
|
||||||
@@ -233,34 +249,31 @@
|
|||||||
<radio style="transform: scale(0.7);" value="" :checked="active === 'yue'" color="#C52733"/>
|
<radio style="transform: scale(0.7);" value="" :checked="active === 'yue'" color="#C52733"/>
|
||||||
<text></text>
|
<text></text>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<!-- v9 优惠券开始 -->
|
<!-- v9 优惠券开始 -->
|
||||||
<u-popup
|
<u-popup
|
||||||
|
v-if="!isLotteryOrder() && show"
|
||||||
:show="show"
|
:show="show"
|
||||||
:round="10"
|
:round="10"
|
||||||
mode="bottom"
|
mode="bottom"
|
||||||
close-on-click-overlay
|
close-on-click-overlay
|
||||||
@close="changeCoupons"
|
@close="close"
|
||||||
>
|
>
|
||||||
<CouponsPopup
|
<CouponsPopup
|
||||||
v-if="couponList.usable.length > 0"
|
v-if="!isLotteryOrder() && couponList.usable.length > 0 && show"
|
||||||
:two-list="couponList"
|
:two-list="couponList"
|
||||||
@change="changeCoupons"
|
@change="changeCoupons"
|
||||||
@close="close"
|
@close="close"
|
||||||
:currentPrice="force2Decimal(orderPrice.totalPrice)"
|
:currentPrice="force2Decimal(orderPrice.totalPrice)"
|
||||||
:id="couponId"
|
:id="couponId"
|
||||||
@max="couponMax"
|
:couponId1="couponId"
|
||||||
:show-tab="false"
|
:show-tab="false"
|
||||||
/>
|
/>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<!-- v9 优惠券结束 -->
|
<!-- v9 优惠券结束 -->
|
||||||
|
|
||||||
<view style="height:80rpx"></view>
|
<view style="height:80rpx"></view>
|
||||||
<view class="footer v12-justify-end v12-px-3" style="height: 120rpx;">
|
<view class="footer v12-justify-end v12-px-3" style="height: 120rpx;">
|
||||||
<view class="v12-align-center v12-px-4">
|
<view class="v12-align-center v12-px-4">
|
||||||
@@ -288,6 +301,7 @@
|
|||||||
@redirect="addressRedirect"
|
@redirect="addressRedirect"
|
||||||
/>
|
/>
|
||||||
<passkeyborad
|
<passkeyborad
|
||||||
|
v-if="isShowPayPwdPop"
|
||||||
ref='payPwdPop'
|
ref='payPwdPop'
|
||||||
showMoney
|
showMoney
|
||||||
:money="orderPrice.payPrice"
|
:money="orderPrice.payPrice"
|
||||||
@@ -300,19 +314,27 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard'
|
import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard'
|
||||||
import OrderGoods from "@/components/OrderGoods";
|
import OrderGoods from "@/components/OrderGoods"
|
||||||
import AddressWindow from "@/components/AddressWindow";
|
import AddressWindow from "@/components/AddressWindow"
|
||||||
import {createOrder, postOrderComputed, postOrderConfirm} from "@/api/order";
|
import {
|
||||||
import {mapGetters} from "vuex";
|
createOrder,
|
||||||
import {weappPay} from "@/libs/wechat";
|
postOrderComputed,
|
||||||
import {isNullOrEmpty, isWeixin} from "@/utils";
|
postOrderConfirm,
|
||||||
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue';
|
getAddressDefaultSelected
|
||||||
import uniPopup from '@/components/uni-popup/uni-popup.vue';
|
} from "@/api/order"
|
||||||
|
import {mapGetters} from "vuex"
|
||||||
|
import {weappPay} from "@/libs/wechat"
|
||||||
|
import {isNullOrEmpty, isWeixin} from "@/utils"
|
||||||
|
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue'
|
||||||
|
import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
||||||
import CouponsPopup from "@/components/CouponsPopup.vue"
|
import CouponsPopup from "@/components/CouponsPopup.vue"
|
||||||
|
import { getDrawTicketByOrder } from '@/api/lottery'
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
|
import settings from '@/config/baseSetting.js'
|
||||||
|
import { orderPaySuccessToCheckDrawStatus } from '@/mixins/orderPaySuccessToCheckDrawStatus.js'
|
||||||
|
|
||||||
const NAME = "OrderSubmission",
|
const NAME = "OrderSubmission"
|
||||||
_isWeixin = isWeixin();
|
const _isWeixin = isWeixin()
|
||||||
export default {
|
export default {
|
||||||
name: NAME,
|
name: NAME,
|
||||||
components: {
|
components: {
|
||||||
@@ -323,7 +345,7 @@ export default {
|
|||||||
passkeyborad,
|
passkeyborad,
|
||||||
CouponsPopup
|
CouponsPopup
|
||||||
},
|
},
|
||||||
mixins: [pageListenMixins],
|
mixins: [pageListenMixins, orderPaySuccessToCheckDrawStatus],
|
||||||
props: {},
|
props: {},
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
@@ -362,7 +384,7 @@ export default {
|
|||||||
unusable: [],
|
unusable: [],
|
||||||
usable: []
|
usable: []
|
||||||
},
|
},
|
||||||
couponId: uni.getStorageSync('couponId') || 0,
|
couponId: null,
|
||||||
couponIndex: -1,
|
couponIndex: -1,
|
||||||
show: false,
|
show: false,
|
||||||
// 是否使用积分开关
|
// 是否使用积分开关
|
||||||
@@ -377,15 +399,16 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
couponTitle: '',
|
couponTitle: '',
|
||||||
hasCoupon: false,
|
hasCoupon: false,
|
||||||
};
|
pageQuery: {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: mapGetters(["userInfo", "storeItems"]),
|
computed: mapGetters(["userInfo", "storeItems"]),
|
||||||
watch: {
|
watch: {
|
||||||
useIntegral() {
|
useIntegral() {
|
||||||
this.computedPrice('useIntegral');
|
this.computedPrice('useIntegral')
|
||||||
},
|
},
|
||||||
shipping_type() {
|
shipping_type() {
|
||||||
this.computedPrice('shipping_type');
|
this.computedPrice('shipping_type')
|
||||||
},
|
},
|
||||||
async couponId(value) {
|
async couponId(value) {
|
||||||
this.couponIndex = this.couponList['usable']?.findIndex(item => item.id === +value)
|
this.couponIndex = this.couponList['usable']?.findIndex(item => item.id === +value)
|
||||||
@@ -394,74 +417,129 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(opts) {
|
onLoad(opts) {
|
||||||
console.log(opts);
|
|
||||||
const that = this
|
const that = this
|
||||||
if (that.$yroute.query.pinkid !== undefined) {
|
that.pageQuery = Object.assign({}, that.resolvePageQuery(), opts || {})
|
||||||
that.pinkId = that.$yroute.query.pinkid
|
if (that.pageQuery.pinkid !== undefined) {
|
||||||
|
that.pinkId = that.pageQuery.pinkid
|
||||||
}
|
}
|
||||||
if (that.$yroute.query.id !== undefined) {
|
if (that.pageQuery.id !== undefined) {
|
||||||
that.cartid = that.$yroute.query.id
|
that.cartid = that.pageQuery.id
|
||||||
console.log(that.cartid)
|
console.log(that.cartid)
|
||||||
}
|
}
|
||||||
if (that.$yroute.query.lotteryRecordId !== undefined) {
|
if (that.pageQuery.lotteryRecordId !== undefined) {
|
||||||
that.lotteryRecordId = that.$yroute.query.lotteryRecordId
|
that.lotteryRecordId = that.pageQuery.lotteryRecordId
|
||||||
}
|
}
|
||||||
that.hasCoupon = opts.couponId !== ''
|
that.hasCoupon = !!(opts && opts.couponId !== '')
|
||||||
|
that.getCartInfo()
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
const _this = this
|
const _this = this
|
||||||
_this.getCartInfo()
|
|
||||||
//获取用户信息
|
//获取用户信息
|
||||||
_this.$store.dispatch("getUser", true)
|
_this.$store.dispatch("getUser", true)
|
||||||
|
// 监听到选择收货地址
|
||||||
|
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
|
||||||
|
// const sourceAddress = uni.getStorageSync('sourceAddress') || {}
|
||||||
|
// 监听到选择收货地址
|
||||||
|
if (chooseAddress.id) {
|
||||||
|
_this.addressInfo = chooseAddress
|
||||||
|
// 地址切换也要重新计算一下
|
||||||
|
// uni.setStorageSync('sourceAddress', _this.addressInfo || '')
|
||||||
|
uni.setStorageSync('sourceAddress', {})
|
||||||
|
_this.computedPrice('onLoad chooseAddress')
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.setStorageSync('chooseAddress', {})
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isNullOrEmpty,
|
isNullOrEmpty,
|
||||||
|
resolvePageQuery() {
|
||||||
|
if (this.$yroute && this.$yroute.query) {
|
||||||
|
return this.$yroute.query
|
||||||
|
}
|
||||||
|
if (this.$route && this.$route.query) {
|
||||||
|
return this.$route.query
|
||||||
|
}
|
||||||
|
if (this._route && this._route.query) {
|
||||||
|
return this._route.query
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
isLotteryOrder() {
|
||||||
|
const cartInfo = Array.isArray(this.orderGroupInfo && this.orderGroupInfo.cartInfo)
|
||||||
|
? this.orderGroupInfo.cartInfo
|
||||||
|
: []
|
||||||
|
return Boolean(
|
||||||
|
this.lotteryRecordId ||
|
||||||
|
this.pageQuery.from === 'countyLottery' ||
|
||||||
|
Number(this.pageQuery.drawActivityId || 0) > 0 ||
|
||||||
|
cartInfo.some(item => Number(
|
||||||
|
item.drawActivityId ||
|
||||||
|
(item.productInfo && item.productInfo.drawActivityId) ||
|
||||||
|
0
|
||||||
|
) > 0)
|
||||||
|
)
|
||||||
|
},
|
||||||
|
getOrderCouponId() {
|
||||||
|
if (this.isLotteryOrder()) return 0
|
||||||
|
return this.couponList.usable.length === 0 ? 0 : (this.couponId || 0)
|
||||||
|
},
|
||||||
couponMax(e) {
|
couponMax(e) {
|
||||||
this.couponTitle = e.couponTitle
|
// this.couponTitle = e.couponTitle
|
||||||
this.couponId = this.$yroute.query.couponId || uni.getStorageSync('couponId') || 0
|
// this.couponId = this.$yroute.query.couponId || uni.getStorageSync('couponId') || 0
|
||||||
},
|
},
|
||||||
showStoreList() {
|
showStoreList() {
|
||||||
this.$store.commit("get_to", "orders");
|
this.$store.commit("get_to", "orders")
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/shop/StoreList/index"
|
path: "/pagesShop/shop/StoreList/index"
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
force2Decimal(value) {
|
force2Decimal(value) {
|
||||||
return this.$force2Decimal(value);
|
return this.$force2Decimal(value)
|
||||||
},
|
},
|
||||||
usePointsCheckChange(e) {
|
usePointsCheckChange(e) {
|
||||||
this.computedPrice()
|
this.computedPrice()
|
||||||
},
|
},
|
||||||
// 计算订单金额
|
|
||||||
|
/**
|
||||||
|
* 计算订单金额
|
||||||
|
* @param {*} f 有值时 couponId不取默认值
|
||||||
|
*/
|
||||||
computedPrice(f) {
|
computedPrice(f) {
|
||||||
let shipping_type = this.shipping_type;
|
|
||||||
postOrderComputed(this.orderGroupInfo.orderKey, {
|
postOrderComputed(this.orderGroupInfo.orderKey, {
|
||||||
addressId: this.addressInfo.id,
|
addressId: this.addressInfo.id,
|
||||||
useIntegral: this.useIntegral ? 1 : 0,
|
useIntegral: this.useIntegral ? 1 : 0,
|
||||||
couponId: this.couponList.usable.length === 0 ? 0 : this.couponId || 0,
|
couponId: this.getOrderCouponId(),
|
||||||
usePoints: this.usePointsCheck ? 1 : 0,
|
usePoints: this.usePointsCheck ? 1 : 0,
|
||||||
shipping_type: parseInt(shipping_type) + 1
|
shipping_type: parseInt(this.shipping_type) + 1
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
this.couponList = res.data.result.couponList
|
||||||
|
if (this.isLotteryOrder()) {
|
||||||
|
this.couponTitle = ''
|
||||||
|
if (this.couponId !== 0) {
|
||||||
|
this.couponId = 0
|
||||||
|
}
|
||||||
|
} else if(!f) {
|
||||||
|
this.couponId = res.data.result.defaultCouponId
|
||||||
|
}
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
if (data.status === "EXTEND_ORDER") {
|
if (data.status === "EXTEND_ORDER") {
|
||||||
this.$yrouter.replace({
|
this.$yrouter.replace({
|
||||||
path: "/pages/order/OrderDetails/index",
|
path: "/pagesOrder/order/OrderDetails/index",
|
||||||
query: {
|
query: {
|
||||||
id: data.result.orderId
|
id: data.result.orderId
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
this.orderPrice = data.result;
|
this.orderPrice = data.result;
|
||||||
console.log(this.orderPrice);
|
|
||||||
|
|
||||||
if (this.usePointsCheck) {
|
if (this.usePointsCheck) {
|
||||||
this.usePointsNumber = data.result.usedPoints
|
this.usePointsNumber = data.result.usedPoints
|
||||||
} else {
|
} else {
|
||||||
this.usePointsNumber = 0
|
this.usePointsNumber = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
getCartInfo() {
|
getCartInfo() {
|
||||||
const _this = this
|
const _this = this
|
||||||
@@ -501,38 +579,18 @@ export default {
|
|||||||
_this.usePointsCheck = true
|
_this.usePointsCheck = true
|
||||||
_this.usePointsNumber = data.maxPoints
|
_this.usePointsNumber = data.maxPoints
|
||||||
}
|
}
|
||||||
if(_this.$yroute.query.address !== undefined ) {
|
|
||||||
_this.addressInfo = JSON.parse(_this.$yroute.query.address) || {}
|
|
||||||
} else {
|
|
||||||
_this.addressInfo = uni.getStorageSync('chooseAddress') ? uni.getStorageSync('chooseAddress') : data.addressInfo || {}
|
|
||||||
}
|
|
||||||
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
|
|
||||||
const sourceAddress = uni.getStorageSync('sourceAddress') || data.addressInfo || uni.getStorageSync('chooseAddress')
|
|
||||||
// 监听到选择收货地址
|
|
||||||
if (chooseAddress.id && (chooseAddress.id !== sourceAddress.id)) {
|
|
||||||
uni.showModal({
|
|
||||||
title:'确定修改地址吗?',
|
|
||||||
content: '',
|
|
||||||
showCancel: true,
|
|
||||||
cancelText: '取消',
|
|
||||||
confirmText: '确认',
|
|
||||||
success: (res) => {
|
|
||||||
if(res.confirm) {
|
|
||||||
_this.addressInfo = chooseAddress
|
|
||||||
// 地址切换也要重新计算一下
|
|
||||||
uni.setStorageSync('sourceAddress', _this.addressInfo || '')
|
|
||||||
_this.computedPrice('onLoad chooseAddress')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
complete: () => {
|
|
||||||
uni.hideLoading()
|
|
||||||
// uni.setStorageSync('chooseAddress', {})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
_this.systemStore = data.systemStore || {}
|
_this.systemStore = data.systemStore || {}
|
||||||
_this.storeSelfMention = data.storeSelfMention
|
_this.storeSelfMention = data.storeSelfMention
|
||||||
|
if(_this.pageQuery.address !== undefined ) {
|
||||||
|
_this.addressInfo = JSON.parse(_this.pageQuery.address) || {}
|
||||||
_this.computedPrice()
|
_this.computedPrice()
|
||||||
|
} else {
|
||||||
|
// _this.addressInfo = uni.getStorageSync('sourceAddress') || data.addressInfo || {}
|
||||||
|
getAddressDefaultSelected().then(res => {
|
||||||
|
_this.addressInfo = res.data
|
||||||
|
_this.computedPrice()
|
||||||
|
})
|
||||||
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg,
|
title: err.msg,
|
||||||
@@ -542,32 +600,33 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
addressTap: function () {
|
addressTap: function () {
|
||||||
|
uni.setStorageSync('sourceAddress', this.addressInfo)
|
||||||
// 改用跳转页面方式
|
// 改用跳转页面方式
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/user/address/AddressManagement/index",
|
path: "/pages/user/address/AddressManagement/index",
|
||||||
query: {
|
query: {
|
||||||
choosMode: 1
|
choosMode: 1
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
addressRedirect() {
|
addressRedirect() {
|
||||||
this.addressLoaded = false;
|
this.addressLoaded = false
|
||||||
this.showAddress = false;
|
this.showAddress = false
|
||||||
},
|
},
|
||||||
payItem: function (index) {
|
payItem: function (index) {
|
||||||
this.active = index;
|
this.active = index
|
||||||
},
|
},
|
||||||
changeAddress(addressInfo) {
|
changeAddress(addressInfo) {
|
||||||
this.addressInfo = addressInfo;
|
this.addressInfo = addressInfo
|
||||||
//地址切换也要重新计算一下
|
//地址切换也要重新计算一下
|
||||||
this.computedPrice('changeAddress');
|
this.computedPrice('changeAddress')
|
||||||
},
|
},
|
||||||
pwdPopClose() {
|
pwdPopClose() {
|
||||||
this.isShowPayPwdPop = false;
|
this.isShowPayPwdPop = false
|
||||||
},
|
},
|
||||||
pwdPopFinish(payPwd) {
|
pwdPopFinish(payPwd) {
|
||||||
this.payPassword = payPwd;
|
this.payPassword = payPwd
|
||||||
this.createOrder(true);
|
this.createOrder(true)
|
||||||
},
|
},
|
||||||
//支付密码输入监听
|
//支付密码输入监听
|
||||||
onInput(e) {
|
onInput(e) {
|
||||||
@@ -575,36 +634,34 @@ export default {
|
|||||||
},
|
},
|
||||||
// 支付密码输入确认
|
// 支付密码输入确认
|
||||||
onConfirm(e) {
|
onConfirm(e) {
|
||||||
this.payPassword = e.value;
|
this.payPassword = e.value
|
||||||
this.$refs.popup.close();//关闭支付密码弹窗
|
this.$refs.popup.close()
|
||||||
this.$refs.secrity.clear();//清空支付密码
|
this.$refs.secrity.clear()
|
||||||
this.createOrder(true);
|
this.createOrder(true)
|
||||||
},
|
},
|
||||||
subscribePay() {
|
subscribePay() {
|
||||||
uni.requestSubscribeMessage({
|
uni.requestSubscribeMessage({
|
||||||
tmplIds: ['7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE', 'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU', '9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU'],
|
tmplIds: settings.SubscribeMessageTmplIds,
|
||||||
complete: () => this.createOrder(false)
|
complete: () => this.createOrder(false)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
createOrder(isyue) {
|
createOrder(isyue) {
|
||||||
let shipping_type = this.shipping_type;
|
|
||||||
if (!this.active) {
|
if (!this.active) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请选择支付方式",
|
title: "请选择支付方式",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
})
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
if (!this.addressInfo.id && !this.shipping_type) {
|
if (!this.addressInfo.id && !this.shipping_type) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请选择收货地址",
|
title: "请选择收货地址",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
})
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.shipping_type) {
|
if (this.shipping_type) {
|
||||||
if (
|
if (
|
||||||
(this.contacts === "" || this.contactsTel === "") &&
|
(this.contacts === "" || this.contactsTel === "") &&
|
||||||
@@ -614,16 +671,15 @@ export default {
|
|||||||
title: "请填写联系人或联系人电话",
|
title: "请填写联系人或联系人电话",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!/^1(3|4|5|7|8|9|6)\d{9}$/.test(this.contactsTel)) {
|
if (!/^1(3|4|5|7|8|9|6)\d{9}$/.test(this.contactsTel)) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请填写正确的手机号",
|
title: "请填写正确的手机号",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!/^[\u4e00-\u9fa5\w]{2,16}$/.test(this.contacts)) {
|
if (!/^[\u4e00-\u9fa5\w]{2,16}$/.test(this.contacts)) {
|
||||||
@@ -631,11 +687,10 @@ export default {
|
|||||||
title: "请填写您的真实姓名",
|
title: "请填写您的真实姓名",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
})
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断如果是余额支付,先要输入支付密码
|
// 判断如果是余额支付,先要输入支付密码
|
||||||
if (this.active == 'yue' && !isyue) {
|
if (this.active == 'yue' && !isyue) {
|
||||||
// 先判断用户是否绑定过手机
|
// 先判断用户是否绑定过手机
|
||||||
@@ -643,34 +698,30 @@ export default {
|
|||||||
// 再判断用户是否设置过支付密码
|
// 再判断用户是否设置过支付密码
|
||||||
if (this.userInfo.hasPwdPay) {
|
if (this.userInfo.hasPwdPay) {
|
||||||
// 显示输入支付密码
|
// 显示输入支付密码
|
||||||
this.isShowPayPwdPop = true;
|
this.isShowPayPwdPop = true
|
||||||
} else {
|
} else {
|
||||||
// 设置支付密码
|
// 设置支付密码
|
||||||
this.$yrouter.push("/pkg_user/views/payPassword?isSetMode=true");
|
this.$yrouter.push("/pkg_user/views/payPassword?isSetMode=true")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 跳转到绑定手机
|
// 跳转到绑定手机
|
||||||
this.$yrouter.push("/pkg_user/views/bindPhone");
|
this.$yrouter.push("/pkg_user/views/bindPhone")
|
||||||
}
|
}
|
||||||
|
return
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "生成订单中"
|
title: "生成订单中"
|
||||||
});
|
})
|
||||||
let from = {};
|
let from = {}
|
||||||
if (this.$deviceType == "app") {
|
if (this.$deviceType == "app") {
|
||||||
from.from = "app";
|
from.from = "app"
|
||||||
}
|
}
|
||||||
console.log(this.storeItems, this.systemStore);
|
const params = {
|
||||||
|
|
||||||
var params = {
|
|
||||||
realName: this.contacts,
|
realName: this.contacts,
|
||||||
phone: this.contactsTel,
|
phone: this.contactsTel,
|
||||||
addressId: this.addressInfo.id,
|
addressId: this.addressInfo.id,
|
||||||
useIntegral: this.useIntegral ? 1 : 0,
|
useIntegral: this.useIntegral ? 1 : 0,
|
||||||
couponId: this.couponList.usable.length === 0 ? 0 : this.couponId || 0,
|
couponId: this.getOrderCouponId(),
|
||||||
usePoints: this.usePointsNumber || 0,
|
usePoints: this.usePointsNumber || 0,
|
||||||
payType: this.active,
|
payType: this.active,
|
||||||
pinkId: this.pinkId,
|
pinkId: this.pinkId,
|
||||||
@@ -679,22 +730,21 @@ export default {
|
|||||||
bargainId: this.orderGroupInfo.bargain_id,
|
bargainId: this.orderGroupInfo.bargain_id,
|
||||||
from: this.from,
|
from: this.from,
|
||||||
mark: this.mark || "",
|
mark: this.mark || "",
|
||||||
shippingType: parseInt(shipping_type) + 1,
|
shippingType: parseInt(this.shipping_type) + 1,
|
||||||
storeId: this.storeItems ? this.storeItems.id : this.systemStore.id,
|
storeId: this.storeItems ? this.storeItems.id : this.systemStore.id,
|
||||||
...from
|
...from
|
||||||
}
|
}
|
||||||
|
uni.setStorageSync('chooseAddress', {})
|
||||||
//余额支付的支付密码
|
//余额支付的支付密码
|
||||||
if (this.active == 'yue') {
|
if (this.active == 'yue') {
|
||||||
params.passwordPay = this.payPassword;
|
params.passwordPay = this.payPassword
|
||||||
}
|
}
|
||||||
uni.removeStorageSync('couponId')
|
uni.removeStorageSync('couponId')
|
||||||
|
var that = this
|
||||||
var that = this;
|
createOrder(this.orderGroupInfo.orderKey, params).then(res => {
|
||||||
createOrder(this.orderGroupInfo.orderKey, params)
|
uni.hideLoading()
|
||||||
.then(res => {
|
const data = res.data
|
||||||
uni.hideLoading();
|
const orderId = data && data.result ? data.result.orderId : ''
|
||||||
const data = res.data;
|
|
||||||
switch (data.status) {
|
switch (data.status) {
|
||||||
case "ORDER_EXIST":
|
case "ORDER_EXIST":
|
||||||
case "EXTEND_ORDER":
|
case "EXTEND_ORDER":
|
||||||
@@ -702,27 +752,26 @@ export default {
|
|||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
})
|
||||||
this.$yrouter.replace({
|
this.$yrouter.replace({
|
||||||
path: "/pages/order/OrderDetails/index",
|
path: "/pagesOrder/order/OrderDetails/index",
|
||||||
query: {
|
query: {
|
||||||
id: data.result.orderId
|
id: orderId
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
break;
|
break;
|
||||||
case "PAY_DEFICIENCY":
|
case "PAY_DEFICIENCY":
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "PAY_ERROR":
|
case "PAY_ERROR":
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
})
|
||||||
this.$yrouter.replace({
|
this.$yrouter.replace({
|
||||||
path: "/pages/order/OrderDetails/index",
|
path: "/pages/order/MyOrder/index",
|
||||||
query: {
|
query: {
|
||||||
id: data.result.orderId
|
type: 1
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@@ -731,79 +780,97 @@ export default {
|
|||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
})
|
||||||
this.$yrouter.replace({
|
this.paySuccessToMyOrderOrDetail(orderId)
|
||||||
path: "/pages/order/OrderDetails/index",
|
|
||||||
query: {
|
|
||||||
id: data.result.orderId
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
case "WECHAT_H5_PAY":
|
case "WECHAT_H5_PAY":
|
||||||
// H5支付
|
// H5支付
|
||||||
this.$yrouter.replace({
|
this.$yrouter.replace({
|
||||||
path: "/pages/order/OrderDetails/index",
|
path: "/pages/order/MyOrder/index",
|
||||||
query: {
|
query: {
|
||||||
id: data.result.orderId
|
type: 1
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
setTimeout(() => {
|
|
||||||
// location.href = data.result.jsConfig.mweb_url;
|
|
||||||
}, 100);
|
|
||||||
break;
|
break;
|
||||||
case "WECHAT_PAY":
|
case "WECHAT_PAY":
|
||||||
// 小程序支付
|
// 小程序支付
|
||||||
weappPay(data.result.jsConfig).finally(() => {
|
weappPay(data.result.jsConfig).then(() => {
|
||||||
this.$yrouter.replace({
|
this.paySuccessToMyOrderOrDetail(orderId)
|
||||||
path: "/pages/order/OrderDetails/index",
|
}).catch(() => {
|
||||||
query: {
|
this.paySuccessToMyOrderOrDetail(orderId)
|
||||||
id: data.result.orderId
|
})
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "WECHAT_APP_PAY":
|
case "WECHAT_APP_PAY":
|
||||||
// APP支付
|
// APP支付
|
||||||
weappPay(data.result.jsConfig).finally(() => {
|
weappPay(data.result.jsConfig).then(() => {
|
||||||
this.$yrouter.replace({
|
this.paySuccessToMyOrderOrDetail(orderId)
|
||||||
path: "/pages/order/OrderDetails/index",
|
}).catch(() => {
|
||||||
query: {
|
this.paySuccessToMyOrderOrDetail(orderId)
|
||||||
id: data.result.orderId
|
})
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
})
|
}).catch(err => {
|
||||||
.catch(err => {
|
uni.hideLoading()
|
||||||
uni.hideLoading();
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:
|
title: err.msg ||
|
||||||
err.msg ||
|
|
||||||
err.response.data.msg ||
|
err.response.data.msg ||
|
||||||
err.response.data.message ||
|
err.response.data.message ||
|
||||||
"创建订单失败",
|
"创建订单失败",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
})
|
||||||
}).finally(function () {
|
}).finally(function () {
|
||||||
that.isShowPayPwdPop = false;
|
if (that.$refs.payPwdPop) {
|
||||||
that.$refs.payPwdPop.clear();//清空支付密码
|
that.$refs.payPwdPop.clear()
|
||||||
that.$refs.payPwdPop.close();//关闭支付密码弹窗
|
that.$refs.payPwdPop.close()
|
||||||
});
|
}
|
||||||
|
that.isShowPayPwdPop = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
paySuccessToMyOrderOrDetail(orderId) {
|
||||||
|
this.afterPaySuccess(orderId, (drawTicketResult) => {
|
||||||
|
if (this.orderGroupInfo.cartInfo && this.orderGroupInfo.cartInfo.length === 1) {
|
||||||
|
this.$yrouter.replace({
|
||||||
|
path: "/pagesOrder/order/OrderDetails/index",
|
||||||
|
query: this.buildOrderDetailQuery(orderId, drawTicketResult)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$yrouter.replace({
|
||||||
|
path: "/pages/order/MyOrder/index",
|
||||||
|
query: {
|
||||||
|
type: 2,
|
||||||
|
query: this.buildOrderDetailQuery(orderId, drawTicketResult)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.show = !this.show
|
this.show = !this.show
|
||||||
},
|
},
|
||||||
|
showCouponsPopup() {
|
||||||
|
if (this.isLotteryOrder()) return
|
||||||
|
if (this.couponList.usable.length === 0) return
|
||||||
|
this.show = !this.show
|
||||||
|
},
|
||||||
// v9-2
|
// v9-2
|
||||||
changeCoupons(item) {
|
changeCoupons(item) {
|
||||||
|
if (this.isLotteryOrder()) return
|
||||||
if(!item) return
|
if(!item) return
|
||||||
if (this.couponList.usable.length === 0) return
|
if (this.couponList.usable.length === 0) return
|
||||||
this.show = !this.show
|
this.show = !this.show
|
||||||
this.couponId = uni.getStorageSync('couponId') || 0
|
if(!item.id) {
|
||||||
|
this.couponId = 0
|
||||||
|
this.couponTitle = ''
|
||||||
|
this.computedPrice(1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.couponId = item.id
|
||||||
this.couponTitle = item.couponTitle
|
this.couponTitle = item.couponTitle
|
||||||
},
|
this.computedPrice(1)
|
||||||
|
// this.couponId = uni.getStorageSync('couponId') || 0
|
||||||
|
// this.couponTitle = item.couponTitle
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -980,4 +1047,5 @@ export default {
|
|||||||
padding: 20rpx 0 0 0;
|
padding: 20rpx 0 0 0;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="payment-status">
|
|
||||||
<!--失败时: 用icon-iconfontguanbi fail替换icon-duihao2 bg-color-red-->
|
|
||||||
<view class="iconfont icon-duihao2 bg-color-red"></view>
|
|
||||||
<!-- 失败时:订单支付失败 -->
|
|
||||||
<view class="status">订单支付成功</view>
|
|
||||||
<view class="wrapper">
|
|
||||||
<view class="item acea-row row-between-wrapper">
|
|
||||||
<view>订单编号</view>
|
|
||||||
<view class="itemCom">wx3265361456134568</view>
|
|
||||||
</view>
|
|
||||||
<view class="item acea-row row-between-wrapper">
|
|
||||||
<view>下单时间</view>
|
|
||||||
<view class="itemCom">2019-01-09 18:05</view>
|
|
||||||
</view>
|
|
||||||
<view class="item acea-row row-between-wrapper">
|
|
||||||
<view>支付方式</view>
|
|
||||||
<view class="itemCom">微信支付</view>
|
|
||||||
</view>
|
|
||||||
<view class="item acea-row row-between-wrapper">
|
|
||||||
<view>支付金额</view>
|
|
||||||
<view class="itemCom">2222.00</view>
|
|
||||||
</view>
|
|
||||||
<!--失败时加上这个 -->
|
|
||||||
<!--<view class='item acea-row row-between-wrapper'>-->
|
|
||||||
<!--<view>失败原因</view>-->
|
|
||||||
<!--<view class='itemCom'>账户余额不足</view>-->
|
|
||||||
<!--</view>-->
|
|
||||||
</view>
|
|
||||||
<!--失败时: 重新购买 -->
|
|
||||||
<view class="returnBnt bg-color-red">返回查看订单</view>
|
|
||||||
<view class="returnBnt cart-color">返回首页</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="evaluate-list" ref="container">
|
|
||||||
<view class="header">
|
|
||||||
<view class="generalComment acea-row row-between-wrapper">
|
|
||||||
<view class="acea-row row-middle font-color-red">
|
|
||||||
<text class="evaluate">评分</text>
|
|
||||||
<view class="start" :class="'star' + replyData.replyStar"></view>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<text class="font-color-red">{{ replyData.replyChance || 0 }}%</text>
|
|
||||||
<text>好评率</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="nav acea-row row-middle">
|
|
||||||
<view
|
|
||||||
class="acea-row row-center-wrapper"
|
|
||||||
v-for="(item, navListIndex) in navList"
|
|
||||||
:key="navListIndex"
|
|
||||||
@click="changeType(navListIndex)"
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
class="item"
|
|
||||||
:class="currentActive === navListIndex ? 'bg-color-red' : ''"
|
|
||||||
v-if="item.num"
|
|
||||||
>
|
|
||||||
<text>{{ item.evaluate }}({{ item.num }})</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<UserEvaluation :reply="reply"></UserEvaluation>
|
|
||||||
<Loading :loaded="loadend" :loading="loading"></Loading>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import UserEvaluation from "@/components/UserEvaluation";
|
|
||||||
import { getReplyConfig, getReplyList } from "@/api/store";
|
|
||||||
import Loading from "@/components/Loading";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "EvaluateList",
|
|
||||||
components: {
|
|
||||||
UserEvaluation,
|
|
||||||
Loading
|
|
||||||
},
|
|
||||||
props: {},
|
|
||||||
data: function() {
|
|
||||||
return {
|
|
||||||
product_id: 0,
|
|
||||||
replyData: {},
|
|
||||||
navList: [
|
|
||||||
{ evaluate: "全部", num: 0 },
|
|
||||||
{ evaluate: "好评", num: 0 },
|
|
||||||
{ evaluate: "中评", num: 0 },
|
|
||||||
{ evaluate: "差评", num: 0 }
|
|
||||||
],
|
|
||||||
currentActive: 0,
|
|
||||||
page: 1,
|
|
||||||
limit: 8,
|
|
||||||
reply: [],
|
|
||||||
loadTitle: "",
|
|
||||||
loading: false,
|
|
||||||
loadend: false
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted: function() {
|
|
||||||
this.product_id = this.$yroute.query.id;
|
|
||||||
this.getProductReplyCount();
|
|
||||||
this.getProductReplyList();
|
|
||||||
},
|
|
||||||
onReachBottom() {
|
|
||||||
!this.loading && this.getProductReplyList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getProductReplyCount: function() {
|
|
||||||
let that = this;
|
|
||||||
getReplyConfig(that.product_id).then(res => {
|
|
||||||
that.$set(that, "replyData", res.data);
|
|
||||||
that.navList[0].num = res.data.sumCount;
|
|
||||||
that.navList[1].num = res.data.goodCount;
|
|
||||||
that.navList[2].num = res.data.inCount;
|
|
||||||
that.navList[3].num = res.data.poorCount;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getProductReplyList: function() {
|
|
||||||
let that = this;
|
|
||||||
if (that.loading) return; //阻止下次请求(false可以进行请求);
|
|
||||||
if (that.loadend) return; //阻止结束当前请求(false可以进行请求);
|
|
||||||
that.loading = true;
|
|
||||||
let q = { page: that.page, limit: that.limit, type: that.currentActive };
|
|
||||||
getReplyList(that.product_id, q).then(res => {
|
|
||||||
that.loading = false;
|
|
||||||
//apply();js将一个数组插入另一个数组;
|
|
||||||
that.reply.push.apply(that.reply, res.data);
|
|
||||||
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成;
|
|
||||||
that.page = that.page + 1;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
changeType: function(index) {
|
|
||||||
let that = this;
|
|
||||||
that.currentActive = index;
|
|
||||||
that.page = 1;
|
|
||||||
that.loadend = false;
|
|
||||||
that.$set(that, "reply", []);
|
|
||||||
that.getProductReplyList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style scoped lang="less">
|
|
||||||
.noCommodity {
|
|
||||||
height: 8*100rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -252,7 +252,8 @@ export default {
|
|||||||
setHistory(word) {
|
setHistory(word) {
|
||||||
const index = this.historyKey.findIndex(item => item.word === word)
|
const index = this.historyKey.findIndex(item => item.word === word)
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
return
|
this.historyKey.splice(index, 1)
|
||||||
|
// return
|
||||||
}
|
}
|
||||||
this.historyKey.unshift({id: this.$global.generateMixed(10), word })
|
this.historyKey.unshift({id: this.$global.generateMixed(10), word })
|
||||||
uni.setStorageSync('historyKey', JSON.stringify(this.historyKey))
|
uni.setStorageSync('historyKey', JSON.stringify(this.historyKey))
|
||||||
|
|||||||
+146
-32
@@ -32,9 +32,9 @@
|
|||||||
<image :src="webUrl+'/20210806121714655368.png'" mode="" style="width: 36rpx;height: 36rpx;"></image>
|
<image :src="webUrl+'/20210806121714655368.png'" mode="" style="width: 36rpx;height: 36rpx;"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="couponListLimit2ToShow.length > 0 || attr.productSelect.earnPoints" class="v12-mt-1 v12-mb-1">
|
<view v-if="(!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0) || attr.productSelect.earnPoints" class="v12-mt-1 v12-mb-1">
|
||||||
<view class="cell flex jc-between ai-center">
|
<view class="cell flex jc-between ai-center">
|
||||||
<view v-if="couponListLimit2ToShow.length > 0" class="v12-justify-start">
|
<view v-if="!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0" class="v12-justify-start">
|
||||||
<view
|
<view
|
||||||
v-for="(item, index) in couponListLimit2ToShow"
|
v-for="(item, index) in couponListLimit2ToShow"
|
||||||
:key="index"
|
:key="index"
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view
|
<view
|
||||||
v-if="couponListLimit2ToShow.length > 0"
|
v-if="!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0"
|
||||||
class="value value2 v12-font-24 v12-primary-text"
|
class="value value2 v12-font-24 v12-primary-text"
|
||||||
@click="changeCoupons()"
|
@click="changeCoupons()"
|
||||||
>
|
>
|
||||||
@@ -73,11 +73,12 @@
|
|||||||
:style="giftBg ? 'background: url(' + giftBg + ') no-repeat center/cover' : ''"
|
:style="giftBg ? 'background: url(' + giftBg + ') no-repeat center/cover' : ''"
|
||||||
:class="giftBg ? '' : 'v12-primary'"
|
:class="giftBg ? '' : 'v12-primary'"
|
||||||
>
|
>
|
||||||
|
<text v-if="storeInfo.discount > 0" class="v12-font-28 v12-yellow-text ll-text">平台限时补贴{{ storeInfo.discount }}折</text>
|
||||||
<view class="v12-font-28 v12-align-center" style="height: 74rpx; opacity: 0;">
|
<view class="v12-font-28 v12-align-center" style="height: 74rpx; opacity: 0;">
|
||||||
<image class="gift-img" :src="webUrl + '/orderIcon/gift.png'" mode="widthFix" ></image>
|
<image class="gift-img" :src="webUrl + '/orderIcon/gift.png'" mode="widthFix" ></image>
|
||||||
支持礼包赠送
|
支持礼包赠送
|
||||||
</view>
|
</view>
|
||||||
<view @click="toGift" class="v12-white v12-dark-text v12-radius-20 v12-font-28 gift-btn" style="opacity: 0;">
|
<view @click="toGift" class="v12-white v12-dark-text v12-radius-20 v12-font-28 gift-btn" v-if="!giftBg">
|
||||||
送给朋友
|
送给朋友
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -200,13 +201,14 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- v9 优惠券开始 -->
|
<!-- v9 优惠券开始 -->
|
||||||
<u-popup :show="show" :round="10" mode="bottom" closeOnClickOverlay @close="changeCoupons()">
|
<u-popup v-if="!isCountyLotteryGoodsDetail()" :show="show" :round="10" mode="bottom" closeOnClickOverlay @close="changeCoupons()">
|
||||||
<CouponsPopup
|
<CouponsPopup
|
||||||
:two-list="couponList"
|
:two-list="couponList"
|
||||||
@ok="setCoupon"
|
@ok="setCoupon"
|
||||||
@change="changeCoupons"
|
@change="changeCoupons"
|
||||||
@close="changeCoupons()"
|
@close="changeCoupons()"
|
||||||
:showTab="false"
|
:showTab="false"
|
||||||
|
:showRadio="false"
|
||||||
:currentPrice="storeInfo.price" />
|
:currentPrice="storeInfo.price" />
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<!-- v9 优惠券结束 -->
|
<!-- v9 优惠券结束 -->
|
||||||
@@ -273,6 +275,9 @@
|
|||||||
<image class="logo" :src="webUrl+'/orderIcon/地址.png'" mode="" style="margin-right:0; width: 32rpx; height:32rpx; opacity: 0;"/>
|
<image class="logo" :src="webUrl+'/orderIcon/地址.png'" mode="" style="margin-right:0; width: 32rpx; height:32rpx; opacity: 0;"/>
|
||||||
<text v-if="storeInfo.isFastPost == 1">预计48小时内发货</text>
|
<text v-if="storeInfo.isFastPost == 1">预计48小时内发货</text>
|
||||||
<text v-if="storeInfo.isFastPost == 2">预计72小时内发货</text>
|
<text v-if="storeInfo.isFastPost == 2">预计72小时内发货</text>
|
||||||
|
<text v-if="storeInfo.isFastPost == 3">预计24小时内发货</text>
|
||||||
|
<text v-if="storeInfo.isFastPost == 4">预计7天内发货</text>
|
||||||
|
<text v-if="storeInfo.isFastPost == 5">预计15天内发货</text>
|
||||||
<text v-if="storeInfo.isFastPost == 0">{{ "预计发货时间:" + storeInfo.postTime }}</text>
|
<text v-if="storeInfo.isFastPost == 0">{{ "预计发货时间:" + storeInfo.postTime }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -304,7 +309,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- v6服务项目结束 -->
|
<!-- v6服务项目结束 -->
|
||||||
<view class="store-section goods-section" v-if="systemStore">
|
<view class="store-section goods-section" v-if="systemStore && appProductHideMerchant !== '1'">
|
||||||
<view class="flex jc-between ai-center">
|
<view class="flex jc-between ai-center">
|
||||||
<view class="title bold flex ai-center">
|
<view class="title bold flex ai-center">
|
||||||
<view>
|
<view>
|
||||||
@@ -488,6 +493,7 @@
|
|||||||
ref="attrWindow"
|
ref="attrWindow"
|
||||||
:attr="attr"
|
:attr="attr"
|
||||||
:cartNum="cart_num"
|
:cartNum="cart_num"
|
||||||
|
:hideQuantityControls="source === 'countyLottery' && Number(activityId) > 0"
|
||||||
@changeFun="changeFun"
|
@changeFun="changeFun"
|
||||||
:isNegotiable="storeInfo.isNegotiable === 1"
|
:isNegotiable="storeInfo.isNegotiable === 1"
|
||||||
@gift="gift"
|
@gift="gift"
|
||||||
@@ -534,7 +540,7 @@ import {
|
|||||||
getProductSkuBySelected
|
getProductSkuBySelected
|
||||||
} from '@/api/store'
|
} from '@/api/store'
|
||||||
import { userBindParent } from '@/api/user'
|
import { userBindParent } from '@/api/user'
|
||||||
import { handleQrCode, isWeixin } from '@/utils'
|
import { handleLoginFailure, handleQrCode, isWeixin } from '@/utils'
|
||||||
import { getHomeData } from '@/api/public'
|
import { getHomeData } from '@/api/public'
|
||||||
import {
|
import {
|
||||||
getDailyGoods,
|
getDailyGoods,
|
||||||
@@ -573,6 +579,7 @@ export default {
|
|||||||
mixins: [pageListenMixins],
|
mixins: [pageListenMixins],
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
|
appProductHideMerchant: '0',
|
||||||
isGift: false,
|
isGift: false,
|
||||||
giftBg: '',
|
giftBg: '',
|
||||||
// 商品信息是否展开
|
// 商品信息是否展开
|
||||||
@@ -649,11 +656,16 @@ export default {
|
|||||||
pageKeyId: '',
|
pageKeyId: '',
|
||||||
couponListLimit2ToShow: [],
|
couponListLimit2ToShow: [],
|
||||||
qualifications: [],
|
qualifications: [],
|
||||||
couponId: null
|
couponId: null,
|
||||||
|
submitActionLock: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: mapGetters(['isLogin', 'location', 'userInfo']),
|
computed: mapGetters(['isLogin', 'location', 'userInfo']),
|
||||||
onShareAppMessage() {
|
onShareAppMessage() {
|
||||||
|
uni.updateShareMenu({
|
||||||
|
isPrivateMessage: false,
|
||||||
|
withShareTicket: false
|
||||||
|
})
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
let result;
|
let result;
|
||||||
let params = `?id=${this.id}&partnerId=${this.userInfo.uid}`
|
let params = `?id=${this.id}&partnerId=${this.userInfo.uid}`
|
||||||
@@ -679,11 +691,49 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
onShareTimeline() {
|
||||||
|
uni.updateShareMenu({
|
||||||
|
isPrivateMessage: false,
|
||||||
|
withShareTicket: false
|
||||||
|
})
|
||||||
|
const storeName = this.storeInfo.storeName
|
||||||
|
const promise = new Promise(async (resolve, reject) => {
|
||||||
|
let result = null
|
||||||
|
let query = `id=${this.id}&partnerId=${this.userInfo.uid}`
|
||||||
|
if (this.source === 'famous') {
|
||||||
|
result = await famousGoodsShareImage(this.id)
|
||||||
|
}
|
||||||
|
if (this.source === 'kill') {
|
||||||
|
result = await secKillGoodsShareImage(this.activityId)
|
||||||
|
query += `&activityId=${this.activityId}`
|
||||||
|
}
|
||||||
|
if (result && result.status === 200) {
|
||||||
|
resolve({
|
||||||
|
title: storeName,
|
||||||
|
query,
|
||||||
|
imageUrl: result.data
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
resolve({
|
||||||
|
title: storeName,
|
||||||
|
query,
|
||||||
|
imageUrl: this.storeInfo.image
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return {
|
||||||
|
title: storeName,
|
||||||
|
query: `id=${this.id}&partnerId=${this.userInfo.uid}`,
|
||||||
|
imageUrl: this.storeInfo.image,
|
||||||
|
promise
|
||||||
|
}
|
||||||
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
// test data
|
// test data
|
||||||
console.log("getLaunchOptionsSync", uni.getLaunchOptionsSync())
|
console.log("getLaunchOptionsSync", uni.getLaunchOptionsSync())
|
||||||
console.log("getEnterOptionsSync", uni.getEnterOptionsSync())
|
console.log("getEnterOptionsSync", uni.getEnterOptionsSync())
|
||||||
uni.removeStorageSync('couponId')
|
uni.removeStorageSync('couponId')
|
||||||
|
const pageQuery = Object.assign({}, this.resolvePageQuery(), options || {})
|
||||||
const from = options.from
|
const from = options.from
|
||||||
const id = options.id
|
const id = options.id
|
||||||
switch (from) {
|
switch (from) {
|
||||||
@@ -731,10 +781,10 @@ export default {
|
|||||||
if (url && url.productId) {
|
if (url && url.productId) {
|
||||||
this.id = url.productId
|
this.id = url.productId
|
||||||
} else if (options.id) {
|
} else if (options.id) {
|
||||||
this.id = options.id || null
|
this.id = pageQuery.id || options.id || null
|
||||||
this.partnerId = options.partnerId || null
|
this.partnerId = pageQuery.partnerId || options.partnerId || null
|
||||||
this.activityId = this._route.query.activityId
|
this.activityId = Number(pageQuery.activityId || pageQuery.drawActivityId || 0)
|
||||||
this.source = this._route.query.from || ''
|
this.source = pageQuery.from || ''
|
||||||
} else {
|
} else {
|
||||||
const obj = uni.getEnterOptionsSync()
|
const obj = uni.getEnterOptionsSync()
|
||||||
if (options.scene != null || obj.query.scene != null) {
|
if (options.scene != null || obj.query.scene != null) {
|
||||||
@@ -774,6 +824,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.submitActionLock = false
|
||||||
this.getMapData()
|
this.getMapData()
|
||||||
getGiftCardSendBackground().then(res => {
|
getGiftCardSendBackground().then(res => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
@@ -798,6 +849,18 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
resolvePageQuery() {
|
||||||
|
if (this.$yroute && this.$yroute.query) {
|
||||||
|
return this.$yroute.query
|
||||||
|
}
|
||||||
|
if (this.$route && this.$route.query) {
|
||||||
|
return this.$route.query
|
||||||
|
}
|
||||||
|
if (this._route && this._route.query) {
|
||||||
|
return this._route.query
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
},
|
||||||
gift() {
|
gift() {
|
||||||
this.goCat(2)
|
this.goCat(2)
|
||||||
},
|
},
|
||||||
@@ -829,14 +892,23 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
goRoom() {
|
goRoom() {
|
||||||
console.log(this.storeInfo);
|
if (!this.isLogin) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请先登录后联系客服',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
handleLoginFailure()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log(this.attr);
|
||||||
const params = {
|
const params = {
|
||||||
goodsId: this.id,
|
goodsId: this.id,
|
||||||
goodsName: this.attr.productSelect.store_name,
|
goodsName: this.attr.productSelect.store_name,
|
||||||
skuStr: this.attrValue,
|
skuStr: this.attrValue,
|
||||||
price: this.attr.productSelect.price,
|
price: this.attr.productSelect.price,
|
||||||
seckillId: this.activityId,
|
seckillId: this.activityId,
|
||||||
cover: this.attr.productSelect.image,
|
cover: this.attr.productSelect.image || this.storeInfo.image,
|
||||||
goodsData: '',
|
goodsData: '',
|
||||||
seckillData: '',
|
seckillData: '',
|
||||||
isNegotiable: this.storeInfo.isNegotiable
|
isNegotiable: this.storeInfo.isNegotiable
|
||||||
@@ -855,17 +927,18 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
async getMapData() {
|
async getMapData() {
|
||||||
let location = uni.getStorageSync('location')
|
const location = uni.getStorageSync('location')
|
||||||
if (location.length === 0) {
|
if (location.length === 0) {
|
||||||
const map = await getLocation()
|
const map = await getLocation()
|
||||||
if (map.length > 1) {
|
if (map.length > 1) {
|
||||||
const {latitude, longitude} = map[1]
|
const {latitude, longitude} = map[1]
|
||||||
let address = await getCurAddress(latitude, longitude)
|
getCurAddress(latitude, longitude, address => {
|
||||||
address = address[1].data.result.ad_info
|
this.postAddress = address.formattedAddress
|
||||||
location = address.province + address.city + address.district
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
this.postAddress = location
|
this.postAddress = location
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 获取当前位置经纬度
|
// 获取当前位置经纬度
|
||||||
handleLoacation(toast) {
|
handleLoacation(toast) {
|
||||||
@@ -877,9 +950,9 @@ export default {
|
|||||||
const map = await getLocation();
|
const map = await getLocation();
|
||||||
if (map.length > 1) {
|
if (map.length > 1) {
|
||||||
const {latitude, longitude} = map[1]
|
const {latitude, longitude} = map[1]
|
||||||
let address = await getCurAddress(latitude, longitude)
|
getCurAddress(latitude, longitude, address => {
|
||||||
address = address[1].data.result.ad_info
|
that.postAddress = address.formattedAddress
|
||||||
that.postAddress = address.province + address.city + address.district
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
@@ -1023,12 +1096,12 @@ export default {
|
|||||||
},
|
},
|
||||||
goStoreList() {
|
goStoreList() {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: '/pages/shop/StoreList/index'
|
path: '/pagesShop/shop/StoreList/index'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goEvaluateList(id) {
|
goEvaluateList(id) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: '/pages/shop/EvaluateList/index',
|
path: '/pagesShop/shop/EvaluateList/index',
|
||||||
query: {
|
query: {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
@@ -1138,6 +1211,7 @@ export default {
|
|||||||
this.posterData.price = this.storeInfo.price
|
this.posterData.price = this.storeInfo.price
|
||||||
this.posterData.code = this.storeInfo.codeBase
|
this.posterData.code = this.storeInfo.codeBase
|
||||||
this.systemStore = data.systemStore
|
this.systemStore = data.systemStore
|
||||||
|
this.appProductHideMerchant = data.appProductHideMerchant
|
||||||
const good_list = data.goodList || []
|
const good_list = data.goodList || []
|
||||||
const goodArray = []
|
const goodArray = []
|
||||||
const count = Math.ceil(good_list.length / 6)
|
const count = Math.ceil(good_list.length / 6)
|
||||||
@@ -1204,7 +1278,7 @@ export default {
|
|||||||
'store_name',
|
'store_name',
|
||||||
this.storeInfo.storeName
|
this.storeInfo.storeName
|
||||||
)
|
)
|
||||||
this.$set(this.attr.productSelect, 'image', productSelect.image)
|
this.$set(this.attr.productSelect, 'image', productSelect.image || this.storeInfo.image)
|
||||||
this.$set(this.attr.productSelect, 'price', productSelect.price)
|
this.$set(this.attr.productSelect, 'price', productSelect.price)
|
||||||
this.$set(this.attr.productSelect, 'otPrice', productSelect.otPrice)
|
this.$set(this.attr.productSelect, 'otPrice', productSelect.otPrice)
|
||||||
this.$set(this.attr.productSelect, 'stock', productSelect.stock)
|
this.$set(this.attr.productSelect, 'stock', productSelect.stock)
|
||||||
@@ -1331,7 +1405,7 @@ export default {
|
|||||||
subItem.check = true
|
subItem.check = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.$set(this.attr.productSelect, 'image', productSelect.image)
|
this.$set(this.attr.productSelect, 'image', productSelect.image || this.storeInfo.image)
|
||||||
this.$set(this.attr.productSelect, 'price', productSelect.price)
|
this.$set(this.attr.productSelect, 'price', productSelect.price)
|
||||||
this.$set(this.attr.productSelect, 'otPrice', productSelect.otPrice)
|
this.$set(this.attr.productSelect, 'otPrice', productSelect.otPrice)
|
||||||
this.$set(this.attr.productSelect, 'stock', productSelect.stock)
|
this.$set(this.attr.productSelect, 'stock', productSelect.stock)
|
||||||
@@ -1448,27 +1522,55 @@ export default {
|
|||||||
case "day":
|
case "day":
|
||||||
q.dailyGoodsId = Number(this.activityId)
|
q.dailyGoodsId = Number(this.activityId)
|
||||||
break
|
break
|
||||||
|
case "countyLottery":
|
||||||
|
q.drawActivityId = Number(this.activityId || 0)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
if (that.submitActionLock) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
that.submitActionLock = true
|
||||||
postCartAdd(q).then(function (res) {
|
postCartAdd(q).then(function (res) {
|
||||||
that.isOpen = false
|
that.isOpen = false
|
||||||
that.attr.cartAttr = false
|
that.attr.cartAttr = false
|
||||||
if (news === 1) {
|
if (news === 1) {
|
||||||
|
const orderQuery = {
|
||||||
|
id: res.data.cartId,
|
||||||
|
discount: that.storeInfo.discount,
|
||||||
|
}
|
||||||
|
if (that.source === 'countyLottery') {
|
||||||
|
orderQuery.from = 'countyLottery'
|
||||||
|
orderQuery.drawActivityId = Number(that.activityId || 0)
|
||||||
|
}
|
||||||
that.$yrouter.push({
|
that.$yrouter.push({
|
||||||
path: "/pages/order/OrderSubmission/index",
|
path: "/pages/order/OrderSubmission/index",
|
||||||
query: {
|
query: orderQuery
|
||||||
id: res.data.cartId,
|
|
||||||
couponId: that.couponId // 优惠券ID
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
that.submitActionLock = false
|
||||||
|
}, 1500)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(news === 2) {
|
if(news === 2) {
|
||||||
const coupId = that.couponId ? that.couponId : (that.couponList.usable[0] && that.couponList.usable[0].id || '')
|
const coupId = that.couponId ? that.couponId : (that.couponList.usable[0] && that.couponList.usable[0].id || '')
|
||||||
|
let giftUrl = '/pkg_user/views/gift/gift?cartId=' + res.data.cartId
|
||||||
|
if (that.storeInfo.discount) {
|
||||||
|
giftUrl += '&discount=' + that.storeInfo.discount
|
||||||
|
}
|
||||||
|
if (that.source === 'countyLottery') {
|
||||||
|
giftUrl += '&from=countyLottery'
|
||||||
|
giftUrl += '&drawActivityId=' + Number(that.activityId || 0)
|
||||||
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pkg_user/views/gift/gift?cartId=' + res.data.cartId + '&couponId=' + coupId
|
// + '&couponId=' + coupId
|
||||||
|
url: giftUrl
|
||||||
})
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
that.submitActionLock = false
|
||||||
|
}, 1500)
|
||||||
}
|
}
|
||||||
if(news === 0) {
|
if(news === 0) {
|
||||||
|
that.submitActionLock = false
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "添加购物车成功",
|
title: "添加购物车成功",
|
||||||
icon: "success",
|
icon: "success",
|
||||||
@@ -1481,6 +1583,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
that.isOpen = false;
|
that.isOpen = false;
|
||||||
|
that.submitActionLock = false
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: error.msg,
|
title: error.msg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
@@ -1516,11 +1619,16 @@ export default {
|
|||||||
listenerActionClose() {
|
listenerActionClose() {
|
||||||
this.posters = false
|
this.posters = false
|
||||||
},
|
},
|
||||||
|
isCountyLotteryGoodsDetail() {
|
||||||
|
return this.source === 'countyLottery' && Number(this.activityId || 0) > 0
|
||||||
|
},
|
||||||
// v9-2
|
// v9-2
|
||||||
changeCoupons(e) {
|
changeCoupons(e) {
|
||||||
|
if (this.isCountyLotteryGoodsDetail()) return
|
||||||
this.show = !this.show
|
this.show = !this.show
|
||||||
},
|
},
|
||||||
setCoupon(couponId) {
|
setCoupon(couponId) {
|
||||||
|
if (this.isCountyLotteryGoodsDetail()) return
|
||||||
this.couponId = couponId
|
this.couponId = couponId
|
||||||
},
|
},
|
||||||
async checkFavorite() {
|
async checkFavorite() {
|
||||||
@@ -1826,7 +1934,8 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.btn-buy-disabled {
|
.btn-buy-disabled {
|
||||||
background: #9D9D9D;
|
background: #9D9D9D !important;
|
||||||
|
color: #FFFFFF !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2054,6 +2163,7 @@ export default {
|
|||||||
.product-con .footer{
|
.product-con .footer{
|
||||||
height: 140rpx !important;
|
height: 140rpx !important;
|
||||||
padding-bottom: 20rpx;
|
padding-bottom: 20rpx;
|
||||||
|
// z-index: 1002 !important;
|
||||||
}
|
}
|
||||||
.product-con .product-intro .conter view {
|
.product-con .product-intro .conter view {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
@@ -2181,4 +2291,8 @@ export default {
|
|||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.ll-text{
|
||||||
|
margin-left: 250rpx;
|
||||||
|
word-break: keep-all;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -119,7 +119,16 @@
|
|||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</view>
|
</view>
|
||||||
<view class="type">
|
<view class="type">
|
||||||
<view v-if="item.typeName" class="type-tag">
|
<view
|
||||||
|
v-if="item.isTravel === 1"
|
||||||
|
class="type-tag-travel"
|
||||||
|
>
|
||||||
|
旅居店铺
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
v-else-if="item.typeName"
|
||||||
|
class="type-tag"
|
||||||
|
>
|
||||||
{{ item.typeName }}
|
{{ item.typeName }}
|
||||||
</view>
|
</view>
|
||||||
<view v-else> </view>
|
<view v-else> </view>
|
||||||
@@ -140,9 +149,17 @@
|
|||||||
@click="goGoodsCon(good.productId)"
|
@click="goGoodsCon(good.productId)"
|
||||||
>
|
>
|
||||||
<image :src="good.productImage" class="img" />
|
<image :src="good.productImage" class="img" />
|
||||||
<view class="price">
|
<view class="price" style="width: fit-content;">
|
||||||
<text class="txt">¥</text>
|
<text v-if="good.isNegotiable !== 1" class="txt">¥</text>
|
||||||
|
<text v-if="good.isNegotiable !== 1" class="">
|
||||||
{{ force2Decimal(good.productPrice) }}
|
{{ force2Decimal(good.productPrice) }}
|
||||||
|
</text>
|
||||||
|
<text
|
||||||
|
v-if="good.isNegotiable === 1"
|
||||||
|
class="v12-primary-text v12-font-28 v12-font-weight"
|
||||||
|
>
|
||||||
|
价格面议
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -175,7 +192,7 @@
|
|||||||
:cartNum="cart_num"
|
:cartNum="cart_num"
|
||||||
:showOk="true"
|
:showOk="true"
|
||||||
@changeFun="changeFun"
|
@changeFun="changeFun"
|
||||||
@ok="handleOk"
|
@ok="handleOk(() => this.getCartCount())"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -188,9 +205,6 @@ import NP from 'number-precision'
|
|||||||
import NoGoodData from '@/components/good/NoData'
|
import NoGoodData from '@/components/good/NoData'
|
||||||
import Recommend from '@/components/Recommend'
|
import Recommend from '@/components/Recommend'
|
||||||
import goCartMixin from '@/mixins/goCartMixins'
|
import goCartMixin from '@/mixins/goCartMixins'
|
||||||
import {
|
|
||||||
getCartCount,
|
|
||||||
} from '@/api/store'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'GoodsList',
|
name: 'GoodsList',
|
||||||
components: {
|
components: {
|
||||||
@@ -201,7 +215,6 @@ export default {
|
|||||||
mixins: [goCartMixin],
|
mixins: [goCartMixin],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
CartCount: 0,
|
|
||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
list: [],
|
list: [],
|
||||||
query: {
|
query: {
|
||||||
@@ -232,17 +245,7 @@ export default {
|
|||||||
!this.loading && this.getList()
|
!this.loading && this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取购物车数量
|
|
||||||
getCartCount () {
|
|
||||||
const isLogin = this.isLogin
|
|
||||||
if (isLogin) {
|
|
||||||
getCartCount({
|
|
||||||
numType: 0
|
|
||||||
}).then(res => {
|
|
||||||
this.CartCount = res.data.count
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
goShoppingCart() {
|
goShoppingCart() {
|
||||||
this.$yrouter.switchTab('/pages/cart')
|
this.$yrouter.switchTab('/pages/cart')
|
||||||
},
|
},
|
||||||
@@ -267,12 +270,18 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
hotelItemClick(item) {
|
hotelItemClick(item) {
|
||||||
|
if (item.isTravel === 1) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pkg_product/views/sojoumStore?id=' + item.id
|
||||||
|
})
|
||||||
|
} else {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: '/pagesInn/inn/innHome',
|
path: '/pagesInn/inn/innHome',
|
||||||
query: {
|
query: {
|
||||||
id: item.id
|
id: item.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getList() {
|
getList() {
|
||||||
if (this.loading || this.loadend) {
|
if (this.loading || this.loadend) {
|
||||||
@@ -537,6 +546,13 @@ export default {
|
|||||||
color: #946300;
|
color: #946300;
|
||||||
background: linear-gradient(to bottom, #FDF8B9, #E3A72C);
|
background: linear-gradient(to bottom, #FDF8B9, #E3A72C);
|
||||||
}
|
}
|
||||||
|
.type-tag-travel {
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 3px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #fff;
|
||||||
|
background: linear-gradient(to bottom, #77E49F, #4FA379);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.desc {
|
.desc {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
:src="webUrl + '/20230803152147141807.png'"
|
:src="webUrl + '/20230803152147141807.png'"
|
||||||
class="icon"
|
class="icon"
|
||||||
/>
|
/>
|
||||||
<text class="seeNum-txt v12-font-28">{{ item.pv }}</text>
|
<text class="seeNum-txt v12-font-28">{{ $formatCount(item.pv) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -211,7 +211,9 @@ export default {
|
|||||||
},
|
},
|
||||||
getActive() {
|
getActive() {
|
||||||
const params = {
|
const params = {
|
||||||
ancientTownId: this.id
|
ancientTownId: this.id,
|
||||||
|
page: 1,
|
||||||
|
pageSize: 9999
|
||||||
}
|
}
|
||||||
getAncientTownActive(params).then(res => {
|
getAncientTownActive(params).then(res => {
|
||||||
this.activeties = res.data.records || []
|
this.activeties = res.data.records || []
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="my-hdeader-bottom">
|
<view class="my-hdeader-bottom">
|
||||||
<view class="item" @click="linkTo('/pages/user/UserBill/index')">
|
<view class="item" @click="linkTo('/pagesUser/user/UserBill/index')">
|
||||||
<view v-if="!isNoLogin" class="number">
|
<view v-if="!isNoLogin" class="number">
|
||||||
{{ userInfo.nowMoney ? force2Decimal(userInfo.nowMoney) : 0.00 }}
|
{{ userInfo.nowMoney ? force2Decimal(userInfo.nowMoney) : 0.00 }}
|
||||||
</view>
|
</view>
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
余额
|
余额
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item" @click="linkTo('/pages/user/Points/index')">
|
<view class="item" @click="linkTo('/pagesUser/user/Points/index')">
|
||||||
<view v-if="!isNoLogin" class="number">
|
<view v-if="!isNoLogin" class="number">
|
||||||
{{ userInfo.integral || 0 }}
|
{{ userInfo.integral || 0 }}
|
||||||
</view>
|
</view>
|
||||||
@@ -215,6 +215,16 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view
|
||||||
|
v-if="(store.getters.token || userInfo.uid) &&
|
||||||
|
drawConfig.myTicketImageEnable === 1 &&
|
||||||
|
drawConfig.myTicketImage
|
||||||
|
"
|
||||||
|
class="my-ticket-entry"
|
||||||
|
@click="goMyTicketList"
|
||||||
|
>
|
||||||
|
<image :src="drawConfig.myTicketImage" mode="widthFix" class="img" />
|
||||||
|
</view>
|
||||||
<!-- 我的服务开始 -->
|
<!-- 我的服务开始 -->
|
||||||
<view class="myService" style="margin-top: 30rpx !important;">
|
<view class="myService" style="margin-top: 30rpx !important;">
|
||||||
<view class="title acea-row row-middle">
|
<view class="title acea-row row-middle">
|
||||||
@@ -301,6 +311,7 @@ import {
|
|||||||
noticeList,
|
noticeList,
|
||||||
getUserCenterBanner
|
getUserCenterBanner
|
||||||
} from "@/api/user"
|
} from "@/api/user"
|
||||||
|
import { getDrawConfig } from '@/api/lottery'
|
||||||
import {isWeixin} from "@/utils"
|
import {isWeixin} from "@/utils"
|
||||||
import cookie from "@/utils/store/cookie"
|
import cookie from "@/utils/store/cookie"
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
@@ -364,7 +375,7 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '账户明细',
|
text: '账户明细',
|
||||||
url: '/pages/user/UserBill/index',
|
url: '/pagesUser/user/UserBill/index',
|
||||||
icon: '/icon/icon-coin.png',
|
icon: '/icon/icon-coin.png',
|
||||||
allowEnter: true
|
allowEnter: true
|
||||||
},
|
},
|
||||||
@@ -376,19 +387,23 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '团队管理',
|
text: '团队管理',
|
||||||
url: '/pages/user/promotion/UserPromotion/index',
|
url: '/pagesUser/user/promotion/UserPromotion/index',
|
||||||
icon: '/icon/icon-users.png',
|
icon: '/icon/icon-users.png',
|
||||||
allowEnter: true
|
allowEnter: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '商品足迹',
|
text: '商品足迹',
|
||||||
url: '/pages/user/History/index',
|
url: '/pagesUser/user/History/index',
|
||||||
icon: '/icon/icon-help.png',
|
icon: '/icon/icon-help.png',
|
||||||
allowEnter: true
|
allowEnter: true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
bannerBgUrl: '',
|
bannerBgUrl: '',
|
||||||
userCenterBannerUrl: '',
|
userCenterBannerUrl: '',
|
||||||
|
drawConfig: {
|
||||||
|
myTicketImage: '',
|
||||||
|
myTicketImageEnable: 0
|
||||||
|
},
|
||||||
pageKeyId: Object.freeze('userIndex'),
|
pageKeyId: Object.freeze('userIndex'),
|
||||||
nowrap: true,
|
nowrap: true,
|
||||||
// 是否已登录
|
// 是否已登录
|
||||||
@@ -402,6 +417,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
uni.$emit('updateUnreadMessageCount')
|
||||||
if (this.$store.getters.token) {
|
if (this.$store.getters.token) {
|
||||||
this.isNoLogin = false
|
this.isNoLogin = false
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@@ -412,6 +428,7 @@ export default {
|
|||||||
this.getUserLevelInfoReq()
|
this.getUserLevelInfoReq()
|
||||||
this.isWeixin = isWeixin()
|
this.isWeixin = isWeixin()
|
||||||
// this.getUnreadMsgList()
|
// this.getUnreadMsgList()
|
||||||
|
this.getDrawConfigReq()
|
||||||
} else {
|
} else {
|
||||||
this.isNoLogin = true
|
this.isNoLogin = true
|
||||||
/*
|
/*
|
||||||
@@ -428,6 +445,19 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['updateAuthorizationPage']),
|
...mapMutations(['updateAuthorizationPage']),
|
||||||
|
getDrawConfigReq() {
|
||||||
|
getDrawConfig().then(res => {
|
||||||
|
if (res && res.data) {
|
||||||
|
this.drawConfig = {
|
||||||
|
myTicketImage: res.data.myTicketImage || '',
|
||||||
|
myTicketImageEnable: Number(res.data.myTicketImageEnable) || 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
goMyTicketList() {
|
||||||
|
this.linkTo('/pkg-video/views/county-my-tickets')
|
||||||
|
},
|
||||||
// 新增方法:计算文本像素长度
|
// 新增方法:计算文本像素长度
|
||||||
getTextWidth() {
|
getTextWidth() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -485,7 +515,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
goReturnList() {
|
goReturnList() {
|
||||||
this.$yrouter.push('/pages/order/ReturnList/index')
|
this.$yrouter.push('/pagesOrder/order/ReturnList/index')
|
||||||
},
|
},
|
||||||
goMyOrder(type) {
|
goMyOrder(type) {
|
||||||
if (this.isNoLogin) {
|
if (this.isNoLogin) {
|
||||||
@@ -508,7 +538,7 @@ export default {
|
|||||||
},
|
},
|
||||||
goUserAccount() {
|
goUserAccount() {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: '/pages/user/UserAccount/index'
|
path: '/pagesUser/user/UserAccount/index'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goPersonalData() {
|
goPersonalData() {
|
||||||
@@ -680,6 +710,14 @@ export default {
|
|||||||
}
|
}
|
||||||
.my-wrapper {
|
.my-wrapper {
|
||||||
padding: 30upx;
|
padding: 30upx;
|
||||||
|
.my-ticket-entry {
|
||||||
|
margin-top: 30rpx;
|
||||||
|
.img {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
&.wrapper {
|
&.wrapper {
|
||||||
padding: 0 0 30rpx 0 !important;
|
padding: 0 0 30rpx 0 !important;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,7 @@
|
|||||||
:items="district"
|
:items="district"
|
||||||
></CitySelect>
|
></CitySelect>
|
||||||
</view>
|
</view>
|
||||||
<view class="iconfont icon-dizhi font-color-red" @click="getCurAddress()"></view>
|
<view class="iconfont icon-dizhi font-color-red" @click="getCurAddressFn()"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper" style="flex-wrap: nowrap;">
|
<view class="item acea-row row-between-wrapper" style="flex-wrap: nowrap;">
|
||||||
@@ -32,7 +32,8 @@
|
|||||||
<view class="address-analysis-wrap">
|
<view class="address-analysis-wrap">
|
||||||
<view class="inp">
|
<view class="inp">
|
||||||
<textarea
|
<textarea
|
||||||
v-model.trim="addressInput"
|
:value="addressInput"
|
||||||
|
@input="handleAddressInput"
|
||||||
placeholder="请粘贴收件人手机号、姓名、收货地址并用空格区分,系统将自动识别地址信息"
|
placeholder="请粘贴收件人手机号、姓名、收货地址并用空格区分,系统将自动识别地址信息"
|
||||||
placeholder-style="font-size:24rpx;color:#C2C5CC;"
|
placeholder-style="font-size:24rpx;color:#C2C5CC;"
|
||||||
class="inp-textarea"
|
class="inp-textarea"
|
||||||
@@ -74,7 +75,7 @@
|
|||||||
|
|
||||||
<script type="text/babel">
|
<script type="text/babel">
|
||||||
import CitySelect from '@/components/CitySelect'
|
import CitySelect from '@/components/CitySelect'
|
||||||
import config from '@/utils/mapConfig'
|
import {getCurAddress, getLocation} from "@/utils/common"
|
||||||
import { getAddress, getCity, postAddress, analysisAddress } from '@/api/user'
|
import { getAddress, getCity, postAddress, analysisAddress } from '@/api/user'
|
||||||
import attrs, { chs_extphone, required } from '@/utils/validate'
|
import attrs, { chs_extphone, required } from '@/utils/validate'
|
||||||
import { validatorDefaultCatch } from '@/utils/dialog'
|
import { validatorDefaultCatch } from '@/utils/dialog'
|
||||||
@@ -126,6 +127,12 @@ export default {
|
|||||||
this.getUserAddress()
|
this.getUserAddress()
|
||||||
this.getCityList()
|
this.getCityList()
|
||||||
},
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
// 清除定时器,避免内存泄漏
|
||||||
|
if (this.inputTimer) {
|
||||||
|
clearTimeout(this.inputTimer);
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getIndex(value, arr) {
|
getIndex(value, arr) {
|
||||||
var idx = -1
|
var idx = -1
|
||||||
@@ -141,6 +148,17 @@ export default {
|
|||||||
if (!this.addressInput) return
|
if (!this.addressInput) return
|
||||||
this.addressInput = ''
|
this.addressInput = ''
|
||||||
},
|
},
|
||||||
|
handleAddressInput(e) {
|
||||||
|
// 清除之前的定时器
|
||||||
|
if (this.inputTimer) {
|
||||||
|
clearTimeout(this.inputTimer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置新的定时器,延迟300ms执行
|
||||||
|
this.inputTimer = setTimeout(() => {
|
||||||
|
this.addressInput = e.target.value.trim();
|
||||||
|
}, 300);
|
||||||
|
},
|
||||||
// 识别
|
// 识别
|
||||||
distinguishHandle() {
|
distinguishHandle() {
|
||||||
if (!this.addressInput) return
|
if (!this.addressInput) return
|
||||||
@@ -174,113 +192,33 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取当前定位地址
|
//获取当前定位地址
|
||||||
getCurAddress() {
|
async getCurAddressFn() {
|
||||||
|
const that = this
|
||||||
var that = this;
|
|
||||||
//定位
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '定位中...'
|
title: '定位中...'
|
||||||
});
|
|
||||||
|
|
||||||
//this.getLocation();
|
|
||||||
|
|
||||||
uni.getLocation({
|
|
||||||
type: 'wgs84',
|
|
||||||
success: function (res) {
|
|
||||||
let latitude = res.latitude;
|
|
||||||
let longitude = res.longitude;
|
|
||||||
|
|
||||||
console.log('latitude:' + latitude + 'longitude:' + longitude)
|
|
||||||
|
|
||||||
// #ifdef H5
|
|
||||||
Vue.jsonp(
|
|
||||||
'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude + '&key=' + config.key,
|
|
||||||
{
|
|
||||||
//callbackName: 'QQmap',
|
|
||||||
output: 'jsonp',
|
|
||||||
}).then(json => {
|
|
||||||
// Success.
|
|
||||||
uni.hideLoading();
|
|
||||||
|
|
||||||
that.addressText =
|
|
||||||
json.result.ad_info.province + " " + json.result.ad_info.city + " " + json.result.ad_info.district;
|
|
||||||
that.address.province = json.result.ad_info.province;
|
|
||||||
that.address.city = json.result.ad_info.city;
|
|
||||||
that.address.district = json.result.ad_info.district;
|
|
||||||
that.$set(that.userAddress, 'detail', json.result.formatted_addresses.recommend);
|
|
||||||
//that.userAddress.detail = json.result.formatted_addresses.recommend;
|
|
||||||
// that.$refs.cityselect.adjustDefaultValue();
|
|
||||||
|
|
||||||
//设置city_id
|
|
||||||
var pIdx = that.getIndex(that.address.province, that.district);
|
|
||||||
if (pIdx > -1) {
|
|
||||||
var citys = that.district[pIdx].c;
|
|
||||||
var cIdx = that.getIndex(that.address.city, citys);
|
|
||||||
if (cIdx > -1) {
|
|
||||||
var city = citys[cIdx];
|
|
||||||
that.address.city_id = city.v;
|
|
||||||
console.log('city_id:' + city.v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}).catch(err => {
|
|
||||||
// Failed.
|
|
||||||
console.log('地址解析失败:' + JSON.stringify(err));
|
|
||||||
uni.hideLoading();
|
|
||||||
})
|
})
|
||||||
// #endif
|
const map = await getLocation()
|
||||||
|
if (map.length > 1) {
|
||||||
// #ifndef H5
|
const {latitude, longitude} = map[1]
|
||||||
uni.request({
|
getCurAddress(latitude, longitude, address => {
|
||||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude + '&key=' + config.key,
|
that.addressText = address.province + " " + address.city + " " + address.county
|
||||||
success: function (res) {
|
that.address.province = address.province
|
||||||
// console.log('res:'+JSON.stringify(res.data));
|
that.address.city = address.city
|
||||||
uni.hideLoading();
|
that.address.district = address.county
|
||||||
that.addressText =
|
that.$set(that.userAddress, 'detail', address.formattedAddress)
|
||||||
res.data.result.ad_info.province + " " + res.data.result.ad_info.city + " " + res.data.result.ad_info.district;
|
|
||||||
that.address.province = res.data.result.ad_info.province;
|
|
||||||
that.address.city = res.data.result.ad_info.city;
|
|
||||||
that.address.district = res.data.result.ad_info.district;
|
|
||||||
//that.userAddress.detail = res.data.result.formatted_addresses.recommend;
|
|
||||||
that.$set(that.userAddress, 'detail', res.data.result.formatted_addresses.recommend);
|
|
||||||
// that.$refs.cityselect.adjustDefaultValue();
|
|
||||||
// 设置city_id
|
// 设置city_id
|
||||||
var pIdx = that.getIndex(that.address.province, that.district);
|
const pIdx = that.getIndex(that.address.province, that.district)
|
||||||
if (pIdx > -1) {
|
if (pIdx > -1) {
|
||||||
var citys = that.district[pIdx].c;
|
const citys = that.district[pIdx].c
|
||||||
var cIdx = that.getIndex(that.address.city, citys);
|
const cIdx = that.getIndex(that.address.city, citys)
|
||||||
if (cIdx > -1) {
|
if (cIdx > -1) {
|
||||||
var city = citys[cIdx];
|
const city = citys[cIdx]
|
||||||
that.address.city_id = city.v;
|
that.address.city_id = city.v
|
||||||
console.log('city_id:' + city.v);
|
console.log('city_id:' + city.v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
},
|
|
||||||
fail: function (res) {
|
|
||||||
console.log('地址解析失败');
|
|
||||||
uni.hideLoading();
|
|
||||||
},
|
|
||||||
complete: function () {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
fail: function (res) {
|
|
||||||
uni.hideLoading();
|
|
||||||
|
|
||||||
// uni.showToast({
|
|
||||||
// title:'城市定位失败:'+JSON.stringify(res),
|
|
||||||
// icon:'none',
|
|
||||||
// duration:2000
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
getCityList: function () {
|
getCityList: function () {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<view style="position: relative;" class="item" v-for="(item, addressListIndex) in addressList"
|
<view style="position: relative;" class="item" v-for="(item, addressListIndex) in addressList"
|
||||||
:key="addressListIndex" @click="tapAddress(item)">
|
:key="addressListIndex" @click="tapAddress(item)">
|
||||||
|
<view v-if="choosMode" @click.stop="editAddress(addressListIndex)" style="position: absolute; right: 20rpx; top: 0; z-index: 10; padding: 0;" :style="item.isDefault||item.isDefault=='1' ? 'right: 80rpx' : ''">
|
||||||
|
<text class="iconfont icon-bianji" style="color: #999; font-size: 32rpx;"></text>
|
||||||
|
</view>
|
||||||
<view v-if="item.isDefault||item.isDefault=='1' ? true : false" class=""
|
<view v-if="item.isDefault||item.isDefault=='1' ? true : false" class=""
|
||||||
style="position: absolute;top: 0;right: 0;">
|
style="position: absolute;top: 0;right: 0;">
|
||||||
<image style="width: 72rpx;height: 36rpx;" :src="webUrl+'/20210807165228290910.png'" mode=""></image>
|
<image style="width: 72rpx;height: 36rpx;" :src="webUrl+'/20210807165228290910.png'" mode=""></image>
|
||||||
@@ -27,7 +30,7 @@
|
|||||||
<u-icon name="checkbox-mark" color="#C52733" size="20"></u-icon>
|
<u-icon name="checkbox-mark" color="#C52733" size="20"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="!choosMode" class="operation acea-row row-between-wrapper">
|
<view class="operation acea-row row-between-wrapper" v-if="!choosMode">
|
||||||
<view class="select-btn">
|
<view class="select-btn">
|
||||||
<view class="checkbox-wrapper">
|
<view class="checkbox-wrapper">
|
||||||
<checkbox-group @change.stop="radioChange(item.id)">
|
<checkbox-group @change.stop="radioChange(item.id)">
|
||||||
@@ -147,6 +150,11 @@ export default {
|
|||||||
uni.setStorageSync('giftChooseAddress', item)
|
uni.setStorageSync('giftChooseAddress', item)
|
||||||
this.$yrouter.back()
|
this.$yrouter.back()
|
||||||
}
|
}
|
||||||
|
// 来源修改订单地址(复用订单创建页的choosMode但避免污染chooseAddress)
|
||||||
|
if (this.choosMode === 4) {
|
||||||
|
uni.setStorageSync('updateOrderAddress', item)
|
||||||
|
this.$yrouter.back()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
refresh() {
|
refresh() {
|
||||||
this.addressList = []
|
this.addressList = []
|
||||||
@@ -172,7 +180,7 @@ export default {
|
|||||||
this.loadend = res.data.length < this.limit
|
this.loadend = res.data.length < this.limit
|
||||||
this.page = this.page + 1
|
this.page = this.page + 1
|
||||||
if (this.choosMode === 1) {
|
if (this.choosMode === 1) {
|
||||||
this.currentId = uni.getStorageSync('chooseAddress') ? uni.getStorageSync('chooseAddress').id : this.addressList.find(e => e.isDefault === 1) ? this.addressList.find(e => e.isDefault === 1).id : null
|
this.currentId = uni.getStorageSync('sourceAddress') ? uni.getStorageSync('sourceAddress').id : this.addressList.find(e => e.isDefault === 1) ? this.addressList.find(e => e.isDefault === 1).id : null
|
||||||
}
|
}
|
||||||
// 来源购物车
|
// 来源购物车
|
||||||
if (this.choosMode === 2) {
|
if (this.choosMode === 2) {
|
||||||
@@ -182,6 +190,24 @@ export default {
|
|||||||
if (this.choosMode === 3) {
|
if (this.choosMode === 3) {
|
||||||
this.currentId = uni.getStorageSync('giftChooseAddress') ? uni.getStorageSync('giftChooseAddress').id : this.addressList.find(e => e.isDefault === 1) ? this.addressList.find(e => e.isDefault === 1).id : null
|
this.currentId = uni.getStorageSync('giftChooseAddress') ? uni.getStorageSync('giftChooseAddress').id : this.addressList.find(e => e.isDefault === 1) ? this.addressList.find(e => e.isDefault === 1).id : null
|
||||||
}
|
}
|
||||||
|
// 来源修改订单地址
|
||||||
|
if (this.choosMode === 4) {
|
||||||
|
const sourceAddress = uni.getStorageSync('updateOrderSourceAddress') || {}
|
||||||
|
let currentId = sourceAddress.id || null
|
||||||
|
if (!currentId && sourceAddress.userAddress) {
|
||||||
|
const sourceAddressText = String(sourceAddress.userAddress).replace(/\s+/g, '')
|
||||||
|
const sourceRealName = String(sourceAddress.realName || '').trim()
|
||||||
|
const sourcePhone = String(sourceAddress.phone || '').trim()
|
||||||
|
const matched = this.addressList.find(e => {
|
||||||
|
const addressText = `${e.province || ''}${e.city || ''}${e.district || ''}${e.detail || ''}`.replace(/\s+/g, '')
|
||||||
|
const sameAddress = sourceAddressText && addressText === sourceAddressText
|
||||||
|
const samePerson = sourceRealName && sourcePhone && String(e.realName || '').trim() === sourceRealName && String(e.phone || '').trim() === sourcePhone
|
||||||
|
return sameAddress || samePerson
|
||||||
|
})
|
||||||
|
currentId = matched ? matched.id : null
|
||||||
|
}
|
||||||
|
this.currentId = currentId || (this.addressList.find(e => e.isDefault === 1) ? this.addressList.find(e => e.isDefault === 1).id : null)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -273,7 +273,7 @@
|
|||||||
:src="webUrl + '/20230803152147141807.png'"
|
:src="webUrl + '/20230803152147141807.png'"
|
||||||
class="icon"
|
class="icon"
|
||||||
/>
|
/>
|
||||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<image
|
<image
|
||||||
@@ -292,7 +292,7 @@
|
|||||||
v-show="item.zan > 0"
|
v-show="item.zan > 0"
|
||||||
:class="item.zanVo ? 'on' : ''"
|
:class="item.zanVo ? 'on' : ''"
|
||||||
class="seeNum-txt"
|
class="seeNum-txt"
|
||||||
>{{ item.zan }}</text>
|
>{{ $formatCount(item.zan) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
<view class="">
|
<view class="">
|
||||||
<CitySelect
|
<CitySelect
|
||||||
ref="cityselect"
|
ref="cityselect"
|
||||||
:defaultValue="addressText"
|
:defaultValue="addressText || ''"
|
||||||
@callback="result"
|
@callback="result"
|
||||||
:items="district"
|
:items="district"
|
||||||
></CitySelect>
|
></CitySelect>
|
||||||
@@ -219,7 +219,6 @@ import CitySelect from "@/components/CitySelect";
|
|||||||
import tmUpload from '@/components/tm-upload/tm-upload.vue';
|
import tmUpload from '@/components/tm-upload/tm-upload.vue';
|
||||||
import {getCity} from "@/api/user";
|
import {getCity} from "@/api/user";
|
||||||
import {chooseImage, isWeixin} from "@/utils";
|
import {chooseImage, isWeixin} from "@/utils";
|
||||||
import {getHomeData} from "@/api/public";
|
|
||||||
import {VUE_APP_API_URL} from "@/config"
|
import {VUE_APP_API_URL} from "@/config"
|
||||||
import {getHotelTypeList, postHotelApply, postHotelReApply} from "@/api/inn.js";
|
import {getHotelTypeList, postHotelApply, postHotelReApply} from "@/api/inn.js";
|
||||||
|
|
||||||
@@ -440,81 +439,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getIndex(value, arr) {
|
submit() {
|
||||||
var idx = -1;
|
|
||||||
for (var i = 0; i < arr.length; i++) {
|
|
||||||
if (arr[i].n == value) {
|
|
||||||
idx = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return idx;
|
|
||||||
},
|
|
||||||
getCityList: function () {
|
|
||||||
let that = this;
|
|
||||||
getCity()
|
|
||||||
.then(res => {
|
|
||||||
that.district = res.data;
|
|
||||||
// that.ready = true;
|
|
||||||
|
|
||||||
// if(this.id){
|
|
||||||
// //设置city_id
|
|
||||||
// var pIdx = that.getIndex(that.address.province,that.district);
|
|
||||||
// if(pIdx>-1){
|
|
||||||
// var citys = that.district[pIdx].c;
|
|
||||||
// var cIdx = that.getIndex(that.address.city,citys);
|
|
||||||
// if(cIdx>-1){
|
|
||||||
// var city = citys[cIdx];
|
|
||||||
// that.address.city_id = city.v;
|
|
||||||
// console.log('city_id:'+city.v);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
that.$dialog.error(err.msg);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
chooseQrcodeImg: function () {
|
|
||||||
chooseImage(img => {
|
|
||||||
console.log(img)
|
|
||||||
that.$set(that.innApplyInfo, 'qrcode', img);
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
|
||||||
chooseLogoImg: function () {
|
|
||||||
chooseImage(img => {
|
|
||||||
console.log(img)
|
|
||||||
|
|
||||||
that.innApplyInfo.logo = img;
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
|
||||||
chooseCoverImg: function () {
|
|
||||||
chooseImage(img => {
|
|
||||||
console.log(img)
|
|
||||||
|
|
||||||
that.innApplyInfo.cover = img;
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//文件上传结果
|
|
||||||
uploadedImgChange: function (uploadedFilesList) {
|
|
||||||
this.uploadedFilesArray = uploadedFilesList;
|
|
||||||
},
|
|
||||||
submit: function () {
|
|
||||||
|
|
||||||
if (this.innApplyInfo.name.length == 0) {
|
|
||||||
this.$dialog.error("请输入店铺名称");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.innApplyInfo.type.length == 0) {
|
|
||||||
this.$dialog.error("请选择店铺类型");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.addressText.length == 0) {
|
if (this.addressText.length == 0) {
|
||||||
this.$dialog.error("请选择店铺所在省市区");
|
this.$dialog.error("请选择店铺所在省市区");
|
||||||
return;
|
return;
|
||||||
|
|||||||
+126
-6
@@ -272,7 +272,7 @@
|
|||||||
:src="webUrl + '/20230803152147141807.png'"
|
:src="webUrl + '/20230803152147141807.png'"
|
||||||
class="icon"
|
class="icon"
|
||||||
/>
|
/>
|
||||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<image
|
<image
|
||||||
@@ -291,7 +291,15 @@
|
|||||||
v-show="item.zan > 0"
|
v-show="item.zan > 0"
|
||||||
:class="item.zanVo ? 'on' : ''"
|
:class="item.zanVo ? 'on' : ''"
|
||||||
class="seeNum-txt"
|
class="seeNum-txt"
|
||||||
>{{ item.zan }}</text>
|
>{{ $formatCount(item.zan) }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex" @click="infoClick(item)">
|
||||||
|
<!-- <image
|
||||||
|
:src="webUrl + '/20230803152147141807.png'"
|
||||||
|
class="icon"
|
||||||
|
/> -->
|
||||||
|
<u-icon name="chat" size="24"></u-icon>
|
||||||
|
<text class="seeNum-txt">{{ $formatCount(item.replyCount || 0) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isMyInn" class="flex more-btn" @click="toggleMoreHandle(index)">
|
<view v-if="isMyInn" class="flex more-btn" @click="toggleMoreHandle(index)">
|
||||||
<image
|
<image
|
||||||
@@ -335,6 +343,77 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="comment-list v12-px-3" v-if="item.latestReplyList" @click="infoClick(item)">
|
||||||
|
<view class="v12-mt-2" v-for="(comment, i) in item.latestReplyList" :key="i">
|
||||||
|
<view class="user-info v12-align-center">
|
||||||
|
<view class="user-avatar">
|
||||||
|
<u-avatar :src="comment.userAvatar"></u-avatar>
|
||||||
|
</view>
|
||||||
|
<view class="user-name v12-ml-3">
|
||||||
|
<view class="v12-font-bold v12-dark-text v12-font-32">
|
||||||
|
<text>{{ comment.userNickName }}</text>
|
||||||
|
<text v-if="comment.userIsAdmin" class="v12-ml-1 v12-primary v12-white-text v12-font-24 v12-font-weight-400 v12-px-1 v12-radius-8">
|
||||||
|
{{ '店主' }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view class="v12-font-22 v12-secondary-dark-text v12-mt-1">
|
||||||
|
<text>{{ formatterTime(comment.createTime) }}</text>
|
||||||
|
<text v-if="comment.at">
|
||||||
|
{{ ' 回复 ' + comment.at.atNickName }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="user-info v12-d-flex" >
|
||||||
|
<view class="user-avatar">
|
||||||
|
<view style="opacity: 0;">
|
||||||
|
<u-avatar></u-avatar>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="user-name v12-ml-3">
|
||||||
|
<view class="v12-font-28 v12-dark-text">
|
||||||
|
{{ comment.reply }}
|
||||||
|
</view>
|
||||||
|
<view v-if="comment.children">
|
||||||
|
<view class="v12-mt-2" v-for="(_comment, atIndex) in comment.children" :key="atIndex">
|
||||||
|
<view class="user-info v12-align-center">
|
||||||
|
<view class="user-avatar">
|
||||||
|
<u-avatar size="35" :src="_comment.userAvatar"></u-avatar>
|
||||||
|
</view>
|
||||||
|
<view class="user-name v12-ml-3">
|
||||||
|
<view class="v12-font-bold v12-dark-text v12-font-32">
|
||||||
|
<text>{{ _comment.userNickName }}</text>
|
||||||
|
<text v-if="_comment.userIsAdmin" class="v12-ml-1 v12-primary v12-white-text v12-font-24 v12-font-weight-400 v12-px-1 v12-radius-8">
|
||||||
|
{{ '店主' }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view class="v12-font-22 v12-secondary-dark-text v12-mt-1">
|
||||||
|
<text>{{ formatterTime(_comment.createTime) }}</text>
|
||||||
|
<text v-if="_comment.at && _comment.parentReplyId !== comment.id">
|
||||||
|
{{ ' 回复 ' + _comment.at.atNickName }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="user-info v12-align-center">
|
||||||
|
<view class="user-avatar">
|
||||||
|
<view style="opacity: 0;">
|
||||||
|
<u-avatar size="35"></u-avatar>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="user-name v12-ml-3">
|
||||||
|
<view class="v12-font-28 v12-dark-text">
|
||||||
|
{{ _comment.reply }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -453,7 +532,7 @@ import {
|
|||||||
getHotelNewsZan,
|
getHotelNewsZan,
|
||||||
getHotelShareBackgroundImage,
|
getHotelShareBackgroundImage,
|
||||||
hotelNewsView,
|
hotelNewsView,
|
||||||
getMerchantApply
|
getMerchantApply,
|
||||||
} from "@/api/inn.js"
|
} from "@/api/inn.js"
|
||||||
import {formatDateTime} from "@/utils"
|
import {formatDateTime} from "@/utils"
|
||||||
import {getUrlParam} from "@/utils/common.js"
|
import {getUrlParam} from "@/utils/common.js"
|
||||||
@@ -508,7 +587,9 @@ export default {
|
|||||||
isLoadInfoListSuccess: false,
|
isLoadInfoListSuccess: false,
|
||||||
pageKeyId: '',
|
pageKeyId: '',
|
||||||
shareImg: '',
|
shareImg: '',
|
||||||
videoPlayers: []
|
videoPlayers: [],
|
||||||
|
isView: false,
|
||||||
|
skipRefreshOnShow: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
|
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
|
||||||
@@ -583,6 +664,10 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
onShareAppMessage() {
|
onShareAppMessage() {
|
||||||
|
uni.updateShareMenu({
|
||||||
|
isPrivateMessage: false,
|
||||||
|
withShareTicket: false
|
||||||
|
})
|
||||||
return {
|
return {
|
||||||
title: this.inn.name,
|
title: this.inn.name,
|
||||||
path: '/pagesInn/inn/innHome?id=' + this.inn.id,
|
path: '/pagesInn/inn/innHome?id=' + this.inn.id,
|
||||||
@@ -590,13 +675,25 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
console.log(this.infoArray);
|
||||||
|
|
||||||
if (!this.isLoad) {
|
if (!this.isLoad) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (this.skipRefreshOnShow) {
|
||||||
|
this.skipRefreshOnShow = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.fetchInnDetail()
|
||||||
|
if(this.isView) return
|
||||||
|
if(this.activeIndex === 1) {
|
||||||
|
this.fetchInnInfoList()
|
||||||
|
return
|
||||||
|
}
|
||||||
if (uni.getStorageSync('hotelInfoPublish') === '1') {
|
if (uni.getStorageSync('hotelInfoPublish') === '1') {
|
||||||
this.fetchInnInfoList()
|
this.fetchInnInfoList()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
this.fetchInnDetail()
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
activeIndex: {
|
activeIndex: {
|
||||||
@@ -611,6 +708,25 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
formatterTime(time) {
|
||||||
|
const now = new Date();
|
||||||
|
const date = new Date(time);
|
||||||
|
const diff = now - date;
|
||||||
|
const diffMin = Math.floor(diff / 1000 / 60);
|
||||||
|
const diffHour = Math.floor(diff / 1000 / 60 / 60);
|
||||||
|
const diffDay = Math.floor(diff / 1000 / 60 / 60 / 24);
|
||||||
|
if (diffMin < 1) {
|
||||||
|
return "刚刚";
|
||||||
|
} else if (diffHour < 1) {
|
||||||
|
return diffMin + "分钟前";
|
||||||
|
} else if (diffDay < 1) {
|
||||||
|
return diffHour + "小时前";
|
||||||
|
} else if (diffDay < 7) {
|
||||||
|
return diffDay + "天前";
|
||||||
|
} else {
|
||||||
|
return date.getFullYear() + "年" + (date.getMonth() + 1) + "月" + date.getDate() + "日";
|
||||||
|
}
|
||||||
|
},
|
||||||
goHome(e) {
|
goHome(e) {
|
||||||
this.id = e.id
|
this.id = e.id
|
||||||
this.isLoad = false
|
this.isLoad = false
|
||||||
@@ -619,6 +735,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.fetchInnInfoList()
|
this.fetchInnInfoList()
|
||||||
}
|
}
|
||||||
|
this.initPoster()
|
||||||
this.fetchInnDetail()
|
this.fetchInnDetail()
|
||||||
// this.fetchGoods(this.id)
|
// this.fetchGoods(this.id)
|
||||||
},
|
},
|
||||||
@@ -722,7 +839,8 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
infoClick: function (info) {
|
infoClick: function (info) {
|
||||||
// this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id)
|
this.skipRefreshOnShow = true
|
||||||
|
this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id)
|
||||||
},
|
},
|
||||||
coverPlay(){
|
coverPlay(){
|
||||||
this.videoPlayers.forEach(player => {
|
this.videoPlayers.forEach(player => {
|
||||||
@@ -752,6 +870,7 @@ export default {
|
|||||||
}
|
}
|
||||||
uni.$u.debounce(() => {
|
uni.$u.debounce(() => {
|
||||||
hotelNewsView({ id: item.id }).finally(() => {
|
hotelNewsView({ id: item.id }).finally(() => {
|
||||||
|
this.isView = true
|
||||||
this.infoArray.map(info => {
|
this.infoArray.map(info => {
|
||||||
if (info.id === item.id) {
|
if (info.id === item.id) {
|
||||||
info.pv += 1
|
info.pv += 1
|
||||||
@@ -900,6 +1019,7 @@ export default {
|
|||||||
_this.isLoad = true
|
_this.isLoad = true
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
|
this.isView = false
|
||||||
uni.stopPullDownRefresh()
|
uni.stopPullDownRefresh()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
+854
-48
@@ -1,83 +1,884 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="pages-inn-info-detail">
|
<view class="info-section">
|
||||||
<view class="top-box">
|
<view class="info-item">
|
||||||
<view class="title more-t">{{ info.name }}</view>
|
<view
|
||||||
|
:class="item.isTop === 1 ? 'info-item-top' : ''"
|
||||||
<view class="sub flex jc-between ai-center">
|
:style="{
|
||||||
<text class="datetime">{{ info.createdTime }}</text>
|
'background-image': item.isTop
|
||||||
<view class="flex ai-center">
|
? 'url(' + webUrl + '/page/hotel/info-top-bg.png)'
|
||||||
<view class="flex ai-center" style="margin-right: 28rpx">
|
: 'none',
|
||||||
<image :src="webUrl+'/20230803152147141807.png'"/>
|
}"
|
||||||
<view class="num">{{ info.pv }}</view>
|
class="info-item-header"
|
||||||
|
>
|
||||||
|
<view class="name">
|
||||||
|
{{ item.name }}
|
||||||
</view>
|
</view>
|
||||||
<view class="flex ai-center" @click="likeInfo">
|
<view class="intro">
|
||||||
<image :src="webUrl+'/20230803151308999742.png'" v-if="info.zanVo != null"/>
|
{{ item.intro }}
|
||||||
<image :src="webUrl+'/20230803151302213857.png'" v-else/>
|
</view>
|
||||||
<view class="num">{{ info.zan }}</view>
|
</view>
|
||||||
|
<view class="info-item-body">
|
||||||
|
<view v-if="item.type === 'NT_VIDEO'" class="video">
|
||||||
|
<video
|
||||||
|
:src="item.video"
|
||||||
|
:poster="item.video + '?vframe/jpg/offset/1'"
|
||||||
|
controls
|
||||||
|
play-btn-position="center"
|
||||||
|
class="video-item"
|
||||||
|
:id="'video-item' + index"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view v-else>
|
||||||
|
<img-box
|
||||||
|
v-if="item.resources"
|
||||||
|
:imgList="item.resources"
|
||||||
|
:num="item.resources.length"
|
||||||
|
:img-radius="10"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item-bottom">
|
||||||
|
<view class="time">
|
||||||
|
{{
|
||||||
|
item.publishTime
|
||||||
|
? item.publishTime.replace(/-/g, ".").substr(0, 10)
|
||||||
|
: ""
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
|
<view class="btns">
|
||||||
|
<view class="flex">
|
||||||
|
<image :src="webUrl + '/20230803152147141807.png'" class="icon" />
|
||||||
|
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex">
|
||||||
|
<image
|
||||||
|
v-if="!item.zanVo"
|
||||||
|
:src="webUrl + '/page/hotel/zan-off-2.png'"
|
||||||
|
class="zan-off-icon"
|
||||||
|
@click="likeInfo"
|
||||||
|
/>
|
||||||
|
<image
|
||||||
|
v-else
|
||||||
|
:src="webUrl + '/page/hotel/zan-on-2.png'"
|
||||||
|
class="zan-on-icon"
|
||||||
|
@click="likeInfo"
|
||||||
|
/>
|
||||||
|
<text
|
||||||
|
v-show="item.zan > 0"
|
||||||
|
:class="item.zanVo ? 'on' : ''"
|
||||||
|
class="seeNum-txt"
|
||||||
|
>{{ $formatCount(item.zan) }}</text
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
<view class="flex">
|
||||||
|
<u-icon name="chat" size="24"></u-icon>
|
||||||
|
<text class="seeNum-txt">{{ $formatCount(item.replyCount || comments.length) }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="v12-px-2">资讯评论</view>
|
||||||
|
<view v-if="comments.length === 0" class="v12-text-center v12-py-2 v12-dark1-text v12-font-24">
|
||||||
|
暂无评论
|
||||||
|
</view>
|
||||||
|
<view class="comment-list">
|
||||||
|
<view class="v12-mt-2" v-for="(comment, index) in comments" :key="index" @click="selectComment(comment)">
|
||||||
|
<view class="user-info v12-align-center">
|
||||||
|
<view class="user-avatar">
|
||||||
|
<u-avatar :src="comment.userAvatar"></u-avatar>
|
||||||
|
</view>
|
||||||
|
<view class="user-name v12-ml-3">
|
||||||
|
<view class="v12-font-bold v12-dark-text v12-font-32">
|
||||||
|
<text>{{ comment.userNickName }}</text>
|
||||||
|
<text v-if="comment.userIsAdmin" class="v12-ml-1 v12-primary v12-white-text v12-font-24 v12-font-weight-400 v12-px-1 v12-radius-8">
|
||||||
|
{{ '店主' }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view class="v12-font-22 v12-secondary-dark-text v12-mt-1">
|
||||||
|
<text>{{ formatterTime(comment.createTime) }}</text>
|
||||||
|
<text v-if="comment.at">
|
||||||
|
{{ ' 回复 ' + comment.at.atNickName }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="user-info v12-d-flex" >
|
||||||
|
<view class="user-avatar">
|
||||||
|
<view style="opacity: 0;">
|
||||||
|
<u-avatar></u-avatar>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="user-name v12-ml-3">
|
||||||
|
<view class="v12-font-28 v12-dark-text">
|
||||||
|
{{ comment.reply }}
|
||||||
|
</view>
|
||||||
|
<view v-if="comment.children">
|
||||||
|
<view class="v12-mt-2" v-for="(_comment, atIndex) in comment.children" :key="atIndex" @click.stop="selectComment(_comment)">
|
||||||
|
<view class="user-info v12-align-center">
|
||||||
|
<view class="user-avatar">
|
||||||
|
<u-avatar size="35" :src="_comment.userAvatar"></u-avatar>
|
||||||
|
</view>
|
||||||
|
<view class="user-name v12-ml-3">
|
||||||
|
<view class="v12-font-bold v12-dark-text v12-font-32">
|
||||||
|
<text>{{ _comment.userNickName }}</text>
|
||||||
|
<text v-if="_comment.userIsAdmin" class="v12-ml-1 v12-primary v12-white-text v12-font-24 v12-font-weight-400 v12-px-1 v12-radius-8">
|
||||||
|
{{ '店主' }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view class="v12-font-22 v12-secondary-dark-text v12-mt-1">
|
||||||
|
<text>{{ formatterTime(_comment.createTime) }}</text>
|
||||||
|
<text v-if="_comment.at && _comment.parentReplyId !== comment.id">
|
||||||
|
{{ ' 回复 ' + _comment.at.atNickName }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="user-info v12-align-center">
|
||||||
|
<view class="user-avatar">
|
||||||
|
<view style="opacity: 0;">
|
||||||
|
<u-avatar size="35"></u-avatar>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="user-name v12-ml-3">
|
||||||
|
<view class="v12-font-28 v12-dark-text">
|
||||||
|
<!-- <text class="v12-dark1-text" v-if="_comment.at && _comment.parentReplyId !== comment.id">{{ "@" +_comment.at.atNickName }}</text> -->
|
||||||
|
{{ ' ' + _comment.reply }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="comment.hasMoreChildren" class="more-text" @click.stop="showMoreComment(comment)">
|
||||||
|
{{ '—— 点击展开更多回复 ——' }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="video-box" v-if="info.type==='NT_VIDEO'">
|
|
||||||
<video style="width: 100%;height: 320rpx;" :src="info.video" controls play-btn-position="center"/>
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="comment-input-wrap">
|
||||||
|
<view style="width: 100%;">
|
||||||
|
<u-textarea
|
||||||
|
v-model="reply"
|
||||||
|
:prefixIcon="prefixIcon"
|
||||||
|
:maxlength="500"
|
||||||
|
:maxheight="200"
|
||||||
|
:showConfirmBar="false"
|
||||||
|
:autoHeight="reply.length < 40 ? true : false"
|
||||||
|
cursorSpacing="15"
|
||||||
|
placeholder="分享你的观点,让世界听见你的声音..."
|
||||||
|
class="comment-input"
|
||||||
|
@focus="commentInputFocus"
|
||||||
|
@change="commentInputChange"
|
||||||
|
>
|
||||||
|
|
||||||
<view class="content-box">
|
<template slot="prefix">
|
||||||
<rich-text :nodes="info.content"/>
|
<view class="v12-align-center">
|
||||||
|
<u-icon :name="prefixIcon"></u-icon>
|
||||||
|
<u--text
|
||||||
|
v-if="currentComment.userNickName"
|
||||||
|
:text="'@' + currentComment.userNickName"
|
||||||
|
margin="0 3px 0 0"
|
||||||
|
type="tips"
|
||||||
|
></u--text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</u-textarea>
|
||||||
|
</view>
|
||||||
|
<view class="">
|
||||||
|
<view class="send-btn v12-primary v12-white-text" @click="sendComment">发送</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getHotelNewsDetail, getHotelNewsZan} from "@/api/inn";
|
import { getHotelNewsDetail, getHotelNewsZan, getCommentList, addComment } from "@/api/inn"
|
||||||
|
import imgBox from '@/components/imageTypeSet/imagebox.vue'
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
imgBox
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
id: null,
|
id: null,
|
||||||
info: null
|
item: {},
|
||||||
|
comments: [],
|
||||||
|
reply: '',
|
||||||
|
atUid: '',
|
||||||
|
currentComment: {},
|
||||||
|
prefixIcon: 'edit-pen'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.id = options.id;
|
this.id = options.id
|
||||||
this.init();
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
showMoreComment(comment) {
|
||||||
getHotelNewsDetail(this.id).then(({data}) => this.info = data);
|
const params = {
|
||||||
},
|
contentId: this.id,
|
||||||
|
contentType: "hotelNews",
|
||||||
likeInfo() {
|
rootReplyId: comment.id,
|
||||||
let that = this;
|
page: 1,
|
||||||
uni.showLoading();
|
limit: 99999
|
||||||
getHotelNewsZan(this.id).then((res) => {
|
|
||||||
uni.hideLoading();
|
|
||||||
|
|
||||||
uni.showToast({
|
|
||||||
title: res.msg,
|
|
||||||
mask: false,
|
|
||||||
duration: 1500,
|
|
||||||
success() {
|
|
||||||
if (res.status === 200) that.info = res.data;
|
|
||||||
}
|
}
|
||||||
})
|
getCommentList(params).then((res) => {
|
||||||
}).catch((err) => {
|
comment.children = res.data.records
|
||||||
uni.hideLoading()
|
comment.hasMoreChildren = false
|
||||||
uni.showToast({
|
|
||||||
title: err.msg + '',
|
|
||||||
icon: 'none',
|
|
||||||
mask: false,
|
|
||||||
duration: 1500
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
commentInputChange(e) {
|
||||||
|
// 若删除直接将@用户名整个删除
|
||||||
|
if (e === '') {
|
||||||
|
this.currentComment = {}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 若删除@用户名,将@用户名整个删除
|
||||||
|
const usernameLength = `@${this.currentComment.userNickName} `.length
|
||||||
|
if(!e.includes(`@${this.currentComment.userNickName} `) && this.currentComment.userNickName) {
|
||||||
|
this.currentComment = {}
|
||||||
|
// 去除@用户名
|
||||||
|
this.reply = e.slice(usernameLength - 1)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
commentInputFocus(e) {
|
||||||
|
// this.prefixIcon = ''
|
||||||
|
},
|
||||||
|
selectComment(comment) {
|
||||||
|
this.currentComment = comment
|
||||||
|
this.reply = '@' + comment.userNickName + ' '
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 格式化时间
|
||||||
|
* @param {*} time 时间
|
||||||
|
* @returns 距离当前时间的时间差
|
||||||
|
* 1. 小于1分钟,显示刚刚
|
||||||
|
* 2. 小于1小时,显示xx分钟前
|
||||||
|
* 3. 小于1天,显示xx小时前
|
||||||
|
* 4. 超过7天,显示日期 xxxx年xx月xx日
|
||||||
|
*/
|
||||||
|
formatterTime(time) {
|
||||||
|
const now = new Date()
|
||||||
|
const date = new Date(time)
|
||||||
|
const diff = now - date
|
||||||
|
const diffMin = Math.floor(diff / 1000 / 60)
|
||||||
|
const diffHour = Math.floor(diff / 1000 / 60 / 60)
|
||||||
|
const diffDay = Math.floor(diff / 1000 / 60 / 60 / 24)
|
||||||
|
if (diffMin < 1) {
|
||||||
|
return "刚刚"
|
||||||
|
} else if (diffHour < 1) {
|
||||||
|
return diffMin + "分钟前"
|
||||||
|
} else if (diffDay < 1) {
|
||||||
|
return diffHour + "小时前"
|
||||||
|
} else if (diffDay < 7) {
|
||||||
|
return diffDay + "天前"
|
||||||
|
} else {
|
||||||
|
return date.getFullYear() + "年" + (date.getMonth() + 1) + "月" + date.getDate() + "日"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 发评论
|
||||||
|
*/
|
||||||
|
sendComment() {
|
||||||
|
if (!this.reply.trim()) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入评论内容',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(this.reply.trim() === ('@' + this.currentComment.userNickName)) {
|
||||||
|
// 请输入回复内容
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入回复内容',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.showLoading({
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
const params = {
|
||||||
|
contentId: this.id,
|
||||||
|
contentType: 'hotelNews',
|
||||||
|
parentReplyId: this.currentComment.parentId || this.currentComment.id,
|
||||||
|
reply: (this.reply.replace('@' + this.currentComment.userNickName, '')).trim(),
|
||||||
|
atUid: this.currentComment.uid || null
|
||||||
|
}
|
||||||
|
addComment(params).then((res) => {
|
||||||
|
uni.hideLoading()
|
||||||
|
this.init()
|
||||||
|
this.reply = ''
|
||||||
|
this.currentComment = {}
|
||||||
|
this.item.replyCount === null ? this.item.replyCount = 1 : this.item.replyCount++
|
||||||
|
})
|
||||||
|
},
|
||||||
|
init() {
|
||||||
|
getHotelNewsDetail(this.id).then(({ data }) => (this.item = data))
|
||||||
|
this.getComment()
|
||||||
|
},
|
||||||
|
// contentId int 评论的目标内容ID,必传
|
||||||
|
// contentType string 评论的目标内容类型,必传(店铺资讯传入值hotelNews)
|
||||||
|
// rootReplyId int 根评论ID
|
||||||
|
// page int 页码
|
||||||
|
// limit int 每页数量
|
||||||
|
getComment() {
|
||||||
|
const params = {
|
||||||
|
contentId: this.id,
|
||||||
|
contentType: "hotelNews",
|
||||||
|
page: 1,
|
||||||
|
limit: 99999
|
||||||
|
}
|
||||||
|
getCommentList(params).then((res) => {
|
||||||
|
this.comments = res.data.records
|
||||||
|
})
|
||||||
|
},
|
||||||
|
likeInfo() {
|
||||||
|
uni.showLoading({
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
getHotelNewsZan(this.id).then((res) => {
|
||||||
|
uni.hideLoading()
|
||||||
|
getHotelNewsDetail(this.id).then(({ data }) => (this.item = data))
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
@import "@/assets/css/store.less";
|
||||||
|
.comment-list{
|
||||||
|
padding-bottom: 100rpx;
|
||||||
|
}
|
||||||
|
.more-text{
|
||||||
|
color:#1B76F0;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
.comment-input-wrap{
|
||||||
|
padding: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
position: -webkit-sticky;
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
bottom: 0;
|
||||||
|
background: #fff;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
.comment-input{
|
||||||
|
height: 70rpx;
|
||||||
|
background: rgba(246,246,246,0.39);
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
.send-btn{
|
||||||
|
border-radius: 16rpx;
|
||||||
|
width: 96rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
line-height: 70rpx;
|
||||||
|
text-align: center;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
}
|
||||||
|
.my-inn-page {
|
||||||
|
padding: 0 0 100rpx 0;
|
||||||
|
background-color: #f6f6f6;
|
||||||
|
}
|
||||||
|
.cover-box {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.full-img {
|
||||||
|
width: 750rpx;
|
||||||
|
}
|
||||||
|
.video {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.guarantee {
|
||||||
|
margin-right: 16rpx;
|
||||||
|
padding: 8rpx 16rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
background: #0DC5C5;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 22rpx;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
.zan-favorite-wrap {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
.on {
|
||||||
|
color: #FF564A;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.zan-box {
|
||||||
|
.img {
|
||||||
|
width: 36rpx;
|
||||||
|
height: 36rpx;
|
||||||
|
margin: 0 8rpx 0 0;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.favorite-box {
|
||||||
|
.icon {
|
||||||
|
width: 36rpx;
|
||||||
|
height: 36rpx;
|
||||||
|
margin: 0 8rpx 0 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.store-img {
|
||||||
|
width: 686rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-section {
|
||||||
|
padding: 40rpx 32rpx 0;
|
||||||
|
background: #F5F5FA;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
position: relative;
|
||||||
|
width: 332rpx;
|
||||||
|
height: 528rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-right: 22rpx;
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
padding: 0 6rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price-line {
|
||||||
|
padding: 0 10rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
line-height: 38rpx;
|
||||||
|
color: #ED0F0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sales-line {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
padding: 8rpx 10rpx 18rpx;
|
||||||
|
border-top: 1rpx solid #EFEFEF;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
color: #8D8D8D;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item:nth-child(2n) {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cover {
|
||||||
|
width: 332rpx;
|
||||||
|
height: 332rpx;
|
||||||
|
background: rgba(255, 255, 255, 0.39);
|
||||||
|
border-radius: 8rpx;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
margin-right: 4rpx;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
margin-right: 6rpx;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
display: flex;
|
||||||
|
padding: 20rpx 0 40rpx 0;
|
||||||
|
justify-content: center;
|
||||||
|
.btn-cont {
|
||||||
|
padding: 13rpx 30rpx;
|
||||||
|
border: 1px solid #0DC5C5;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
color: #0DC5C5;
|
||||||
|
.iconfont {
|
||||||
|
margin: 0 0 0 20rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
position: relative;
|
||||||
|
background: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.innInfoWrap {
|
||||||
|
position: relative;
|
||||||
|
margin-top: -76rpx;
|
||||||
|
padding: 20rpx 36rpx;
|
||||||
|
line-height: 1;
|
||||||
|
z-index: 1;
|
||||||
|
.bg-color {
|
||||||
|
position: absolute;
|
||||||
|
top: -5px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 1;
|
||||||
|
height: 50%;
|
||||||
|
background: linear-gradient(-180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);
|
||||||
|
|
||||||
|
.box-mask {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
left: 166rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 32rpx 12rpx 0;
|
||||||
|
|
||||||
|
.city-section {
|
||||||
|
width: 256rpx;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.body-cont {
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.inn-logo {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 56*2rpx;
|
||||||
|
height: 56*2rpx;
|
||||||
|
margin-right: 18rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inn-logo image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inn-name {
|
||||||
|
width: 280rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
line-height: 48rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inn-owner {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #8B8F99;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inn-tag-wrap {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
.inn-signature-wrap {
|
||||||
|
position: relative;
|
||||||
|
z-index: 5;
|
||||||
|
padding: 0 32rpx;
|
||||||
|
margin: 20rpx 0 0 0;
|
||||||
|
.triangle {
|
||||||
|
position: absolute;
|
||||||
|
top: -20rpx;
|
||||||
|
left: 72rpx;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-left: 20rpx solid transparent;
|
||||||
|
border-right: 20rpx solid transparent;
|
||||||
|
border-bottom: 24rpx solid rgba(243,243,246,0.39);
|
||||||
|
}
|
||||||
|
.inn-signature {
|
||||||
|
position: relative;
|
||||||
|
padding: 20rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #080F1A;
|
||||||
|
background: rgba(243,243,246,0.39);
|
||||||
|
box-shadow: 0px 6px 12px rgba(0,0,0,0.12);
|
||||||
|
}
|
||||||
|
.share-btn {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
bottom: -68rpx;
|
||||||
|
.img {
|
||||||
|
width: 212rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btLine {
|
||||||
|
width: 100%;
|
||||||
|
height: 6rpx;
|
||||||
|
margin-top: 18rpx;
|
||||||
|
background: #0DC5C5;
|
||||||
|
}
|
||||||
|
.pics-box {
|
||||||
|
margin: 36rpx;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
.pics-list {
|
||||||
|
position: relative;
|
||||||
|
padding: 32rpx 0;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.pics-list .pics-item {
|
||||||
|
margin-left: 36rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
.bottom-view {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 99;
|
||||||
|
display: flex;
|
||||||
|
height: 70rpx;
|
||||||
|
padding: 15rpx;
|
||||||
|
border-top: 1px solid #f1f1f1;
|
||||||
|
background: #FFFFFF;
|
||||||
|
|
||||||
|
.bottom-btn {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
line-height: 70rpx;
|
||||||
|
&:first-child {
|
||||||
|
border-right: 1px solid #d5d5d5;
|
||||||
|
}
|
||||||
|
.img {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
margin: 0 12rpx 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tab-item-active {
|
||||||
|
color:#080F1A;
|
||||||
|
font-size:32rpx;
|
||||||
|
}
|
||||||
|
.tab-item-no-active {
|
||||||
|
color:#A6AAB3;
|
||||||
|
font-size:28rpx;
|
||||||
|
}
|
||||||
|
.map-wrapper {
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
height: 200rpx;
|
||||||
|
margin: 40rpx 0 0 0;
|
||||||
|
overflow: hidden;
|
||||||
|
.map-cont {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 2;
|
||||||
|
width: 100%;
|
||||||
|
opacity: 0.3;
|
||||||
|
transform: translateY(-50rpx);
|
||||||
|
}
|
||||||
|
.bg {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 3;
|
||||||
|
height: 60rpx;
|
||||||
|
background: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
|
||||||
|
}
|
||||||
|
.map-info {
|
||||||
|
position: relative;
|
||||||
|
z-index: 5;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 40rpx 10rpx 40rpx 32rpx;
|
||||||
|
color: #333;
|
||||||
|
font-size: 14px;
|
||||||
|
justify-content: space-between;
|
||||||
|
.map-info-hd {
|
||||||
|
.icon {
|
||||||
|
display: block;
|
||||||
|
width: 56rpx;
|
||||||
|
height: 56rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.map-info-bd {
|
||||||
|
flex: 1;
|
||||||
|
padding: 0 60rpx 0 20rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
}
|
||||||
|
.map-info-ft {
|
||||||
|
.item + .item {
|
||||||
|
margin: 0 0 0 6rpx;
|
||||||
|
}
|
||||||
|
.item {
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 500;
|
||||||
|
.img {
|
||||||
|
display: block;
|
||||||
|
width: 96rpx;
|
||||||
|
height: 96rpx;
|
||||||
|
margin: 0 0 -16rpx 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.top-tab {
|
||||||
|
margin: 60rpx 0 0 0;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
.tab {
|
||||||
|
margin: 0 35rpx;
|
||||||
|
&.hide {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.info-section,
|
||||||
|
.pics-section,
|
||||||
|
.qualifications-section {
|
||||||
|
position: relative;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
.info-section,
|
||||||
|
.qualifications-section {
|
||||||
|
padding: 32rpx;
|
||||||
|
}
|
||||||
|
.info-section {
|
||||||
|
word-break: break-all;
|
||||||
|
min-height: 100vh;
|
||||||
|
.info-item + .info-item {
|
||||||
|
margin: 32rpx 0 0 0;
|
||||||
|
}
|
||||||
|
.info-item {
|
||||||
|
border-radius: 10rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
.info-item-header {
|
||||||
|
position: relative;
|
||||||
|
padding: 20rpx 20rpx 0 20rpx;
|
||||||
|
&.info-item-top {
|
||||||
|
padding-top: 60rpx;
|
||||||
|
background-size: 100% 80rpx;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-image: url();
|
||||||
|
}
|
||||||
|
.name {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #333;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.intro {
|
||||||
|
margin: 10rpx 0 0 0;
|
||||||
|
color: #666;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.info-item-body {
|
||||||
|
padding: 0 20rpx 20rpx 20rpx;
|
||||||
|
.video {
|
||||||
|
padding: 20rpx 0 0 0;
|
||||||
|
.video-item {
|
||||||
|
width: 100%;
|
||||||
|
height: 400rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.info-item-bottom {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 20rpx 20rpx 20rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
border-bottom: 1px solid #f1f1f1;
|
||||||
|
font-size: 16px;
|
||||||
|
.time {
|
||||||
|
flex: 1;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
.btns {
|
||||||
|
display: flex;
|
||||||
|
color: #999;
|
||||||
|
.flex + .flex {
|
||||||
|
margin: 0 0 0 32rpx;
|
||||||
|
}
|
||||||
|
.flex {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.icon {
|
||||||
|
width: 32rpx;
|
||||||
|
height: 32rpx;
|
||||||
|
margin: 0 8rpx 0 0;
|
||||||
|
}
|
||||||
|
.zan-off-icon {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
}
|
||||||
|
.zan-on-icon {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
}
|
||||||
|
.seeNum-txt {
|
||||||
|
&.on {
|
||||||
|
color: #D81E06;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.more-btn {
|
||||||
|
position: relative;
|
||||||
|
.more-wrapper {
|
||||||
|
position: absolute;
|
||||||
|
right: -20rpx;
|
||||||
|
top: -150rpx;
|
||||||
|
z-index: 5;
|
||||||
|
width: 200rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0px 1px 6px rgba(0,0,0,0.16);
|
||||||
|
.more-item + .more-item {
|
||||||
|
border-top: 1px solid #d5d5d5;
|
||||||
|
}
|
||||||
|
.more-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 70rpx;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #333;
|
||||||
|
.more-icon {
|
||||||
|
width: 36rpx;
|
||||||
|
height: 36rpx;
|
||||||
|
margin: 0 10rpx 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tab-no-data {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #999;
|
||||||
|
line-height: 200rpx;
|
||||||
|
}
|
||||||
.pages-inn-info-detail {
|
.pages-inn-info-detail {
|
||||||
.top-box {
|
.top-box {
|
||||||
padding: 40rpx 32rpx 20rpx;
|
padding: 40rpx 32rpx 20rpx;
|
||||||
@@ -123,4 +924,9 @@ export default {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.user-info{
|
||||||
|
view{
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -2,11 +2,12 @@
|
|||||||
<view class="apply-return">
|
<view class="apply-return">
|
||||||
<view class="goodsStyle acea-row row-between" v-for="cart in orderInfo.cartInfo" :key="cart.id">
|
<view class="goodsStyle acea-row row-between" v-for="cart in orderInfo.cartInfo" :key="cart.id">
|
||||||
<view class="pictrue">
|
<view class="pictrue">
|
||||||
<image :src="cart.productInfo.image" class="image" />
|
<image v-if="orderInfo.isGiftCardReceiveBlind === 0" :src="cart.productInfo.image" class="image" />
|
||||||
|
<image v-else class="image" :src="webUrl+'/orderIcon/盲盒礼包.png'"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="text acea-row row-between" >
|
<view class="text acea-row row-between" >
|
||||||
<view class="name line2">{{ cart.productInfo.storeName }}</view>
|
<view class="name line2">{{ orderInfo.isGiftCardReceiveBlind === 0 ? cart.productInfo.storeName : '盲盒礼包' }}</view>
|
||||||
<view class="money">
|
<view class="money" v-if="orderInfo.isGiftCardReceiveBlind === 0">
|
||||||
<view>
|
<view>
|
||||||
¥{{
|
¥{{
|
||||||
cart.productInfo.attrInfo
|
cart.productInfo.attrInfo
|
||||||
@@ -23,7 +24,7 @@
|
|||||||
<view>退货件数</view>
|
<view>退货件数</view>
|
||||||
<view class="num">{{ orderInfo.totalNum }}</view>
|
<view class="num">{{ orderInfo.totalNum }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper">
|
<view class="item acea-row row-between-wrapper" v-if="orderInfo.isGiftCardReceiveBlind === 0">
|
||||||
<view>退款金额</view>
|
<view>退款金额</view>
|
||||||
<view class="num">¥{{ orderInfo.payPrice }}</view>
|
<view class="num">¥{{ orderInfo.payPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -65,6 +66,7 @@ export default {
|
|||||||
mixins: [pageListenMixins],
|
mixins: [pageListenMixins],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
url: `${VUE_APP_API_URL}/upload/image`,
|
url: `${VUE_APP_API_URL}/upload/image`,
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + this.$store.state.token
|
Authorization: "Bearer " + this.$store.state.token
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="return-list" ref="container">
|
<view class="return-list" ref="container">
|
||||||
<view class="goodWrapper" v-for="(order,orderListIndex) in orderList" :key="orderListIndex">
|
<view class="goodWrapper" v-for="(order,orderListIndex) in orderList" :key="orderListIndex">
|
||||||
<view class="iconfont icon-tuikuanzhong powder" v-if="order._status._type === '-1'"></view>
|
<view class="iconfont icon-tuikuanzhong powder" v-if="parseInt(order._status._type) === -1"></view>
|
||||||
<view class="iconfont icon-yituikuan" v-if="order._status._type === '-2'"></view>
|
<view class="iconfont icon-yituikuan" v-if="parseInt(order._status._type) === -2"></view>
|
||||||
<image class="iconfont" :src="webUrl+'/20230713110051999762.png'" v-if="order._status._type === '-3'"/>
|
<image class="iconfont" :src="webUrl+'/20230713110051999762.png'" v-if="parseInt(order._status._type) === -3"/>
|
||||||
<view class="orderNum">订单号:{{ order.orderId }}</view>
|
<view class="orderNum">订单号:{{ order.orderId }}</view>
|
||||||
<view
|
<view
|
||||||
class="item acea-row row-between-wrapper"
|
class="item acea-row row-between-wrapper"
|
||||||
@@ -76,7 +76,7 @@ export default {
|
|||||||
},
|
},
|
||||||
goOrderDetails(order) {
|
goOrderDetails(order) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/order/OrderDetails/index",
|
path: "/pagesOrder/order/OrderDetails/index",
|
||||||
query: {id: order.orderId}
|
query: {id: order.orderId}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -0,0 +1,165 @@
|
|||||||
|
<template>
|
||||||
|
<view class="evaluate-list" ref="container">
|
||||||
|
<view class="header">
|
||||||
|
<view class="generalComment acea-row row-between-wrapper">
|
||||||
|
<view class="acea-row row-middle font-color-red">
|
||||||
|
<text class="evaluate">评分</text>
|
||||||
|
<view class="start" :class="'star' + replyData.replyStar"></view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<text class="font-color-red">{{ isTravelGroup ? replyData.replyChance || 0 : replyData.replyChance + '%' || 0 }}</text>
|
||||||
|
<text> {{ ` 好评率` }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="nav acea-row row-middle">
|
||||||
|
<view
|
||||||
|
class="acea-row row-center-wrapper"
|
||||||
|
v-for="(item, navListIndex) in navList"
|
||||||
|
:key="navListIndex"
|
||||||
|
@click="changeType(navListIndex)"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="item"
|
||||||
|
:class="currentActive === navListIndex ? 'bg-color-red' : ''"
|
||||||
|
v-if="item.num"
|
||||||
|
>
|
||||||
|
<text>{{ item.evaluate }}({{ item.num }})</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<UserEvaluation :reply="reply"></UserEvaluation>
|
||||||
|
<Loading :loaded="loadend" :loading="loading"></Loading>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import UserEvaluation from "@/components/UserEvaluation";
|
||||||
|
import { getReplyConfig, getReplyList } from "@/api/store";
|
||||||
|
import { getJiaLouProductReply, getJiaLouProductReplyCount } from "@/api/qianxian";
|
||||||
|
import Loading from "@/components/Loading";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "EvaluateList",
|
||||||
|
components: {
|
||||||
|
UserEvaluation,
|
||||||
|
Loading
|
||||||
|
},
|
||||||
|
props: {},
|
||||||
|
data: function() {
|
||||||
|
return {
|
||||||
|
product_id: 0,
|
||||||
|
isTravelGroup: false,
|
||||||
|
replyData: {},
|
||||||
|
navList: [
|
||||||
|
{ evaluate: "全部", num: 0 },
|
||||||
|
{ evaluate: "好评", num: 0 },
|
||||||
|
{ evaluate: "中评", num: 0 },
|
||||||
|
{ evaluate: "差评", num: 0 }
|
||||||
|
],
|
||||||
|
currentActive: 0,
|
||||||
|
page: 1,
|
||||||
|
limit: 8,
|
||||||
|
reply: [],
|
||||||
|
loadTitle: "",
|
||||||
|
loading: false,
|
||||||
|
loadend: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted: function() {
|
||||||
|
this.product_id = this.$yroute.query.id;
|
||||||
|
this.isTravelGroup = String(this.$yroute.query.isTravelGroup || '') === '1';
|
||||||
|
this.getProductReplyCount();
|
||||||
|
this.getProductReplyList();
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
!this.loading && this.getProductReplyList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getProductReplyCount: function() {
|
||||||
|
let that = this;
|
||||||
|
if (that.isTravelGroup) {
|
||||||
|
getJiaLouProductReplyCount({
|
||||||
|
travelGroupProductId: that.product_id
|
||||||
|
}).then(res => {
|
||||||
|
const data = res.data || {};
|
||||||
|
that.$set(that, "replyData", data);
|
||||||
|
that.navList[0].num = data.sumCount || 0;
|
||||||
|
that.navList[1].num = data.goodCount || 0;
|
||||||
|
that.navList[2].num = data.inCount || 0;
|
||||||
|
that.navList[3].num = data.poorCount || 0;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
getReplyConfig(that.product_id).then(res => {
|
||||||
|
const data = res.data || {};
|
||||||
|
that.$set(that, "replyData", data);
|
||||||
|
that.navList[0].num = data.sumCount || 0;
|
||||||
|
that.navList[1].num = data.goodCount || 0;
|
||||||
|
that.navList[2].num = data.inCount || 0;
|
||||||
|
that.navList[3].num = data.poorCount || 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getProductReplyList: function() {
|
||||||
|
let that = this;
|
||||||
|
if (that.loading) return;
|
||||||
|
if (that.loadend) return;
|
||||||
|
that.loading = true;
|
||||||
|
let q = { page: that.page, limit: that.limit, type: that.currentActive };
|
||||||
|
if (that.isTravelGroup) {
|
||||||
|
getJiaLouProductReply({
|
||||||
|
travelGroupProductId: that.product_id,
|
||||||
|
type: q.type,
|
||||||
|
page: q.page,
|
||||||
|
limit: q.limit
|
||||||
|
}).then(res => {
|
||||||
|
that.loading = false;
|
||||||
|
const pageData = res.data || {};
|
||||||
|
const rawList = Array.isArray(pageData.records) ? pageData.records : [];
|
||||||
|
const list = rawList.map(item => {
|
||||||
|
const productScore = Number(item.productScore) || 0;
|
||||||
|
const serviceScore = Number(item.serviceScore) || 0;
|
||||||
|
let star = productScore || serviceScore || 5;
|
||||||
|
const skuText = '默认';
|
||||||
|
const picturesArr = Array.isArray(item.pics) ? item.pics : [];
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
star,
|
||||||
|
sku: item.travelGroupProductName || skuText,
|
||||||
|
picturesArr
|
||||||
|
};
|
||||||
|
});
|
||||||
|
that.reply.push.apply(that.reply, list);
|
||||||
|
that.loadend = list.length < that.limit || !pageData.pages || that.page >= pageData.pages;
|
||||||
|
that.page = that.page + 1;
|
||||||
|
}).catch(() => {
|
||||||
|
that.loading = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
getReplyList(that.product_id, q).then(res => {
|
||||||
|
that.loading = false;
|
||||||
|
const data = res.data || [];
|
||||||
|
that.reply.push.apply(that.reply, data);
|
||||||
|
that.loadend = data.length < that.limit;
|
||||||
|
that.page = that.page + 1;
|
||||||
|
}).catch(() => {
|
||||||
|
that.loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeType: function(index) {
|
||||||
|
let that = this;
|
||||||
|
that.currentActive = index;
|
||||||
|
that.page = 1;
|
||||||
|
that.loadend = false;
|
||||||
|
that.$set(that, "reply", []);
|
||||||
|
that.getProductReplyList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped lang="less">
|
||||||
|
.noCommodity {
|
||||||
|
height: 8*100rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,7 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="evaluate-con">
|
<view class="evaluate-con">
|
||||||
<view
|
<view
|
||||||
v-if="orderCon.productInfo"
|
v-if="isTravelGroup && travelOrderInfo && travelOrderInfo.travelGroupOrderInfo && travelOrderInfo.travelGroupOrderInfo.travelGroupProduct"
|
||||||
|
class="goodsStyle acea-row row-between"
|
||||||
|
>
|
||||||
|
<view class="pictrue">
|
||||||
|
<image :src="travelOrderInfo.travelGroupOrderInfo.travelGroupProduct.mainImage" class="image"/>
|
||||||
|
</view>
|
||||||
|
<view class="text acea-row row-between">
|
||||||
|
<view class="name line2">{{ travelOrderInfo.travelGroupOrderInfo.travelGroupProduct.name }}</view>
|
||||||
|
<view class="money">
|
||||||
|
<view>¥{{ travelOrderInfo.travelGroupOrderInfo.travelGroupProduct.price }}</view>
|
||||||
|
<view class="num">x1</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
v-else-if="orderCon.productInfo"
|
||||||
class="goodsStyle acea-row row-between"
|
class="goodsStyle acea-row row-between"
|
||||||
>
|
>
|
||||||
<view class="pictrue">
|
<view class="pictrue">
|
||||||
@@ -78,6 +93,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { postOrderComment, postOrderProduct } from '@/api/store'
|
import { postOrderComment, postOrderProduct } from '@/api/store'
|
||||||
|
import { fetchSojoumOrderDetail, sojoumOrderComment } from '@/api/sojoumOrder'
|
||||||
import { trim } from '@/utils'
|
import { trim } from '@/utils'
|
||||||
import { required } from '@/utils/validate'
|
import { required } from '@/utils/validate'
|
||||||
import { validatorDefaultCatch } from '@/utils/dialog'
|
import { validatorDefaultCatch } from '@/utils/dialog'
|
||||||
@@ -104,6 +120,8 @@ export default {
|
|||||||
productInfo: {}
|
productInfo: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
isTravelGroup: false,
|
||||||
|
travelOrderInfo: null,
|
||||||
scoreList: [
|
scoreList: [
|
||||||
{
|
{
|
||||||
name: '商品质量',
|
name: '商品质量',
|
||||||
@@ -125,9 +143,19 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.unique = this.$yroute.query.id
|
this.unique = this.$yroute.query.id
|
||||||
|
this.isTravelGroup = this.$yroute.query.isTravelGroup === '1'
|
||||||
|
if (this.isTravelGroup) {
|
||||||
|
this.getTravelOrderDetail()
|
||||||
|
} else {
|
||||||
this.getOrderProduct()
|
this.getOrderProduct()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getTravelOrderDetail() {
|
||||||
|
fetchSojoumOrderDetail({ key: this.unique }).then(res => {
|
||||||
|
this.travelOrderInfo = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
getOrderProduct() {
|
getOrderProduct() {
|
||||||
postOrderProduct(this.unique).then(res => {
|
postOrderProduct(this.unique).then(res => {
|
||||||
this.orderCon = res.data
|
this.orderCon = res.data
|
||||||
@@ -165,14 +193,26 @@ export default {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
return validatorDefaultCatch(e)
|
return validatorDefaultCatch(e)
|
||||||
}
|
}
|
||||||
postOrderComment({
|
const pics = this.picArr
|
||||||
|
const video = this.videoArr[0] || ''
|
||||||
|
const request = this.isTravelGroup
|
||||||
|
? sojoumOrderComment({
|
||||||
|
orderId: this.unique,
|
||||||
|
comment: expect,
|
||||||
|
pics,
|
||||||
|
video,
|
||||||
|
productScore: product_score,
|
||||||
|
serviceScore: service_score
|
||||||
|
})
|
||||||
|
: postOrderComment({
|
||||||
productScore: product_score,
|
productScore: product_score,
|
||||||
serviceScore: service_score,
|
serviceScore: service_score,
|
||||||
unique: this.unique,
|
unique: this.unique,
|
||||||
pics: this.picArr.join(','),
|
pics: this.picArr.join(','),
|
||||||
comment: expect,
|
comment: expect,
|
||||||
video: this.videoArr.join(',')
|
video: this.videoArr.join(',')
|
||||||
}).then(() => {
|
})
|
||||||
|
request.then(() => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '评价成功',
|
title: '评价成功',
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user