调用:PayType 背景:bg2.jpg

image.png
image.png

⚙ 配置

属性 说明 是否必需
uniClick 选择统一处理。 YES
payType 缴费类型配置。
资源路径:./h5/img/icon/paytype/(文件名不可随意定义)
YES
infor 顶部额外资源信息内容(支持传入HTML标签) NO

整体配置范例

  1. function PayType() {
  2. var data = {
  3. model: "PayType",
  4. config: {
  5. shell: commonShellCfg,
  6. bgImg: "bg2.jpg",
  7. modInAnimation: "fadeIn",
  8. uniClick: "PayType_UniClick",
  9. infor: paytype_infor_html("1000.00", "929.01"),
  10. payType: [
  11. {
  12. type: "ali",
  13. iconType:"svg",//不设置默认png,设置svg显示更清晰
  14. txt: "支付宝支付"
  15. // disabled: true
  16. },
  17. {
  18. type: "wx",
  19. txt: "微信支付"
  20. },
  21. {
  22. type: "medium_sfz",
  23. txt: "<div style='font-size:14px'>扫码支付<br/>(微信+支付宝)</div>"
  24. },
  25. {
  26. type: "unioncloud",
  27. txt: "银行卡云闪付"
  28. },
  29. // {
  30. // type: "medium_ybk",
  31. // txt: "刷脸支付"
  32. // },
  33. ],
  34. }
  35. };
  36. return data;
  37. }

uniClick

  1. //配置
  2. uniClick:"PayType_UniClick"
  3. //自定义函数
  4. function PayType_UniClick(index,item) {
  5. //获取按钮索引以及对应索引的值
  6. console.log(index,item);
  7. }

payType

  1. payType:[
  2. {
  3. //#缴费类型#
  4. //支付宝:ali
  5. //微信:wx
  6. //社保:si
  7. //银行卡:bank
  8. //银联:union
  9. //云闪付:unioncloud
  10. //刷脸支付:face
  11. //现金:cash
  12. //卡预交金支付:pcard
  13. //扫码支付:qrcode
  14. type: "ali",
  15. //是否要禁用(非必要,默认为false)
  16. disabled: true,
  17. //缴费按钮块文字内容
  18. txt:"支付宝支付"
  19. },
  20. ]

infor

  1. infor: paytype_infor_html("200.00","929.01")
  2. //该部分内容可自己定义,或联系前端开发人员代编写
  3. function paytype_infor_html(amount1, amount2) {
  4. return "<div style='font-size:28px;background-color:#dceff7;padding:15px;border-radius:15px'>" +
  5. "<span style='font-weight:bold'>本次自费金额:</span><span style='color:red'>" + amount1 + "</span>元" +
  6. "<span style='margin-right:50px'></span>"+
  7. "<span style='font-weight:bold'>医保支付金额:</span><span style='color:red'>" + amount2 + "</span>元" +
  8. "</div>";
  9. }

♨️ JS Call

🚀 getData