@jx3box/jx3box-common-ui 6.1.4 → 6.1.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.
@@ -0,0 +1,122 @@
1
+ <template>
2
+ <div class="c-author-posts" v-if="ready">
3
+ <div class="u-label">
4
+ <i class="el-icon-notebook-2"></i>
5
+ <span>作者最新作品</span>
6
+ <a :href="uid | authorLink" class="u-more" target="_blank">全部 &raquo;</a>
7
+ </div>
8
+
9
+ <ul class="u-list" v-if="data && data.length">
10
+ <li v-for="(item, i) in data" :key="i">
11
+ <a class="u-item" :href="url(item.ID, item.post_type)" target="_blank">
12
+ <span
13
+ ><i class="u-icon el-icon-arrow-right"></i>
14
+ {{ item.post_title || item.post_type + "/无标题" }}</span
15
+ >
16
+ </a>
17
+ </li>
18
+ </ul>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ import { authorLink, getLink } from "@jx3box/jx3box-common/js/utils";
24
+ import { getUserPosts } from "../../service/author";
25
+ export default {
26
+ name: "AuthorPosts",
27
+ props: ["uid"],
28
+ data: function () {
29
+ return {
30
+ data: [],
31
+ };
32
+ },
33
+ computed: {
34
+ ready: function () {
35
+ return this.uid && this.data && this.data.length;
36
+ },
37
+ },
38
+ watch: {
39
+ uid: {
40
+ immediate: true,
41
+ handler: function (val) {
42
+ val && this.init();
43
+ },
44
+ },
45
+ },
46
+ methods: {
47
+ url: function (pid, type) {
48
+ return getLink(type, pid);
49
+ },
50
+ init: function () {
51
+ getUserPosts(this.uid)
52
+ .then((data) => {
53
+ this.data = data.slice(0, 5);
54
+ })
55
+ .catch((err) => {
56
+ console.log(err);
57
+ });
58
+ },
59
+ },
60
+ filters: {
61
+ authorLink,
62
+ },
63
+ };
64
+ </script>
65
+
66
+ <style scoped lang="less">
67
+ .c-author-posts {
68
+ // margin:0 10px;
69
+ ul {
70
+ list-style: none;
71
+ margin: 0;
72
+ padding: 0;
73
+ }
74
+ li {
75
+ .db;
76
+ }
77
+ .u-item {
78
+ .db;
79
+ padding: 3px 10px 3px 5px;
80
+ .nobreak;
81
+ .fz(12px,2);
82
+ color: #666;
83
+ border-bottom: 1px solid transparent;
84
+ &:hover {
85
+ color: @pink;
86
+ // background-color:#fff;
87
+ border-bottom: 1px solid @border;
88
+ }
89
+ }
90
+ .u-icon {
91
+ .fz(12px);
92
+ .size(12px);
93
+ // .y;
94
+ color: #999;
95
+ // .mr(5px);
96
+ }
97
+
98
+ .u-label {
99
+ margin: 15px 0 10px 0;
100
+ padding: 0 5px 10px 5px;
101
+ i {
102
+ .mr(5px);
103
+ .y;
104
+ }
105
+ span {
106
+ .fz(13px);
107
+ }
108
+ border-bottom: 1px solid @border;
109
+
110
+ .pr;
111
+ .u-more {
112
+ .fz(12px);
113
+ .pa;
114
+ .rb(0,10px);
115
+ color: #999;
116
+ &:hover {
117
+ color: @pink;
118
+ }
119
+ }
120
+ }
121
+ }
122
+ </style>
@@ -0,0 +1,98 @@
1
+ <template>
2
+ <div class="c-author-teams" v-if="ready">
3
+ <div class="u-label">
4
+ <i class="el-icon-school"></i>
5
+ <span>所属团队</span>
6
+ </div>
7
+ <div class="u-teams">
8
+ <a class="u-team" v-for="(item, i) in teams" :key="i" :href="teamLink(item.team_id)" target="_blank">
9
+ <img class="u-team-logo" :src="showTeamLogo(item.team_logo)" />
10
+ <span class="u-team-name">{{ item.team_name }}@{{ item.team_server }}</span>
11
+ </a>
12
+ </div>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ import { getLink, getThumbnail } from "@jx3box/jx3box-common/js/utils";
18
+ import { getUserPublicTeams } from "../../service/author";
19
+
20
+ export default {
21
+ name: "AuthorTeams",
22
+ props: ["uid"],
23
+ components: {},
24
+ data: function () {
25
+ return {
26
+ teams: [
27
+ // {
28
+ // team_name : '诗画印象',
29
+ // team_logo : 'https://oss.jx3box.com/2019/09/logo.png',
30
+ // team_server : "蝶恋花"
31
+ // }
32
+ ],
33
+ };
34
+ },
35
+ computed: {
36
+ ready: function () {
37
+ return this.uid && this.teams && this.teams.length;
38
+ },
39
+ },
40
+ watch: {
41
+ uid: {
42
+ immediate: true,
43
+ handler: function (val) {
44
+ val && this.loadTeams();
45
+ },
46
+ },
47
+ },
48
+ methods: {
49
+ loadTeams: function () {
50
+ getUserPublicTeams(this.uid).then((data) => {
51
+ this.teams = data && data.slice(0, 5);
52
+ });
53
+ },
54
+ teamLink: function (team_id) {
55
+ return getLink("org", team_id);
56
+ },
57
+ showTeamLogo: function (val) {
58
+ return getThumbnail(val, 96);
59
+ },
60
+ },
61
+ created: function () {},
62
+ mounted: function () {},
63
+ };
64
+ </script>
65
+
66
+ <style scoped lang="less">
67
+ .c-author-teams {
68
+ .mt(10px);
69
+ .u-label{
70
+ i{
71
+ .y;
72
+ }
73
+ }
74
+ .u-team {
75
+ .db;
76
+ background-color: #f5f7fa;
77
+ .mb(6px);
78
+ &:hover {
79
+ // background-color: #e6f0fb;
80
+ .u-team-name{
81
+ color:@pink;
82
+ }
83
+ }
84
+ padding: 4px 4px;
85
+ .r(3px);
86
+ }
87
+ .u-team-logo {
88
+ .size(24px);
89
+ .y;
90
+ .mr(4px);
91
+ .r(4px);
92
+ }
93
+ .u-team-name {
94
+ .fz(12px);
95
+ color: #555;
96
+ }
97
+ }
98
+ </style>
@@ -14,7 +14,7 @@
14
14
  <div class="w-boxcoin-admin-content">
