@jx3box/jx3box-common-ui 6.9.3 → 6.9.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 +1 -1
- package/src/author/UserPop.vue +17 -16
package/package.json
CHANGED
package/src/author/UserPop.vue
CHANGED
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
<slot></slot>
|
|
11
11
|
</div>
|
|
12
12
|
<div class="u-input">
|
|
13
|
-
<el-input v-model.trim.lazy="search" placeholder="请输入用户 UID 或者昵称进行搜索"
|
|
13
|
+
<el-input v-model.trim.lazy="search" placeholder="请输入用户 UID 或者昵称进行搜索" @keydown.enter.native="onSearch">
|
|
14
|
+
<el-button slot="append" icon="el-icon-search" @click="onSearch"></el-button>
|
|
15
|
+
</el-input>
|
|
14
16
|
</div>
|
|
15
17
|
<div class="u-preview">
|
|
16
18
|
<img class="u-avatar" :src="showAvatar(userdata.user_avatar)" />
|
|
@@ -26,7 +28,6 @@
|
|
|
26
28
|
<script>
|
|
27
29
|
import { showAvatar } from "@jx3box/jx3box-common/js/utils";
|
|
28
30
|
import { getUserInfoByUidOrName } from "../../service/author";
|
|
29
|
-
import { debounce } from "lodash";
|
|
30
31
|
export default {
|
|
31
32
|
name: "userpop",
|
|
32
33
|
props: ["title", "show"],
|
|
@@ -46,20 +47,6 @@ export default {
|
|
|
46
47
|
event: "switchUserPop",
|
|
47
48
|
},
|
|
48
49
|
watch: {
|
|
49
|
-
search: debounce(function (newval) {
|
|
50
|
-
getUserInfoByUidOrName({ search: newval }).then((data) => {
|
|
51
|
-
if (data) {
|
|
52
|
-
this.status = true;
|
|
53
|
-
this.userdata = data;
|
|
54
|
-
} else {
|
|
55
|
-
this.status = false;
|
|
56
|
-
this.userdata = {
|
|
57
|
-
name: "",
|
|
58
|
-
avatar: "",
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}, 300),
|
|
63
50
|
show: function (newval) {
|
|
64
51
|
this.visible = newval;
|
|
65
52
|
},
|
|
@@ -81,6 +68,20 @@ export default {
|
|
|
81
68
|
showAvatar: function (val) {
|
|
82
69
|
return showAvatar(val, "l");
|
|
83
70
|
},
|
|
71
|
+
onSearch() {
|
|
72
|
+
getUserInfoByUidOrName({ search: this.search }).then((data) => {
|
|
73
|
+
if (data) {
|
|
74
|
+
this.status = true;
|
|
75
|
+
this.userdata = data;
|
|
76
|
+
} else {
|
|
77
|
+
this.status = false;
|
|
78
|
+
this.userdata = {
|
|
79
|
+
name: "",
|
|
80
|
+
avatar: "",
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
84
85
|
},
|
|
85
86
|
mounted: function () {},
|
|
86
87
|
components: {},
|