@jx3box/jx3box-common-ui 6.6.6 → 6.6.9

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,188 @@
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" :style="levelStyle">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>
114
+ <template v-if="isPhone">
115
+ <ul class="u-menu" v-show="!fold">
116
+ <li>
117
+ <a href="/dashboard">个人中心</a>
118
+ </li>
119
+ <li>
120
+ <a :href="url.msg">消息中心</a>
121
+ </li>
122
+ <li>
123
+ <a :href="url.publish">发布中心</a>
124
+ </li>
125
+ <li v-if="isAdmin">
126
+ <a href="/admin">站点配置</a>
61
127
  </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>
128
+ <li v-if="isEditor">
129
+ <a href="https://os.jx3box.com/admin">管理平台</a>
130
+ </li>
131
+ <hr>
132
+ <li>
133
+ <a @click="logout">退出登录</a>
134
+ </li>
135
+ </ul>
136
+ </template>
137
+ <template v-else>
138
+ <div class="m-info" v-show="!fold">
139
+ <div class="u-profile">
140
+ <b :title="user.name">{{ showUserName(user.name) }}</b>
141
+ <div class="u-id">
142
+ <span>魔盒UID:{{ user.uid }}</span>
143
+ <i class="el-icon-document-copy u-copy" @click.stop="copyText(user.uid)"></i>
144
+ </div>
145
+ <div class="m-vip">
146
+ <a href="/dashboard/cooperation">
147
+ <img
148
+ :src="super_author_icon"
149
+ class="u-superauthor-profile"
150
+ alt="superauthor"
151
+ title="签约作者"
152
+ :class="{ off: !isSuperAuthor }"
153
+ /></a>
154
+
155
+ <a
156
+ class="u-vip"
157
+ href="/vip/premium?from=header_usermenu"
158
+ target="_blank"
159
+ title="专业版"
160
+ >
161
+ <i class="i-icon-vip" :class="{ on: isPRO }">{{ vipType }}</i>
162
+ </a>
163
+ </div>
164
+ </div>
165
+
166
+ <el-button-group class="u-actions">
167
+ <a class="el-button el-button--default" :href="url.profile">资料设置</a>
168
+ <a class="el-button el-button--default" :href="url.homepage">个人主页</a>
169
+ <a class="el-button el-button--default" href="/dashboard/frame">主题风格</a>
170
+ </el-button-group>
171
+
172
+ <div class="m-other">
173
+ <a href="/dashboard/fav" class="u-item"> 我的收藏 </a>
174
+ <a href="/team/role/manage" class="u-item"> 我的角色 </a>
175
+ <a href="/dashboard/purchases" class="u-item"> 付费购买的资源 </a>
176
+ <a href="/vip/mall" class="u-item"> 积分商城兑好礼 </a>
177
+ <hr />
178
+ <a href="/dashboard/feedback" class="u-item"> 反馈中心 </a>
179
+ <hr />
180
+ <div class="u-logout">
181
+ <el-button @click="logout">退出登录</el-button>
182
+ </div>
183
+ </div>
184
+ </div>
185
+ </template>
71
186
  </div>
72
187
  </div>
73
188
  </template>
@@ -84,12 +199,13 @@
84
199
  <script>
85
200
  import User from "@jx3box/jx3box-common/js/user";
86
201
  import { showDate } from "@jx3box/jx3box-common/js/moment";
87
- import { __Links, __Root, __imgPath, __OriginRoot } from "@jx3box/jx3box-common/data/jx3box.json";
202
+ import { __Links, __Root, __imgPath, __OriginRoot, __userLevelColor } from "@jx3box/jx3box-common/data/jx3box.json";
88
203
  import panel from "../../assets/data/panel.json";
89
204
  import { getMsg, getMenu } from "../../service/header";
90
205
  import { getMyInfo, userSignIn } from "../../service/author";
91
206
  import dayjs from "dayjs";
92
207
  import isToday from "dayjs/plugin/isToday";
208
+ import { copyText } from "../../assets/js/utils";
93
209
  dayjs.extend(isToday);
94
210
  export default {
95
211
  props: [],
@@ -126,6 +242,12 @@ export default {
126
242
  was_pro: 0,
127
243
  },
128
244
 
245
+ // assets
246
+ showAssets: false,
247
+
248
+ // manage
249
+ showManage: false,
250
+
129
251
  // 链接
130
252
  login_url: __Links.account.login + "?redirect=" + location.href,
131
253
  register_url: __Links.account.register + "?redirect=" + location.href,
@@ -140,7 +262,7 @@ export default {
140
262
  return User._isPRO(this.asset) || false;
141
263
  },
142
264
  vipType: function () {
143
- return this.isPRO ? "PRO" : "PRE";
265
+ return "PRO";
144
266
  },
145
267
  vipTypeTxt: function () {
146
268
  return this.isPRO ? "专业版" : "高级版";
@@ -169,6 +291,17 @@ export default {
169
291
  siteRoot: function () {
170
292
  return location.host.includes("origin") ? __OriginRoot : __Root;
171
293
  },
294
+ level: function () {
295
+ return User.getLevel(this.asset.experience);
296
+ },
297
+ levelStyle: function () {
298
+ return {
299
+ color: __userLevelColor[this.level],
300
+ };
301
+ },
302
+ isPhone: function () {
303
+ return window.innerWidth < 768;
304
+ },
172
305
  },
173
306
  watch: {
174
307
  fold(val) {
@@ -278,6 +411,13 @@ export default {
278
411
  this.isSuperAuthor = !!res.sign;
279
412
  });
280
413
  },
414
+ onAssetsHover: function () {
415
+ this.showAssets = true;
416
+ },
417
+ onAssetsBlur: function () {
418
+ this.showAssets = false;
419
+ },
420
+ copyText,
281
421
 
282
422
  // 初始化
283
423
  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
+ <batch-reward :postType="postType" :items="postId" :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",
@@ -74,6 +61,7 @@ export default {
74
61
  Like,
75
62
  Share,
76
63
  Fav,
64
+ "batch-reward": BatchReward,
77
65
  "boxcoin-records": BoxcoinRecords,
78
66
  "boxcoin-admin": BoxcoinAdmin,
79
67
  "boxcoin-user": BoxcoinUser,
@@ -144,7 +132,7 @@ export default {
144
132
  this.cacheRecord = data;
145
133
  },
146
134
  },
147
- created: function () {},
135
+ created: function () { },
148
136
  };
149
137
  </script>
150
138