| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <template id="happiness-member-card-preview">
- <div class="happiness-member-card-main" :style="[boxStyle]">
- <div class="happiness-member-card-preview-box" flex>
- <!--占位元素-->
- <div class="avatar-box">
- <el-image class="" src="/resources/img/common/default-avatar.png">
- </el-image>
- </div>
- <div class="member-info">
- <div class="nickname" flex="cross:center">
- <div class="info-name" :style="{color: computedStyle.nicknameColor}">会员昵称</div>
- <!-- <div class="info-level" :style="{color: computedStyle.levelColor,background:computedStyle.levelBgColor}">-->
- <!-- 普通会员-->
- <!-- </div>-->
- </div>
- <div class="desc-info">
- <div class="desc-item">
- <div class="desc-item-title" :style="{color: computedStyle.descColor}">养老金:</div>
- <div class="desc-item-content" :style="{color: computedStyle.btnColor}">0.00</div>
- </div>
- <div class="desc-item">
- <div class="desc-item-title" :style="{color: computedStyle.descColor}">余额:</div>
- <div class="desc-item-content" :style="{color: computedStyle.btnColor}">0.00</div>
- </div>
- <div class="desc-item">
- <div class="desc-item-title" :style="{color: computedStyle.descColor}">积分:</div>
- <div class="desc-item-content" :style="{color: computedStyle.btnColor}">0.00</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- /**
- * @descriptions
- * 1. 组件名字必须对应模板形式 - 递归组件name
- * 2. 样式内容方法尽量内部维护 - 前端方便通用
- * 3. 父级组件会传预览数据 - activeItem
- */
- Vue.component('happiness-member-card-preview', {
- name: "happiness-member-card-preview",
- props: {
- activeItem: {
- type: Object,
- default () {
- return {}
- }
- }
- },
- template: '#happiness-member-card-preview',
- computed: {
- computedStyle() {
- return this.activeItem.computedStyle
- },
- boxStyle() {
- let sizeObj = this.computedStyle.sizeObj || {}
- let radius = this.computedStyle.searchIpts || {}
- let style = {
- background: this.computedStyle.background,
- marginTop: `${sizeObj.marginTop}`,
- marginLeft: `${sizeObj.aroundMargin}`,
- marginRight: `${sizeObj.aroundMargin}`,
- marginBottom: `${sizeObj.marginBottom}`,
- borderRadius: `${radius['border-top-left-radius']} ${radius['border-top-right-radius']} ${radius['border-bottom-right-radius']} ${radius['border-bottom-left-radius']}`
- }
- if (sizeObj.posTop != '0px') {
- style.marginTop = `-${sizeObj.posTop}`
- }
- return style
- }
- },
- data() {
- return {}
- }
- });
- </script>
- <style>
- .happiness-member-card-main {
- position: relative;
- z-index: 1;
- }
- .happiness-member-card-preview-box {
- padding: 12px 12px 12px;
- border-radius: 4px;
- display: flex;
- flex-direction: row;
- align-items: center;
- }
- .member-info {
- flex: 1;
- }
- .nickname {
- font-size: 14px;
- max-width: 275px;
- line-height: 20px;
- margin-bottom: 9px;
- font-weight: 700;
- }
- .nickname .info-name {
- margin-right: 10px;
- }
- .nickname .info-level {
- font-size: 13px;
- border-radius: 20px;
- padding: 0 5px;
- }
- .avatar-box {
- width: 60px;
- height: 60px;
- margin-right: 12px;
- }
- .desc-info {
- font-size: 13px;
- display: flex;
- flex-direction: row;
- }
- .desc-info .desc-item {
- display: flex;
- flex-direction: row;
- width: 33%;
- }
- .desc-item-title {
- color: #AAAAAA;
- }
- .desc-item-content {
- color: #333333;
- }
- </style>
|