fix: 问题修复
This commit is contained in:
@@ -204,6 +204,9 @@ export default function GameInfo(props) {
|
||||
// hide business msg
|
||||
showLocation
|
||||
theme="dark"
|
||||
enableScroll={false}
|
||||
enableZoom={false}
|
||||
onTap={openMap}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { View, Text } from "@tarojs/components";
|
||||
import { genNTRPRequirementText } from "../../utils/helper";
|
||||
import { genNTRPRequirementText } from "@/utils/helper";
|
||||
import styles from "./index.module.scss";
|
||||
|
||||
// 玩法要求
|
||||
|
||||
@@ -6,7 +6,7 @@ import { calculateDistance } from "@/utils";
|
||||
import { useUserInfo } from "@/store/userStore";
|
||||
import * as LoginService from "@/services/loginService";
|
||||
import img from "@/config/images";
|
||||
import { navto } from "../../utils/helper";
|
||||
import { navto } from "@/utils/helper";
|
||||
import styles from "./index.module.scss";
|
||||
|
||||
function genRecommendGames(games, location, avatar) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import WechatLogo from "@/static/detail/wechat_icon.svg";
|
||||
// import WechatTimeline from "@/static/detail/wechat_timeline.svg";
|
||||
import LinkIcon from "@/static/detail/link.svg";
|
||||
import CrossIcon from "@/static/detail/cross.svg";
|
||||
import { genNTRPRequirementText, navto } from "../../utils/helper";
|
||||
import { genNTRPRequirementText, navto } from "@/utils/helper";
|
||||
import { DayOfWeekMap } from "../../config";
|
||||
import styles from "./index.module.scss";
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
&.disabled > .sticky-bottom-bar-join-game {
|
||||
background: #b4b4b4;
|
||||
color: rgba(60, 60, 67, 0.6);
|
||||
pointer-events: none;
|
||||
// pointer-events: none;
|
||||
}
|
||||
|
||||
.sticky-bottom-bar-join-game {
|
||||
@@ -147,6 +147,7 @@
|
||||
font-feature-settings: "liga" off, "clig" off;
|
||||
font-family: "DingTalk JinBuTi";
|
||||
// font-style: italic;
|
||||
font-style: normal;
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
|
||||
@@ -9,7 +9,7 @@ import { MATCH_STATUS, IsSubstituteSupported } from "@/services/detailService";
|
||||
import { GameManagePopup, NTRPEvaluatePopup } from "@/components";
|
||||
import img from "@/config/images";
|
||||
import RMB_ICON from "@/static/detail/rmb.svg";
|
||||
import { toast, navto } from "../../utils/helper";
|
||||
import { toast, navto } from "@/utils/helper";
|
||||
import styles from "./index.module.scss";
|
||||
|
||||
function isFull(counts) {
|
||||
@@ -36,6 +36,34 @@ function isFull(counts) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function matchNtrpRequestment(
|
||||
target?: string,
|
||||
min?: string,
|
||||
max?: string
|
||||
): boolean {
|
||||
// 目标值为空或 undefined
|
||||
if (!target?.trim()) return true;
|
||||
|
||||
// 提取目标值中的第一个数字
|
||||
const match = target.match(/-?\d+(\.\d+)?/);
|
||||
if (!match) return true;
|
||||
|
||||
const value = parseFloat(match[0]);
|
||||
const minNum = min !== undefined ? parseFloat(min) : undefined;
|
||||
const maxNum = max !== undefined ? parseFloat(max) : undefined;
|
||||
|
||||
// min 和 max 都未定义 → 直接通过
|
||||
if (minNum === undefined && maxNum === undefined) return true;
|
||||
|
||||
// min = max 或只有一边 undefined → 参考值判断,包含端点
|
||||
if (minNum === undefined || maxNum === undefined || minNum === maxNum) {
|
||||
return value >= (minNum ?? maxNum!);
|
||||
}
|
||||
|
||||
// 正常区间判断,包含端点
|
||||
return value >= minNum && value <= maxNum;
|
||||
}
|
||||
|
||||
// 底部操作栏
|
||||
export default function StickyButton(props) {
|
||||
const {
|
||||
@@ -45,6 +73,7 @@ export default function StickyButton(props) {
|
||||
onStatusChange,
|
||||
handleAddComment,
|
||||
getCommentCount,
|
||||
currentUserInfo,
|
||||
} = props;
|
||||
const [commentCount, setCommentCount] = useState(0);
|
||||
const ntrpRef = useRef<{
|
||||
@@ -58,14 +87,28 @@ export default function StickyButton(props) {
|
||||
start_time,
|
||||
end_time,
|
||||
is_organizer,
|
||||
skill_level_max,
|
||||
skill_level_min,
|
||||
} = detail || {};
|
||||
|
||||
const { ntrp_level } = currentUserInfo || {};
|
||||
|
||||
const matchNtrpReq = matchNtrpRequestment(
|
||||
ntrp_level,
|
||||
skill_level_min,
|
||||
skill_level_max
|
||||
);
|
||||
|
||||
const gameManageRef = useRef();
|
||||
|
||||
function handleSelfEvaluate() {
|
||||
ntrpRef?.current?.show({
|
||||
type: EvaluateScene.detail,
|
||||
next: (flag) => {
|
||||
next: ({ flag, score }) => {
|
||||
if (!matchNtrpRequestment(score, skill_level_min, skill_level_max)) {
|
||||
toast("您当前不符合此球局NTRP水平要求,去看看其他活动吧~");
|
||||
return;
|
||||
}
|
||||
if (flag) {
|
||||
Taro.navigateTo({
|
||||
url: `/order_pages/orderDetail/index?gameId=${id}`,
|
||||
@@ -123,31 +166,31 @@ export default function StickyButton(props) {
|
||||
return {
|
||||
text: "活动已取消",
|
||||
available: false,
|
||||
// action: () => toast("活动已取消"),
|
||||
action: () => toast("活动已取消,去看看其他活动吧~"),
|
||||
};
|
||||
} else if (MATCH_STATUS.FINISHED === match_status) {
|
||||
return {
|
||||
text: "活动已结束",
|
||||
available: false,
|
||||
// action: () => toast("活动已取消"),
|
||||
action: () => toast("活动已结束,去看看其他活动吧~"),
|
||||
};
|
||||
} else if (dayjs(end_time).isBefore(dayjs())) {
|
||||
return {
|
||||
text: "活动已结束",
|
||||
available: false,
|
||||
// action: () => toast("活动已结束"),
|
||||
action: () => toast("活动已结束,去看看其他活动吧~"),
|
||||
};
|
||||
} else if (dayjs(start_time).isBefore(dayjs())) {
|
||||
return {
|
||||
text: "活动已开始",
|
||||
available: false,
|
||||
// action: () => toast("活动已开始"),
|
||||
action: () => toast("活动已开始,去看看其他活动吧~"),
|
||||
};
|
||||
} else if (isFull(detail)) {
|
||||
return {
|
||||
text: "活动已满员",
|
||||
available: false,
|
||||
// action: () => toast("活动已满员"),
|
||||
action: () => toast("活动已满员,去看看其他活动吧~"),
|
||||
};
|
||||
}
|
||||
if (waiting_start) {
|
||||
@@ -159,7 +202,7 @@ export default function StickyButton(props) {
|
||||
<Text className={styles.btnText}>已加入</Text>
|
||||
</>
|
||||
),
|
||||
action: () => toast("已加入"),
|
||||
action: () => toast("您已参与了本次活动"),
|
||||
};
|
||||
} else if (is_substituting) {
|
||||
return {
|
||||
@@ -170,7 +213,7 @@ export default function StickyButton(props) {
|
||||
<Text className={styles.btnText}>已加入候补</Text>
|
||||
</>
|
||||
),
|
||||
action: () => toast("已加入候补"),
|
||||
action: () => toast("您已加入候补,候补失败会全额退款~"),
|
||||
};
|
||||
} else if (can_pay) {
|
||||
return {
|
||||
@@ -190,6 +233,19 @@ export default function StickyButton(props) {
|
||||
}
|
||||
},
|
||||
};
|
||||
} else if (!matchNtrpReq) {
|
||||
return {
|
||||
text: () => (
|
||||
<>
|
||||
<Image className={styles.crrrencySymbol} src={RMB_ICON} />
|
||||
{displayPrice}
|
||||
<Text className={styles.btnText}>立即加入</Text>
|
||||
</>
|
||||
),
|
||||
available: false,
|
||||
action: () =>
|
||||
toast("您当前不符合此球局NTRP水平要求,去看看其他活动吧~"),
|
||||
};
|
||||
} else if (can_substitute) {
|
||||
return {
|
||||
text: () => (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Text, View } from "@tarojs/components";
|
||||
import styles from "./index.module.scss";
|
||||
import { insertDotInTags } from "../../utils/helper";
|
||||
import { insertDotInTags } from "@/utils/helper";
|
||||
|
||||
export default function SupplementalNotes(props) {
|
||||
const {
|
||||
|
||||
@@ -4,7 +4,7 @@ import Taro from "@tarojs/taro";
|
||||
import { CommonPopup } from "@/components";
|
||||
import img from "@/config/images";
|
||||
import styles from "./index.module.scss";
|
||||
import { insertDotInTags } from "../../utils/helper";
|
||||
import { insertDotInTags } from "@/utils/helper";
|
||||
|
||||
// 场馆信息
|
||||
export default function VenueInfo(props) {
|
||||
|
||||
Reference in New Issue
Block a user