调用:InforShow 背景:bg3.jpg
⚙ 配置
属性 | 说明 | 是否必需 |
---|---|---|
media | 左侧媒体信息配置 资源路径:./h5/img/icon/qrcode/(文件名不可随意定义) |
YES |
topTip | 左侧媒体信息上方提示信息内容 | NO |
subTip | 左侧媒体信息下方提示信息内容 | NO |
txt | 信息内容 | NO |
contentCenter | 信息内容是否垂直居中显示(可不配该配置,默认为true)。 设置为false时,内容以左上角处开始显示。 ⚠️当设置为true时,传入内容时,超过一行数据将自动换行。 |
NO |
tip | 温馨提示配置(1080*1920竖屏下不支持) | NO |
整体配置范例
function InforShow() {
var data = {
model: "InforShow",
config: {
shell: commonShellCfg2,
bgImg: "bg3.jpg",
modInAnimation: "fadeIn",
media: {
type: "qrcode", //swf pic qrcode
// url: "./h5/img/lefttip/dycg.png",
size: 220,
data: "http://weixin.qq.com/r/3jovN8vEXZYirY9U92-M",
qrIcon: "wx",
},
subTip: "请您打开微信进行扫码",
txt: inforshow_format_html1("failed", "failed.svg", "通讯失败"),
// txt: inforshow_format_html1("success", "success.svg", "操作成功"),
// txt: inforshow_format_html1("success", "left-arrow.svg","请按图示,插入您的医保卡"),
// txt: inforshow_format_html2("9988222"),
// txt: inforshow_format_html3(),
// txt: inforshow_format_html4("王晓华", "320402199008083418", "女", "15961287766"),
// txt: "信息回显内容",
contentCenter: true,
tip: {
title: "温馨提示",
txt: "请您按提示认真操作,如有问题请求助自助机旁的导医人员。\n操作完成时,\n请您取走您的银行卡或诊疗卡,以防丢失!"
}
}
};
return data;
}
function inforshow_format_html1(type, pic, content) {
var dpi = window.ZZH5.Dpi;
var _img_width = "100px";
if (dpi == "1024_768") {
_img_width = "75px";
}
var dom = "";
var iconUrl = "./h5/img/icon/inforshow/";
var maincolor = "#386fc9";
if (type == "success") {
maincolor = "#386fc9";
}
if (type == "failed") {
maincolor = "#a81503";
}
dom = "<div style='display:flex;flex-direction:column;justify-content:center;align-items:center;'>" +
"<img src='" + iconUrl + pic + "' style='width:" + _img_width + ";margin-bottom:10px'/>" +
"<div style='text-align:center;font-size:40px;color:" + maincolor + "'>" + content + "</div>" +
"</div>";
return dom;
}
function inforshow_format_html2(cardNo) {
var dom = "";
dom = "<div style='font-size:32px;display:flex;flex-direction:column;justify-content:center;align-items:center;'>" +
"<div>您已经办过卡,卡号是:<spans style='color:#386fc9'>" + cardNo + "</span></div>" +
"<br/>" +
"<div>点击确认进行补卡,补卡后<span style='color:red'>原卡作废</span></div>" +
"<div style='margin-top:20px'>否则请点击返回按钮!</div>" +
"</div>";
return dom;
}
function inforshow_format_html3() {
var dom = "";
dom = "<div style='font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;line-height:52px;padding-left:20px'>" +
"<div>1、请您使用二代身份证在本机办理居民健康卡。</div>" +
"<div>2、本院诊疗卡将收取您的10元押金。</div>" +
"<div style='width:600px'>3、请您务必妥善保管您挂号时打印出的凭条,以便就诊、取药时使用。</div>" +//想要换行须加width
"<div>4、请根据 自助设备上提示及时取出您的诊疗卡。</div>" +
"</div>";
return dom;
}
function inforshow_format_html4(name, idcno, sex, mobile) {
var dom = "";
dom = "<div style='font-size:32px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;line-height:70px;'>" +
"<div>姓 名:" + name + "</div>" +
"<div>身份证号:" + idcno + "</div>" +
"<div>性 别:" + sex + "</div>" +
"<div>手机号码:" + mobile + "</div>" +
"</div>";
return dom;
}
media
//当type为pic或swf时
media:{
//媒体类型:swf|pic(可以是gif文件)|qrcode
type:"swf",//swf pic qrcode
//媒体文件路径
url:"./h5/swf/idc.swf",
//媒体文件尺寸(非必要,默认是文件原件尺寸大小)
//🔆为了不影响缩放比例,只调width或height一个值
size:{
width:"200px",
height:"100px"
},
}
//当type为qrcode时
media:{
//媒体类型
type:"qrcode",
//二维码大小
//🔆为正方形,可不配置,默认220(1024*768),280(1280*1024)
size:220,
//二维码数据
data:"123",
//二维码中ICON
//微信:wx
//支付宝:ali
qrIcon:"ali"
}
subTip
//#调用
subTip:"请按提示操作"
title
//#调用
title:"请核对您的信息"
txt
//#调用(支持HTML标签)
txt: inforshow_format_html1("failed", "failed.svg", "通讯失败"),
txt: inforshow_format_html1("success", "success.svg", "操作成功"),
function inforshow_format_html1(type, pic, content) {
var dpi = window.ZZH5.Dpi;
var _img_width = "100px";
if (dpi == "1024_768") {
_img_width = "75px";
}
var dom = "";
var iconUrl = "./h5/img/icon/inforshow/";
var maincolor = "#386fc9";
if (type == "success") {
maincolor = "#386fc9";
}
if (type == "failed") {
maincolor = "#a81503";
}
dom = "<div style='display:flex;flex-direction:column;justify-content:center;align-items:center;'>" +
"<img src='" + iconUrl + pic + "' style='width:" + _img_width + ";margin-bottom:10px'/>" +
"<div style='text-align:center;font-size:40px;color:" + maincolor + "'>" + content + "</div>" +
"</div>";
return dom;
}
//#调用(支持HTML标签)
txt: inforshow_format_html3(),
function inforshow_format_html3() {
var dom = "";
dom = "<div style='font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;line-height:52px;padding-left:20px'>" +
"<div style='width:600px'>1、请您使用二代身份证在本机办理居民健康卡。</div>" +
"<div style='width:600px'>2、本院诊疗卡将收取您的10元押金。</div>" +
"<div style='width:600px'>3、请您务必妥善保管您挂号时打印出的凭条,以便就诊、取药时使用。</div>" +//想要换行须加width
"<div style='width:600px'>4、请根据 自助设备上提示及时取出您的诊疗卡。</div>" +
"</div>";
return dom;
}
//#调用(支持HTML标签)
txt: inforshow_format_html23("王晓华", "32040219900808", "女", "15961287766"),
function inforshow_format_html23(name, idcno, sex, mobile) {
var dom = "";
// 🔥行数多时注意修改line-height属性,降低行高
dom = "<div style='font-size:36px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;line-height:100px;'>" +
"<lable>姓 名:" + name + "</lable>" +
"<lable>身份证号:" + idcno + "</lable>" +
"<lable>性 别:" + sex + "</lable>" +
"<lable>手机号码:" + mobile + "</lable>" +
"</div>";
return dom;
}
contentCenter
//#调用
contentCenter:false
tip
//#调用(支持HTML标签)
//文本换行请加:<br/>或每行以<p></p>来包裹或\n
tip:{
//标题
title: "温馨提示",
//内容
txt: "请您认真操作"
}
👉点击这里:使用更多HTML格式
♨️ JS Call
方法 | 说明 |
---|---|
setData(type,content):void | 文字内容设置。 |
setData(type,content):void
[入参] type……设置方式。 add:追加文字内容。 reset:重置文字内容。 content……文字内容(支持HTML标签) [返回]无
//#调用-追加文字
ZZH5.Call.setData("add","加载成功,正在跳转页面...");
//#调用-重设文字
ZZH5.Call.setData("reset","加载成功,正在跳转页面...");
🚀 getData
无