@jx3box/jx3box-editor 1.5.7 → 1.5.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-editor",
3
- "version": "1.5.7",
3
+ "version": "1.5.9",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/service/cms.js CHANGED
@@ -17,5 +17,10 @@ function loadEmotions(params){
17
17
  params: params
18
18
  });
19
19
  }
20
-
21
- export { uploadFile, loadAuthors, loadEmotions };
20
+ //获取装扮
21
+ function getDecoration(params) {
22
+ return $cms().get(`/api/cms/user/decoration`,{
23
+ params
24
+ });
25
+ }
26
+ export { uploadFile, loadAuthors, loadEmotions,getDecoration };
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="w-author" v-loading="loading">
3
- <div class="w-author-wrapper el-popover" v-if="data">
3
+ <div class="w-author-wrapper el-popover" v-if="data" :style="decoration">
4
4
  <div class="u-author">
5
5
  <Avatar class="u-avatar" :uid="uid" :url="data.user_avatar" :size="68" :frame="data.user_avatar_frame" />
6
6
  <div class="u-info">
@@ -45,6 +45,7 @@
45
45
  <script>
46
46
  import { authorLink, getLink, getThumbnail } from "@jx3box/jx3box-common/js/utils";
47
47
  import { getUserInfo, getUserMedals, getUserPublicTeams } from "../../service/author";
48
+ import { getDecoration } from "../../service/cms";
48
49
  import { __server, __imgPath,__userLevelColor } from "@jx3box/jx3box-common/data/jx3box.json";
49
50
  import User from "@jx3box/jx3box-common/js/user";
50
51
  import { __userLevel } from "@jx3box/jx3box-common/data/jx3box.json";
@@ -61,7 +62,8 @@ export default {
61
62
  data: null,
62
63
  medals: [],
63
64
  teams: [],
64
- loading: false
65
+ loading: false,
66
+ decoration:''
65
67
  }),
66
68
  computed: {
67
69
  super_author_icon: function() {
@@ -92,6 +94,7 @@ export default {
92
94
  handler (val) {
93
95
  if (val) {
94
96
  this.loadData()
97
+ this.getDecoration()
95
98
  }
96
99
  }
97
100
  }
@@ -123,7 +126,40 @@ export default {
123
126
  this.teams = data && data.slice(0, 5);
124
127
  });
125
128
  },
126
-
129
+ getDecoration(){
130
+ let decoration_atcard=sessionStorage.getItem('decoration_atcard'+this.uid)
131
+ if(decoration_atcard == 'no'){
132
+ return;
133
+ }
134
+ //已有缓存,读取解析
135
+ if(decoration_atcard){
136
+ this.setDecoration(JSON.parse(decoration_atcard))
137
+ return;
138
+ }
139
+ getDecoration({using:1,user_id:this.uid}).then(data=>{
140
+ let res=data.data.data
141
+ if(res.length==0){
142
+ //空 则为无主题,不再加载接口,界面设No
143
+ sessionStorage.setItem('decoration_atcard'+this.uid,'no')
144
+ return;
145
+ }
146
+ let decoration=res.filter(val => {
147
+ return val.type === 'atcard'
148
+ })
149
+ if(decoration.length>0){
150
+ sessionStorage.setItem('decoration_atcard'+this.uid,JSON.stringify(decoration[0]))
151
+ this.setDecoration(decoration[0])
152
+ }else{
153
+ //空 则为无主题,不再加载接口,界面设No
154
+ sessionStorage.setItem('decoration_atcard'+this.uid,'no')
155
+ }
156
+ })
157
+ },
158
+ setDecoration(decoration_sidebar){
159
+ this.decoration={
160
+ 'background-image':'url('+this.showDecoration(decoration_sidebar.val,decoration_sidebar.type)+')'
161
+ }
162
+ },
127
163
  showMedalIcon: function(val) {
128
164
  return __imgPath + "image/medals/user/" + val + ".gif";
129
165
  },
@@ -139,6 +175,9 @@ export default {
139
175
  showLevelColor:function (level){
140
176
  return __userLevelColor[level]
141
177
  },
178
+ showDecoration:function(val,type){
179
+ return __imgPath + `decoration/images/${val}/${type}.png`;
180
+ },
142
181
  authorLink
143
182
  }
144
183
  }
@@ -148,8 +187,12 @@ export default {
148
187
  @import "../../assets/css/module/author.less";
149
188
  .w-author {
150
189
  .w-author-wrapper {
190
+ // background-image: url(https://img.jx3box.com/decoration/images/1_CAT/atcard.png);
191
+ background-repeat: no-repeat;
192
+ background-position: top right;
193
+ background-size: contain;
151
194
  .u-author{
152
- padding:5px 0 15px 0;
195
+ padding:5px 0 15px 5px;
153
196
  }
154
197
  .u-avatar {
155
198
  .fl;