refactor(ai-pick): 同步地址资源与末行分隔线
This commit is contained in:
@@ -27,11 +27,6 @@ export const INFO_IMAGE_LIGHT =
|
|||||||
'https://u.thsi.cn/imgsrc/bbs/e1e9b6d81b9f4f6fa817cbeb71e98ff1.png';
|
'https://u.thsi.cn/imgsrc/bbs/e1e9b6d81b9f4f6fa817cbeb71e98ff1.png';
|
||||||
export const INFO_IMAGE_DARK =
|
export const INFO_IMAGE_DARK =
|
||||||
'https://u.thsi.cn/imgsrc/bbs/19f7f20bcf800ec2b8e9fc0fa0d73369.png';
|
'https://u.thsi.cn/imgsrc/bbs/19f7f20bcf800ec2b8e9fc0fa0d73369.png';
|
||||||
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';
|
|
||||||
|
|
||||||
// 字段黑名单:过滤 field_list 中不应展示的字段
|
// 字段黑名单:过滤 field_list 中不应展示的字段
|
||||||
export const BLACK_LIST: string[] = [
|
export const BLACK_LIST: string[] = [
|
||||||
'合约代码',
|
'合约代码',
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ import {
|
|||||||
EventListener,
|
EventListener,
|
||||||
} from '../common/EventEmitter';
|
} from '../common/EventEmitter';
|
||||||
import {
|
import {
|
||||||
EMPTY_IMAGE_DARK,
|
|
||||||
EMPTY_IMAGE_LIGHT,
|
|
||||||
INFO_IMAGE_DARK,
|
INFO_IMAGE_DARK,
|
||||||
INFO_IMAGE_LIGHT,
|
INFO_IMAGE_LIGHT,
|
||||||
RIGHT_ARROW_DARK,
|
RIGHT_ARROW_DARK,
|
||||||
@@ -43,6 +41,10 @@ export struct AiPickNodeComponent {
|
|||||||
|
|
||||||
// Tab 状态及滚动区域
|
// Tab 状态及滚动区域
|
||||||
@State tabIdx: number = 0;
|
@State tabIdx: number = 0;
|
||||||
|
|
||||||
|
private getUrl(resource: Resource): string {
|
||||||
|
return getContext(this).resourceManager.getStringSync(resource);
|
||||||
|
}
|
||||||
@State tabViewportWidth: number = 0;
|
@State tabViewportWidth: number = 0;
|
||||||
@State tabContentWidth: number = 0;
|
@State tabContentWidth: number = 0;
|
||||||
@State tabScrollOffset: number = 0;
|
@State tabScrollOffset: number = 0;
|
||||||
@@ -192,7 +194,7 @@ export struct AiPickNodeComponent {
|
|||||||
// 跳转到一句话定制策略主页。
|
// 跳转到一句话定制策略主页。
|
||||||
// todo: 后续跳转为真实的客户端页面。
|
// todo: 后续跳转为真实的客户端页面。
|
||||||
private jumpToNewHome(): void {
|
private jumpToNewHome(): void {
|
||||||
const pageUrl = 'https://fupage.10jqka.com.cn/ai-web/ai-diagnosis-home.html?sync=1';
|
const pageUrl: string = this.getUrl($r('app.string.ai_pick_home_url'));
|
||||||
const clientUrl =
|
const clientUrl =
|
||||||
`client://client.html?action=ymtz^ishiddenbar=1^mode=new^webid=2804^url=${pageUrl}^title=AI选期`;
|
`client://client.html?action=ymtz^ishiddenbar=1^mode=new^webid=2804^url=${pageUrl}^title=AI选期`;
|
||||||
console.info(`[AiPick] home url: ${clientUrl}`);
|
console.info(`[AiPick] home url: ${clientUrl}`);
|
||||||
@@ -209,7 +211,7 @@ export struct AiPickNodeComponent {
|
|||||||
// 跳转到策略详情页。
|
// 跳转到策略详情页。
|
||||||
// todo: 后续跳转为真实的客户端页面。
|
// todo: 后续跳转为真实的客户端页面。
|
||||||
private jumpToStrategyDetail(strategy: PickStrategy): void {
|
private jumpToStrategyDetail(strategy: PickStrategy): void {
|
||||||
const pageUrl = 'https://fupage.10jqka.com.cn/ai-web/ai-diagnosis-detail.html' +
|
const pageUrl: string = this.getUrl($r('app.string.ai_pick_strategy_detail_url')) +
|
||||||
`?id=${strategy.id}&type=${strategy.periodType}&name=${encodeURIComponent(strategy.name)}`;
|
`?id=${strategy.id}&type=${strategy.periodType}&name=${encodeURIComponent(strategy.name)}`;
|
||||||
const clientUrl =
|
const clientUrl =
|
||||||
`client://client.html?action=ymtz^ishiddenbar=1^mode=new^webid=2804^url=${pageUrl}^title=AI选期`;
|
`client://client.html?action=ymtz^ishiddenbar=1^mode=new^webid=2804^url=${pageUrl}^title=AI选期`;
|
||||||
@@ -230,7 +232,7 @@ export struct AiPickNodeComponent {
|
|||||||
// 跳转到策略标签页。
|
// 跳转到策略标签页。
|
||||||
// todo: 后续跳转为真实的客户端页面。
|
// todo: 后续跳转为真实的客户端页面。
|
||||||
private jumpToLabel(strategy: PickStrategy, label: string): void {
|
private jumpToLabel(strategy: PickStrategy, label: string): void {
|
||||||
const pageUrl = 'https://fupage.10jqka.com.cn/ai-web/ai-diagnosis-label.html' +
|
const pageUrl: string = this.getUrl($r('app.string.ai_pick_strategy_label_url')) +
|
||||||
`?id=${strategy.id}&type=${strategy.periodType}&label=${encodeURIComponent(label)}`;
|
`?id=${strategy.id}&type=${strategy.periodType}&label=${encodeURIComponent(label)}`;
|
||||||
const clientUrl =
|
const clientUrl =
|
||||||
`client://client.html?action=ymtz^ishiddenbar=1^mode=new^webid=2804^url=${pageUrl}^title=AI选期`;
|
`client://client.html?action=ymtz^ishiddenbar=1^mode=new^webid=2804^url=${pageUrl}^title=AI选期`;
|
||||||
@@ -540,7 +542,7 @@ export struct AiPickNodeComponent {
|
|||||||
// ── 合约列表 ────────────────────────────────────────
|
// ── 合约列表 ────────────────────────────────────────
|
||||||
ForEach(
|
ForEach(
|
||||||
this.cardData.tabs[this.tabIdx].items,
|
this.cardData.tabs[this.tabIdx].items,
|
||||||
(item: PickContractItem, index: number) => {
|
(item: PickContractItem) => {
|
||||||
Row({ space: 8 }) {
|
Row({ space: 8 }) {
|
||||||
Row({ space: 5 }) {
|
Row({ space: 5 }) {
|
||||||
Text(item.name)
|
Text(item.name)
|
||||||
@@ -599,13 +601,7 @@ export struct AiPickNodeComponent {
|
|||||||
.width('100%')
|
.width('100%')
|
||||||
.height(45)
|
.height(45)
|
||||||
.alignItems(VerticalAlign.Center)
|
.alignItems(VerticalAlign.Center)
|
||||||
.border({
|
.border({ width: { top: 1 }, color: $r('app.color.divider_color') })
|
||||||
width: {
|
|
||||||
top: 1,
|
|
||||||
bottom: index === this.cardData.tabs[this.tabIdx].items.length - 1 ? 1 : 0,
|
|
||||||
},
|
|
||||||
color: $r('app.color.divider_color'),
|
|
||||||
})
|
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
this.jumpToDetail(item);
|
this.jumpToDetail(item);
|
||||||
})
|
})
|
||||||
@@ -614,6 +610,11 @@ export struct AiPickNodeComponent {
|
|||||||
(item: PickContractItem) =>
|
(item: PickContractItem) =>
|
||||||
`${item.contract}_${item.market}_${item.price ?? ''}_${item.priceChg ?? ''}`,
|
`${item.contract}_${item.market}_${item.price ?? ''}_${item.priceChg ?? ''}`,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Divider()
|
||||||
|
.width('100%')
|
||||||
|
.strokeWidth(1)
|
||||||
|
.color($r('app.color.divider_color'))
|
||||||
}
|
}
|
||||||
.width('100%')
|
.width('100%')
|
||||||
}
|
}
|
||||||
@@ -643,7 +644,9 @@ export struct AiPickNodeComponent {
|
|||||||
@Builder
|
@Builder
|
||||||
EmptyState(message: ResourceStr) {
|
EmptyState(message: ResourceStr) {
|
||||||
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(message)
|
Text(message)
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"string": [
|
||||||
|
{
|
||||||
|
"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