@jx3box/jx3box-common-ui 6.4.2 → 6.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "6.4.2",
3
+ "version": "6.4.4",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="c-author-info">
3
3
  <div class="u-author">
4
- <Avatar class="u-avatar" :uid="uid" :url="data.user_avatar" :size="68" :frame="data.user_avatar_frame" />
4
+ <Avatar class="u-avatar" :uid="uid" :url="data.user_avatar" size="s" :frame="data.user_avatar_frame" />
5
5
  <div class="u-info">
6
6
  <a class="u-name" :href="authorLink(uid)" target="_blank">
7
7
  <span>{{ (data.display_name && data.display_name.slice(0, 8)) || "未知" }}</span>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <a class="c-avatar" :href="authorLink(uid)">
2
+ <a class="c-avatar" :href="authorLink(uid)" :class="size">
3
3
  <img :src="showAvatar(url)" class="c-avatar-pic"/>
4
4
  <i class="c-avatar-frame" v-if="frame">
5
5
  <img :src="frameUrl" />
@@ -28,19 +28,18 @@ export default {
28
28
  },
29
29
  size : {
30
30
  type : [Number, String],
31
- default : 88
31
+ default : 'm'
32
32
  }
33
33
  },
34
34
  components: {},
35
35
  data: function() {
36
36
  return {
37
37
  frames: [],
38
- styles : [
39
- {cls:'xs',size:60},
40
- {cls:'s',size:84},
41
- {cls:'m',size:136},
42
- {cls:'l',size:224},
43
- ]
38
+ styles : {
39
+ s : 68,
40
+ m : 88,
41
+ l : 120
42
+ }
44
43
  };
45
44
  },
46
45
  computed: {
@@ -50,7 +49,7 @@ export default {
50
49
  },
51
50
  methods: {
52
51
  showAvatar: function(val) {
53
- return showAvatar(val, this.size*3);
52
+ return showAvatar(val, this.styles[this.size]*3);
54
53
  },
55
54
  authorLink,
56
55
  },
@@ -61,6 +60,42 @@ export default {
61
60
  .c-avatar {
62
61
  .pr;
63
62
  .dbi;
63
+
64
+ &.l{
65
+ @pic:120px;
66
+ @frame:168px;
67
+ .c-avatar-pic{.size(@pic);}
68
+ .c-avatar-frame{
69
+ .size(@frame);
70
+ .lt(@pic / 2);
71
+ margin-left:-@frame / 2;
72
+ margin-top:-@frame / 2;
73
+ }
74
+ }
75
+
76
+ &.m{
77
+ @pic:88px;
78
+ @frame:123px;
79
+ .c-avatar-pic{.size(@pic);}
80
+ .c-avatar-frame{
81
+ .size(@frame);
82
+ .lt(@pic / 2);
83
+ margin-left:-@frame / 2;
84
+ margin-top:-@frame / 2;
85
+ }
86
+ }
87
+
88
+ &.s{
89
+ @pic:68px;
90
+ @frame:88px;
91
+ .c-avatar-pic{.size(@pic);}
92
+ .c-avatar-frame{
93
+ .size(@frame);
94
+ .lt(@pic / 2);
95
+ margin-left:-@frame / 2;
96
+ margin-top:-@frame / 2;
97
+ }
98
+ }
64
99
  }
65
100
  .c-avatar-pic {
66
101
  .db;
@@ -69,9 +104,6 @@ export default {
69
104
  }
70
105
  .c-avatar-frame {
71
106
  .pa;
72
- .lt(-10px);
73
- .size(100%);
74
- padding: 10px;
75
107
  box-sizing: content-box;
76
108
  img {
77
109
  .db;
@@ -79,31 +111,5 @@ export default {
79
111
  .size(100%);
80
112
  .lt(0);
81
113
  }
82
-
83
- &.xs {
84
- left: -6px;
85
- top: -6px;
86
- width: 60px;
87
- height: 60px;
88
- }
89
-
90
- &.s {
91
- left: -8px;
92
- top: -8px;
93
- width: 84px;
94
- height: 84px;
95
- }
96
- &.m {
97
- left: -8px;
98
- top: -8px;
99
- width: 136px;
100
- height: 136px;
101
- }
102
- &.l {
103
- width: 224px;
104
- height: 224px;
105
- left: -22px;
106
- top: -22px;
107
- }
108
114
  }
109
115
  </style>