Compare commits
3 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
85656c48b8 | |
|
|
202e510bb0 | |
|
|
fc6e864a4a |
|
|
@ -0,0 +1,270 @@
|
||||||
|
<template>
|
||||||
|
<view v-if="visible" class="popup-mask" @touchmove.stop.prevent="noop">
|
||||||
|
<view class="popup-mask__backdrop" @click="handleMaskClick"></view>
|
||||||
|
<view class="popup-panel" :class="['popup-panel--' + status, panelClass]">
|
||||||
|
<view class="popup-panel__head">
|
||||||
|
<text class="popup-panel__title">{{ title }}</text>
|
||||||
|
<view v-if="showClose" class="popup-panel__close" @click="$emit('cancel')">
|
||||||
|
<image class="popup-panel__close-image" src="https://imgs.agrimedia.cn/bm-bmt/bmt-close.png" mode="aspectFit">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view v-if="showStatusBlock" class="popup-panel__status">
|
||||||
|
<image class="popup-panel__status-image" :src="statusIcon" mode="aspectFit"></image>
|
||||||
|
<text v-if="message" class="popup-panel__status-text asset-number-font">{{
|
||||||
|
message
|
||||||
|
}}</text>
|
||||||
|
</view>
|
||||||
|
<text v-else-if="message" class="popup-panel__message asset-number-font">{{
|
||||||
|
message
|
||||||
|
}}</text>
|
||||||
|
|
||||||
|
<text v-if="description" class="popup-panel__description asset-number-font">{{
|
||||||
|
description
|
||||||
|
}}</text>
|
||||||
|
|
||||||
|
<view v-if="$slots.default" class="popup-panel__body">
|
||||||
|
<slot />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="popup-panel__footer" :class="{ 'popup-panel__footer--single': !showCancel }">
|
||||||
|
<view v-if="showCancel" class="popup-panel__btn popup-panel__btn--ghost" style="height: 64rpx"
|
||||||
|
@click="$emit('cancel')">
|
||||||
|
{{ cancelText }}
|
||||||
|
</view>
|
||||||
|
<view class="popup-panel__btn popup-panel__btn--primary" style="height: 64rpx" @click="$emit('confirm')">
|
||||||
|
{{ confirmText }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: "提示",
|
||||||
|
},
|
||||||
|
message: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
confirmText: {
|
||||||
|
type: String,
|
||||||
|
default: "确认",
|
||||||
|
},
|
||||||
|
cancelText: {
|
||||||
|
type: String,
|
||||||
|
default: "取消",
|
||||||
|
},
|
||||||
|
showCancel: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
showClose: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
closeOnMask: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
status: {
|
||||||
|
type: String,
|
||||||
|
default: "default",
|
||||||
|
},
|
||||||
|
panelClass: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
showStatusBlock() {
|
||||||
|
return this.status === "success" || this.status === "error";
|
||||||
|
},
|
||||||
|
statusIcon() {
|
||||||
|
if (this.status === "success") {
|
||||||
|
return "https://imgs.agrimedia.cn/bm-bmt/success.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.status === "error") {
|
||||||
|
return "https://imgs.agrimedia.cn/bm-bmt/fail.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
noop() { },
|
||||||
|
handleMaskClick() {
|
||||||
|
if (this.closeOnMask) {
|
||||||
|
this.$emit("cancel");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "../../styles/tokens.scss";
|
||||||
|
|
||||||
|
.popup-mask {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 80;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-mask__backdrop {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
inset: 0;
|
||||||
|
background: rgba(5, 10, 22, 0.72);
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600rpx;
|
||||||
|
padding: 30rpx 28rpx 32rpx;
|
||||||
|
border-radius: 28rpx;
|
||||||
|
border: 1px solid rgba(142, 157, 206, 0.14);
|
||||||
|
background: #2a2f4d;
|
||||||
|
box-shadow: 0 30rpx 70rpx rgba(0, 0, 0, 0.28);
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__head {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
min-height: 44rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__title {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 56rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__close {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 44rpx;
|
||||||
|
height: 44rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__close-image {
|
||||||
|
width: 28rpx;
|
||||||
|
height: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__message {
|
||||||
|
display: block;
|
||||||
|
margin-top: 34rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 1.8;
|
||||||
|
color: #edf2ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__status {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 46rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__status-image {
|
||||||
|
width: 54rpx;
|
||||||
|
height: 54rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__status-text {
|
||||||
|
margin-left: 18rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #edf2ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__description {
|
||||||
|
display: block;
|
||||||
|
margin-top: 34rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
line-height: 1.7;
|
||||||
|
text-align: center;
|
||||||
|
color: rgba(201, 209, 233, 0.86);
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__body {
|
||||||
|
margin-top: 22rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__footer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 18rpx;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__footer--single {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex: 1;
|
||||||
|
height: 64rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__footer--single .popup-panel__btn {
|
||||||
|
flex: 0 0 232rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__btn--ghost {
|
||||||
|
border: 1px solid rgba(157, 173, 221, 0.44);
|
||||||
|
background: rgba(77, 89, 129, 0.28);
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-panel__btn--primary {
|
||||||
|
background: #02ABF1;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "白马交易所",
|
"name" : "白马交易所",
|
||||||
"appid" : "__UNI__3EC3CC8",
|
"appid" : "__UNI__B250220",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
"versionCode" : "100",
|
"versionCode" : "100",
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,7 @@
|
||||||
<view class="hero-card__content">
|
<view class="hero-card__content">
|
||||||
<view class="hero-card__coin-row">
|
<view class="hero-card__coin-row">
|
||||||
<view class="hero-card__coin">
|
<view class="hero-card__coin">
|
||||||
<image
|
<image class="hero-card__coin-image" :src="pageIcon('bmt')" mode="aspectFit"></image>
|
||||||
class="hero-card__coin-image"
|
|
||||||
:src="pageIcon('bmt')"
|
|
||||||
mode="aspectFit"
|
|
||||||
></image>
|
|
||||||
</view>
|
</view>
|
||||||
<text class="hero-card__coin-text">BMT</text>
|
<text class="hero-card__coin-text">BMT</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -23,11 +19,7 @@
|
||||||
<view class="panel-card info-card">
|
<view class="panel-card info-card">
|
||||||
<view class="info-row">
|
<view class="info-row">
|
||||||
<view class="info-row__left">
|
<view class="info-row__left">
|
||||||
<image
|
<image class="info-row__icon" :src="pageIcon('voucher')" mode="aspectFit"></image>
|
||||||
class="info-row__icon"
|
|
||||||
:src="pageIcon('voucher')"
|
|
||||||
mode="aspectFit"
|
|
||||||
></image>
|
|
||||||
<text class="info-row__label">我的算力</text>
|
<text class="info-row__label">我的算力</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="info-row__value asset-number-font">{{ displayVoucher }}</text>
|
<text class="info-row__value asset-number-font">{{ displayVoucher }}</text>
|
||||||
|
|
@ -35,11 +27,7 @@
|
||||||
|
|
||||||
<view class="info-row">
|
<view class="info-row">
|
||||||
<view class="info-row__left">
|
<view class="info-row__left">
|
||||||
<image
|
<image class="info-row__icon" :src="pageIcon('coupon')" mode="aspectFit"></image>
|
||||||
class="info-row__icon"
|
|
||||||
:src="pageIcon('coupon')"
|
|
||||||
mode="aspectFit"
|
|
||||||
></image>
|
|
||||||
<text class="info-row__label">可用积分</text>
|
<text class="info-row__label">可用积分</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="info-row__value asset-number-font">{{ displayCoupon }}</text>
|
<text class="info-row__value asset-number-font">{{ displayCoupon }}</text>
|
||||||
|
|
@ -47,11 +35,8 @@
|
||||||
|
|
||||||
<view class="info-row info-row--last">
|
<view class="info-row info-row--last">
|
||||||
<view class="info-row__left">
|
<view class="info-row__left">
|
||||||
<image
|
<image class="info-row__icon" src="https://imgs.agrimedia.cn/bm-bmt/b.png" mode="aspectFit">
|
||||||
class="info-row__icon"
|
</image>
|
||||||
src="https://imgs.agrimedia.cn/bm-bmt/b.png"
|
|
||||||
mode="aspectFit"
|
|
||||||
></image>
|
|
||||||
<text class="info-row__label">BMT实时价格</text>
|
<text class="info-row__label">BMT实时价格</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-row__price">
|
<view class="info-row__price">
|
||||||
|
|
@ -69,22 +54,14 @@
|
||||||
|
|
||||||
<view class="panel-card form-card">
|
<view class="panel-card form-card">
|
||||||
<view class="form-card__title">
|
<view class="form-card__title">
|
||||||
<image
|
<image class="form-card__title-icon" src="https://imgs.agrimedia.cn/bm-bmt/b.png" mode="aspectFit">
|
||||||
class="form-card__title-icon"
|
</image>
|
||||||
src="https://imgs.agrimedia.cn/bm-bmt/b.png"
|
|
||||||
mode="aspectFit"
|
|
||||||
></image>
|
|
||||||
<text class="form-card__title-text">BMT兑换</text>
|
<text class="form-card__title-text">BMT兑换</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-input">
|
<view class="form-input">
|
||||||
<decimal-input
|
<decimal-input v-model="form.points" class="form-input__field asset-number-font" :digit="0"
|
||||||
v-model="form.points"
|
placeholder="请输入积分数量" placeholder-style="color: rgba(177, 187, 214, 0.42);" />
|
||||||
class="form-input__field asset-number-font"
|
|
||||||
:digit="0"
|
|
||||||
placeholder="请输入积分数量"
|
|
||||||
placeholder-style="color: rgba(177, 187, 214, 0.42);"
|
|
||||||
/>
|
|
||||||
<text class="form-input__suffix">可用积分</text>
|
<text class="form-input__suffix">可用积分</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
@ -97,9 +74,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="preview-card__row">
|
<view class="preview-card__row">
|
||||||
<view class="preview-card__left">
|
<view class="preview-card__left">
|
||||||
<text class="preview-card__label" style="color: #fff"
|
<text class="preview-card__label" style="color: #fff">消耗算力</text>
|
||||||
>消耗算力</text
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
<text class="preview-card__value preview-card__value--light asset-number-font">{{
|
<text class="preview-card__value preview-card__value--light asset-number-font">{{
|
||||||
powerCost
|
powerCost
|
||||||
|
|
@ -109,11 +84,7 @@
|
||||||
|
|
||||||
<view class="tips-block">
|
<view class="tips-block">
|
||||||
<text class="tips-block__title">兑换说明:</text>
|
<text class="tips-block__title">兑换说明:</text>
|
||||||
<view
|
<view v-for="(tip, index) in normalizedTips" :key="tip" class="tips-block__item">
|
||||||
v-for="(tip, index) in normalizedTips"
|
|
||||||
:key="tip"
|
|
||||||
class="tips-block__item"
|
|
||||||
>
|
|
||||||
<text class="tips-block__index asset-number-font">{{ index + 1 }}.</text>
|
<text class="tips-block__index asset-number-font">{{ index + 1 }}.</text>
|
||||||
<text class="tips-block__text asset-number-font">{{ tip }}</text>
|
<text class="tips-block__text asset-number-font">{{ tip }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -121,26 +92,15 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="action-wrap">
|
<view class="action-wrap">
|
||||||
<view
|
<view class="action-button" @touchend.stop.prevent="openConfirm" @tap.stop="openConfirm"
|
||||||
class="action-button"
|
@click.stop="openConfirm">确认兑换</view>
|
||||||
@touchend.stop.prevent="openConfirm"
|
|
||||||
@tap.stop="openConfirm"
|
|
||||||
@click.stop="openConfirm"
|
|
||||||
>确认兑换</view
|
|
||||||
>
|
|
||||||
<view class="action-link" @click="openLedger">兑换记录</view>
|
<view class="action-link" @click="openLedger">兑换记录</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<asset-confirm-popup
|
<confirm-popup :visible="confirmVisible" title="兑换提示" :message="
|
||||||
:visible="confirmVisible"
|
|
||||||
title="兑换提示"
|
|
||||||
:message="
|
|
||||||
'确认使用 ' + formatAmount(pointsValue, 0) + ' 积分兑换 BMT 吗?'
|
'确认使用 ' + formatAmount(pointsValue, 0) + ' 积分兑换 BMT 吗?'
|
||||||
"
|
" @cancel="confirmVisible = false" @confirm="submit">
|
||||||
@cancel="confirmVisible = false"
|
|
||||||
@confirm="submit"
|
|
||||||
>
|
|
||||||
<view class="popup-line">
|
<view class="popup-line">
|
||||||
<text class="meta-pair__label">预估兑换BMT:</text>
|
<text class="meta-pair__label">预估兑换BMT:</text>
|
||||||
<text class="meta-pair__value asset-number-font">{{ estimateBmt }}</text>
|
<text class="meta-pair__value asset-number-font">{{ estimateBmt }}</text>
|
||||||
|
|
@ -153,12 +113,12 @@
|
||||||
<text class="meta-pair__label">消耗算力:</text>
|
<text class="meta-pair__label">消耗算力:</text>
|
||||||
<text class="meta-pair__value asset-number-font">{{ powerCost }}</text>
|
<text class="meta-pair__value asset-number-font">{{ powerCost }}</text>
|
||||||
</view>
|
</view>
|
||||||
</asset-confirm-popup>
|
</confirm-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AssetConfirmPopup from "../../components/asset-confirm-popup.vue";
|
import ConfirmPopup from "../../components/confirm-popup/confirm-popup.vue";
|
||||||
import AssetPageShell from "../../components/asset-page-shell.vue";
|
import AssetPageShell from "../../components/asset-page-shell.vue";
|
||||||
import DecimalInput from "../../components/DecimalInput/DecimalInput.vue";
|
import DecimalInput from "../../components/DecimalInput/DecimalInput.vue";
|
||||||
import {
|
import {
|
||||||
|
|
@ -168,7 +128,7 @@ import {
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
AssetConfirmPopup,
|
ConfirmPopup,
|
||||||
AssetPageShell,
|
AssetPageShell,
|
||||||
DecimalInput,
|
DecimalInput,
|
||||||
},
|
},
|
||||||
|
|
@ -297,12 +257,12 @@ export default {
|
||||||
async loadPage(showLoading) {
|
async loadPage(showLoading) {
|
||||||
try {
|
try {
|
||||||
this.detail = await fetchBmtExchangeDetail(
|
this.detail = await fetchBmtExchangeDetail(
|
||||||
showLoading
|
showLoading ?
|
||||||
? {
|
{
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
loadingText: "加载中",
|
loadingText: "加载中",
|
||||||
}
|
} :
|
||||||
: null,
|
null,
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
@ -421,8 +381,7 @@ export default {
|
||||||
min-height: 240rpx;
|
min-height: 240rpx;
|
||||||
padding: 24rpx 28rpx;
|
padding: 24rpx 28rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: #20263e url("https://imgs.agrimedia.cn/bm-bmt/bmt2-header.png")
|
background: #20263e url("https://imgs.agrimedia.cn/bm-bmt/bmt2-header.png") no-repeat center top / 100% 240rpx;
|
||||||
no-repeat center top / 100% 240rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero-card__content {
|
.hero-card__content {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue