You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
158 lines
3.5 KiB
158 lines
3.5 KiB
<template> |
|
<view class="container"> |
|
<u-navbar title="系统设置" bgColor='#D3832A' leftIconColor='#ffffff' titleStyle='color:#ffffff' placeholder |
|
:autoBack="true" leftIconSize='35'></u-navbar> |
|
<view class="list"> |
|
<!-- 设置后台监听状态 --> |
|
<view class="list_item flex-c-c"> |
|
<view class="uni-list-cell-left"> |
|
<u-icon class="mr20" name="moments" size="36" color="#47beff"></u-icon> |
|
<view> |
|
扫描后台监听状态: |
|
</view> |
|
</view> |
|
|
|
<u-switch v-model="details.isListen" @change="handleChangeByListen" size="40" inactive-color="#e6e6e6" |
|
active-color="#d3832a"></u-switch> |
|
</view> |
|
|
|
<!-- 是否显示扫描按钮 --> |
|
<view class="list_item mt20 flex-c-c"> |
|
<view class="uni-list-cell-left"> |
|
<u-icon class="mr20" name="moments" size="36" color="#47beff"></u-icon> |
|
|
|
<view> |
|
是否显示扫描按钮: |
|
</view> |
|
</view> |
|
|
|
<u-switch v-model="details.isShowScanBtn" @change="handleChangeByShowScanBtn" @click.stop size="40" |
|
inactive-color="#e6e6e6" active-color="#d3832a"></u-switch> |
|
</view> |
|
</view> |
|
</view> |
|
</template> |
|
|
|
<script lang="ts" setup> |
|
import { |
|
onShow, |
|
onLoad, |
|
onHide, |
|
onPullDownRefresh |
|
} from '@dcloudio/uni-app' |
|
import { reactive, ref, toRefs } from 'vue'; |
|
import useSystemSettingsStore from '@/store/useSystemSettingsStore.js'; |
|
import uaePdaStore from '@/store/uaePdaStore.js'; |
|
import { storeToRefs } from 'pinia'; |
|
|
|
// 获取系统设置存储仓库 |
|
const systemSettingsStore = useSystemSettingsStore() |
|
const { scanStateList, scanState } = storeToRefs(systemSettingsStore) |
|
const { HANDLE_SCANSTATE } = systemSettingsStore |
|
|
|
// 是否显示扫描按钮 |
|
const pdaStore = uaePdaStore() |
|
const { isShowScanBtn } = storeToRefs(pdaStore) |
|
const { HANDLE_SETSCANBTN } = pdaStore |
|
|
|
onPullDownRefresh(() => { |
|
const timer = setTimeout(() => { |
|
// 关闭下拉刷新 |
|
uni.stopPullDownRefresh() |
|
clearTimeout(timer) |
|
}, 500) |
|
}) |
|
|
|
const details = reactive({ |
|
// |
|
scanStateList: [], |
|
/** 是否后台监听 */ |
|
isListen: false, |
|
/** 是否显示扫描按钮 */ |
|
isShowScanBtn: false |
|
}) |
|
|
|
|
|
details.isListen = scanState.value === 1 |
|
details.isShowScanBtn = isShowScanBtn.value |
|
|
|
/** 是否监听 */ |
|
const handleChangeByListen = (changeValue) => { |
|
HANDLE_SCANSTATE(changeValue ? 1 : 0) |
|
} |
|
|
|
/** 是否显示扫描按钮 */ |
|
const handleChangeByShowScanBtn = (changeValue) => { |
|
HANDLE_SETSCANBTN(changeValue) |
|
} |
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
@import url(@/utils/style/common.scss); |
|
|
|
.container { |
|
width: 100vw; |
|
height: 100vh; |
|
font-size: 1rem; |
|
// background: #fff; |
|
} |
|
|
|
.list_item { |
|
display: flex; |
|
justify-content: space-between; |
|
padding: 20upx; |
|
border-bottom: 2upx solid #eee; |
|
background: #fff; |
|
position: relative; |
|
|
|
.uni-list-cell-db { |
|
position: absolute; |
|
top: 0; |
|
left: 0; |
|
padding: 20upx; |
|
width: 100%; |
|
height: 100%; |
|
text-align: right; |
|
box-sizing: border-box; |
|
} |
|
|
|
&:last-child { |
|
border-bottom: 0px; |
|
} |
|
|
|
.uni-list-cell-left { |
|
display: inline-flex; |
|
} |
|
} |
|
|
|
.margin-right-10 { |
|
margin-right: 10upx; |
|
} |
|
|
|
// 修改密码弹窗 |
|
.EditPwdPop-title { |
|
position: relative; |
|
width: 200upx; |
|
flex: none; |
|
|
|
&::after { |
|
right: 20upx; |
|
top: 50%; |
|
transform: translateY(-50%); |
|
position: absolute; |
|
content: ''; |
|
display: block; |
|
width: 2upx; |
|
height: 40upx; |
|
background: #000; |
|
} |
|
} |
|
|
|
.flex-c-sb { |
|
display: flex; |
|
align-items: center; |
|
margin: 20upx 0 10upx; |
|
border-bottom: 2upx solid #aaa; |
|
padding: 20upx 0 10upx; |
|
} |
|
</style> |