|
@@ -1,6 +1,6 @@
|
|
|
<!-- 装修用户组件:用户资产 -->
|
|
|
<template>
|
|
|
- <view class="ss-wallet-menu-wrap ss-flex ss-col-center">
|
|
|
+ <view class="ss-wallet-menu-wrap ss-flex ss-col-center" :style="[style, { marginLeft: `${data.space}px` }]">
|
|
|
<view class="menu-item ss-flex-1 ss-flex-col ss-row-center ss-col-center"
|
|
|
@tap="sheep.$router.go('/pages/user/wallet/money')">
|
|
|
<view class="value-box ss-flex ss-col-bottom">
|
|
@@ -42,8 +42,34 @@
|
|
|
*/
|
|
|
import { computed } from 'vue';
|
|
|
import sheep from '@/sheep';
|
|
|
- import { fen2yuan } from '../../hooks/useGoods';
|
|
|
+ import { fen2yuan } from '../../hooks/useGoods';
|
|
|
|
|
|
+ // 接收参数
|
|
|
+ const props = defineProps({
|
|
|
+ // 装修数据
|
|
|
+ data: {
|
|
|
+ type: Object,
|
|
|
+ default: () => ({}),
|
|
|
+ },
|
|
|
+ // 装修样式
|
|
|
+ styles: {
|
|
|
+ type: Object,
|
|
|
+ default: () => ({}),
|
|
|
+ },
|
|
|
+ });
|
|
|
+ // 设置背景样式
|
|
|
+ const style = computed(() => {
|
|
|
+ // 直接从 props.styles 解构
|
|
|
+ const { bgType, bgImg, bgColor } = props.styles;
|
|
|
+
|
|
|
+ // 根据 bgType 返回相应的样式
|
|
|
+ return {
|
|
|
+ background: bgType === 'img'
|
|
|
+ ? `url(${bgImg}) no-repeat top center / 100% 100%`
|
|
|
+ : bgColor
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
const userWallet = computed(() => sheep.$store('user').userWallet);
|
|
|
const userInfo = computed(() => sheep.$store('user').userInfo);
|
|
|
const numData = computed(() => sheep.$store('user').numData);
|