@jx3box/jx3box-common-ui 8.2.0 → 8.2.2
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 +3 -3
- package/service/cms.js +20 -1
- package/src/App.vue +1 -1
- package/src/header/shop.vue +83 -1
- package/src/header/vip.vue +88 -1
- package/src/wiki/WikiComments.vue +39 -69
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-common-ui",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.2",
|
|
4
4
|
"description": "JX3BOX UI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@jx3box/jx3box-comment-ui": "^1.8.7",
|
|
34
|
-
"@jx3box/jx3box-common": "^8.2.
|
|
34
|
+
"@jx3box/jx3box-common": "^8.2.4",
|
|
35
35
|
"@jx3box/jx3box-data": "^3.5.6",
|
|
36
|
-
"@jx3box/jx3box-editor": "^2.1.
|
|
36
|
+
"@jx3box/jx3box-editor": "^2.1.6",
|
|
37
37
|
"@jx3box/reporter": "^0.0.4",
|
|
38
38
|
"axios": "^0.26.1",
|
|
39
39
|
"dayjs": "^1.11.0",
|
package/service/cms.js
CHANGED
|
@@ -58,4 +58,23 @@ function getTopicBucket(params) {
|
|
|
58
58
|
return $cms().get(`/api/cms/topic/bucket`, { params });
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
// 获取config
|
|
62
|
+
function getConfig(params) {
|
|
63
|
+
return $cms().get(`/api/cms/config`, { params }).then((res) => {
|
|
64
|
+
return res.data.data;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// 获取用户meta
|
|
69
|
+
function getUserMeta(params) {
|
|
70
|
+
return $cms().get(`/api/cms/user/my/meta`, { params }).then((res) => {
|
|
71
|
+
return res.data.data;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// 设置用户meta
|
|
76
|
+
function setUserMeta(key,data) {
|
|
77
|
+
return $cms().post(`/api/cms/user/my/meta?key=${key}`, data);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { getPostAuthors, uploadImage, upload, getDecoration, getDecorationJson, checkTeamMember, getHonorJson, getSliders, getCollection, getTopicBucket, getConfig, getUserMeta, setUserMeta };
|
package/src/App.vue
CHANGED
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
<WikiRevisions type="achievement" source-id="2996" />
|
|
101
101
|
<hr />
|
|
102
102
|
|
|
103
|
-
<WikiComments type="achievement" source-id="
|
|
103
|
+
<WikiComments type="achievement" source-id="456" />
|
|
104
104
|
<hr />
|
|
105
105
|
</el-tab-pane>
|
|
106
106
|
<el-tab-pane label="头像" name="avatar">
|
package/src/header/shop.vue
CHANGED
|
@@ -2,12 +2,66 @@
|
|
|
2
2
|
<div class="c-header-panel c-header-shop">
|
|
3
3
|
<el-tooltip effect="dark" content="积分商城" placement="bottom" popper-class="c-header-tooltip">
|
|
4
4
|
<a class="u-present" href="/vip/mall">
|
|
5
|
-
<
|
|
5
|
+
<i class="u-icon u-icon-msg">
|
|
6
|
+
<i class="u-pop" style="display: none" v-show="pop"></i>
|
|
7
|
+
<img class="u-icon" svg-inline src="../../assets/img/header/gift.svg" />
|
|
8
|
+
</i>
|
|
6
9
|
</a>
|
|
7
10
|
</el-tooltip>
|
|
8
11
|
</div>
|
|
9
12
|
</template>
|
|
10
13
|
|
|
14
|
+
<script>
|
|
15
|
+
import { getConfig, getUserMeta, setUserMeta } from "../../service/cms";
|
|
16
|
+
export default {
|
|
17
|
+
name: "shop",
|
|
18
|
+
data: function () {
|
|
19
|
+
return {
|
|
20
|
+
pop: false,
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
mounted() {
|
|
24
|
+
this.init();
|
|
25
|
+
},
|
|
26
|
+
methods: {
|
|
27
|
+
async init() {
|
|
28
|
+
/**
|
|
29
|
+
* 1. 用户第一次进入页面时,没有记录,则显示,并记录到meta
|
|
30
|
+
* 2. 用户第二次进入页面,此时meta有记录,但是用户并未进入会员中心,则显示
|
|
31
|
+
*/
|
|
32
|
+
let meta = await getUserMeta({ key: "mall_pop" });
|
|
33
|
+
let config = await getConfig({ key: "mall" });
|
|
34
|
+
|
|
35
|
+
if (meta == null) {
|
|
36
|
+
const val = ~~config.val;
|
|
37
|
+
|
|
38
|
+
if (val) {
|
|
39
|
+
this.pop = true;
|
|
40
|
+
localStorage.setItem('mall_pop', config.val);
|
|
41
|
+
setUserMeta("mall_pop", { val: 1 });
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
if (meta == 1) {
|
|
45
|
+
this.pop = true;
|
|
46
|
+
|
|
47
|
+
localStorage.setItem('mall_pop', config.val);
|
|
48
|
+
} else {
|
|
49
|
+
const local = localStorage.getItem('mall_pop');
|
|
50
|
+
|
|
51
|
+
if (~~config.val > ~~local) {
|
|
52
|
+
this.pop = true;
|
|
53
|
+
|
|
54
|
+
localStorage.setItem('mall_pop', config.val);
|
|
55
|
+
|
|
56
|
+
setUserMeta("mall_pop", { val: 1 });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
11
65
|
<style lang="less">
|
|
12
66
|
.c-header-shop {
|
|
13
67
|
.u-present {
|
|
@@ -19,6 +73,34 @@
|
|
|
19
73
|
.tm(0.7);
|
|
20
74
|
}
|
|
21
75
|
}
|
|
76
|
+
|
|
77
|
+
.u-icon-msg {
|
|
78
|
+
width: 17px;
|
|
79
|
+
height: 17px;
|
|
80
|
+
display: block;
|
|
81
|
+
.pr;
|
|
82
|
+
top: 1px;
|
|
83
|
+
svg {
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 100%;
|
|
86
|
+
}
|
|
87
|
+
.pr;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.u-pop {
|
|
91
|
+
width: 10px;
|
|
92
|
+
height: 10px;
|
|
93
|
+
color: #fff;
|
|
94
|
+
background-image: linear-gradient(#54a3ff, #006eed);
|
|
95
|
+
background-clip: padding-box;
|
|
96
|
+
border: 2px solid #24292e;
|
|
97
|
+
border-radius: 50%;
|
|
98
|
+
position: absolute;
|
|
99
|
+
right: -5px;
|
|
100
|
+
top: -6px;
|
|
101
|
+
z-index: 1;
|
|
102
|
+
}
|
|
103
|
+
|
|
22
104
|
.u-icon {
|
|
23
105
|
color: #fff;
|
|
24
106
|
.size(16px);
|
package/src/header/vip.vue
CHANGED
|
@@ -2,20 +2,107 @@
|
|
|
2
2
|
<div class="c-header-panel c-header-vip" id="c-header-vip">
|
|
3
3
|
<el-tooltip effect="dark" content="会员中心" placement="bottom" popper-class="c-header-tooltip">
|
|
4
4
|
<a class="u-post u-vip" href="/vip/premium">
|
|
5
|
-
<
|
|
5
|
+
<i class="u-icon u-icon-msg">
|
|
6
|
+
<i class="u-pop" style="display: none" v-show="pop"></i>
|
|
7
|
+
<img class="u-add" svg-inline src="../../assets/img/header/vip.svg" />
|
|
8
|
+
</i>
|
|
6
9
|
</a>
|
|
7
10
|
</el-tooltip>
|
|
8
11
|
</div>
|
|
9
12
|
</template>
|
|
10
13
|
|
|
14
|
+
<script>
|
|
15
|
+
import { getConfig, getUserMeta, setUserMeta } from "../../service/cms";
|
|
16
|
+
export default {
|
|
17
|
+
name: "vip",
|
|
18
|
+
data: function () {
|
|
19
|
+
return {
|
|
20
|
+
pop: false
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
mounted() {
|
|
24
|
+
this.init();
|
|
25
|
+
},
|
|
26
|
+
methods: {
|
|
27
|
+
async init() {
|
|
28
|
+
/**
|
|
29
|
+
* 1. 用户第一次进入页面时,没有记录,则显示,并记录到meta
|
|
30
|
+
* 2. 用户第二次进入页面,此时meta有记录,但是用户并未进入会员中心,则显示
|
|
31
|
+
*/
|
|
32
|
+
let meta = await getUserMeta({ key: 'vip_pop' });
|
|
33
|
+
let config = await getConfig({ key: "vip" });
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
if (meta == null) {
|
|
37
|
+
const val = ~~config.val;
|
|
38
|
+
|
|
39
|
+
if (val) {
|
|
40
|
+
this.pop = true;
|
|
41
|
+
localStorage.setItem('vip_pop', config.val);
|
|
42
|
+
setUserMeta("vip_pop", { val: 1 });
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
if (meta == 1) {
|
|
46
|
+
this.pop = true;
|
|
47
|
+
|
|
48
|
+
localStorage.setItem('vip_pop', config.val);
|
|
49
|
+
} else {
|
|
50
|
+
const local = localStorage.getItem('vip_pop');
|
|
51
|
+
|
|
52
|
+
if (~~config.val > ~~local) {
|
|
53
|
+
this.pop = true;
|
|
54
|
+
|
|
55
|
+
localStorage.setItem('vip_pop', config.val);
|
|
56
|
+
|
|
57
|
+
setUserMeta("vip_pop", { val: 1 });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</script>
|
|
65
|
+
|
|
11
66
|
<style lang="less" scoped>
|
|
12
67
|
.c-header-vip {
|
|
13
68
|
height: 100%;
|
|
69
|
+
|
|
70
|
+
.u-icon-msg {
|
|
71
|
+
width: 17px;
|
|
72
|
+
height: 17px;
|
|
73
|
+
display: block;
|
|
74
|
+
.pr;
|
|
75
|
+
top: 1px;
|
|
76
|
+
svg {
|
|
77
|
+
width: 100%;
|
|
78
|
+
height: 100%;
|
|
79
|
+
}
|
|
80
|
+
.pr;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.u-pop {
|
|
84
|
+
width: 10px;
|
|
85
|
+
height: 10px;
|
|
86
|
+
color: #fff;
|
|
87
|
+
background-image: linear-gradient(#54a3ff, #006eed);
|
|
88
|
+
background-clip: padding-box;
|
|
89
|
+
border: 2px solid #24292e;
|
|
90
|
+
border-radius: 50%;
|
|
91
|
+
position: absolute;
|
|
92
|
+
right: -5px;
|
|
93
|
+
top: -6px;
|
|
94
|
+
z-index: 1;
|
|
95
|
+
}
|
|
14
96
|
.u-vip {
|
|
15
97
|
padding: 0 10px;
|
|
16
98
|
height: 100%;
|
|
17
99
|
.flex;
|
|
18
100
|
align-items: center;
|
|
101
|
+
|
|
102
|
+
&:hover {
|
|
103
|
+
opacity: 0.7;
|
|
104
|
+
}
|
|
105
|
+
cursor: pointer;
|
|
19
106
|
}
|
|
20
107
|
}
|
|
21
108
|
</style>
|
|
@@ -29,19 +29,12 @@
|
|
|
29
29
|
<i class="el-icon-chat-dot-round"></i>
|
|
30
30
|
<span>回复</span>
|
|
31
31
|
</h4>
|
|
32
|
-
<textarea
|
|
33
|
-
class="u-reply-content"
|
|
34
|
-
v-model="reply_form.content"
|
|
35
|
-
></textarea>
|
|
32
|
+
<textarea class="u-reply-content" v-model="reply_form.content"></textarea>
|
|
36
33
|
<div class="u-author">
|
|
37
34
|
<span>昵称:</span>
|
|
38
35
|
<input v-model="reply_form.user_nickname" type="text" />
|
|
39
36
|
</div>
|
|
40
|
-
<el-button
|
|
41
|
-
type="primary"
|
|
42
|
-
class="u-submit"
|
|
43
|
-
@click="create_comment(reply_form)"
|
|
44
|
-
>
|
|
37
|
+
<el-button type="primary" class="u-submit" @click="create_comment(reply_form)">
|
|
45
38
|
<i class="el-icon-check"></i>
|
|
46
39
|
<span>提交</span>
|
|
47
40
|
</el-button>
|
|
@@ -54,7 +47,7 @@
|
|
|
54
47
|
<script>
|
|
55
48
|
import WikiPanel from "./WikiPanel";
|
|
56
49
|
import Comment from "./WikiComment.vue";
|
|
57
|
-
import { wikiComment } from "@jx3box/jx3box-common/js/
|
|
50
|
+
import { wikiComment } from "@jx3box/jx3box-common/js/wiki_v2";
|
|
58
51
|
import User from "@jx3box/jx3box-common/js/user";
|
|
59
52
|
|
|
60
53
|
export default {
|
|
@@ -81,33 +74,25 @@ export default {
|
|
|
81
74
|
methods: {
|
|
82
75
|
get_comments() {
|
|
83
76
|
if (!this.type || !this.sourceId) return;
|
|
84
|
-
// WikiComment.list(this.type, this.sourceId, this.client)
|
|
85
77
|
this.loading = true;
|
|
86
|
-
wikiComment
|
|
87
|
-
|
|
88
|
-
(res) => {
|
|
78
|
+
wikiComment
|
|
79
|
+
.list({ type: this.type, id: this.sourceId }, { client: this.client, page: this.page })
|
|
80
|
+
.then((res) => {
|
|
89
81
|
res = res.data;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
this.page = res.data.current_page;
|
|
100
|
-
this.total = res.data.total
|
|
101
|
-
this.comments = filter(comments, 0);
|
|
102
|
-
// this.comments = comments;
|
|
103
|
-
this.loading = false;
|
|
82
|
+
let comments = res.data.list;
|
|
83
|
+
for (let i = 0; i < comments.length; i++) {
|
|
84
|
+
comments[i]["reply_form"] = {
|
|
85
|
+
show: false,
|
|
86
|
+
content: "",
|
|
87
|
+
user_nickname: User.getInfo().name,
|
|
88
|
+
};
|
|
104
89
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
this.comments =
|
|
90
|
+
this.page = res.data.page;
|
|
91
|
+
this.total = res.data.total;
|
|
92
|
+
this.comments = filter(comments, 0);
|
|
93
|
+
// this.comments = comments;
|
|
108
94
|
this.loading = false;
|
|
109
|
-
}
|
|
110
|
-
);
|
|
95
|
+
});
|
|
111
96
|
|
|
112
97
|
function filter(comments, parent) {
|
|
113
98
|
let outputs = [];
|
|
@@ -122,13 +107,13 @@ export default {
|
|
|
122
107
|
user_id: c.user_id,
|
|
123
108
|
user_nickname: c.user_nickname,
|
|
124
109
|
id: c.id,
|
|
125
|
-
}
|
|
110
|
+
};
|
|
126
111
|
item.reply_form = {
|
|
127
112
|
show: false,
|
|
128
113
|
content: "",
|
|
129
114
|
user_nickname: User.getInfo().name,
|
|
130
|
-
}
|
|
131
|
-
return item
|
|
115
|
+
};
|
|
116
|
+
return item;
|
|
132
117
|
});
|
|
133
118
|
outputs.push(c);
|
|
134
119
|
}
|
|
@@ -146,38 +131,23 @@ export default {
|
|
|
146
131
|
return;
|
|
147
132
|
}
|
|
148
133
|
const data = {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
type: "success",
|
|
167
|
-
});
|
|
168
|
-
} else
|
|
169
|
-
this.$message({
|
|
170
|
-
message: `${res.message}`,
|
|
171
|
-
type: "warning",
|
|
172
|
-
});
|
|
173
|
-
},
|
|
174
|
-
() => {
|
|
175
|
-
this.$message({
|
|
176
|
-
message: "网络异常,提交失败",
|
|
177
|
-
type: "warning",
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
)
|
|
134
|
+
type: this.type,
|
|
135
|
+
source_id: this.sourceId,
|
|
136
|
+
parent_id: parent_id,
|
|
137
|
+
user_nickname: form.user_nickname || User.getInfo().name,
|
|
138
|
+
content: form.content,
|
|
139
|
+
client: this.client,
|
|
140
|
+
};
|
|
141
|
+
wikiComment
|
|
142
|
+
.post(data)
|
|
143
|
+
.then((res) => {
|
|
144
|
+
res = res.data;
|
|
145
|
+
form.content = "";
|
|
146
|
+
this.$message({
|
|
147
|
+
message: "提交成功,请等待审核",
|
|
148
|
+
type: "success",
|
|
149
|
+
});
|
|
150
|
+
})
|
|
181
151
|
.finally(() => {
|
|
182
152
|
form.show = false;
|
|
183
153
|
});
|
|
@@ -185,7 +155,7 @@ export default {
|
|
|
185
155
|
handleCurrentChange(page) {
|
|
186
156
|
this.page = page;
|
|
187
157
|
this.get_comments();
|
|
188
|
-
}
|
|
158
|
+
},
|
|
189
159
|
},
|
|
190
160
|
components: {
|
|
191
161
|
WikiPanel,
|