更改了融豆图标和负数显示
This commit is contained in:
@@ -63,7 +63,10 @@
|
|||||||
<div class="balance-card">
|
<div class="balance-card">
|
||||||
<div class="balance-item">
|
<div class="balance-item">
|
||||||
<span class="balance-label">我的余额</span>
|
<span class="balance-label">我的余额</span>
|
||||||
<span class="balance-value">¥{{ accountInfo.balance }}</span>
|
<div class="balance-content">
|
||||||
|
<img src="/imgs/shop.png" alt="融豆" class="bean-image">
|
||||||
|
<div class="balance-value">{{ Math.abs(accountInfo.balance) }}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -614,4 +617,25 @@ export default {
|
|||||||
height: 178px;
|
height: 178px;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.balance-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px; /* 控制图标和数值之间的间距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.bean-image {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
flex-shrink: 0; /* 防止图片被压缩 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.balance-value {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: white;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
white-space: nowrap; /* 防止文本换行 */
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -276,13 +276,13 @@ const categories = ref([
|
|||||||
//热销商品数据
|
//热销商品数据
|
||||||
const hotProducts = ref([
|
const hotProducts = ref([
|
||||||
{ id: '6', name: '1', discount: '100', points: '9999', originalPoints:'999999' },
|
{ id: '6', name: '1', discount: '100', points: '9999', originalPoints:'999999' },
|
||||||
{ id: '10', name: '2', discount: '100', points: '9999', originalPoints:'999999' }
|
{ id: '6', name: '2', discount: '100', points: '9999', originalPoints:'999999' }
|
||||||
])
|
])
|
||||||
|
|
||||||
//秒杀推荐数据
|
//秒杀推荐数据
|
||||||
const cheapProducts = ref([
|
const cheapProducts = ref([
|
||||||
{ id: '8', name: '1', discount: '100', points: '9999', originalPoints:'999999' },
|
{ id: '6', name: '1', discount: '100', points: '9999', originalPoints:'999999' },
|
||||||
{ id: '9', name: '2', discount: '100', points: '9999', originalPoints:'999999' }
|
{ id: '6', name: '2', discount: '100', points: '9999', originalPoints:'999999' }
|
||||||
])
|
])
|
||||||
|
|
||||||
// 计算属性
|
// 计算属性
|
||||||
@@ -482,20 +482,24 @@ const truncateText = (text, maxLength) => {
|
|||||||
//获取热销推荐商品
|
//获取热销推荐商品
|
||||||
const getHotProducts = async () => {
|
const getHotProducts = async () => {
|
||||||
try {
|
try {
|
||||||
const {data} =await api.get('')
|
const {data} = await api.get('')
|
||||||
hotProducts.value=data.data.products
|
hotProducts.value = data.data.products
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
} finally {
|
||||||
|
console.log('热销:',hotProducts)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取秒杀推荐商品
|
//获取秒杀推荐商品
|
||||||
const getCheapProducts = async () => {
|
const getCheapProducts = async () => {
|
||||||
try {
|
try {
|
||||||
const {data} =await api.get('')
|
const {data} = await api.get('')
|
||||||
cheapProducts.value=data.data.products
|
cheapProducts.value = data.data.products
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
} finally {
|
||||||
|
console.log('秒杀:',cheapProducts)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user