@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.
@@ -1,126 +1,96 @@
1
- <template>
2
- <div class="w-fav2" :class="{ disabled:favorited }" @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"],
18
- data: function () {
19
- return {
20
- login: User.isLogin(),
21
- favorited: false,
22
- total: 0,
23
- };
24
- },
25
- computed: {
26
- favContent() {
27
- return this.favorited ? "取消收藏" : "收藏";
28
- },
29
- },
30
- methods: {
31
- doFav: function () {
32
- if (this.login) {
33
- this.favorited ? this.delFav() : this.addFav();
34
- } else {
35
- User.toLogin();
36
- }
37
- },
38
- hasFav: function () {
39
- hasFav(this.postType, this.postId).then(
40
- (data) => {
41
- data = data.data;
42
- this.favorited =
43
- data.code === 200 && data.data.favorited > 0;
44
- this.total = data.data?.total || 0;
45
- },
46
- (err) => {
47
- this.fail(err);
48
- }
49
- );
50
- },
51
- addFav: function () {
52
- addFav(this.postType, this.postId).then(
53
- (data) => {
54
- if (data.data.code === 200) {
55
- this.favorited = true;
56
- this.total++;
57
- } else {
58
- this.fail(data.data.message);
59
- }
60
- },
61
- (err) => {
62
- this.fail(err);
63
- }
64
- );
65
- },
66
- delFav: function () {
67
- delFav(this.postType, this.postId).then(
68
- (data) => {
69
- if (data.data.code === 200) {
70
- this.favorited = false;
71
- this.total--;
72
- } else {
73
- this.fail(data.data.message);
74
- }
75
- },
76
- (err) => {
77
- this.fail(err);
78
- }
79
- );
80
- },
81
- fail: function (err) {
82
- if (err.response && err.response.data && err.response.data.code) {
83
- this.$message.error(
84
- `[${err.response.data.code}] ${err.response.data.msg}`
85
- );
86
- } else {
87
- this.$message.error(
88
- typeof err === "string" ? err : "网络请求异常"
89
- );
90
- }
91
- console.log(err);
92
- },
93
- },
94
- watch: {
95
- postId: {
96
- immediate: true,
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 '@/interact/Contributors.vue';
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 '@/interact/Contributors.vue';
51
+ import Contributors from './Contributors.vue';
52
52
  export default {
53
53
  name: "BoxcoinUser",
54
54
  props: ["boxcoin", "postType", "postId", "userId", "own", "points", "authors"],
@@ -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: "http://gray.team.api.jx3box.com",
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://next.jx3box.com",
69
+ target: "https://next2.jx3box.com",
62
70
  onProxyReq: function(request) {
63
71
  request.setHeader("origin", "");
64
72
  },