|
|
@@ -1,434 +1,432 @@
|
|
1
|
1
|
<template>
|
|
2
|
|
- <view class="cirumstances_wrap">
|
|
3
|
|
- <u-navbar placeholder :autoBack="true" title="环境监测" v-hideNav>
|
|
4
|
|
- <view class="u-nav-slot right_btn" slot="right">
|
|
5
|
|
- <view class="reset" @click="handleReset">
|
|
6
|
|
- <u-icon name="reload" color="#108CFF"></u-icon>刷新
|
|
7
|
|
- </view>
|
|
8
|
|
- </view>
|
|
9
|
|
- </u-navbar>
|
|
10
|
|
- <view class="option_list">
|
|
11
|
|
- <view class="option_item">
|
|
12
|
|
- <view class="item_left">
|
|
13
|
|
- <text class="label">登录用户</text>
|
|
14
|
|
- </view>
|
|
15
|
|
- <view class="item-right">
|
|
16
|
|
- <text>{{ nickName }}</text>
|
|
17
|
|
- </view>
|
|
18
|
|
- </view>
|
|
19
|
|
- <template v-if="isCallOff === '1'">
|
|
20
|
|
- <view class="option_item">
|
|
21
|
|
- <view class="item_left">
|
|
22
|
|
- <text class="label">外呼分机号</text>
|
|
23
|
|
- </view>
|
|
24
|
|
- <view class="item-right">
|
|
25
|
|
- <text>{{
|
|
|
2
|
+ <view class="cirumstances_wrap">
|
|
|
3
|
+ <u-navbar placeholder :autoBack="true" title="环境监测" v-hideNav>
|
|
|
4
|
+ <view class="u-nav-slot right_btn" slot="right">
|
|
|
5
|
+ <view class="reset" @click="handleReset">
|
|
|
6
|
+ <u-icon name="reload" color="#108CFF"></u-icon>刷新
|
|
|
7
|
+ </view>
|
|
|
8
|
+ </view>
|
|
|
9
|
+ </u-navbar>
|
|
|
10
|
+ <view class="option_list">
|
|
|
11
|
+ <view class="option_item">
|
|
|
12
|
+ <view class="item_left">
|
|
|
13
|
+ <text class="label">登录用户</text>
|
|
|
14
|
+ </view>
|
|
|
15
|
+ <view class="item-right">
|
|
|
16
|
+ <text>{{ nickName }}</text>
|
|
|
17
|
+ </view>
|
|
|
18
|
+ </view>
|
|
|
19
|
+ <template v-if="isCallOff === '1'">
|
|
|
20
|
+ <view class="option_item">
|
|
|
21
|
+ <view class="item_left">
|
|
|
22
|
+ <text class="label">外呼分机号</text>
|
|
|
23
|
+ </view>
|
|
|
24
|
+ <view class="item-right">
|
|
|
25
|
+ <text>{{
|
|
26
|
26
|
callAccount ? callAccount.extenNum : "未配置分机号"
|
|
27
|
27
|
}}</text>
|
|
28
|
|
- </view>
|
|
29
|
|
- </view>
|
|
30
|
|
- <view class="option_item">
|
|
31
|
|
- <view class="item_left">
|
|
32
|
|
- <text class="label">外呼注册状态</text>
|
|
33
|
|
- </view>
|
|
34
|
|
- <view class="item-right" @longpress="handleRegisterFun">
|
|
35
|
|
- <text v-if="callAccount != null && callSystem != null">
|
|
36
|
|
- {{ ipAddress }}
|
|
37
|
|
- </text>
|
|
38
|
|
- <text class="btn" v-else @click="handleRegisterFun">点击注册</text>
|
|
39
|
|
- <icon-img
|
|
40
|
|
- :value="callAccount != null && callSystem != null"
|
|
41
|
|
- ></icon-img>
|
|
42
|
|
- </view>
|
|
43
|
|
- </view>
|
|
44
|
|
- <view class="option_item">
|
|
45
|
|
- <view class="item_left">
|
|
46
|
|
- <text class="label">外呼签入状态</text>
|
|
47
|
|
- </view>
|
|
48
|
|
- <view class="item-right">
|
|
49
|
|
- <text v-if="signInState">正常</text>
|
|
50
|
|
- <text class="btn" v-else @click="handleRegisterFun">点击签入</text>
|
|
51
|
|
- <icon-img :value="signInState"></icon-img>
|
|
52
|
|
- <icon-img :value="redisStatus"></icon-img>
|
|
53
|
|
- </view>
|
|
54
|
|
- </view>
|
|
55
|
|
- </template>
|
|
56
|
|
- <template v-else>
|
|
57
|
|
- <view class="option_item">
|
|
58
|
|
- <view class="item_left">
|
|
59
|
|
- <text class="label">呼叫中心</text>
|
|
60
|
|
- </view>
|
|
61
|
|
- <view class="item-right" @longpress="handleRegisterFun">
|
|
62
|
|
- <text>不启用</text>
|
|
63
|
|
- <icon-img :value="isCallOff === '1'"></icon-img>
|
|
64
|
|
- </view>
|
|
65
|
|
- </view>
|
|
66
|
|
- </template>
|
|
67
|
|
- <view class="option_item">
|
|
68
|
|
- <view class="item_left">
|
|
69
|
|
- <text class="label">麦克风权限</text>
|
|
70
|
|
- </view>
|
|
71
|
|
- <view class="item-right">
|
|
72
|
|
- <text v-if="isRecord">已授权</text>
|
|
73
|
|
- <text class="btn" v-else @click="handleOpenSet">点击授权</text>
|
|
74
|
|
- <icon-img :value="isRecord"></icon-img>
|
|
75
|
|
- </view>
|
|
76
|
|
- </view>
|
|
77
|
|
- <!-- 通话自动录音状态 -->
|
|
78
|
|
- <view class="option_item">
|
|
79
|
|
- <view class="item_left">
|
|
80
|
|
- <text class="label">通话自动录音</text>
|
|
81
|
|
- </view>
|
|
82
|
|
- <view class="item-right">
|
|
83
|
|
- <text v-if="isAutoRecord">已开启</text>
|
|
84
|
|
- <text class="btn" v-else @click="toCallRecorderSettings"
|
|
85
|
|
- >点击开启</text
|
|
86
|
|
- >
|
|
87
|
|
- <icon-img :value="isAutoRecord"></icon-img>
|
|
88
|
|
- </view>
|
|
89
|
|
- </view>
|
|
90
|
|
- <!-- 文件访问权限状态 -->
|
|
91
|
|
- <view class="option_item">
|
|
92
|
|
- <view class="item_left">
|
|
93
|
|
- <text class="label">文件访问权限</text>
|
|
94
|
|
- </view>
|
|
95
|
|
- <view class="item-right">
|
|
96
|
|
- <text v-if="hasStoragePermission">已授权</text>
|
|
97
|
|
- <text class="btn" v-else @click="requestStoragePermission"
|
|
98
|
|
- >点击授权</text
|
|
99
|
|
- >
|
|
100
|
|
- <icon-img :value="hasStoragePermission"></icon-img>
|
|
101
|
|
- </view>
|
|
102
|
|
- </view>
|
|
103
|
|
- <view class="option_item">
|
|
104
|
|
- <view class="item_left">
|
|
105
|
|
- <text class="label">定位服务</text>
|
|
106
|
|
- </view>
|
|
107
|
|
- <view class="item-right">
|
|
108
|
|
- <text v-if="systemLocation">已开启</text>
|
|
109
|
|
- <text v-else>未开启</text>
|
|
110
|
|
- <icon-img :value="systemLocation"></icon-img>
|
|
111
|
|
- </view>
|
|
112
|
|
- </view>
|
|
113
|
|
- <view class="option_item">
|
|
114
|
|
- <view class="item_left">
|
|
115
|
|
- <text class="label">定位权限</text>
|
|
116
|
|
- </view>
|
|
117
|
|
- <view class="item-right">
|
|
118
|
|
- <text v-if="isLocation">已授权</text>
|
|
119
|
|
- <text class="btn" v-else @click="handleOpenSet">点击授权</text>
|
|
120
|
|
- <icon-img :value="isLocation"></icon-img>
|
|
121
|
|
- </view>
|
|
122
|
|
- </view>
|
|
123
|
|
- <view class="option_item">
|
|
124
|
|
- <view class="item_left">
|
|
125
|
|
- <text class="label">X5引擎</text>
|
|
126
|
|
- </view>
|
|
127
|
|
- <view class="item-right">
|
|
128
|
|
- <text v-if="isX5">启用</text>
|
|
129
|
|
- <text v-else>不启用</text>
|
|
130
|
|
- <icon-img :value="isX5"></icon-img>
|
|
131
|
|
- </view>
|
|
132
|
|
- </view>
|
|
133
|
|
- <view class="option_item">
|
|
134
|
|
- <view class="item_left">
|
|
135
|
|
- <text class="label">品牌型号</text>
|
|
136
|
|
- </view>
|
|
137
|
|
- <view class="item-right">
|
|
138
|
|
- <text>{{ deviceBrand }}</text>
|
|
139
|
|
- </view>
|
|
140
|
|
- </view>
|
|
141
|
|
- <view class="option_item">
|
|
142
|
|
- <view class="item_left">
|
|
143
|
|
- <text class="label">所用系统</text>
|
|
144
|
|
- </view>
|
|
145
|
|
- <view class="item-right">
|
|
146
|
|
- <text>{{ system }}</text>
|
|
147
|
|
- </view>
|
|
148
|
|
- </view>
|
|
149
|
|
- </view>
|
|
150
|
|
- <view class="tips_wrap" @longpress="handleOpenSet">
|
|
151
|
|
- <view class="left">
|
|
152
|
|
- <image
|
|
153
|
|
- src="../../static/circumstances/success.png"
|
|
154
|
|
- mode=""
|
|
155
|
|
- class="icon_img"
|
|
156
|
|
- >
|
|
157
|
|
- </image>
|
|
158
|
|
- <text>正常</text>
|
|
159
|
|
- </view>
|
|
160
|
|
- <view class="right">
|
|
161
|
|
- <image
|
|
162
|
|
- src="../../static/circumstances/error.png"
|
|
163
|
|
- mode=""
|
|
164
|
|
- class="icon_img"
|
|
165
|
|
- ></image>
|
|
166
|
|
- <text>不正常</text>
|
|
167
|
|
- </view>
|
|
168
|
|
- </view>
|
|
169
|
|
- </view>
|
|
|
28
|
+ </view>
|
|
|
29
|
+ </view>
|
|
|
30
|
+ <view class="option_item">
|
|
|
31
|
+ <view class="item_left">
|
|
|
32
|
+ <text class="label">外呼注册状态</text>
|
|
|
33
|
+ </view>
|
|
|
34
|
+ <view class="item-right" @longpress="handleRegisterFun">
|
|
|
35
|
+ <text v-if="callAccount != null && callSystem != null">
|
|
|
36
|
+ {{ ipAddress }}
|
|
|
37
|
+ </text>
|
|
|
38
|
+ <text class="btn" v-else @click="handleRegisterFun">点击注册</text>
|
|
|
39
|
+ <icon-img :value="callAccount != null && callSystem != null"></icon-img>
|
|
|
40
|
+ </view>
|
|
|
41
|
+ </view>
|
|
|
42
|
+ <view class="option_item">
|
|
|
43
|
+ <view class="item_left">
|
|
|
44
|
+ <text class="label">外呼签入状态</text>
|
|
|
45
|
+ </view>
|
|
|
46
|
+ <view class="item-right">
|
|
|
47
|
+ <text v-if="signInState">正常</text>
|
|
|
48
|
+ <text class="btn" v-else @click="handleRegisterFun">点击签入</text>
|
|
|
49
|
+ <icon-img :value="signInState"></icon-img>
|
|
|
50
|
+ <icon-img :value="redisStatus"></icon-img>
|
|
|
51
|
+ </view>
|
|
|
52
|
+ </view>
|
|
|
53
|
+ </template>
|
|
|
54
|
+ <template v-else>
|
|
|
55
|
+ <view class="option_item">
|
|
|
56
|
+ <view class="item_left">
|
|
|
57
|
+ <text class="label">呼叫中心</text>
|
|
|
58
|
+ </view>
|
|
|
59
|
+ <view class="item-right" @longpress="handleRegisterFun">
|
|
|
60
|
+ <text>不启用</text>
|
|
|
61
|
+ <icon-img :value="isCallOff === '1'"></icon-img>
|
|
|
62
|
+ </view>
|
|
|
63
|
+ </view>
|
|
|
64
|
+ </template>
|
|
|
65
|
+ <view class="option_item">
|
|
|
66
|
+ <view class="item_left">
|
|
|
67
|
+ <text class="label">麦克风权限</text>
|
|
|
68
|
+ </view>
|
|
|
69
|
+ <view class="item-right">
|
|
|
70
|
+ <text v-if="isRecord">已授权</text>
|
|
|
71
|
+ <text class="btn" v-else @click="handleOpenSet">点击授权</text>
|
|
|
72
|
+ <icon-img :value="isRecord"></icon-img>
|
|
|
73
|
+ </view>
|
|
|
74
|
+ </view>
|
|
|
75
|
+ <!-- 通话自动录音状态 -->
|
|
|
76
|
+ <view class="option_item">
|
|
|
77
|
+ <view class="item_left">
|
|
|
78
|
+ <text class="label">通话自动录音</text>
|
|
|
79
|
+ </view>
|
|
|
80
|
+ <view class="item-right">
|
|
|
81
|
+ <text v-if="isAutoRecord">已开启</text>
|
|
|
82
|
+ <text class="btn" v-else @click="toCallRecorderSettings">点击开启</text>
|
|
|
83
|
+ <icon-img :value="isAutoRecord"></icon-img>
|
|
|
84
|
+ </view>
|
|
|
85
|
+ </view>
|
|
|
86
|
+ <!-- 文件访问权限状态 -->
|
|
|
87
|
+ <view class="option_item">
|
|
|
88
|
+ <view class="item_left">
|
|
|
89
|
+ <text class="label">文件访问权限</text>
|
|
|
90
|
+ </view>
|
|
|
91
|
+ <view class="item-right">
|
|
|
92
|
+ <text v-if="hasStoragePermission">已授权</text>
|
|
|
93
|
+ <text class="btn" v-else @click="requestStoragePermission">点击授权</text>
|
|
|
94
|
+ <icon-img :value="hasStoragePermission"></icon-img>
|
|
|
95
|
+ </view>
|
|
|
96
|
+ </view>
|
|
|
97
|
+ <!-- 读取手机状态权限 -->
|
|
|
98
|
+ <view class="option_item">
|
|
|
99
|
+ <view class="item_left">
|
|
|
100
|
+ <text class="label">读取手机状态</text>
|
|
|
101
|
+ </view>
|
|
|
102
|
+ <view class="item-right">
|
|
|
103
|
+ <text v-if="hasReadPhoneStatePermission">已授权</text>
|
|
|
104
|
+ <text class="btn" v-else @click="handleOpenSet">点击授权</text>
|
|
|
105
|
+ <icon-img :value="hasReadPhoneStatePermission"></icon-img>
|
|
|
106
|
+ </view>
|
|
|
107
|
+ </view>
|
|
|
108
|
+ <!-- 拨打电话权限 -->
|
|
|
109
|
+ <view class="option_item">
|
|
|
110
|
+ <view class="item_left">
|
|
|
111
|
+ <text class="label">拨打电话</text>
|
|
|
112
|
+ </view>
|
|
|
113
|
+ <view class="item-right">
|
|
|
114
|
+ <text v-if="hasCallPhonePermission">已授权</text>
|
|
|
115
|
+ <text class="btn" v-else @click="handleOpenSet">点击授权</text>
|
|
|
116
|
+ <icon-img :value="hasCallPhonePermission"></icon-img>
|
|
|
117
|
+ </view>
|
|
|
118
|
+ </view>
|
|
|
119
|
+ <!-- 读取通话记录权限 -->
|
|
|
120
|
+ <view class="option_item">
|
|
|
121
|
+ <view class="item_left">
|
|
|
122
|
+ <text class="label">读取通话记录</text>
|
|
|
123
|
+ </view>
|
|
|
124
|
+ <view class="item-right">
|
|
|
125
|
+ <text v-if="hasReadCallLogPermission">已授权</text>
|
|
|
126
|
+ <text class="btn" v-else @click="handleOpenSet">点击授权</text>
|
|
|
127
|
+ <icon-img :value="hasReadCallLogPermission"></icon-img>
|
|
|
128
|
+ </view>
|
|
|
129
|
+ </view>
|
|
|
130
|
+ <!-- 读取电话号码权限 -->
|
|
|
131
|
+ <view class="option_item">
|
|
|
132
|
+ <view class="item_left">
|
|
|
133
|
+ <text class="label">读取电话号码</text>
|
|
|
134
|
+ </view>
|
|
|
135
|
+ <view class="item-right">
|
|
|
136
|
+ <text v-if="hasReadPhoneNumbersPermission">已授权</text>
|
|
|
137
|
+ <text class="btn" v-else @click="handleOpenSet">点击授权</text>
|
|
|
138
|
+ <icon-img :value="hasReadPhoneNumbersPermission"></icon-img>
|
|
|
139
|
+ </view>
|
|
|
140
|
+ </view>
|
|
|
141
|
+ <view class="option_item">
|
|
|
142
|
+ <view class="item_left">
|
|
|
143
|
+ <text class="label">定位服务</text>
|
|
|
144
|
+ </view>
|
|
|
145
|
+ <view class="item-right">
|
|
|
146
|
+ <text v-if="systemLocation">已开启</text>
|
|
|
147
|
+ <text v-else>未开启</text>
|
|
|
148
|
+ <icon-img :value="systemLocation"></icon-img>
|
|
|
149
|
+ </view>
|
|
|
150
|
+ </view>
|
|
|
151
|
+ <view class="option_item">
|
|
|
152
|
+ <view class="item_left">
|
|
|
153
|
+ <text class="label">定位权限</text>
|
|
|
154
|
+ </view>
|
|
|
155
|
+ <view class="item-right">
|
|
|
156
|
+ <text v-if="isLocation">已授权</text>
|
|
|
157
|
+ <text class="btn" v-else @click="handleOpenSet">点击授权</text>
|
|
|
158
|
+ <icon-img :value="isLocation"></icon-img>
|
|
|
159
|
+ </view>
|
|
|
160
|
+ </view>
|
|
|
161
|
+ <view class="option_item">
|
|
|
162
|
+ <view class="item_left">
|
|
|
163
|
+ <text class="label">X5引擎</text>
|
|
|
164
|
+ </view>
|
|
|
165
|
+ <view class="item-right">
|
|
|
166
|
+ <text v-if="isX5">启用</text>
|
|
|
167
|
+ <text v-else>不启用</text>
|
|
|
168
|
+ <icon-img :value="isX5"></icon-img>
|
|
|
169
|
+ </view>
|
|
|
170
|
+ </view>
|
|
|
171
|
+ <view class="option_item">
|
|
|
172
|
+ <view class="item_left">
|
|
|
173
|
+ <text class="label">品牌型号</text>
|
|
|
174
|
+ </view>
|
|
|
175
|
+ <view class="item-right">
|
|
|
176
|
+ <text>{{ deviceBrand }}</text>
|
|
|
177
|
+ </view>
|
|
|
178
|
+ </view>
|
|
|
179
|
+ <view class="option_item">
|
|
|
180
|
+ <view class="item_left">
|
|
|
181
|
+ <text class="label">所用系统</text>
|
|
|
182
|
+ </view>
|
|
|
183
|
+ <view class="item-right">
|
|
|
184
|
+ <text>{{ system }}</text>
|
|
|
185
|
+ </view>
|
|
|
186
|
+ </view>
|
|
|
187
|
+ </view>
|
|
|
188
|
+ <view class="tips_wrap" @longpress="handleOpenSet">
|
|
|
189
|
+ <view class="left">
|
|
|
190
|
+ <image src="../../static/circumstances/success.png" mode="" class="icon_img">
|
|
|
191
|
+ </image>
|
|
|
192
|
+ <text>正常</text>
|
|
|
193
|
+ </view>
|
|
|
194
|
+ <view class="right">
|
|
|
195
|
+ <image src="../../static/circumstances/error.png" mode="" class="icon_img"></image>
|
|
|
196
|
+ <text>不正常</text>
|
|
|
197
|
+ </view>
|
|
|
198
|
+ </view>
|
|
|
199
|
+ </view>
|
|
170
|
200
|
</template>
|
|
171
|
201
|
|
|
172
|
202
|
<script>
|
|
173
|
|
-import { mapState } from "vuex";
|
|
174
|
|
-import iconImg from "./components/iconImg.vue";
|
|
175
|
|
-import permision from "@/js_sdk/wa-permission/permission.js";
|
|
|
203
|
+ import {
|
|
|
204
|
+ mapState
|
|
|
205
|
+ } from "vuex";
|
|
|
206
|
+ import iconImg from "./components/iconImg.vue";
|
|
|
207
|
+ import permision from "@/js_sdk/wa-permission/permission.js";
|
|
176
|
208
|
|
|
177
|
|
-import {
|
|
178
|
|
- checkIsAutoRecord,
|
|
179
|
|
- toCallAutoRecorderPage,
|
|
180
|
|
- navigateToCallRecordingSettings,
|
|
181
|
|
- jumpToPermissionPage,
|
|
182
|
|
-} from "@/uni_modules/yao-lister";
|
|
|
209
|
+ export default {
|
|
|
210
|
+ components: {
|
|
|
211
|
+ iconImg,
|
|
|
212
|
+ },
|
|
|
213
|
+ computed: {
|
|
|
214
|
+ ...mapState({
|
|
|
215
|
+ nickName: (state) => state.user.userInfo.nickName,
|
|
|
216
|
+ callAccount: (state) => state.app.callAccount,
|
|
|
217
|
+ signInState: (state) => state.app.signInState,
|
|
|
218
|
+ ipAddress: (state) =>
|
|
|
219
|
+ state.app.registerInfo && state.app.registerInfo.register ?
|
|
|
220
|
+ state.app.registerInfo.register["IPv4"].slice(-3) : "异常",
|
|
|
221
|
+ redisStatus: (state) => state.app.redisStatus,
|
|
|
222
|
+ callSystem: (state) => state.app.callSystem,
|
|
|
223
|
+ uuid: (state) => state.user.uuid,
|
|
|
224
|
+ isCallOff: (state) => state.user.netConfig.isCallOff,
|
|
|
225
|
+ // 从call store获取权限状态
|
|
|
226
|
+ isAutoRecord: (state) => state.call.isAutoRecord,
|
|
|
227
|
+ hasStoragePermission: (state) => state.call.hasStoragePermission,
|
|
|
228
|
+ hasReadPhoneStatePermission: (state) => state.call.hasReadPhoneStatePermission,
|
|
|
229
|
+ hasCallPhonePermission: (state) => state.call.hasCallPhonePermission,
|
|
|
230
|
+ hasReadCallLogPermission: (state) => state.call.hasReadCallLogPermission,
|
|
|
231
|
+ hasReadPhoneNumbersPermission: (state) => state.call.hasReadPhoneNumbersPermission,
|
|
|
232
|
+ }),
|
|
|
233
|
+ },
|
|
|
234
|
+ data() {
|
|
|
235
|
+ return {
|
|
|
236
|
+ isX5: false,
|
|
|
237
|
+ isRecord: false,
|
|
|
238
|
+ isLocation: false,
|
|
|
239
|
+ system: "",
|
|
|
240
|
+ deviceBrand: "",
|
|
|
241
|
+ systemLocation: false,
|
|
|
242
|
+ };
|
|
|
243
|
+ },
|
|
|
244
|
+ methods: {
|
|
|
245
|
+ // 刷新
|
|
|
246
|
+ handleReset() {
|
|
|
247
|
+ this.getAllStatus();
|
|
|
248
|
+ uni.$u.toast("刷新成功");
|
|
|
249
|
+ },
|
|
|
250
|
+ // 打开设置
|
|
|
251
|
+ handleOpenSet() {
|
|
|
252
|
+ this.$store.dispatch('call/handleOpenSet');
|
|
|
253
|
+ },
|
|
|
254
|
+ // 请求文件访问权限
|
|
|
255
|
+ requestStoragePermission() {
|
|
|
256
|
+ this.$store.dispatch('call/requestStoragePermission');
|
|
|
257
|
+ },
|
|
|
258
|
+ // 跳转到通话录音设置页面
|
|
|
259
|
+ toCallRecorderSettings() {
|
|
|
260
|
+ this.$store.dispatch('call/toCallRecorderSettings');
|
|
|
261
|
+ },
|
|
|
262
|
+ // 跳转到系统通话录音界面
|
|
|
263
|
+ toSystemRecorderSettings() {
|
|
|
264
|
+ this.$store.dispatch('call/toSystemRecorderSettings');
|
|
|
265
|
+ },
|
|
|
266
|
+ // 注册
|
|
|
267
|
+ handleRegisterFun() {
|
|
|
268
|
+ this.$store
|
|
|
269
|
+ .dispatch("app/getExtensionByUserId", {
|
|
|
270
|
+ userId: this.$store.state.user.userInfo.userId,
|
|
|
271
|
+ })
|
|
|
272
|
+ .then((res) => {
|
|
|
273
|
+ Promise.all([
|
|
|
274
|
+ permision.requestAndroidPermission(
|
|
|
275
|
+ "android.permission.RECORD_AUDIO"
|
|
|
276
|
+ ),
|
|
|
277
|
+ permision.requestAndroidPermission(
|
|
|
278
|
+ "android.permission.MODIFY_AUDIO_SETTINGS"
|
|
|
279
|
+ ),
|
|
|
280
|
+ ]).then((result) => {
|
|
|
281
|
+ const flag = result.every((v) => v == 1);
|
|
|
282
|
+ if (flag) {
|
|
|
283
|
+ this.$store.dispatch("app/createWv");
|
|
|
284
|
+ }
|
|
|
285
|
+ });
|
|
|
286
|
+ });
|
|
|
287
|
+ },
|
|
|
288
|
+ // 检测定位服务是否开启
|
|
|
289
|
+ checkSystemEnableLocation() {
|
|
|
290
|
+ let context = plus.android.importClass("android.content.Context");
|
|
|
291
|
+ let locationManager = plus.android.importClass(
|
|
|
292
|
+ "android.location.LocationManager"
|
|
|
293
|
+ );
|
|
|
294
|
+ let main = plus.android.runtimeMainActivity();
|
|
|
295
|
+ let mainSvr = main.getSystemService(context.LOCATION_SERVICE);
|
|
|
296
|
+ let result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
|
|
|
297
|
+ return result;
|
|
|
298
|
+ },
|
|
|
299
|
+ getAllStatus() {
|
|
|
300
|
+ uni.getSystemInfo({
|
|
|
301
|
+ success: (res) => {
|
|
|
302
|
+ this.deviceBrand = res.deviceBrand + " " + res.model;
|
|
|
303
|
+ this.system = res.system ? res.system : "获取失败";
|
|
|
304
|
+ this.isX5 = res.browserName.includes("x5");
|
|
|
305
|
+ },
|
|
|
306
|
+ });
|
|
183
|
307
|
|
|
184
|
|
-export default {
|
|
185
|
|
- components: {
|
|
186
|
|
- iconImg,
|
|
187
|
|
- },
|
|
188
|
|
- computed: {
|
|
189
|
|
- ...mapState({
|
|
190
|
|
- nickName: (state) => state.user.userInfo.nickName,
|
|
191
|
|
- callAccount: (state) => state.app.callAccount,
|
|
192
|
|
- signInState: (state) => state.app.signInState,
|
|
193
|
|
- ipAddress: (state) =>
|
|
194
|
|
- state.app.registerInfo && state.app.registerInfo.register
|
|
195
|
|
- ? state.app.registerInfo.register["IPv4"].slice(-3)
|
|
196
|
|
- : "异常",
|
|
197
|
|
- redisStatus: (state) => state.app.redisStatus,
|
|
198
|
|
- callSystem: (state) => state.app.callSystem,
|
|
199
|
|
- uuid: (state) => state.user.uuid,
|
|
200
|
|
- isCallOff: (state) => state.user.netConfig.isCallOff,
|
|
201
|
|
- }),
|
|
202
|
|
- },
|
|
203
|
|
- data() {
|
|
204
|
|
- return {
|
|
205
|
|
- isX5: false,
|
|
206
|
|
- isRecord: false,
|
|
207
|
|
- isLocation: false,
|
|
208
|
|
- system: "",
|
|
209
|
|
- deviceBrand: "",
|
|
210
|
|
- systemLocation: false,
|
|
211
|
|
- isAutoRecord: false, // 通话自动录音状态
|
|
212
|
|
- hasStoragePermission: false, // 文件访问权限状态
|
|
213
|
|
- };
|
|
214
|
|
- },
|
|
215
|
|
- methods: {
|
|
216
|
|
- // 刷新
|
|
217
|
|
- handleReset() {
|
|
218
|
|
- this.getAllStatus();
|
|
219
|
|
- uni.$u.toast("刷新成功");
|
|
220
|
|
- },
|
|
221
|
|
- // 打开设置
|
|
222
|
|
- handleOpenSet() {
|
|
223
|
|
- permision.gotoAppPermissionSetting("android.permission.RECORD_AUDIO");
|
|
224
|
|
- },
|
|
225
|
|
- // 请求文件访问权限
|
|
226
|
|
- requestStoragePermission() {
|
|
227
|
|
- jumpToPermissionPage();
|
|
228
|
|
- },
|
|
229
|
|
- // 跳转到通话录音设置页面
|
|
230
|
|
- toCallRecorderSettings() {
|
|
231
|
|
- toCallAutoRecorderPage();
|
|
232
|
|
- },
|
|
233
|
|
- // 跳转到系统通话录音界面
|
|
234
|
|
- toSystemRecorderSettings() {
|
|
235
|
|
- navigateToCallRecordingSettings();
|
|
236
|
|
- },
|
|
237
|
|
- // 注册
|
|
238
|
|
- handleRegisterFun() {
|
|
239
|
|
- this.$store
|
|
240
|
|
- .dispatch("app/getExtensionByUserId", {
|
|
241
|
|
- userId: this.$store.state.user.userInfo.userId,
|
|
242
|
|
- })
|
|
243
|
|
- .then((res) => {
|
|
244
|
|
- Promise.all([
|
|
245
|
|
- permision.requestAndroidPermission(
|
|
246
|
|
- "android.permission.RECORD_AUDIO"
|
|
247
|
|
- ),
|
|
248
|
|
- permision.requestAndroidPermission(
|
|
249
|
|
- "android.permission.MODIFY_AUDIO_SETTINGS"
|
|
250
|
|
- ),
|
|
251
|
|
- ]).then((result) => {
|
|
252
|
|
- const flag = result.every((v) => v == 1);
|
|
253
|
|
- if (flag) {
|
|
254
|
|
- this.$store.dispatch("app/createWv");
|
|
255
|
|
- }
|
|
256
|
|
- });
|
|
257
|
|
- });
|
|
258
|
|
- },
|
|
259
|
|
- // 检测定位服务是否开启
|
|
260
|
|
- checkSystemEnableLocation() {
|
|
261
|
|
- let context = plus.android.importClass("android.content.Context");
|
|
262
|
|
- let locationManager = plus.android.importClass(
|
|
263
|
|
- "android.location.LocationManager"
|
|
264
|
|
- );
|
|
265
|
|
- let main = plus.android.runtimeMainActivity();
|
|
266
|
|
- let mainSvr = main.getSystemService(context.LOCATION_SERVICE);
|
|
267
|
|
- let result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
|
|
268
|
|
- return result;
|
|
269
|
|
- },
|
|
270
|
|
- getAllStatus() {
|
|
271
|
|
- uni.getSystemInfo({
|
|
272
|
|
- success: (res) => {
|
|
273
|
|
- this.deviceBrand = res.deviceBrand + " " + res.model;
|
|
274
|
|
- this.system = res.system ? res.system : "获取失败";
|
|
275
|
|
- this.isX5 = res.browserName.includes("x5");
|
|
276
|
|
- // 获取Android版本号
|
|
277
|
|
- let androidVersion = 0;
|
|
278
|
|
- if (this.system && this.system.includes("Android")) {
|
|
279
|
|
- const versionMatch = this.system.match(/Android (\d+\.?\d*)/);
|
|
280
|
|
- if (versionMatch && versionMatch[1]) {
|
|
281
|
|
- androidVersion = parseFloat(versionMatch[1]);
|
|
282
|
|
- }
|
|
283
|
|
- }
|
|
|
308
|
+ // 检查麦克风权限
|
|
|
309
|
+ permision
|
|
|
310
|
+ .requestAndroidPermission("android.permission.RECORD_AUDIO")
|
|
|
311
|
+ .then((result) => {
|
|
|
312
|
+ this.isRecord = result == "1";
|
|
|
313
|
+ });
|
|
284
|
314
|
|
|
285
|
|
- // 检查文件访问权限
|
|
286
|
|
- if (androidVersion >= 11) {
|
|
287
|
|
- // Android 11及以上版本,使用MANAGE_EXTERNAL_STORAGE权限(特殊权限)
|
|
288
|
|
- try {
|
|
289
|
|
- // 使用Android原生API检查特殊权限
|
|
290
|
|
- const Environment = plus.android.importClass("android.os.Environment");
|
|
291
|
|
- const Context = plus.android.importClass("android.content.Context");
|
|
292
|
|
- const mainActivity = plus.android.runtimeMainActivity();
|
|
293
|
|
- // 检查是否有管理外部存储的权限
|
|
294
|
|
- this.hasStoragePermission = Environment.isExternalStorageManager();
|
|
295
|
|
- console.log('MANAGE_EXTERNAL_STORAGE权限状态:', this.hasStoragePermission);
|
|
296
|
|
- } catch (e) {
|
|
297
|
|
- console.error('检查存储权限失败:', e);
|
|
298
|
|
- this.hasStoragePermission = false;
|
|
299
|
|
- }
|
|
300
|
|
- } else {
|
|
301
|
|
- // Android 11以下版本,使用READ_EXTERNAL_STORAGE权限
|
|
302
|
|
- permision
|
|
303
|
|
- .requestAndroidPermission(
|
|
304
|
|
- "android.permission.READ_EXTERNAL_STORAGE"
|
|
305
|
|
- )
|
|
306
|
|
- .then((result) => {
|
|
307
|
|
- this.hasStoragePermission = result === 1;
|
|
308
|
|
- });
|
|
309
|
|
- }
|
|
310
|
|
- },
|
|
311
|
|
- });
|
|
|
315
|
+ // 检查定位服务状态
|
|
|
316
|
+ this.systemLocation = this.checkSystemEnableLocation();
|
|
312
|
317
|
|
|
313
|
|
- permision
|
|
314
|
|
- .requestAndroidPermission("android.permission.RECORD_AUDIO")
|
|
315
|
|
- .then((result) => {
|
|
316
|
|
- this.isRecord = result == "1";
|
|
317
|
|
- });
|
|
|
318
|
+ // 检查定位权限
|
|
|
319
|
+ permision
|
|
|
320
|
+ .requestAndroidPermission("android.permission.ACCESS_FINE_LOCATION")
|
|
|
321
|
+ .then((result) => {
|
|
|
322
|
+ this.isLocation = result == "1";
|
|
|
323
|
+ });
|
|
318
|
324
|
|
|
319
|
|
- this.systemLocation = this.checkSystemEnableLocation();
|
|
320
|
|
-
|
|
321
|
|
- permision
|
|
322
|
|
- .requestAndroidPermission("android.permission.ACCESS_FINE_LOCATION")
|
|
323
|
|
- .then((result) => {
|
|
324
|
|
- this.isLocation = result == "1";
|
|
325
|
|
- });
|
|
326
|
|
-
|
|
327
|
|
- // 检查通话自动录音状态
|
|
328
|
|
- this.isAutoRecord = checkIsAutoRecord();
|
|
329
|
|
- },
|
|
330
|
|
- },
|
|
331
|
|
- mounted() {
|
|
332
|
|
- this.getAllStatus();
|
|
333
|
|
- },
|
|
334
|
|
-};
|
|
|
325
|
+ // 从store检查所有其他权限状态
|
|
|
326
|
+ this.$store.dispatch('call/checkAllPermissions');
|
|
|
327
|
+ },
|
|
|
328
|
+ },
|
|
|
329
|
+ mounted() {
|
|
|
330
|
+ this.getAllStatus();
|
|
|
331
|
+ },
|
|
|
332
|
+ };
|
|
335
|
333
|
</script>
|
|
336
|
334
|
|
|
337
|
335
|
<style lang="scss" scoped>
|
|
338
|
|
-.right_btn {
|
|
339
|
|
- display: flex;
|
|
340
|
|
- align-items: center;
|
|
341
|
|
- font-size: 14px;
|
|
|
336
|
+ .right_btn {
|
|
|
337
|
+ display: flex;
|
|
|
338
|
+ align-items: center;
|
|
|
339
|
+ font-size: 14px;
|
|
342
|
340
|
|
|
343
|
|
- .copy_btn {
|
|
344
|
|
- display: flex;
|
|
345
|
|
- align-items: center;
|
|
346
|
|
- margin-right: 20rpx;
|
|
347
|
|
- }
|
|
|
341
|
+ .copy_btn {
|
|
|
342
|
+ display: flex;
|
|
|
343
|
+ align-items: center;
|
|
|
344
|
+ margin-right: 20rpx;
|
|
|
345
|
+ }
|
|
348
|
346
|
|
|
349
|
|
- .reset {
|
|
350
|
|
- display: flex;
|
|
351
|
|
- align-items: center;
|
|
352
|
|
- }
|
|
353
|
|
-}
|
|
|
347
|
+ .reset {
|
|
|
348
|
+ display: flex;
|
|
|
349
|
+ align-items: center;
|
|
|
350
|
+ }
|
|
|
351
|
+ }
|
|
354
|
352
|
|
|
355
|
|
-.tips_wrap {
|
|
356
|
|
- display: flex;
|
|
357
|
|
- align-items: center;
|
|
358
|
|
- justify-content: space-evenly;
|
|
359
|
|
- height: 40px;
|
|
360
|
|
- background: #ececec;
|
|
361
|
|
- border-radius: 4px;
|
|
362
|
|
- margin-top: 15px;
|
|
363
|
|
- margin-left: 15px;
|
|
364
|
|
- margin-right: 15px;
|
|
365
|
|
- margin-bottom: 50px;
|
|
|
353
|
+ .tips_wrap {
|
|
|
354
|
+ display: flex;
|
|
|
355
|
+ align-items: center;
|
|
|
356
|
+ justify-content: space-evenly;
|
|
|
357
|
+ height: 40px;
|
|
|
358
|
+ background: #ececec;
|
|
|
359
|
+ border-radius: 4px;
|
|
|
360
|
+ margin-top: 15px;
|
|
|
361
|
+ margin-left: 15px;
|
|
|
362
|
+ margin-right: 15px;
|
|
|
363
|
+ margin-bottom: 50px;
|
|
366
|
364
|
|
|
367
|
|
- .right {
|
|
368
|
|
- display: flex;
|
|
369
|
|
- align-items: center;
|
|
370
|
|
- }
|
|
|
365
|
+ .right {
|
|
|
366
|
+ display: flex;
|
|
|
367
|
+ align-items: center;
|
|
|
368
|
+ }
|
|
371
|
369
|
|
|
372
|
|
- .left {
|
|
373
|
|
- display: flex;
|
|
374
|
|
- align-items: center;
|
|
375
|
|
- }
|
|
|
370
|
+ .left {
|
|
|
371
|
+ display: flex;
|
|
|
372
|
+ align-items: center;
|
|
|
373
|
+ }
|
|
376
|
374
|
|
|
377
|
|
- .icon_img {
|
|
378
|
|
- width: 40rpx;
|
|
379
|
|
- height: 40rpx;
|
|
380
|
|
- margin-right: 20rpx;
|
|
381
|
|
- }
|
|
382
|
|
-}
|
|
|
375
|
+ .icon_img {
|
|
|
376
|
+ width: 40rpx;
|
|
|
377
|
+ height: 40rpx;
|
|
|
378
|
+ margin-right: 20rpx;
|
|
|
379
|
+ }
|
|
|
380
|
+ }
|
|
383
|
381
|
|
|
384
|
|
-.option_list {
|
|
385
|
|
- margin-top: 30rpx;
|
|
386
|
|
- padding: 0 30rpx;
|
|
|
382
|
+ .option_list {
|
|
|
383
|
+ margin-top: 30rpx;
|
|
|
384
|
+ padding: 0 30rpx;
|
|
387
|
385
|
|
|
388
|
|
- .option_item {
|
|
389
|
|
- display: flex;
|
|
390
|
|
- justify-content: space-between;
|
|
391
|
|
- align-items: center;
|
|
392
|
|
- padding-bottom: 36rpx;
|
|
393
|
|
- padding-top: 36rpx;
|
|
394
|
|
- border-bottom: 2rpx solid #dfdfdf;
|
|
|
386
|
+ .option_item {
|
|
|
387
|
+ display: flex;
|
|
|
388
|
+ justify-content: space-between;
|
|
|
389
|
+ align-items: center;
|
|
|
390
|
+ padding-bottom: 36rpx;
|
|
|
391
|
+ padding-top: 36rpx;
|
|
|
392
|
+ border-bottom: 2rpx solid #dfdfdf;
|
|
395
|
393
|
|
|
396
|
|
- .item_left {
|
|
397
|
|
- display: flex;
|
|
398
|
|
- align-items: center;
|
|
|
394
|
+ .item_left {
|
|
|
395
|
+ display: flex;
|
|
|
396
|
+ align-items: center;
|
|
399
|
397
|
|
|
400
|
|
- image {
|
|
401
|
|
- width: 32rpx;
|
|
402
|
|
- height: 32rpx;
|
|
403
|
|
- margin-right: 20rpx;
|
|
404
|
|
- }
|
|
|
398
|
+ image {
|
|
|
399
|
+ width: 32rpx;
|
|
|
400
|
+ height: 32rpx;
|
|
|
401
|
+ margin-right: 20rpx;
|
|
|
402
|
+ }
|
|
405
|
403
|
|
|
406
|
|
- .label {
|
|
407
|
|
- font-size: 28rpx;
|
|
408
|
|
- color: #202020;
|
|
409
|
|
- }
|
|
410
|
|
- }
|
|
|
404
|
+ .label {
|
|
|
405
|
+ font-size: 28rpx;
|
|
|
406
|
+ color: #202020;
|
|
|
407
|
+ }
|
|
|
408
|
+ }
|
|
411
|
409
|
|
|
412
|
|
- .item-right {
|
|
413
|
|
- display: flex;
|
|
414
|
|
- justify-content: space-between;
|
|
415
|
|
- align-items: center;
|
|
|
410
|
+ .item-right {
|
|
|
411
|
+ display: flex;
|
|
|
412
|
+ justify-content: space-between;
|
|
|
413
|
+ align-items: center;
|
|
416
|
414
|
|
|
417
|
|
- text {
|
|
418
|
|
- font-size: 24rpx;
|
|
419
|
|
- color: #999999;
|
|
420
|
|
- margin-right: 10rpx;
|
|
421
|
|
- }
|
|
|
415
|
+ text {
|
|
|
416
|
+ font-size: 24rpx;
|
|
|
417
|
+ color: #999999;
|
|
|
418
|
+ margin-right: 10rpx;
|
|
|
419
|
+ }
|
|
422
|
420
|
|
|
423
|
|
- .btn {
|
|
424
|
|
- color: #108cff;
|
|
425
|
|
- }
|
|
|
421
|
+ .btn {
|
|
|
422
|
+ color: #108cff;
|
|
|
423
|
+ }
|
|
426
|
424
|
|
|
427
|
|
- .icon_img {
|
|
428
|
|
- width: 40rpx;
|
|
429
|
|
- height: 40rpx;
|
|
430
|
|
- }
|
|
431
|
|
- }
|
|
432
|
|
- }
|
|
433
|
|
-}
|
|
|
425
|
+ .icon_img {
|
|
|
426
|
+ width: 40rpx;
|
|
|
427
|
+ height: 40rpx;
|
|
|
428
|
+ }
|
|
|
429
|
+ }
|
|
|
430
|
+ }
|
|
|
431
|
+ }
|
|
434
|
432
|
</style>
|