@jx3box/jx3box-common-ui 6.7.8 → 6.7.9

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": "6.7.8",
3
+ "version": "6.7.9",
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.8",
34
- "@jx3box/jx3box-common": "^7.6.2",
35
- "@jx3box/jx3box-data": "^3.0.3",
36
- "@jx3box/jx3box-editor": "^1.6.9",
34
+ "@jx3box/jx3box-common": "^7.6.3",
35
+ "@jx3box/jx3box-data": "^3.0.4",
36
+ "@jx3box/jx3box-editor": "^1.7.1",
37
37
  "axios": "^0.26.1",
38
38
  "dayjs": "^1.11.0",
39
39
  "element-ui": "^2.13.2",
@@ -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>