@jx3box/jx3box-common-ui 6.6.6 → 6.6.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.
@@ -1,73 +1,163 @@
1
1
  <template>
2
2
  <div class="c-header-user" id="c-header-user">
3
3
  <template v-if="isLogin">
4
- <!-- user msg -->
4
+ <!-- 消息中心 -->
5
5
  <div class="c-header-msg" id="c-header-msg">
6
- <el-tooltip effect="dark" content="我的消息" placement="bottom">
6
+ <el-tooltip effect="dark" content="消息中心" placement="bottom">
7
7
  <a class="u-msg" :href="url.msg">
8
8
  <i class="u-icon u-icon-msg">
9
9
  <i class="u-pop" style="display: none" v-show="pop"></i>
10
- <img svg-inline src="../../assets/img/header/msg.svg" />
10
+ <img svg-inline src="../../assets/img/header/bell.svg" />
11
11
  </i>
12
12
  </a>
13
13
  </el-tooltip>
14
14
  </div>
15
15
 
16
- <!-- user panel -->
16
+ <!-- 创作中心 -->
17
17
  <div class="c-header-panel" id="c-header-panel">
18
- <el-tooltip effect="dark" content="发布中心" placement="bottom">
18
+ <el-tooltip effect="dark" content="创作中心" placement="bottom">
19
19
  <a class="u-post" :href="url.publish">
20
- <img class="u-add" svg-inline src="../../assets/img/header/add.svg" />
20
+ <img class="u-add" svg-inline src="../../assets/img/header/edit.svg" />
21
21
  </a>
22
22
  </el-tooltip>
23
23
  </div>
24
24
 
25
+ <!-- 我的资产 -->
26
+ <div class="c-header-panel c-header-assets" @mouseenter="onAssetsHover" @mouseleave="onAssetsBlur">
27
+ <a class="u-asset" href="/dashboard/boxcoin">
28
+ <img class="u-coin" svg-inline src="../../assets/img/header/coin.svg" />
29
+ </a>
30
+
31
+ <div class="u-assets" v-show="showAssets">
32
+ <div class="u-detail">
33
+ <span class="u-item">
34
+ <!-- <span class="u-item-primary>" -->
35
+ <span class="u-label"><i class="el-icon-user"></i> 等级</span>
36
+ <span class="u-value">Lv.{{ level }}</span>
37
+ <!-- </span> -->
38
+ <!-- <span class="u-item-extend"><a href="/notice/28917" target="_blank">[权益]</a></span> -->
39
+ </span>
40
+ <span class="u-item">
41
+ <span class="u-item-primary"
42
+ ><span class="u-label"><i class="el-icon-coin"></i> 盒币</span>
43
+ <span class="u-value">{{ asset.box_coin }}</span></span
44
+ >
45
+ <span class="u-item-extend"
46
+ ><a href="/dashboard/boxcoin" target="_blank">[兑换通宝]</a></span
47
+ >
48
+ </span>
49
+ <span class="u-item">
50
+ <span class="u-item-primary"
51
+ ><span class="u-label"><i class="el-icon-wallet"></i> 金箔</span
52
+ ><span class="u-value">{{ asset.cny }}</span></span
53
+ >
54
+ <span class="u-item-extend"
55
+ ><a href="/vip/cny" target="_blank">[充值]</a>
56
+ <a href="/dashboard/cny" target="_blank">[提现]</a></span
57
+ >
58
+ </span>
59
+ <span class="u-item">
60
+ <span class="u-item-primary"
61
+ ><span class="u-label"><i class="el-icon-sugar"></i> 银铛</span>
62
+ <span class="u-value">{{ asset.points }}</span></span
63
+ >
64
+ <span class="u-item-extend"
65
+ ><a href="/vip/mall" target="_blank">[兑礼]</a
66
+ ><a href="/vip/lottery" target="_blank">[抽奖]</a></span
67
+ >
68
+ </span>
69
+ <span class="u-item">
70
+ <span class="u-item-primary"
71
+ ><span class="u-label"><i class="el-icon-bank-card"></i> 卡密</span>
72
+ <span class="u-value">{{ asset.ext_info ? asset.ext_info.keycode : 0 }}</span></span
73
+ >
74
+ <span class="u-item-extend"><a href="/dashboard/card" target="_blank">[查看]</a></span>
75
+ </span>
76
+ </div>
77
+ </div>
78
+ </div>
79
+
80
+ <!-- vip -->
81
+ <div class="c-header-panel" id="c-header-vip">
82
+ <el-tooltip effect="dark" content="会员中心" placement="bottom">
83
+ <a class="u-post" href="/vip/premium">
84
+ <img class="u-add" svg-inline src="../../assets/img/header/vip.svg" />
85
+ </a>
86
+ </el-tooltip>
87
+ </div>
88
+
89
+ <!-- manage -->
90
+ <div
91
+ class="c-header-panel c-header-manage"
92
+ id="c-header-manage"
93
+ v-if="isEditor"
94
+ @mouseenter="showManage = true"
95
+ @mouseleave="showManage = false"
96
+ >
97
+ <span class="u-post">
98
+ <img class="u-add" svg-inline src="../../assets/img/header/manage.svg" />
99
+ </span>
100
+ <ul class="u-menu" v-show="showManage">
101
+ <li v-if="isAdmin">
102
+ <a href="/admin">站点配置</a>
103
+ </li>
104
+ <li v-if="isEditor">
105
+ <a href="https://os.jx3box.com/admin">管理平台</a>
106
+ </li>
107
+ </ul>
108
+ </div>
109
+
25
110
  <!-- user info -->
