@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 +4 -4
- package/src/interact/batchReward.vue +167 -154
- package/src/single/Thx.vue +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-common-ui",
|
|
3
|
-
"version": "6.7.
|
|
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.
|
|
35
|
-
"@jx3box/jx3box-data": "^3.0.
|
|
36
|
-
"@jx3box/jx3box-editor": "^1.
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
85
|
+
remark: "辛苦,感谢!",
|
|
86
|
+
left: this.own,
|
|
87
|
+
chargeLink: "/vip/boxcoin?redirect=" + location.href,
|
|
88
|
+
chosen: "", // 被选中的人
|
|
70
89
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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>
|
package/src/single/Thx.vue
CHANGED
|
@@ -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="
|
|
6
|
-
:authors="authors" :client="client" v-if="
|
|
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>
|