@jx3box/jx3box-vue3-ui 0.1.7 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-vue3-ui",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "JX3BOX Vue3 UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -31,6 +31,8 @@
31
31
  <b>{{ item }}</b
32
32
  >盒币
33
33
  </el-radio>
34
+ <el-radio label="custom" border>自定义</el-radio>
35
+ <el-input v-model="amount" v-show="count === 'custom'" placeholder="输入自定义数量"></el-input>
34
36
  </el-radio-group>
35
37
  </div>
36
38
  </div>
@@ -79,6 +81,7 @@ export default {
79
81
  remark: "辛苦,感谢!",
80
82
  left: this.own,
81
83
  chosen: "", // 被选中的人
84
+ amount: "",
82
85
 
83
86
  submitting: false,
84
87
  fetchingCurrentRelease: false,
@@ -89,13 +92,15 @@ export default {
89
92
  return this.total - this.left;
90
93
  },
91
94
  ready: function () {
92
- return this.isNotSelf && this.isEnough && this.count && this.remark;
95
+ const count = this.count === "custom" ? this.amount : this.count;
96
+ return this.isNotSelf && this.isEnough && count && this.remark;
93
97
  },
94
98
  isNotSelf: function () {
95
99
  return this.userId != User.getInfo().uid;
96
100
  },
97
101
  isEnough: function () {
98
- return this.left && this.left >= this.count;
102
+ const count = this.count === "custom" ? this.amount : this.count;
103
+ return this.left && this.left >= count;
99
104
  },
100
105
  allowBoxcoin: function () {
101
106
  return this.postType && this.postId && (this.userId || (this.authors && this.authors.length));
@@ -122,7 +127,8 @@ export default {
122
127
  },
123
128
  submit: function () {
124
129
  this.submitting = true;
125
- grantBoxcoin(this.postType, this.postId, this.chosen || this.userId, this.count, {
130
+ const count = this.count === "custom" ? this.amount : this.count;
131
+ grantBoxcoin(this.postType, this.postId, this.chosen || this.userId, count, {
126
132
  remark: this.remark,
127
133
  client: this.client || this.hostClient,
128
134
  })
@@ -21,6 +21,8 @@
21
21
  <el-radio :label="item" v-for="item in fitPoints" :key="item" border>
22
22
  <b>{{item}}</b>盒币
23
23
  </el-radio>
24
+ <el-radio label="custom" border>自定义</el-radio>
25
+ <el-input v-model="amount" v-show="count === 'custom'" placeholder="输入自定义数量"></el-input>
24
26
  </el-radio-group>
25
27
  </div>
26
28
  </div>
@@ -63,6 +65,7 @@ export default {
63
65
 
64
66
  count: 0,
65
67
  remark: "辛苦了,谢谢大大!",
68
+ amount: "",
66
69
 
67
70
  left : this.own,
68
71
 
@@ -73,13 +76,15 @@ export default {
73
76
  },
74
77
  computed: {
75
78
  ready: function () {
76
- return this.isNotSelf && this.isEnough && this.count && this.remark;
79
+ const count = this.count === 'custom' ? this.amount : this.count
80
+ return this.isNotSelf && this.isEnough && count && this.remark;
77
81
  },
78
82
  isNotSelf: function () {
79
83
  return this.userId != User.getInfo().uid;
80
84
  },
81
85
  isEnough: function () {
82
- return this.left && this.left >= this.count;
86
+ const count = this.count === 'custom' ? this.amount : this.count
87
+ return this.left && this.left >= count;
83
88
  },
84
89
  allowBoxcoin : function (){
85
90
  return this.postType && this.postId && (this.userId || (this.authors && this.authors.length))
@@ -109,7 +114,8 @@ export default {
109
114
  this.chosen = userId
110
115
  },
111
116
  submit: function () {
112
- rewardBoxcoin(this.postType, this.postId, this.chosen || this.userId, this.count, {
117
+ const count = this.count === 'custom' ? this.amount : this.count
118
+ rewardBoxcoin(this.postType, this.postId, this.chosen || this.userId, count, {
113
119
  remark: this.remark,
114
120
  client : this.client || this.hostClient
115
121
  })