updata
This commit is contained in:
parent
3dc8986586
commit
1ebb461fbe
|
|
@ -858,7 +858,32 @@ function getTransferRecordAmount(item) {
|
|||
return getTransferRecordSymbol(item) + numberText;
|
||||
}
|
||||
|
||||
function extractTransferTitleFeeValue(item) {
|
||||
const titleText = String(pickFirstValue(item, ["title", "name"]) || "").trim();
|
||||
|
||||
if (!titleText) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (/^-?\d+(?:\.\d+)?$/.test(titleText)) {
|
||||
return titleText;
|
||||
}
|
||||
|
||||
const titleFeeMatch = titleText.match(
|
||||
/手续费(?:\s*[::]?\s*|\s*[((]\s*)(-?\d+(?:\.\d+)?)\s*[))]?/,
|
||||
);
|
||||
|
||||
return titleFeeMatch && titleFeeMatch[1] !== undefined
|
||||
? titleFeeMatch[1]
|
||||
: "";
|
||||
}
|
||||
|
||||
function getTransferRecordFee(item) {
|
||||
const titleFeeValue = extractTransferTitleFeeValue(item);
|
||||
if (titleFeeValue !== "") {
|
||||
return toNumber(titleFeeValue);
|
||||
}
|
||||
|
||||
if (
|
||||
item &&
|
||||
item.fee !== undefined &&
|
||||
|
|
@ -877,18 +902,10 @@ function getTransferRecordFeeText(item) {
|
|||
const feeText = formatHomeNumber(getTransferRecordFee(item), 2);
|
||||
|
||||
if (percent > 0) {
|
||||
return (
|
||||
"手续费 " +
|
||||
feeText +
|
||||
" " +
|
||||
unit +
|
||||
" (" +
|
||||
formatTransferRecordNumber(percent) +
|
||||
"%)"
|
||||
);
|
||||
return "手续费: " + feeText;
|
||||
}
|
||||
|
||||
return "手续费 " + feeText + " " + unit;
|
||||
return "手续费: " + feeText + " " + unit;
|
||||
}
|
||||
|
||||
function getTransferRecordBalance(item) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<view class="asset-shell" :style="{ '--asset-shell-side-width': sideWidth }">
|
||||
<view class="asset-shell" :style="shellStyle">
|
||||
<view class="asset-shell__nav">
|
||||
<view class="asset-shell__side">
|
||||
<view v-if="backable" class="asset-shell__back" @click="handleBack">
|
||||
|
|
@ -10,7 +10,9 @@
|
|||
></image>
|
||||
</view>
|
||||
</view>
|
||||
<text class="asset-shell__title">{{ title }}</text>
|
||||
<view class="asset-shell__title">
|
||||
<text class="asset-shell__title-text">{{ title }}</text>
|
||||
</view>
|
||||
<view class="asset-shell__side asset-shell__side--right">
|
||||
<slot name="right">
|
||||
<text
|
||||
|
|
@ -49,10 +51,76 @@ export default {
|
|||
default: "120rpx",
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
navLayout: {
|
||||
paddingTop: "calc(env(safe-area-inset-top) + 20rpx)",
|
||||
navHeight: "64rpx",
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
shellStyle() {
|
||||
return {
|
||||
"--asset-shell-side-width": this.sideWidth,
|
||||
"--asset-shell-padding-top": this.navLayout.paddingTop,
|
||||
"--asset-shell-nav-height": this.navLayout.navHeight,
|
||||
};
|
||||
},
|
||||
},
|
||||
created() {
|
||||
refreshCurrentWebviewToken();
|
||||
this.initNavLayout();
|
||||
},
|
||||
methods: {
|
||||
initNavLayout() {
|
||||
const fallbackLayout = {
|
||||
paddingTop: "calc(env(safe-area-inset-top) + 20rpx)",
|
||||
navHeight: "64rpx",
|
||||
};
|
||||
|
||||
try {
|
||||
if (
|
||||
typeof uni !== "undefined" &&
|
||||
typeof uni.getMenuButtonBoundingClientRect === "function"
|
||||
) {
|
||||
const menuButtonRect = uni.getMenuButtonBoundingClientRect();
|
||||
|
||||
if (
|
||||
menuButtonRect &&
|
||||
Number(menuButtonRect.top) > 0 &&
|
||||
Number(menuButtonRect.height) > 0
|
||||
) {
|
||||
const menuButtonHeight = Number(menuButtonRect.height);
|
||||
this.navLayout = {
|
||||
paddingTop: Number(menuButtonRect.top) + "px",
|
||||
navHeight: Math.max(menuButtonHeight + 8, 36) + "px",
|
||||
};
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
typeof uni !== "undefined" &&
|
||||
typeof uni.getSystemInfoSync === "function"
|
||||
) {
|
||||
const systemInfo = uni.getSystemInfoSync() || {};
|
||||
const statusBarHeight = Number(systemInfo.statusBarHeight || 0);
|
||||
|
||||
if (statusBarHeight > 0) {
|
||||
this.navLayout = {
|
||||
paddingTop: statusBarHeight + 12 + "px",
|
||||
navHeight: "64rpx",
|
||||
};
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
// Ignore runtime layout failures and keep fallback spacing.
|
||||
}
|
||||
|
||||
this.navLayout = fallbackLayout;
|
||||
},
|
||||
handleBack() {
|
||||
if (getCurrentPages().length > 1) {
|
||||
uni.navigateBack();
|
||||
|
|
@ -74,48 +142,59 @@ export default {
|
|||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 20;
|
||||
padding: calc(env(safe-area-inset-top) + 20rpx) 14rpx 20rpx;
|
||||
padding: var(--asset-shell-padding-top) 18rpx 24rpx;
|
||||
background: #191e32;
|
||||
}
|
||||
|
||||
.asset-shell__nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 48rpx;
|
||||
align-items: flex-end;
|
||||
min-height: calc(var(--asset-shell-nav-height) + 12rpx);
|
||||
padding-bottom: 6rpx;
|
||||
}
|
||||
|
||||
.asset-shell__side {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-items: flex-end;
|
||||
width: var(--asset-shell-side-width);
|
||||
flex: 0 0 var(--asset-shell-side-width);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.asset-shell__side--right {
|
||||
align-items: flex-end;
|
||||
justify-content: flex-end;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
|
||||
.asset-shell__back {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
|
||||
.asset-shell__back-image {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
}
|
||||
|
||||
.asset-shell__title {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.asset-shell__title-text {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
font-weight: 500;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
|
|
|
|||
|
|
@ -63,10 +63,11 @@
|
|||
<view
|
||||
class="transfer-record-card__row transfer-record-card__row--middle"
|
||||
>
|
||||
<text class="transfer-record-card__balance asset-number-font">{{
|
||||
<text class="transfer-record-card__balance ">{{
|
||||
item.balanceLabel || item.balance
|
||||
}}</text>
|
||||
<text class="transfer-record-card__fee asset-number-font">{{
|
||||
|
||||
<text class="transfer-record-card__fee">{{
|
||||
item.feeDisplayText || item.feeText
|
||||
}}</text>
|
||||
</view>
|
||||
|
|
@ -74,7 +75,7 @@
|
|||
<view
|
||||
class="transfer-record-card__row transfer-record-card__row--bottom"
|
||||
>
|
||||
<text class="transfer-record-card__time asset-number-font">{{ item.time }}</text>
|
||||
<text class="transfer-record-card__time">{{ item.time }}</text>
|
||||
<text
|
||||
class="transfer-record-card__direction"
|
||||
:class="
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@
|
|||
}}</text>
|
||||
积分 兑换
|
||||
<text class="points-confirm__number asset-number-font">{{
|
||||
displaySelectedTotal
|
||||
displayTransferPointEstimate
|
||||
}}</text>
|
||||
可用积分吗?
|
||||
</text>
|
||||
|
|
@ -536,10 +536,9 @@ export default {
|
|||
title: "转换成功",
|
||||
icon: "none",
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 400);
|
||||
this.selectedIds = [];
|
||||
this.resetPagingState();
|
||||
this.loadPage(false, 1);
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: error.message || "转换失败",
|
||||
|
|
|
|||
Loading…
Reference in New Issue