1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 08:48:06 +08:00
This commit is contained in:
shaoying 2022-10-18 09:28:55 +08:00
parent 1c4947dc63
commit ca866003ca
3 changed files with 35 additions and 20 deletions

View File

@ -193,9 +193,14 @@ Volcanos(chat.ONACTION, {help: "操作数据", _init: function(can, cb, target)
can.onmotion.select(can, can._output, html.FIELDSET_PLUGIN, parseInt(event.key)-1)
}
},
onsize: function(can, msg, height, width) { can.Conf({height: height-can.Conf(html.MARGIN_Y), width: width-can.Conf(html.MARGIN_X)}) },
onsize: function(can, msg, height, width) {
can.Conf({height: height-can.Conf(html.MARGIN_Y), width: width-can.Conf(html.MARGIN_X)})
},
onprint: function(can, msg) { can.page.styleHeight(can, can._target, "") },
onresize: function(can, msg) { can.onlayout._init(can), can.onaction.layout(can, can.Conf(chat.LAYOUT)) },
onresize: function(can, msg) {
can.onlayout._init(can)
can.onaction.layout(can, can.Conf(chat.LAYOUT))
},
layout: function(can, button, silent) { button = button||ice.AUTO
can.page.ClassList.del(can, can._target, can.Conf(chat.LAYOUT)); if (button == ice.AUTO) { button = "" }
@ -204,10 +209,11 @@ Volcanos(chat.ONACTION, {help: "操作数据", _init: function(can, cb, target)
can._header_tabs && can.onmotion.hidden(can, can._header_tabs)
can.onlayout._init(can)
var cb = can.onlayout[button]; if (can.base.isFunc(cb)? cb(can, silent): (can.getActionSize(function(height, width) {
can.ConfHeight(can.base.Min(200, height-can.Conf(html.MARGIN_Y)-(can.isCmdMode()? 0: 200))), can.ConfWidth(width-can.Conf(html.MARGIN_X))
}), false)) { return }
var cb = can.onlayout[button]; if (can.base.isFunc(cb)? cb(can, silent): (function() {})()) { return }
// var cb = can.onlayout[button]; if (can.base.isFunc(cb)? cb(can, silent): (can.getActionSize(function(height, width) {
// can.ConfHeight(can.base.Min(200, height-can.Conf(html.MARGIN_Y)-(can.isCmdMode()? 0: 200))), can.ConfWidth(width-can.Conf(html.MARGIN_X))
// }), false)) { return }
can.page.style(can, can._target, html.HEIGHT, can.ConfHeight(), html.WIDTH, can.ConfWidth())
can.core.Next(can._plugins, function(sub, next) { can.onmotion.delay(can, function() {
sub.onaction._resize(sub, button == "" || button == ice.AUTO, can.ConfHeight(), can.ConfWidth()), next()
if (button == "" || button == ice.AUTO) { can.page.style(can, sub._output, html.MAX_HEIGHT, "") }

View File

@ -1,5 +1,7 @@
fieldset.goods>div.output>div.item>div { padding:10px; float:left; clear:none; }
fieldset.goods>div.output>div.item { height:170px; width:488px; float:left; border-radius:10px; }
fieldset.goods>div.output>div.item { height:170px; float:left; border-radius:10px; }
fieldset.goods>div.output>div.item>div.image img { border-radius:10px; }
fieldset.goods>div.output>div.item>div.content>div.title { width:298px; height:50px; white-space:break-spaces; overflow:auto; }
fieldset.goods>div.output>div.item>div.content>div.price { color:red; }
fieldset.goods>div.output>div.item>div.content { float:right; }
fieldset.goods>div.output>div.item>div.content>div.title { height:50px; white-space:break-spaces; overflow:hidden; }
fieldset.goods>div.output>div.item>div.content>div.price { color:red; }
body.mobile>fieldset.Action>div.output { overflow:hidden; }

View File

@ -1,10 +1,12 @@
Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, target) { can.onmotion.clear(can)
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.clear(can)
var width = can.onexport.width(can); can.user.isMobile && can.page.style(can, can._output, html.HEIGHT, can.ConfHeight())
can.page.Appends(can, target, msg.Table(function(value) {
return {view: html.ITEM+" "+(value.status||""), list: [
return {view: html.ITEM+" "+(value.status||""), style: {width: width}, list: [
{view: "image", list: [{img: can.misc.MergeURL(can, {_path: "/share/cache/"+can.core.Split(value.image)[0]}), width: 150}]}, {view: "content", list: [
{view: [wiki.TITLE, html.DIV, value.name]},
{view: [wiki.TITLE, html.DIV, value.name], style: {width: width-190}},
{view: [wiki.CONTENT, html.DIV, value.text]},
{view: ["price", html.DIV, "¥"+value.price]},
{view: ["price", html.DIV, "¥ "+value.price]},
{view: ["count", html.DIV, "还剩 "+value.count]},
{view: html.ACTION, inner: value.action, onclick: function(event) {
can.run(can.request(event, value), [ctx.ACTION, event.target.name])
}},
@ -13,14 +15,19 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
if (can.page.tagis(event.target, html.INPUT)) { return }
can.Option(mdb.HASH, value.hash), can.Update()
}}
}))
})), can.base.isFunc(cb) && cb(msg)
can.page.Select(can, target, "input[type=button]", function(target) {
if (target.value == target.name) { target.value = can.user.trans(can, target.name) }
})
can.base.isFunc(cb) && cb(msg)
can.page.style(can, can._output, html.HEIGHT, can.ConfHeight())
},
onlayout: function(can) {
can.page.style(can, can._output, html.HEIGHT, can.ConfHeight())
},
}, [""])
layout: function(can) { can.page.style(can, can._output, html.HEIGHT, can.ConfHeight())
var width = can.onexport.width(can); can.page.Select(can, can._output, "div.item", function(target) {
can.page.style(can, target, html.WIDTH, width), can.page.Select(can, target, "div.title", function(target) {
can.page.style(can, target, html.WIDTH, width-190)
})
})
},
}, [""])
Volcanos(chat.ONEXPORT, {
width: function(can) { if (can.ConfWidth() < 343) { return 343 } for (var i = 2; i < 10; i++) { if (can.ConfWidth() < 343*i) { return can.ConfWidth()/(i-1) } } },
})