@jx3box/jx3box-common-ui 6.0.9 → 6.1.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.
@@ -118,6 +118,7 @@
118
118
  padding:4px 10px;
119
119
  &:last-child{border:none;}
120
120
  display:flex;
121
+ white-space: nowrap;
121
122
  }
122
123
  .u-meta{
123
124
  .db;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "6.0.9",
3
+ "version": "6.1.2",
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.0",
34
- "@jx3box/jx3box-common": "^7.3.11",
35
- "@jx3box/jx3box-data": "^1.10.6",
36
- "@jx3box/jx3box-editor": "^1.4.5",
34
+ "@jx3box/jx3box-common": "^7.4.0",
35
+ "@jx3box/jx3box-data": "^1.10.10",
36
+ "@jx3box/jx3box-editor": "^1.4.8",
37
37
  "axios": "^0.26.1",
38
38
  "dayjs": "^1.11.0",
39
39
  "element-ui": "^2.13.2",
@@ -1,62 +1,69 @@
1
- <template>
2
- <div class="w-like2" :class="{ disabled:!status }" @click="addLike">
3
- <el-tooltip effect="dark" content="点赞" placement="top-start">
4
- <div>
5
- <img
6
- class="u-icon"
7
- svg-inline
8
- src="../../assets/img/widget/like2.svg"
9
- />
10
- <span class="u-count" v-if="count">{{ count }}</span>
11
- </div>
12
- </el-tooltip>
13
- </div>
14
- </template>
15
-
16
- <script>
17
- import { postStat, getStat } from "@jx3box/jx3box-common/js/stat";
18
- import { getRewrite } from "@jx3box/jx3box-common/js/utils";
19
- import _ from "lodash";
20
- export default {
21
- name: "Like2",
22
- props: ["postType", "postId"],
23
- data: function () {
24
- return {
25
- status: true,
26
- count: 0,
27
- };
28
- },
29
- computed: {
30
- ready() {
31
- return !!(this.postType && this.postId);
32
- },
33
- },
34
- methods: {
35
- init: function () {
36
- this.loadStat();
37
- },
38
- loadStat: function () {
39
- this.ready &&
40
- getStat(this.postType, this.postId).then((res) => {
41
- this.count = res.data?.likes || 0;
42
- });
43
- },
44
- // 点赞
45
- addLike: function () {
46
- if (!this.ready) return;
47
- this.count++;
48
- if (this.status) {
49
- postStat(this.postType, this.postId, "likes");
50
- }
51
- this.status = false;
52
- },
53
- },
54
- mounted: function () {
55
- this.init();
56
- },
57
- };
58
- </script>
59
-
60
- <style lang="less">
61
- @import "../../assets/css/like2.less";
62
- </style>
1
+ <!--
2
+ * @Author: iRuxu
3
+ * @Date: 2022-04-29 22:34:07
4
+ * @LastEditTime: 2022-07-24 16:51:43
5
+ * @Description:
6
+ -->
7
+ <template>
8
+ <div class="w-like2" :class="{ disabled:!status }" @click="addLike" v-if="ready">
9
+ <el-tooltip effect="dark" content="点赞" placement="top-start">
10
+ <div>
11
+ <img
12
+ class="u-icon"
13
+ svg-inline
14
+ src="../../assets/img/widget/like2.svg"
15
+ />
16
+ <span class="u-count" v-if="count">{{ count }}</span>
17
+ </div>
18
+ </el-tooltip>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ import { postStat, getStat } from "@jx3box/jx3box-common/js/stat";
24
+ import { getRewrite } from "@jx3box/jx3box-common/js/utils";
25
+ import _ from "lodash";
26
+ export default {
27
+ name: "Like2",
28
+ props: ["postType", "postId"],
29
+ data: function () {
30
+ return {
31
+ status: true,
32
+ count: 0,
33
+ };
34
+ },
35
+ computed: {
36
+ ready() {
37
+ return this.postType && this.postId;
38
+ },
39
+ },
40
+ methods: {
41
+ init: function () {
42
+ this.loadStat();
43
+ },
44
+ loadStat: function () {
45
+ getStat(this.postType, this.postId).then((res) => {
46
+ this.count = res.data.likes || 0;
47
+ });
48
+ },
49
+ // 点赞
50
+ addLike: function () {
51
+ if (!this.ready) return;
52
+ this.count++;
53
+ if (this.status) {
54
+ postStat(this.postType, this.postId, "likes");
55
+ }
56
+ this.status = false;
57
+ },
58
+ },
59
+ watch : {
60
+ postId : function (val){
61
+ this.init();
62
+ }
63
+ }
64
+ };
65
+ </script>
66
+
67
+ <style lang="less">
68
+ @import "../../assets/css/like2.less";
69
+ </style>
@@ -12,39 +12,31 @@
12
12
  <span class="u-meta u-remark">寄语</span>
13
13
  <time class="u-meta u-time"></time>
14
14
  </li>
15
- <li v-for="(item,i) in list" :key="i" class="u-item u-body">
15
+ <li v-for="(item, i) in list" :key="i" class="u-item u-body">
16
16
  <span class="u-meta u-action">
17
17
  <template v-if="item.is_user_gift">
18
- <i title="打赏"><img class svg-inline src="../../assets/img/widget/gift.svg"/></i>
18
+ <i title="打赏"><img class svg-inline src="../../assets/img/widget/gift.svg" /></i>
19
19
  </template>
20
20
  <template v-else>
21
- <i title="品鉴"><img class svg-inline src="../../assets/img/widget/admin_gift.svg"/></i>
21
+ <i title="品鉴"><img class svg-inline src="../../assets/img/widget/admin_gift.svg" /></i>
22
22
  </template>
23
23
  </span>
24
- <a
25
- class="u-meta u-user"
26
- :href="authorLink(item.operate_user_id)"
27
- target="_blank"
28
- >
24
+ <a class="u-meta u-user" :href="authorLink(item.operate_user_id)" target="_blank">
29
25
  <img class="u-user-avatar" :src="showAvatar(item.ext_operate_user_info.avatar)" alt />
30
- <span>{{item.ext_operate_user_info.display_name}}</span>
26
+ <span>{{ item.ext_operate_user_info.display_name }}</span>
31
27
  </a>
32
- <a
33
- class="u-meta u-user"
34
- :href="authorLink(item.user_id)"
35
- target="_blank"
36
- >
28
+ <a class="u-meta u-user" :href="authorLink(item.user_id)" target="_blank">
37
29
  <img class="u-user-avatar" :src="showAvatar(item.ext_user_info.avatar)" alt />
38
- <span>{{item.ext_user_info.display_name}}</span>
30
+ <span>{{ item.ext_user_info.display_name }}</span>
39
31
  </a>
40
32
  <span class="u-meta u-count">
41
33
  +
42
- <b>{{item.count}}</b>
34
+ <b>{{ item.count + item.ext_take_off_count + ~~item.ext2_take_off_count }}</b>
43
35
  </span>
44
- <span class="u-meta u-remark">{{item.remark}}</span>
45
- <time class="u-meta u-time">{{showTime(item.created_at)}}</time>
46
- <span class="u-client" v-if="isSuperAdmin">{{item.client}}</span>
47
- <span class="u-delete" v-if="isSuperAdmin" @click="recovery(item,i)">
36
+ <span class="u-meta u-remark">{{ item.remark }}</span>
37
+ <time class="u-meta u-time">{{ showTime(item.created_at) }}</time>
38
+ <span class="u-client" v-if="isSuperAdmin">{{ item.client }}</span>
39
+ <span class="u-delete" v-if="isSuperAdmin" @click="recovery(item, i)">
48
40
  <i class="el-icon-delete"></i>撤销
49
41
  </span>
50
42
  </li>
@@ -69,7 +61,7 @@ import { showAvatar, authorLink } from "@jx3box/jx3box-common/js/utils";
69
61
  import { showTime } from "@jx3box/jx3box-common/js/moment";
70
62
  export default {
71
63
  name: "BoxcoinRecords",
72
- props: ["postType", "postId", "cacheRecord",'postClient','mode'],
64
+ props: ["postType", "postId", "cacheRecord", "postClient", "mode"],
73
65
  components: {},
74
66
  data: function () {
75
67
  return {
@@ -83,8 +75,8 @@ export default {
83
75
  };
84
76
  },
85
77
  computed: {
86
- post_keys : function (){
87
- return [this.postType,this.postId]
78
+ post_keys: function () {
79
+ return [this.postType, this.postId];
88
80
  },
89
81
  params: function () {
90
82
  return {
@@ -95,12 +87,12 @@ export default {
95
87
  },
96
88
  },
97
89
  watch: {
98
- post_keys : {
99
- immediate : true,
100
- deep : true,
101
- handler : function (){
90
+ post_keys: {
91
+ immediate: true,
92
+ deep: true,
93
+ handler: function () {
102
94
  this.postType && this.postId && this.loadData();
103
- }
95
+ },
104
96
  },
105
97
  params: {
106
98
  deep: true,
@@ -112,26 +104,23 @@ export default {
112
104
  deep: true,
113
105
  handler: function (data) {
114
106
  if (data) {
115
- this.list.push(data)
107
+ this.list.push(data);
116
108
  // 清空父组件的cache
117
109
  this.$parent.cacheRecord = null;
118
110
  }
119
- }
120
- }
111
+ },
112
+ },
121
113
  },
122
114
  methods: {
123
115
  loadData: function () {
124
- getPostBoxcoinRecords(this.postType, this.postId, this.params).then(
125
- (res) => {
126
- this.list = res.data.data.list;
127
- this.total = res.data.data.page.total;
128
- this.boxcoin =
129
- res.data.data.fromManager + res.data.data.fromUser;
130
- this.$parent.boxcoin = this.boxcoin;
131
- }
132
- );
116
+ getPostBoxcoinRecords(this.postType, this.postId, this.params).then((res) => {
117
+ this.list = res.data.data.list;
118
+ this.total = res.data.data.page.total;
119
+ this.boxcoin = res.data.data.fromManager + res.data.data.fromUser;
120
+ this.$parent.boxcoin = this.boxcoin;
121
+ });
133
122
  },
134
- recovery: function (item,i) {
123
+ recovery: function (item, i) {
135
124
  this.$alert("是否确定撤销该评分?", "确认", {
136
125
  confirmButtonText: "确定",
137
126
  callback: (action) => {
@@ -141,9 +130,8 @@ export default {
141
130
  message: "撤销成功",
142
131
  type: "success",
143
132
  });
144
- this.list.splice(i,1)
145
- })
146
-
133
+ this.list.splice(i, 1);
134
+ });
147
135
  }
148
136
  },
149
137
  });