Browse Source

连接设置参数缓存方式由离线修改为内存方式

guohh 3 years ago
parent
commit
7d80afe4b0
1 changed files with 7 additions and 7 deletions
  1. 7 7
      2021/nm-zsyt/ipu/android-webview.js

+ 7 - 7
2021/nm-zsyt/ipu/android-webview.js

17
     * @param {string} type 读卡器类型,SR/SYD/ZYZX分别代表森锐/三元达/中移在线
17
     * @param {string} type 读卡器类型,SR/SYD/ZYZX分别代表森锐/三元达/中移在线
18
     */
18
     */
19
    setCardReaderType: function (type) {
19
    setCardReaderType: function (type) {
20
      IpuMobile.setOfflineCache(cardDeviceTypeKey, type);
20
      IpuMobile.setMemoryCache(cardDeviceTypeKey, type);
21
    },
21
    },
22
22
23
    /**
23
    /**
25
     * @param {string} connection 连接方式 bt\otg\nfc
25
     * @param {string} connection 连接方式 bt\otg\nfc
26
     */
26
     */
27
    setCardReaderConnection: function (connection) {
27
    setCardReaderConnection: function (connection) {
28
      IpuMobile.setOfflineCache(cardConnectTypeKey, connection);
28
      IpuMobile.setMemoryCache(cardConnectTypeKey, connection);
29
    },
29
    },
30
30
31
    /**
31
    /**
33
     * @param {string} deviceType 设备类型
33
     * @param {string} deviceType 设备类型
34
     */
34
     */
35
    setSimReaderDeviceType: function (deviceType) {
35
    setSimReaderDeviceType: function (deviceType) {
36
      IpuMobile.setOfflineCache(simDeviceTypeKey, deviceType);
36
      IpuMobile.setMemoryCache(simDeviceTypeKey, deviceType);
37
    },
37
    },
38
38
39
    /**
39
    /**
41
     * @param {string} connectType 设备连接方式
41
     * @param {string} connectType 设备连接方式
42
     */
42
     */
43
    setSimReaderConnection: function (connectType) {
43
    setSimReaderConnection: function (connectType) {
44
      IpuMobile.setOfflineCache(simConnectTypeKey, connectType);
44
      IpuMobile.setMemoryCache(simConnectTypeKey, connectType);
45
    },
45
    },
46
46
47
    /**
47
    /**
49
     * @param {string} btnAddress 蓝牙设备地址
49
     * @param {string} btnAddress 蓝牙设备地址
50
     */
50
     */
51
    setSimReaderBtnAddress: function (btnAddress) {
51
    setSimReaderBtnAddress: function (btnAddress) {
52
      IpuMobile.setOfflineCache(simBtAddress, btnAddress);
52
      IpuMobile.setMemoryCache(simBtAddress, btnAddress);
53
    },
53
    },
54
54
55
    /**
55
    /**
60
     * @param {string} callback.connectType 连接类型
60
     * @param {string} callback.connectType 连接类型
61
     */
61
     */
62
    getCardReaderConfig: function (callback) {
62
    getCardReaderConfig: function (callback) {
63
      IpuMobile.getOfflineCache(function (cacheResult) {  // deviceType, connectType存储在缓存,不直接通过调用传递参数
63
      IpuMobile.getMemoryCache(function (cacheResult) {  // deviceType, connectType存储在缓存,不直接通过调用传递参数
64
        cacheResult = JSON.parse(cacheResult);
64
        cacheResult = JSON.parse(cacheResult);
65
        var deviceType = cacheResult[cardDeviceTypeKey];
65
        var deviceType = cacheResult[cardDeviceTypeKey];
66
        var connectType = cacheResult[cardConnectTypeKey];
66
        var connectType = cacheResult[cardConnectTypeKey];
78
     */
78
     */
79
    getSimReaderConfig: function (callback) {
79
    getSimReaderConfig: function (callback) {
80
      // 如需使用js内存缓存,可修改此方法,不用每次读取App缓存
80
      // 如需使用js内存缓存,可修改此方法,不用每次读取App缓存
81
      IpuMobile.getOfflineCache(function (cacheResult) {  // deviceType, connectType存储在缓存,不直接通过调用传递参数
81
      IpuMobile.getMemoryCache(function (cacheResult) {  // deviceType, connectType存储在缓存,不直接通过调用传递参数
82
        cacheResult = JSON.parse(cacheResult);
82
        cacheResult = JSON.parse(cacheResult);
83
        var deviceType = cacheResult[simDeviceTypeKey];
83
        var deviceType = cacheResult[simDeviceTypeKey];
84
        var connectType = cacheResult[simConnectTypeKey];
84
        var connectType = cacheResult[simConnectTypeKey];