feat: 功能完善: 订单模块的button切边、评论自动跳转、详情页进入个人页前置判断、详情分享卡片取值问题以及部分样式问题

This commit is contained in:
2025-10-18 11:23:20 +08:00
parent 9ef35267cf
commit 2ba4586804
13 changed files with 131 additions and 42 deletions

View File

@@ -44,10 +44,19 @@
} }
} }
.list { .list {
padding: 12px 20px; // padding: 12px 20px;
padding: 12px 0;
& > .commentItem { & > .commentItem {
padding-bottom: 12px; // padding-bottom: 12px;
padding: 0 0 12px 20px;
box-sizing: border-box;
&.weight_super.blink::after {
padding: 0;
top: -5px;
left: 0;
border-radius: initial;
}
} }
.commentItem { .commentItem {
@@ -56,6 +65,7 @@
justify-content: space-between; justify-content: space-between;
gap: 8px; gap: 8px;
position: relative; position: relative;
width: 100%;
&.blink::after { &.blink::after {
content: ""; content: "";

View File

@@ -187,7 +187,8 @@ function CommentItem(props: {
<View <View
className={classnames( className={classnames(
styles.commentItem, styles.commentItem,
blink_id === comment.id && styles.blink blink_id === comment.id && styles.blink,
styles.weight_super
)} )}
key={comment.id} key={comment.id}
id={`comment_id_${comment.id}`} id={`comment_id_${comment.id}`}
@@ -344,7 +345,7 @@ export default forwardRef(function Comments(
setBlinkId(res.data.id); setBlinkId(res.data.id);
setTimeout(() => { setTimeout(() => {
setBlinkId(undefined); setBlinkId(undefined);
}, 3300); }, 4300);
}); });
} }
} }

View File

@@ -182,8 +182,8 @@
} }
.location-map { .location-map {
width: 100%; // width: 100%;
padding: 20px 20px 0; margin: 20px 20px 0;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;

View File

@@ -65,7 +65,7 @@ export default forwardRef(({ id, from, detail, userInfo }, ref) => {
start_time, start_time,
end_time, end_time,
location_name, location_name,
venue_image_list, image_list,
} = detail || {}; } = detail || {};
const startTime = dayjs(start_time); const startTime = dayjs(start_time);
const endTime = dayjs(end_time); const endTime = dayjs(end_time);
@@ -82,7 +82,7 @@ export default forwardRef(({ id, from, detail, userInfo }, ref) => {
gameDate: `${startTime.format("M月D日")} (${dayofWeek})`, gameDate: `${startTime.format("M月D日")} (${dayofWeek})`,
gameTime: `${startTime.format("ah")}${gameLength}`, gameTime: `${startTime.format("ah")}${gameLength}`,
venueName: location_name, venueName: location_name,
venueImages: venue_image_list ? venue_image_list.map((c) => c.url) : [], venueImages: image_list ? image_list : [],
}); });
// console.log(res, "res"); // console.log(res, "res");
return { return {

View File

@@ -43,16 +43,14 @@ function Index() {
useEffect(() => { useEffect(() => {
updateLocation(); updateLocation();
fetchUserInfo(); fetchUserInfo();
if (from === "publish") {
handleShare(true);
}
}, []); }, []);
useDidShow(async () => { useDidShow(() => {
// await updateLocation(); // await updateLocation();
// await fetchUserInfo(); // await fetchUserInfo();
if (id) { if (id) {
await fetchDetail(); Taro.showLoading();
fetchDetail();
} }
}); });
@@ -70,6 +68,9 @@ function Index() {
// 位置更新后,重新获取详情页数据(因为距离等信息可能发生变化) // 位置更新后,重新获取详情页数据(因为距离等信息可能发生变化)
await fetchDetail(); await fetchDetail();
if (from === "publish") {
handleShare(true);
}
} catch (error) { } catch (error) {
console.error("用户位置更新失败", error); console.error("用户位置更新失败", error);
} }
@@ -88,6 +89,7 @@ function Index() {
handleBack(); handleBack();
} }
} }
Taro.hideLoading();
}; };
const onUpdateUserInfo = () => { const onUpdateUserInfo = () => {
@@ -135,7 +137,11 @@ function Index() {
} }
function handleViewUserInfo(userId) { function handleViewUserInfo(userId) {
navto(`/user_pages/other/index?userid=${userId}`); navto(
isMyOwn
? "/user_pages/myself/index"
: `/user_pages/other/index?userid=${userId}`
);
} }
const backgroundImage = detail?.image_list?.[0] const backgroundImage = detail?.image_list?.[0]

View File

@@ -274,18 +274,39 @@
margin: 12px 0; margin: 12px 0;
padding: 4px 10px; padding: 4px 10px;
height: 28px; height: 28px;
box-sizing: border-box;
border-radius: 999px; border-radius: 999px;
border: 0.5px solid rgba(0, 0, 0, 0.06); border: 0.5px solid rgba(0, 0, 0, 0.06);
position: relative;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
& > .buttonText {
color: #000; color: #000;
font-feature-settings: "liga" off, "clig" off;
font-family: "PingFang SC";
font-size: 12px; font-size: 12px;
font-style: normal; font-style: normal;
font-weight: 600; font-weight: 600;
line-height: 20px;
letter-spacing: -0.23px; letter-spacing: -0.23px;
}
& > .transparentButton {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
opacity: 0;
}
&:first-child { &:first-child {
background: #000; background: #000;
& > .buttonText {
color: #fff; color: #fff;
}
&.payNow { &.payNow {
background-color: #ff3b30; background-color: #ff3b30;
} }
@@ -514,6 +535,8 @@
text-align: center; text-align: center;
// border: 0.5px solid rgba(0, 0, 0, 0.06); // border: 0.5px solid rgba(0, 0, 0, 0.06);
color: #000; color: #000;
font-feature-settings: "liga" off, "clig" off;
font-family: "PingFang SC";
font-size: 16px; font-size: 16px;
font-style: normal; font-style: normal;
font-weight: 600; font-weight: 600;

View File

@@ -329,12 +329,17 @@ function GameInfo(props) {
}, },
"detail" "detail"
)?.map((obj) => ( )?.map((obj) => (
<Button <View
className={classnames(styles.button, styles[obj.className])} className={classnames(styles.button, styles[obj.className])}
>
<Text className={styles.buttonText}>{obj.text}</Text>
<Button
className={styles.transparentButton}
onClick={obj.action} onClick={obj.action}
> >
{obj.text} {obj.text}
</Button> </Button>
</View>
))} ))}
<View className={styles.customer} onClick={handleCustomerService}> <View className={styles.customer} onClick={handleCustomerService}>
<Image className={styles.customerIcon} src={CustomerIcon} /> <Image className={styles.customerIcon} src={CustomerIcon} />

