@jx3box/jx3box-common-ui 6.7.8 → 6.8.0

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,20 +1,23 @@
1
1
  <template>
2
2
  <div class="c-author-medals" v-if="ready">
3
3
  <div class="u-label">
4
- <i class="el-icon-trophy"></i>
4
+ <!-- <i class="el-icon-trophy"></i> -->
5
+ <img svg-inline src="../../assets/img/leftsidebar/medal.svg" />
5
6
  <span>作者荣誉</span>
6
7
  </div>
7
8
  <div class="u-medals" v-if="medals && medals.length">
8
- <a
9
- :href="getMedalLink(item)"
10
- target="_blank"
11
- class="u-medal"
9
+ <el-tooltip
10
+ class="item"
11
+ effect="dark"
12
+ :content="item.medal_desc"
13
+ placement="top"
12
14
  v-for="item in medals"
13
15
  :key="item.id"
14
- :title="item.medal_desc"
15
16
  >
16
- <img class="u-medal-img" :src="showIcon(item.medal)" />
17
- </a>
17
+ <a :href="getMedalLink(item)" target="_blank" class="u-medal">
18
+ <img class="u-medal-img" :src="showIcon(item.medal)" />
19
+ </a>
20
+ </el-tooltip>
18
21
  </div>
19
22
  </div>
20
23
  </template>
@@ -55,7 +58,7 @@ export default {
55
58
  return __imgPath + "image/medals/user/" + medal + ".gif";
56
59
  },
57
60
  getMedalLink(medal) {
58
- return getMedalLink(medal.rank_id, medal.medal_type || 'rank');
61
+ return getMedalLink(medal.rank_id, medal.medal_type || "rank");
59
62
  },
60
63
  },
61
64
  created: function () {},
@@ -63,23 +66,17 @@ export default {
63
66
  };
64
67
  </script>
65
68
 
