@jx3box/jx3box-common-ui 6.5.8 → 6.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 +1 -1
- package/src/App.vue +2 -2
- package/src/LeftSidebar.vue +22 -14
package/package.json
CHANGED
package/src/App.vue
CHANGED
package/src/LeftSidebar.vue
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
'without-bread': withoutBread,
|
|
8
8
|
}"
|
|
9
9
|
v-if="!isApp"
|
|
10
|
-
:style="
|
|
10
|
+
:style="{backgroundImage:bg}"
|
|
11
11
|
>
|
|
12
12
|
<div class="c-sidebar-left-inner">
|
|
13
13
|
<slot></slot>
|
|
@@ -39,26 +39,30 @@ import Bus from "../service/bus";
|
|
|
39
39
|
import { isApp } from "../assets/js/app.js";
|
|
40
40
|
import {getDecoration} from "../service/cms"
|
|
41
41
|
import { __imgPath } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
42
|
-
import User from '@jx3box/jx3box-common'
|
|
42
|
+
import User from '@jx3box/jx3box-common/js/user'
|
|
43
43
|
export default {
|
|
44
44
|
name: "LeftSidebar",
|
|
45
|
-
props: ["open", "withoutBread"],
|
|
45
|
+
props: ["open", "withoutBread","uid"],
|
|
46
46
|
data: function () {
|
|
47
47
|
return {
|
|
48
48
|
isOpen: true,
|
|
49
|
+
user_id:null,
|
|
49
50
|
isApp: isApp(),
|
|
50
|
-
|
|
51
|
+
bg:""
|
|
51
52
|
};
|
|
52
53
|
},
|
|
53
54
|
computed: {
|
|
54
55
|
stickyHeader: function () {
|
|
55
56
|
return this.withoutBread;
|
|
56
|
-
}
|
|
57
|
+
}
|
|
57
58
|
},
|
|
58
59
|
watch: {
|
|
59
60
|
open: function (newval) {
|
|
60
61
|
this.isOpen = newval === undefined ? true : !!newval;
|
|
61
62
|
},
|
|
63
|
+
uid: function (newval) {
|
|
64
|
+
this.user_id = newval ;
|
|
65
|
+
},
|
|
62
66
|
},
|
|
63
67
|
methods: {
|
|
64
68
|
toggleLeftSide: function () {
|
|
@@ -69,8 +73,9 @@ export default {
|
|
|
69
73
|
return __imgPath + `decoration/images/${val}/${type}.png`;
|
|
70
74
|
},
|
|
71
75
|
getDecoration(){
|
|
72
|
-
let decoration_sidebar=sessionStorage.getItem('decoration_sidebar')
|
|
76
|
+
let decoration_sidebar=sessionStorage.getItem('decoration_sidebar'+this.uid)
|
|
73
77
|
if(decoration_sidebar == 'no'){
|
|
78
|
+
this.bg =""
|
|
74
79
|
return;
|
|
75
80
|
}
|
|
76
81
|
//已有缓存,读取解析
|
|
@@ -78,29 +83,29 @@ export default {
|
|
|
78
83
|
this.setDecoration(JSON.parse(decoration_sidebar))
|
|
79
84
|
return;
|
|
80
85
|
}
|
|
81
|
-
getDecoration({using:1}).then(data=>{
|
|
86
|
+
getDecoration({using:1,user_id:this.user_id}).then(data=>{
|
|
82
87
|
let res=data.data.data
|
|
83
88
|
if(res.length==0){
|
|
84
89
|
//空 则为无主题,不再加载接口,界面设No
|
|
85
|
-
sessionStorage.setItem('decoration_sidebar','no')
|
|
90
|
+
sessionStorage.setItem('decoration_sidebar'+this.uid,'no')
|
|
91
|
+
this.bg =""
|
|
86
92
|
return;
|
|
87
93
|
}
|
|
88
94
|
let decoration=res.filter(val => {
|
|
89
95
|
return val.type === 'sidebar'
|
|
90
96
|
})
|
|
91
97
|
if(decoration.length>0){
|
|
92
|
-
sessionStorage.setItem('decoration_sidebar',JSON.stringify(decoration[0]))
|
|
98
|
+
sessionStorage.setItem('decoration_sidebar'+this.uid,JSON.stringify(decoration[0]))
|
|
93
99
|
this.setDecoration(decoration[0])
|
|
94
100
|
}else{
|
|
95
101
|
//空 则为无主题,不再加载接口,界面设No
|
|
96
|
-
sessionStorage.setItem('decoration_sidebar','no')
|
|
102
|
+
sessionStorage.setItem('decoration_sidebar'+this.uid,'no')
|
|
103
|
+
this.bg =""
|
|
97
104
|
}
|
|
98
105
|
})
|
|
99
106
|
},
|
|
100
107
|
setDecoration(decoration_sidebar){
|
|
101
|
-
this.
|
|
102
|
-
'background-image':'url('+this.showDecoration(decoration_sidebar.val,decoration_sidebar.type)+')'
|
|
103
|
-
}
|
|
108
|
+
this.bg = `url(${this.showDecoration(decoration_sidebar.val,decoration_sidebar.type)})`;
|
|
104
109
|
}
|
|
105
110
|
},
|
|
106
111
|
mounted: function () {
|
|
@@ -118,7 +123,10 @@ export default {
|
|
|
118
123
|
},
|
|
119
124
|
created: function () {
|
|
120
125
|
this.isOpen = this.open === undefined ? true : this.open;
|
|
121
|
-
|
|
126
|
+
this.user_id = this.uid
|
|
127
|
+
if(this.user_id){
|
|
128
|
+
this.getDecoration()
|
|
129
|
+
}
|
|
122
130
|
},
|
|
123
131
|
};
|
|
124
132
|
</script>
|