123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- import {
- updateConfig,
- snConfig
- } from '../../../utils/api/api'
- import {
- getWaterDrop,
- } from '../../../utils/index/index'
- const app = getApp()
- Page({
- data: {
- list: [{
- name: '支付宝刷脸人脸比对成功提示音',
- value: 'successVoice'
- },
- {
- name: '支付宝刷脸人脸比对失败提示音',
- value: 'failVoice'
- },
- {
- name: '访客信息登记成功提示音',
- value: 'registerSuccessVoice'
- },
- {
- name: '刷身份证提示音',
- value: 'readIdcardVoice'
- },
- {
- name: '输身份证提示音',
- value: 'inputIdcardVoice'
- },
- {
- name: '输手机号提示音',
- value: 'inputPhoneVoice'
- },
- {
- name: '联网信息查询提示音',
- value: 'connectSearchVoice'
- },
- {
- name: '签离扫码提示音',
- value: 'singOutVoice'
- },
- ],
- form: {
- successVoice: "比对成功",
- failVoice: "比对失败,请重试,或刷身份证",
- registerSuccessVoice: "正在打印访客单",
- readIdcardVoice: "请刷身份证",
- inputIdcardVoice: "请输入身份证号",
- inputPhoneVoice: "请输入手机号",
- connectSearchVoice: "正在联网查询信息,请耐心等待",
- singOutVoice: "请将二维码对准设备的扫码窗",
- },
- },
- onLoad() {
- this.getForm()
- },
- clickAudio(){
- getWaterDrop()
- },
- async getForm() {
- my.showLoading()
- try {
- let dto = {
- sn: app.globalData.sn,
- token: app.globalData.FKJConfiguration,
- }
- let res = await snConfig(dto)
- this.setData({
- form: res.data
- })
- } catch (error) {} finally {
- my.hideLoading()
- }
- },
- getVal(e) {
- let key = e.currentTarget.dataset.item.value
- let value = e.detail.value
- let NameVal = `form[${key}]`
- this.setData({
- [NameVal]: value
- })
- },
- async sure() {
- let {
- form
- } = this.data
- form.modifyType = app.globalData.modifyType[3];
- form.token = app.globalData.FKJConfiguration;
- my.showLoading()
- try {
- let res = await updateConfig(form)
- app.globalData.snDisposition.successVoice = form.successVoice;
- app.globalData.snDisposition.failVoice = form.failVoice;
- app.globalData.snDisposition.registerSuccessVoice = form.registerSuccessVoice;
- app.globalData.snDisposition.readIdcardVoice = form.readIdcardVoice;
- app.globalData.snDisposition.inputIdcardVoice = form.inputIdcardVoice;
- app.globalData.snDisposition.inputPhoneVoice = form.inputPhoneVoice;
- app.globalData.snDisposition.connectSearchVoice = form.connectSearchVoice;
- app.globalData.snDisposition.singOutVoice = form.singOutVoice;
- // console.log(app.globalData.snDisposition);
- my.setStorageSync({
- data: app.globalData.snDisposition,
- key: 'snDisposition'
- });
- my.reLaunch({
- url: "/pages/settings/index/index"
- })
- } catch (error) {
- console.log(error);
- } finally {
- my.hideLoading()
- }
- },
- });
|