@jx3box/jx3box-common-ui 6.1.1 → 6.1.4

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": "6.1.1",
3
+ "version": "6.1.4",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -30,9 +30,9 @@
30
30
  "last 2 versions"
31
31
  ],
32
32
  "dependencies": {
33
- "@jx3box/jx3box-comment-ui": "^1.7.0",
33
+ "@jx3box/jx3box-comment-ui": "^1.7.1",
34
34
  "@jx3box/jx3box-common": "^7.4.0",
35
- "@jx3box/jx3box-data": "^1.10.10",
35
+ "@jx3box/jx3box-data": "^1.11.1",
36
36
  "@jx3box/jx3box-editor": "^1.4.8",
37
37
  "axios": "^0.26.1",
38
38
  "dayjs": "^1.11.0",
@@ -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>
@@ -5,7 +5,7 @@
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'">
8
- <i class="el-icon-lock" v-if="post.post_status == 'draft' || post.post_status == 'pending' || ~~post.visible" style="color:#fb9b24"></i>
8
+ <i class="el-icon-lock" v-if="post.post_status == 'draft' || post.post_status == 'pending' || !!~~post.visible" style="color:#fb9b24"></i>
9
9
  <i class="el-icon-delete" v-if="post.post_status == 'dustbin'" style="color:#c00"></i>
10
10
  </i>
11
11
  <span class="u-title-text">{{ title }}</span>