@jx3box/jx3box-common-ui 5.8.4 → 5.8.7

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.8.4",
3
+ "version": "5.8.7",
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.7.0",
34
- "@jx3box/jx3box-common": "^7.1.6",
35
- "@jx3box/jx3box-data": "^1.9.4",
36
- "@jx3box/jx3box-editor": "^1.2.7",
34
+ "@jx3box/jx3box-common": "^7.1.8",
35
+ "@jx3box/jx3box-data": "^1.9.9",
36
+ "@jx3box/jx3box-editor": "^1.2.8",
37
37
  "axios": "^0.26.1",
38
38
  "dayjs": "^1.11.0",
39
39
  "element-ui": "^2.13.2",
@@ -57,7 +57,7 @@ import { getBreadcrumb } from "@jx3box/jx3box-common/js/api_misc";
57
57
  import Contributors from './Contributors.vue';
58
58
  export default {
59
59
  name: "BoxcoinAdmin",
60
- props: ["postType", "postId", "userId", "own", "total", "points", "max", "min", 'authors'],
60
+ props: ["postType", "postId", "userId", "own", "total", "points", "max", "min", 'authors','client'],
61
61
  components: {
62
62
  Contributors
63
63
  },
@@ -89,9 +89,9 @@ export default {
89
89
  allowBoxcoin : function (){
90
90
  return this.postType && this.postId && (this.userId || (this.authors && this.authors.length))
91
91
  },
92
- client : function (){
92
+ hostClient : function (){
93
93
  return location.href.includes('origin') ? 'origin' : 'std'
94
- }
94
+ },
95
95
  },
96
96
  watch: {
97
97
  own : function (val){
@@ -110,7 +110,7 @@ export default {
110
110
  this.submitting = true;
111
111
  grantBoxcoin(this.postType, this.postId, this.chosen || this.userId, this.count, {
112
112
  remark: this.remark,
113
- client : this.client
113
+ client : this.client || this.hostClient
114
114
  })
115
115
  .then((res) => {
116
116
  this.$message({
@@ -51,7 +51,7 @@ import User from "@jx3box/jx3box-common/js/user";
51
51
  import Contributors from './Contributors.vue';
52
52
  export default {
53
53
  name: "BoxcoinUser",
54
- props: ["boxcoin", "postType", "postId", "userId", "own", "points", "authors"],
54
+ props: ["boxcoin", "postType", "postId", "userId", "own", "points", "authors",'client'],
55
55
  components: {
56
56
  Contributors
57
57
  },
@@ -82,7 +82,7 @@ export default {
82
82
  allowBoxcoin : function (){
83
83
  return this.postType && this.postId && (this.userId || (this.authors && this.authors.length))
84
84
  },
85
- client : function (){
85
+ hostClient : function (){
86
86
  return location.href.includes('origin') ? 'origin' : 'std'
87
87
  }
88
88
  },
@@ -106,7 +106,7 @@ export default {
106
106
  submit: function () {
107
107
  rewardBoxcoin(this.postType, this.postId, this.chosen || this.userId, this.count, {
108
108
  remark: this.remark,
109
- client : this.client
109
+ client : this.client || this.hostClient
110
110
  })
111
111
  .then((res) => {
112
112
  this.$message({
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <div class="w-thx">
3
3
  <div class="w-thx-panel">
4
- <boxcoin-admin :postId="postId" :postType="postType" v-if="hasRight && adminBoxcoinEnable && boxcoin_enable" :userId="userId" :max="admin_max" :min="admin_min" :own="admin_left" :total="admin_total" :points="admin_points" :authors="authors" @updateRecord="updateRecord" />
4
+ <boxcoin-admin :postId="postId" :postType="postType" v-if="hasRight && adminBoxcoinEnable && boxcoin_enable" :userId="userId" :max="admin_max" :min="admin_min" :own="admin_left" :total="admin_total" :points="admin_points" :authors="authors" @updateRecord="updateRecord" :client="client" />
5
5
  <Like :postId="postId" :postType="postType"></Like>
6
6
  <fav :postId="postId" :postType="postType" :postTitle="postTitle"></fav>
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
- <Share :postId="postId" :postType="postType" />
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
+ <Share :postId="postId" :postType="postType" :client="client" />
9
9
  </div>
10
10
  <div class="w-thx-records">
11
11
  <boxcoin-records :postId="postId" :postType="postType" :cacheRecord="cacheRecord" :mode="mode"/>
@@ -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", "postTitle", "userId","adminBoxcoinEnable","userBoxcoinEnable",'mode', 'authors'],
31
+ props: ["postId", "postType", "postTitle", "userId","adminBoxcoinEnable","userBoxcoinEnable",'mode', 'authors',"client"],
32
32
  components: {
33
33
  Like,
34
34
  Share,
@@ -97,4 +97,4 @@ export default {
97
97
 
98
98
  <style lang="less">
99
99
  @import "../../assets/css/thx.less";
100
- </style>
100
+ </style>
@@ -33,7 +33,7 @@
33
33
  <slot name="single-append"></slot>
34
34
 
35
35
  <!-- 打赏 -->
36
- <Thx class="m-single-thx" :postId="id" :postType="post_type" :postTitle="post_title" :userId="author_id" :adminBoxcoinEnable="true" :userBoxcoinEnable="true" :authors="authors" />
36
+ <Thx class="m-single-thx" :postId="id" :postType="post_type" :postTitle="post_title" :userId="author_id" :adminBoxcoinEnable="true" :userBoxcoinEnable="true" :authors="authors" :client="post_client"/>
37
37
 
38
38
  <!-- 评论 -->
39
39
  <div class="m-single-comment">
@@ -133,6 +133,9 @@ export default {
133
133
  }
134
134
 
135
135
  return []
136
+ },
137
+ post_client : function (){
138
+ return this.post?.client || 'all'
136
139
  }
137
140
  },
138
141
  methods : {
@@ -20,7 +20,11 @@
20
20
  </tr>
21
21
  <tr class="history" v-for="(ver, key) in versions" :key="key">
22
22
  <td>
23
- <a :href="link(type, `${ver.source_id}/${ver.id}`)" v-text="'v' + (versions.length - key)" @click="redirectRevision(ver,$event)"></a>
23
+ <a
24
+ :href="link(type, `${ver.source_id}/${ver.id}`)"
25
+ v-text="'v' + (versions.length - key)"
26
+ @click="redirectRevision(ver, $event)"
27
+ ></a>
24
28
  </td>
25
29
  <td v-text="ts2str(ver.updated)"></td>
26
30
  <td>
@@ -43,37 +47,40 @@ import { __Root, __OriginRoot } from "@jx3box/jx3box-common/data/jx3box.json";
43
47
  export default {
44
48
  name: "WikiRevisions",
45
49
  props: ["type", "sourceId", "isGame"],
46
- data: function() {
50
+ data: function () {
47
51
  return {
48
52
  versions: null,
49
53
  };
50
54
  },
51
55
  computed: {
52
- baseUrl: function() {
53
- return (location.href.includes("classic") || location.href.includes("origin")) ? __OriginRoot : __Root;
56
+ client: function () {
57
+ return location.href.includes("classic") || location.href.includes("origin") ? "origin" : "std";
54
58
  },
55
- prefix: function() {
59
+ baseUrl: function () {
60
+ return this.client == "origin" ? __OriginRoot : __Root;
61
+ },
62
+ prefix: function () {
56
63
  if (this.isGame) {
57
- return this.baseUrl.slice(0,-1);
64
+ return this.baseUrl.slice(0, -1);
58
65
  } else {
59
66
  return "";
60
67
  }
61
68
  },
62
69
  },
63
70
  methods: {
64
- link: function(type, id) {
71
+ link: function (type, id) {
65
72
  return this.prefix + getLink(type, id);
66
73
  },
67
- author_url: function(uid) {
74
+ author_url: function (uid) {
68
75
  return this.prefix + authorLink(uid);
69
76
  },
70
77
  ts2str,
71
- redirectRevision : function (ver,e){
72
- if(!this.isGame && this.$router){
78
+ redirectRevision: function (ver, e) {
79
+ if (!this.isGame && this.$router) {
73
80
  e.preventDefault();
74
- this.$router.replace({path:`/view/${ver.source_id}/${ver.id}`})
81
+ this.$router.replace({ path: `/view/${ver.source_id}/${ver.id}` });
75
82
  }
76
- }
83
+ },
77
84
  },
78
85
  components: {
79
86
  WikiPanel,
@@ -83,7 +90,7 @@ export default {
83
90
  immediate: true,
84
91
  handler() {
85
92
  if (this.sourceId) {
86
- WikiPost.versions(this.type, this.sourceId).then(
93
+ WikiPost.versions(this.type, this.sourceId, this.client).then(
87
94
  (res) => {
88
95
  res = res.data;
89
96
  this.versions = res.code === 200 ? res.data.versions : false;