C端小程序
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

142 行
2.9 KiB

  1. const util = require("../../utils/util.js");
  2. const config = require("../../config/config.js");
  3. const Http = require("../../utils/HttpBasics");
  4. let app = getApp();
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. merChant:{},
  11. focus: true,
  12. inputValue: ''
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad: function (options) {
  18. console.log(options)
  19. let that = this;
  20. that.setData({
  21. merChant: JSON.parse(options.merChant),
  22. cardid:options.cardid
  23. })
  24. },
  25. bindKeyInput(e) {
  26. console.log(e)
  27. this.setData({
  28. inputValue: e.detail.value
  29. })
  30. console.log(this.data.inputValue)
  31. },
  32. gotoPayMoney:function(){
  33. let that = this;
  34. Http.post({
  35. url: config.api.orderCreate,
  36. data: {
  37. cardId: that.data.cardid,
  38. merchantCode: that.data.merChant.merchant_id,
  39. totalFee: that.data.inputValue
  40. }
  41. })
  42. .then(res => {
  43. console.log(res)
  44. })
  45. .catch(err => {
  46. wx.showModal({
  47. title: "抱歉",
  48. content: err.message,
  49. showCancel: false
  50. })
  51. })
  52. },
  53. gotoPayMoneys(e) {
  54. var that = this;
  55. if (wx.canIUse("checkIsSupportSoterAuthentication")) {
  56. //判断此接口是否可用
  57. console.log(e)
  58. wx.checkIsSupportSoterAuthentication({
  59. success: function (res) {
  60. console.log('本机支持的 SOTER 生物认证', res);
  61. var keys = [];
  62. for (var key in res) {
  63. keys.push(res[key])
  64. }
  65. console.log(res)
  66. that.setData({
  67. print: keys//页面中输出支持情况
  68. })
  69. if (res.supportMode == "fingerPrint") {
  70. wx.startSoterAuthentication({
  71. requestAuthModes: ['fingerPrint'],
  72. challenge: '123456',
  73. authContent: "请用指纹解锁",
  74. success: function (res) {
  75. console.log('js', res);
  76. },
  77. fail: function (res) {
  78. that.setData({
  79. c: "用户取消了指纹识别,或调用出现错误"
  80. })
  81. }
  82. })
  83. } else {
  84. that.setData({
  85. b: "当前该设备不支持指纹识别"
  86. })
  87. }
  88. }
  89. })
  90. }
  91. },
  92. /**
  93. * 生命周期函数--监听页面初次渲染完成
  94. */
  95. onReady: function () {
  96. },
  97. /**
  98. * 生命周期函数--监听页面显示
  99. */
  100. onShow: function () {
  101. },
  102. /**
  103. * 生命周期函数--监听页面隐藏
  104. */
  105. onHide: function () {
  106. },
  107. /**
  108. * 生命周期函数--监听页面卸载
  109. */
  110. onUnload: function () {
  111. },
  112. /**
  113. * 页面相关事件处理函数--监听用户下拉动作
  114. */
  115. onPullDownRefresh: function () {
  116. },
  117. /**
  118. * 页面上拉触底事件的处理函数
  119. */
  120. onReachBottom: function () {
  121. },
  122. /**
  123. * 用户点击右上角分享
  124. */
  125. onShareAppMessage: function () {
  126. }
  127. })