diff --git a/src/views/index.vue b/src/views/index.vue index 60eed3e..140bb57 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -10,8 +10,8 @@ - 帐户余额:¥{{ userBalance }} - 本月消费:¥{{ userBalanceMonth }} + 帐户余额:¥{{ NumFilter(userBalance) }} + 本月消费:¥{{ NumFilter(userBalanceMonth) }} 帐户等级:1 @@ -22,24 +22,34 @@ 服务信息 - -
- + +
+ +
-
- +
+ + +
-
- +
+ +
- +
@@ -52,12 +62,12 @@ @@ -71,6 +81,7 @@ import { getCertIndex } from '@/api/cert/index' import { ref } from 'vue'; +const { proxy } = getCurrentInstance(); const modelList = ref([]); const serverUrl = ref(""); const serverUrl2 = ref(""); @@ -89,6 +100,32 @@ function getIndex() { }) } +function handleCopy(id){ + // 获取需要复制的元素以及元素内的文本内容 + const text = id; + // 添加一个input元素放置需要的文本内容 + const input = document.createElement("input"); + input.value = text; + document.body.appendChild(input); + // 选中并复制文本到剪切板 + input.select(); + document.execCommand("copy"); + // 移除input元素 + document.body.removeChild(input); + proxy.$modal.msgSuccess("复制成功"); +} + +function NumFilter (value) { + // 截取当前数据到小数点后两位 + let realVal = parseFloat(value).toFixed(2) + return realVal +} +function NumFilter4 (value) { + // 截取当前数据到小数点后两位 + let realVal = parseFloat(value).toFixed(4) + return realVal +} + getIndex()