@jx3box/jx3box-common-ui 6.7.0 → 6.7.1
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/assets/css/header.less +2 -2
- package/package.json +1 -1
- package/src/interact/batchReward.vue +139 -126
package/assets/css/header.less
CHANGED
|
@@ -648,14 +648,14 @@ body {
|
|
|
648
648
|
|
|
649
649
|
.u-coin {
|
|
650
650
|
.db;
|
|
651
|
-
.size(
|
|
651
|
+
.size(15px);
|
|
652
652
|
* {
|
|
653
653
|
fill: #fff !important;
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
656
|
.u-asset {
|
|
657
657
|
.db;
|
|
658
|
-
padding:
|
|
658
|
+
padding: 26px 10px 23px 10px;
|
|
659
659
|
&:hover {
|
|
660
660
|
.tm(0.7);
|
|
661
661
|
}
|
package/package.json
CHANGED
|
@@ -1,39 +1,50 @@
|
|
|
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
|
-
|
|
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>
|
|
37
48
|
</template>
|
|
38
49
|
|
|
39
50
|
<script>
|
|
@@ -41,112 +52,114 @@ import { batchReward } from "../../service/thx.js";
|
|
|
41
52
|
import User from "@jx3box/jx3box-common/js/user";
|
|
42
53
|
import Contributors from "./Contributors.vue";
|
|
43
54
|
export default {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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,
|
|
52
63
|
|
|
53
|
-
|
|
54
|
-
|
|
64
|
+
count: 0,
|
|
65
|
+
remark: "辛苦了,谢谢大大!",
|
|
55
66
|
|
|
56
|
-
|
|
67
|
+
left: this.own,
|
|
57
68
|
|
|
58
|
-
|
|
69
|
+
chargeLink: "/vip/boxcoin?redirect=" + location.href,
|
|
59
70
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
computed: {
|
|
64
|
-
ready: function () {
|
|
65
|
-
return this.isEnough && this.count && this.remark;
|
|
66
|
-
},
|
|
67
|
-
isEnough: function () {
|
|
68
|
-
return this.left && this.left >= this.count;
|
|
69
|
-
},
|
|
70
|
-
allowBoxcoin: function () {
|
|
71
|
-
return this.postType && (this.authors && this.authors.length);
|
|
72
|
-
},
|
|
73
|
-
hostClient: function () {
|
|
74
|
-
return location.href.includes("origin") ? "origin" : "std";
|
|
75
|
-
},
|
|
76
|
-
fitPoints: function () {
|
|
77
|
-
return this.points;
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
watch: {
|
|
81
|
-
own: function (val) {
|
|
82
|
-
this.left = val;
|
|
71
|
+
chosen: "", // 被选中的人
|
|
72
|
+
};
|
|
83
73
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
+
},
|
|
93
90
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
watch: {
|
|
92
|
+
own: function (val) {
|
|
93
|
+
this.left = val;
|
|
94
|
+
},
|
|
97
95
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
this.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
this
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
+
},
|
|
122
139
|
},
|
|
123
|
-
init: function () { },
|
|
124
|
-
},
|
|
125
|
-
created: function () { },
|
|
126
|
-
mounted: function () { },
|
|
127
140
|
};
|
|
128
141
|
</script>
|
|
129
142
|
|
|
130
143
|
<style scoped lang="less">
|
|
131
144
|
.w-boxcoin-user {
|
|
132
|
-
|
|
133
|
-
|
|
145
|
+
.dbi;
|
|
146
|
+
.x(left);
|
|
134
147
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
148
|
+
.u-icon {
|
|
149
|
+
.size(26px);
|
|
150
|
+
.y;
|
|
151
|
+
.pr;
|
|
152
|
+
top: -2px;
|
|
153
|
+
}
|
|
141
154
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
155
|
+
.u-count {
|
|
156
|
+
color: #888;
|
|
157
|
+
.ml(10px);
|
|
158
|
+
}
|
|
146
159
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
160
|
+
.u-charge {
|
|
161
|
+
.underline(@color-link);
|
|
162
|
+
.ml(10px);
|
|
163
|
+
}
|
|
151
164
|
}
|
|
152
165
|
</style>
|