diff --git a/src/components/Comments/index.module.scss b/src/components/Comments/index.module.scss index 5d028af..fc249e5 100644 --- a/src/components/Comments/index.module.scss +++ b/src/components/Comments/index.module.scss @@ -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; } } diff --git a/src/components/Comments/index.tsx b/src/components/Comments/index.tsx index df8d435..d471436 100644 --- a/src/components/Comments/index.tsx +++ b/src/components/Comments/index.tsx @@ -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(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(function ( > - (function ( onConfirm={handleSend} focus maxlength={100} + autoHeight + showCount /> @@ -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); } diff --git a/src/components/NTRPTestEntryCard/index.tsx b/src/components/NTRPTestEntryCard/index.tsx index 8127d75..1312fc7 100644 --- a/src/components/NTRPTestEntryCard/index.tsx +++ b/src/components/NTRPTestEntryCard/index.tsx @@ -63,7 +63,6 @@ function NTRPTestEntryCard(props: { Taro.redirectTo({ url: "/main_pages/index" }); }, onCancel: () => { - Taro.navigateBack(); }, }); diff --git a/src/game_pages/detail/components/Participants/index.module.scss b/src/game_pages/detail/components/Participants/index.module.scss index 47be443..4c4a2d1 100644 --- a/src/game_pages/detail/components/Participants/index.module.scss +++ b/src/game_pages/detail/components/Participants/index.module.scss @@ -60,6 +60,7 @@ &-scroll { flex: 0 0 auto; width: calc(100% - 116px); + height: 100%; &-content { display: flex; diff --git a/src/game_pages/detail/components/Participants/index.tsx b/src/game_pages/detail/components/Participants/index.tsx index 80aa2e6..51daca0 100644 --- a/src/game_pages/detail/components/Participants/index.tsx +++ b/src/game_pages/detail/components/Participants/index.tsx @@ -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: () => ( - <> - - {displayPrice} - 已加入 - - ), + text: "已加入", action: () => toast("您已参与了本次活动"), }; } else if (is_substituting) { return { - text: () => ( - <> - - {displayPrice} - 已加入候补 - - ), + text: "已加入候补", action: () => toast("您已加入候补,候补失败会全额退款~"), }; } else if (can_pay) { return { - text: () => ( - <> - - {displayPrice} - 继续支付 - - ), + 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: () => ( - <> - - {displayPrice} - 立即加入 - - ), + text: "立即加入1", available: false, action: () => toast("您当前不符合此球局NTRP水平要求,去看看其他活动吧~"), }; } else if (can_substitute) { return { - text: () => ( - <> - - {displayPrice} - 我要候补 - - ), + text: "我要候补", action: checkPhoneAndExecute(handleJoinGame), }; } else if (can_join) { return { - text: () => { - return ( - <> - - {displayPrice} - 立即加入 - - ); - }, + text: "立即加入2", action: checkPhoneAndExecute(handleJoinGame), }; } else if (can_assess) { return { - text: () => ( - <> - - {displayPrice} - 立即加入 - - ), + text: "立即加入3", action: checkPhoneAndExecute(handleSelfEvaluate), }; } @@ -349,7 +305,11 @@ export default function Participants(props) { )} {/* participants list */} - + { 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); } diff --git a/src/game_pages/detail/components/StickyBottom/index.module.scss b/src/game_pages/detail/components/StickyBottom/index.module.scss index da40881..7797701 100644 --- a/src/game_pages/detail/components/StickyBottom/index.module.scss +++ b/src/game_pages/detail/components/StickyBottom/index.module.scss @@ -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; +} diff --git a/src/game_pages/detail/components/StickyBottom/index.tsx b/src/game_pages/detail/components/StickyBottom/index.tsx index 696eed0..ec5e501 100644 --- a/src/game_pages/detail/components/StickyBottom/index.tsx +++ b/src/game_pages/detail/components/StickyBottom/index.tsx @@ -37,6 +37,10 @@ function isFull(counts) { return false; } +function RmbIcon() { + return ¥; +} + 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: () => ( <> - + {/* */} + {displayPrice} 已加入 @@ -240,7 +250,7 @@ export default function StickyButton(props) { return { text: () => ( <> - + {displayPrice} 已加入候补 @@ -251,7 +261,7 @@ export default function StickyButton(props) { return { text: () => ( <> - + {displayPrice} 继续支付 @@ -269,7 +279,7 @@ export default function StickyButton(props) { return { text: () => ( <> - + {displayPrice} 立即加入 @@ -282,7 +292,7 @@ export default function StickyButton(props) { return { text: () => ( <> - + {displayPrice} 我要候补 @@ -294,7 +304,7 @@ export default function StickyButton(props) { text: () => { return ( <> - + {displayPrice} 立即加入 @@ -306,7 +316,7 @@ export default function StickyButton(props) { return { text: () => ( <> - + {displayPrice} 立即加入 diff --git a/src/game_pages/detail/index.module.scss b/src/game_pages/detail/index.module.scss index f3de38b..af414f8 100644 --- a/src/game_pages/detail/index.module.scss +++ b/src/game_pages/detail/index.module.scss @@ -84,6 +84,8 @@ // margin: -10px; width: 100vw; height: 100vh; + opacity: 0; + transition: opacity 0.3s ease-in-out; &::after { content: ""; diff --git a/src/game_pages/detail/index.tsx b/src/game_pages/detail/index.tsx index fd87db0..7525f48 100644 --- a/src/game_pages/detail/index.tsx +++ b/src/game_pages/detail/index.tsx @@ -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); diff --git a/src/order_pages/orderDetail/index.module.scss b/src/order_pages/orderDetail/index.module.scss index c5e68b7..ae7a412 100644 --- a/src/order_pages/orderDetail/index.module.scss +++ b/src/order_pages/orderDetail/index.module.scss @@ -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; } } diff --git a/src/order_pages/orderDetail/index.tsx b/src/order_pages/orderDetail/index.tsx index 3508f9d..7ee5549 100644 --- a/src/order_pages/orderDetail/index.tsx +++ b/src/order_pages/orderDetail/index.tsx @@ -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) { {/* location message */} @@ -426,23 +427,24 @@ function OrderMsg(props) { { title: "组织人电话", // content: wechat_contact, - content: wechat_contact ? ( - { - Taro.makePhoneCall({ phoneNumber: wechat_contact }); - }} - > - {wechat_contact} - - ) : ( - "-" - ), + content: + wechat_contact && isPhoneNumber(wechat_contact) ? ( + { + Taro.makePhoneCall({ phoneNumber: wechat_contact }); + }} + > + {wechat_contact} + + ) : ( + "-" + ), }, { title: "费用", diff --git a/src/utils/helper.ts b/src/utils/helper.ts index 48d3aa9..205d4f8 100644 --- a/src/utils/helper.ts +++ b/src/utils/helper.ts @@ -117,4 +117,8 @@ export function genNTRPRequirementText(min, max) { return `${formatNtrpDisplay(max)} 以上`; } return "-"; -} \ No newline at end of file +} + +export function isPhoneNumber(str) { + return /^1[3-9]\d{9}$/.test(str); +}