26
111
  <div class="c-header-info">
27
112
  <div class="c-header-profile" id="c-header-profile" @click="showmenu">
28
113
  <img class="u-avatar" :src="user.avatar" />
29
- <span class="u-dropdown"></span>
30
- <ul class="u-menu" v-show="!fold">
31
- <li>
32
- <a class="u-me" :href="url.homepage">
33
- <b>{{ showUserName(user.name) }}</b>
34
- <img
35
- v-if="isSuperAuthor"
36
- :src="super_author_icon"
37
- class="u-superauthor-profile"
38
- alt="superauthor"
39
- title="签约作者"
40
- />
41
- <em>(UID : {{ user.uid }})</em>
42
- </a>
43
- </li>
44
- <li>
45
- <a class="u-vip" href="/vip/premium?from=header_usermenu" target="_blank">
46
- <i class="i-icon-vip" :class="{ on: isVIP || isPRO }">{{ vipType }}</i>
47
- <span class="u-vip-type">
48
- <template v-if="isVIP || isPRO">
49
- {{ vipTypeTxt }}
50
- <span class="u-vip-left">({{ vipLeftDays }}天)</span>
51
- </template>
52
- <template v-else>升级账号类型</template>
53
- </span>
54
- <!-- <span class="u-expire" v-if="expire_date">(有效期至:{{expire_date}})</span> -->
55
- </a>
56
- </li>
57
- <hr />
58
- <template v-for="(item, i) in panel">
59
- <li :key="'panel-' + i" v-if="isEditor || !item.onlyAdmin">
60
- <a :href="item.link">{{ item.label }}</a>
61
- </li>
62
- </template>
63
- <hr />
64
- <li>
65
- <a :href="url.profile">设置</a>
66
- </li>
67
- <li>
68
- <a @click="logout()">登出</a>
69
- </li>
70
- </ul>
114
+ <div class="m-info" v-show="!fold">
115
+ <div class="u-profile">
116
+ <b :title="user.name">{{ showUserName(user.name) }}</b>
117
+ <div class="u-id">
118
+ <span>魔盒UID:{{ user.uid }}</span>
119
+ <i class="el-icon-document-copy u-copy" @click.stop="copyText(user.uid)"></i>
120
+ </div>
121
+ <div class="m-vip">
122
+ <a href="/dashboard/cooperation">
123
+ <img
124
+ :src="super_author_icon"
125
+ class="u-superauthor-profile"
126
+ alt="superauthor"
127
+ title="签约作者"
128
+ :class="{ off: !isSuperAuthor }"
129
+ /></a>
130
+
131
+ <a
132
+ class="u-vip"
133
+ href="/vip/premium?from=header_usermenu"
134
+ target="_blank"
135
+ title="专业版"
136
+ >
137
+ <i class="i-icon-vip" :class="{ on: isPRO }">{{ vipType }}</i>
138
+ </a>
139
+ </div>
140
+ </div>
141
+
142
+ <el-button-group class="u-actions">
143
+ <a class="el-button el-button--default" :href="url.profile">资料设置</a>
144
+ <a class="el-button el-button--default" :href="url.homepage">个人主页</a>
145
+ <a class="el-button el-button--default" href="/dashboard/frame">主题风格</a>
146
+ </el-button-group>
147
+
148
+ <div class="m-other">
149
+ <a href="/dashboard/fav" class="u-item"> 我的收藏 </a>
150
+ <a href="/team/role/manage" class="u-item"> 我的角色 </a>
151
+ <a href="/dashboard/purchases" class="u-item"> 付费购买的资源 </a>
152
+ <a href="/vip/mall" class="u-item"> 积分商城兑好礼 </a>
153
+ <hr />
154
+ <a href="/dashboard/feedback" class="u-item"> 反馈中心 </a>
155
+ <hr />
156
+ <div class="u-logout">
157
+ <el-button @click="logout">退出登录</el-button>
158
+ </div>
159
+ </div>
160
+ </div>
71
161
  </div>
