调用:PayType 背景:bg2.jpg
⚙ 配置
属性 | 说明 | 是否必需 |
---|---|---|
uniClick | 选择统一处理。 | YES |
payType | 缴费类型配置。 资源路径:./h5/img/icon/paytype/(文件名不可随意定义) |
YES |
infor | 顶部额外资源信息内容(支持传入HTML标签) | NO |
整体配置范例
function PayType() {
var data = {
model: "PayType",
config: {
shell: commonShellCfg,
bgImg: "bg2.jpg",
modInAnimation: "fadeIn",
uniClick: "PayType_UniClick",
infor: paytype_infor_html("1000.00", "929.01"),
payType: [
{
type: "ali",
iconType:"svg",//不设置默认png,设置svg显示更清晰
txt: "支付宝支付"
// disabled: true
},
{
type: "wx",
txt: "微信支付"
},
{
type: "medium_sfz",
txt: "<div style='font-size:14px'>扫码支付<br/>(微信+支付宝)</div>"
},
{
type: "unioncloud",
txt: "银行卡云闪付"
},
// {
// type: "medium_ybk",
// txt: "刷脸支付"
// },
],
}
};
return data;
}
uniClick
//配置
uniClick:"PayType_UniClick"
//自定义函数
function PayType_UniClick(index,item) {
//获取按钮索引以及对应索引的值
console.log(index,item);
}
payType
payType:[
{
//#缴费类型#
//支付宝:ali
//微信:wx
//社保:si
//银行卡:bank
//银联:union
//云闪付:unioncloud
//刷脸支付:face
//现金:cash
//卡预交金支付:pcard
//扫码支付:qrcode
type: "ali",
//是否要禁用(非必要,默认为false)
disabled: true,
//缴费按钮块文字内容
txt:"支付宝支付"
},
…
]
infor
infor: paytype_infor_html("200.00","929.01")
//该部分内容可自己定义,或联系前端开发人员代编写
function paytype_infor_html(amount1, amount2) {
return "<div style='font-size:28px;background-color:#dceff7;padding:15px;border-radius:15px'>" +
"<span style='font-weight:bold'>本次自费金额:</span><span style='color:red'>" + amount1 + "</span>元" +
"<span style='margin-right:50px'></span>"+
"<span style='font-weight:bold'>医保支付金额:</span><span style='color:red'>" + amount2 + "</span>元" +
"</div>";
}
♨️ JS Call
无
🚀 getData
无