@jx3box/jx3box-common-ui 6.9.4 → 6.9.5
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/UserPop.vue +48 -10
package/package.json
CHANGED
package/src/author/UserPop.vue
CHANGED
|
@@ -11,17 +11,22 @@
|
|
|
11
11
|
</div>
|
|
12
12
|
<div class="u-input">
|
|
13
13
|
<el-input v-model.trim.lazy="search" placeholder="请输入用户 UID 或者昵称进行搜索" @keydown.enter.native="onSearch">
|
|
14
|
-
<
|
|
14
|
+
<i slot="prepend" class="el-icon-search"></i>
|
|
15
15
|
</el-input>
|
|
16
|
+
<el-button class="u-search-btn" type="primary" @click="onSearch">搜索</el-button>
|
|
16
17
|
</div>
|
|
17
|
-
<div class="u-preview">
|
|
18
|
+
<div class="u-preview" v-loading="loading">
|
|
18
19
|
<img class="u-avatar" :src="showAvatar(userdata.user_avatar)" />
|
|
19
20
|
<span class="u-name">{{ userdata.display_name || "-" }}</span>
|
|
21
|
+
|
|
22
|
+
<div class="u-empty" v-if="!status">
|
|
23
|
+
<i class="el-icon-warning-outline"></i>未找到匹配项
|
|
24
|
+
</div>
|
|
20
25
|
</div>
|
|
21
|
-
<
|
|
22
|
-
<el-button @click="
|
|
26
|
+
<div slot="footer" class="dialog-footer">
|
|
27
|
+
<el-button @click="cancel">取 消</el-button>
|
|
23
28
|
<el-button type="primary" @click="confirm">确 定</el-button>
|
|
24
|
-
</
|
|
29
|
+
</div>
|
|
25
30
|
</el-dialog>
|
|
26
31
|
</template>
|
|
27
32
|
|
|
@@ -39,7 +44,8 @@ export default {
|
|
|
39
44
|
name: "",
|
|
40
45
|
avatar: "",
|
|
41
46
|
},
|
|
42
|
-
status:
|
|
47
|
+
status: true,
|
|
48
|
+
loading: false,
|
|
43
49
|
};
|
|
44
50
|
},
|
|
45
51
|
model: {
|
|
@@ -47,11 +53,11 @@ export default {
|
|
|
47
53
|
event: "switchUserPop",
|
|
48
54
|
},
|
|
49
55
|
watch: {
|
|
50
|
-
show: function (
|
|
51
|
-
this.visible =
|
|
56
|
+
show: function (val) {
|
|
57
|
+
this.visible = val;
|
|
52
58
|
},
|
|
53
|
-
visible: function (
|
|
54
|
-
this.$emit("switchUserPop",
|
|
59
|
+
visible: function (val) {
|
|
60
|
+
this.$emit("switchUserPop", val);
|
|
55
61
|
},
|
|
56
62
|
},
|
|
57
63
|
methods: {
|
|
@@ -69,6 +75,15 @@ export default {
|
|
|
69
75
|
return showAvatar(val, "l");
|
|
70
76
|
},
|
|
71
77
|
onSearch() {
|
|
78
|
+
if (!this.search) {
|
|
79
|
+
this.userdata = {
|
|
80
|
+
name: "",
|
|
81
|
+
avatar: "",
|
|
82
|
+
}
|
|
83
|
+
this.status = true;
|
|
84
|
+
return
|
|
85
|
+
}
|
|
86
|
+
this.loading = true;
|
|
72
87
|
getUserInfoByUidOrName({ search: this.search }).then((data) => {
|
|
73
88
|
if (data) {
|
|
74
89
|
this.status = true;
|
|
@@ -80,7 +95,18 @@ export default {
|
|
|
80
95
|
avatar: "",
|
|
81
96
|
};
|
|
82
97
|
}
|
|
98
|
+
}).finally(() => {
|
|
99
|
+
this.loading = false;
|
|
83
100
|
});
|
|
101
|
+
},
|
|
102
|
+
cancel() {
|
|
103
|
+
this.visible = false;
|
|
104
|
+
this.search = "";
|
|
105
|
+
this.userdata = {
|
|
106
|
+
name: "",
|
|
107
|
+
avatar: "",
|
|
108
|
+
};
|
|
109
|
+
this.status = true;
|
|
84
110
|
}
|
|
85
111
|
},
|
|
86
112
|
mounted: function () {},
|
|
@@ -113,6 +139,18 @@ export default {
|
|
|
113
139
|
.u-tip {
|
|
114
140
|
.fz(13px);
|
|
115
141
|
}
|
|
142
|
+
.u-input {
|
|
143
|
+
.flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
gap: 10px;
|
|
146
|
+
}
|
|
147
|
+
.u-empty {
|
|
148
|
+
color: #999;
|
|
149
|
+
.x;
|
|
150
|
+
}
|
|
151
|
+
.dialog-footer {
|
|
152
|
+
text-align: center;
|
|
153
|
+
}
|
|
116
154
|
}
|
|
117
155
|
|
|
118
156
|
@media screen and (max-width: @phone) {
|