|
@@ -51,11 +51,14 @@ export default {
|
|
EventBus.$emit('loading', val);
|
|
EventBus.$emit('loading', val);
|
|
},
|
|
},
|
|
$route(){
|
|
$route(){
|
|
- this.dispath()
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
- this.dispath()
|
|
|
|
|
|
+ let {id } = this.$route.params;
|
|
|
|
+ if(id=="main") id = '679773f089e7bbf1b50a43e2c83645be';
|
|
|
|
+ this.uuid = id
|
|
|
|
+ console.log("uuid", id)
|
|
|
|
+ this.init()
|
|
},
|
|
},
|
|
mounted(){
|
|
mounted(){
|
|
if(!this.isMobile) {
|
|
if(!this.isMobile) {
|
|
@@ -66,49 +69,15 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapActions('pages', ['setPage']),
|
|
...mapActions('pages', ['setPage']),
|
|
- dispath(){
|
|
|
|
- const { id } = this.$route.params;
|
|
|
|
- if( id == "main"){
|
|
|
|
- this.uuid = ""
|
|
|
|
- this.paperId = 0
|
|
|
|
- this.init()
|
|
|
|
- }else if( id.length == 32 ){
|
|
|
|
- this.uuid = id
|
|
|
|
- this.paperId = 0
|
|
|
|
- this.init()
|
|
|
|
- }else{
|
|
|
|
- this.nodeId = +id;
|
|
|
|
- this.getPageInfo();
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
init(){
|
|
init(){
|
|
- let {paperId,uuid} = this.uuid;
|
|
|
|
|
|
+ let uuid = this.uuid;
|
|
if(this.loading) return;
|
|
if(this.loading) return;
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- fetch("paper.getpaperinfo", {paperId,uuid}).then((res) => {
|
|
|
|
|
|
+ fetch("paper.getpaper", {uuid}).then((res) => {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
this.isMain = true
|
|
this.isMain = true
|
|
- let {nodes, slider} = res;
|
|
|
|
|
|
+ console.log( res, res)
|
|
this.page = res;
|
|
this.page = res;
|
|
- this.page.nodes = {
|
|
|
|
- logo: {
|
|
|
|
- type: "image",
|
|
|
|
- image: res.logo,
|
|
|
|
- style: "position: absolute; z-index: 111; top: 80px; width: 50vw; left: 50%;margin-left: -25vw;pointer-events:none;"
|
|
|
|
- },
|
|
|
|
- slider:{
|
|
|
|
- type: "slider",
|
|
|
|
- style: "height: 200px;",
|
|
|
|
- children: slider.split(",").map((url)=>{
|
|
|
|
- return {image: url}
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- matrix: {
|
|
|
|
- type: "matrix",
|
|
|
|
- style: "height: 200px;",
|
|
|
|
- children: nodes
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
this.setPage(this.page);
|
|
this.setPage(this.page);
|
|
res.title && (document.title = res.title);
|
|
res.title && (document.title = res.title);
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
@@ -116,20 +85,6 @@ export default {
|
|
this.error = true;
|
|
this.error = true;
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- getPageInfo() {
|
|
|
|
- let nodeId = this.nodeId;
|
|
|
|
- if( !nodeId ) return;
|
|
|
|
- fetch("paper.getnodeinfo", {nodeId}).then((res) => {
|
|
|
|
- this.isMain = false
|
|
|
|
- this.page = res
|
|
|
|
- this.setPage(res);
|
|
|
|
- res.title && (document.title = res.title);
|
|
|
|
- }).catch((res) => {
|
|
|
|
- console.log("catch", res);
|
|
|
|
- this.loading = false;
|
|
|
|
- this.error = true;
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
back(){
|
|
back(){
|
|
this.$router.back();
|
|
this.$router.back();
|
|
}
|
|
}
|