Merge branch 'master' into feat/liujie
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"miniprogramRoot": "dist/",
|
"miniprogramRoot": "dist/",
|
||||||
"projectname": "playBallTogether",
|
"projectname": "playBallTogether",
|
||||||
"description": "playBallTogether",
|
"description": "playBallTogether",
|
||||||
"appid": "wx915ecf6c01bea4ec",
|
"appid": "wx815b533167eb7b53",
|
||||||
|
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": true,
|
"urlCheck": true,
|
||||||
|
|||||||
@@ -19,8 +19,7 @@ page {
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Quicksand";
|
font-family: "Quicksand";
|
||||||
// 注意:此路径来自 @/config/api.ts 中的 OSS_BASE_URL 配置
|
// 注意:此路径对应 @/config/api.ts 中的 OSS_BASE
|
||||||
// 如需修改,请更新配置文件中的 OSS_BASE_URL
|
src: url("https://bimwe-oss.oss-cn-shanghai.aliyuncs.com/front/ball/other/57dc951f-f10e-45b7-9157-0b1e468187fd.ttf") format("truetype");
|
||||||
src: url("https://youchang2026.oss-cn-shanghai.aliyuncs.com/front/ball/other/57dc951f-f10e-45b7-9157-0b1e468187fd.ttf") format("truetype");
|
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ const NTRPEvaluatePopup = (props: NTRPEvaluatePopupProps, ref) => {
|
|||||||
showGuide = false,
|
showGuide = false,
|
||||||
} = props;
|
} = props;
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const [ntrp, setNtrp] = useState<string>("");
|
const [ntrp, setNtrp] = useState<string>("1.5");
|
||||||
const [guideShow, setGuideShow] = useState(() => showGuide);
|
const [guideShow, setGuideShow] = useState(() => showGuide);
|
||||||
const { updateUserInfo } = useUserActions();
|
const { updateUserInfo } = useUserActions();
|
||||||
const userInfo = useUserInfo();
|
const userInfo = useUserInfo();
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
useLastTestResult,
|
useLastTestResult,
|
||||||
} from "@/store/userStore";
|
} from "@/store/userStore";
|
||||||
// import { getCurrentFullPath } from "@/utils";
|
// import { getCurrentFullPath } from "@/utils";
|
||||||
import { OSS_BASE_URL } from "@/config/api";
|
import { OSS_BASE } from "@/config/api";
|
||||||
import { StageType } from "@/services/evaluateService";
|
import { StageType } from "@/services/evaluateService";
|
||||||
import { waitForAuthInit } from "@/utils/authInit";
|
import { waitForAuthInit } from "@/utils/authInit";
|
||||||
import DocCopy from "@/static/ntrp/ntrp_doc_copy.svg";
|
import DocCopy from "@/static/ntrp/ntrp_doc_copy.svg";
|
||||||
@@ -148,7 +148,7 @@ function NTRPTestEntryCard(props: {
|
|||||||
<View
|
<View
|
||||||
className={styles.lines}
|
className={styles.lines}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(${OSS_BASE_URL}/images/215f1ce1-be52-4a92-8250-5a4a69e7f2b3.png)`,
|
backgroundImage: `url(${OSS_BASE}/front/ball/images/215f1ce1-be52-4a92-8250-5a4a69e7f2b3.png)`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<View className={styles.desc}>
|
<View className={styles.desc}>
|
||||||
@@ -188,7 +188,7 @@ function NTRPTestEntryCard(props: {
|
|||||||
<View
|
<View
|
||||||
className={styles.lines}
|
className={styles.lines}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(${OSS_BASE_URL}/images/215f1ce1-be52-4a92-8250-5a4a69e7f2b3.png)`,
|
backgroundImage: `url(${OSS_BASE}/front/ball/images/215f1ce1-be52-4a92-8250-5a4a69e7f2b3.png)`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<View className={styles.desc}>
|
<View className={styles.desc}>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { View, Canvas } from "@tarojs/components";
|
|||||||
import { forwardRef, useImperativeHandle } from "react";
|
import { forwardRef, useImperativeHandle } from "react";
|
||||||
import shareLogoSvg from "@/static/ntrp/ntrp_share_logo.png";
|
import shareLogoSvg from "@/static/ntrp/ntrp_share_logo.png";
|
||||||
import docCopyPng from "@/static/ntrp/ntrp_doc_copy.png";
|
import docCopyPng from "@/static/ntrp/ntrp_doc_copy.png";
|
||||||
import { OSS_BASE_URL } from "@/config/api";
|
import { OSS_BASE } from "@/config/api";
|
||||||
|
|
||||||
interface RadarChartV2Props {
|
interface RadarChartV2Props {
|
||||||
data: [string, number][];
|
data: [string, number][];
|
||||||
@@ -233,7 +233,7 @@ const RadarChartV2 = forwardRef<RadarChartV2Ref, RadarChartV2Props>((props, ref)
|
|||||||
|
|
||||||
// 绘制背景 - 使用 share_bg.png 背景图,撑满整个画布(从 OSS 动态加载)
|
// 绘制背景 - 使用 share_bg.png 背景图,撑满整个画布(从 OSS 动态加载)
|
||||||
try {
|
try {
|
||||||
const shareBgUrl = `${OSS_BASE_URL}/images/share_bg.png`;
|
const shareBgUrl = `${OSS_BASE}/front/ball/images/share_bg.png`;
|
||||||
const bgImg = await loadImage(canvas, shareBgUrl);
|
const bgImg = await loadImage(canvas, shareBgUrl);
|
||||||
ctx.drawImage(bgImg, 0, 0, width, height);
|
ctx.drawImage(bgImg, 0, 0, width, height);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import { View, Canvas } from '@tarojs/components'
|
import { View, Canvas } from '@tarojs/components'
|
||||||
import Taro from '@tarojs/taro'
|
import Taro from '@tarojs/taro'
|
||||||
import { OSS_BASE_URL } from "@/config/api";
|
import { OSS_BASE } from "@/config/api";
|
||||||
|
|
||||||
// 分享卡片数据接口
|
// 分享卡片数据接口
|
||||||
export interface ShareCardData {
|
export interface ShareCardData {
|
||||||
@@ -506,7 +506,7 @@ const ShareCardCanvas: React.FC<ShareCardCanvasProps> = ({
|
|||||||
const textX = iconX + iconSize + 20
|
const textX = iconX + iconSize + 20
|
||||||
|
|
||||||
// 绘制网球图标
|
// 绘制网球图标
|
||||||
const tennisBallPath = await loadImage(`${OSS_BASE_URL}/images/b3eaf45e-ef28-4e45-9195-823b832e0451.jpg`, canvasNode)
|
const tennisBallPath = await loadImage(`${OSS_BASE}/front/ball/images/b3eaf45e-ef28-4e45-9195-823b832e0451.jpg`, canvasNode)
|
||||||
ctx.drawImage(tennisBallPath, iconX, gameInfoY, iconSize, iconSize)
|
ctx.drawImage(tennisBallPath, iconX, gameInfoY, iconSize, iconSize)
|
||||||
|
|
||||||
// 绘制"单打"标签
|
// 绘制"单打"标签
|
||||||
@@ -542,7 +542,7 @@ const ShareCardCanvas: React.FC<ShareCardCanvasProps> = ({
|
|||||||
const dateX = danDaX
|
const dateX = danDaX
|
||||||
const timeInfoY = infoStartY + infoSpacing
|
const timeInfoY = infoStartY + infoSpacing
|
||||||
const timeInfoFontSize = scale * 24 * dpr
|
const timeInfoFontSize = scale * 24 * dpr
|
||||||
const calendarPath = await loadImage(`${OSS_BASE_URL}/images/ea792a5d-b105-4c95-bfc4-8af558f2b33b.jpg`, canvasNode)
|
const calendarPath = await loadImage(`${OSS_BASE}/front/ball/images/ea792a5d-b105-4c95-bfc4-8af558f2b33b.jpg`, canvasNode)
|
||||||
ctx.drawImage(calendarPath, iconX, timeInfoY, iconSize, iconSize)
|
ctx.drawImage(calendarPath, iconX, timeInfoY, iconSize, iconSize)
|
||||||
|
|
||||||
// 绘制日期(绿色)
|
// 绘制日期(绿色)
|
||||||
@@ -556,7 +556,7 @@ const ShareCardCanvas: React.FC<ShareCardCanvasProps> = ({
|
|||||||
// 绘制地点
|
// 绘制地点
|
||||||
const locationInfoY = infoStartY + infoSpacing * 2
|
const locationInfoY = infoStartY + infoSpacing * 2
|
||||||
const locationFontSize = scale * 22 * dpr
|
const locationFontSize = scale * 22 * dpr
|
||||||
const locationPath = await loadImage(`${OSS_BASE_URL}/images/adc9a167-2ea9-4e3b-b963-6a894a1fd91b.jpg`, canvasNode)
|
const locationPath = await loadImage(`${OSS_BASE}/front/ball/images/adc9a167-2ea9-4e3b-b963-6a894a1fd91b.jpg`, canvasNode)
|
||||||
ctx.drawImage(locationPath, iconX, locationInfoY, iconSize, iconSize)
|
ctx.drawImage(locationPath, iconX, locationInfoY, iconSize, iconSize)
|
||||||
drawBoldText(ctx, data.venueName, danDaX, locationInfoY + 10, locationFontSize, '#000000')
|
drawBoldText(ctx, data.venueName, danDaX, locationInfoY + 10, locationFontSize, '#000000')
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import envConfig from './env'// API配置
|
import envConfig from './env'// API配置
|
||||||
|
|
||||||
// OSS 基础路径配置
|
// OSS 配置:仅域名,调用处拼接 /front/ball 及后续路径
|
||||||
export const OSS_BASE_URL = 'https://youchang2026.oss-cn-shanghai.aliyuncs.com/front/ball'
|
export const OSS_BASE = "https://bimwe-oss.oss-cn-shanghai.aliyuncs.com";
|
||||||
|
|
||||||
|
// 因乐驰OSS 配置:仅域名,调用处拼接 /front/ball 及后续路径
|
||||||
|
// export const OSS_BASE = "https://youchang2026.oss-cn-shanghai.aliyuncs.com";
|
||||||
|
|
||||||
export const API_CONFIG = {
|
export const API_CONFIG = {
|
||||||
// 基础URL
|
// 基础URL
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ 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 { waitForAuthInit } from "@/utils/authInit";
|
||||||
import { useUserActions } from "@/store/userStore";
|
import { useUserActions } from "@/store/userStore";
|
||||||
import { OSS_BASE_URL } from "@/config/api";
|
import { OSS_BASE } from "@/config/api";
|
||||||
import { generatePosterImage, base64ToTempFilePath, delay } from "@/utils";
|
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";
|
||||||
@@ -148,7 +148,7 @@ export default forwardRef(({ id, from, detail, userInfo }, ref) => {
|
|||||||
mainCoursal:
|
mainCoursal:
|
||||||
image_list[0] && image_list[0].startsWith("http")
|
image_list[0] && image_list[0].startsWith("http")
|
||||||
? image_list[0]
|
? image_list[0]
|
||||||
: `${OSS_BASE_URL}/images/0621b8cf-f7d6-43ad-b852-7dc39f29a782.png`,
|
: `${OSS_BASE}/front/ball/images/0621b8cf-f7d6-43ad-b852-7dc39f29a782.png`,
|
||||||
nickname,
|
nickname,
|
||||||
avatarUrl: avatar_url,
|
avatarUrl: avatar_url,
|
||||||
title,
|
title,
|
||||||
@@ -210,7 +210,7 @@ export default forwardRef(({ id, from, detail, userInfo }, ref) => {
|
|||||||
<View
|
<View
|
||||||
className={styles.contentContainer}
|
className={styles.contentContainer}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(${OSS_BASE_URL}/images/215f1ce1-be52-4a92-8250-5a4a69e7f2b3.png)`,
|
backgroundImage: `url(${OSS_BASE}/front/ball/images/215f1ce1-be52-4a92-8250-5a4a69e7f2b3.png)`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<View
|
<View
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { useUserActions } from "@/store/userStore";
|
|||||||
import { DayOfWeekMap } from "../detail/config";
|
import { DayOfWeekMap } from "../detail/config";
|
||||||
import { genNTRPRequirementText } from "@/utils/helper";
|
import { genNTRPRequirementText } from "@/utils/helper";
|
||||||
import { waitForAuthInit } from "@/utils/authInit";
|
import { waitForAuthInit } from "@/utils/authInit";
|
||||||
import { OSS_BASE_URL } from "@/config/api";
|
import { OSS_BASE } from "@/config/api";
|
||||||
import styles from "./index.module.scss";
|
import styles from "./index.module.scss";
|
||||||
|
|
||||||
dayjs.locale("zh-cn");
|
dayjs.locale("zh-cn");
|
||||||
@@ -71,7 +71,7 @@ function SharePoster(props) {
|
|||||||
mainCoursal:
|
mainCoursal:
|
||||||
image_list[0] && image_list[0].startsWith("http")
|
image_list[0] && image_list[0].startsWith("http")
|
||||||
? image_list[0]
|
? image_list[0]
|
||||||
: `${OSS_BASE_URL}/images/0621b8cf-f7d6-43ad-b852-7dc39f29a782.png`,
|
: `${OSS_BASE}/front/ball/images/0621b8cf-f7d6-43ad-b852-7dc39f29a782.png`,
|
||||||
nickname,
|
nickname,
|
||||||
avatarUrl: avatar_url,
|
avatarUrl: avatar_url,
|
||||||
title,
|
title,
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ const MyselfPageContent: React.FC<MyselfPageContentProps> = ({ isActive = true }
|
|||||||
const [hasLoaded, setHasLoaded] = useState(false); // 记录是否已经加载过数据
|
const [hasLoaded, setHasLoaded] = useState(false); // 记录是否已经加载过数据
|
||||||
|
|
||||||
const [collapseProfile, setCollapseProfile] = useState(false);
|
const [collapseProfile, setCollapseProfile] = useState(false);
|
||||||
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
pickerOption.getCities();
|
pickerOption.getCities();
|
||||||
@@ -169,6 +170,23 @@ const MyselfPageContent: React.FC<MyselfPageContentProps> = ({ isActive = true }
|
|||||||
setActiveTab(tab);
|
setActiveTab(tab);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 下拉刷新:刷新用户信息和球局数据
|
||||||
|
const handle_refresh = async () => {
|
||||||
|
setRefreshing(true);
|
||||||
|
try {
|
||||||
|
await Promise.all([fetchUserInfo(), load_game_data()]);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("刷新失败:", error);
|
||||||
|
(Taro as any).showToast({
|
||||||
|
title: "刷新失败,请重试",
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
setRefreshing(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// const handleScroll = (event: any) => {
|
// const handleScroll = (event: any) => {
|
||||||
// const scrollData = event.detail;
|
// const scrollData = event.detail;
|
||||||
// setCollapseProfile(scrollData.scrollTop > 1);
|
// setCollapseProfile(scrollData.scrollTop > 1);
|
||||||
@@ -178,6 +196,9 @@ const MyselfPageContent: React.FC<MyselfPageContentProps> = ({ isActive = true }
|
|||||||
<ScrollView
|
<ScrollView
|
||||||
scrollY
|
scrollY
|
||||||
refresherBackground="#FAFAFA"
|
refresherBackground="#FAFAFA"
|
||||||
|
refresherEnabled
|
||||||
|
refresherTriggered={refreshing}
|
||||||
|
onRefresherRefresh={handle_refresh}
|
||||||
className={styles.myselfPage}
|
className={styles.myselfPage}
|
||||||
>
|
>
|
||||||
<View
|
<View
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import { useGlobalStore } from "@/store/global";
|
|||||||
import { useOrder } from "@/store/orderStore";
|
import { useOrder } from "@/store/orderStore";
|
||||||
import detailService, { GameData } from "@/services/detailService";
|
import detailService, { GameData } from "@/services/detailService";
|
||||||
import { withAuth, RefundPopup, GeneralNavbar } from "@/components";
|
import { withAuth, RefundPopup, GeneralNavbar } from "@/components";
|
||||||
import { OSS_BASE_URL } from "@/config/api";
|
import { OSS_BASE } from "@/config/api";
|
||||||
import img from "@/config/images";
|
import img from "@/config/images";
|
||||||
import CustomerIcon from "@/static/order/customer.svg";
|
import CustomerIcon from "@/static/order/customer.svg";
|
||||||
import { handleCustomerService } from "@/services/userService";
|
import { handleCustomerService } from "@/services/userService";
|
||||||
@@ -301,7 +301,7 @@ function GameInfo(props) {
|
|||||||
<View className={styles.locationMessageIcon}>
|
<View className={styles.locationMessageIcon}>
|
||||||
<Image
|
<Image
|
||||||
className={styles.locationMessageIconImage}
|
className={styles.locationMessageIconImage}
|
||||||
src={`${OSS_BASE_URL}/images/3ee5c89c-fe58-4a56-9471-1295da09c743.png`}
|
src={`${OSS_BASE}/front/ball/images/3ee5c89c-fe58-4a56-9471-1295da09c743.png`}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
{/* location message */}
|
{/* location message */}
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ function generateTimeMsg(game_info) {
|
|||||||
const OrderList = () => {
|
const OrderList = () => {
|
||||||
const [list, setList] = useState<any[][]>([]);
|
const [list, setList] = useState<any[][]>([]);
|
||||||
const [total, setTotal] = useState(0);
|
const [total, setTotal] = useState(0);
|
||||||
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
const refundRef = useRef(null);
|
const refundRef = useRef(null);
|
||||||
|
|
||||||
const end = list.length * PAGESIZE >= total;
|
const end = list.length * PAGESIZE >= total;
|
||||||
@@ -114,6 +115,22 @@ const OrderList = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 下拉刷新:重新加载第一页订单
|
||||||
|
async function handle_refresh() {
|
||||||
|
setRefreshing(true);
|
||||||
|
try {
|
||||||
|
await getOrders(1);
|
||||||
|
} catch (error) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: "刷新失败,请重试",
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
setRefreshing(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handlePayNow(item) {
|
async function handlePayNow(item) {
|
||||||
// 检查登录状态和手机号
|
// 检查登录状态和手机号
|
||||||
if (!requireLoginWithPhone()) {
|
if (!requireLoginWithPhone()) {
|
||||||
@@ -285,6 +302,10 @@ const OrderList = () => {
|
|||||||
scrollWithAnimation
|
scrollWithAnimation
|
||||||
lowerThreshold={20}
|
lowerThreshold={20}
|
||||||
onScrollToLower={handleFetchNext}
|
onScrollToLower={handleFetchNext}
|
||||||
|
refresherBackground="#FAFAFA"
|
||||||
|
refresherEnabled
|
||||||
|
refresherTriggered={refreshing}
|
||||||
|
onRefresherRefresh={handle_refresh}
|
||||||
enhanced
|
enhanced
|
||||||
showScrollbar={false}
|
showScrollbar={false}
|
||||||
className={styles.list}
|
className={styles.list}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: '开启消息通知',
|
navigationBarTitleText: '开启消息通知',
|
||||||
navigationStyle: 'custom',
|
navigationStyle: 'custom',
|
||||||
enablePullDownRefresh: false,
|
backgroundColor:"#FAFAFA"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
.enable_notification_page {
|
.enable_notification_page {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
// min-height: 100vh;
|
// min-height: 100vh;
|
||||||
background: radial-gradient(circle at 50% 0%, rgba(191, 255, 239, 1) 0%, rgba(255, 255, 255, 1) 37%);
|
// background: radial-gradient(circle at 50% 0%, rgba(191, 255, 239, 1) 0%, rgba(255, 255, 255, 1) 37%);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
@@ -29,7 +29,6 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
padding: 10px 16px;
|
padding: 10px 16px;
|
||||||
background: #ffffff;
|
|
||||||
border: 0.5px solid rgba(0, 0, 0, 0.08);
|
border: 0.5px solid rgba(0, 0, 0, 0.08);
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.08);
|
box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.08);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import { formatNtrpDisplay } from "@/utils/helper";
|
|||||||
import { waitForAuthInit } from "@/utils/authInit";
|
import { waitForAuthInit } from "@/utils/authInit";
|
||||||
import httpService from "@/services/httpService";
|
import httpService from "@/services/httpService";
|
||||||
import DetailService from "@/services/detailService";
|
import DetailService from "@/services/detailService";
|
||||||
import { OSS_BASE_URL } from "@/config/api";
|
import { OSS_BASE } from "@/config/api";
|
||||||
import CloseIcon from "@/static/ntrp/ntrp_close_icon.svg";
|
import CloseIcon from "@/static/ntrp/ntrp_close_icon.svg";
|
||||||
import DocCopy from "@/static/ntrp/ntrp_doc_copy.svg";
|
import DocCopy from "@/static/ntrp/ntrp_doc_copy.svg";
|
||||||
import ArrowRight from "@/static/ntrp/ntrp_arrow_right.svg";
|
import ArrowRight from "@/static/ntrp/ntrp_arrow_right.svg";
|
||||||
@@ -225,7 +225,7 @@ function Intro() {
|
|||||||
<View
|
<View
|
||||||
className={styles.introContainer}
|
className={styles.introContainer}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(${OSS_BASE_URL}/images/215f1ce1-be52-4a92-8250-5a4a69e7f2b3.png)`,
|
backgroundImage: `url(${OSS_BASE}/front/ball/images/215f1ce1-be52-4a92-8250-5a4a69e7f2b3.png)`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CommonGuideBar />
|
<CommonGuideBar />
|
||||||
@@ -252,7 +252,7 @@ function Intro() {
|
|||||||
<View className={styles.tip}>
|
<View className={styles.tip}>
|
||||||
<Image
|
<Image
|
||||||
className={styles.tipImage}
|
className={styles.tipImage}
|
||||||
src={`${OSS_BASE_URL}/images/b7cb47aa-b609-4112-899f-3fde02ed2431.png`}
|
src={`${OSS_BASE}/front/ball/images/b7cb47aa-b609-4112-899f-3fde02ed2431.png`}
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
@@ -310,7 +310,7 @@ function Intro() {
|
|||||||
<View className={styles.tip}>
|
<View className={styles.tip}>
|
||||||
<Image
|
<Image
|
||||||
className={styles.tipImage}
|
className={styles.tipImage}
|
||||||
src={`${OSS_BASE_URL}/images/b7cb47aa-b609-4112-899f-3fde02ed2431.png`}
|
src={`${OSS_BASE}/front/ball/images/b7cb47aa-b609-4112-899f-3fde02ed2431.png`}
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
@@ -318,7 +318,7 @@ function Intro() {
|
|||||||
<View className={styles.radar}>
|
<View className={styles.radar}>
|
||||||
<Image
|
<Image
|
||||||
className={styles.radarImage}
|
className={styles.radarImage}
|
||||||
src={`${OSS_BASE_URL}/images/a2e1b639-82a9-4ab8-b767-8605556eafcb.png`}
|
src={`${OSS_BASE}/front/ball/images/a2e1b639-82a9-4ab8-b767-8605556eafcb.png`}
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
@@ -427,7 +427,7 @@ function Test() {
|
|||||||
<View
|
<View
|
||||||
className={styles.testContainer}
|
className={styles.testContainer}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(${OSS_BASE_URL}/images/215f1ce1-be52-4a92-8250-5a4a69e7f2b3.png)`,
|
backgroundImage: `url(${OSS_BASE}/front/ball/images/215f1ce1-be52-4a92-8250-5a4a69e7f2b3.png)`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CommonGuideBar confirm title={`${index + 1} / ${questions.length}`} />
|
<CommonGuideBar confirm title={`${index + 1} / ${questions.length}`} />
|
||||||
@@ -720,7 +720,7 @@ function Result() {
|
|||||||
<View
|
<View
|
||||||
className={styles.card}
|
className={styles.card}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(${OSS_BASE_URL}/images/f5b45cea-5015-41d6-aaf4-83b2e76678e1.png)`,
|
backgroundImage: `url(${OSS_BASE}/front/ball/images/f5b45cea-5015-41d6-aaf4-83b2e76678e1.png)`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<View className={styles.avatarWrap}>
|
<View className={styles.avatarWrap}>
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ const OtherUserPage: React.FC = () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const [collapseProfile, setCollapseProfile] = useState(false);
|
const [collapseProfile, setCollapseProfile] = useState(false);
|
||||||
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
|
|
||||||
// 进入页面时检查 user_id,只在组件挂载时执行一次
|
// 进入页面时检查 user_id,只在组件挂载时执行一次
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -82,15 +83,12 @@ const OtherUserPage: React.FC = () => {
|
|||||||
}
|
}
|
||||||
}, []); // 空依赖数组,确保只在进入时执行一次
|
}, []); // 空依赖数组,确保只在进入时执行一次
|
||||||
|
|
||||||
// 页面加载时获取用户信息
|
// 加载用户信息(使用 useCallback 便于下拉刷新复用)
|
||||||
useEffect(() => {
|
const load_user_data = useCallback(async () => {
|
||||||
const load_user_data = async () => {
|
if (!user_id) return;
|
||||||
if (user_id) {
|
|
||||||
try {
|
try {
|
||||||
// const user_data = await UserService.get_user_info(user_id);
|
|
||||||
const res = await LoginService.getUserInfoById(user_id);
|
const res = await LoginService.getUserInfoById(user_id);
|
||||||
const { data: userData } = res;
|
const { data: userData } = res;
|
||||||
// setUserInfo({...res.data as UserInfo, avatar: data.avatar_url || require("@/static/userInfo/default_avatar.svg")});
|
|
||||||
setUserInfo({
|
setUserInfo({
|
||||||
id: parseInt(user_id || "") || 0,
|
id: parseInt(user_id || "") || 0,
|
||||||
nickname: userData.nickname || "",
|
nickname: userData.nickname || "",
|
||||||
@@ -107,7 +105,6 @@ const OtherUserPage: React.FC = () => {
|
|||||||
participated_games_count:
|
participated_games_count:
|
||||||
userData.stats?.participated_games_count || 0,
|
userData.stats?.participated_games_count || 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
personal_profile: userData.personal_profile || "",
|
personal_profile: userData.personal_profile || "",
|
||||||
province: userData.province || "",
|
province: userData.province || "",
|
||||||
city: userData.city || "",
|
city: userData.city || "",
|
||||||
@@ -126,12 +123,12 @@ const OtherUserPage: React.FC = () => {
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
load_user_data();
|
|
||||||
}, [user_id]);
|
}, [user_id]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
load_user_data();
|
||||||
|
}, [load_user_data]);
|
||||||
|
|
||||||
// 分类球局数据(使用 useCallback 包装,避免每次渲染都创建新函数)
|
// 分类球局数据(使用 useCallback 包装,避免每次渲染都创建新函数)
|
||||||
const classifyGameRecords = useCallback(
|
const classifyGameRecords = useCallback(
|
||||||
(
|
(
|
||||||
@@ -232,6 +229,18 @@ const OtherUserPage: React.FC = () => {
|
|||||||
setCollapseProfile(scrollData.scrollTop > 1);
|
setCollapseProfile(scrollData.scrollTop > 1);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// 下拉刷新:刷新用户信息和球局数据
|
||||||
|
const handle_refresh = useCallback(async () => {
|
||||||
|
setRefreshing(true);
|
||||||
|
try {
|
||||||
|
await Promise.all([load_user_data(), load_game_data()]);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("刷新失败:", error);
|
||||||
|
} finally {
|
||||||
|
setRefreshing(false);
|
||||||
|
}
|
||||||
|
}, [load_user_data, load_game_data]);
|
||||||
|
|
||||||
// 处理球局详情
|
// 处理球局详情
|
||||||
// const handle_game_detail = (game_id: string) => {
|
// const handle_game_detail = (game_id: string) => {
|
||||||
// Taro.navigateTo({
|
// Taro.navigateTo({
|
||||||
@@ -244,6 +253,9 @@ const OtherUserPage: React.FC = () => {
|
|||||||
scrollY
|
scrollY
|
||||||
className="other_user_page"
|
className="other_user_page"
|
||||||
refresherBackground="#FAFAFA"
|
refresherBackground="#FAFAFA"
|
||||||
|
refresherEnabled
|
||||||
|
refresherTriggered={refreshing}
|
||||||
|
onRefresherRefresh={handle_refresh}
|
||||||
>
|
>
|
||||||
{/* <CustomNavbar>
|
{/* <CustomNavbar>
|
||||||
<View className="navbar_content">
|
<View className="navbar_content">
|
||||||
|
|||||||
@@ -1,12 +1,19 @@
|
|||||||
// @use '../../scss/common.scss' as *;
|
// @use '../../scss/common.scss' as *;
|
||||||
|
|
||||||
.wallet_page {
|
.wallet_page {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow-y: auto;
|
overflow: hidden;
|
||||||
background-color: #fafafa;
|
background-color: #fafafa;
|
||||||
padding-bottom: 5px;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.wallet_scroll {
|
||||||
|
flex: 1;
|
||||||
|
height: 0;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
&::-webkit-scrollbar {
|
&::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
width: 0;
|
width: 0;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState, useCallback } from "react";
|
||||||
import { View, Text, Input, Button, Image } from "@tarojs/components";
|
import { View, Text, Input, Button, Image, ScrollView } from "@tarojs/components";
|
||||||
import Taro, { useDidShow, useReachBottom } from "@tarojs/taro";
|
import Taro, { useDidShow } from "@tarojs/taro";
|
||||||
import "./index.scss";
|
import "./index.scss";
|
||||||
import { CommonPopup, EmptyState } from "@/components";
|
import { CommonPopup, EmptyState } from "@/components";
|
||||||
import httpService from "@/services/httpService";
|
import httpService from "@/services/httpService";
|
||||||
@@ -109,16 +109,6 @@ const WalletPage: React.FC = () => {
|
|||||||
const pageConfig = currentPage.page?.config;
|
const pageConfig = currentPage.page?.config;
|
||||||
const pageTitle = pageConfig?.navigationBarTitleText;
|
const pageTitle = pageConfig?.navigationBarTitleText;
|
||||||
|
|
||||||
useReachBottom(() => {
|
|
||||||
if (load_transactions_params.page >= totalPages) return;
|
|
||||||
// 加载更多方法
|
|
||||||
set_load_transactions_params((prev) => {
|
|
||||||
return {
|
|
||||||
...prev,
|
|
||||||
page: prev.page + 1,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// 钱包信息状态
|
// 钱包信息状态
|
||||||
const [wallet_info, set_wallet_info] = useState<WalletInfo>({
|
const [wallet_info, set_wallet_info] = useState<WalletInfo>({
|
||||||
balance: 0,
|
balance: 0,
|
||||||
@@ -158,6 +148,7 @@ const WalletPage: React.FC = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const [totalPages, setTotalPages] = useState(1);
|
const [totalPages, setTotalPages] = useState(1);
|
||||||
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
load_transactions();
|
load_transactions();
|
||||||
@@ -452,6 +443,33 @@ const WalletPage: React.FC = () => {
|
|||||||
setShowFilterPopup(true);
|
setShowFilterPopup(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 下拉刷新:刷新钱包余额和交易记录
|
||||||
|
const handle_refresh = useCallback(async () => {
|
||||||
|
setRefreshing(true);
|
||||||
|
try {
|
||||||
|
await load_wallet_data();
|
||||||
|
set_transactions([]);
|
||||||
|
set_load_transactions_params((prev) => ({ ...prev, page: 1 }));
|
||||||
|
} catch (error) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: "刷新失败,请重试",
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
setRefreshing(false);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// 滚动到底部加载更多交易记录
|
||||||
|
const handle_scroll_to_lower = useCallback(() => {
|
||||||
|
if (load_transactions_params.page >= totalPages) return;
|
||||||
|
set_load_transactions_params((prev) => ({
|
||||||
|
...prev,
|
||||||
|
page: prev.page + 1,
|
||||||
|
}));
|
||||||
|
}, [load_transactions_params.page, totalPages]);
|
||||||
|
|
||||||
const handleFilterCancel = () => {
|
const handleFilterCancel = () => {
|
||||||
setShowFilterPopup(false);
|
setShowFilterPopup(false);
|
||||||
setFilterParams({
|
setFilterParams({
|
||||||
@@ -488,6 +506,16 @@ const WalletPage: React.FC = () => {
|
|||||||
Taro.navigateBack();
|
Taro.navigateBack();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
<ScrollView
|
||||||
|
scrollY
|
||||||
|
refresherBackground="#FAFAFA"
|
||||||
|
refresherEnabled
|
||||||
|
refresherTriggered={refreshing}
|
||||||
|
onRefresherRefresh={handle_refresh}
|
||||||
|
lowerThreshold={50}
|
||||||
|
onScrollToLower={handle_scroll_to_lower}
|
||||||
|
className="wallet_scroll"
|
||||||
|
>
|
||||||
{/* 钱包主卡片 */}
|
{/* 钱包主卡片 */}
|
||||||
<View
|
<View
|
||||||
className="wallet_main_card"
|
className="wallet_main_card"
|
||||||
@@ -649,6 +677,7 @@ const WalletPage: React.FC = () => {
|
|||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
{/* 提现弹窗 */}
|
{/* 提现弹窗 */}
|
||||||
<CommonPopup
|
<CommonPopup
|
||||||
|
|||||||
@@ -1,18 +1,11 @@
|
|||||||
import Taro from "@tarojs/taro";
|
import Taro from "@tarojs/taro";
|
||||||
import { OSS_BASE_URL } from "@/config/api";
|
import { OSS_BASE } from "@/config/api";
|
||||||
|
|
||||||
const bgUrl = `${OSS_BASE_URL}/images/5e2c85ab-fb0c-4026-974d-1e0725181542.png`;
|
const bgUrl = `${OSS_BASE}/front/ball/images/5e2c85ab-fb0c-4026-974d-1e0725181542.png`;
|
||||||
|
const ringUrl = `${OSS_BASE}/front/ball/images/b635164f-ecec-434a-a00b-69614a918f2f.png`;
|
||||||
const ringUrl = `${OSS_BASE_URL}/images/b635164f-ecec-434a-a00b-69614a918f2f.png`;
|
const dateIcon = `${OSS_BASE}/front/ball/images/1b49476e-0eda-42ff-b08c-002ce510df82.jpg`;
|
||||||
|
const mapIcon = `${OSS_BASE}/front/ball/images/06b994fa-9227-4708-8555-8a07af8d0c3b.jpg`;
|
||||||
const dateIcon = `${OSS_BASE_URL}/images/1b49476e-0eda-42ff-b08c-002ce510df82.jpg`;
|
const logoText = `${OSS_BASE}/front/ball/system/youchang_tip_text.png`;
|
||||||
|
|
||||||
const mapIcon = `${OSS_BASE_URL}/images/06b994fa-9227-4708-8555-8a07af8d0c3b.jpg`;
|
|
||||||
|
|
||||||
// const logo = `${OSS_BASE_URL}/images/fb732da6-11b9-4022-a524-a377b17635eb.jpg`
|
|
||||||
|
|
||||||
// const logoText = `${OSS_BASE_URL}/images/9d8cbc9d-9601-4e2d-ab23-76420a4537d6.png`;
|
|
||||||
const logoText = `${OSS_BASE_URL}/system/youchang_tip_text.png`
|
|
||||||
|
|
||||||
export function base64ToTempFilePath(base64Data: string): Promise<string> {
|
export function base64ToTempFilePath(base64Data: string): Promise<string> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Taro from '@tarojs/taro'
|
import Taro from '@tarojs/taro'
|
||||||
import { OSS_BASE_URL } from "@/config/api";
|
import { OSS_BASE } from "@/config/api";
|
||||||
|
|
||||||
export interface ShareCardData {
|
export interface ShareCardData {
|
||||||
userAvatar: string
|
userAvatar: string
|
||||||
@@ -481,7 +481,7 @@ const drawShareCard = async (ctx: any, data: ShareCardData, offscreen: any): Pro
|
|||||||
const textX = iconX + iconSize + 20
|
const textX = iconX + iconSize + 20
|
||||||
|
|
||||||
// 绘制网球图标
|
// 绘制网球图标
|
||||||
const tennisBallPath = await loadImage(`${OSS_BASE_URL}/images/b3eaf45e-ef28-4e45-9195-823b832e0451.jpg`)
|
const tennisBallPath = await loadImage(`${OSS_BASE}/front/ball/images/b3eaf45e-ef28-4e45-9195-823b832e0451.jpg`)
|
||||||
ctx.drawImage(tennisBallPath, iconX, gameInfoY, iconSize, iconSize)
|
ctx.drawImage(tennisBallPath, iconX, gameInfoY, iconSize, iconSize)
|
||||||
|
|
||||||
// 绘制"单打"标签
|
// 绘制"单打"标签
|
||||||
@@ -517,7 +517,7 @@ const drawShareCard = async (ctx: any, data: ShareCardData, offscreen: any): Pro
|
|||||||
const dateX = danDaX
|
const dateX = danDaX
|
||||||
const timeInfoY = infoStartY + infoSpacing
|
const timeInfoY = infoStartY + infoSpacing
|
||||||
const timeInfoFontSize = scale * 24 * dpr
|
const timeInfoFontSize = scale * 24 * dpr
|
||||||
const calendarPath = await loadImage(`${OSS_BASE_URL}/images/ea792a5d-b105-4c95-bfc4-8af558f2b33b.jpg`)
|
const calendarPath = await loadImage(`${OSS_BASE}/front/ball/images/ea792a5d-b105-4c95-bfc4-8af558f2b33b.jpg`)
|
||||||
ctx.drawImage(calendarPath, iconX, timeInfoY, iconSize, iconSize)
|
ctx.drawImage(calendarPath, iconX, timeInfoY, iconSize, iconSize)
|
||||||
|
|
||||||
// 绘制日期(绿色,非描边粗体)
|
// 绘制日期(绿色,非描边粗体)
|
||||||
@@ -530,7 +530,7 @@ const drawShareCard = async (ctx: any, data: ShareCardData, offscreen: any): Pro
|
|||||||
// 绘制地点
|
// 绘制地点
|
||||||
const locationInfoY = infoStartY + infoSpacing * 2
|
const locationInfoY = infoStartY + infoSpacing * 2
|
||||||
const locationFontSize = scale * 22 * dpr
|
const locationFontSize = scale * 22 * dpr
|
||||||
const locationPath = await loadImage(`${OSS_BASE_URL}/images/adc9a167-2ea9-4e3b-b963-6a894a1fd91b.jpg`)
|
const locationPath = await loadImage(`${OSS_BASE}/front/ball/images/adc9a167-2ea9-4e3b-b963-6a894a1fd91b.jpg`)
|
||||||
ctx.drawImage(locationPath, iconX, locationInfoY, iconSize, iconSize)
|
ctx.drawImage(locationPath, iconX, locationInfoY, iconSize, iconSize)
|
||||||
drawBoldText(ctx, data.venueName, danDaX, locationInfoY + 10, locationFontSize, '#000000')
|
drawBoldText(ctx, data.venueName, danDaX, locationInfoY + 10, locationFontSize, '#000000')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user