feat: fix

This commit is contained in:
2025-11-30 22:59:30 +08:00
parent 15d5b05587
commit 8396b5b02a
13 changed files with 157 additions and 106 deletions

View File

@@ -163,6 +163,7 @@
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
line-height: 20px; line-height: 20px;
padding-right: 16px;
.atPeople { .atPeople {
color: rgba(255, 255, 255, 0.45); color: rgba(255, 255, 255, 0.45);
@@ -215,7 +216,7 @@
} }
.inputContainer { .inputContainer {
height: 36px; // height: 36px;
padding: 12px 20px; padding: 12px 20px;
display: flex; display: flex;
align-items: center; align-items: center;
@@ -230,7 +231,7 @@
& > .input { & > .input {
width: 100%; width: 100%;
height: 24px; // height: 24px;
} }
} }

View File

@@ -5,7 +5,7 @@ import React, {
useRef, useRef,
useImperativeHandle, useImperativeHandle,
} from "react"; } from "react";
import { View, Text, Image, Input } from "@tarojs/components"; import { View, Text, Image, Input, Textarea } from "@tarojs/components";
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
import dayjs from "dayjs"; import dayjs from "dayjs";
import classnames from "classnames"; import classnames from "classnames";
@@ -118,7 +118,7 @@ const CommentInput = forwardRef<CommentInputRef, CommentInputProps>(function (
zIndex={1002} zIndex={1002}
onClose={onClose} onClose={onClose}
style={{ style={{
height: "60px!important", // height: "60px!important",
minHeight: "unset", minHeight: "unset",
bottom: bottom:
isKeyboardVisible && keyboardHeight > 0 ? `${keyboardHeight}px` : "0", isKeyboardVisible && keyboardHeight > 0 ? `${keyboardHeight}px` : "0",
@@ -127,7 +127,7 @@ const CommentInput = forwardRef<CommentInputRef, CommentInputProps>(function (
> >
<View className={styles.inputContainer}> <View className={styles.inputContainer}>
<View className={styles.inputWrapper}> <View className={styles.inputWrapper}>
<Input <Textarea
adjustPosition={false} adjustPosition={false}
ref={inputDomRef} ref={inputDomRef}
className={styles.input} className={styles.input}
@@ -140,6 +140,8 @@ const CommentInput = forwardRef<CommentInputRef, CommentInputProps>(function (
onConfirm={handleSend} onConfirm={handleSend}
focus focus
maxlength={100} maxlength={100}
autoHeight
showCount
/> />
</View> </View>
<View className={styles.sendIcon} onClick={handleSend}> <View className={styles.sendIcon} onClick={handleSend}>
@@ -318,7 +320,7 @@ export default forwardRef(function Comments(
async function markCommentAsRead() { async function markCommentAsRead() {
if (!message_id) return; if (!message_id) return;
try { try {
await messageService.markAsRead('comment', [message_id]); await messageService.markAsRead("comment", [message_id]);
} catch (e) { } catch (e) {
console.error("标记评论已读失败:", e); console.error("标记评论已读失败:", e);
} }

View File

@@ -63,7 +63,6 @@ function NTRPTestEntryCard(props: {
Taro.redirectTo({ url: "/main_pages/index" }); Taro.redirectTo({ url: "/main_pages/index" });
}, },
onCancel: () => { onCancel: () => {
Taro.navigateBack(); Taro.navigateBack();
}, },
}); });

View File

@@ -60,6 +60,7 @@
&-scroll { &-scroll {
flex: 0 0 auto; flex: 0 0 auto;
width: calc(100% - 116px); width: calc(100% - 116px);
height: 100%;
&-content { &-content {
display: flex; display: flex;

View File

@@ -131,7 +131,7 @@ export default function Participants(props) {
}; };
const matchNtrpReq = matchNtrpRequestment( const matchNtrpReq = matchNtrpRequestment(
ntrp_level, userInfo?.ntrp_level,
skill_level_min, skill_level_min,
skill_level_max skill_level_max
); );
@@ -224,35 +224,17 @@ export default function Participants(props) {
} }
if (waiting_start) { if (waiting_start) {
return { return {
text: () => ( text: "已加入",
<>
<Image className={styles.crrrencySymbol} src={RMB_ICON} />
{displayPrice}
<Text className={styles.btnText}></Text>
</>
),
action: () => toast("您已参与了本次活动"), action: () => toast("您已参与了本次活动"),
}; };
} else if (is_substituting) { } else if (is_substituting) {
return { return {
text: () => ( text: "已加入候补",
<>
<Image className={styles.crrrencySymbol} src={RMB_ICON} />
{displayPrice}
<Text className={styles.btnText}></Text>
</>
),
action: () => toast("您已加入候补,候补失败会全额退款~"), action: () => toast("您已加入候补,候补失败会全额退款~"),
}; };
} else if (can_pay) { } else if (can_pay) {
return { return {
text: () => ( text: "继续支付",
<>
<Image className={styles.crrrencySymbol} src={RMB_ICON} />
{displayPrice}
<Text className={styles.btnText}></Text>
</>
),
action: checkPhoneAndExecute(async () => { action: checkPhoneAndExecute(async () => {
const res = await OrderService.getUnpaidOrder(id); const res = await OrderService.getUnpaidOrder(id);
if (res.code === 0) { if (res.code === 0) {
@@ -264,50 +246,24 @@ export default function Participants(props) {
}; };
} else if (!matchNtrpReq) { } else if (!matchNtrpReq) {
return { return {
text: () => ( text: "立即加入1",
<>
<Image className={styles.crrrencySymbol} src={RMB_ICON} />
{displayPrice}
<Text className={styles.btnText}></Text>
</>
),
available: false, available: false,
action: () => action: () =>
toast("您当前不符合此球局NTRP水平要求去看看其他活动吧"), toast("您当前不符合此球局NTRP水平要求去看看其他活动吧"),
}; };
} else if (can_substitute) { } else if (can_substitute) {
return { return {
text: () => ( text: "我要候补",
<>
<Image className={styles.crrrencySymbol} src={RMB_ICON} />
{displayPrice}
<Text className={styles.btnText}></Text>
</>
),
action: checkPhoneAndExecute(handleJoinGame), action: checkPhoneAndExecute(handleJoinGame),
}; };
} else if (can_join) { } else if (can_join) {
return { return {
text: () => { text: "立即加入2",
return (
<>
<Image className={styles.crrrencySymbol} src={RMB_ICON} />
{displayPrice}
<Text className={styles.btnText}></Text>
</>
);
},
action: checkPhoneAndExecute(handleJoinGame), action: checkPhoneAndExecute(handleJoinGame),
}; };
} else if (can_assess) { } else if (can_assess) {
return { return {
text: () => ( text: "立即加入3",
<>
<Image className={styles.crrrencySymbol} src={RMB_ICON} />
{displayPrice}
<Text className={styles.btnText}></Text>
</>
),
action: checkPhoneAndExecute(handleSelfEvaluate), action: checkPhoneAndExecute(handleSelfEvaluate),
}; };
} }
@@ -349,7 +305,11 @@ export default function Participants(props) {
</View> </View>
)} )}
{/* participants list */} {/* participants list */}
<ScrollView refresherBackground="#FAFAFA" className={styles["participants-list-scroll"]} scrollX> <ScrollView
refresherBackground="#FAFAFA"
className={styles["participants-list-scroll"]}
scrollX
>
<View <View
className={styles["participants-list-scroll-content"]} className={styles["participants-list-scroll-content"]}
style={{ style={{

View File

@@ -13,6 +13,9 @@ import WechatLogo from "@/static/detail/wechat_icon.svg";
import LinkIcon from "@/static/detail/link.svg"; import LinkIcon from "@/static/detail/link.svg";
import CrossIcon from "@/static/detail/cross.svg"; import CrossIcon from "@/static/detail/cross.svg";
import { genNTRPRequirementText, navto } from "@/utils/helper"; import { genNTRPRequirementText, navto } from "@/utils/helper";
import { waitForAuthInit } from "@/utils/authInit";
import { useUserActions } from "@/store/userStore";
import { generatePosterImage, base64ToTempFilePath, delay } from "@/utils";
import { DayOfWeekMap } from "../../config"; import { DayOfWeekMap } from "../../config";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
@@ -22,6 +25,7 @@ dayjs.locale("zh-cn");
export default forwardRef(({ id, from, detail, userInfo }, ref) => { export default forwardRef(({ id, from, detail, userInfo }, ref) => {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [publishFlag, setPublishFlag] = useState(false); const [publishFlag, setPublishFlag] = useState(false);
const { fetchUserInfo } = useUserActions();
// const posterRef = useRef(); // const posterRef = useRef();
const { max_participants, participant_count } = detail || {}; const { max_participants, participant_count } = detail || {};
@@ -92,8 +96,59 @@ export default forwardRef(({ id, from, detail, userInfo }, ref) => {
}; };
}); });
async function handleGenPoster() {
const {
id,
play_type,
skill_level_max,
skill_level_min,
start_time,
end_time,
location_name,
image_list,
title,
} = detail || {};
// 先等待静默登录完成
await waitForAuthInit();
const userInfo = await fetchUserInfo();
const { avatar_url, nickname } = userInfo;
const startTime = dayjs(start_time);
const endTime = dayjs(end_time);
const dayofWeek = DayOfWeekMap.get(startTime.day());
const gameLength = `${endTime.diff(startTime, "hour")}小时`;
Taro.showLoading({ title: "生成中..." });
const qrCodeUrlRes = await DetailService.getQrCodeUrl({
page: "game_pages/detail/index",
scene: `id=${id}`,
});
const qrCodeUrl = await base64ToTempFilePath(
qrCodeUrlRes.data.qr_code_base64
);
await delay(100);
const url = await generatePosterImage({
playType: play_type,
ntrp: `NTRP ${genNTRPRequirementText(skill_level_min, skill_level_max)}`,
mainCoursal:
image_list[0] && image_list[0].startsWith("http")
? image_list[0]
: "https://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/0621b8cf-f7d6-43ad-b852-7dc39f29a782.png",
nickname,
avatarUrl: avatar_url,
title,
locationName: location_name,
date: `${startTime.format("M月D日")} (${dayofWeek})`,
time: `${startTime.format("ah")}${gameLength}`,
qrCodeUrl,
});
Taro.hideLoading();
Taro.showShareImageMenu({
path: url,
});
}
async function handlePost() { async function handlePost() {
navto(`/game_pages/sharePoster/index?id=${detail.id}`); // navto(`/game_pages/sharePoster/index?id=${detail.id}`);
handleGenPoster();
setVisible(false); setVisible(false);
} }

View File

@@ -102,7 +102,7 @@
justify-content: center; justify-content: center;
flex: 1; flex: 1;
font-family: "Quicksand"; font-family: "Quicksand";
font-style: italic; // font-style: italic;
font-size: 20px; font-size: 20px;
border-radius: 16px 0 0 16px; border-radius: 16px 0 0 16px;
border: 2px solid rgba(0, 0, 0, 0.06); border: 2px solid rgba(0, 0, 0, 0.06);
@@ -183,3 +183,9 @@
} }
} }
} }
.rmbSymbol {
font-size: 14px;
font-weight: 600;
line-height: 16px;
}

View File

@@ -37,6 +37,10 @@ function isFull(counts) {
return false; return false;
} }
function RmbIcon() {
return <Text className={styles.rmbSymbol}>¥</Text>;
}
function matchNtrpRequestment( function matchNtrpRequestment(
target?: string, target?: string,
min?: string, min?: string,
@@ -100,24 +104,29 @@ export default function StickyButton(props) {
return () => { return () => {
if (!userInfo?.phone) { if (!userInfo?.phone) {
Taro.showModal({ Taro.showModal({
title: '提示', title: "提示",
content: '该功能需要绑定手机号', content: "该功能需要绑定手机号",
confirmText: '去绑定', confirmText: "去绑定",
cancelText: '取消', cancelText: "取消",
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
const currentPath = Taro.getCurrentInstance().router?.path || ''; const currentPath = Taro.getCurrentInstance().router?.path || "";
const currentParams = Taro.getCurrentInstance().router?.params || {}; const currentParams =
Taro.getCurrentInstance().router?.params || {};
const queryString = Object.keys(currentParams) const queryString = Object.keys(currentParams)
.map(key => `${key}=${currentParams[key]}`) .map((key) => `${key}=${currentParams[key]}`)
.join('&'); .join("&");
const fullPath = queryString ? `${currentPath}?${queryString}` : currentPath; const fullPath = queryString
? `${currentPath}?${queryString}`
: currentPath;
Taro.navigateTo({ Taro.navigateTo({
url: `/login_pages/index/index?redirect=${encodeURIComponent(fullPath)}`, url: `/login_pages/index/index?redirect=${encodeURIComponent(
fullPath
)}`,
}); });
} }
} },
}); });
return; return;
} }
@@ -229,7 +238,8 @@ export default function StickyButton(props) {
return { return {
text: () => ( text: () => (
<> <>
<Image className={styles.crrrencySymbol} src={RMB_ICON} /> {/* <Image className={styles.crrrencySymbol} src={RMB_ICON} /> */}
<RmbIcon />
{displayPrice} {displayPrice}
<Text className={styles.btnText}></Text> <Text className={styles.btnText}></Text>
</> </>
@@ -240,7 +250,7 @@ export default function StickyButton(props) {
return { return {
text: () => ( text: () => (
<> <>
<Image className={styles.crrrencySymbol} src={RMB_ICON} /> <RmbIcon />
{displayPrice} {displayPrice}
<Text className={styles.btnText}></Text> <Text className={styles.btnText}></Text>
</> </>
@@ -251,7 +261,7 @@ export default function StickyButton(props) {
return { return {
text: () => ( text: () => (
<> <>
<Image className={styles.crrrencySymbol} src={RMB_ICON} /> <RmbIcon />
{displayPrice} {displayPrice}
<Text className={styles.btnText}></Text> <Text className={styles.btnText}></Text>
</> </>
@@ -269,7 +279,7 @@ export default function StickyButton(props) {
return { return {
text: () => ( text: () => (
<> <>
<Image className={styles.crrrencySymbol} src={RMB_ICON} /> <RmbIcon />
{displayPrice} {displayPrice}
<Text className={styles.btnText}></Text> <Text className={styles.btnText}></Text>
</> </>
@@ -282,7 +292,7 @@ export default function StickyButton(props) {
return { return {
text: () => ( text: () => (
<> <>
<Image className={styles.crrrencySymbol} src={RMB_ICON} /> <RmbIcon />
{displayPrice} {displayPrice}
<Text className={styles.btnText}></Text> <Text className={styles.btnText}></Text>
</> </>
@@ -294,7 +304,7 @@ export default function StickyButton(props) {
text: () => { text: () => {
return ( return (
<> <>
<Image className={styles.crrrencySymbol} src={RMB_ICON} /> <RmbIcon />
{displayPrice} {displayPrice}
<Text className={styles.btnText}></Text> <Text className={styles.btnText}></Text>
</> </>
@@ -306,7 +316,7 @@ export default function StickyButton(props) {
return { return {
text: () => ( text: () => (
<> <>
<Image className={styles.crrrencySymbol} src={RMB_ICON} /> <RmbIcon />
{displayPrice} {displayPrice}
<Text className={styles.btnText}></Text> <Text className={styles.btnText}></Text>
</> </>

View File

@@ -84,6 +84,8 @@
// margin: -10px; // margin: -10px;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
opacity: 0;
transition: opacity 0.3s ease-in-out;
&::after { &::after {
content: ""; content: "";

View File

@@ -162,8 +162,8 @@ function Index() {
} }
const backgroundImage = detail?.image_list?.[0] const backgroundImage = detail?.image_list?.[0]
? { backgroundImage: `url(${detail?.image_list?.[0]})` } ? { opacity: 1, backgroundImage: `url(${detail?.image_list?.[0]})` }
: {}; : { opacity: 0 };
const [glass, setGlass] = useState(false); const [glass, setGlass] = useState(false);

View File

@@ -115,8 +115,14 @@
box-sizing: border-box; box-sizing: border-box;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
// border-bottom: 1px solid rgba(255, 255, 255, 0.08);
background: #ff3b30; background: #ff3b30;
color: #fff;
font-feature-settings: "liga" off, "clig" off;
font-family: "SF Compact Rounded";
font-style: normal;
font-weight: 600;
line-height: 16px;
letter-spacing: -0.23px;
} }
.day { .day {
@@ -124,13 +130,16 @@
width: 48px; width: 48px;
height: 30px; height: 30px;
color: #000; color: #000;
// padding-bottom: 6px;
box-sizing: border-box; box-sizing: border-box;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
// border: 0.5px solid rgba(255, 255, 255, 0.08); font-feature-settings: "liga" off, "clig" off;
// background: rgba(255, 255, 255, 0.25); font-family: "SF Compact Rounded";
// background-color: #536272; font-size: 22px;
font-style: normal;
font-weight: 500;
line-height: 28px;
letter-spacing: -0.23px;
} }
} }

View File

@@ -18,6 +18,7 @@ import {
getCurrentLocation, getCurrentLocation,
getOrderStatus, getOrderStatus,
generateOrderActions, generateOrderActions,
isPhoneNumber,
} from "@/utils"; } from "@/utils";
import { getStorage, setStorage } from "@/store/storage"; import { getStorage, setStorage } from "@/store/storage";
import { useGlobalStore } from "@/store/global"; import { useGlobalStore } from "@/store/global";
@@ -298,7 +299,7 @@ function GameInfo(props) {
<View className={styles.locationMessageIcon}> <View className={styles.locationMessageIcon}>
<Image <Image
className={styles.locationMessageIconImage} className={styles.locationMessageIconImage}
src="https://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/43aab7e9-061e-4e3b-88c6-61c19b660b22.png" src="https://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/3ee5c89c-fe58-4a56-9471-1295da09c743.png"
/> />
</View> </View>
{/* location message */} {/* location message */}
@@ -426,7 +427,8 @@ function OrderMsg(props) {
{ {
title: "组织人电话", title: "组织人电话",
// content: wechat_contact, // content: wechat_contact,
content: wechat_contact ? ( content:
wechat_contact && isPhoneNumber(wechat_contact) ? (
<Text <Text
selectable={true} // 支持长按复制 selectable={true} // 支持长按复制
style={{ style={{

View File

@@ -118,3 +118,7 @@ export function genNTRPRequirementText(min, max) {
} }
return "-"; return "-";
} }
export function isPhoneNumber(str) {
return /^1[3-9]\d{9}$/.test(str);
}