@jx3box/jx3box-vue3-ui 0.9.13 → 0.9.15

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.9.13",
3
+ "version": "0.9.15",
4
4
  "description": "JX3BOX Vue3 UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/service/author.js CHANGED
@@ -63,15 +63,19 @@ function userSignIn() {
63
63
  return $pay({ mute: true }).get(`/api/personal/task/everyday/sign-in`);
64
64
  }
65
65
 
66
- function getFansList(userid) {
67
- return $pay().get(`/api/cny/consume/user-charge/rank/of/${userid}?limit=0`);
68
- }
69
-
70
66
  // 获取指定表情
71
67
  function getEmotion(id) {
72
68
  return $cms().get(`/api/cms/post/emotion/${id}`);
73
69
  }
74
70
 
71
+ function getFansList(userid, limit) {
72
+ return $next().get(`/api/next2/rss/user-list/author/${userid}/vip-subscriber?limit=${limit}`)
73
+ }
74
+
75
+ function getSummary(uid) {
76
+ return $next().get(`/api/next2/rss/summary/author/${uid}`)
77
+ }
78
+
75
79
  export {
76
80
  getUserInfo,
77
81
  getUserPosts,
@@ -85,4 +89,6 @@ export {
85
89
  getFansList,
86
90
  getUserInfoByUidOrName,
87
91
  getEmotion,
92
+ getSummary
93
+
88
94
  };
package/src/Header.vue CHANGED
@@ -37,6 +37,7 @@ import nav from "./header/Nav.vue";
37
37
  import user from "./header/User.vue";
38
38
  import Box from "../src/Box.vue";
39
39
  import { isMiniProgram, miniprogramHack } from "@jx3box/jx3box-common/js/utils";
40
+ import miniprogram from "@jx3box/jx3box-common/data/miniprogram.json";
40
41
 
41
42
  export default {
42
43
  name: "CommonHeader",
@@ -60,10 +61,24 @@ export default {
60
61
  }
61
62
 
62
63
  if (isMiniProgram()) {
63
- document.documentElement.classList.add("wechat-miniprogram");
64
+ const urlParams = new URLSearchParams(window.location.search);
65
+ const appid = urlParams.get("appid");
66
+ const item = miniprogram?.find((item) => item.appid === appid);
64
67
 
65
- // 微信小程序hack
66
- miniprogramHack();
68
+ document.documentElement.classList.add("v-miniprogram");
69
+
70
+ if (appid && item) {
71
+ document.documentElement.classList.add("env-miniprogram" + item.id);
72
+
73
+ window.JX3BOX_ENV = item.id?.toUpperCase() + "_MINIPROGRAM";
74
+ } else {
75
+ document.documentElement.classList.add("wechat-miniprogram");
76
+
77
+ window.JX3BOX_ENV = "MINIPROGRAM";
78
+
79
+ // 微信小程序hack
80
+ miniprogramHack();
81
+ }
67
82
  }
68
83
  },
69
84
 
@@ -8,27 +8,26 @@
8
8
  <el-tooltip
9
9
  class="item"
10
10
  effect="dark"
11
- :content="'累计打赏' + item.money.toString() + '金箔'"
11
+ :content="'累计打赏' + item.summary.toString() + '盒币'"
12
12
  placement="top"
13
13
  v-for="item in list"
14
14
  :key="item.pay_user_id"
15
15
  >
16
- <a class="u-fan" :href="authorLink(item.pay_user_id)"
17
- ><el-avatar class="u-avatar" shape="circle" :size="20" :src="showAvatar(item.pay_user.avatar)"
18
- ><el-icon><Avatar/></el-icon></el-avatar
16
+ <a class="u-fan" :href="authorLink(item.user_id)"
17
+ ><el-avatar class="u-avatar" shape="circle" :size="20" :src="showAvatar(item.user_info.avatar)"
18
+ ><i class="el-icon-s-custom"></i></el-avatar
19
19
  ></a>
20
20
  </el-tooltip>
21
- <el-avatar class="u-avatar u-more" shape="circle" :size="20" v-if="total > MAX_LENGTH">
22
- <span class="f-avatar-num" v-if="total > 99">···</span>
23
- <span class="f-avatar-num" v-else>+{{ total - MAX_LENGTH }}</span>
24
- </el-avatar>
25
21
  </div>
26
- <div class="f-bottom">本赛季共 {{ total }} 人为TA赠礼</div>
22
+ <div class="f-bottom">
23
+ 粉丝数: <span class="u-count">{{ fans_count }}</span
24
+ ><template v-if="boxcoin_count">,累计收到盒币打赏: <span class="u-count">{{ boxcoin_count }}</span></template>
25
+ </div>
27
26
  </div>
28
27
  </template>
29
28
 
30
29
  <script>
31
- import { getFansList } from "../../service/author";
30
+ import { getFansList, getSummary } from "../../service/author";
32
31
  import { showAvatar, authorLink } from "@jx3box/jx3box-common/js/utils";
33
32
  export default {
34
33
  name: "AuthorFans",
@@ -42,14 +41,22 @@ export default {
42
41
  return {
43
42
  list: [],
44
43
  total: 0,
45
- MAX_LENGTH : 8,
44
+ MAX_LENGTH: 8,
45
+
46
+ fans_count: 0,
47
+ boxcoin_count: 0,
46
48
  };
47
49
  },
48
50
  methods: {
49
51
  getData() {
50
- getFansList(this.uid).then((res) => {
51
- this.list = res.data.data.list?.slice(0,this.MAX_LENGTH) || [];
52
- this.total = res.data.data.totalUser || 0;
52
+ if (!~~this.uid) return;
53
+ getSummary(this.uid).then((res) => {
54
+ this.fans_count = res.data.data?.fans_count || 0;
55
+ this.boxcoin_count = res.data.data?.boxcoin_count || 0;
56
+ });
57
+
58
+ getFansList(this.uid, this.fansLimit).then((res) => {
59
+ this.list = res.data.data.list || [];
53
60
  });
54
61
  },
55
62
  showAvatar,
@@ -40,7 +40,7 @@ export default {
40
40
  },
41
41
  computed: {
42
42
  btnText() {
43
- return this.subscribed ? "已订阅" : "订阅";
43
+ return this.subscribed ? "已关注" : "关注";
44
44
  },
45
45
  btnType() {
46
46
  return !this.subscribed ? "info" : "warning";
@@ -87,7 +87,7 @@ export default {
87
87
  subscribeAuthor({ id: this.uid, data: { title: this.data?.display_name } })
88
88
  .then(() => {
89
89
  this.subscribed = true;
90
- this.$message.success("订阅成功");
90
+ this.$message.success("关注成功");
91
91
  })
92
92
  .catch((err) => {
93
93
  console.log(err);
@@ -276,7 +276,6 @@ export default {
276
276
  @import "../../../assets/css/module/author.less";
277
277
  .w-author {
278
278
  .w-author-wrapper {
279
- // background-image: url(https://img.jx3box.com/decoration/images/1_CAT/atcard.png);
280
279
  background-repeat: no-repeat;
281
280
  background-position: top right;
282
281
  background-size: 100% auto;
@@ -25,6 +25,14 @@ export default {
25
25
  type: String,
26
26
  default: "",
27
27
  },
28
+ authorId: {
29
+ type: Number,
30
+ default: 0,
31
+ },
32
+ banner: {
33
+ type: String,
34
+ default: "",
35
+ },
28
36
  },
29
37
  data: function () {
30
38
  return {
@@ -47,6 +55,8 @@ export default {
47
55
  category: this.category,
48
56
  link: location.href,
49
57
  title: this.title,
58
+ author_id: this.authorId,
59
+ banner: this.banner,
50
60
  }
51
61
  }
52
62
  },
@@ -6,13 +6,13 @@
6
6
  <!-- <AuthorFollow style="margin-right: 8px;" :uid="uid" /> -->
7
7
  <AuthorRss style="margin-right: 8px" :uid="uid" :data="data" />
8
8
  <!-- <AuthorGift :uid="uid" /> -->
9
- <el-button class="u-btn" @click="onMessage"><img class="u-msg-icon" svg-inline :src="src" />
9
+ <el-button class="u-btn" size="small" @click="onMessage"><img class="u-msg-icon" svg-inline :src="src" />
10
10
  私信</el-button>
11
11
  </div>
12
12
  <!-- <AuthorMsg :uid="uid" /> -->
13
- <AuthorLink class="u-block u-links" :uid="uid" :data="data" />
13
+ <!-- <AuthorLink class="u-block u-links" :uid="uid" :data="data" /> -->
14
14
  <AuthorMedals class="u-block u-trophy" :uid="uid" />
15
- <AuthorTeams class="u-block u-teams" :uid="uid" />
15
+ <!-- <AuthorTeams class="u-block u-teams" :uid="uid" /> -->
16
16
  <!-- <AuthorFans class="u-block u-fans" :uid="uid" /> -->
17
17
  <slot></slot>
18
18
  <AuthorPosts class="u-block u-posts" :uid="uid" />
@@ -22,13 +22,13 @@
22
22
 
23
23
  <script>
24
24
  import AuthorInfo from "../author/AuthorInfo.vue";
25
- import AuthorLink from "../author/AuthorLink.vue";
25
+ // import AuthorLink from "../author/AuthorLink.vue";
26
26
  // import AuthorFollow from "../author/AuthorFollow.vue";
27
27
  // import AuthorMsg from "./author/AuthorMsg.vue";
28
28
  // import AuthorGift from "../author/AuthorGift.vue";
29
29
  // import AuthorFans from "../author/AuthorFans.vue";
30
30
  import AuthorMedals from "../author/AuthorMedals.vue";
31
- import AuthorTeams from "../author/AuthorTeams.vue";
31
+ // import AuthorTeams from "../author/AuthorTeams.vue";
32
32
  import AuthorPosts from "../author/AuthorPosts.vue";
33
33
  import AuthorRss from "../author/AuthorRss.vue";
34
34
  const jx3box = require("@jx3box/jx3box-common/data/jx3box.json");
@@ -51,12 +51,12 @@ export default {
51
51
  },
52
52
  components: {
53
53
  AuthorInfo,
54
- AuthorLink,
54
+ // AuthorLink,
55
55
  // AuthorFollow,
56
56
  // AuthorMsg,
57
57
  // AuthorGift,
58
58
  AuthorMedals,
59
- AuthorTeams,
59
+ // AuthorTeams,
60
60
  AuthorPosts,
61
61
  // AuthorFans,
62
62
  AuthorRss,
@@ -48,7 +48,7 @@ export default {
48
48
  },
49
49
  topicImage() {
50
50
  const img = this.postBanner || this.topicInfo?.img;
51
- if (img && img.indexOf(".gif") > -1) {
51
+ if (img && (img.indexOf(".gif") > -1 || img.indexOf(".webp") > -1)) {
52
52
  return img;
53
53
  }
54
54
  return getThumbnail(img, [260*2, 78*2])