@jx3box/jx3box-common-ui 7.2.4 → 7.2.6

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-common-ui",
3
- "version": "7.2.4",
3
+ "version": "7.2.6",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -31,9 +31,9 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@jx3box/jx3box-comment-ui": "^1.7.12",
34
- "@jx3box/jx3box-common": "^7.8.7",
35
- "@jx3box/jx3box-data": "^3.0.9",
36
- "@jx3box/jx3box-editor": "^1.8.2",
34
+ "@jx3box/jx3box-common": "^7.8.9",
35
+ "@jx3box/jx3box-data": "^3.1.0",
36
+ "@jx3box/jx3box-editor": "^1.8.6",
37
37
  "axios": "^0.26.1",
38
38
  "dayjs": "^1.11.0",
39
39
  "element-ui": "^2.13.2",
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <a class="c-avatar" :href="authorLink(uid)" :class="size" :style="style">
2
+ <a class="c-avatar" :href="authorLink(uid)" :class="size" :style="style" target="_blank">
3
3
  <img :src="showAvatar(url)" class="c-avatar-pic" />
4
4
  <i class="c-avatar-frame" v-if="frame">
5
5
  <img :src="frameUrl" />
@@ -25,6 +25,8 @@
25
25
  <el-radio :label="item" v-for="item in fitPoints" :key="item" border>
26
26
  <b>{{item}}</b>盒币
27
27
  </el-radio>
28
+ <el-radio label="custom" border>自定义</el-radio>
29
+ <el-input v-model="amount" v-show="count === 'custom'" placeholder="输入自定义数量"></el-input>
28
30
  </el-radio-group>
29
31
  </div>
30
32
  </div>
@@ -69,6 +71,7 @@ export default {
69
71
  remark: "辛苦,感谢!",
70
72
  left : this.own,
71
73
  chosen: '', // 被选中的人
74
+ amount: "",
72
75
 
73
76
  submitting: false,
74
77
  fetchingCurrentRelease: false,
@@ -79,6 +82,7 @@ export default {
79
82
  return this.total - this.left;
80
83
  },
81
84
  ready: function () {
85
+ const count = this.count === "custom" ? this.amount : this.count;
82
86
  // 不能给自己打赏,打赏目标不能是自己
83
87
  // 打赏数量不能超过剩余数量
84
88
  // 打赏数量不能为0
@@ -87,7 +91,7 @@ export default {
87
91
  !this.isSelf &&
88
92
  !this.targetIsSelf &&
89
93
  this.isEnough &&
90
- this.count &&
94
+ count &&
91
95
  this.remark
92
96
  );
93
97
  },
@@ -98,7 +102,8 @@ export default {
98
102
  return this.chosen == this.userId;
99
103
  },
100
104
  isEnough: function () {
101
- return this.left && this.left >= this.count;
105
+ const count = this.count === "custom" ? this.amount : this.count;
106
+ return this.left && this.left >= count;
102
107
  },
103
108
  allowBoxcoin : function (){
104
109
  return this.postType && this.postId && (this.userId || (this.authors && this.authors.length))
@@ -125,7 +130,8 @@ export default {
125
130
  },
126
131
  submit: function () {
127
132
  this.submitting = true;
128
- grantBoxcoin(this.postType, this.postId, this.chosen || this.userId, this.count, {
133
+ const count = this.count === "custom" ? this.amount : this.count;
134
+ grantBoxcoin(this.postType, this.postId, this.chosen || this.userId, count, {
129
135
  remark: this.remark,
130
136
  client : this.client || this.hostClient
131
137
  })
@@ -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>
@@ -61,6 +63,7 @@ export default {
61
63
 
62
64
  count: 0,
63
65
  remark: "辛苦了,谢谢大大!",
66
+ amount: "",
64
67
 
65
68
  left : this.own,
66
69
 
@@ -71,13 +74,15 @@ export default {
71
74
  },
72
75
  computed: {
73
76
  ready: function () {
74
- return this.isNotSelf && this.isEnough && this.count && this.remark;
77
+ const count = this.count === 'custom' ? this.amount : this.count
78
+ return this.isNotSelf && this.isEnough && count && this.remark;
75
79
  },
76
80
  isNotSelf: function () {
77
81
  return this.userId != User.getInfo().uid;
78
82
  },
79
83
  isEnough: function () {
80
- return this.left && this.left >= this.count;
84
+ const count = this.count === 'custom' ? this.amount : this.count
85
+ return this.left && this.left >= count;
81
86
  },
82
87
  allowBoxcoin : function (){
83
88
  return this.postType && this.postId && (this.userId || (this.authors && this.authors.length))
@@ -87,6 +92,9 @@ export default {
87
92
  },
88
93
  fitPoints : function (){
89
94
  return this.points//.filter(item => item <= this.left)
95
+ },
96
+ isCustom(){
97
+ return this.count === 'custom'
90
98
  }
91
99
  },
92
100
  watch: {
@@ -107,7 +115,8 @@ export default {
107
115
  this.chosen = userId
108
116
  },
109
117
  submit: function () {
110
- rewardBoxcoin(this.postType, this.postId, this.chosen || this.userId, this.count, {
118
+ const count = this.count === 'custom' ? this.amount : this.count
119
+ rewardBoxcoin(this.postType, this.postId, this.chosen || this.userId, count, {
111
120
  remark: this.remark,
112
121
  client : this.client || this.hostClient
113
122
  })
@@ -127,12 +136,8 @@ export default {
127
136
  .finally(() => {
128
137
  this.visible = false;
129
138
  });
130
-
131
139
  },
132
- init: function () {},
133
140
  },
134
- created: function () {},
135
- mounted: function () {},
136
141
  };
137
142
  </script>
138
143