@jx3box/jx3box-common-ui 5.1.0 → 5.1.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": "5.1.0",
3
+ "version": "5.1.4",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/service/author.js CHANGED
@@ -4,7 +4,7 @@ import { $next, $cms, $team } from "@jx3box/jx3box-common/js/https.js";
4
4
 
5
5
  function getUserInfo(uid) {
6
6
  return $cms({ mute: true })
7
- .get(`api/cms/user/${uid}/info`)
7
+ .get(`/api/cms/user/${uid}/info`)
8
8
  .then((res) => {
9
9
  return res.data.data;
10
10
  });
package/src/App.vue CHANGED
@@ -24,6 +24,8 @@
24
24
 
25
25
  <Creators :postId="28" style="margin-bottom:10px"/>
26
26
  <Collection :id="59" :defaultVisible="true"/>
27
+ <UserPop title="添加用户" v-model="visible" @confirm="addUser"/>
28
+ <el-button @click="visible = true">用户POP</el-button>
27
29
 
28
30
  <Thx :postId="23865" postType="bbs" :userId="7" :adminBoxcoinEnable="true" :userBoxcoinEnable="true"/>
29
31
 
@@ -94,6 +96,7 @@ import Breadcrumb from "./Breadcrumb.vue";
94
96
  import LeftSidebar from "./LeftSidebar.vue";
95
97
  import LeftSideToggle from "./LeftSideToggle.vue";
96
98
  import Author from "./Author.vue";
99
+ import UserPop from "./author/UserPop.vue";
97
100
 
98
101
  import Main from "./Main.vue";
99
102
  import RightSidebar from "./RightSidebar.vue";
@@ -170,12 +173,15 @@ export default {
170
173
  WikiPanel,
171
174
  WikiRevisions,
172
175
  WikiComments,
176
+
177
+ UserPop
173
178
  },
174
179
  data: function() {
175
180
  return {
176
181
  author: "",
177
182
  wikiPost: null,
178
- tag : ''
183
+ tag : '',
184
+ visible : false,
179
185
  };
180
186
  },
181
187
  created: function() {
@@ -186,6 +192,10 @@ export default {
186
192
  }
187
193
  );
188
194
  },
189
- methods: {},
195
+ methods: {
196
+ addUser : function (val){
197
+ console.log(val)
198
+ }
199
+ },
190
200
  };
191
201
  </script>