View File

@@ -1,4 +1,5 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: '订单列表', navigationBarTitleText: '订单列表',
navigationStyle: 'custom',
navigationBarBackgroundColor: '#FAFAFA' navigationBarBackgroundColor: '#FAFAFA'
}) })

View File

@@ -1,7 +1,16 @@
@use "~@/scss/images.scss" as img; @use "~@/scss/images.scss" as img;
.navbar {
box-shadow: none;
& > view > view:nth-child(2) {
justify-content: flex-start;
margin-left: -30px;
}
}
.container { .container {
padding: 12px 12px 40px; padding: 100px 12px 40px;
background-color: #fafafa; background-color: #fafafa;
height: 100vh; height: 100vh;
width: 100%; width: 100%;
@@ -298,18 +307,39 @@
& > .button { & > .button {
padding: 4px 10px; padding: 4px 10px;
height: 28px; height: 28px;
box-sizing: border-box;
border-radius: 999px; border-radius: 999px;
border: 0.5px solid rgba(0, 0, 0, 0.06); border: 0.5px solid rgba(0, 0, 0, 0.06);
position: relative;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
& > .buttonText {
color: #000; color: #000;
font-feature-settings: "liga" off, "clig" off;
font-family: "PingFang SC";
font-size: 12px; font-size: 12px;
font-style: normal; font-style: normal;
font-weight: 600; font-weight: 600;
line-height: 20px;
letter-spacing: -0.23px; letter-spacing: -0.23px;
}
& > .transparentButton {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
opacity: 0;
}
&:last-child { &:last-child {
background: #000; background: #000;
& > .buttonText {
color: #fff; color: #fff;
}
&.payNow { &.payNow {
background-color: #ff3b30; background-color: #ff3b30;
} }
@@ -352,10 +382,12 @@
text-align: center; text-align: center;
// border: 0.5px solid rgba(0, 0, 0, 0.06); // border: 0.5px solid rgba(0, 0, 0, 0.06);
color: #000; color: #000;
font-feature-settings: "liga" off, "clig" off;
font-family: "PingFang SC";
font-size: 16px; font-size: 16px;
font-style: normal; font-style: normal;
font-weight: 600; font-weight: 600;
line-height: 20px; line-height: normal;
&:last-child { &:last-child {
background: #000; background: #000;

View File

@@ -12,7 +12,7 @@ import orderService, {
} from "@/services/orderService"; } from "@/services/orderService";
import { getStorage, removeStorage, setStorage } from "@/store/storage"; import { getStorage, removeStorage, setStorage } from "@/store/storage";
import { handleCustomerService } from "@/services/userService"; import { handleCustomerService } from "@/services/userService";
import { withAuth, RefundPopup } from "@/components"; import { withAuth, RefundPopup, GeneralNavbar } from "@/components";
import { payOrder, generateOrderActions } from "@/utils"; import { payOrder, generateOrderActions } from "@/utils";
import emptyContent from "@/static/emptyStatus/publish-empty.png"; import emptyContent from "@/static/emptyStatus/publish-empty.png";
import CustomerIcon from "@/static/order/customer.svg"; import CustomerIcon from "@/static/order/customer.svg";
@@ -258,6 +258,12 @@ const OrderList = () => {
return ( return (
<View className={styles.container}> <View className={styles.container}>
<GeneralNavbar
title="订单列表"
backgroundColor="transparent"
titleClassName={styles.titleClassName}
className={styles.navbar}
/>
<ScrollView <ScrollView
scrollY scrollY
scrollWithAnimation scrollWithAnimation
@@ -379,15 +385,20 @@ const OrderList = () => {
}, },
"list" "list"
)?.map((obj) => ( )?.map((obj) => (
<Button <View
className={classnames( className={classnames(
styles.button, styles.button,
styles[obj.className] styles[obj.className]
)} )}
>
<Text className={styles.buttonText}>{obj.text}</Text>
<Button
className={styles.transparentButton}
onClick={obj.action} onClick={obj.action}
> >
{obj.text} {obj.text}
</Button> </Button>
</View>
))} ))}
</View> </View>
</View> </View>

View File

@@ -54,7 +54,7 @@ export interface ToggleLikeType {
class CommentService { class CommentService {
// 查询评论列表 // 查询评论列表
async getComments(req: { game_id: number, page: number, pageSize: number }): Promise<ApiResponse<CommentResponse>> { async getComments(req: { game_id: number, page: number, pageSize: number }): Promise<ApiResponse<CommentResponse>> {
return httpService.post("/comments/list", req, { showLoading: true }); return httpService.post("/comments/list", req, { showLoading: false });
} }
// 发表评论 // 发表评论

View File

@@ -106,7 +106,7 @@ class GameDetailService {
"/games/detail", "/games/detail",
{ id }, { id },
{ {
showLoading: true, showLoading: false,
}, },
); );
} }

View File

@@ -112,7 +112,7 @@ class EvaluateService {
// 获取最后一次(最新)测试结果 // 获取最后一次(最新)测试结果
async getLastResult(): Promise<ApiResponse<LastTimeTestResult>> { async getLastResult(): Promise<ApiResponse<LastTimeTestResult>> {
return httpService.post("/ntrp/last_result", {}, { showLoading: true }); return httpService.post("/ntrp/last_result", {}, { showLoading: false });
} }
// 更新NTRP等级 // 更新NTRP等级