mirror of
https://github.com/motajs/template.git
synced 2026-10-17 03:10:17 +08:00
chore: 微调四个 UI 的代码
This commit is contained in:
parent
109ff4b860
commit
00379e1861
@ -124,7 +124,10 @@ export const Book = defineComponent<BookProps>(props => {
|
||||
fillStyle="gold"
|
||||
/>
|
||||
{/* 怪物列表区 */}
|
||||
<Scroll noscroll loc={[LIST_LEFT, LIST_TOP, LIST_WIDTH, LIST_HEIGHT]}>
|
||||
<Scroll
|
||||
noscroll
|
||||
loc={[LIST_LEFT, LIST_TOP, LIST_WIDTH, LIST_HEIGHT]}
|
||||
>
|
||||
{enemies.value.map((view, i) => {
|
||||
const base = view.getBaseEnemy();
|
||||
const locator = ctx.getEnemyLocatorByView(view);
|
||||
|
||||
@ -47,14 +47,16 @@ export const BookDetail = defineComponent<BookDetailProps>(props => {
|
||||
/** 获取基础属性,视图取基础怪物,否则取入参本身 */
|
||||
const getBase = (): IReadonlyEnemy<IEnemyAttr> => {
|
||||
if (props.enemy instanceof EnemyView) return props.enemy.getBaseEnemy();
|
||||
return props.enemy;
|
||||
else return props.enemy as IReadonlyEnemy<IEnemyAttr>;
|
||||
};
|
||||
|
||||
/** 获取计算后属性,视图走计算接口,否则取入参本身 */
|
||||
const getComputed = (): IReadonlyEnemy<IEnemyAttr> => {
|
||||
if (props.enemy instanceof EnemyView)
|
||||
if (props.enemy instanceof EnemyView) {
|
||||
return props.enemy.getComputedEnemy();
|
||||
return props.enemy;
|
||||
} else {
|
||||
return props.enemy as IReadonlyEnemy<IEnemyAttr>;
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: 后续支持「在地图中打开指定 View 详情」时,locator 需按实际位置补全
|
||||
|
||||
@ -361,16 +361,11 @@ export const EquipBox = defineComponent<EquipBoxProps>(props => {
|
||||
<container
|
||||
loc={[RIGHT_LEFT, SLOT_TOP, RIGHT_WIDTH, SLOT_HEIGHT]}
|
||||
>
|
||||
<Scroll
|
||||
hor
|
||||
noscroll
|
||||
loc={[0, 0, RIGHT_WIDTH, SLOT_HEIGHT]}
|
||||
>
|
||||
<Scroll hor noscroll loc={[0, 0, RIGHT_WIDTH, SLOT_HEIGHT]}>
|
||||
{hero.equip.slots.map((name, i) => {
|
||||
const slotEquip = equippedList.value[i];
|
||||
const isSelected =
|
||||
!!slotEquip &&
|
||||
slotEquip.uid === selected.value;
|
||||
!!slotEquip && slotEquip.uid === selected.value;
|
||||
return (
|
||||
<container
|
||||
key={i}
|
||||
@ -511,10 +506,7 @@ export const EquipBox = defineComponent<EquipBoxProps>(props => {
|
||||
/>
|
||||
<text
|
||||
text={item.item.name}
|
||||
loc={[
|
||||
58,
|
||||
OWNED_ROW_HEIGHT / 2
|
||||
]}
|
||||
loc={[58, OWNED_ROW_HEIGHT / 2]}
|
||||
anc={[0, 0.5]}
|
||||
font={labelFont}
|
||||
fillStyle="#eeeeee"
|
||||
|
||||
@ -334,9 +334,7 @@ export const Shop = defineComponent<ShopProps>(props => {
|
||||
/>
|
||||
<text
|
||||
text={
|
||||
entry
|
||||
? core.formatBigNumber(entry.buyPrice)
|
||||
: '-'
|
||||
entry ? core.formatBigNumber(entry.buyPrice) : '-'
|
||||
}
|
||||
loc={[INFO_WIDTH - 14, 10]}
|
||||
anc={[1, 0.5]}
|
||||
@ -352,9 +350,7 @@ export const Shop = defineComponent<ShopProps>(props => {
|
||||
/>
|
||||
<text
|
||||
text={
|
||||
entry
|
||||
? core.formatBigNumber(entry.sellPrice)
|
||||
: '-'
|
||||
entry ? core.formatBigNumber(entry.sellPrice) : '-'
|
||||
}
|
||||
loc={[INFO_WIDTH - 14, 30]}
|
||||
anc={[1, 0.5]}
|
||||
@ -369,11 +365,7 @@ export const Shop = defineComponent<ShopProps>(props => {
|
||||
fillStyle="#dddddd"
|
||||
/>
|
||||
<text
|
||||
text={
|
||||
entry
|
||||
? core.formatBigNumber(entry.stock)
|
||||
: '-'
|
||||
}
|
||||
text={entry ? core.formatBigNumber(entry.stock) : '-'}
|
||||
loc={[INFO_WIDTH - 14, 50]}
|
||||
anc={[1, 0.5]}
|
||||
font={textFont}
|
||||
@ -387,11 +379,7 @@ export const Shop = defineComponent<ShopProps>(props => {
|
||||
fillStyle="#dddddd"
|
||||
/>
|
||||
<text
|
||||
text={
|
||||
entry
|
||||
? core.formatBigNumber(entry.owned)
|
||||
: '-'
|
||||
}
|
||||
text={entry ? core.formatBigNumber(entry.owned) : '-'}
|
||||
loc={[INFO_WIDTH - 14, 70]}
|
||||
anc={[1, 0.5]}
|
||||
font={textFont}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user