|
@@ -69,8 +69,12 @@ function GoodsInfo({ isOpen, id, closePage }: Props) {
|
|
// 点击点赞
|
|
// 点击点赞
|
|
const likeClickFu = useCallback(async () => {
|
|
const likeClickFu = useCallback(async () => {
|
|
if (right4) return;
|
|
if (right4) return;
|
|
- await A2_APIgoodsaddStar(id);
|
|
|
|
setRight4(true);
|
|
setRight4(true);
|
|
|
|
+ try {
|
|
|
|
+ await A2_APIgoodsaddStar(id);
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error);
|
|
|
|
+ }
|
|
window.setTimeout(() => {
|
|
window.setTimeout(() => {
|
|
setRight4(false);
|
|
setRight4(false);
|
|
}, 3000);
|
|
}, 3000);
|
|
@@ -125,9 +129,7 @@ function GoodsInfo({ isOpen, id, closePage }: Props) {
|
|
const width = barrMoveRef.current?.offsetWidth || 0;
|
|
const width = barrMoveRef.current?.offsetWidth || 0;
|
|
|
|
|
|
if (barrMoveRef.current) {
|
|
if (barrMoveRef.current) {
|
|
- if (barrMoveRef.current) {
|
|
|
|
- barrMoveRef.current.style.right = -width - 200 + "px";
|
|
|
|
- }
|
|
|
|
|
|
+ barrMoveRef.current.style.right = -width - 200 + "px";
|
|
|
|
|
|
const endNum = -window.innerWidth - width - 200;
|
|
const endNum = -window.innerWidth - width - 200;
|
|
barrMoveRefKill.current?.kill();
|
|
barrMoveRefKill.current?.kill();
|
|
@@ -141,7 +143,7 @@ function GoodsInfo({ isOpen, id, closePage }: Props) {
|
|
x: endNum,
|
|
x: endNum,
|
|
repeat: -1,
|
|
repeat: -1,
|
|
});
|
|
});
|
|
- } else {
|
|
|
|
|
|
+ } else if (barrageAll.length > 1) {
|
|
// 有超过 1 的情况
|
|
// 有超过 1 的情况
|
|
barrMoveRefKill.current = gsap.fromTo(
|
|
barrMoveRefKill.current = gsap.fromTo(
|
|
barrMoveRef.current,
|
|
barrMoveRef.current,
|