fix: 修复取消活动后还可以编辑和取消、详情页参与者卡片展示NTRP 等级、生成海报的图片质量降低到1M以下, 详情页海报与测试结果页海报
This commit is contained in:
@@ -22,7 +22,7 @@ export interface EnvConfig {
|
||||
|
||||
const baseConfig = {
|
||||
apiBaseURL: "https://tennis.bimwe.com",
|
||||
ossBaseURL: "https://bimwe-oss.oss-cn-shanghai.aliyuncs.com",
|
||||
ossBaseURL: "https://bimwe.oss-cn-shanghai.aliyuncs.com",
|
||||
appid: "wx815b533167eb7b53", // 测试号
|
||||
timeout: 15000,
|
||||
enableLog: true,
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
align-items: center;
|
||||
color: #000;
|
||||
text-align: center;
|
||||
font-feature-settings: 'liga' off, 'clig' off;
|
||||
font-feature-settings:
|
||||
"liga" off,
|
||||
"clig" off;
|
||||
font-family: "PingFang SC";
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
@@ -32,7 +34,9 @@
|
||||
padding-top: 24px;
|
||||
color: #000;
|
||||
text-align: center;
|
||||
font-feature-settings: 'liga' off, 'clig' off;
|
||||
font-feature-settings:
|
||||
"liga" off,
|
||||
"clig" off;
|
||||
font-family: "PingFang SC";
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
@@ -48,8 +52,10 @@
|
||||
align-items: center;
|
||||
|
||||
.tips {
|
||||
color: rgba(60, 60, 67, 0.60);
|
||||
font-feature-settings: 'liga' off, 'clig' off;
|
||||
color: rgba(60, 60, 67, 0.6);
|
||||
font-feature-settings:
|
||||
"liga" off,
|
||||
"clig" off;
|
||||
font-family: "PingFang SC";
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
@@ -62,13 +68,15 @@
|
||||
margin-top: 8px;
|
||||
padding: 8px;
|
||||
border-radius: 4px;
|
||||
background: #F0F0F0;
|
||||
background: #f0f0f0;
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
&:placeholder-shown {
|
||||
color: rgba(60, 60, 67, 0.30);
|
||||
font-feature-settings: 'liga' off, 'clig' off;
|
||||
color: rgba(60, 60, 67, 0.3);
|
||||
font-feature-settings:
|
||||
"liga" off,
|
||||
"clig" off;
|
||||
font-family: "PingFang SC";
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
@@ -84,11 +92,12 @@
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 44px;
|
||||
border-top: 0.5px solid #CECECE;
|
||||
background: #FFF;
|
||||
border-top: 0.5px solid #cecece;
|
||||
background: #fff;
|
||||
margin-top: 2px;
|
||||
|
||||
.confirm, .cancel {
|
||||
.confirm,
|
||||
.cancel {
|
||||
width: 50%;
|
||||
height: 44px;
|
||||
display: flex;
|
||||
@@ -96,7 +105,9 @@
|
||||
align-items: center;
|
||||
color: #000;
|
||||
text-align: center;
|
||||
font-feature-settings: 'liga' off, 'clig' off;
|
||||
font-feature-settings:
|
||||
"liga" off,
|
||||
"clig" off;
|
||||
font-family: "PingFang SC";
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
@@ -109,4 +120,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ export default forwardRef(function GameManagePopup(props, ref) {
|
||||
.some((item) => item.user.id === userInfo.id);
|
||||
|
||||
const finished = [MATCH_STATUS.FINISHED, MATCH_STATUS.CANCELED].includes(
|
||||
detail.match_status
|
||||
detail.match_status,
|
||||
);
|
||||
|
||||
const inTwoHours = dayjs(detail.start_time).diff(dayjs(), "hour") < 2;
|
||||
@@ -207,7 +207,7 @@ export default forwardRef(function GameManagePopup(props, ref) {
|
||||
style={{ minHeight: "unset" }}
|
||||
>
|
||||
<View className={styles.container}>
|
||||
{!inTwoHours && !hasOtherParticiappants && (
|
||||
{!finished && !inTwoHours && !hasOtherParticiappants && (
|
||||
<View className={styles.button} onClick={handleEditGame}>
|
||||
编辑活动
|
||||
</View>
|
||||
@@ -217,12 +217,12 @@ export default forwardRef(function GameManagePopup(props, ref) {
|
||||
重新发布
|
||||
</View>
|
||||
)}
|
||||
{!inTwoHours && !hasOtherParticiappants && (
|
||||
{!finished && !inTwoHours && !hasOtherParticiappants && (
|
||||
<View className={styles.button} onClick={handleCancelGame}>
|
||||
取消活动
|
||||
</View>
|
||||
)}
|
||||
{hasJoin && (
|
||||
{!finished && hasJoin && (
|
||||
<View className={styles.button} onClick={handleQuitGame}>
|
||||
退出活动
|
||||
</View>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -40,7 +40,7 @@ function isFull(counts) {
|
||||
function matchNtrpRequestment(
|
||||
target?: string,
|
||||
min?: string,
|
||||
max?: string
|
||||
max?: string,
|
||||
): boolean {
|
||||
// 目标值为空或 undefined
|
||||
if (!target?.trim()) return true;
|
||||
@@ -110,7 +110,7 @@ export default function Participants(props) {
|
||||
user_action_status;
|
||||
const showApplicationEntry =
|
||||
[can_pay, can_substitute, is_substituting, waiting_start].every(
|
||||
(item) => !item
|
||||
(item) => !item,
|
||||
) &&
|
||||
can_join &&
|
||||
dayjs(start_time).isAfter(dayjs());
|
||||
@@ -138,7 +138,7 @@ export default function Participants(props) {
|
||||
|
||||
Taro.navigateTo({
|
||||
url: `/login_pages/index/index?redirect=${encodeURIComponent(
|
||||
fullPath
|
||||
fullPath,
|
||||
)}`,
|
||||
});
|
||||
}
|
||||
@@ -153,7 +153,7 @@ export default function Participants(props) {
|
||||
const matchNtrpReq = matchNtrpRequestment(
|
||||
userInfo?.ntrp_level,
|
||||
skill_level_min,
|
||||
skill_level_max
|
||||
skill_level_max,
|
||||
);
|
||||
|
||||
function handleSelfEvaluate() {
|
||||
@@ -180,7 +180,7 @@ export default function Participants(props) {
|
||||
}
|
||||
|
||||
function generateTextAndAction(
|
||||
user_action_status: null | { [key: string]: boolean }
|
||||
user_action_status: null | { [key: string]: boolean },
|
||||
):
|
||||
| undefined
|
||||
| { text: string | React.FC; action?: () => void; available?: boolean } {
|
||||
@@ -259,7 +259,7 @@ export default function Participants(props) {
|
||||
const res = await OrderService.getUnpaidOrder(id);
|
||||
if (res.code === 0) {
|
||||
navto(
|
||||
`/order_pages/orderDetail/index?id=${res.data.order_info.order_id}`
|
||||
`/order_pages/orderDetail/index?id=${res.data.order_info.order_id}`,
|
||||
);
|
||||
}
|
||||
}),
|
||||
@@ -296,10 +296,11 @@ export default function Participants(props) {
|
||||
const { action = () => {} } = generateTextAndAction(user_action_status)!;
|
||||
|
||||
const leftCount = max_participants - participant_count;
|
||||
const leftSubstituteCount = (max_substitute_players || 0) - (substitute_count || 0);
|
||||
const leftSubstituteCount =
|
||||
(max_substitute_players || 0) - (substitute_count || 0);
|
||||
const showSubstituteApplicationEntry =
|
||||
[can_pay, can_join, is_substituting, waiting_start].every(
|
||||
(item) => !item
|
||||
(item) => !item,
|
||||
) &&
|
||||
can_substitute &&
|
||||
dayjs(start_time).isAfter(dayjs());
|
||||
@@ -336,7 +337,7 @@ export default function Participants(props) {
|
||||
refresherBackground="#FAFAFA"
|
||||
className={classnames(
|
||||
styles["participants-list-scroll"],
|
||||
showApplicationEntry ? styles.withApplication : ""
|
||||
showApplicationEntry ? styles.withApplication : "",
|
||||
)}
|
||||
scrollX
|
||||
>
|
||||
@@ -377,14 +378,14 @@ export default function Participants(props) {
|
||||
src={avatar_url}
|
||||
onClick={handleViewUserInfo.bind(
|
||||
null,
|
||||
participant_user_id
|
||||
participant_user_id,
|
||||
)}
|
||||
/>
|
||||
<Text className={styles["participants-list-item-name"]}>
|
||||
{nickname || "未知"}
|
||||
</Text>
|
||||
<Text className={styles["participants-list-item-level"]}>
|
||||
{displayNtrp}
|
||||
NTRP {displayNtrp}
|
||||
</Text>
|
||||
<Text className={styles["participants-list-item-role"]}>
|
||||
{role}
|
||||
@@ -400,97 +401,107 @@ export default function Participants(props) {
|
||||
)}
|
||||
</View>
|
||||
{/* 候补区域 */}
|
||||
{max_substitute_players > 0 && (substitute_count > 0 || showSubstituteApplicationEntry) && (
|
||||
<View className={styles["detail-page-content-participants"]}>
|
||||
<View className={styles["participants-title"]}>
|
||||
<Text>候补</Text>
|
||||
<Text>·</Text>
|
||||
<Text>{leftSubstituteCount > 0 ? `剩余空位 ${leftSubstituteCount}` : "已满员"}</Text>
|
||||
</View>
|
||||
<View className={styles["participants-list"]}>
|
||||
{/* 候补申请入口 */}
|
||||
{showSubstituteApplicationEntry && (
|
||||
<View
|
||||
className={styles["participants-list-application"]}
|
||||
onClick={() => {
|
||||
action?.();
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
className={styles["participants-list-application-icon"]}
|
||||
src={img.ICON_DETAIL_APPLICATION_ADD}
|
||||
/>
|
||||
<Text className={styles["participants-list-application-text"]}>
|
||||
申请候补
|
||||
</Text>
|
||||
</View>
|
||||
)}
|
||||
{/* 候补成员列表 */}
|
||||
<ScrollView
|
||||
refresherBackground="#FAFAFA"
|
||||
className={classnames(
|
||||
styles["participants-list-scroll"],
|
||||
showSubstituteApplicationEntry ? styles.withApplication : ""
|
||||
{max_substitute_players > 0 &&
|
||||
(substitute_count > 0 || showSubstituteApplicationEntry) && (
|
||||
<View className={styles["detail-page-content-participants"]}>
|
||||
<View className={styles["participants-title"]}>
|
||||
<Text>候补</Text>
|
||||
<Text>·</Text>
|
||||
<Text>
|
||||
{leftSubstituteCount > 0
|
||||
? `剩余空位 ${leftSubstituteCount}`
|
||||
: "已满员"}
|
||||
</Text>
|
||||
</View>
|
||||
<View className={styles["participants-list"]}>
|
||||
{/* 候补申请入口 */}
|
||||
{showSubstituteApplicationEntry && (
|
||||
<View
|
||||
className={styles["participants-list-application"]}
|
||||
onClick={() => {
|
||||
action?.();
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
className={styles["participants-list-application-icon"]}
|
||||
src={img.ICON_DETAIL_APPLICATION_ADD}
|
||||
/>
|
||||
<Text
|
||||
className={styles["participants-list-application-text"]}
|
||||
>
|
||||
申请候补
|
||||
</Text>
|
||||
</View>
|
||||
)}
|
||||
scrollX
|
||||
>
|
||||
<View
|
||||
className={styles["participants-list-scroll-content"]}
|
||||
style={{
|
||||
width: `${
|
||||
Math.max(substitute_members.length, 1) * 103 + (Math.max(substitute_members.length, 1) - 1) * 8
|
||||
}px`,
|
||||
}}
|
||||
{/* 候补成员列表 */}
|
||||
<ScrollView
|
||||
refresherBackground="#FAFAFA"
|
||||
className={classnames(
|
||||
styles["participants-list-scroll"],
|
||||
showSubstituteApplicationEntry ? styles.withApplication : "",
|
||||
)}
|
||||
scrollX
|
||||
>
|
||||
{substitute_members.map((substitute) => {
|
||||
const {
|
||||
is_organizer,
|
||||
user: {
|
||||
avatar_url,
|
||||
nickname,
|
||||
level,
|
||||
ntrp_level,
|
||||
id: substitute_user_id,
|
||||
},
|
||||
} = substitute;
|
||||
const role = is_organizer ? "组织者" : "参与者";
|
||||
// 优先使用 ntrp_level,如果没有则使用 level
|
||||
const ntrpValue = ntrp_level || level;
|
||||
// 格式化显示 NTRP,如果没有值则显示"初学者"
|
||||
const displayNtrp = ntrpValue
|
||||
? formatNtrpDisplay(ntrpValue)
|
||||
: "初学者";
|
||||
return (
|
||||
<View
|
||||
key={substitute.id}
|
||||
className={styles["participants-list-item"]}
|
||||
>
|
||||
<Image
|
||||
className={styles["participants-list-item-avatar"]}
|
||||
mode="aspectFill"
|
||||
src={avatar_url}
|
||||
onClick={handleViewUserInfo.bind(
|
||||
null,
|
||||
substitute_user_id
|
||||
)}
|
||||
/>
|
||||
<Text className={styles["participants-list-item-name"]}>
|
||||
{nickname || "未知"}
|
||||
</Text>
|
||||
<Text className={styles["participants-list-item-level"]}>
|
||||
{displayNtrp}
|
||||
</Text>
|
||||
<Text className={styles["participants-list-item-role"]}>
|
||||
{role}
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
</ScrollView>
|
||||
<View
|
||||
className={styles["participants-list-scroll-content"]}
|
||||
style={{
|
||||
width: `${
|
||||
Math.max(substitute_members.length, 1) * 103 +
|
||||
(Math.max(substitute_members.length, 1) - 1) * 8
|
||||
}px`,
|
||||
}}
|
||||
>
|
||||
{substitute_members.map((substitute) => {
|
||||
const {
|
||||
is_organizer,
|
||||
user: {
|
||||
avatar_url,
|
||||
nickname,
|
||||
level,
|
||||
ntrp_level,
|
||||
id: substitute_user_id,
|
||||
},
|
||||
} = substitute;
|
||||
const role = is_organizer ? "组织者" : "参与者";
|
||||
// 优先使用 ntrp_level,如果没有则使用 level
|
||||
const ntrpValue = ntrp_level || level;
|
||||
// 格式化显示 NTRP,如果没有值则显示"初学者"
|
||||
const displayNtrp = ntrpValue
|
||||
? formatNtrpDisplay(ntrpValue)
|
||||
: "初学者";
|
||||
return (
|
||||
<View
|
||||
key={substitute.id}
|
||||
className={styles["participants-list-item"]}
|
||||
>
|
||||
<Image
|
||||
className={styles["participants-list-item-avatar"]}
|
||||
mode="aspectFill"
|
||||
src={avatar_url}
|
||||
onClick={handleViewUserInfo.bind(
|
||||
null,
|
||||
substitute_user_id,
|
||||
)}
|
||||
/>
|
||||
<Text className={styles["participants-list-item-name"]}>
|
||||
{nickname || "未知"}
|
||||
</Text>
|
||||
<Text
|
||||
className={styles["participants-list-item-level"]}
|
||||
>
|
||||
{displayNtrp}
|
||||
</Text>
|
||||
<Text className={styles["participants-list-item-role"]}>
|
||||
{role}
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
</ScrollView>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
)}
|
||||
)}
|
||||
<NTRPEvaluatePopup type={EvaluateScene.detail} ref={ntrpRef} showGuide />
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -16,7 +16,7 @@ import { useGlobalState } from "@/store/global";
|
||||
import { delay, getCurrentFullPath } from "@/utils";
|
||||
import { formatNtrpDisplay } from "@/utils/helper";
|
||||
import { waitForAuthInit } from "@/utils/authInit";
|
||||
import httpService from "@/services/httpService";
|
||||
// import httpService from "@/services/httpService";
|
||||
import DetailService from "@/services/detailService";
|
||||
import { OSS_BASE } from "@/config/api";
|
||||
import CloseIcon from "@/static/ntrp/ntrp_close_icon.svg";
|
||||
|
||||
@@ -282,7 +282,9 @@ function drawTextWrap(
|
||||
/** 核心纯函数:生成海报图片 */
|
||||
export async function generatePosterImage(data: any): Promise<string> {
|
||||
console.log("start !!!!");
|
||||
const dpr = Taro.getWindowInfo().pixelRatio;
|
||||
// const dpr = Taro.getWindowInfo().pixelRatio;
|
||||
const dpr = 1;
|
||||
// console.log(dpr, 'dpr')
|
||||
const width = 600;
|
||||
const height = 1000;
|
||||
|
||||
@@ -433,7 +435,7 @@ export async function generatePosterImage(data: any): Promise<string> {
|
||||
const { tempFilePath } = await Taro.canvasToTempFilePath({
|
||||
canvas,
|
||||
fileType: 'png',
|
||||
quality: 1,
|
||||
quality: 0.7,
|
||||
});
|
||||
return tempFilePath;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user