diff --git a/components/tpx-physics-scan/tpx-physics-scan.vue b/components/tpx-physics-scan/tpx-physics-scan.vue index d5246f7..1715304 100644 --- a/components/tpx-physics-scan/tpx-physics-scan.vue +++ b/components/tpx-physics-scan/tpx-physics-scan.vue @@ -6,24 +6,22 @@ import { getSessionSystemInfo } from "@/session" export default { props: { - customintent: { - default () { - return { - // !!注意: 不同的设备配置项是不同的 - scanDownKey: "KEYCODE_SCAN_L_DOWN", - actionKey: 'com.android.receive_scan_action', - codeKey: "data" - } - } - }, value: { default () { return '' } }, }, - data() { - return { + data() { + let { hongWai } = getSessionSystemInfo() + let { actionKey = 'com.android.receive_scan_action', codeKey = 'data', scanDownKey = 'KEYCODE_SCAN_L_DOWN' } = hongWai || {} + return { + customintent: { // 默认配置 + // !!注意: 不同的设备配置项是不同的 + scanDownKey, + actionKey, + codeKey, + }, receiver: '', filter: '', codeQueryTag: false, @@ -84,11 +82,6 @@ // #endif }, queryCode: function(code) { - // let { hongWaiSwitch } = getSessionSystemInfo() - // // 红外开启,才可使用该功能 - // if(!hongWaiSwitch) { - // return false; - // } let that = this; // #ifdef APP console.log('queryCode'); diff --git a/pages.json b/pages.json index 7c15551..a4ac77f 100644 --- a/pages.json +++ b/pages.json @@ -62,6 +62,12 @@ "style": { "navigationBarTitleText": "修改密码" } + }, + { + "path": "pages/user/infraredInfo", + "style": { + "navigationBarTitleText": "红外扫码配置" + } }, { "path": "pages/user/withdraw", diff --git a/pages/tabBar/mine/mine.vue b/pages/tabBar/mine/mine.vue index 7d5ce91..f613e33 100644 --- a/pages/tabBar/mine/mine.vue +++ b/pages/tabBar/mine/mine.vue @@ -101,15 +101,15 @@ - + @@ -170,7 +170,6 @@ props: { }, data() { - let { hongWaiSwitch } = getSessionSystemInfo() return { staticInfo: { commStat: {}, @@ -180,7 +179,6 @@ curAppVersion: '', chkVRes: {}, curDeviceId: '', - hongWaiSwitch, } }, onShareAppMessage() { @@ -221,9 +219,6 @@ // TODO this.showToast('清除成功') }, - handleHongWaiChange(val){ - setSessionSystemInfo({ hongWaiSwitch: val }) - } } } diff --git a/pages/user/infraredInfo.vue b/pages/user/infraredInfo.vue new file mode 100644 index 0000000..c1208dd --- /dev/null +++ b/pages/user/infraredInfo.vue @@ -0,0 +1,102 @@ + + + + + + \ No newline at end of file diff --git a/session/index.js b/session/index.js index 6239e3e..70cd22a 100644 --- a/session/index.js +++ b/session/index.js @@ -38,7 +38,9 @@ export const getSessionLoginInfo = ()=> { export const setSessionSystemInfo = (val = {})=> { let oldVal = getSessionSystemInfo() // { - // hongWaiSwitch: false, // 红外扫描 + // hongWai: { // 红外扫描 + + //}, // lastActiveTime: 时间戳, // 上次活跃时间戳 // } uni.setStorageSync(SYSTEM_INFO_KEY, { ...oldVal, ...val}) @@ -46,6 +48,6 @@ export const setSessionSystemInfo = (val = {})=> { export const getSessionSystemInfo = ()=> { return uni.getStorageSync(SYSTEM_INFO_KEY) || { - hongWaiSwitch: false + hongWai: { } } }