@jx3box/jx3box-common-ui 5.5.24 → 5.5.27
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/.editorconfig +13 -0
- package/.prettierrc +21 -0
- package/assets/css/author.less +51 -27
- package/jsconfig.json +9 -0
- package/package.json +65 -63
- package/service/author.js +14 -5
- package/service/fav.js +55 -38
- package/src/App.vue +3 -3
- package/src/Author.vue +66 -110
- package/src/author/Authorposts.vue +29 -32
- package/src/header/user.vue +42 -7
- package/src/interact/Fav.vue +24 -48
- package/src/interact/Fav2.vue +96 -126
- package/src/interact/boxcoin_admin.vue +1 -1
- package/src/interact/boxcoin_user.vue +1 -1
- package/src/single/Thx.vue +2 -2
- package/vue.config.js +11 -3
package/src/interact/Fav2.vue
CHANGED
|
@@ -1,126 +1,96 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="w-fav2" :class="{ disabled:
|
|
3
|
-
<el-tooltip effect="dark" :content="favContent" placement="top-start">
|
|
4
|
-
<div>
|
|
5
|
-
<img class="u-icon" svg-inline src="../../assets/img/widget/star.svg" />
|
|
6
|
-
<span class="u-count" v-if="total">{{ total }}</span>
|
|
7
|
-
</div>
|
|
8
|
-
</el-tooltip>
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
import User from "@jx3box/jx3box-common/js/user";
|
|
14
|
-
import { hasFav, addFav, delFav } from "../../service/fav";
|
|
15
|
-
export default {
|
|
16
|
-
name: "Fav2",
|
|
17
|
-
props: ["postType", "postId"],
|
|
18
|
-
data: function () {
|
|
19
|
-
return {
|
|
20
|
-
login: User.isLogin(),
|
|
21
|
-
|
|
22
|
-
total: 0,
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
computed: {
|
|
26
|
-
favContent() {
|
|
27
|
-
return this.
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
methods: {
|
|
31
|
-
doFav: function () {
|
|
32
|
-
if (this.login) {
|
|
33
|
-
this.
|
|
34
|
-
} else {
|
|
35
|
-
User.toLogin();
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
hasFav: function () {
|
|
39
|
-
hasFav(this.postType, this.postId).then(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
handler() {
|
|
98
|
-
if (this.postType && this.postId) this.hasFav();
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
</script>
|
|
104
|
-
|
|
105
|
-
<style lang="less" scoped>
|
|
106
|
-
.w-fav2 {
|
|
107
|
-
.pointer;
|
|
108
|
-
.dbi;
|
|
109
|
-
.u-icon {
|
|
110
|
-
.size(32px);
|
|
111
|
-
.y;
|
|
112
|
-
.pr;
|
|
113
|
-
top: -1px;
|
|
114
|
-
}
|
|
115
|
-
.u-count {
|
|
116
|
-
color: #888;
|
|
117
|
-
.ml(10px);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
&.disabled {
|
|
121
|
-
svg * {
|
|
122
|
-
fill: #aaa;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="w-fav2" :class="{ disabled: favorite }" @click="doFav">
|
|
3
|
+
<el-tooltip effect="dark" :content="favContent" placement="top-start">
|
|
4
|
+
<div>
|
|
5
|
+
<img class="u-icon" svg-inline src="../../assets/img/widget/star.svg" />
|
|
6
|
+
<span class="u-count" v-if="total">{{ total }}</span>
|
|
7
|
+
</div>
|
|
8
|
+
</el-tooltip>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import User from "@jx3box/jx3box-common/js/user";
|
|
14
|
+
import { hasFav, addFav, delFav } from "../../service/fav";
|
|
15
|
+
export default {
|
|
16
|
+
name: "Fav2",
|
|
17
|
+
props: ["postType", "postId", "postTitle"],
|
|
18
|
+
data: function () {
|
|
19
|
+
return {
|
|
20
|
+
login: User.isLogin(),
|
|
21
|
+
favorite: false,
|
|
22
|
+
total: 0,
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
computed: {
|
|
26
|
+
favContent() {
|
|
27
|
+
return this.favorite ? "取消收藏" : "收藏";
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
methods: {
|
|
31
|
+
doFav: function () {
|
|
32
|
+
if (this.login) {
|
|
33
|
+
this.favorite ? this.delFav() : this.addFav();
|
|
34
|
+
} else {
|
|
35
|
+
User.toLogin();
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
hasFav: function () {
|
|
39
|
+
hasFav(this.postType, this.postId).then((res) => {
|
|
40
|
+
this.favorite = res.id || false;
|
|
41
|
+
this.total = res.totalFavorites || 0;
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
addFav: function () {
|
|
45
|
+
addFav(this.postType, this.postId, this.postTitle).then((res) => {
|
|
46
|
+
this.favorite = res.id;
|
|
47
|
+
this.total++;
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
delFav: function () {
|
|
51
|
+
delFav(this.favorite).then(() => {
|
|
52
|
+
this.favorite = false;
|
|
53
|
+
this.total--;
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
fail: function (err) {
|
|
57
|
+
if (err.response && err.response.data && err.response.data.code) {
|
|
58
|
+
this.$message.error(`[${err.response.data.code}] ${err.response.data.msg}`);
|
|
59
|
+
} else {
|
|
60
|
+
this.$message.error(typeof err === "string" ? err : "网络请求异常");
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
watch: {
|
|
65
|
+
postId: {
|
|
66
|
+
immediate: true,
|
|
67
|
+
handler() {
|
|
68
|
+
if (this.postType && this.postId) this.hasFav();
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<style lang="less" scoped>
|
|
76
|
+
.w-fav2 {
|
|
77
|
+
.pointer;
|
|
78
|
+
.dbi;
|
|
79
|
+
.u-icon {
|
|
80
|
+
.size(32px);
|
|
81
|
+
.y;
|
|
82
|
+
.pr;
|
|
83
|
+
top: -1px;
|
|
84
|
+
}
|
|
85
|
+
.u-count {
|
|
86
|
+
color: #888;
|
|
87
|
+
.ml(10px);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.disabled {
|
|
91
|
+
svg * {
|
|
92
|
+
fill: #aaa;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
<script>
|
|
52
52
|
import { grantBoxcoin } from "../../service/thx.js";
|
|
53
53
|
import User from "@jx3box/jx3box-common/js/user";
|
|
54
|
-
import Contributors from '
|
|
54
|
+
import Contributors from './Contributors.vue';
|
|
55
55
|
export default {
|
|
56
56
|
name: "BoxcoinAdmin",
|
|
57
57
|
props: ["postType", "postId", "userId", "own", "points", 'authors'],
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
<script>
|
|
49
49
|
import { rewardBoxcoin } from "../../service/thx.js";
|
|
50
50
|
import User from "@jx3box/jx3box-common/js/user";
|
|
51
|
-
import Contributors from '
|
|
51
|
+
import Contributors from './Contributors.vue';
|
|
52
52
|
export default {
|
|
53
53
|
name: "BoxcoinUser",
|
|
54
54
|
props: ["boxcoin", "postType", "postId", "userId", "own", "points", "authors"],
|
package/src/single/Thx.vue
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="w-thx-panel">
|
|
4
4
|
<boxcoin-admin :postId="postId" :postType="postType" v-if="hasRight && adminBoxcoinEnable && boxcoin_enable" :userId="userId" :own="admin_left" :points="admin_points" :authors="authors" @updateRecord="updateRecord" />
|
|
5
5
|
<Like :postId="postId" :postType="postType"></Like>
|
|
6
|
-
<fav :postId="postId" :postType="postType"></fav>
|
|
6
|
+
<fav :postId="postId" :postType="postType" :postTitle="postTitle"></fav>
|
|
7
7
|
<boxcoin-user :postId="postId" :postType="postType" :boxcoin="boxcoin" :userId="userId" :own="user_left" :points="user_points" :authors="authors" v-if="userBoxcoinEnable && boxcoin_enable" @updateRecord="updateRecord" />
|
|
8
8
|
<Share :postId="postId" :postType="postType" />
|
|
9
9
|
</div>
|
|
@@ -28,7 +28,7 @@ import User from '@jx3box/jx3box-common/js/user'
|
|
|
28
28
|
import {getPostBoxcoinConfig,getBoxcoinStatus} from '../../service/thx'
|
|
29
29
|
export default {
|
|
30
30
|
name: "Thx",
|
|
31
|
-
props: ["postId", "postType","userId","adminBoxcoinEnable","userBoxcoinEnable",'mode', 'authors'],
|
|
31
|
+
props: ["postId", "postType", "postTitle", "userId","adminBoxcoinEnable","userBoxcoinEnable",'mode', 'authors'],
|
|
32
32
|
components: {
|
|
33
33
|
Like,
|
|
34
34
|
Share,
|
package/vue.config.js
CHANGED
|
@@ -39,8 +39,7 @@ module.exports = {
|
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
"/api/team": {
|
|
42
|
-
target: "
|
|
43
|
-
// "target": "https://team.api.jx3box.com",
|
|
42
|
+
"target": "https://team.api.jx3box.com",
|
|
44
43
|
onProxyReq: function(request) {
|
|
45
44
|
request.setHeader("origin", "");
|
|
46
45
|
},
|
|
@@ -48,6 +47,9 @@ module.exports = {
|
|
|
48
47
|
"/api/cms": {
|
|
49
48
|
target: process.env["DEV_SERVER"] == "true" ? "http://localhost:5120" : "https://cms.jx3box.com",
|
|
50
49
|
},
|
|
50
|
+
"/api/article": {
|
|
51
|
+
target: "https://next2.jx3box.com",
|
|
52
|
+
},
|
|
51
53
|
"/api/messages": {
|
|
52
54
|
target: "https://helper.jx3box.com",
|
|
53
55
|
},
|
|
@@ -57,8 +59,14 @@ module.exports = {
|
|
|
57
59
|
"/api/wiki": {
|
|
58
60
|
target: "https://helper.jx3box.com",
|
|
59
61
|
},
|
|
62
|
+
"/api/personal": {
|
|
63
|
+
target: "https://pay.jx3box.com",
|
|
64
|
+
onProxyReq: function(request) {
|
|
65
|
+
request.setHeader("origin", "");
|
|
66
|
+
},
|
|
67
|
+
},
|
|
60
68
|
"/api": {
|
|
61
|
-
target: "https://
|
|
69
|
+
target: "https://next2.jx3box.com",
|
|
62
70
|
onProxyReq: function(request) {
|
|
63
71
|
request.setHeader("origin", "");
|
|
64
72
|
},
|