1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00

opt login

This commit is contained in:
shylinux 2021-04-29 11:18:38 +08:00
parent 10c06a51d6
commit 48cf389106
6 changed files with 18 additions and 9 deletions

View File

@ -301,7 +301,7 @@ Volcanos("page", {help: "网页模块",
text = text.replace(/\\n/g, "<br>") text = text.replace(/\\n/g, "<br>")
return text return text
}, },
Format: function(type, src, name) { Format: function(type, src) {
switch (type) { switch (type) {
case "a": case "a":
return "<a href='"+arguments[1]+"' target='_blank'>"+(arguments[2]||arguments[1])+"</a>" return "<a href='"+arguments[1]+"' target='_blank'>"+(arguments[2]||arguments[1])+"</a>"

View File

@ -96,8 +96,8 @@ Volcanos("user", {help: "用户模块", agent: {
can.run(msg._event, cmd||["action", "share"], function(msg) { can.run(msg._event, cmd||["action", "share"], function(msg) {
var src = can.user.MergeURL(can, {_path: "/share/"+msg.Result()}, true) var src = can.user.MergeURL(can, {_path: "/share/"+msg.Result()}, true)
var ui = can.user.toast(can, { var ui = can.user.toast(can, {
title: can.page.Format("a", "/share?share="+msg.Result(), "share"), title: can.page.Format("a", "/share/"+msg.Result()+"?share="+msg.Result()),
content: can.page.Format("img", src+"/share")+"<br/>"+can.user.MergeURL(can, {share: msg.Result()}, true), content: can.page.Format("img", src+"/share"),
button: ["close"], duration: 100000, button: ["close"], duration: 100000,
width: 300, height: 300, width: 300, height: 300,
}) })
@ -121,7 +121,7 @@ Volcanos("user", {help: "用户模块", agent: {
case "扫码": case "扫码":
can.misc.WSS(can, {type: "chrome"}, function(event, msg, cmd, arg) { if (!msg) { return } can.misc.WSS(can, {type: "chrome"}, function(event, msg, cmd, arg) { if (!msg) { return }
if (cmd == "pwd") { if (cmd == "pwd") {
can.user.share(can, can.request(event, {text: arg[0]}), ["action", "apply"]) can.user.share(can, can.request(event, {name: arg[0]}), ["action", "apply"])
msg.Reply() msg.Reply()
return return
} }
@ -142,6 +142,8 @@ Volcanos("user", {help: "用户模块", agent: {
break break
} }
}) })
can.page.Modify(can, ui.first, {style: {left: (window.innerWidth-ui.first.offsetWidth)/2}})
}, },
carte: function(event, can, meta, list, cb, view) { carte: function(event, can, meta, list, cb, view) {
meta = meta||can.ondetail||can.onaction||{}, list = list&&list.length > 0? list: meta.list||[]; if (list.length == 0) { return } meta = meta||can.ondetail||can.onaction||{}, list = list&&list.length > 0? list: meta.list||[]; if (list.length == 0) { return }

View File

@ -202,6 +202,9 @@ div.toast {
padding:5px; padding:5px;
z-index:100; z-index:100;
} }
div.toast a {
color:yellow;
}
div.toast div.title { div.toast div.title {
font-size:14px; font-size:14px;
color:#cae850; color:#cae850;

View File

@ -174,8 +174,8 @@ Volcanos("onaction", {help: "交互数据", list: [], _init: function(can, msg,
can.onlayout.topic(can) can.onlayout.topic(can)
can.user.isLocalFile? init(): can.run({}, ["check"], function(msg) { can.user.isLocalFile? init(): can.run({}, ["check"], function(msg) {
if (msg.Option("type") == "apply" && msg.Option("name") == "") { if (msg.Option("type") == "apply" && msg.Option("username") == "") {
if (can.user.confirm("auth "+msg.Option("text"))) { if (can.user.confirm("auth "+msg.Option("name"))) {
can.run(event, ["action", "auth", "share", can.user.Search(can, "share")]) can.run(event, ["action", "auth", "share", can.user.Search(can, "share")])
} }
} }

View File

@ -1,6 +1,10 @@
Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, list, cb, target) { Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, list, cb, target) {
can._main_river = can.user.Search(can, "river") || Volcanos.meta.args.river || (can.user.isMobile||can.user.isExtension? "product": "project") can._main_river = can.user.Search(can, "river") || Volcanos.meta.args.river || "project"
can._main_storm = can.user.Search(can, "storm") || Volcanos.meta.args.storm || (can.user.isMobile? "office": can.user.isExtension? "chrome": "studio") can._main_storm = can.user.Search(can, "storm") || Volcanos.meta.args.storm || "studio"
if (can.user.isExtension) { can._main_river = "product", can._main_storm = "chrome" }
if (can.user.isMobile) { can._main_river = "product", can._main_storm = "office" }
if (can.user.isWeiXin) { can._main_river = "service", can._main_storm = "wx" }
can.onmotion.clear(can), can.sublist = {} can.onmotion.clear(can), can.sublist = {}
var select; msg.Table(function(value, index, array) { var select; msg.Table(function(value, index, array) {

View File

@ -50,7 +50,7 @@ var Volcanos = shy("火山架", {args: {}, pack: {}, libs: [], cache: {}}, [], f
return // 加载完成 return // 加载完成
} }
if (libs && libs[0][0] != "/") { if (libs && libs[0][0] != "/" && libs[0].indexOf("http") == -1) {
can._require = can._require||[], can._require.push(libs[0]) can._require = can._require||[], can._require.push(libs[0])
can.require(libs.slice(1), cb, each) can.require(libs.slice(1), cb, each)
return return