refactor(ai-pick): 统一管理页面地址资源
This commit is contained in:
@@ -4,11 +4,6 @@ export const MAX_TAGS = 3;
|
||||
export const MAX_SHOW_KEYS = 3;
|
||||
export const MAX_DOUBLE_KEYS = 2;
|
||||
|
||||
export const EMPTY_IMAGE_LIGHT =
|
||||
'https://u.thsi.cn/imgsrc/bbs/8eee9cd4fa7e359032de11a3f7c2a70b_300_230.png';
|
||||
export const EMPTY_IMAGE_DARK =
|
||||
'https://u.thsi.cn/imgsrc/bbs/1c4e679244ed87231befad2b04cddfe2_300_230.png';
|
||||
|
||||
export const BLACK_LIST: string[] = [
|
||||
'合约代码',
|
||||
'合约简称',
|
||||
|
||||
@@ -15,10 +15,6 @@ import {
|
||||
formatColName,
|
||||
getUniqueContracts,
|
||||
} from './AiPickUtils';
|
||||
import {
|
||||
EMPTY_IMAGE_DARK,
|
||||
EMPTY_IMAGE_LIGHT,
|
||||
} from './AiPickConstant';
|
||||
import { AllCardsCard } from '../node/model/AiDiagnosisNodeModel';
|
||||
import { RouterUtil } from '../util/RouterUtil';
|
||||
import { getResourceString } from '../util/ResourceUtil';
|
||||
@@ -287,15 +283,20 @@ export struct AiPickNodeComponent {
|
||||
|
||||
// 跳转 AI 策略定制首页。
|
||||
private jumpToNewHome(): void {
|
||||
const pageUrl: string =
|
||||
'https://fupage.10jqka.com.cn/ai-web/ai-diagnosis-home.html?sync=1';
|
||||
const pageUrl: string = getResourceString(
|
||||
getContext(this),
|
||||
$r('app.string.ai_pick_home_url'),
|
||||
);
|
||||
RouterUtil.jumpPage(this.buildClientUrl(pageUrl), true);
|
||||
}
|
||||
|
||||
// 跳转策略详情页。
|
||||
private jumpToStrategyDetail(strategy: PickStrategy): void {
|
||||
const pageUrl: string =
|
||||
'https://fupage.10jqka.com.cn/ai-web/ai-diagnosis-detail.html' +
|
||||
const baseUrl: string = getResourceString(
|
||||
getContext(this),
|
||||
$r('app.string.ai_pick_strategy_detail_url'),
|
||||
);
|
||||
const pageUrl: string = baseUrl +
|
||||
`?id=${strategy.id}&type=${strategy.periodType}` +
|
||||
`&name=${encodeURIComponent(strategy.name)}`;
|
||||
RouterUtil.jumpPage(this.buildClientUrl(pageUrl), true);
|
||||
@@ -303,8 +304,11 @@ export struct AiPickNodeComponent {
|
||||
|
||||
// 跳转策略标签页。
|
||||
private jumpToLabel(strategy: PickStrategy, label: string): void {
|
||||
const pageUrl: string =
|
||||
'https://fupage.10jqka.com.cn/ai-web/ai-diagnosis-label.html' +
|
||||
const baseUrl: string = getResourceString(
|
||||
getContext(this),
|
||||
$r('app.string.ai_pick_strategy_label_url'),
|
||||
);
|
||||
const pageUrl: string = baseUrl +
|
||||
`?id=${strategy.id}&type=${strategy.periodType}` +
|
||||
`&label=${encodeURIComponent(label)}`;
|
||||
RouterUtil.jumpPage(this.buildClientUrl(pageUrl), true);
|
||||
@@ -751,7 +755,9 @@ export struct AiPickNodeComponent {
|
||||
buildEmptyState() {
|
||||
Column() {
|
||||
if (this.dataReady) {
|
||||
Image(this.isDarkMode ? EMPTY_IMAGE_DARK : EMPTY_IMAGE_LIGHT)
|
||||
Image(this.isDarkMode ?
|
||||
$r('app.string.ai_pick_empty_image_dark_url') :
|
||||
$r('app.string.ai_pick_empty_image_light_url'))
|
||||
.width(120)
|
||||
.height(120)
|
||||
.margin({ bottom: 8 })
|
||||
@@ -773,7 +779,9 @@ export struct AiPickNodeComponent {
|
||||
@Builder
|
||||
buildNoContractState() {
|
||||
Column() {
|
||||
Image(this.isDarkMode ? EMPTY_IMAGE_DARK : EMPTY_IMAGE_LIGHT)
|
||||
Image(this.isDarkMode ?
|
||||
$r('app.string.ai_pick_empty_image_dark_url') :
|
||||
$r('app.string.ai_pick_empty_image_light_url'))
|
||||
.width(100)
|
||||
.height(100)
|
||||
Text($r('app.string.ai_pick_no_contract'))
|
||||
|
||||
@@ -47,6 +47,26 @@
|
||||
{
|
||||
"name": "market_ranking_recommend_url_test",
|
||||
"value": "https://futures-test.10jqka.com.cn/futgwapi/api/market/homepage/v1/recommend_futures?quote_type=%s&number=50"
|
||||
},
|
||||
{
|
||||
"name": "ai_pick_empty_image_light_url",
|
||||
"value": "https://u.thsi.cn/imgsrc/bbs/8eee9cd4fa7e359032de11a3f7c2a70b_300_230.png"
|
||||
},
|
||||
{
|
||||
"name": "ai_pick_empty_image_dark_url",
|
||||
"value": "https://u.thsi.cn/imgsrc/bbs/1c4e679244ed87231befad2b04cddfe2_300_230.png"
|
||||
},
|
||||
{
|
||||
"name": "ai_pick_home_url",
|
||||
"value": "https://fupage.10jqka.com.cn/ai-web/ai-diagnosis-home.html?sync=1"
|
||||
},
|
||||
{
|
||||
"name": "ai_pick_strategy_detail_url",
|
||||
"value": "https://fupage.10jqka.com.cn/ai-web/ai-diagnosis-detail.html"
|
||||
},
|
||||
{
|
||||
"name": "ai_pick_strategy_label_url",
|
||||
"value": "https://fupage.10jqka.com.cn/ai-web/ai-diagnosis-label.html"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user