72
162
  </div>
73
163
  </template>
@@ -90,6 +180,7 @@ import { getMsg, getMenu } from "../../service/header";
90
180
  import { getMyInfo, userSignIn } from "../../service/author";
91
181
  import dayjs from "dayjs";
92
182
  import isToday from "dayjs/plugin/isToday";
183
+ import { copyText } from "../../assets/js/utils";
93
184
  dayjs.extend(isToday);
94
185
  export default {
95
186
  props: [],
@@ -126,6 +217,12 @@ export default {
126
217
  was_pro: 0,
127
218
  },
128
219
 
220
+ // assets
221
+ showAssets: false,
222
+
223
+ // manage
224
+ showManage: false,
225
+
129
226
  // 链接
130
227
  login_url: __Links.account.login + "?redirect=" + location.href,
131
228
  register_url: __Links.account.register + "?redirect=" + location.href,
@@ -140,7 +237,7 @@ export default {
140
237
  return User._isPRO(this.asset) || false;
141
238
  },
142
239
  vipType: function () {
143
- return this.isPRO ? "PRO" : "PRE";
240
+ return "PRO";
144
241
  },
145
242
  vipTypeTxt: function () {
146
243
  return this.isPRO ? "专业版" : "高级版";
@@ -169,6 +266,9 @@ export default {
169
266
  siteRoot: function () {
170
267
  return location.host.includes("origin") ? __OriginRoot : __Root;
171
268
  },
269
+ level: function () {
270
+ return User.getLevel(this.asset.experience);
271
+ },
172
272
  },
173
273
  watch: {
174
274
  fold(val) {
@@ -278,6 +378,13 @@ export default {
278
378
  this.isSuperAuthor = !!res.sign;
279
379
  });
280
380
  },
381
+ onAssetsHover: function () {
382
+ this.showAssets = true;
383
+ },
384
+ onAssetsBlur: function () {
385
+ this.showAssets = false;
386
+ },
387
+ copyText,
281
388
 
282
389
  // 初始化
283
390
  init: function () {
@@ -0,0 +1,152 @@
1
+ <template>
2
+ <div class="w-boxcoin-user">
3
+ <el-button @click="openBoxcoinPop" type="primary" size="mini">批量打赏</el-button>
4
+ <el-dialog title="投币打赏" :visible.sync="visible" custom-class="w-boxcoin-pop" append-to-body
5
+ :close-on-click-modal="false">
6
+ <div class="w-boxcoin-user-content">
7
+ <div class="u-left">
8
+ <em class="u-label">当前拥有盒币</em>
9
+ <b>{{ left }}</b>
10
+ <a class="u-charge" :href="chargeLink" target="_blank">[充值]</a>
11
+ </div>
12
+ <div class="u-list">
13
+ <em class="u-label">❤️ 打赏</em>
14
+ <Contributors v-if="authors && authors.length" :authors="authors" @chosen="handleChosen" />
15
+ <div class="u-points">
16
+ <el-radio-group v-model="count">
17
+ <el-radio :label="item" v-for="item in fitPoints" :key="item" border>
18
+ <b>{{ item }}</b>盒币
19
+ </el-radio>
20
+ </el-radio-group>
21
+ </div>
22
+ </div>
23
+ <div class="u-msg">
24
+ <em class="u-label">📝 寄语</em>
25
+ <div class="u-input">
26
+ <el-input v-model="remark" placeholder="请输入寄语(必填)" :minlength="2" :maxlength="30"
27
+ show-word-limit></el-input>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ <span slot="footer" class="dialog-footer">
32
+ <el-button @click="visible = false">取 消</el-button>
33
+ <el-button type="primary" @click="submit" :disabled="!ready">确 定</el-button>
34
+ </span>
35
+ </el-dialog>
36
+ </div>
37
+ </template>
38
+
39
+ <script>
40
+ import { batchReward } from "../../service/thx.js";
41
+ import User from "@jx3box/jx3box-common/js/user";
42
+ import Contributors from "./Contributors.vue";
43
+ export default {
44
+ name: "BatchReward",
45
+ props: ["boxcoin", "postType", "items", "own", "points", "authors", "client"],
46
+ components: {
47
+ Contributors,
48
+ },
49
+ data: function () {
50
+ return {
51
+ visible: false,
52
+
53
+ count: 0,
54
+ remark: "辛苦了,谢谢大大!",
55
+
56
+ left: this.own,
57
+
58
+ chargeLink: "/vip/boxcoin?redirect=" + location.href,
59
+
60
+ chosen: "", // 被选中的人
61
+ };
62
+ },
63
+ computed: {
64
+ ready: function () {
65
+ return this.isEnough && this.count && this.remark;
66
+ },
67
+ isEnough: function () {
68
+ return this.left && this.left >= this.count;
69
+ },
70
+ allowBoxcoin: function () {
71
+ return this.postType && (this.authors && this.authors.length);
72
+ },
73
+ hostClient: function () {
74
+ return location.href.includes("origin") ? "origin" : "std";
75
+ },
76
+ fitPoints: function () {
77
+ return this.points;
78
+ },
79
+ },
80
+ watch: {
81
+ own: function (val) {
82
+ this.left = val;
83
+ },
84
+ },
85
+ methods: {
86
+ openBoxcoinPop: function () {
87
+ if (!(this.items && this.items.length)) return this.$message({ message: `请选择需要打赏的作品`, type: "warning", });
88
+ if (User.isLogin()) {
89
+ this.visible = true;
90
+ } else {
91
+ User.toLogin();
92
+ }
93
+ },
94
+ // 选择要打赏的对象
95
+ handleChosen (userId) {
96
+ this.chosen = userId;
97
+ },
98
+ submit: function () {
99
+ batchReward(this.postType, this.count, { items: this.items, remark: this.remark, client: this.client || this.hostClient, })
100
+ .then((res) => {
101
+ return res.data.data;
102
+ })
103
+ .then((data) => {
104
+ // 1.扣除额度
105
+ data.success.map(item => {
106
+ this.$message({
107
+ message: `作品${this.items[item.index].article_id}打赏成功`,
108
+ type: "success",
109
+ });
110
+ this.left -= this.count;
111
+ })
112
+ data.fail.map(item => {
113
+ this.$message({
114
+ message: `作品${this.items[item.index].article_id}打赏失败,原因:${item.msg}`,
115
+ type: "error",
116
+ });
117
+ })
118
+ })
119
+ .finally(() => {
120
+ this.visible = false;
121
+ });
122
+ },
123
+ init: function () { },
124
+ },
125
+ created: function () { },
126
+ mounted: function () { },
127
+ };
128
+ </script>
129
+
130
+ <style scoped lang="less">
131
+ .w-boxcoin-user {
132
+ .dbi;
133
+ .x(left);
134
+
135
+ .u-icon {
136
+ .size(26px);
137
+ .y;
138
+ .pr;
139
+ top: -2px;
140
+ }
141
+
142
+ .u-count {
143
+ color: #888;
144
+ .ml(10px);
145
+ }
146
+
147
+ .u-charge {
148
+ .underline(@color-link);
149
+ .ml(10px);
150
+ }
151
+ }
152
+ </style>
@@ -1,50 +1,35 @@
1
1
  <template>
2
2
  <div class="w-thx">
3
- <div class="w-thx-panel">
4
- <boxcoin-admin
5
- :postId="postId"
6
- :postType="postType"
7
- v-if="hasRight && adminBoxcoinEnable && boxcoin_enable"
8
- :userId="userId"
9
- :max="admin_max"
10
- :min="admin_min"
11
- :own="admin_left"
12
- :total="admin_total"
13
- :points="admin_points"
14
- :authors="authors"
15
- @updateRecord="updateRecord"
16
- :client="client"
17
- />
18
- <Like :postId="postId" :postType="postType"></Like>
19
- <fav :postId="postId" :postType="postType" :postTitle="postTitle"></fav>
20
- <boxcoin-user
21
- :postId="postId"
22
- :postType="postType"
23
- :boxcoin="boxcoin"
24
- :userId="userId"
25
- :own="user_left"
26
- :points="user_points"
27
- :authors="authors"
28
- v-if="userBoxcoinEnable && boxcoin_enable"
29
- @updateRecord="updateRecord"
30
- :client="client"
31
- />
32
- <Share :postId="postId" :postType="postType" :client="client" />
33
- </div>
34
- <div class="w-thx-records">
35
- <boxcoin-records
36
- :postId="postId"
37
- :postType="postType"
38
- :postClient="client"
39
- :cacheRecord="cacheRecord"
40
- :mode="mode"
41
- />
42
- </div>
43
- <div class="w-thx-copyright">
44
- &copy;
45
- 所有原创作品,著作权归作者所有,所有未经授权的非署名转载或抄袭将有权追究法律责任,所有法律事务由专聘律师代理。<br />
46
- 签约作者独家特约稿件,及所有魔盒官方评分作品用户一经兑现则视为有偿付费稿件,所有商业稿件的转载引用需同时征得魔盒平台授权。
47
- </div>
3
+ <template v-if="type === 'batchReward'">
4
+ <!-- 批量打赏 -->
5
+ <BatchReward :postType="postType" :items="items" :boxcoin="boxcoin" :own="user_left" :points="user_points"
6
+ :authors="authors" :client="client" v-if="userBoxcoinEnable && boxcoin_enable"
7
+ @updateRecord="updateRecord" />
8
+ </template>
9
+ <template v-else>
10
+ <div class="w-thx-panel">
11
+ <boxcoin-admin :postId="postId" :postType="postType"
12
+ v-if="hasRight && adminBoxcoinEnable && boxcoin_enable" :userId="userId" :max="admin_max"
13
+ :min="admin_min" :own="admin_left" :total="admin_total" :points="admin_points" :authors="authors"
14
+ @updateRecord="updateRecord" :client="client" />
15
+ <Like :postId="postId" :postType="postType"></Like>
16
+ <fav :postId="postId" :postType="postType" :postTitle="postTitle"></fav>
17
+ <boxcoin-user :postId="postId" :postType="postType" :boxcoin="boxcoin" :userId="userId" :own="user_left"
18
+ :points="user_points" :authors="authors" v-if="userBoxcoinEnable && boxcoin_enable"
19
+ @updateRecord="updateRecord" :client="client" />
20
+ <Share :postId="postId" :postType="postType" :client="client" />
21
+ </div>
22
+ <div class="w-thx-records">
23
+ <boxcoin-records :postId="postId" :postType="postType" :postClient="client" :cacheRecord="cacheRecord"
24
+ :mode="mode" />
25
+ </div>
26
+ <div class="w-thx-copyright">
27
+ &copy;
28
+ 所有原创作品,著作权归作者所有,所有未经授权的非署名转载或抄袭将有权追究法律责任,所有法律事务由专聘律师代理。<br />
29
+ 签约作者独家特约稿件,及所有魔盒官方评分作品用户一经兑现则视为有偿付费稿件,所有商业稿件的转载引用需同时征得魔盒平台授权。
30
+ </div>
31
+ </template>
32
+
48
33
  </div>
49
34
  </template>
50
35
 
@@ -52,6 +37,7 @@
52
37
  import Like from "../interact/Like2.vue";
53
38
  import Share from "../interact/Share2.vue";
54
39
  import Fav from "../interact/Fav2.vue";
40
+ import BatchReward from "../interact/batchReward.vue";
55
41
  import BoxcoinRecords from "../interact/boxcoin_records.vue";
56
42
  import BoxcoinAdmin from "../interact/boxcoin_admin.vue";
57
43
  import BoxcoinUser from "../interact/boxcoin_user.vue";
@@ -60,6 +46,7 @@ import { getPostBoxcoinConfig, getBoxcoinStatus } from "../../service/thx";
60
46
  export default {
61
47
  name: "Thx",
62
48
  props: [
49
+ "type",
63
50
  "postId",
64
51
  "postType",
65
52
  "postTitle",
@@ -69,11 +56,13 @@ export default {
69
56
  "mode",
70
57
  "authors",
71
58
  "client",
59
+ "items"
72
60
  ],
73
61
  components: {
74
62
  Like,
75
63
  Share,
76
64
  Fav,
65
+ BatchReward,
77
66
  "boxcoin-records": BoxcoinRecords,
78
67
  "boxcoin-admin": BoxcoinAdmin,
79
68
  "boxcoin-user": BoxcoinUser,
@@ -144,7 +133,7 @@ export default {
144
133
  this.cacheRecord = data;
145
134
  },
146
135
  },
147
- created: function () {},
136
+ created: function () { },
148
137
  };
149
138
  </script>
150
139