@jx3box/jx3box-common-ui 5.3.5 → 5.3.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.
@@ -122,10 +122,37 @@
122
122
  height: calc(100vh - @header-height);
123
123
  }
124
124
  }
125
- @media screen and (max-width:375px){
125
+
126
+ @media screen and (max-width:@phone){
127
+ .c-jx3box{
128
+ .u-list{
129
+ display: flex;
130
+ flex-wrap: wrap;
131
+ padding-right:10px;
132
+ li{
133
+ .w(25%);
134
+ .mr(0);
135
+ // flex:1;
136
+ }
137
+ }
138
+ .u-item{
139
+ .mr(20px);
140
+ .u-txt{
141
+ .fz(10px);
142
+ }
143
+ .u-pic{
144
+ .size(28px);
145
+ }
146
+ }
147
+ li:nth-child(4n) .u-item{
148
+ .mr(0) !important;
149
+ }
150
+ }
151
+ }
152
+ @media screen and (max-width:320px){
126
153
  .c-jx3box{
127
154
  .u-item{
128
- .size(64px);
155
+ .size(60px);
129
156
  .u-txt{
130
157
  .fz(10px);
131
158
  }
@@ -0,0 +1,5 @@
1
+ {
2
+ "std": "正式服",
3
+ "origin": "怀旧服",
4
+ "all": "双端"
5
+ }
@@ -20,12 +20,12 @@
20
20
  "onlyAdmin":false
21
21
  },
22
22
  {
23
- "label": "海报管理",
24
- "link": "/admin",
23
+ "label": "全局设置",
24
+ "link": "/config",
25
25
  "onlyAdmin":true
26
26
  },
27
27
  {
28
- "label": "内容管理",
28
+ "label": "后台管理",
29
29
  "link": "https://os.jx3box.com/admin",
30
30
  "onlyAdmin":true
31
31
  }
@@ -0,0 +1 @@
1
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 12 16" width="12" height="16" aria-hidden="true" fill="#555555"><path fill-rule="evenodd" d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true" fill="#444444"><path fill-rule="evenodd" d="M12 14.002a.998.998 0 0 1-.998.998H1.001A1 1 0 0 1 0 13.999V13c0-2.633 4-4 4-4s.229-.409 0-1c-.841-.62-.944-1.59-1-4 .173-2.413 1.867-3 3-3s2.827.586 3 3c-.056 2.41-.159 3.38-1 4-.229.59 0 1 0 1s4 1.367 4 4v1.002z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 12 16" version="1.1" width="12" height="16" fill="#dbab09"><path fill-rule="evenodd" d="M4 13H3v-1h1v1zm8-6v7c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V7c0-.55.45-1 1-1h1V4c0-2.2 1.8-4 4-4s4 1.8 4 4v2h1c.55 0 1 .45 1 1zM3.8 6h4.41V4c0-1.22-.98-2.2-2.2-2.2-1.22 0-2.2.98-2.2 2.2v2H3.8zM11 7H2v7h9V7zM4 8H3v1h1V8zm0 2H3v1h1v-1z"></path></svg>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="485.213px" height="485.212px" viewBox="0 0 485.213 485.212" style="enable-background:new 0 0 485.213 485.212;" fill="#555555"
6
+ xml:space="preserve">
7
+ <g>
8
+ <path d="M60.652,75.816V15.163C60.652,6.781,67.433,0,75.817,0c8.38,0,15.161,6.781,15.161,15.163v60.653
9
+ c0,8.38-6.781,15.161-15.161,15.161C67.433,90.978,60.652,84.196,60.652,75.816z M318.424,90.978
10
+ c8.378,0,15.163-6.781,15.163-15.161V15.163C333.587,6.781,326.802,0,318.424,0c-8.382,0-15.168,6.781-15.168,15.163v60.653
11
+ C303.256,84.196,310.042,90.978,318.424,90.978z M485.212,363.906c0,66.996-54.312,121.307-121.303,121.307
12
+ c-66.986,0-121.302-54.311-121.302-121.307c0-66.986,54.315-121.3,121.302-121.3C430.9,242.606,485.212,296.919,485.212,363.906z
13
+ M454.89,363.906c0-50.161-40.81-90.976-90.98-90.976c-50.166,0-90.976,40.814-90.976,90.976c0,50.171,40.81,90.98,90.976,90.98
14
+ C414.08,454.886,454.89,414.077,454.89,363.906z M121.305,181.955H60.652v60.651h60.653V181.955z M60.652,333.584h60.653V272.93
15
+ H60.652V333.584z M151.629,242.606h60.654v-60.651h-60.654V242.606z M151.629,333.584h60.654V272.93h-60.654V333.584z
16
+ M30.328,360.891V151.628h333.582v60.653h30.327V94c0-18.421-14.692-33.349-32.843-33.349h-12.647v15.166
17
+ c0,16.701-13.596,30.325-30.322,30.325c-16.731,0-30.326-13.624-30.326-30.325V60.651H106.14v15.166
18
+ c0,16.701-13.593,30.325-30.322,30.325c-16.733,0-30.327-13.624-30.327-30.325V60.651H32.859C14.707,60.651,0.001,75.579,0.001,94
19
+ v266.892c0,18.36,14.706,33.346,32.858,33.346h179.424v-30.331H32.859C31.485,363.906,30.328,362.487,30.328,360.891z
20
+ M303.256,242.606v-60.651h-60.648v60.651H303.256z M409.399,363.906h-45.49v-45.49c0-8.377-6.781-15.158-15.163-15.158
21
+ s-15.159,6.781-15.159,15.158v60.658c0,8.378,6.777,15.163,15.159,15.163h60.653c8.382,0,15.163-6.785,15.163-15.163
22
+ C424.562,370.692,417.781,363.906,409.399,363.906z"/>
23
+ </g>
24
+ </svg>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" fill="#6a737d"
4
+ viewBox="0 0 485.2 485.2" style="enable-background:new 0 0 485.2 485.2;" xml:space="preserve">
5
+ <g>
6
+ <path d="M60.7,75.8V15.2C60.7,6.8,67.4,0,75.8,0C84.2,0,91,6.8,91,15.2v60.7C91,84.2,84.2,91,75.8,91C67.4,91,60.7,84.2,60.7,75.8z
7
+ "/>
8
+ <path d="M318.4,91c8.4,0,15.2-6.8,15.2-15.2V15.2c0-8.4-6.8-15.2-15.2-15.2c-8.4,0-15.2,6.8-15.2,15.2v60.7
9
+ C303.3,84.2,310,91,318.4,91z"/>
10
+ <rect x="60.7" y="182" width="60.7" height="60.7"/>
11
+ <rect x="60.7" y="272.9" width="60.7" height="60.7"/>
12
+ <rect x="151.6" y="182" width="60.7" height="60.7"/>
13
+ <rect x="151.6" y="272.9" width="60.7" height="60.7"/>
14
+ <path d="M30,361.2v-210h334c0.2,70.7,0.4,141.4,0.7,212.1c9.8,0,19.6-0.1,29.3-0.1c0-89.9,0-179.7,0-269.6
15
+ c0-18.5-14.5-33.4-32.5-33.4H349v15.2c0,16.7-13.7,30.3-30.5,30.3c-16.8,0-30.5-13.6-30.5-30.3V60.2H106v15.2
16
+ c0,16.7-13.7,30.3-30.5,30.3C58.7,105.7,45,92.1,45,75.4V60.2H32.5C14.5,60.2,0,75.2,0,93.6v267.2c0,9.2,3.6,17.5,9.5,23.6
17
+ c7.8,8.1,18.5,9.3,23,9.8c22.1,2.4,165.3,2.9,361.5,1c0-10.7,0-21.3,0-32c-120.5,0.3-241,0.7-361.5,1
18
+ C31.7,363.2,30.8,362.2,30,361.2z"/>
19
+ <path d="M420.3,387.9"/>
20
+ <rect x="242.6" y="182" width="60.6" height="60.7"/>
21
+ <rect x="242.6" y="272.9" width="60.7" height="60.7"/>
22
+ </g>
23
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "5.3.5",
3
+ "version": "5.3.9",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -30,7 +30,7 @@
30
30
  "last 2 versions"
31
31
  ],
32
32
  "dependencies": {
33
- "@jx3box/jx3box-common": "^6.7.2",
33
+ "@jx3box/jx3box-common": "^6.7.8",
34
34
  "@jx3box/jx3box-data": "^1.8.3",
35
35
  "axios": "^0.19.2",
36
36
  "element-ui": "^2.13.2",
package/src/App.vue CHANGED
@@ -20,7 +20,7 @@
20
20
  </LeftSidebar>
21
21
 
22
22
  <Main :withoutLeft="false" :withoutRight="false">
23
-
23
+ <PostHeader :post="post"/>
24
24
 
25
25
  <Creators :postId="30432" style="margin-bottom:10px"/>
26
26
  <Collection :id="59" :defaultVisible="true"/>
@@ -105,6 +105,8 @@ import RightSideMsg from "./RightSideMsg.vue";
105
105
  import Footer from "./Footer.vue";
106
106
  import Bottom from "./Bottom.vue";
107
107
 
108
+ import PostHeader from "./single/PostHeader.vue";
109
+
108
110
  import Thx from "./single/Thx.vue";
109
111
  import Collection from "./single/Collection.vue";
110
112
  import Creators from "./single/Creators.vue";
@@ -145,6 +147,8 @@ export default {
145
147
  Bottom,
146
148
  RightSidebar,
147
149
 
150
+ PostHeader,
151
+
148
152
  Thx,
149
153
  Collection,
150
154
  Creators,
@@ -182,6 +186,8 @@ export default {
182
186
  wikiPost: null,
183
187
  tag : '',
184
188
  visible : false,
189
+
190
+ post : ''
185
191
  };
186
192
  },
187
193
  created: function() {
@@ -191,6 +197,9 @@ export default {
191
197
  if (res.code === 200) this.wikiPost = res.data;
192
198
  }
193
199
  );
200
+ axios.get('/api/cms/post/32035').then((res) => {
201
+ this.post = res.data.data
202
+ })
194
203
  },
195
204
  methods: {
196
205
  addUser : function (val){
@@ -199,3 +208,9 @@ export default {
199
208
  },
200
209
  };
201
210
  </script>
211
+
212
+ <style lang="less">
213
+ body{
214
+ padding-top:0;
215
+ }
216
+ </style>
package/src/Author.vue CHANGED
@@ -78,7 +78,7 @@
78
78
  </div>
79
79
  <div class="u-medals" v-if="medals && medals.length">
80
80
  <span class="u-medal" v-for="(item, i) in medals" :key="i">
81
- <img :src="item.medal | showTeamMedal" :title="medal_map[item.medal]" />
81
+ <img :src="item.medal | showMedalIcon" :title="item | showMedalDesc" />
82
82
  </span>
83
83
  </div>
84
84
  </div>
@@ -179,8 +179,11 @@ export default {
179
179
  },
180
180
  },
181
181
  filters: {
182
- showTeamMedal: function (val) {
183
- return __imgPath + "image/medals/team/" + val + ".gif";
182
+ showMedalIcon: function (val) {
183
+ return __imgPath + "image/medals/user/" + val + ".gif";
184
+ },
185
+ showMedalDesc : function (item){
186
+ return item.medal_desc || medal_map[item.medal]
184
187
  },
185
188
  authorLink,
186
189
  weiboLink: function (val) {
@@ -10,14 +10,16 @@
10
10
  v-if="hasRight"
11
11
  >
12
12
  <div class="c-admin-wrapper">
13
- <el-divider content-position="left">状态变更</el-divider>
14
- <el-radio-group v-model="post_status" size="small" class="c-admin-status">
15
- <el-radio-button
16
- v-for="(option, key) in status_options"
17
- :label="key"
18
- :key="key"
19
- >{{ option }}</el-radio-button>
20
- </el-radio-group>
13
+ <template v-if="isAdmin">
14
+ <el-divider content-position="left">状态变更</el-divider>
15
+ <el-radio-group v-model="post_status" size="small" class="c-admin-status">
16
+ <el-radio-button
17
+ v-for="(option, key) in status_options"
18
+ :label="key"
19
+ :key="key"
20
+ >{{ option }}</el-radio-button>
21
+ </el-radio-group>
22
+ </template>
21
23
 
22
24
  <el-divider content-position="left">可见性变更</el-divider>
23
25
  <el-radio-group v-model="visible" size="small" class="c-admin-status">
@@ -140,6 +142,7 @@ export default {
140
142
  status_options: {
141
143
  publish: "默认",
142
144
  draft: "草稿",
145
+ pending: "待审核",
143
146
  dustbin: "删除",
144
147
  },
145
148
  visible: "0",
@@ -192,6 +195,9 @@ export default {
192
195
  sticky: this.isSticky ? Date.now() : null,
193
196
  };
194
197
  },
198
+ isAdmin : function (){
199
+ return User.isAdmin()
200
+ }
195
201
  },
196
202
  methods: {
197
203
  // 是否有权限
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <nav class="c-header-nav" v-if="finalNav">
3
- <div class="u-item-box" v-for="item in finalNav" :key="item.key">
3
+ <div class="u-item-box" v-for="item in finalNav" :key="'header-nav-' + item.key">
4
4
  <template
5
5
  v-if="item.status && item.children && item.children.length"
6
6
  >
@@ -6,8 +6,15 @@
6
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
- <i class="u-pop" style="display: none;" v-show="pop"></i>
10
- <img svg-inline src="../../assets/img/header/msg.svg" />
9
+ <i
10
+ class="u-pop"
11
+ style="display: none"
12
+ v-show="pop"
13
+ ></i>
14
+ <img
15
+ svg-inline
16
+ src="../../assets/img/header/msg.svg"
17
+ />
11
18
  </i>
12
19
  </a>
13
20
  </el-tooltip>
@@ -17,14 +24,22 @@
17
24
  <div class="c-header-panel" id="c-header-panel">
18
25
  <el-tooltip effect="dark" content="发布中心" placement="bottom">
19
26
  <a class="u-post" :href="url.publish">
20
- <img class="u-add" svg-inline src="../../assets/img/header/add.svg" />
27
+ <img
28
+ class="u-add"
29
+ svg-inline
30
+ src="../../assets/img/header/add.svg"
31
+ />
21
32
  </a>
22
33
  </el-tooltip>
23
34
  </div>
24
35
 
25
36
  <!-- user info -->
26
37
  <div class="c-header-info">
27
- <div class="c-header-profile" id="c-header-profile" @click="showmenu">
38
+ <div
39
+ class="c-header-profile"
40
+ id="c-header-profile"
41
+ @click="showmenu"
42
+ >
28
43
  <img class="u-avatar" :src="user.avatar" />
29
44
  <span class="u-dropdown"></span>
30
45
  <ul class="u-menu" v-show="!fold">
@@ -47,14 +62,17 @@
47
62
  href="/vip/premium?from=header_usermenu"
48
63
  target="_blank"
49
64
  >
50
- <i class="i-icon-vip" :class="{ on: isVIP || isPRO }">{{ vipType }}</i>
65
+ <i
66
+ class="i-icon-vip"
67
+ :class="{ on: isVIP || isPRO }"
68
+ >{{ vipType }}</i
69
+ >
51
70
  <span class="u-vip-type">
52
71
  <template v-if="isVIP || isPRO">
53
- {{ vipTypeTxt
54
- }}
55
- <span
56
- class="u-vip-left"
57
- >({{ vipLeftDays }}天)</span>
72
+ {{ vipTypeTxt }}
73
+ <span class="u-vip-left"
74
+ >({{ vipLeftDays }}天)</span
75
+ >
58
76
  </template>
59
77
  <template v-else>升级账号类型</template>
60
78
  </span>
@@ -63,7 +81,10 @@
63
81
  </li>
64
82
  <hr />
65
83
  <template v-for="(item, i) in panel">
66
- <li :key="'panel-' + i" v-if="isEditor || !item.onlyAdmin">
84
+ <li
85
+ :key="'panel-' + i"
86
+ v-if="isEditor || !item.onlyAdmin"
87
+ >
67
88
  <a :href="item.link">{{ item.label }}</a>
68
89
  </li>
69
90
  </template>
@@ -104,7 +125,7 @@ export default {
104
125
  data: function () {
105
126
  return {
106
127
  panel,
107
- isEditor : false,
128
+ isEditor: false,
108
129
 
109
130
  // 是否有消息
110
131
  pop: false,
@@ -200,7 +221,7 @@ export default {
200
221
  });
201
222
  },
202
223
  loadPanel: function () {
203
- getMenu('panel').then((res) => {
224
+ getMenu("panel").then((res) => {
204
225
  this.panel = res.data?.data?.val || panel;
205
226
  });
206
227
  },
@@ -237,7 +258,7 @@ export default {
237
258
  // 初始化
238
259
  init: function () {
239
260
  if (this.isLogin) {
240
- this.isEditor = User.isEditor()
261
+ this.isEditor = User.isEditor();
241
262
  this.checkMSG();
242
263
  this.loadPanel();
243
264
  this.loadAsset();
@@ -76,6 +76,9 @@ export default {
76
76
  },
77
77
  allowBoxcoin : function (){
78
78
  return this.postType && this.postId && this.userId
79
+ },
80
+ client : function (){
81
+ return location.href.includes('origin') ? 'origin' : 'std'
79
82
  }
80
83
  },
81
84
  watch: {
@@ -90,6 +93,7 @@ export default {
90
93
  submit: function () {
91
94
  grantBoxcoin(this.postType, this.postId, this.userId, this.count, {
92
95
  remark: this.remark,
96
+ client : this.client
93
97
  })
94
98
  .then((res) => {
95
99
  this.$message({
@@ -75,6 +75,9 @@ export default {
75
75
  },
76
76
  allowBoxcoin : function (){
77
77
  return this.postType && this.postId && this.userId
78
+ },
79
+ client : function (){
80
+ return location.href.includes('origin') ? 'origin' : 'std'
78
81
  }
79
82
  },
80
83
  watch: {
@@ -93,6 +96,7 @@ export default {
93
96
  submit: function () {
94
97
  rewardBoxcoin(this.postType, this.postId, this.userId, this.count, {
95
98
  remark: this.remark,
99
+ client : this.client
96
100
  })
97
101
  .then((res) => {
98
102
  this.$message({
@@ -4,7 +4,7 @@
4
4
  <span>
5
5
  <i class="el-icon-notebook-1"></i> 该作品已被收录至作者的剑三小册
6
6
  </span>
7
- <a @click.stop :href="id | collectionLink">《{{ title }}》</a>
7
+ <a @click.stop :href="id | collectionLink" target="_blank">《{{ title }}》</a>
8
8
  </div>
9
9
  <transition name="fade">
10
10
  <div class="w-collection-list" v-if="visible">
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <div class="m-single-contents">
3
+ <!-- TODO: -->
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name : 'PostContents',
10
+ props:[],
11
+ components : {},
12
+ data : function(){
13
+ return {
14
+
15
+ }
16
+ },
17
+ computed:{},
18
+ watch:{},
19
+ methods:{},
20
+ filters:{},
21
+ created:function(){},
22
+ mounted:function(){},
23
+ }
24
+ </script>
@@ -0,0 +1,328 @@
1
+ <template>
2
+ <header class="m-single-header" v-if="post">
3
+ <!-- 标题 -->
4
+ <div class="m-single-title">
5
+ <span class="u-title u-sub-block" :href="url" :title="title">
6
+ <i class="u-original" v-if="isOriginal">原创</i>
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>
9
+ <i class="el-icon-delete" v-if="post.post_status == 'dustbin'" style="color:#c00"></i>
10
+ </i>
11
+ <span class="u-title-text">{{ title }}</span>
12
+ </span>
13
+ </div>
14
+
15
+ <!-- 信息 -->
16
+ <div class="m-single-info">
17
+ <!-- 用户名 -->
18
+ <div class="u-author u-sub-block">
19
+ <i class="u-author-icon">
20
+ <img svg-inline src="../../assets/img/single/author.svg" />
21
+ </i>
22
+ <a class="u-name" :href="author_link">{{ author_name }}</a>
23
+ </div>
24
+
25
+ <!-- 自定义字段 -->
26
+ <!-- <template v-if="metas && metas.length">
27
+ <div class="u-meta u-sub-block" v-for="(meta_value,meta_key) in metas" :key="meta_key">
28
+ <em class="u-label">{{meta_key}}</em>
29
+ <span class="u-value">{{meta_value}}</span>
30
+ </div>
31
+ </template> -->
32
+ <slot></slot>
33
+
34
+ <!-- 客户端 -->
35
+ <div class="u-meta u-sub-block">
36
+ <em class="u-label">适用客户端</em>
37
+ <span class="u-value u-client" :class="client">{{ client | showClientLabel }}</span>
38
+ </div>
39
+
40
+ <!-- 发布日期 -->
41
+ <span class="u-podate u-sub-block" :title="'发布日期:' + post_time">
42
+ <i class="u-icon-podate">
43
+ <img svg-inline src="../../assets/img/single/podate.svg" />
44
+ </i>
45
+ <time>{{ post_date }}</time>
46
+ </span>
47
+
48
+ <!-- 最后更新 -->
49
+ <span class="u-modate u-sub-block" :title="'最后更新:' + update_time">
50
+ <i class="u-icon-modate">
51
+ <img svg-inline src="../../assets/img/single/modate.svg" />
52
+ </i>
53
+ <time>{{ update_date }}</time>
54
+ </span>
55
+
56
+ <!-- 查看次数 -->
57
+ <span class="u-views u-sub-block">
58
+ <i class="el-icon-view"></i>
59
+ {{ views }}
60
+ </span>
61
+
62
+ <!-- 编辑 -->
63
+ <a class="u-edit u-sub-block" :href="edit_link" v-if="canEdit">
64
+ <i class="u-icon-edit el-icon-edit-outline"></i>
65
+ <span>编辑</span>
66
+ </a>
67
+ </div>
68
+ </header>
69
+ </template>
70
+
71
+ <script>
72
+ import { __Root } from "@jx3box/jx3box-common/data/jx3box.json";
73
+ import { showDate, showTime } from "@jx3box/jx3box-common/js/moment";
74
+ import { editLink, authorLink } from "@jx3box/jx3box-common/js/utils.js";
75
+ import User from "@jx3box/jx3box-common/js/user.js";
76
+ import client_map from "../../assets/data/clients.json";
77
+ export default {
78
+ name: "single-header",
79
+ props: ["post", "stat"],
80
+ data: function() {
81
+ return {};
82
+ },
83
+ computed: {
84
+ url: function() {
85
+ return location.href;
86
+ },
87
+ isOriginal: function() {
88
+ return !!~~this.post?.original;
89
+ },
90
+ title: function() {
91
+ return this.post?.post_title || "无标题";
92
+ },
93
+ author_link: function() {
94
+ return authorLink(this.post?.post_author);
95
+ },
96
+ author_name: function() {
97
+ return this.post?.author || "匿名";
98
+ },
99
+ post_date: function() {
100
+ return showDate(new Date(this.post?.post_date));
101
+ },
102
+ update_date: function() {
103
+ return showDate(new Date(this.post?.post_modified));
104
+ },
105
+ post_time: function() {
106
+ return showTime(new Date(this.post?.post_date));
107
+ },
108
+ update_time: function() {
109
+ return showTime(new Date(this.post?.post_modified));
110
+ },
111
+ views: function() {
112
+ return this.stat?.views || "-";
113
+ },
114
+ edit_link: function() {
115
+ return editLink(this.post?.post_type, this.post?.ID);
116
+ },
117
+ canEdit: function() {
118
+ return this.post?.post_author == User.getInfo().uid || User.isEditor();
119
+ },
120
+ client: function() {
121
+ return this.post?.client || "std";
122
+ },
123
+ },
124
+ methods: {},
125
+ mounted: function() {},
126
+ filters: {
127
+ showClientLabel: function(val) {
128
+ return client_map[val];
129
+ },
130
+ },
131
+ };
132
+ </script>
133
+
134
+ <style lang="less">
135
+ .m-single-header {
136
+ padding-top: 20px;
137
+ padding-bottom: 20px;
138
+ padding-right: 280px;
139
+ .pr;
140
+ .u-sub-block {
141
+ .dbi;
142
+ .y(top);
143
+ }
144
+ }
145
+ @media screen and (max-width: @phone) {
146
+ .m-single-header {
147
+ padding-right: 0;
148
+ }
149
+ }
150
+ @media print {
151
+ .m-single-header {
152
+ padding-right: 0;
153
+ }
154
+ }
155
+
156
+ .m-single-title {
157
+ .fz(32px);
158
+ padding: 1px 0;
159
+
160
+ .u-title {
161
+ color: @color;
162
+ // &:hover {
163
+ // color: @primary;
164
+ // }
165
+ letter-spacing: 0.5px;
166
+ font-weight: 300;
167
+ .db;
168
+ .nobreak;
169
+ }
170
+ .u-author {
171
+ .pr;
172
+ }
173
+
174
+ .u-original {
175
+ background-color: #6f42c1;
176
+ color: #fff;
177
+ .fz(14px, 20px);
178
+ font-style: normal;
179
+ font-weight: normal;
180
+ padding: 2px 5px;
181
+ .mr(5px);
182
+ // .fl;
183
+ }
184
+
185
+ .u-private {
186
+ .y(-2px);
187
+ margin-right: 5px;
188
+ color: #111;
189
+ }
190
+ }
191
+ @media screen and (max-width: @phone) {
192
+ .m-single-title {
193
+ .fz(1rem, 1.8);
194
+ .u-title {
195
+ word-break: break-all;
196
+ white-space: normal;
197
+ font-weight: normal;
198
+ }
199
+ }
200
+ }
201
+ @media print {
202
+ .m-single-title {
203
+ .x;
204
+ }
205
+ }
206
+
207
+ .m-single-info {
208
+ margin-top: 10px;
209
+ .clearfix;
210
+ .fz(12px, 20px);
211
+ color: #666;
212
+
213
+ @origin: #0eb7ce;
214
+ @std: #f0b400;
215
+ @all: #a26ef7;
216
+
217
+ .u-client {
218
+ // .fl;
219
+ font-style: normal;
220
+ .fz(12px);
221
+ padding: 0px 5px;
222
+ .r(3px);
223
+ // .mr(10px);
224
+
225
+ &.std {
226
+ border: 1px solid @std;
227
+ color: @std;
228
+ }
229
+
230
+ &.origin {
231
+ border: 1px solid @origin;
232
+ color: @origin;
233
+ }
234
+
235
+ &.all {
236
+ border: 1px solid @all;
237
+ color: @all;
238
+ }
239
+ }
240
+
241
+ * {
242
+ .dbi;
243
+ }
244
+
245
+ svg {
246
+ fill: #666;
247
+ .size(16px);
248
+ .y;
249
+ .mr(3px);
250
+ }
251
+
252
+ .u-sub-block {
253
+ .mr(15px);
254
+ .fl;
255
+ }
256
+
257
+ .u-author {
258
+ a:hover {
259
+ box-shadow: 0 1px 0 @color-link;
260
+ }
261
+ i {
262
+ .pr;
263
+ top: -2px;
264
+ }
265
+ }
266
+
267
+ .u-label {
268
+ .mr(5px);
269
+ background-color: #eee;
270
+ padding: 0 5px;
271
+ .r(2px);
272
+ font-style: normal;
273
+ }
274
+ .u-value {
275
+ }
276
+
277
+ .u-views {
278
+ i {
279
+ .fz(15px);
280
+ .y;
281
+ }
282
+ }
283
+
284
+ .u-edit {
285
+ i {
286
+ &:before {
287
+ font-size: 16px;
288
+ }
289
+ .pr;
290
+ top: 2px;
291
+ .mr(3px);
292
+ }
293
+ &:hover {
294
+ box-shadow: 0 1px 0 @color-link;
295
+ }
296
+ }
297
+ }
298
+ @media screen and (max-width: @ipad) {
299
+ .m-single-info {
300
+ .u-meta {
301
+ .none;
302
+ }
303
+ }
304
+ }
305
+ @media screen and (max-width: @phone) {
306
+ .m-single-info {
307
+ .u-podate {
308
+ .none;
309
+ }
310
+ }
311
+ }
312
+ @media print {
313
+ .m-single-info {
314
+ .u-meta,
315
+ .u-views,
316
+ .u-edit {
317
+ .none;
318
+ }
319
+ .x;
320
+ .u-sub-block {
321
+ float: none;
322
+ }
323
+ .u-name {
324
+ color: @color;
325
+ }
326
+ }
327
+ }
328
+ </style>