@@ -0,0 +1,124 @@
1
+ <template>
2
+ <el-dialog
3
+ class="w-userpop"
4
+ :title="title"
5
+ :visible.sync="visible"
6
+ :close-on-click-modal="false"
7
+ :close-on-press-escape="false"
8
+ >
9
+ <div class="u-tip">
10
+ <slot></slot>
11
+ </div>
12
+ <div class="u-input">
13
+ <el-input v-model.number="uid" placeholder="请输入UID(数字)"></el-input>
14
+ </div>
15
+ <div class="u-preview">
16
+ <img class="u-avatar" :src="userdata.user_avatar | showAvatar" />
17
+ <span class="u-name">{{ userdata.display_name || "-" }}</span>
18
+ </div>
19
+ <span slot="footer" class="dialog-footer">
20
+ <el-button @click="visible = false">取 消</el-button>
21
+ <el-button type="primary" @click="confirm">确 定</el-button>
22
+ </span>
23
+ </el-dialog>
24
+ </template>
25
+
26
+ <script>
27
+ import { showAvatar } from "@jx3box/jx3box-common/js/utils";
28
+ import { getUserInfo } from "../../service/author";
29
+ export default {
30
+ name: "userpop",
31
+ props: ["title", "show"],
32
+ data: function () {
33
+ return {
34
+ visible: false,
35
+ uid: "",
36
+ userdata: {
37
+ name: "",
38
+ avatar: "",
39
+ },
40
+ status: false,
41
+ };
42
+ },
43
+ model: {
44
+ prop: "show",
45
+ event: "switchUserPop",
46
+ },
47
+ watch: {
48
+ uid: function (newval) {
49
+ getUserInfo(newval).then((data) => {
50
+ if (data) {
51
+ this.status = true;
52
+ this.userdata = data;
53
+ } else {
54
+ this.status = false;
55
+ this.userdata = {
56
+ name: "",
57
+ avatar: "",
58
+ };
59
+ }
60
+ });
61
+ },
62
+ show: function (newval) {
63
+ this.visible = newval;
64
+ },
65
+ visible: function (newval) {
66
+ this.$emit("switchUserPop", newval);
67
+ },
68
+ },
69
+ filters: {
70
+ showAvatar: function (val) {
71
+ return showAvatar(val, "l");
72
+ },
73
+ },
74
+ computed: {},
75
+ methods: {
76
+ confirm: function () {
77
+ if (this.status) {
78
+ this.visible = false;
79
+ this.$emit("confirm", this.userdata);
80
+ } else {
81
+ this.$alert("用户不存在 或 UID不正确", "提醒", {
82
+ confirmButtonText: "确定",
83
+ });
84
+ }
85
+ },
86
+ },
87
+ mounted: function () {},
88
+ components: {},
89
+ };
90
+ </script>
91
+
92
+ <style lang="less">
93
+ .w-userpop {
94
+ .fz(1rem, 2.5);
95
+ .el-dialog {
96
+ min-width: 520px;
97
+ }
98
+ .el-dialog__body {
99
+ padding: 0 20px;
100
+ }
101
+ .u-avatar {
102
+ .mt(20px);
103
+ .size(120px);
104
+ .db;
105
+ .auto(x);
106
+ border: 1px solid #eee;
107
+ padding: 5px;
108
+ }
109
+ .u-name {
110
+ .bold;
111
+ .x;
112
+ .db;
113
+ }
114
+ .u-tip {
115
+ .fz(13px);
116
+ }
117
+ }
118
+
119
+ @media screen and (max-width: @phone) {
120
+ .w-userpop .el-dialog {
121
+ .w(100%) !important;
122
+ }
123
+ }
124
+ </style>
@@ -173,7 +173,7 @@ export default {
173
173
  methods: {
174
174
  // 消息
175
175
  checkMSG: function () {
176
- getMsg().then((res) => {
176
+ this.isLogin && getMsg().then((res) => {
177
177
  this.pop = !!res.data.data.unread;
178
178
  });
179
179
  },
@@ -57,6 +57,9 @@ export default {
57
57
  !!~~val && this.loadData();
58
58
  },
59
59
  },
60
+ defaultVisible : function (val){
61
+ this.visible = val
62
+ }
60
63
  },
61
64
  methods: {
62
65
  handleShow: function () {
@@ -18,10 +18,11 @@
18
18
  :key="i"
19
19
  :href="item.post_author_info.ID | authorLink"
20
20
  target="_blank"
21
+ v-show="item.status"
21
22
  >
22
23
  <img class="u-avatar" :src="item.post_author_info.user_avatar | showAvatar" />
23
24
  <span class="u-name">{{item.post_author_info.display_name}}</span>
24
- <i class="u-label">{{item.label}}</i>
25
+ <i class="u-label">{{item.label | formatLabel}}</i>
25
26
  </a>
26
27
  </div>
27
28
  <a class="w-creators-edit" :href="editLink" v-if="isCreator">
@@ -91,6 +92,9 @@ export default {
91
92
  return showAvatar(val, 48);
92
93
  },
93
94
  authorLink,
95
+ formatLabel : function (str){
96
+ return str && str.slice(0,8)
97
+ }
94
98
  },
95
99
  created: function () {},
96
100
  mounted: function () {},
@@ -114,7 +118,7 @@ export default {
114
118
  .lt(0);
115
119
  writing-mode: vertical-rl;
116
120
  .fz(12px);
117
- background: #49c10f;
121
+ background: @primary;
118
122
  color: #fff;
119
123
  .h(100%);
120
124
  .x;