@jx3box/jx3box-common-ui 6.7.0 → 6.7.2

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.
@@ -394,7 +394,7 @@ body {
394
394
  .u-msg {
395
395
  display: block;
396
396
  // height: 32px;
397
- padding: 27px 14px 20px 14px;
397
+ padding: 27px 10px 20px 10px;
398
398
  &:hover {
399
399
  opacity: 0.7;
400
400
  }
@@ -611,13 +611,13 @@ body {
611
611
 
612
612
  .u-post {
613
613
  .db;
614
- padding: 24px 8px 24px 10px;
614
+ padding: 24px 10px;
615
615
  }
616
616
 
617
617
  .u-add {
618
618
  fill: #fff;
619
619
  vertical-align: middle;
620
- margin-right: 4px;
620
+ // margin-right: 4px;
621
621
  }
622
622
 
623
623
  &.on {
@@ -648,14 +648,14 @@ body {
648
648
 
649
649
  .u-coin {
650
650
  .db;
651
- .size(16px);
651
+ .size(15px);
652
652
  * {
653
653
  fill: #fff !important;
654
654
  }
655
655
  }
656
656
  .u-asset {
657
657
  .db;
658
- padding: (@header-height - 14px)/2 10px;
658
+ padding: 26px 10px 23px 10px;
659
659
  &:hover {
660
660
  .tm(0.7);
661
661
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "6.7.0",
3
+ "version": "6.7.2",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,39 +1,50 @@
1
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>
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
- name: "BatchReward",
45
- props: ["boxcoin", "postType", "items", "own", "points", "authors", "client"],
46
- components: {
47
- Contributors,
48
- },
49
- data: function () {
50
- return {
51
- visible: false,
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
- count: 0,
54
- remark: "辛苦了,谢谢大大!",
64
+ count: 0,
65
+ remark: "辛苦了,谢谢大大!",
55
66
 
56
- left: this.own,
67
+ left: this.own,
57
68
 
58
- chargeLink: "/vip/boxcoin?redirect=" + location.href,
69
+ chargeLink: "/vip/boxcoin?redirect=" + location.href,
59
70
 
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;
71
+ chosen: "", // 被选中的人
72
+ };
83
73
  },
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
- }
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
- handleChosen (userId) {
96
- this.chosen = userId;
91
+ watch: {
92
+ own: function (val) {
93
+ this.left = val;
94
+ },
97
95
  },
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
- });
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
- .dbi;
133
- .x(left);
145
+ .dbi;
146
+ .x(left);
134
147
 
135
- .u-icon {
136
- .size(26px);
137
- .y;
138
- .pr;
139
- top: -2px;
140
- }
148
+ .u-icon {
149
+ .size(26px);
150
+ .y;
151
+ .pr;
152
+ top: -2px;
153
+ }
141
154
 
142
- .u-count {
143
- color: #888;
144
- .ml(10px);
145
- }
155
+ .u-count {
156
+ color: #888;
157
+ .ml(10px);
158
+ }
146
159
 
147
- .u-charge {
148
- .underline(@color-link);
149
- .ml(10px);
150
- }
160
+ .u-charge {
161
+ .underline(@color-link);
162
+ .ml(10px);
163
+ }
151
164
  }
152
165
  </style>