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 {
padding: 12px 20px;
// padding: 12px 20px;
padding: 12px 0;
& > .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 {
@@ -56,6 +65,7 @@
justify-content: space-between;
gap: 8px;
position: relative;
width: 100%;
&.blink::after {
content: "";

View File

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

View File

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

View File

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

View File

@@ -43,16 +43,14 @@ function Index() {
useEffect(() => {
updateLocation();
fetchUserInfo();
if (from === "publish") {
handleShare(true);
}
}, []);
useDidShow(async () => {
useDidShow(() => {
// await updateLocation();
// await fetchUserInfo();
if (id) {
await fetchDetail();
Taro.showLoading();
fetchDetail();
}
});
@@ -70,6 +68,9 @@ function Index() {
// 位置更新后,重新获取详情页数据(因为距离等信息可能发生变化)
await fetchDetail();
if (from === "publish") {
handleShare(true);
}
} catch (error) {
console.error("用户位置更新失败", error);
}
@@ -88,6 +89,7 @@ function Index() {
handleBack();
}
}
Taro.hideLoading();
};
const onUpdateUserInfo = () => {
@@ -135,7 +137,11 @@ function Index() {
}
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]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -54,7 +54,7 @@ export interface ToggleLikeType {
class CommentService {
// 查询评论列表
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",
{ id },
{
showLoading: true,
showLoading: false,
},
);
}

View File

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