@jx3box/jx3box-common-ui 6.6.5 → 6.6.8
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 +247 -59
- package/assets/css/left-sidebar.less +90 -94
- package/assets/data/box2.json +0 -117
- package/assets/img/header/bell.svg +1 -0
- package/assets/img/header/coin.svg +1 -0
- package/assets/img/header/edit.svg +1 -0
- package/assets/img/header/manage.svg +1 -0
- package/assets/img/header/send.svg +56 -0
- package/assets/img/header/vip.svg +1 -0
- package/assets/js/utils.js +28 -0
- package/index.js +1 -1
- package/package.json +3 -3
- package/service/thx.js +5 -0
- package/src/App.vue +29 -117
- package/src/Header.vue +7 -2
- package/src/LeftSidebar.vue +14 -12
- package/src/header/gameSwitch.vue +227 -0
- package/src/header/user.vue +179 -66
- package/src/interact/batchReward.vue +152 -0
- package/src/single/Thx.vue +35 -46
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="w-boxcoin-user">
|
|
3
|
+
<el-button @click="openBoxcoinPop" type="primary" size="mini">批量打赏</el-button>
|
|
4
|
+
<el-dialog title="投币打赏" :visible.sync="visible" custom-class="w-boxcoin-pop" append-to-body
|
|
5
|
+
:close-on-click-modal="false">
|
|
6
|
+
<div class="w-boxcoin-user-content">
|
|
7
|
+
<div class="u-left">
|
|
8
|
+
<em class="u-label">当前拥有盒币</em>
|
|
9
|
+
<b>{{ left }}</b>
|
|
10
|
+
<a class="u-charge" :href="chargeLink" target="_blank">[充值]</a>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="u-list">
|
|
13
|
+
<em class="u-label">❤️ 打赏</em>
|
|
14
|
+
<Contributors v-if="authors && authors.length" :authors="authors" @chosen="handleChosen" />
|
|
15
|
+
<div class="u-points">
|
|
16
|
+
<el-radio-group v-model="count">
|
|
17
|
+
<el-radio :label="item" v-for="item in fitPoints" :key="item" border>
|
|
18
|
+
<b>{{ item }}</b>盒币
|
|
19
|
+
</el-radio>
|
|
20
|
+
</el-radio-group>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="u-msg">
|
|
24
|
+
<em class="u-label">📝 寄语</em>
|
|
25
|
+
<div class="u-input">
|
|
26
|
+
<el-input v-model="remark" placeholder="请输入寄语(必填)" :minlength="2" :maxlength="30"
|
|
27
|
+
show-word-limit></el-input>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<span slot="footer" class="dialog-footer">
|
|
32
|
+
<el-button @click="visible = false">取 消</el-button>
|
|
33
|
+
<el-button type="primary" @click="submit" :disabled="!ready">确 定</el-button>
|
|
34
|
+
</span>
|
|
35
|
+
</el-dialog>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
import { batchReward } from "../../service/thx.js";
|
|
41
|
+
import User from "@jx3box/jx3box-common/js/user";
|
|
42
|
+
import Contributors from "./Contributors.vue";
|
|
43
|
+
export default {
|
|
44
|
+
name: "BatchReward",
|
|
45
|
+
props: ["boxcoin", "postType", "items", "own", "points", "authors", "client"],
|
|
46
|
+
components: {
|
|
47
|
+
Contributors,
|
|
48
|
+
},
|
|
49
|
+
data: function () {
|
|
50
|
+
return {
|
|
51
|
+
visible: false,
|
|
52
|
+
|
|
53
|
+
count: 0,
|
|
54
|
+
remark: "辛苦了,谢谢大大!",
|
|
55
|
+
|
|
56
|
+
left: this.own,
|
|
57
|
+
|
|
58
|
+
chargeLink: "/vip/boxcoin?redirect=" + location.href,
|
|
59
|
+
|
|
60
|
+
chosen: "", // 被选中的人
|
|
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;
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
methods: {
|
|
86
|
+
openBoxcoinPop: function () {
|
|
87
|
+
if (!(this.items && this.items.length)) return this.$message({ message: `请选择需要打赏的作品`, type: "warning", });
|
|
88
|
+
if (User.isLogin()) {
|
|
89
|
+
this.visible = true;
|
|
90
|
+
} else {
|
|
91
|
+
User.toLogin();
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
// 选择要打赏的对象
|
|
95
|
+
handleChosen (userId) {
|
|
96
|
+
this.chosen = userId;
|
|
97
|
+
},
|
|
98
|
+
submit: function () {
|
|
99
|
+
batchReward(this.postType, this.count, { items: this.items, remark: this.remark, client: this.client || this.hostClient, })
|
|
100
|
+
.then((res) => {
|
|
101
|
+
return res.data.data;
|
|
102
|
+
})
|
|
103
|
+
.then((data) => {
|
|
104
|
+
// 1.扣除额度
|
|
105
|
+
data.success.map(item => {
|
|
106
|
+
this.$message({
|
|
107
|
+
message: `作品${this.items[item.index].article_id}打赏成功`,
|
|
108
|
+
type: "success",
|
|
109
|
+
});
|
|
110
|
+
this.left -= this.count;
|
|
111
|
+
})
|
|
112
|
+
data.fail.map(item => {
|
|
113
|
+
this.$message({
|
|
114
|
+
message: `作品${this.items[item.index].article_id}打赏失败,原因:${item.msg}`,
|
|
115
|
+
type: "error",
|
|
116
|
+
});
|
|
117
|
+
})
|
|
118
|
+
})
|
|
119
|
+
.finally(() => {
|
|
120
|
+
this.visible = false;
|
|
121
|
+
});
|
|
122
|
+
},
|
|
123
|
+
init: function () { },
|
|
124
|
+
},
|
|
125
|
+
created: function () { },
|
|
126
|
+
mounted: function () { },
|
|
127
|
+
};
|
|
128
|
+
</script>
|
|
129
|
+
|
|
130
|
+
<style scoped lang="less">
|
|
131
|
+
.w-boxcoin-user {
|
|
132
|
+
.dbi;
|
|
133
|
+
.x(left);
|
|
134
|
+
|
|
135
|
+
.u-icon {
|
|
136
|
+
.size(26px);
|
|
137
|
+
.y;
|
|
138
|
+
.pr;
|
|
139
|
+
top: -2px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.u-count {
|
|
143
|
+
color: #888;
|
|
144
|
+
.ml(10px);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.u-charge {
|
|
148
|
+
.underline(@color-link);
|
|
149
|
+
.ml(10px);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
</style>
|
package/src/single/Thx.vue
CHANGED
|
@@ -1,50 +1,35 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="w-thx">
|
|
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
|
-
</div>
|
|
34
|
-
<div class="w-thx-records">
|
|
35
|
-
<boxcoin-records
|
|
36
|
-
:postId="postId"
|
|
37
|
-
:postType="postType"
|
|
38
|
-
:postClient="client"
|
|
39
|
-
:cacheRecord="cacheRecord"
|
|
40
|
-
:mode="mode"
|
|
41
|
-
/>
|
|
42
|
-
</div>
|
|
43
|
-
<div class="w-thx-copyright">
|
|
44
|
-
©
|
|
45
|
-
所有原创作品,著作权归作者所有,所有未经授权的非署名转载或抄袭将有权追究法律责任,所有法律事务由专聘律师代理。<br />
|
|
46
|
-
签约作者独家特约稿件,及所有魔盒官方评分作品用户一经兑现则视为有偿付费稿件,所有商业稿件的转载引用需同时征得魔盒平台授权。
|
|
47
|
-
</div>
|
|
3
|
+
<template v-if="type === 'batchReward'">
|
|
4
|
+
<!-- 批量打赏 -->
|
|
5
|
+
<BatchReward :postType="postType" :items="items" :boxcoin="boxcoin" :own="user_left" :points="user_points"
|
|
6
|
+
:authors="authors" :client="client" v-if="userBoxcoinEnable && boxcoin_enable"
|
|
7
|
+
@updateRecord="updateRecord" />
|
|
8
|
+
</template>
|
|
9
|
+
<template v-else>
|
|
10
|
+
<div class="w-thx-panel">
|
|
11
|
+
<boxcoin-admin :postId="postId" :postType="postType"
|
|
12
|
+
v-if="hasRight && adminBoxcoinEnable && boxcoin_enable" :userId="userId" :max="admin_max"
|
|
13
|
+
:min="admin_min" :own="admin_left" :total="admin_total" :points="admin_points" :authors="authors"
|
|
14
|
+
@updateRecord="updateRecord" :client="client" />
|
|
15
|
+
<Like :postId="postId" :postType="postType"></Like>
|
|
16
|
+
<fav :postId="postId" :postType="postType" :postTitle="postTitle"></fav>
|
|
17
|
+
<boxcoin-user :postId="postId" :postType="postType" :boxcoin="boxcoin" :userId="userId" :own="user_left"
|
|
18
|
+
:points="user_points" :authors="authors" v-if="userBoxcoinEnable && boxcoin_enable"
|
|
19
|
+
@updateRecord="updateRecord" :client="client" />
|
|
20
|
+
<Share :postId="postId" :postType="postType" :client="client" />
|
|
21
|
+
</div>
|
|
22
|
+
<div class="w-thx-records">
|
|
23
|
+
<boxcoin-records :postId="postId" :postType="postType" :postClient="client" :cacheRecord="cacheRecord"
|
|
24
|
+
:mode="mode" />
|
|
25
|
+
</div>
|
|
26
|
+
<div class="w-thx-copyright">
|
|
27
|
+
©
|
|
28
|
+
所有原创作品,著作权归作者所有,所有未经授权的非署名转载或抄袭将有权追究法律责任,所有法律事务由专聘律师代理。<br />
|
|
29
|
+
签约作者独家特约稿件,及所有魔盒官方评分作品用户一经兑现则视为有偿付费稿件,所有商业稿件的转载引用需同时征得魔盒平台授权。
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
48
33
|
</div>
|
|
49
34
|
</template>
|
|
50
35
|
|
|
@@ -52,6 +37,7 @@
|
|
|
52
37
|
import Like from "../interact/Like2.vue";
|
|
53
38
|
import Share from "../interact/Share2.vue";
|
|
54
39
|
import Fav from "../interact/Fav2.vue";
|
|
40
|
+
import BatchReward from "../interact/batchReward.vue";
|
|
55
41
|
import BoxcoinRecords from "../interact/boxcoin_records.vue";
|
|
56
42
|
import BoxcoinAdmin from "../interact/boxcoin_admin.vue";
|
|
57
43
|
import BoxcoinUser from "../interact/boxcoin_user.vue";
|
|
@@ -60,6 +46,7 @@ import { getPostBoxcoinConfig, getBoxcoinStatus } from "../../service/thx";
|
|
|
60
46
|
export default {
|
|
61
47
|
name: "Thx",
|
|
62
48
|
props: [
|
|
49
|
+
"type",
|
|
63
50
|
"postId",
|
|
64
51
|
"postType",
|
|
65
52
|
"postTitle",
|
|
@@ -69,11 +56,13 @@ export default {
|
|
|
69
56
|
"mode",
|
|
70
57
|
"authors",
|
|
71
58
|
"client",
|
|
59
|
+
"items"
|
|
72
60
|
],
|
|
73
61
|
components: {
|
|
74
62
|
Like,
|
|
75
63
|
Share,
|
|
76
64
|
Fav,
|
|
65
|
+
BatchReward,
|
|
77
66
|
"boxcoin-records": BoxcoinRecords,
|
|
78
67
|
"boxcoin-admin": BoxcoinAdmin,
|
|
79
68
|
"boxcoin-user": BoxcoinUser,
|
|
@@ -144,7 +133,7 @@ export default {
|
|
|
144
133
|
this.cacheRecord = data;
|
|
145
134
|
},
|
|
146
135
|
},
|
|
147
|
-
created: function () {},
|
|
136
|
+
created: function () { },
|
|
148
137
|
};
|
|
149
138
|
</script>
|
|
150
139
|
|