@jx3box/jx3box-common-ui 6.9.5 → 6.9.7
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 +1 -1
- package/src/author/Avatar.vue +72 -59
- package/src/author/UserPop.vue +55 -25
package/package.json
CHANGED
package/src/author/Avatar.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<a class="c-avatar" :href="authorLink(uid)" :class="size">
|
|
3
|
-
<img :src="showAvatar(url)" class="c-avatar-pic"/>
|
|
3
|
+
<img :src="showAvatar(url)" class="c-avatar-pic" />
|
|
4
4
|
<i class="c-avatar-frame" v-if="frame">
|
|
5
5
|
<img :src="frameUrl" />
|
|
6
6
|
</i>
|
|
@@ -26,33 +26,33 @@ export default {
|
|
|
26
26
|
type: String,
|
|
27
27
|
default: "",
|
|
28
28
|
},
|
|
29
|
-
size
|
|
30
|
-
type
|
|
31
|
-
default
|
|
32
|
-
}
|
|
29
|
+
size: {
|
|
30
|
+
type: [Number, String],
|
|
31
|
+
default: "m",
|
|
32
|
+
},
|
|
33
33
|
},
|
|
34
34
|
components: {},
|
|
35
|
-
data: function() {
|
|
35
|
+
data: function () {
|
|
36
36
|
return {
|
|
37
37
|
frames: [],
|
|
38
|
-
styles
|
|
39
|
-
xxs
|
|
40
|
-
xs
|
|
41
|
-
s
|
|
42
|
-
m
|
|
43
|
-
l
|
|
44
|
-
xl
|
|
45
|
-
}
|
|
38
|
+
styles: {
|
|
39
|
+
xxs: 36,
|
|
40
|
+
xs: 48,
|
|
41
|
+
s: 68,
|
|
42
|
+
m: 88,
|
|
43
|
+
l: 120,
|
|
44
|
+
xl: 150,
|
|
45
|
+
},
|
|
46
46
|
};
|
|
47
47
|
},
|
|
48
48
|
computed: {
|
|
49
|
-
frameUrl: function() {
|
|
49
|
+
frameUrl: function () {
|
|
50
50
|
return __imgPath + `avatar/images/${this.frame}/${this.frame}.svg`;
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
53
|
methods: {
|
|
54
|
-
showAvatar: function(val) {
|
|
55
|
-
return showAvatar(val, this.styles[this.size]*3);
|
|
54
|
+
showAvatar: function (val) {
|
|
55
|
+
return showAvatar(val, this.styles[this.size] * 3);
|
|
56
56
|
},
|
|
57
57
|
authorLink,
|
|
58
58
|
},
|
|
@@ -65,72 +65,84 @@ export default {
|
|
|
65
65
|
.dbi;
|
|
66
66
|
background-color: #ffffff;
|
|
67
67
|
.r(100%);
|
|
68
|
-
&.xl{
|
|
69
|
-
@pic:150px;
|
|
70
|
-
@frame:210px;
|
|
71
|
-
.c-avatar-pic{
|
|
72
|
-
|
|
68
|
+
&.xl {
|
|
69
|
+
@pic: 150px;
|
|
70
|
+
@frame: 210px;
|
|
71
|
+
.c-avatar-pic {
|
|
72
|
+
.size(@pic);
|
|
73
|
+
}
|
|
74
|
+
.c-avatar-frame {
|
|
73
75
|
.size(@frame);
|
|
74
76
|
.lt(@pic / 2);
|
|
75
|
-
margin-left
|
|
76
|
-
margin-top
|
|
77
|
+
margin-left: -@frame / 2;
|
|
78
|
+
margin-top: -@frame / 2;
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
|
-
&.l{
|
|
80
|
-
@pic:120px;
|
|
81
|
-
@frame:168px;
|
|
82
|
-
.c-avatar-pic{
|
|
83
|
-
|
|
81
|
+
&.l {
|
|
82
|
+
@pic: 120px;
|
|
83
|
+
@frame: 168px;
|
|
84
|
+
.c-avatar-pic {
|
|
85
|
+
.size(@pic);
|
|
86
|
+
}
|
|
87
|
+
.c-avatar-frame {
|
|
84
88
|
.size(@frame);
|
|
85
89
|
.lt(@pic / 2);
|
|
86
|
-
margin-left
|
|
87
|
-
margin-top
|
|
90
|
+
margin-left: -@frame / 2;
|
|
91
|
+
margin-top: -@frame / 2;
|
|
88
92
|
}
|
|
89
93
|
}
|
|
90
94
|
|
|
91
|
-
&.m{
|
|
92
|
-
@pic:88px;
|
|
93
|
-
@frame:123px;
|
|
94
|
-
.c-avatar-pic{
|
|
95
|
-
|
|
95
|
+
&.m {
|
|
96
|
+
@pic: 88px;
|
|
97
|
+
@frame: 123px;
|
|
98
|
+
.c-avatar-pic {
|
|
99
|
+
.size(@pic);
|
|
100
|
+
}
|
|
101
|
+
.c-avatar-frame {
|
|
96
102
|
.size(@frame);
|
|
97
103
|
.lt(@pic / 2);
|
|
98
|
-
margin-left
|
|
99
|
-
margin-top
|
|
104
|
+
margin-left: -@frame / 2;
|
|
105
|
+
margin-top: -@frame / 2;
|
|
100
106
|
}
|
|
101
107
|
}
|
|
102
108
|
|
|
103
|
-
&.s{
|
|
104
|
-
@pic:68px;
|
|
105
|
-
@frame:88px;
|
|
106
|
-
.c-avatar-pic{
|
|
107
|
-
|
|
109
|
+
&.s {
|
|
110
|
+
@pic: 68px;
|
|
111
|
+
@frame: 88px;
|
|
112
|
+
.c-avatar-pic {
|
|
113
|
+
.size(@pic);
|
|
114
|
+
}
|
|
115
|
+
.c-avatar-frame {
|
|
108
116
|
.size(@frame);
|
|
109
117
|
.lt(@pic / 2);
|
|
110
|
-
margin-left
|
|
111
|
-
margin-top
|
|
118
|
+
margin-left: -@frame / 2;
|
|
119
|
+
margin-top: -@frame / 2;
|
|
112
120
|
}
|
|
113
121
|
}
|
|
114
|
-
&.xs{
|
|
115
|
-
@pic:48px;
|
|
116
|
-
@frame:68px;
|
|
117
|
-
.c-avatar-pic{
|
|
118
|
-
|
|
122
|
+
&.xs {
|
|
123
|
+
@pic: 48px;
|
|
124
|
+
@frame: 68px;
|
|
125
|
+
.c-avatar-pic {
|
|
126
|
+
.size(@pic);
|
|
127
|
+
}
|
|
128
|
+
.c-avatar-frame {
|
|
119
129
|
.size(@frame);
|
|
120
130
|
.lt(@pic / 2);
|
|
121
|
-
margin-left
|
|
122
|
-
margin-top
|
|
131
|
+
margin-left: -@frame / 2;
|
|
132
|
+
margin-top: -@frame / 2;
|
|
123
133
|
}
|
|
124
134
|
}
|
|
125
|
-
&.xxs{
|
|
126
|
-
@pic:36px;
|
|
127
|
-
@frame:48px;
|
|
128
|
-
.c-avatar-pic{
|
|
129
|
-
|
|
135
|
+
&.xxs {
|
|
136
|
+
@pic: 36px;
|
|
137
|
+
@frame: 48px;
|
|
138
|
+
.c-avatar-pic {
|
|
139
|
+
.size(@pic);
|
|
140
|
+
}
|
|
141
|
+
.c-avatar-frame {
|
|
130
142
|
.size(@frame);
|
|
131
143
|
.lt(@pic / 2);
|
|
132
|
-
margin-left
|
|
133
|
-
margin-top
|
|
144
|
+
margin-left: -@frame / 2;
|
|
145
|
+
margin-top: -@frame / 2;
|
|
134
146
|
}
|
|
135
147
|
}
|
|
136
148
|
}
|
|
@@ -138,6 +150,7 @@ export default {
|
|
|
138
150
|
.db;
|
|
139
151
|
.full;
|
|
140
152
|
.r(100%);
|
|
153
|
+
object-fit: cover;
|
|
141
154
|
}
|
|
142
155
|
.c-avatar-frame {
|
|
143
156
|
.pa;
|
package/src/author/UserPop.vue
CHANGED
|
@@ -10,18 +10,29 @@
|
|
|
10
10
|
<slot></slot>
|
|
11
11
|
</div>
|
|
12
12
|
<div class="u-input">
|
|
13
|
-
<el-input
|
|
13
|
+
<el-input
|
|
14
|
+
v-model.trim.lazy="search"
|
|
15
|
+
placeholder="请输入用户 UID 或者昵称进行搜索"
|
|
16
|
+
@keydown.enter.native="onSearch"
|
|
17
|
+
>
|
|
14
18
|
<i slot="prepend" class="el-icon-search"></i>
|
|
15
19
|
</el-input>
|
|
16
|
-
<el-button class="u-search-btn" type="primary" @click="onSearch">搜索</el-button>
|
|
20
|
+
<el-button class="u-search-btn" type="primary" @click="onSearch" :disabled="!search">搜索</el-button>
|
|
17
21
|
</div>
|
|
18
22
|
<div class="u-preview" v-loading="loading">
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</
|
|
23
|
+
<template v-if="searched && status">
|
|
24
|
+
<a class="u-author" :href="'/author/' + userdata.ID" target="_blank">
|
|
25
|
+
<img class="u-avatar" :src="showAvatar(userdata.user_avatar)" />
|
|
26
|
+
<span class="u-name">{{ userdata.display_name || "-" }}</span>
|
|
27
|
+
</a>
|
|
28
|
+
</template>
|
|
29
|
+
<template v-else>
|
|
30
|
+
<img class="u-avatar" :src="showAvatar('')" />
|
|
31
|
+
<span class="u-name">-</span>
|
|
32
|
+
<div class="u-empty">
|
|
33
|
+
<i class="el-icon-warning-outline"></i>{{ searched ? "未找到匹配项" : "请输入搜索条件" }}
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
25
36
|
</div>
|
|
26
37
|
<div slot="footer" class="dialog-footer">
|
|
27
38
|
<el-button @click="cancel">取 消</el-button>
|
|
@@ -40,7 +51,9 @@ export default {
|
|
|
40
51
|
return {
|
|
41
52
|
visible: false,
|
|
42
53
|
search: "",
|
|
54
|
+
searched: false,
|
|
43
55
|
userdata: {
|
|
56
|
+
ID: "",
|
|
44
57
|
name: "",
|
|
45
58
|
avatar: "",
|
|
46
59
|
},
|
|
@@ -79,25 +92,29 @@ export default {
|
|
|
79
92
|
this.userdata = {
|
|
80
93
|
name: "",
|
|
81
94
|
avatar: "",
|
|
82
|
-
}
|
|
95
|
+
};
|
|
83
96
|
this.status = true;
|
|
84
|
-
return
|
|
97
|
+
return;
|
|
85
98
|
}
|
|
86
99
|
this.loading = true;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
this.searched = false;
|
|
101
|
+
getUserInfoByUidOrName({ search: this.search })
|
|
102
|
+
.then((data) => {
|
|
103
|
+
if (data) {
|
|
104
|
+
this.status = true;
|
|
105
|
+
this.userdata = data;
|
|
106
|
+
} else {
|
|
107
|
+
this.status = false;
|
|
108
|
+
this.userdata = {
|
|
109
|
+
name: "",
|
|
110
|
+
avatar: "",
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
.finally(() => {
|
|
115
|
+
this.loading = false;
|
|
116
|
+
this.searched = true;
|
|
117
|
+
});
|
|
101
118
|
},
|
|
102
119
|
cancel() {
|
|
103
120
|
this.visible = false;
|
|
@@ -107,7 +124,7 @@ export default {
|
|
|
107
124
|
avatar: "",
|
|
108
125
|
};
|
|
109
126
|
this.status = true;
|
|
110
|
-
}
|
|
127
|
+
},
|
|
111
128
|
},
|
|
112
129
|
mounted: function () {},
|
|
113
130
|
components: {},
|
|
@@ -136,6 +153,19 @@ export default {
|
|
|
136
153
|
.x;
|
|
137
154
|
.db;
|
|
138
155
|
}
|
|
156
|
+
.u-author {
|
|
157
|
+
.db;
|
|
158
|
+
max-width: 280px;
|
|
159
|
+
.auto(x);
|
|
160
|
+
&:hover {
|
|
161
|
+
.u-avatar {
|
|
162
|
+
border-color: #ff71b8;
|
|
163
|
+
}
|
|
164
|
+
.u-name {
|
|
165
|
+
color: #ff71b8;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
139
169
|
.u-tip {
|
|
140
170
|
.fz(13px);
|
|
141
171
|
}
|