Commit f9a979e1 by zhangmeng

merge

parents d64b4ac5 e1b2489b
import data from './schemaData.js'
import editMethod from './editMethod.js'
import requireIcons from '@/icons/requireIcons'
// console.log(JSON.stringify(data))
export default {
data: function () {
return {
pages: data.pageList,
sceneData: data.sceneData
}
},
methods: {
callback () {
console.log('callback')
},
getDefaulted () {
this.pages = this.pages.map(function (item) {
item.list.map(ele => {
return (ele = Object.assign(ele, ele.default))
})
return item
// (item = Object.assign(item, item.default));
})
},
getAllData () {
this.message(
{
type: 'getList',
pages: this.pages
},
'*'
)
},
setAllData (data) {
this.pages = data.pages
},
...editMethod
},
mounted () {
function setZoom () {
var unit = 1920
var unit2 = 1080
var width = window.innerWidth
var height = window.innerHeight
var zoom = height / 1080
if (width / height <= 16 / 9) {
zoom = width / 1920
}
if (width / height >= 16 / 9) {
zoom = height / 1080
}
var container = document.querySelectorAll('.container')
for (let index = 0; index < container.length; index++) {
// container[index].style.transform = `scale(${zoom})`;
}
// console.log(zoom);
document.querySelector(
'.swiper-container'
).style.transform = `scale(${zoom})`
}
setZoom()
addEventListener('resize', setZoom, false)
},
created: function () {
console.log('我是mixin 的crteated')
}
}
export default {
schemaData: {},
itemList: []
}
import defaultData from './defaultData'
import itemList from './itemList'
import templateInfo from './templateInfo'
import sceneData from './sceneData.js'
export default {
templateInfo,
// defaultData,
sceneData,
pageList: [
{
name: '欢迎页面',
thumb: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/resource/template-culture/thumb1.jpg',
component: 'welcome',
defaultData: defaultData.welcome,
schemaData: defaultData.welcome,
itemList: itemList.welcome
},
{
name: '通知页面',
thumb: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/resource/template-culture/thumb3.jpg',
component: 'notice',
defaultData: defaultData.notice,
schemaData: defaultData.notice,
itemList: itemList.notice
},
{
name: '日程页面',
thumb: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/resource/template-culture/thumb2.jpg',
component: 'schedule',
defaultData: defaultData.schedule,
schemaData: defaultData.schedule,
itemList: itemList.schedule
}
]
}
import data from './schemaData.js'
import editMethod from './editMethod.js'
import requireIcons from '@/icons/requireIcons'
// console.log(JSON.stringify(data))
export default {
data: function () {
return {
pages: data.pageList,
sceneData: data.sceneData // 引入页面数据
}
},
methods: {
callback () {
console.log('callback')
},
getDefaulted () {
// todo 获取默认值
this.pages = this.pages.map(function (item) {
item.list.map(ele => {
return (ele = Object.assign(ele, ele.default))
})
return item
})
},
getAllData () {
this.message(
{
type: 'getList',
pages: this.pages
},
'*'
)
},
setAllData (data) {
this.pages = data.pages
},
...editMethod
},
mounted () {
// setZoom 设置网页缩放
function setZoom () {
var unit = 1920
var unit2 = 1080
var width = window.innerWidth
var height = window.innerHeight
var zoom = height / 1080
if (width / height <= 16 / 9) {
zoom = width / 1920
}
if (width / height >= 16 / 9) {
zoom = height / 1080
}
var container = document.querySelectorAll('.container')
for (let index = 0; index < container.length; index++) {
// container[index].style.transform = `scale(${zoom})`;
}
// console.log(zoom);
document.querySelector(
'.glob-container'
).style.transform = `scale(${zoom})`
}
setZoom()
addEventListener('resize', setZoom, false)
},
created: function () {
// console.log('我是mixin 的crteated')
}
}
export default {
schemaData: {},
itemList: []
}
import defaultData from './defaultData'
import itemList from './itemList'
import templateInfo from './templateInfo'
import sceneData from './sceneData.js'
export default {
templateInfo,
// defaultData,
sceneData,
pageList: [
{
name: '买房页面',
thumb: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/resource/listing-information/thumb1.png',
component: 'buyingHouse',
defaultData: defaultData.buyingHouse,
schemaData: defaultData.buyingHouse,
itemList: itemList.buyingHouse
},
{
name: '租房页面',
thumb: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/resource/listing-information/thumb2.png',
component: 'rentHouse',
defaultData: defaultData.buyingHouse,
schemaData: defaultData.buyingHouse,
itemList: itemList.buyingHouse
},
{
name: '租房页面',
thumb: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/resource/listing-information/thumb2.png',
component: 'rentHouse2',
defaultData: defaultData.buyingHouse,
schemaData: defaultData.buyingHouse,
itemList: itemList.buyingHouse
},
{
name: '租房页面',
thumb: 'http://visual-clouds.oss-cn-beijing.aliyuncs.com/resource/listing-information/thumb2.png',
component: 'rentHouse3',
defaultData: defaultData.buyingHouse,
schemaData: defaultData.buyingHouse,
itemList: itemList.buyingHouse
}
]
}
...@@ -6,7 +6,8 @@ import requireIcons from '@/icons/requireIcons' ...@@ -6,7 +6,8 @@ import requireIcons from '@/icons/requireIcons'
export default { export default {
data: function () { data: function () {
return { return {
pages: data.pageList pages: data.pageList,
sceneData: data.sceneData
} }
}, },
methods: { methods: {
......
export default {
schemaData: {},
itemList: []
}
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