Commit be83661b by hank

代码优化

parent b2acb410
...@@ -4,5 +4,5 @@ const prodEnv = require('./prod.env') ...@@ -4,5 +4,5 @@ const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, { module.exports = merge(prodEnv, {
NODE_ENV: '"development"', NODE_ENV: '"development"',
BASE_API: '"http://equipment.bdideal.com"' BASE_API: '"https://equipment.bdideal.com"'
}) })
\ No newline at end of file
...@@ -89,12 +89,13 @@ export default { ...@@ -89,12 +89,13 @@ export default {
}, },
methods: { methods: {
loaded(index) { loaded(index) {
console.log("child mouted", index); if (!this.isEditMode) {
setTimeout(() => { setTimeout(() => {
this.$refs["child" + this.sliderActiveIndex][0].enter().then(() => { this.$refs["child" + this.sliderActiveIndex][0].enter().then(() => {
console.log(index, "enter 完毕"); console.log(index, "enter 完毕");
}); });
}, 1000); }, 1000);
}
}, },
message(data) { message(data) {
Message.send(data, "*"); Message.send(data, "*");
...@@ -130,20 +131,25 @@ export default { ...@@ -130,20 +131,25 @@ export default {
}); });
}, },
created() { created() {
Scene.EventBus.on("leaveBefore", e => { if (getQuery("isEdit")) {
console.log("leaveBefore"); this.isEditMode = true;
if (this.pages.length > 1) { } else {
this.$refs["child" + this.sliderActiveIndex][0].leave().then(() => { Scene.EventBus.on("leaveBefore", e => {
console.log("leaveBefore then"); console.log("leaveBefore");
var index = this.sliderActiveIndex; if (this.pages.length > 1) {
if (index >= this.pages.length - 1) { this.$refs["child" + this.sliderActiveIndex][0].leave().then(() => {
index = -1; console.log("leaveBefore then");
console.log(index); var index = this.sliderActiveIndex;
} if (index >= this.pages.length - 1) {
this.swiper.slideTo(index + 1, 0, false); index = -1;
}); console.log(index);
} }
}); this.swiper.slideTo(index + 1, 0, false);
});
}
});
this.isEditMode = false;
}
var vm = this; var vm = this;
Message.init(e => { Message.init(e => {
var isObj = typeof e.data === "object"; var isObj = typeof e.data === "object";
...@@ -200,11 +206,6 @@ export default { ...@@ -200,11 +206,6 @@ export default {
} }
} }
}; };
if (getQuery("isEdit")) {
this.isEditMode = true;
} else {
this.isEditMode = false;
}
if (getQuery("filmId") && !this.isEditMode) { if (getQuery("filmId") && !this.isEditMode) {
getFilmDetail(getQuery("filmId")).then(result => { getFilmDetail(getQuery("filmId")).then(result => {
console.log(result); console.log(result);
...@@ -242,7 +243,7 @@ export default { ...@@ -242,7 +243,7 @@ export default {
position: relative; position: relative;
opacity: 1; opacity: 1;
.ant { .ant {
clip-path: url(#cd-image-1) clip-path: url(#cd-image-1);
} }
.decoration { .decoration {
position: absolute; position: absolute;
......
...@@ -45,28 +45,28 @@ export default [ ...@@ -45,28 +45,28 @@ export default [
type: 'text', type: 'text',
name: '亮点二名称', name: '亮点二名称',
description: '填写亮点二名称不超过三个字', description: '填写亮点二名称不超过三个字',
dataKey: 'brighTwoName', dataKey: 'brightTwoName',
valueRule: '' valueRule: ''
}, },
{ {
type: 'text', type: 'text',
name: '亮点二内容', name: '亮点二内容',
description: '填写亮点二内容不超过五个字', description: '填写亮点二内容不超过五个字',
dataKey: 'brighTwoContent', dataKey: 'brightTwoContent',
valueRule: '' valueRule: ''
}, },
{ {
type: 'text', type: 'text',
name: '亮点三名称', name: '亮点三名称',
description: '填写亮点三名称不超过三个字', description: '填写亮点三名称不超过三个字',
dataKey: 'brighThreeName', dataKey: 'brightThreeName',
valueRule: '' valueRule: ''
}, },
{ {
type: 'text', type: 'text',
name: '亮点三内容', name: '亮点三内容',
description: '填写亮点三内容不超过五个字', description: '填写亮点三内容不超过五个字',
dataKey: 'brighThreeContent', dataKey: 'brightThreeContent',
valueRule: '' valueRule: ''
}, },
{ {
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</div> </div>
<div class="surrounding" zh="房源特色" ref="surrounding">PROPERTY FEATURES</div> <div class="surrounding" zh="房源特色" ref="surrounding">PROPERTY FEATURES</div>
<div class="feature-list" ref="feature-list"> <div class="feature-list" ref="feature-list">
<div class="feature-item" v-for="(item, index) in feutrueList" :key="index">{{item}}</div> <div class="feature-item" v-for="(item, index) in feutrueList" :key="index">{{item}}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -54,7 +54,7 @@ import { swiper, swiperSlide } from "vue-awesome-swiper"; ...@@ -54,7 +54,7 @@ import { swiper, swiperSlide } from "vue-awesome-swiper";
import StarSky from "@/framework/components/BoxShadowSky"; import StarSky from "@/framework/components/BoxShadowSky";
import methods from "../methods"; import methods from "../methods";
import anime from "animejs/lib/anime.es.js"; import anime from "animejs/lib/anime.es.js";
import Scene from '@/framework/utils/sence' import Scene from "@/framework/utils/sence";
export default { export default {
name: "welcome", name: "welcome",
props: ["schemaData", "page", "isEditMode", "cancelEdit"], props: ["schemaData", "page", "isEditMode", "cancelEdit"],
...@@ -93,16 +93,16 @@ export default { ...@@ -93,16 +93,16 @@ export default {
easing: "easeOutQuad" easing: "easeOutQuad"
}).finished }).finished
]; ];
var enPromise = Promise.all(PromiseAll) var enPromise = Promise.all(PromiseAll);
return enPromise; return enPromise;
}, },
enter() { enter() {
console.log('enter anime') console.log("enter anime");
var PromiseAll = [ var PromiseAll = [
anime({ anime({
targets: this.$refs["house-list"], targets: this.$refs["house-list"],
translateX: 0, translateX: 0,
opacity: 1, opacity: 1,
duration: 1000 duration: 1000
}).finished, }).finished,
anime({ anime({
...@@ -149,8 +149,8 @@ export default { ...@@ -149,8 +149,8 @@ export default {
}).finished }).finished
]; ];
Promise.all(PromiseAll).then(() => { Promise.all(PromiseAll).then(() => {
this.enterAfter() this.enterAfter();
}) });
return Promise.all(PromiseAll); return Promise.all(PromiseAll);
}, },
enterBefore() { enterBefore() {
...@@ -215,8 +215,12 @@ export default { ...@@ -215,8 +215,12 @@ export default {
} }
}, },
mounted() { mounted() {
console.log('mounted') console.log(this.isEditMode);
this.enterBefore() if (!this.isEditMode) {
console.log(this.isEditMode);
this.enterBefore();
}
}, },
data() { data() {
return { return {
......
...@@ -246,8 +246,9 @@ export default { ...@@ -246,8 +246,9 @@ export default {
} }
}, },
mounted() { mounted() {
console.log("mounted"); if (!this.isEditMode) {
this.enterBefore(); this.enterBefore();
}
}, },
data() { data() {
return { return {
......
...@@ -243,8 +243,9 @@ export default { ...@@ -243,8 +243,9 @@ export default {
} }
}, },
mounted() { mounted() {
console.log("mounted"); if (!this.isEditMode) {
this.enterBefore(); this.enterBefore();
}
}, },
data() { data() {
return { return {
......
...@@ -266,7 +266,9 @@ export default { ...@@ -266,7 +266,9 @@ export default {
} }
}, },
mounted() { mounted() {
this.enterBefore(); if (!this.isEditMode) {
this.enterBefore();
}
}, },
data() { data() {
return { return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment