|
- const util = require("../../utils/util.js");
- const config = require("../../config/config.js");
- const Http = require("../../utils/HttpBasics");
- let app = getApp();
- Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- merChant:{},
- focus: true,
- inputValue: ''
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- console.log(options)
- let that = this;
- that.setData({
- merChant: JSON.parse(options.merChant),
- cardid:options.cardid
- })
- },
- bindKeyInput(e) {
- console.log(e)
- this.setData({
- inputValue: e.detail.value
- })
- console.log(this.data.inputValue)
- },
- gotoPayMoney:function(){
- let that = this;
- Http.post({
- url: config.api.orderCreate,
- data: {
- cardId: that.data.cardid,
- merchantCode: that.data.merChant.merchant_id,
- totalFee: that.data.inputValue
- }
- })
- .then(res => {
- console.log(res)
- })
- .catch(err => {
- wx.showModal({
- title: "抱歉",
- content: err.message,
- showCancel: false
- })
- })
- },
- gotoPayMoneys(e) {
- var that = this;
- if (wx.canIUse("checkIsSupportSoterAuthentication")) {
- //判断此接口是否可用
- console.log(e)
- wx.checkIsSupportSoterAuthentication({
- success: function (res) {
- console.log('本机支持的 SOTER 生物认证', res);
- var keys = [];
- for (var key in res) {
- keys.push(res[key])
- }
- console.log(res)
- that.setData({
- print: keys//页面中输出支持情况
- })
- if (res.supportMode == "fingerPrint") {
- wx.startSoterAuthentication({
- requestAuthModes: ['fingerPrint'],
- challenge: '123456',
- authContent: "请用指纹解锁",
- success: function (res) {
- console.log('js', res);
- },
- fail: function (res) {
- that.setData({
- c: "用户取消了指纹识别,或调用出现错误"
- })
- }
- })
- } else {
- that.setData({
- b: "当前该设备不支持指纹识别"
- })
- }
- }
- })
- }
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
-
- }
- })
|