15
15
  <div class="u-left">
16
16
  <em class="u-label">本月状态</em>
17
- <b>已用 {{this.used}} 剩余 {{this.left}} 总计 {{this.total}}</b>
17
+ 已用<b>{{this.used}}</b> 剩余<b>{{this.left}}</b> 总计<b>{{this.total}}</b>
18
18
  <el-progress :percentage="100 - (this.used * 100 / this.total)" :stroke-width="15" :text-inside="true"></el-progress>
19
19
  </div>
20
20
  <div class="u-list">
@@ -21,7 +21,6 @@ export default {
21
21
  }
22
22
  },
23
23
  methods: {
24
-
25
24
  medalLink({ rank_id, medal_type = 'rank' }) {
26
25
  return getMedalLink(rank_id, medal_type)
27
26
  }
@@ -8,21 +8,21 @@
8
8
  target="_blank"
9
9
  >
10
10
  <img class="u-avatar" :src="showAvatar(super_author.user_avatar)" />
11
- <span class="u-name">{{super_author.display_name}}</span>
11
+ <span class="u-name">{{ super_author.display_name }}</span>
12
12
  <i class="u-up">UP</i>
13
13
  </a>
14
14
  <div class="w-creators-authors" v-if="other_authors">
15
15
  <a
16
16
  class="w-creators-author w-creators-item"
17
- v-for="(item,i) in other_authors"
17
+ v-for="(item, i) in other_authors"
18
18
  :key="i"
19
19
  :href="authorLink(item.post_author_info.ID)"
20
20
  target="_blank"
21
21
  v-show="item.status"
22
22
  >
23
23
  <img class="u-avatar" :src="showAvatar(item.post_author_info.user_avatar)" />
24
- <span class="u-name">{{item.post_author_info.display_name}}</span>
25
- <i class="u-label">{{formatLabel(item.label)}}</i>
24
+ <span class="u-name">{{ item.post_author_info.display_name }}</span>
25
+ <i class="u-label">{{ formatLabel(item.label) }}</i>
26
26
  </a>
27
27
  </div>
28
28
  <a class="w-creators-edit" :href="editLink" v-if="isCreator">
@@ -33,11 +33,7 @@
33
33
 
34
34
  <script>
35
35
  import { getPostAuthors } from "../../service/cms";
36
- import {
37
- showAvatar,
38
- authorLink,
39
- editLink,
40
- } from "@jx3box/jx3box-common/js/utils";
36
+ import { showAvatar, authorLink, editLink } from "@jx3box/jx3box-common/js/utils";
41
37
  import User from "@jx3box/jx3box-common/js/user";
42
38
  export default {
43
39
  name: "Creators",
@@ -89,27 +85,31 @@ export default {
89
85
  user_id: this.super_author.ID,
90
86
  display_name: this.super_author.display_name,
91
87
  user_avatar: this.super_author.user_avatar,
92
- }
88
+ };
93
89
 
94
- const other_authors = this.other_authors?.map(item => {
95
- return {
96
- user_id: item.post_author_info?.ID,
97
- display_name: item.post_author_info?.display_name,
98
- user_avatar: item.post_author_info?.user_avatar,
90
+ const other_authors = this.other_authors?.map((item) => {
91
+ if (item.status) {
92
+ return {
93
+ user_id: item.post_author_info?.ID,
94
+ display_name: item.post_author_info?.display_name,
95
+ user_avatar: item.post_author_info?.user_avatar,
96
+ };
99
97
  }
100
- })
98
+ }).filter((item) => {
99
+ return !!item;
100
+ });
101
101
 
102
102
  // 将联合创作者传出去
103
- this.$emit('load-authors', { super_author, other_authors })
103
+ this.$emit("load-authors", { super_author, other_authors });
104
104
  });
