You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 月之前
1 月之前
1 月之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <!--
  2. * @Author: gaorf30153 gaorf30153@hundsun.com
  3. * @Date: 2024-06-20 09:16:17
  4. * @LastEditors: gaorf30153 gaorf30153@hundsun.com
  5. * @LastEditTime: 2024-07-09 09:45:55
  6. * @FilePath: \wxminipro\doc\README.md
  7. * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. -->
  9. ## 插件接入
  10. ```
  11. "plugins": {
  12. "issuer-plugin": {
  13. "version": "", // 版本号 开发版本 dev-xxxxxxx 正式版本 例:1.0.0
  14. "provider": "wx06bc6021dc900553"
  15. }
  16. }
  17. ```
  18. ## 支付接入
  19. 1.需要在宿主小程序根目录下增加functional-pages/request-payment.js文件,并且暴露beforeRequestPayment函数
  20. 2.宿主小程序app.json 中配置 "functionalPages": true
  21. ```
  22. exports.beforeRequestPayment = function (paymentArgs, callback) {
  23. // 自定义的参数,此处应为从插件传递过来的 paymentArgs
  24. var error = null
  25. //该对象为下单所需参数
  26. var requestPaymentArgs = {
  27. timeStamp: paymentArgs.timeStamp,
  28. nonceStr: paymentArgs.nonceStr,
  29. package: paymentArgs.package,
  30. signType: paymentArgs.signType,
  31. paySign: paymentArgs.paySign,
  32. }
  33. callback(error, requestPaymentArgs) //重点:返回requestPaymentArgs
  34. }
  35. ```
  36. ## APP跳转方式
  37. ### APP拉起小程序所带参数
  38. 1. 小程序URL?wechatSignNo=xxxxx
  39. ### 小程序拉起插件所带参数
  40. 2. plugin://issuer-plugin/login?wechatSignNo=xxx&redirectUrl=xxxxx&mobile=xxx
  41. 3. wechatSignNo APP拉起小程序所带的签约信息编号由APP端调用接口生成
  42. ## 小程序跳转方式
  43. 1. 新办路径 plugin://issuer-plugin/login?etcProductId=xxx&accountType=1&carType=0&redirectUrl=xxxxx&mobile=xxx
  44. 2. 车辆续办 plugin://issuer-plugin/login?etcProductId=xxx&plateNum=浙A0P73H_0&handleType=continuation&redirectUrl=xxxxx&mobile=xxx
  45. 4. 重新激活 plugin://issuer-plugin/login?plateNum=浙A0P73H_0&handleType=reactivate&redirectUrl=xxxxx&mobile=xxx
  46. 5. 恢复签约 plugin://issuer-plugin/login?plateNum=浙A0P73H_0&handleType=resumeSigning&redirectUrl=xxxxx&mobile=xxx
  47. 6. 仅获取登录凭证 plugin://issuer-plugin/login?type=1&redirectUrl=xxxxx&mobile=xxx
  48. 7. 车辆售后 plugin://issuer-plugin/login?plateNum=浙A0P73H_0&handleType=aftersale&afterType=1&orderNo=xxxx&redirectUrl=xxxxx&mobile=xxx
  49. 8. 车主服务签约 plugin://issuer-plugin/signGetAuth?orderNo=xxxx&openId=xxxx
  50. 9. 设备激活 plugin://issuer-plugin/activeDes?orderNo=xxxx
  51. 10. 签署合同 plugin://issuer-plugin/signProtocol?orderNo=xxxx
  52. 11. 设备升级 plugin://issuer-plugin/deviceUpgrade
  53. 12. 卡签二次激活 plugin://issuer-plugin/activeAgain?plateNum=xxxxxxx_x
  54. ## 跳转参数说明
  55. 1. redirectUrl 小程序重定向地址 例:/pages/login/login
  56. 2. orderNo 订单编号
  57. 3. plateNum 车牌号码和颜色编号 例:浙A0P73H_0
  58. 4. handleType 办理类型 continuation 续办 aftersale 售后 reactivate 重新激活 resumeSigning 恢复签约
  59. 5. afterType 售后办理类型 1.挂失/解挂 3.更换 4.续期 5.补办 6.注销 7.换货 8.退货 9.补货
  60. 6. type 登录类型 1.只获取登录凭证用登录完成跳转回小程序指定页面
  61. 7. accountType 1 个人 2企业
  62. 8. carType 0 客车 1 货车
  63. 9. etcProductId 产品编号
  64. 10. mobile 手机号码
  65. 11. openId 用户登录获取openId
  66. 12. accessToken 用户登录获取accessToken
  67. ## 回调通知
  68. ```js
  69. const plugin = requirePlugin('issuer-plugin');
  70. ```
  71. 1. 激活
  72. ```js
  73. const res = plugin.getActiveResult();
  74. res = {
  75. state: 2, // 0 成功 1 失败 2取消
  76. obu: "", // OBU号
  77. card: "", // 卡号
  78. }
  79. ```
  80. 2. 签署合同
  81. ```js
  82. const res = plugin.getSignProResult();
  83. res = {
  84. state: 1, // 0 已签约 1未签约
  85. }
  86. ```
  87. 3. 车主服务签约
  88. ```js
  89. const res = plugin.getSignCarServiceResule();
  90. res = {
  91. state: 1, // 0 已签署 1未签署
  92. }
  93. ```