updata
This commit is contained in:
parent
3dc8986586
commit
1ebb461fbe
|
|
@ -858,7 +858,32 @@ function getTransferRecordAmount(item) {
|
||||||
return getTransferRecordSymbol(item) + numberText;
|
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) {
|
function getTransferRecordFee(item) {
|
||||||
|
const titleFeeValue = extractTransferTitleFeeValue(item);
|
||||||
|
if (titleFeeValue !== "") {
|
||||||
|
return toNumber(titleFeeValue);
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
item &&
|
item &&
|
||||||
item.fee !== undefined &&
|
item.fee !== undefined &&
|
||||||
|
|
@ -877,18 +902,10 @@ function getTransferRecordFeeText(item) {
|
||||||
const feeText = formatHomeNumber(getTransferRecordFee(item), 2);
|
const feeText = formatHomeNumber(getTransferRecordFee(item), 2);
|
||||||
|
|
||||||
if (percent > 0) {
|
if (percent > 0) {
|
||||||
return (
|
return "手续费: " + feeText;
|
||||||
"手续费 " +
|
|
||||||
feeText +
|
|
||||||
" " +
|
|
||||||
unit +
|
|
||||||
" (" +
|
|
||||||
formatTransferRecordNumber(percent) +
|
|
||||||
"%)"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return "手续费 " + feeText + " " + unit;
|
return "手续费: " + feeText + " " + unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTransferRecordBalance(item) {
|
function getTransferRecordBalance(item) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<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__nav">
|
||||||
<view class="asset-shell__side">
|
<view class="asset-shell__side">
|
||||||
<view v-if="backable" class="asset-shell__back" @click="handleBack">
|
<view v-if="backable" class="asset-shell__back" @click="handleBack">
|
||||||
|
|
@ -10,7 +10,9 @@
|
||||||
></image>
|
></image>
|
||||||
</view>
|
</view>
|
||||||
</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">
|
<view class="asset-shell__side asset-shell__side--right">
|
||||||
<slot name="right">
|
<slot name="right">
|
||||||
<text
|
<text
|
||||||
|
|
@ -49,10 +51,76 @@ export default {
|
||||||
default: "120rpx",
|
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() {
|
created() {
|
||||||
refreshCurrentWebviewToken();
|
refreshCurrentWebviewToken();
|
||||||
|
this.initNavLayout();
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
handleBack() {
|
||||||
if (getCurrentPages().length > 1) {
|
if (getCurrentPages().length > 1) {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
|
|
@ -74,48 +142,59 @@ export default {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 20;
|
z-index: 20;
|
||||||
padding: calc(env(safe-area-inset-top) + 20rpx) 14rpx 20rpx;
|
padding: var(--asset-shell-padding-top) 18rpx 24rpx;
|
||||||
background: #191e32;
|
background: #191e32;
|
||||||
}
|
}
|
||||||
|
|
||||||
.asset-shell__nav {
|
.asset-shell__nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: flex-end;
|
||||||
min-height: 48rpx;
|
min-height: calc(var(--asset-shell-nav-height) + 12rpx);
|
||||||
|
padding-bottom: 6rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.asset-shell__side {
|
.asset-shell__side {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: flex-end;
|
||||||
width: var(--asset-shell-side-width);
|
width: var(--asset-shell-side-width);
|
||||||
flex: 0 0 var(--asset-shell-side-width);
|
flex: 0 0 var(--asset-shell-side-width);
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.asset-shell__side--right {
|
.asset-shell__side--right {
|
||||||
|
align-items: flex-end;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
width: 48rpx;
|
width: 64rpx;
|
||||||
height: 48rpx;
|
height: 64rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.asset-shell__back {
|
.asset-shell__back {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: flex-end;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 48rpx;
|
width: 64rpx;
|
||||||
height: 48rpx;
|
height: 64rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.asset-shell__back-image {
|
.asset-shell__back-image {
|
||||||
width: 48rpx;
|
width: 56rpx;
|
||||||
height: 48rpx;
|
height: 56rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.asset-shell__title {
|
.asset-shell__title {
|
||||||
flex: 1;
|
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;
|
text-align: center;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-weight: 500;
|
font-weight: 600;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
||||||
|
|
@ -63,10 +63,11 @@
|
||||||
<view
|
<view
|
||||||
class="transfer-record-card__row transfer-record-card__row--middle"
|
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
|
item.balanceLabel || item.balance
|
||||||
}}</text>
|
}}</text>
|
||||||
<text class="transfer-record-card__fee asset-number-font">{{
|
|
||||||
|
<text class="transfer-record-card__fee">{{
|
||||||
item.feeDisplayText || item.feeText
|
item.feeDisplayText || item.feeText
|
||||||
}}</text>
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -74,7 +75,7 @@
|
||||||
<view
|
<view
|
||||||
class="transfer-record-card__row transfer-record-card__row--bottom"
|
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
|
<text
|
||||||
class="transfer-record-card__direction"
|
class="transfer-record-card__direction"
|
||||||
:class="
|
:class="
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@
|
||||||
}}</text>
|
}}</text>
|
||||||
积分 兑换
|
积分 兑换
|
||||||
<text class="points-confirm__number asset-number-font">{{
|
<text class="points-confirm__number asset-number-font">{{
|
||||||
displaySelectedTotal
|
displayTransferPointEstimate
|
||||||
}}</text>
|
}}</text>
|
||||||
可用积分吗?
|
可用积分吗?
|
||||||
</text>
|
</text>
|
||||||
|
|
@ -536,10 +536,9 @@ export default {
|
||||||
title: "转换成功",
|
title: "转换成功",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
|
this.selectedIds = [];
|
||||||
setTimeout(() => {
|
this.resetPagingState();
|
||||||
uni.navigateBack();
|
this.loadPage(false, 1);
|
||||||
}, 400);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: error.message || "转换失败",
|
title: error.message || "转换失败",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue