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

View File

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

View File

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

View File

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

View File

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

View File

@@ -13,6 +13,9 @@ import WechatLogo from "@/static/detail/wechat_icon.svg";
import LinkIcon from "@/static/detail/link.svg";
import CrossIcon from "@/static/detail/cross.svg";
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 styles from "./index.module.scss";
@@ -22,6 +25,7 @@ dayjs.locale("zh-cn");
export default forwardRef(({ id, from, detail, userInfo }, ref) => {
const [visible, setVisible] = useState(false);
const [publishFlag, setPublishFlag] = useState(false);
const { fetchUserInfo } = useUserActions();
// const posterRef = useRef();
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() {
navto(`/game_pages/sharePoster/index?id=${detail.id}`);
// navto(`/game_pages/sharePoster/index?id=${detail.id}`);
handleGenPoster();
setVisible(false);
}

View File

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

View File

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

View File

@@ -162,8 +162,8 @@ function Index() {
}
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);

View File

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

View File

@@ -18,6 +18,7 @@ import {
getCurrentLocation,
getOrderStatus,
generateOrderActions,
isPhoneNumber,
} from "@/utils";
import { getStorage, setStorage } from "@/store/storage";
import { useGlobalStore } from "@/store/global";
@@ -298,7 +299,7 @@ function GameInfo(props) {
<View className={styles.locationMessageIcon}>
<Image
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>
{/* location message */}
@@ -426,23 +427,24 @@ function OrderMsg(props) {
{
title: "组织人电话",
// content: wechat_contact,
content: wechat_contact ? (
<Text
selectable={true} // 支持长按复制
style={{
color: "#007AFF",
// textDecoration: "underline",
cursor: "pointer",
}}
onClick={() => {
Taro.makePhoneCall({ phoneNumber: wechat_contact });
}}
>
{wechat_contact}
</Text>
) : (
"-"
),
content:
wechat_contact && isPhoneNumber(wechat_contact) ? (
<Text
selectable={true} // 支持长按复制
style={{
color: "#007AFF",
// textDecoration: "underline",
cursor: "pointer",
}}
onClick={() => {
Taro.makePhoneCall({ phoneNumber: wechat_contact });
}}
>
{wechat_contact}
</Text>
) : (
"-"
),
},
{
title: "费用",

View File

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