105
105
  },
106
106
  showAvatar: function (val) {
107
107
  return showAvatar(val, 144);
108
108
  },
109
109
  authorLink,
110
- formatLabel : function (str){
111
- return str && str.slice(0,8)
112
- }
110
+ formatLabel: function (str) {
111
+ return str && str.slice(0, 8);
112
+ },
113
113
  },
114
114
  created: function () {},
115
115
  mounted: function () {},
@@ -166,7 +166,7 @@ export default {
166
166
  color: @color;
167
167
  margin-bottom: 2px;
168
168
  .nobreak;
169
- max-width:120px;
169
+ max-width: 120px;
170
170
  }
171
171
  &:hover {
172
172
  .u-name {
@@ -177,7 +177,7 @@ export default {
177
177
  .dbi;
178
178
  .fz(12px,1);
179
179
  font-style: normal;
180
- border:1px solid @pink;
180
+ border: 1px solid @pink;
181
181
  color: @pink;
182
182
  padding: 3px 10px;
183
183
  .r(2px);
@@ -185,12 +185,12 @@ export default {
185
185
  }
186
186
  .u-label {
187
187
  .nobreak;
188
- max-width:120px;
188
+ max-width: 120px;
189
189
  .dbi;
190
190
  .fz(12px,1);
191
191
  font-style: normal;
192
- border:1px solid @color-link;
193
- color:@color-link;
192
+ border: 1px solid @color-link;
193
+ color: @color-link;
194
194
  padding: 3px 10px;
195
195
  .r(2px);
196
196
  .mt(5px);
@@ -1,17 +1,48 @@
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" :client="client" />
4
+ <boxcoin-admin
5
+ :postId="postId"
6
+ :postType="postType"
7
+ v-if="hasRight && adminBoxcoinEnable && boxcoin_enable"
8
+ :userId="userId"
9
+ :max="admin_max"
10
+ :min="admin_min"
11
+ :own="admin_left"
12
+ :total="admin_total"
13
+ :points="admin_points"
14
+ :authors="authors"
15
+ @updateRecord="updateRecord"
16
+ :client="client"
17
+ />
5
18
  <Like :postId="postId" :postType="postType"></Like>
6
19
  <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" :client="client" />
20
+ <boxcoin-user
21
+ :postId="postId"
22
+ :postType="postType"
23
+ :boxcoin="boxcoin"
24
+ :userId="userId"
25
+ :own="user_left"
26
+ :points="user_points"
27
+ :authors="authors"
28
+ v-if="userBoxcoinEnable && boxcoin_enable"
29
+ @updateRecord="updateRecord"
30
+ :client="client"
31
+ />
8
32
  <Share :postId="postId" :postType="postType" :client="client" />
9
33
  </div>
10
34
  <div class="w-thx-records">
11
- <boxcoin-records :postId="postId" :postType="postType" :postClient="client" :cacheRecord="cacheRecord" :mode="mode"/>
35
+ <boxcoin-records
36
+ :postId="postId"
37
+ :postType="postType"
38
+ :postClient="client"
39
+ :cacheRecord="cacheRecord"
40
+ :mode="mode"
41
+ />
12
42
  </div>
13
43
  <div class="w-thx-copyright">
14
- &copy; 所有原创作品,著作权归作者所有,所有未经授权的非署名转载或抄袭将有权追究法律责任,所有法律事务由专聘律师代理。<br>
44
+ &copy;
45
+ 所有原创作品,著作权归作者所有,所有未经授权的非署名转载或抄袭将有权追究法律责任,所有法律事务由专聘律师代理。<br />
15
46
  签约作者独家特约稿件,及所有魔盒官方评分作品用户一经兑现则视为有偿付费稿件,所有商业稿件的转载引用需同时征得魔盒平台授权。
16
47
  </div>
17
48
  </div>
@@ -21,74 +52,93 @@
21
52
  import Like from "../interact/Like2.vue";
22
53
  import Share from "../interact/Share2.vue";
23
54
  import Fav from "../interact/Fav2.vue";
24
- import BoxcoinRecords from '../interact/boxcoin_records.vue';
25
- import BoxcoinAdmin from '../interact/boxcoin_admin.vue';
26
- import BoxcoinUser from '../interact/boxcoin_user.vue';
27
- import User from '@jx3box/jx3box-common/js/user'
28
- import {getPostBoxcoinConfig,getBoxcoinStatus} from '../../service/thx'
55
+ import BoxcoinRecords from "../interact/boxcoin_records.vue";
56
+ import BoxcoinAdmin from "../interact/boxcoin_admin.vue";
57
+ import BoxcoinUser from "../interact/boxcoin_user.vue";
58
+ import User from "@jx3box/jx3box-common/js/user";
59
+ import { getPostBoxcoinConfig, getBoxcoinStatus } from "../../service/thx";
29
60
  export default {
30
61
  name: "Thx",
31
- props: ["postId", "postType", "postTitle", "userId","adminBoxcoinEnable","userBoxcoinEnable",'mode', 'authors',"client"],
62
+ props: [
63
+ "postId",
64
+ "postType",
65
+ "postTitle",
66
+ "userId",
67
+ "adminBoxcoinEnable",
68
+ "userBoxcoinEnable",
69
+ "mode",
70
+ "authors",
71
+ "client",
72
+ ],
32
73
  components: {
33
74
  Like,
34
75
  Share,
35
76
  Fav,
36
- 'boxcoin-records':BoxcoinRecords,
37
- 'boxcoin-admin':BoxcoinAdmin,
38
- 'boxcoin-user':BoxcoinUser,
77
+ "boxcoin-records": BoxcoinRecords,
78
+ "boxcoin-admin": BoxcoinAdmin,
79
+ "boxcoin-user": BoxcoinUser,
39
80
  },
40
81
  data: function () {
41
82
  return {
42
- boxcoin : 0,
43
- hasRight : User.getInfo().group >= 32,
83
+ boxcoin: 0,
84
+ hasRight: User.getInfo().group >= 32,
44
85
  user: User.getInfo(),
45
86
 
46
- admin_max : 0,
47
- admin_min : 0,
48
- admin_left : 0,
87
+ admin_max: 0,
88
+ admin_min: 0,
89
+ admin_left: 0,
49
90
  admin_total: 0,
50
- admin_points : [100],
91
+ admin_points: [100],
51
92
 
52
- user_left : 0,
53
- user_points : [100],
93
+ user_left: 0,
94
+ user_points: [100],
54
95
 
55
96
  cacheRecord: null,
56
- boxcoin_enable : 0
97
+ boxcoin_enable: 0,
57
98
  };
58
99
  },
59
100
  computed: {
60
- post_keys : function (){
61
- return [this.postId,this.postType]
62
- }
101
+ post_keys: function () {
102
+ return [this.postId, this.postType];
103
+ },
63
104
  },
64
105
  watch: {
65
- post_keys : {
66
- immediate : true,
67
- deep:true,
68
- handler : function (){
69
- this.postType && this.postId && this.loadBoxcoinConfig()
70
- }
71
- }
106
+ post_keys: {
107
+ immediate: true,
108
+ deep: true,
109
+ handler: function () {
110
+ this.postType && this.postId && this.loadBoxcoinConfig();
111
+ },
112
+ },
72
113
  },
73
114
  methods: {
74
- loadBoxcoinConfig : function (){
75
- User.isLogin() && getPostBoxcoinConfig(this.postType).then((res) => {
76
- this.admin_max = res.data.data.limit.admin_max || 0;
77
- this.admin_min = res.data.data.limit.admin_min || 0;
78
- this.admin_points = res.data.data.limit.admin_points || [10, 1000];
79
- this.admin_left = res.data.data.asManagerBoxCoinRemain || 0;
80
- this.admin_total = res.data.data.asManagerBoxCoinTotal || 0;
115
+ loadBoxcoinConfig: function () {
116
+ User.isLogin() &&
117
+ getPostBoxcoinConfig(this.postType).then((res) => {
118
+ this.admin_max = res.data.data.limit.admin_max || 0;
119
+ this.admin_min = res.data.data.limit.admin_min || 0;
120
+ this.admin_points = res.data.data.limit.admin_points || [10, 1000];
121
+ this.admin_left = res.data.data.asManagerBoxCoinRemain || 0;
122
+ this.admin_total = res.data.data.asManagerBoxCoinTotal || 0;
81
123
 
82
- this.user_points = res.data.data.limit.user_points || [10, 1000];
83
- this.user_left = res.data.data.asUserBoxCoinRemain || 0;
84
- });
124
+ this.user_points = res.data.data.limit.user_points || [10, 1000];
125
+ // 根据多端展示剩余币
126
+ // 作品是n端,接受n端币+all币,但转化为n端币
127
+ if (this.client == "origin") {
128
+ this.user_left = res.data.data.asUserBoxCoinRemainOrigin + res.data.data.asUserBoxCoinRemainAll;
129
+ } else if (this.client == "std") {
130
+ this.user_left = res.data.data.asUserBoxCoinRemainStd + res.data.data.asUserBoxCoinRemainAll;
131
+ } else {
132
+ this.user_left = res.data.data.asUserBoxCoinRemainAll
133
+ }
134
+ });
85
135
  getBoxcoinStatus().then((res) => {
86
- this.boxcoin_enable = !!~~res.data.data.val
87
- })
136
+ this.boxcoin_enable = !!~~res.data.data.val;
137
+ });
88
138
  },
89
139
  // 用户打赏
90
- updateRecord: function (data){
91
- this.cacheRecord = data
140
+ updateRecord: function (data) {
141
+ this.cacheRecord = data;
92
142
  },
93
143
  },
94
144
  created: function () {},