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_SHOW_KEYS = 3;
|
||||||
export const MAX_DOUBLE_KEYS = 2;
|
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[] = [
|
export const BLACK_LIST: string[] = [
|
||||||
'合约代码',
|
'合约代码',
|
||||||
'合约简称',
|
'合约简称',
|
||||||
|
|||||||
@@ -15,10 +15,6 @@ import {
|
|||||||
formatColName,
|
formatColName,
|
||||||
getUniqueContracts,
|
getUniqueContracts,
|
||||||
} from './AiPickUtils';
|
} from './AiPickUtils';
|
||||||
import {
|
|
||||||
EMPTY_IMAGE_DARK,
|
|
||||||
EMPTY_IMAGE_LIGHT,
|
|
||||||
} from './AiPickConstant';
|
|
||||||
import { AllCardsCard } from '../node/model/AiDiagnosisNodeModel';
|
import { AllCardsCard } from '../node/model/AiDiagnosisNodeModel';
|
||||||
import { RouterUtil } from '../util/RouterUtil';
|
import { RouterUtil } from '../util/RouterUtil';
|
||||||
import { getResourceString } from '../util/ResourceUtil';
|
import { getResourceString } from '../util/ResourceUtil';
|
||||||
@@ -287,15 +283,20 @@ export struct AiPickNodeComponent {
|
|||||||
|
|
||||||
// 跳转 AI 策略定制首页。
|
// 跳转 AI 策略定制首页。
|
||||||
private jumpToNewHome(): void {
|
private jumpToNewHome(): void {
|
||||||
const pageUrl: string =
|
const pageUrl: string = getResourceString(
|
||||||
'https://fupage.10jqka.com.cn/ai-web/ai-diagnosis-home.html?sync=1';
|
getContext(this),
|
||||||
|
$r('app.string.ai_pick_home_url'),
|
||||||
|
);
|
||||||
RouterUtil.jumpPage(this.buildClientUrl(pageUrl), true);
|
RouterUtil.jumpPage(this.buildClientUrl(pageUrl), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 跳转策略详情页。
|
// 跳转策略详情页。
|
||||||
private jumpToStrategyDetail(strategy: PickStrategy): void {
|
private jumpToStrategyDetail(strategy: PickStrategy): void {
|
||||||
const pageUrl: string =
|
const baseUrl: string = getResourceString(
|
||||||
'https://fupage.10jqka.com.cn/ai-web/ai-diagnosis-detail.html' +
|
getContext(this),
|
||||||
|
$r('app.string.ai_pick_strategy_detail_url'),
|
||||||
|
);
|
||||||
|
const pageUrl: string = baseUrl +
|
||||||
`?id=${strategy.id}&type=${strategy.periodType}` +
|
`?id=${strategy.id}&type=${strategy.periodType}` +
|
||||||
`&name=${encodeURIComponent(strategy.name)}`;
|
`&name=${encodeURIComponent(strategy.name)}`;
|
||||||
RouterUtil.jumpPage(this.buildClientUrl(pageUrl), true);
|
RouterUtil.jumpPage(this.buildClientUrl(pageUrl), true);
|
||||||
@@ -303,8 +304,11 @@ export struct AiPickNodeComponent {
|
|||||||
|
|
||||||
// 跳转策略标签页。
|
// 跳转策略标签页。
|
||||||
private jumpToLabel(strategy: PickStrategy, label: string): void {
|
private jumpToLabel(strategy: PickStrategy, label: string): void {
|
||||||
const pageUrl: string =
|
const baseUrl: string = getResourceString(
|
||||||
'https://fupage.10jqka.com.cn/ai-web/ai-diagnosis-label.html' +
|
getContext(this),
|
||||||
|
$r('app.string.ai_pick_strategy_label_url'),
|
||||||
|
);
|
||||||
|
const pageUrl: string = baseUrl +
|
||||||
`?id=${strategy.id}&type=${strategy.periodType}` +
|
`?id=${strategy.id}&type=${strategy.periodType}` +
|
||||||
`&label=${encodeURIComponent(label)}`;
|
`&label=${encodeURIComponent(label)}`;
|
||||||
RouterUtil.jumpPage(this.buildClientUrl(pageUrl), true);
|
RouterUtil.jumpPage(this.buildClientUrl(pageUrl), true);
|
||||||
@@ -751,7 +755,9 @@ export struct AiPickNodeComponent {
|
|||||||
buildEmptyState() {
|
buildEmptyState() {
|
||||||
Column() {
|
Column() {
|
||||||
if (this.dataReady) {
|
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)
|
.width(120)
|
||||||
.height(120)
|
.height(120)
|
||||||
.margin({ bottom: 8 })
|
.margin({ bottom: 8 })
|
||||||
@@ -773,7 +779,9 @@ export struct AiPickNodeComponent {
|
|||||||
@Builder
|
@Builder
|
||||||
buildNoContractState() {
|
buildNoContractState() {
|
||||||
Column() {
|
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)
|
.width(100)
|
||||||
.height(100)
|
.height(100)
|
||||||
Text($r('app.string.ai_pick_no_contract'))
|
Text($r('app.string.ai_pick_no_contract'))
|
||||||
|
|||||||
@@ -47,6 +47,26 @@
|
|||||||
{
|
{
|
||||||
"name": "market_ranking_recommend_url_test",
|
"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"
|
"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