feat: NTRP测试入口接入
This commit is contained in:
@@ -24,11 +24,11 @@ import {
|
||||
GameManagePopup,
|
||||
Comments,
|
||||
} from "@/components";
|
||||
import {
|
||||
EvaluateType,
|
||||
SceneType,
|
||||
DisplayConditionType,
|
||||
} from "@/components/NTRPEvaluatePopup";
|
||||
// import {
|
||||
// EvaluateType,
|
||||
// SceneType,
|
||||
// DisplayConditionType,
|
||||
// } from "@/components/NTRPEvaluatePopup";
|
||||
import DetailService, {
|
||||
MATCH_STATUS,
|
||||
IsSubstituteSupported,
|
||||
@@ -36,7 +36,9 @@ import DetailService, {
|
||||
import * as LoginService from "@/services/loginService";
|
||||
import OrderService from "@/services/orderService";
|
||||
import { getCurrentLocation, calculateDistance } from "@/utils/locationUtils";
|
||||
// import { getCurrentFullPath } from "@/utils";
|
||||
import { useUserInfo, useUserActions } from "@/store/userStore";
|
||||
import { EvaluateCallback, EvaluateScene } from "@/store/evaluateStore";
|
||||
import img from "@/config/images";
|
||||
import styles from "./style.module.scss";
|
||||
import "./index.scss";
|
||||
@@ -280,7 +282,9 @@ function StickyButton(props) {
|
||||
getCommentCount,
|
||||
} = props;
|
||||
const [commentCount, setCommentCount] = useState(0);
|
||||
const ntrpRef = useRef(null);
|
||||
const ntrpRef = useRef<{
|
||||
show: (evaluateCallback: EvaluateCallback) => void;
|
||||
}>({ show: () => {} });
|
||||
const {
|
||||
id,
|
||||
price,
|
||||
@@ -294,8 +298,22 @@ function StickyButton(props) {
|
||||
const gameManageRef = useRef();
|
||||
|
||||
function handleSelfEvaluate() {
|
||||
// TODO: 打开自评弹窗
|
||||
ntrpRef?.current?.show();
|
||||
ntrpRef?.current?.show({
|
||||
type: EvaluateScene.detail,
|
||||
next: (flag) => {
|
||||
if (flag) {
|
||||
Taro.navigateTo({
|
||||
url: `/order_pages/orderDetail/index?gameId=${id}`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
Taro.redirectTo({ url: `/order_pages/orderDetail/index?gameId=${id}` });
|
||||
},
|
||||
onCancel: () => {
|
||||
// Taro.redirectTo({ url: `/game_pages/detail/index?id=${id}` });
|
||||
Taro.navigateBack();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
@@ -313,8 +331,8 @@ function StickyButton(props) {
|
||||
return;
|
||||
}
|
||||
const displayPrice = is_organizer ? 0 : price;
|
||||
user_action_status.can_assess = true;
|
||||
user_action_status.can_join = false;
|
||||
// user_action_status.can_assess = true;
|
||||
// user_action_status.can_join = false;
|
||||
// console.log(user_action_status, "user_action");
|
||||
const {
|
||||
can_assess,
|
||||
@@ -385,17 +403,7 @@ function StickyButton(props) {
|
||||
};
|
||||
} else if (can_assess) {
|
||||
return {
|
||||
text: () => (
|
||||
<NTRPEvaluatePopup
|
||||
ref={ntrpRef}
|
||||
types={[EvaluateType.EDIT, EvaluateType.EVALUATE]}
|
||||
scene={SceneType.DETAIL}
|
||||
displayCondition={DisplayConditionType.AUTO}
|
||||
showGuide={false}
|
||||
>
|
||||
<Text>¥{displayPrice} 立即加入</Text>
|
||||
</NTRPEvaluatePopup>
|
||||
),
|
||||
text: () => <Text>¥{displayPrice} 立即加入</Text>,
|
||||
action: handleSelfEvaluate,
|
||||
};
|
||||
}
|
||||
@@ -477,6 +485,7 @@ function StickyButton(props) {
|
||||
</View>
|
||||
</View>
|
||||
<GameManagePopup ref={gameManageRef} />
|
||||
<NTRPEvaluatePopup type={EvaluateScene.detail} ref={ntrpRef} showGuide />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user