@jx3box/jx3box-common-ui 6.4.5 → 6.4.6

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,98 +1,135 @@
1
1
  .c-sidebar-left {
2
- .w(@aside-left - 40px);
3
- box-sizing: border-box;
4
- padding: 10px;
5
- .pf;
6
- .z(600);
7
- left: 0;
8
- top: @header-height + @bread-height;
9
- bottom: 0;
10
- background-color: @bg-light;
11
- border-right: 1px solid #eee;
2
+ .w(@aside-left - 40px);
3
+ box-sizing: border-box;
4
+ padding: 10px;
5
+ .pf;
6
+ .z(600);
7
+ left: 0;
8
+ top: @header-height + @bread-height;
9
+ bottom: 0;
10
+ background-color: @bg-light;
11
+ border-right: 1px solid #eee;
12
12
  }
13
- .c-sidebar-left.without-bread{
14
- top: @header-height;
13
+
14
+ .c-sidebar-left.without-bread {
15
+ top: @header-height;
15
16
  }
16
- .c-sidebar-left-inner{
17
- .size(100%);
17
+
18
+ .c-sidebar-left-inner {
19
+ .size(100%);
20
+ overflow-y: hidden;
21
+
22
+ &:hover {
18
23
  overflow-y: auto;
19
- &::-webkit-scrollbar {
20
- width: 4px;
21
- }
22
- &::-webkit-scrollbar-track,
23
- &::-webkit-scrollbar-track-piece {
24
- background-color: #fafafa;
25
- border-radius: 6px;
26
- }
27
- &::-webkit-scrollbar-thumb {
28
- background-color: #eee;
29
- border-radius: 6px;
30
- }
31
- &::-webkit-scrollbar-button,
32
- &::-webkit-scrollbar-corner,
33
- &::-webkit-resizer {
34
- display: none;
35
- }
24
+ }
25
+
26
+ &::-webkit-scrollbar {
27
+ width: 4px;
28
+ }
29
+
30
+ &::-webkit-scrollbar-track,
31
+ &::-webkit-scrollbar-track-piece {
32
+ background-color: #fafafa;
33
+ border-radius: 6px;
34
+ }
35
+
36
+ &::-webkit-scrollbar-thumb {
37
+ background-color: #eee;
38
+ border-radius: 6px;
39
+ }
40
+
41
+ &::-webkit-scrollbar-button,
42
+ &::-webkit-scrollbar-corner,
43
+ &::-webkit-resizer {
44
+ display: none;
45
+ }
36
46
  }
37
47
 
38
48
  // 笔记本<1440 缩小双边栏
39
49
  @media screen and (max-width: @smallpc) {
40
- .c-sidebar-left {
41
- .w(@aside-left - 40px);
42
- }
50
+ .c-sidebar-left {
51
+ .w(@aside-left - 40px);
52
+ }
43
53
  }
44
54
 
45
55
  // 平板横屏
46
56
  @media screen and (max-width: @notebook) {
47
- .c-sidebar-left {
48
- .w(@aside-left - 60px);
49
- }
57
+ .c-sidebar-left {
58
+ .w(@aside-left - 60px);
59
+ }
50
60
  }
51
61
 
52
62
  // 折叠相关逻辑
53
63
  .c-sidebar-left-toggle {
54
- .pa;
55
- .rb(0);
56
- .size(20px);
57
- .pointer;
58
- padding: 10px;
59
- svg {
60
- fill: @color;
61
- }
64
+ display: block;
65
+ .pa;
66
+ .rb(-21px, calc(50% - 20px));
67
+ width: 20px;
68
+ height: 40px;
69
+ line-height: 40px;
70
+ .pointer;
71
+ text-align: center;
72
+ background-color: @bg-light;
73
+ border-right: 1px solid #eee;
74
+ border-top: 1px solid #eee;
75
+ border-bottom: 1px solid #eee;
76
+ border-radius: 0px 2px 2px 0px;
77
+ font-size: 16px;
78
+ color: #999;
79
+
80
+ &:hover {
81
+ color: #222;
82
+ }
83
+
84
+ &.close-sidebar-left {
85
+ right: 0;
86
+ }
87
+
88
+ svg {
89
+ fill: @color;
90
+ }
62
91
  }
92
+
63
93
  .closeLeftSidebar() {
64
- transition: 0.2s ease-in-out;
65
- transform: translateX(-100%);
94
+ transition: 0.2s ease-in-out;
95
+ transform: translateX(-100%);
66
96
  }
97
+
67
98
  .openLeftSidebar() {
68
- transition: 0.2s ease-in-out;
69
- transform: translateX(0);
99
+ transition: 0.2s ease-in-out;
100
+ transform: translateX(0);
70
101
  }
102
+
71
103
  .c-sidebar-left.isclose {
72
- .closeLeftSidebar();
104
+ .closeLeftSidebar();
73
105
 
74
- .c-sidebar-left-toggle {
75
- transition: 0.2s ease-in-out;
76
- transform: translateX(100%);
77
- }
106
+ .c-sidebar-left-toggle {
107
+ transition: 0.2s ease-in-out;
108
+ transform: translateX(100%);
109
+ }
78
110
  }
111
+
79
112
  .c-sidebar-left.isopen {
80
- .openLeftSidebar();
113
+ .openLeftSidebar();
81
114
 
82
- .c-sidebar-left-toggle {
83
- transition: 0.2s ease-in-out;
84
- transform: translateX(0);
85
- }
115
+ .c-sidebar-left-toggle {
116
+ transition: 0.2s ease-in-out;
117
+ transform: translateX(0);
118
+ }
86
119
  }
87
120
 
88
121
  @media screen and (max-width: @ipad) {
89
- .c-sidebar-left-toggle {
90
- .none;
91
- }
92
- .c-sidebar-left.isopen{
93
- box-shadow:2px 0 3px rgba(0,0,0,.1);
94
- }
122
+ .c-sidebar-left-toggle {
123
+ .none;
124
+ }
125
+
126
+ .c-sidebar-left.isopen {
127
+ box-shadow: 2px 0 3px rgba(0, 0, 0, .1);
128
+ }
129
+ }
130
+
131
+ @media print {
132
+ .c-sidebar-left {
133
+ .none;
134
+ }
95
135
  }
96
- @media print{
97
- .c-sidebar-left{.none;}
98
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "6.4.5",
3
+ "version": "6.4.6",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/App.vue CHANGED
@@ -1,127 +1,198 @@
1
1
  <template>
2
- <div class="container-page">
3
- <Header></Header>
4
- <Breadcrumb
5
- name="频道名称"
6
- slug="slug"
7
- root="/slug"
8
- :publishEnable="true"
9
- :feedbackEnable="true"
10
- :adminEnable="true"
2
+ <div class="container-page">
3
+ <Header></Header>
4
+ <Breadcrumb
5
+ name="频道名称"
6
+ slug="slug"
7
+ root="/slug"
8
+ :publishEnable="true"
9
+ :feedbackEnable="true"
10
+ :adminEnable="true"
11
+ >
12
+ <img
13
+ slot="logo"
14
+ svg-inline
15
+ src="../assets/img/jx3.svg"
16
+ />
17
+ bread info
18
+ </Breadcrumb>
19
+
20
+ <LeftSidebar :open="true">
21
+ <LeftSideToggle :mobileOnly="true" />
22
+ <Author
23
+ :author="author"
24
+ :uid="8"
25
+ />
26
+ </LeftSidebar>
27
+
28
+ <Main
29
+ :withoutLeft="false"
30
+ :withoutRight="false"
31
+ >
32
+ <el-tabs
33
+ v-model="tab"
34
+ type="card"
35
+ >
36
+ <el-tab-pane
37
+ label="CMS作品"
38
+ name="post"
11
39
  >
12
- <img slot="logo" svg-inline src="../assets/img/jx3.svg" />
13
- bread info
14
- </Breadcrumb>
15
-
16
- <LeftSidebar :open="true">
17
- <LeftSideToggle :mobileOnly="true" />
18
- <Author :author="author" :uid="8" />
19
- </LeftSidebar>
20
-
21
- <Main :withoutLeft="false" :withoutRight="false">
22
- <el-tabs v-model="tab" type="card">
23
- <el-tab-pane label="CMS作品" name="post">
24
- <el-radio-group v-model="post_id">
25
- <el-radio label="41346">临时测试</el-radio>
26
- <el-radio label="35605">Markdown</el-radio>
27
- <el-radio label="32035">仅小册</el-radio>
28
- <el-radio label="30017">仅联合创作者</el-radio>
29
- <el-radio label="30582">小册和联合创作者</el-radio>
30
- <el-radio label="31129">无小册和联合创作者</el-radio>
31
- </el-radio-group>
32
- <singlebox :post="post" @extendUpdate="updateExtend" />
33
- </el-tab-pane>
34
- <el-tab-pane label="通用组件" name="widget">
35
- <PostHeader :post="post" />
36
- <Creators :postId="30432" style="margin-bottom: 10px" />
37
- <Collection :id="59" :defaultVisible="true" />
38
- <UserPop title="添加用户" v-model="visible" @confirm="addUser" />
39
- <el-button @click="visible = true">用户POP</el-button>
40
-
41
- <Thx
42
- :postId="23865"
43
- postType="bbs"
44
- postTitle="bbs23865的标题"
45
- :userId="7"
46
- :adminBoxcoinEnable="true"
47
- :userBoxcoinEnable="true"
48
- />
49
-
50
- <hr />
51
-
52
- <Like mode="heart" :count="100" :showCount="true" />
53
- <Down :count="100" :showCount="true" />
54
- <Mark label="KEY" value="VALUE" BGL="#000" BGR="#F39" />
55
- <Fav post-id="90" post-type="jx3dat" post-title="jx3dat测试标题" />
56
- <Feed post-id="90" post-type="jx3dat" />
57
- <Print title="传入标题" />
58
- <QRcode />
59
- <Sharing />
60
-
61
- <hr />
62
-
63
- <markBy />
64
- <menuBy :data="['test1', 'test2']" />
65
- <orderBy />
66
- <tagBy :data="['PVE', 'PVX']" :type="tag" />
67
- <clientBy type="" />
68
- <zlpBy />
69
-
70
- <hr />
71
- <uploadImage
72
- v-model="upload"
73
- info="非必选。首页海报尺寸1100*300(推荐2200*600支持高分屏),最大20M。"
74
- ></uploadImage>
75
- <AuthorMedal :author-id="8"></AuthorMedal>
76
- </el-tab-pane>
77
- <el-tab-pane label="百科组件" name="wiki"
78
- ><WikiPanel :wiki-post="wikiPost">
79
- <template slot="head-title">
80
- <i class="el-icon-location-information"></i>
81
- <span class="u-title">通识正文</span>
82
- </template>
83
- <template slot="head-actions">
84
- <a class="el-button el-button--primary u-publish">
85
- <i class="el-icon-edit"></i>
86
- <span>完善百科通识</span>
87
- </a>
88
- <span class="u-more">查看更多</span>
89
- </template>
90
- <template slot="body"
91
- >正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容</template
92
- >
93
- </WikiPanel>
94
- <hr />
95
-
96
- <WikiRevisions type="achievement" source-id="2996" />
97
- <hr />
98
-
99
- <WikiComments type="achievement" source-id="2996" />
100
- <hr
101
- /></el-tab-pane>
102
- <el-tab-pane label="头像" name="avatar">
103
- <el-radio-group v-model="avatar_size">
104
- <el-radio :label="60">xs-60</el-radio>
105
- <el-radio :label="84">s-84</el-radio>
106
- <el-radio :label="136">m-136</el-radio>
107
- <el-radio :label="224">l-224</el-radio>
108
- </el-radio-group>
109
- <div>
110
- <Avatar :id="8" url="" :size="avatar_size" frame="" />
111
- </div>
112
- </el-tab-pane>
113
- </el-tabs>
114
-
115
- <RightSidebar>
116
- <RightSideMsg>Hello</RightSideMsg>
117
- <div id="directory"></div>
118
- <PostCollection :id="59" />
119
- </RightSidebar>
120
-
121
- <Footer></Footer>
122
- <Bottom></Bottom>
123
- </Main>
124
- </div>
40
+ <el-radio-group v-model="post_id">
41
+ <el-radio label="41346">临时测试</el-radio>
42
+ <el-radio label="35605">Markdown</el-radio>
43
+ <el-radio label="32035">仅小册</el-radio>
44
+ <el-radio label="30017">仅联合创作者</el-radio>
45
+ <el-radio label="30582">小册和联合创作者</el-radio>
46
+ <el-radio label="31129">无小册和联合创作者</el-radio>
47
+ </el-radio-group>
48
+ <singlebox
49
+ :post="post"
50
+ @extendUpdate="updateExtend"
51
+ />
52
+ </el-tab-pane>
53
+ <el-tab-pane
54
+ label="通用组件"
55
+ name="widget"
56
+ >
57
+ <PostHeader :post="post" />
58
+ <Creators
59
+ :postId="30432"
60
+ style="margin-bottom: 10px"
61
+ />
62
+ <Collection
63
+ :id="59"
64
+ :defaultVisible="true"
65
+ />
66
+ <UserPop
67
+ title="添加用户"
68
+ v-model="visible"
69
+ @confirm="addUser"
70
+ />
71
+ <el-button @click="visible = true">用户POP</el-button>
72
+
73
+ <Thx
74
+ :postId="23865"
75
+ postType="bbs"
76
+ postTitle="bbs23865的标题"
77
+ :userId="7"
78
+ :adminBoxcoinEnable="true"
79
+ :userBoxcoinEnable="true"
80
+ />
81
+
82
+ <hr />
83
+
84
+ <Like
85
+ mode="heart"
86
+ :count="100"
87
+ :showCount="true"
88
+ />
89
+ <Down
90
+ :count="100"
91
+ :showCount="true"
92
+ />
93
+ <Mark
94
+ label="KEY"
95
+ value="VALUE"
96
+ BGL="#000"
97
+ BGR="#F39"
98
+ />
99
+ <Fav
100
+ post-id="90"
101
+ post-type="jx3dat"
102
+ post-title="jx3dat测试标题"
103
+ />
104
+ <Feed
105
+ post-id="90"
106
+ post-type="jx3dat"
107
+ />
108
+ <Print title="传入标题" />
109
+ <QRcode />
110
+ <Sharing />
111
+
112
+ <hr />
113
+
114
+ <markBy />
115
+ <menuBy :data="['test1', 'test2']" />
116
+ <orderBy />
117
+ <tagBy
118
+ :data="['PVE', 'PVX']"
119
+ :type="tag"
120
+ />
121
+ <clientBy type="" />
122
+ <zlpBy />
123
+
124
+ <hr />
125
+ <uploadImage
126
+ v-model="upload"
127
+ info="非必选。首页海报尺寸1100*300(推荐2200*600支持高分屏),最大20M。"
128
+ ></uploadImage>
129
+ <AuthorMedal :author-id="8"></AuthorMedal>
130
+ </el-tab-pane>
131
+ <el-tab-pane
132
+ label="百科组件"
133
+ name="wiki"
134
+ >
135
+ <WikiPanel :wiki-post="wikiPost">
136
+ <template slot="head-title">
137
+ <i class="el-icon-location-information"></i>
138
+ <span class="u-title">通识正文</span>
139
+ </template>
140
+ <template slot="head-actions">
141
+ <a class="el-button el-button--primary u-publish">
142
+ <i class="el-icon-edit"></i>
143
+ <span>完善百科通识</span>
144
+ </a>
145
+ <span class="u-more">查看更多</span>
146
+ </template>
147
+ <template slot="body">正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容</template>
148
+ </WikiPanel>
149
+ <hr />
150
+
151
+ <WikiRevisions
152
+ type="achievement"
153
+ source-id="2996"
154
+ />
155
+ <hr />
156
+
157
+ <WikiComments
158
+ type="achievement"
159
+ source-id="2996"
160
+ />
161
+ <hr />
162
+ </el-tab-pane>
163
+ <el-tab-pane
164
+ label="头像"
165
+ name="avatar"
166
+ >
167
+ <el-radio-group v-model="avatar_size">
168
+ <el-radio label="xxs">xxs-36/48</el-radio>
169
+ <el-radio label="xs">xs-48/68</el-radio>
170
+ <el-radio label="s">s-68/88</el-radio>
171
+ <el-radio label="m">m-88/123</el-radio>
172
+ <el-radio label="l">l-120/168</el-radio>
173
+ <el-radio label="xl">xl-150/210</el-radio>
174
+ </el-radio-group>
175
+ <div style="padding:60px">
176
+ <Avatar
177
+ :id="8"
178
+ url="https://qzapp.qlogo.cn/qzapp/101870778/8384D5764DF76997E566D346B3EE78D6/100?x-oss-process=style/avatar_s"
179
+ :size="avatar_size"
180
+ frame="Xmas_2"
181
+ />
182
+ </div>
183
+ </el-tab-pane>
184
+ </el-tabs>
185
+
186
+ <RightSidebar>
187
+ <RightSideMsg>Hello</RightSideMsg>
188
+ <div id="directory"></div>
189
+ <PostCollection :id="59" />
190
+ </RightSidebar>
191
+
192
+ <Footer></Footer>
193
+ <Bottom></Bottom>
194
+ </Main>
195
+ </div>
125
196
  </template>
126
197
 
127
198
  <script>
@@ -177,102 +248,102 @@ import { __server } from "@jx3box/jx3box-common/data/jx3box.json";
177
248
  import { wiki } from "@jx3box/jx3box-common/js/wiki";
178
249
 
179
250
  export default {
180
- name: "App",
181
- components: {
182
- Header,
183
- Breadcrumb,
184
- LeftSidebar,
185
- LeftSideToggle,
186
- Main,
187
- Footer,
188
- Bottom,
189
- RightSidebar,
190
-
191
- // cmsList,
192
- singlebox,
193
- PostHeader,
194
- PostCollection,
195
-
196
- Thx,
197
- Collection,
198
- Creators,
199
-
200
- RightSideMsg,
201
- Author,
202
- Avatar,
203
-
204
- Mark,
205
- Like,
206
- Down,
207
- Fav,
208
- Feed,
209
-
210
- Print,
211
- Sharing,
212
- QRcode,
213
-
214
- markBy,
215
- menuBy,
216
- orderBy,
217
- tagBy,
218
- clientBy,
219
- zlpBy,
220
-
221
- uploadImage,
222
- AuthorMedal,
223
-
224
- WikiPanel,
225
- WikiRevisions,
226
- WikiComments,
227
-
228
- UserPop,
229
- },
230
- data: function () {
231
- return {
232
- tab: "avatar",
233
-
234
- post: "",
235
- post_id: "35605",
236
-
237
- author: "",
238
- wikiPost: null,
239
- tag: "",
240
- visible: false,
241
-
242
- avatar_size: 60,
243
-
244
- upload: "",
245
- text: `<Text>text="使用:<BUFF 3222 1 desc>,持续<BUFF 3222 1 time>。\\\n" font=105 </text><Text>text="红豆沙做馅儿,精致细腻的广式月饼。" font=100 </text><Text>text="使用:能在唐门套装供应商处换取如下装备。\\\n" font=105 </text><Text>text="[燕云·重泉靴]" name="iteminfolink" eventid=513 script="this.nVersion=0 this.dwTabType=7 this.dwIndex=35244 this.OnItemLButtonDown=function() OnItemLinkDown(this) end" font=100 r=255 g=40 b=255 </text><Text>text="," font=105 </text><Text>text="[燕云·铭松靴]" name="iteminfolink" eventid=513 script="this.nVersion=0 this.dwTabType=7 this.dwIndex=35245 this.OnItemLButtonDown=function() OnItemLinkDown(this) end" font=100 r=255 g=40 b=255 </text><Text>text="。" font=100 </text>`,
246
- };
251
+ name: "App",
252
+ components: {
253
+ Header,
254
+ Breadcrumb,
255
+ LeftSidebar,
256
+ LeftSideToggle,
257
+ Main,
258
+ Footer,
259
+ Bottom,
260
+ RightSidebar,
261
+
262
+ // cmsList,
263
+ singlebox,
264
+ PostHeader,
265
+ PostCollection,
266
+
267
+ Thx,
268
+ Collection,
269
+ Creators,
270
+
271
+ RightSideMsg,
272
+ Author,
273
+ Avatar,
274
+
275
+ Mark,
276
+ Like,
277
+ Down,
278
+ Fav,
279
+ Feed,
280
+
281
+ Print,
282
+ Sharing,
283
+ QRcode,
284
+
285
+ markBy,
286
+ menuBy,
287
+ orderBy,
288
+ tagBy,
289
+ clientBy,
290
+ zlpBy,
291
+
292
+ uploadImage,
293
+ AuthorMedal,
294
+
295
+ WikiPanel,
296
+ WikiRevisions,
297
+ WikiComments,
298
+
299
+ UserPop,
300
+ },
301
+ data: function () {
302
+ return {
303
+ tab: "avatar",
304
+
305
+ post: "",
306
+ post_id: "35605",
307
+
308
+ author: "",
309
+ wikiPost: null,
310
+ tag: "",
311
+ visible: false,
312
+
313
+ avatar_size: 'xl',
314
+
315
+ upload: "",
316
+ text: `<Text>text="使用:<BUFF 3222 1 desc>,持续<BUFF 3222 1 time>。\\\n" font=105 </text><Text>text="红豆沙做馅儿,精致细腻的广式月饼。" font=100 </text><Text>text="使用:能在唐门套装供应商处换取如下装备。\\\n" font=105 </text><Text>text="[燕云·重泉靴]" name="iteminfolink" eventid=513 script="this.nVersion=0 this.dwTabType=7 this.dwIndex=35244 this.OnItemLButtonDown=function() OnItemLinkDown(this) end" font=100 r=255 g=40 b=255 </text><Text>text="," font=105 </text><Text>text="[燕云·铭松靴]" name="iteminfolink" eventid=513 script="this.nVersion=0 this.dwTabType=7 this.dwIndex=35245 this.OnItemLButtonDown=function() OnItemLinkDown(this) end" font=100 r=255 g=40 b=255 </text><Text>text="。" font=100 </text>`,
317
+ };
318
+ },
319
+ created: function () {
320
+ wiki.getById(25594).then((res) => {
321
+ res = res.data;
322
+ this.wikiPost = res.data;
323
+ });
324
+ },
325
+ methods: {
326
+ addUser: function (val) {
327
+ console.log(val);
247
328
  },
248
- created: function () {
249
- wiki.getById(25594).then((res) => {
250
- res = res.data;
251
- this.wikiPost = res.data;
252
- });
329
+ loadPost: function () {
330
+ axios.get(`/api/cms/post/${this.post_id}`).then((res) => {
331
+ this.post = res.data.data;
332
+ this.$forceUpdate();
333
+ });
253
334
  },
254
- methods: {
255
- addUser: function (val) {
256
- console.log(val);
257
- },
258
- loadPost: function () {
259
- axios.get(`/api/cms/post/${this.post_id}`).then((res) => {
260
- this.post = res.data.data;
261
- this.$forceUpdate();
262
- });
263
- },
264
- updateExtend: function (val) {
265
- console.log(val);
266
- },
335
+ updateExtend: function (val) {
336
+ console.log(val);
267
337
  },
268
- watch: {
269
- post_id: {
270
- immediate: true,
271
- handler: function (val) {
272
- this.loadPost();
273
- },
274
- },
338
+ },
339
+ watch: {
340
+ post_id: {
341
+ immediate: true,
342
+ handler: function (val) {
343
+ this.loadPost();
344
+ },
275
345
  },
346
+ },
276
347
  };
277
348
  </script>
278
349
 
@@ -1,77 +1,82 @@
1
1
  <template>
2
- <aside
3
- class="c-sidebar-left c-sidebar"
4
- :class="{
2
+ <aside
3
+ class="c-sidebar-left c-sidebar"
4
+ :class="{
5
5
  isclose: !isOpen,
6
6
  isopen: isOpen,
7
7
  'without-bread': withoutBread,
8
8
  }"
9
- v-if="!isApp"
9
+ v-if="!isApp"
10
+ >
11
+ <div class="c-sidebar-left-inner">
12
+ <slot></slot>
13
+ </div>
14
+ <span
15
+ class="c-sidebar-left-toggle"
16
+ :class="!isOpen && 'close-sidebar-left'"
17
+ @click="toggleLeftSide"
18
+ :title="isOpen ? '收起侧边栏' : '打开侧边栏'"
10
19
  >
11
- <div class="c-sidebar-left-inner"><slot></slot></div>
12
- <span
13
- class="c-sidebar-left-toggle"
14
- @click="toggleLeftSide"
15
- title="收起侧边栏"
16
- >
17
- <img
18
- v-show="isOpen"
19
- svg-inline
20
- src="../assets/img/leftsidebar/close.svg"
21
- />
22
- <img
23
- v-show="!isOpen"
24
- svg-inline
25
- src="../assets/img/leftsidebar/open.svg"
26
- />
27
- </span>
28
- </aside>
20
+ <!-- <img
21
+ v-show="isOpen"
22
+ svg-inline
23
+ src="../assets/img/leftsidebar/close.svg"
24
+ /> -->
25
+ <span v-show="isOpen"><i class="el-icon-arrow-left"></i></span>
26
+ <span v-show="!isOpen"><i class="el-icon-arrow-right"></i></span>
27
+ <!-- <img
28
+ v-show="!isOpen"
29
+ svg-inline
30
+ src="../assets/img/leftsidebar/open.svg"
31
+ /> -->
32
+ </span>
33
+ </aside>
29
34
  </template>
30
35
 
31
36
  <script>
32
37
  import Bus from "../service/bus";
33
38
  import { isApp } from "../assets/js/app.js";
34
39
  export default {
35
- name: "LeftSidebar",
36
- props: ["open", "withoutBread"],
37
- data: function() {
38
- return {
39
- isOpen: true,
40
- isApp: isApp(),
41
- };
40
+ name: "LeftSidebar",
41
+ props: ["open", "withoutBread"],
42
+ data: function () {
43
+ return {
44
+ isOpen: true,
45
+ isApp: isApp(),
46
+ };
47
+ },
48
+ computed: {
49
+ stickyHeader: function () {
50
+ return this.withoutBread;
42
51
  },
43
- computed: {
44
- stickyHeader: function() {
45
- return this.withoutBread;
46
- },
52
+ },
53
+ watch: {
54
+ open: function (newval) {
55
+ this.isOpen = newval === undefined ? true : !!newval;
47
56
  },
48
- watch: {
49
- open: function(newval) {
50
- this.isOpen = newval === undefined ? true : !!newval;
51
- },
57
+ },
58
+ methods: {
59
+ toggleLeftSide: function () {
60
+ let status = !this.isOpen;
61
+ Bus.$emit("toggleLeftSide", status);
52
62
  },
53
- methods: {
54
- toggleLeftSide: function() {
55
- let status = !this.isOpen;
56
- Bus.$emit("toggleLeftSide", status);
57
- },
58
- },
59
- mounted: function() {
60
- Bus.$on("toggleLeftSide", (data) => {
61
- this.isOpen = data;
62
- });
63
+ },
64
+ mounted: function () {
65
+ Bus.$on("toggleLeftSide", (data) => {
66
+ this.isOpen = data;
67
+ });
63
68
 
64
- if (window.innerWidth < 1024) {
65
- this.isOpen = false;
69
+ if (window.innerWidth < 1024) {
70
+ this.isOpen = false;
66
71
 
67
- document.addEventListener("click", function() {
68
- Bus.$emit("toggleLeftSide", false);
69
- });
70
- }
71
- },
72
- created: function() {
73
- this.isOpen = this.open === undefined ? true : this.open;
74
- },
72
+ document.addEventListener("click", function () {
73
+ Bus.$emit("toggleLeftSide", false);
74
+ });
75
+ }
76
+ },
77
+ created: function () {
78
+ this.isOpen = this.open === undefined ? true : this.open;
79
+ },
75
80
  };
76
81
  </script>
77
82
 
@@ -36,9 +36,12 @@ export default {
36
36
  return {
37
37
  frames: [],
38
38
  styles : {
39
+ xxs : 36,
40
+ xs : 48,
39
41
  s : 68,
40
42
  m : 88,
41
- l : 120
43
+ l : 120,
44
+ xl : 150
42
45
  }
43
46
  };
44
47
  },
@@ -60,7 +63,17 @@ export default {
60
63
  .c-avatar {
61
64
  .pr;
62
65
  .dbi;
63
-
66
+ &.xl{
67
+ @pic:150px;
68
+ @frame:210px;
69
+ .c-avatar-pic{.size(@pic);}
70
+ .c-avatar-frame{
71
+ .size(@frame);
72
+ .lt(@pic / 2);
73
+ margin-left:-@frame / 2;
74
+ margin-top:-@frame / 2;
75
+ }
76
+ }
64
77
  &.l{
65
78
  @pic:120px;
66
79
  @frame:168px;
@@ -96,6 +109,28 @@ export default {
96
109
  margin-top:-@frame / 2;
97
110
  }
98
111
  }
112
+ &.xs{
113
+ @pic:48px;
114
+ @frame:68px;
115
+ .c-avatar-pic{.size(@pic);}
116
+ .c-avatar-frame{
117
+ .size(@frame);
118
+ .lt(@pic / 2);
119
+ margin-left:-@frame / 2;
120
+ margin-top:-@frame / 2;
121
+ }
122
+ }
123
+ &.xxs{
124
+ @pic:36px;
125
+ @frame:48px;
126
+ .c-avatar-pic{.size(@pic);}
127
+ .c-avatar-frame{
128
+ .size(@frame);
129
+ .lt(@pic / 2);
130
+ margin-left:-@frame / 2;
131
+ margin-top:-@frame / 2;
132
+ }
133
+ }
99
134
  }
100
135
  .c-avatar-pic {
101
136
  .db;
@@ -1,67 +1,82 @@
1
1
  <template>
2
- <div class="w-fav2" :class="{ disabled: favorite }" @click="doFav">
3
- <el-tooltip effect="dark" :content="favContent" placement="top-start">
4
- <div>
5
- <img class="u-icon" svg-inline src="../../assets/img/widget/star.svg" />
6
- <span class="u-count" v-if="total">{{ total }}</span>
7
- </div>
8
- </el-tooltip>
9
- </div>
2
+ <div
3
+ class="w-fav2"
4
+ :class="{ disabled: favorite }"
5
+ @click="doFav"
6
+ >
7
+ <el-tooltip
8
+ effect="dark"
9
+ :content="favContent"
10
+ placement="top-start"
11
+ >
12
+ <div>
13
+ <img
14
+ class="u-icon"
15
+ svg-inline
16
+ src="../../assets/img/widget/star.svg"
17
+ />
18
+ <span
19
+ class="u-count"
20
+ v-if="!hiddenNum && total"
21
+ >{{ total }}</span>
22
+ </div>
23
+ </el-tooltip>
24
+ </div>
10
25
  </template>
11
26
 
12
27
  <script>
13
28
  import User from "@jx3box/jx3box-common/js/user";
14
29
  import { hasFav, addFav, delFav } from "../../service/fav";
15
30
  export default {
16
- name: "Fav2",
17
- props: ["postType", "postId", "postTitle"],
18
- data: function () {
19
- return {
20
- login: User.isLogin(),
21
- favorite: false,
22
- total: 0,
23
- };
31
+ name: "Fav2",
32
+ props: ["postType", "postId", "postTitle", "hiddenNum"],
33
+ data: function () {
34
+ return {
35
+ login: User.isLogin(),
36
+ favorite: false,
37
+ total: 0,
38
+ };
39
+ },
40
+ computed: {
41
+ favContent () {
42
+ return this.favorite ? "取消收藏" : "收藏";
24
43
  },
25
- computed: {
26
- favContent() {
27
- return this.favorite ? "取消收藏" : "收藏";
28
- },
44
+ },
45
+ methods: {
46
+ doFav: function () {
47
+ if (this.login) {
48
+ this.favorite ? this.delFav() : this.addFav();
49
+ } else {
50
+ User.toLogin();
51
+ }
29
52
  },
30
- methods: {
31
- doFav: function () {
32
- if (this.login) {
33
- this.favorite ? this.delFav() : this.addFav();
34
- } else {
35
- User.toLogin();
36
- }
37
- },
38
- hasFav: function () {
39
- hasFav(this.postType, this.postId).then((res) => {
40
- this.favorite = res.id || false;
41
- this.total = res.totalFavorites || 0;
42
- });
43
- },
44
- addFav: function () {
45
- addFav(this.postType, this.postId, this.postTitle).then((res) => {
46
- this.favorite = res.id;
47
- this.total++;
48
- });
49
- },
50
- delFav: function () {
51
- delFav(this.favorite).then(() => {
52
- this.favorite = false;
53
- this.total && this.total--;
54
- });
55
- },
53
+ hasFav: function () {
54
+ hasFav(this.postType, this.postId).then((res) => {
55
+ this.favorite = res.id || false;
56
+ this.total = res.totalFavorites || 0;
57
+ });
56
58
  },
57
- watch: {
58
- postId: {
59
- immediate: true,
60
- handler() {
61
- if (this.postType && this.postId) this.hasFav();
62
- },
63
- },
59
+ addFav: function () {
60
+ addFav(this.postType, this.postId, this.postTitle).then((res) => {
61
+ this.favorite = res.id;
62
+ this.total++;
63
+ });
64
64
  },
65
+ delFav: function () {
66
+ delFav(this.favorite).then(() => {
67
+ this.favorite = false;
68
+ this.total && this.total--;
69
+ });
70
+ },
71
+ },
72
+ watch: {
73
+ postId: {
74
+ immediate: true,
75
+ handler () {
76
+ if (this.postType && this.postId) this.hasFav();
77
+ },
78
+ },
79
+ },
65
80
  };
66
81
  </script>
67
82
 
@@ -61,6 +61,8 @@
61
61
  <footer class="m-single-footer">
62
62
  <slot name="single-footer"></slot>
63
63
  </footer>
64
+
65
+ <right-affix :postId="id" :postType="post_type" :postTitle="post_title"></right-affix>
64
66
  </div>
65
67
  </template>
66
68
 
@@ -69,6 +71,7 @@ import PostHeader from "./PostHeader.vue";
69
71
  import Creators from "./Creators.vue";
70
72
  import Collection from "./Collection.vue";
71
73
  import Thx from "./Thx.vue";
74
+ import RightAffix from "./right-affix.vue";
72
75
  import Article from "@jx3box/jx3box-editor/src/Article.vue";
73
76
  import ArticleMarkdown from "@jx3box/jx3box-editor/src/ArticleMarkdown.vue";
74
77
  import Comment from "@jx3box/jx3box-comment-ui/src/Comment.vue";
@@ -84,6 +87,7 @@ export default {
84
87
  Article,
85
88
  ArticleMarkdown,
86
89
  Comment,
90
+ RightAffix,
87
91
  },
88
92
  props: ["post", "stat"],
89
93
  data: function () {
@@ -0,0 +1,106 @@
1
+ <template>
2
+ <div class="right-affix">
3
+ <div class="item">
4
+ <fav :postId="postId" :postType="postType" :postTitle="postTitle" :hiddenNum="true"></fav>
5
+ </div>
6
+ <el-tooltip effect="dark" content="回到顶部" placement="bottom">
7
+ <div class="item" v-show="scrollBtnShow" @click="goTop">
8
+ <div class="to-top"></div>
9
+ </div>
10
+ </el-tooltip>
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ import Fav from "../interact/Fav2.vue";
16
+ export default {
17
+ name: "RightAffix",
18
+ props: ["postId", "postType", "postTitle"],
19
+ data() {
20
+ return {
21
+ scrollToptimer: null,
22
+ scrollBtnShow: false,
23
+ isTop: true,
24
+ };
25
+ },
26
+ components: {
27
+ Fav,
28
+ },
29
+ methods: {
30
+ goTop() {
31
+ //设置定时器
32
+ const self = this;
33
+ this.scrollToptimer = setInterval(function () {
34
+ //获取滚动条距离顶部高度
35
+ var osTop = document.documentElement.scrollTop || document.body.scrollTop;
36
+ var ispeed = Math.floor(-osTop / 7);
37
+ document.documentElement.scrollTop = document.body.scrollTop = osTop + ispeed;
38
+ //到达顶部,清除定时器
39
+ if (osTop === 0) {
40
+ clearInterval(self.scrollToptimer);
41
+ }
42
+ self.isTop = true;
43
+ }, 30);
44
+ },
45
+ },
46
+ mounted() {
47
+ //获取页面可视区高度
48
+ var clientHeight = document.documentElement.clientHeight;
49
+ const self = this;
50
+ window.addEventListener("scroll", function () {
51
+ //显示回到顶部按钮
52
+ var osTop = document.documentElement.scrollTop || document.body.scrollTop;
53
+ if (osTop >= clientHeight) {
54
+ self.scrollBtnShow = true;
55
+ } else {
56
+ self.scrollBtnShow = false;
57
+ }
58
+ //回到顶部过程中用户滚动滚动条,停止定时器
59
+ if (!self.isTop) {
60
+ clearInterval(self.scrollToptimer);
61
+ }
62
+ self.isTop = false;
63
+ });
64
+ },
65
+ };
66
+ </script>
67
+
68
+ <style lang="less" scoped>
69
+ .right-affix {
70
+ position: fixed;
71
+ display: flex;
72
+ flex-direction: column;
73
+ justify-content: center;
74
+ align-items: center;
75
+ right: @aside-right;
76
+ top: @header-height + @bread-height + 100px;
77
+ background-color: #fafbfc;
78
+ padding: 8px 5px;
79
+ z-index: 99999;
80
+ border-top-left-radius: 6px;
81
+ border-bottom-left-radius: 6px;
82
+ .item {
83
+ display: flex;
84
+ justify-content: center;
85
+ align-items: center;
86
+ width: 32px;
87
+ height: 32px;
88
+ cursor: pointer;
89
+ &:hover {
90
+ background-color: #f6fcff;
91
+ }
92
+ }
93
+ .to-top {
94
+ width: 0;
95
+ height: 0;
96
+ border-left: 12px solid transparent;
97
+ border-right: 12px solid transparent;
98
+ border-bottom: 18px solid skyblue;
99
+ }
100
+ }
101
+ @media screen and (max-width:@smallpc){
102
+ .right-affix{
103
+ right:0;
104
+ }
105
+ }
106
+ </style>