@jx3box/jx3box-vue3-ui 0.1.12 → 0.2.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.
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -44,21 +44,20 @@
|
|
|
44
44
|
<RightSidebar>
|
|
45
45
|
<PostTopic type="bps" :id="48857"></PostTopic>
|
|
46
46
|
</RightSidebar>
|
|
47
|
-
<Footer>
|
|
48
|
-
</Footer>
|
|
47
|
+
<Footer> </Footer>
|
|
49
48
|
<!-- <Bottom></Bottom> -->
|
|
50
49
|
</Main>
|
|
51
50
|
</div>
|
|
52
51
|
</template>
|
|
53
52
|
|
|
54
53
|
<script>
|
|
55
|
-
import Author from
|
|
54
|
+
import Author from "./single/Author.vue";
|
|
56
55
|
import SimpleThxVue from "./single/SimpleThx.vue";
|
|
57
56
|
import Comment from "./single/Comment.vue";
|
|
58
57
|
import Thx from "./single/Thx.vue";
|
|
59
|
-
import PostHeader from
|
|
58
|
+
import PostHeader from "./single/PostHeader.vue";
|
|
60
59
|
import PostTopic from "./single/PostTopic.vue";
|
|
61
|
-
import axios from "axios"
|
|
60
|
+
import axios from "axios";
|
|
62
61
|
export default {
|
|
63
62
|
name: "App",
|
|
64
63
|
components: {
|
|
@@ -67,13 +66,13 @@ export default {
|
|
|
67
66
|
Comment,
|
|
68
67
|
Thx,
|
|
69
68
|
PostHeader,
|
|
70
|
-
PostTopic
|
|
69
|
+
PostTopic,
|
|
71
70
|
},
|
|
72
71
|
data() {
|
|
73
72
|
return {
|
|
74
|
-
post_id: "
|
|
75
|
-
post: ""
|
|
76
|
-
}
|
|
73
|
+
post_id: "60031",
|
|
74
|
+
post: "",
|
|
75
|
+
};
|
|
77
76
|
},
|
|
78
77
|
watch: {
|
|
79
78
|
post_id: {
|
|
@@ -89,7 +88,7 @@ export default {
|
|
|
89
88
|
this.post = res.data.data;
|
|
90
89
|
this.$forceUpdate();
|
|
91
90
|
});
|
|
92
|
-
}
|
|
93
|
-
}
|
|
91
|
+
},
|
|
92
|
+
},
|
|
94
93
|
};
|
|
95
94
|
</script>
|
|
@@ -2,15 +2,21 @@
|
|
|
2
2
|
<div class="w-boxcoin-user" v-if="allowBoxcoin">
|
|
3
3
|
<el-tooltip effect="dark" content="投币" placement="top-start">
|
|
4
4
|
<div class="w-boxcoin-block" @click="openBoxcoinPop">
|
|
5
|
-
<img class="u-icon" svg-inline src="
|
|
6
|
-
<span class="u-count" v-if="boxcoin">{{boxcoin}}</span>
|
|
5
|
+
<img class="u-icon" svg-inline :src="likeImg" />
|
|
6
|
+
<span class="u-count" v-if="boxcoin">{{ boxcoin }}</span>
|
|
7
7
|
</div>
|
|
8
8
|
</el-tooltip>
|
|
9
|
-
<el-dialog
|
|
9
|
+
<el-dialog
|
|
10
|
+
title="投币打赏"
|
|
11
|
+
v-model="visible"
|
|
12
|
+
class="w-boxcoin-pop"
|
|
13
|
+
append-to-body
|
|
14
|
+
:close-on-click-modal="false"
|
|
15
|
+
>
|
|
10
16
|
<div class="w-boxcoin-user-content">
|
|
11
17
|
<div class="u-left">
|
|
12
18
|
<em class="u-label">当前拥有盒币</em>
|
|
13
|
-
<b>{{left}}</b>
|
|
19
|
+
<b>{{ left }}</b>
|
|
14
20
|
<a class="u-charge" :href="chargeLink" target="_blank">[充值]</a>
|
|
15
21
|
</div>
|
|
16
22
|
<div class="u-list">
|
|
@@ -19,10 +25,15 @@
|
|
|
19
25
|
<div class="u-points">
|
|
20
26
|
<el-radio-group v-model="count">
|
|
21
27
|
<el-radio :label="item" v-for="item in fitPoints" :key="item" border>
|
|
22
|
-
<b>{{item}}</b
|
|
28
|
+
<b>{{ item }}</b
|
|
29
|
+
>盒币
|
|
23
30
|
</el-radio>
|
|
24
31
|
<el-radio label="custom" border>自定义</el-radio>
|
|
25
|
-
<el-input
|
|
32
|
+
<el-input
|
|
33
|
+
v-model="amount"
|
|
34
|
+
v-show="count === 'custom'"
|
|
35
|
+
placeholder="输入自定义数量"
|
|
36
|
+
></el-input>
|
|
26
37
|
</el-radio-group>
|
|
27
38
|
</div>
|
|
28
39
|
</div>
|
|
@@ -52,12 +63,13 @@
|
|
|
52
63
|
<script>
|
|
53
64
|
import { rewardBoxcoin } from "../../service/thx.js";
|
|
54
65
|
import User from "@jx3box/jx3box-common/js/user";
|
|
55
|
-
import Contributors from
|
|
66
|
+
import Contributors from "./Contributors.vue";
|
|
67
|
+
import { debounce } from "lodash";
|
|
56
68
|
export default {
|
|
57
69
|
name: "BoxcoinUser",
|
|
58
|
-
props: ["boxcoin", "postType", "postId", "userId", "own", "points", "authors",
|
|
70
|
+
props: ["boxcoin", "postType", "postId", "userId", "own", "points", "authors", "client"],
|
|
59
71
|
components: {
|
|
60
|
-
Contributors
|
|
72
|
+
Contributors,
|
|
61
73
|
},
|
|
62
74
|
data: function () {
|
|
63
75
|
return {
|
|
@@ -67,75 +79,81 @@ export default {
|
|
|
67
79
|
remark: "辛苦了,谢谢大大!",
|
|
68
80
|
amount: "",
|
|
69
81
|
|
|
70
|
-
left
|
|
82
|
+
left: this.own,
|
|
71
83
|
|
|
72
84
|
chargeLink: "/vip/boxcoin?redirect=" + location.href,
|
|
73
85
|
|
|
74
|
-
chosen:
|
|
86
|
+
chosen: "", // 被选中的人
|
|
87
|
+
|
|
88
|
+
likeImg: require("../../assets/img/widget/like4.png"),
|
|
75
89
|
};
|
|
76
90
|
},
|
|
77
91
|
computed: {
|
|
78
92
|
ready: function () {
|
|
79
|
-
const count = this.count ===
|
|
93
|
+
const count = this.count === "custom" ? this.amount : this.count;
|
|
80
94
|
return this.isNotSelf && this.isEnough && count && this.remark;
|
|
81
95
|
},
|
|
82
96
|
isNotSelf: function () {
|
|
83
97
|
return this.userId != User.getInfo().uid;
|
|
84
98
|
},
|
|
85
99
|
isEnough: function () {
|
|
86
|
-
const count = this.count ===
|
|
100
|
+
const count = this.count === "custom" ? this.amount : this.count;
|
|
87
101
|
return this.left && this.left >= count;
|
|
88
102
|
},
|
|
89
|
-
allowBoxcoin
|
|
90
|
-
return this.postType && this.postId && (this.userId || (this.authors && this.authors.length))
|
|
103
|
+
allowBoxcoin: function () {
|
|
104
|
+
return this.postType && this.postId && (this.userId || (this.authors && this.authors.length));
|
|
105
|
+
},
|
|
106
|
+
hostClient: function () {
|
|
107
|
+
return location.href.includes("origin") ? "origin" : "std";
|
|
91
108
|
},
|
|
92
|
-
|
|
93
|
-
return
|
|
109
|
+
fitPoints: function () {
|
|
110
|
+
return this.points; //.filter(item => item <= this.left)
|
|
94
111
|
},
|
|
95
|
-
fitPoints : function (){
|
|
96
|
-
return this.points //.filter(item => item <= this.left)
|
|
97
|
-
}
|
|
98
112
|
},
|
|
99
113
|
watch: {
|
|
100
|
-
own
|
|
101
|
-
this.left = val
|
|
102
|
-
}
|
|
114
|
+
own: function (val) {
|
|
115
|
+
this.left = val;
|
|
116
|
+
},
|
|
103
117
|
},
|
|
104
118
|
methods: {
|
|
105
119
|
openBoxcoinPop: function () {
|
|
106
120
|
if (User.isLogin()) {
|
|
121
|
+
this.likeImg = require("../../assets/img/widget/like4ing.gif");
|
|
107
122
|
this.visible = true;
|
|
123
|
+
|
|
124
|
+
debounce(() => {
|
|
125
|
+
this.likeImg = require("../../assets/img/widget/like4.png");
|
|
126
|
+
}, 2800)();
|
|
108
127
|
} else {
|
|
109
128
|
User.toLogin();
|
|
110
129
|
}
|
|
111
130
|
},
|
|
112
131
|
// 选择要打赏的对象
|
|
113
132
|
handleChosen(userId) {
|
|
114
|
-
this.chosen = userId
|
|
133
|
+
this.chosen = userId;
|
|
115
134
|
},
|
|
116
135
|
submit: function () {
|
|
117
|
-
const count = this.count ===
|
|
136
|
+
const count = this.count === "custom" ? this.amount : this.count;
|
|
118
137
|
rewardBoxcoin(this.postType, this.postId, this.chosen || this.userId, count, {
|
|
119
138
|
remark: this.remark,
|
|
120
|
-
client
|
|
139
|
+
client: this.client || this.hostClient,
|
|
121
140
|
})
|
|
122
141
|
.then((res) => {
|
|
123
142
|
this.$message({
|
|
124
143
|
message: "操作成功",
|
|
125
144
|
type: "success",
|
|
126
145
|
});
|
|
127
|
-
return res.data.data
|
|
146
|
+
return res.data.data;
|
|
128
147
|
})
|
|
129
148
|
.then((data) => {
|
|
130
149
|
// 1.扣除额度
|
|
131
150
|
this.left -= this.count;
|
|
132
151
|
// 2. 将新增emit出去
|
|
133
|
-
this.$emit(
|
|
152
|
+
this.$emit("updateRecord", data);
|
|
134
153
|
})
|
|
135
154
|
.finally(() => {
|
|
136
155
|
this.visible = false;
|
|
137
156
|
});
|
|
138
|
-
|
|
139
157
|
},
|
|
140
158
|
init: function () {},
|
|
141
159
|
},
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<span class="u-title u-sub-block" :href="url" :title="title">
|
|
6
6
|
<i class="u-original" v-if="isOriginal">原创</i>
|
|
7
7
|
<i class="u-private" v-if="post.post_status != 'publish' || !!~~post.visible">
|
|
8
|
-
<
|
|
9
|
-
class="el-icon-lock"
|
|
8
|
+
<el-icon
|
|
10
9
|
v-if="post.post_status == 'draft' || post.post_status == 'pending' || !!~~post.visible"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
color="#fb9b24"
|
|
11
|
+
><Lock></Lock
|
|
12
|
+
></el-icon>
|
|
13
|
+
<el-icon v-if="post.post_status == 'dustbin'" color="#c00"><Delete></Delete></el-icon>
|
|
14
14
|
</i>
|
|
15
15
|
<span class="u-title-text">{{ title }}</span>
|
|
16
16
|
</span>
|
|
@@ -185,7 +185,7 @@ export default {
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
.u-private {
|
|
188
|
-
.y(-
|
|
188
|
+
.y(-4px);
|
|
189
189
|
margin-right: 5px;
|
|
190
190
|
color: #111;
|
|
191
191
|
}
|