66
- <style scoped lang="less">
69
+ <style lang="less">
67
70
  .c-author-medals {
68
- .u-label {
69
- i {
70
- .y;
71
- }
72
- }
73
71
  .u-medals {
74
- padding:0 3px;
75
72
  display: flex;
76
- .u-medal {
77
- cursor: pointer;
78
- .mr(2px);
79
- .u-medal-img {
80
- width: 20px;
81
- height: 20px;
82
- }
73
+ }
74
+ .u-medal {
75
+ cursor: pointer;
76
+ .mr(2px);
77
+ .u-medal-img {
78
+ width: 20px;
79
+ height: 20px;
83
80
  }
84
81
  }
85
82
  }
@@ -1,18 +1,21 @@
1
1
  <template>
2
2
  <div class="c-author-posts" v-if="ready">
3
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>
4
+ <!-- <i class="el-icon-notebook-2"></i> -->
5
+ <img svg-inline src="../../assets/img/leftsidebar/post.svg" />
6
+ <span>作品</span>
7
+ <a :href="uid | authorLink" class="u-more" target="_blank"
8
+ ><img svg-inline src="../../assets/img/leftsidebar/more.svg"
9
+ /></a>
7
10
  </div>
8
11
 
9
12
  <ul class="u-list" v-if="data && data.length">
10
13
  <li v-for="(item, i) in data" :key="i">
11
14
  <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
- >
15
+ <span>
16
+ <img svg-inline src="../../assets/img/leftsidebar/arrow.svg" class="u-icon" />
17
+ {{ item.post_title || item.post_type + "/无标题" }}
18
+ </span>
16
19
  </a>
17
20
  </li>
18
21
  </ul>
@@ -63,9 +66,8 @@ export default {
63
66
  };
64
67
  </script>
65
68
 
66
- <style scoped lang="less">
69
+ <style lang="less">
67
70
  .c-author-posts {
68
- // margin:0 10px;
69
71
  ul {
70
72
  list-style: none;
71
73
  margin: 0;
@@ -76,7 +78,7 @@ export default {
76
78
  }
77
79
  .u-item {
78
80
  .db;
79
- padding: 3px 10px 3px 5px;
81
+ padding: 3px 2px;
80
82
  .nobreak;
81
83
  .fz(12px,2);
82
84
  color: #666;
@@ -84,7 +86,10 @@ export default {
84
86
  &:hover {
85
87
  color: @pink;
86
88
  // background-color:#fff;
87
- border-bottom: 1px solid @border;
89
+ // border-bottom: 1px solid @border;
90
+ .u-icon{
91
+ transform: translateX(5px);
92
+ }
88
93
  }
89
94
  }
90
95
  .u-icon {
@@ -93,20 +98,10 @@ export default {
93
98
  // .y;
94
99
  color: #999;
95
100
  // .mr(5px);
101
+ transition: all 0.3s;
96
102
  }
97
103
 
98
104
  .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
105
  .pr;
111
106
  .u-more {
112
107
  .fz(12px);
@@ -1,14 +1,24 @@
1
1
  <template>
2
2
  <div class="c-author-teams" v-if="ready">
3
3
  <div class="u-label">
4
- <i class="el-icon-school"></i>
5
- <span>所属团队</span>
4
+ <!-- <i class="el-icon-school"></i> -->
5
+ <img svg-inline src="../../assets/img/leftsidebar/united.svg" />
6
+ <span>所在团队</span>
6
7
  </div>
7
8
  <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>
9
+ <el-tooltip
10
+ class="item"
11
+ effect="dark"
12
+ :content="item.team_name + '@' + item.team_server"
13
+ placement="top"
14
+ v-for="(item, i) in teams"
15
+ :key="i"
16
+ >
17
+ <a class="u-team" :href="teamLink(item.team_id)" target="_blank">
18
+ <img class="u-team-logo" :src="showTeamLogo(item.team_logo)" />
19
+ <span class="u-team-name">{{ item.team_name }}@{{ item.team_server }}</span>
20
+ </a>
21
+ </el-tooltip>
12
22
  </div>
13
23
  </div>
14
24
  </template>
@@ -48,7 +58,7 @@ export default {
48
58
  methods: {
49
59
  loadTeams: function () {
50
60
  getUserPublicTeams(this.uid).then((data) => {
51
- this.teams = data && data.slice(0, 5);
61
+ this.teams = data && data.slice(0, 8);
52
62
  });
53
63
  },
54
64
  teamLink: function (team_id) {
@@ -63,36 +73,35 @@ export default {
63
73
  };
64
74
  </script>
65
75
 
66
- <style scoped lang="less">
76
+ <style lang="less">
67
77
  .c-author-teams {
68
- .mt(10px);
69
- .u-label{
70
- i{
71
- .y;
72
- }
78
+ .u-teams {
79
+ .flex;
73
80
  }
74
81
  .u-team {
75
82
  .db;
76
- background-color: #f5f7fa;
77
- .mb(6px);
83
+ // background-color: #f5f7fa;
84
+ // .mb(6px);
78
85
  &:hover {
79
86
  // background-color: #e6f0fb;
80
- .u-team-name{
81
- color:@pink;
87
+ .u-team-name {
88
+ color: @pink;
82
89
  }
83
90
  }
84
- padding: 4px 4px;
91
+ // padding: 4px 0;
85
92
  .r(3px);
93
+ .mr(5px);
86
94
  }
87
95
  .u-team-logo {
88
- .size(24px);
89
- .y;
90
- .mr(4px);
91
- .r(4px);
96
+ .size(19px);
97
+ // .mr(4px);
98
+ .r(50%);
99
+ .db;
92
100
  }
93
101
  .u-team-name {
94
102
  .fz(12px);
95
- color: #555;
103
+ color: #56677a;
104
+ .none;
96
105
  }
97
106
  }
98
107
  </style>
@@ -1,165 +1,178 @@
1
1
  <template>
2
- <div class="w-boxcoin-user">
3
- <el-button @click="openBoxcoinPop" type="primary" size="mini">批量打赏</el-button>
4
- <el-dialog
5
- title="投币打赏"
6
- :visible.sync="visible"
7
- custom-class="w-boxcoin-pop"
8
- append-to-body
9
- :close-on-click-modal="false"
10
- >
11
- <div class="w-boxcoin-user-content">
12
- <div class="u-left">
13
- <em class="u-label">当前拥有盒币</em>
14
- <b>{{ left }}</b>
15
- <a class="u-charge" :href="chargeLink" target="_blank">[充值]</a>
16
- </div>
17
- <div class="u-list">
18
- <em class="u-label">❤️ 打赏</em>
19
- <Contributors v-if="authors && authors.length" :authors="authors" @chosen="handleChosen" />
20
- <div class="u-points">
21
- <el-radio-group v-model="count">
22
- <el-radio :label="item" v-for="item in fitPoints" :key="item" border>
23
- <b>{{ item }}</b
24
- >盒币
25
- </el-radio>
26
- </el-radio-group>
27
- </div>
28
- </div>
29
- <div class="u-msg">
30
- <em class="u-label">📝 寄语</em>
31
- <div class="u-input">
32
- <el-input
33
- v-model="remark"
34
- placeholder="请输入寄语(必填)"
35
- :minlength="2"
36
- :maxlength="30"
37
- show-word-limit
38
- ></el-input>
39
- </div>
40
- </div>
41
- </div>
42
- <span slot="footer" class="dialog-footer">
43
- <el-button @click="visible = false">取 消</el-button>
44
- <el-button type="primary" @click="submit" :disabled="!ready">确 定</el-button>
45
- </span>
46
- </el-dialog>
47
- </div>
2
+ <div class="w-boxcoin-user">
3
+ <el-button @click="openBoxcoinPop" type="primary" size="mini">批量打赏</el-button>
4
+ <el-dialog
5
+ title="品鉴评分"
6
+ :visible.sync="visible"
7
+ custom-class="w-boxcoin-pop"
8
+ :close-on-click-modal="false"
9
+ append-to-body
10
+ >
11
+ <div class="w-boxcoin-admin-content">
12
+ <div class="u-left">
13
+ <em class="u-label">本月状态</em>
14
+ 已用<b>{{ this.used }}</b> 剩余<b>{{ this.left }}</b> 总计<b>{{ this.total }}</b>
15
+ <el-progress
16
+ :percentage="100 - (this.used * 100) / this.total"
17
+ :stroke-width="15"
18
+ :text-inside="true"
19
+ ></el-progress>
20
+ </div>
21
+ <div class="u-list">
22
+ <em class="u-label">❤️ 品鉴</em>
23
+ <Contributors v-if="authors && authors.length" :authors="authors" @chosen="handleChosen" />
24
+ <div class="u-points">
25
+ <el-radio-group v-model="count">
26
+ <el-radio :label="item" v-for="item in fitPoints" :key="item" border>
27
+ <b>{{ item }}</b
28
+ >盒币
29
+ </el-radio>
30
+ </el-radio-group>
31
+ </div>
32
+ </div>
33
+ <div class="u-msg">
34
+ <em class="u-label">📝 寄语</em>
35
+ <div class="u-input">
36
+ <el-input
37
+ v-model="remark"
38
+ placeholder="请输入寄语(必填)"
39
+ :minlength="2"
40
+ :maxlength="30"
41
+ show-word-limit
42
+ ></el-input>
43
+ <el-button :disabled="fetchingCurrentRelease" @click="insertCurrentRelease"
44
+ >插入当前版本</el-button
45
+ >
46
+ </div>
47
+ </div>
48
+ </div>
49
+ <span slot="footer" class="dialog-footer">
50
+ <el-button @click="visible = false">取 消</el-button>
51
+ <el-button type="primary" @click="submit" :disabled="!ready || submitting">确 定</el-button>
52
+ </span>
53
+ </el-dialog>
54
+ </div>
48
55
  </template>
49
56
 
50
57
  <script>
51
58
  import { batchReward } from "../../service/thx.js";
52
- import User from "@jx3box/jx3box-common/js/user";
53
59
  import Contributors from "./Contributors.vue";
54
- export default {
55
- name: "BatchReward",
56
- props: ["boxcoin", "postType", "items", "own", "points", "authors", "client"],
57
- components: {
58
- Contributors,
59
- },
60
- data: function () {
61
- return {
62
- visible: false,
63
-
64
- count: 0,
65
- remark: "辛苦了,谢谢大大!",
60
+ import { getBreadcrumb } from "@jx3box/jx3box-common/js/api_misc";
66
61
 
67
- left: this.own,
62
+ export default {
63
+ name: "BatchReward",
64
+ props: [
65
+ "boxcoin",
66
+ "postType",
67
+ "items",
68
+ "own",
69
+ "points",
70
+ "authors",
71
+ "client",
72
+ "postId",
73
+ "total",
74
+ "max",
75
+ "min",
76
+ ],
77
+ components: {
78
+ Contributors,
79
+ },
80
+ data: function () {
81
+ return {
82
+ visible: false,
83
+ count: 0,
68
84
 
69
- chargeLink: "/vip/boxcoin?redirect=" + location.href,
85
+ remark: "辛苦,感谢!",
86
+ left: this.own,
87
+ chargeLink: "/vip/boxcoin?redirect=" + location.href,
88
+ chosen: "", // 被选中的人
70
89
 
71
- chosen: "", // 被选中的人
72
- };
73
- },
74
- computed: {
75
- ready: function () {
76
- return this.isEnough && this.count && this.remark;
77
- },
78
- isEnough: function () {
79
- return this.left && this.left >= this.count;
80
- },
81
- allowBoxcoin: function () {
82
- return this.postType && this.authors && this.authors.length;
83
- },
84
- hostClient: function () {
85
- return location.href.includes("origin") ? "origin" : "std";
86
- },
87
- fitPoints: function () {
88
- return this.points;
89
- },
90
- },
91
- watch: {
92
- own: function (val) {
93
- this.left = val;
94
- },
95
- },
96
- methods: {
97
- openBoxcoinPop: function () {
98
- if (!(this.items && this.items.length))
99
- return this.$message({ message: `请选择需要打赏的作品`, type: "warning" });
100
- if (User.isLogin()) {
101
- this.visible = true;
102
- } else {
103
- User.toLogin();
104
- }
105
- },
106
- // 选择要打赏的对象
107
- handleChosen(userId) {
108
- this.chosen = userId;
109
- },
110
- submit: function () {
111
- batchReward(this.postType, this.count, {
112
- items: this.items,
113
- remark: this.remark,
114
- client: this.client || this.hostClient,
115
- })
116
- .then((res) => {
117
- return res.data.data;
118
- })
119
- .then((data) => {
120
- // 1.扣除额度
121
- data.success.map((item) => {
122
- this.$message({
123
- message: `作品${this.items[item.index].article_id}打赏成功`,
124
- type: "success",
125
- });
126
- this.left -= this.count;
127
- });
128
- data.fail.map((item) => {
129
- this.$message({
130
- message: `作品${this.items[item.index].article_id}打赏失败,原因:${item.msg}`,
131
- type: "error",
132
- });
133
- });
134
- })
135
- .finally(() => {
136
- this.visible = false;
137
- });
138
- },
139
- },
90
+ submitting: false,
91
+ fetchingCurrentRelease: false,
92
+ };
93
+ },
94
+ computed: {
95
+ used: function () {
96
+ return this.total - this.left;
97
+ },
98
+ ready: function () {
99
+ return this.isEnough && this.count && this.remark;
100
+ },
101
+ isEnough: function () {
102
+ return this.left && this.left >= this.count;
103
+ },
104
+ allowBoxcoin: function () {
105
+ return this.postType && this.authors && this.authors.length;
106
+ },
107
+ hostClient: function () {
108
+ return location.href.includes("origin") ? "origin" : "std";
109
+ },
110
+ fitPoints: function () {
111
+ return this.points.filter((item) => item <= this.left);
112
+ },
113
+ },
114
+ watch: {
115
+ own: function (val) {
116
+ this.left = val;
117
+ },
118
+ },
119
+ methods: {
120
+ openBoxcoinPop: function () {
121
+ if (!(this.items && this.items.length))
122
+ return this.$message({ message: `请选择需要打赏的作品`, type: "warning" });
123
+ this.visible = true;
124
+ },
125
+ // 选择要打赏的对象
126
+ handleChosen(userId) {
127
+ this.chosen = userId;
128
+ },
129
+ submit: function () {
130
+ this.submitting = true;
131
+ batchReward(this.postType, this.count, {
132
+ items: this.items,
133
+ remark: this.remark,
134
+ client: this.client || this.hostClient,
135
+ })
136
+ .then((res) => {
137
+ return res.data.data;
138
+ })
139
+ .then((data) => {
140
+ // 1.扣除额度
141
+ data.success.map((item) => {
142
+ this.$message({
143
+ message: `作品${this.items[item.index].article_id}打赏成功`,
144
+ type: "success",
145
+ });
146
+ this.left -= this.count;
147
+ });
148
+ data.fail.map((item) => {
149
+ this.$message({
150
+ message: `作品${this.items[item.index].article_id}打赏失败,原因:${item.msg}`,
151
+ type: "error",
152
+ });
153
+ });
154
+ })
155
+ .finally(() => {
156
+ this.submitting = false;
157
+ this.visible = false;
158
+ });
159
+ },
160
+ insertCurrentRelease: function () {
161
+ this.fetchingCurrentRelease = true;
162
+ getBreadcrumb(`current-release-${this.hostClient}`)
163
+ .then((res) => {
164
+ this.remark += res;
165
+ })
166
+ .catch((err) => {
167
+ this.$message({
168
+ message: "获取失败",
169
+ type: "error",
170
+ });
171
+ })
172
+ .finally(() => {
173
+ this.fetchingCurrentRelease = false;
174
+ });
175
+ },
176
+ },
140
177
  };
141
178
  </script>
142
-
143
- <style scoped lang="less">
144
- .w-boxcoin-user {
145
- .dbi;
146
- .x(left);
147
-
148
- .u-icon {
149
- .size(26px);
150
- .y;
151
- .pr;
152
- top: -2px;
153
- }
154
-
155
- .u-count {
156
- color: #888;
157
- .ml(10px);
158
- }
159
-
160
- .u-charge {
161
- .underline(@color-link);
162
- .ml(10px);
163
- }
164
- }
165
- </style>
@@ -2,8 +2,9 @@
2
2
  <div class="w-thx">
3
3
  <template v-if="type === 'batchReward'">
4
4
  <!-- 批量打赏 -->
5
- <batch-reward :postType="postType" :items="postId" :boxcoin="boxcoin" :own="user_left" :points="user_points"
6
- :authors="authors" :client="client" v-if="userBoxcoinEnable && boxcoin_enable"
5
+ <batch-reward :postType="postType" :items="postId" :boxcoin="boxcoin" :userId="userId" :own="admin_left" :points="admin_points"
6
+ :authors="authors" :client="client" v-if="hasRight && adminBoxcoinEnable && boxcoin_enable" :max="admin_max"
7
+ :min="admin_min" :total="admin_total"
7
8
  @updateRecord="updateRecord" />
8
9
  </template>
9
10
  <template v-else>