mirror of
https://github.com/openharmony/applications_contacts.git
synced 2026-07-01 19:54:30 -04:00
!6 Modify comments to English and fix bugs
Merge pull request !6 from Sige/1230
This commit is contained in:
+2
-2
@@ -108,7 +108,7 @@ DevEco Studio 支持 debug 与 release 两种打包类型。可以在 OhosBuild
|
||||
配置 hdc:
|
||||
进入SDK目录中的toolchains文件夹下,获取文件路径:
|
||||
|
||||

|
||||

|
||||
|
||||
> 注意,此处的hdc.exe如果版本较老,可能不能正常使用,需要获取新的hdc.exe文件
|
||||
> hdc命令介绍与下载详见:[hdc仓库地址](https://gitee.com/openharmony/developtools_hdc_standard)
|
||||
@@ -116,7 +116,7 @@ DevEco Studio 支持 debug 与 release 两种打包类型。可以在 OhosBuild
|
||||
|
||||
并将此路径配置到环境变量中:
|
||||
|
||||

|
||||

|
||||
|
||||
重启电脑使环境变量生效
|
||||
|
||||
|
||||
@@ -23,19 +23,14 @@ let Subscriber;
|
||||
let id = 1;
|
||||
const events = ['usual.event.INCOMING_CALL_MISSED'];
|
||||
|
||||
/**
|
||||
* class CallManagerService
|
||||
*/
|
||||
|
||||
class MissedCallsService {
|
||||
constructor() {
|
||||
}
|
||||
|
||||
/**
|
||||
* add missedCalls app subscriber
|
||||
*/
|
||||
async addSubscriber() {
|
||||
Subscriber = await new Promise((resolve, reject) => {
|
||||
commonEvent.createSubscriber({events},
|
||||
commonEvent.createSubscriber({ events },
|
||||
(err, data) => {
|
||||
resolve(data);
|
||||
}
|
||||
@@ -43,13 +38,11 @@ class MissedCallsService {
|
||||
});
|
||||
|
||||
commonEvent.subscribe(Subscriber, (err, data) => {
|
||||
/* 接收到未接来电广播后,发送通知 */
|
||||
this.sendNotification(data.data);
|
||||
});
|
||||
}
|
||||
/* 发送未接来电通知 */
|
||||
|
||||
async sendNotification(text) {
|
||||
/* 创建通知消息体 */
|
||||
const notificationRequest = {
|
||||
content: {
|
||||
contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
|
||||
@@ -71,13 +64,14 @@ class MissedCallsService {
|
||||
operationType: wantAgent.OperationType.START_ABILITY,
|
||||
requestCode: 0,
|
||||
});
|
||||
Object.assign(notificationRequest, {wantAgent: res});
|
||||
Object.assign(notificationRequest, { wantAgent: res });
|
||||
notificationRequest.content.normal.title = text;
|
||||
notificationRequest.content.normal.text = '未接来电';
|
||||
notificationRequest.content.normal.text = this.$t('value.callRecords.missedCalls');
|
||||
id++;
|
||||
notify.publish(notificationRequest);
|
||||
}
|
||||
}
|
||||
|
||||
let service = new MissedCallsService();
|
||||
|
||||
export default service;
|
||||
@@ -63,34 +63,32 @@ export default {
|
||||
isHidden: false,
|
||||
isSearch: false
|
||||
},
|
||||
voicemailNumber: '', // 缓存语音信箱号码
|
||||
refreshFunctions: [], // 页面回调函数容器,用于各页面数据的刷新。
|
||||
navigationBackPressFunctions: [], // 主界面返回键回调函数,主界面点击返回时,调用所注册的函数。
|
||||
batchSelectContactsRefreshFunction: [], // 批量选择联系人页面子组件数据刷新回调。
|
||||
isDisplay: true, // 屏蔽组件
|
||||
searchValue: '', // 详情界面助理跳回主页需要携带参数
|
||||
contactCount: 0, // 用于判断分享联系人是否是置灰,
|
||||
voicemailNumber: '',
|
||||
refreshFunctions: [],
|
||||
navigationBackPressFunctions: [],
|
||||
batchSelectContactsRefreshFunction: [],
|
||||
isDisplay: true,
|
||||
searchValue: '',
|
||||
contactCount: 0,
|
||||
pushToGroup: false,
|
||||
groupParams: null,
|
||||
dialogShow: false
|
||||
},
|
||||
/* 拨号盘状态数据 */
|
||||
dialerStateData: {
|
||||
isEditNumber: false, // true:表示从其他页面通过呼叫前编辑返回到拨号盘
|
||||
isGoToMissedCalls: false, // true:表示初始进入拨号盘时,需要展示未接来电页面
|
||||
isEditNumber: false,
|
||||
isGoToMissedCalls: false,
|
||||
numTextDialer: '',
|
||||
showDialer: true,
|
||||
copyDisabled: true,
|
||||
isCallState: false,
|
||||
isNeedShowDialer: true, // 表示在拨号盘从后台拉起时,是否需要显示拨号盘。从拨号盘当前页面的跳转都无需显示拨号盘
|
||||
isNeedHideDialer: false, // 表示三方跳转到拨号盘时,是否需要隐藏拨号盘
|
||||
isNeedShowDialer: true,
|
||||
isNeedHideDialer: false,
|
||||
},
|
||||
groups: {
|
||||
group: []
|
||||
},
|
||||
dialer: {},
|
||||
|
||||
/* 全局拨号盘 */
|
||||
setAddAccount(addAccount) {
|
||||
this.globalData.addAccount = addAccount;
|
||||
},
|
||||
@@ -135,9 +133,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 打电话
|
||||
* Make a phone call
|
||||
*
|
||||
* @param {number} phoneNumber 电话号码
|
||||
* @param {number} phoneNumber
|
||||
*/
|
||||
call(phoneNumber) {
|
||||
if (phoneNumber == null || phoneNumber == '') {
|
||||
@@ -154,14 +152,14 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
// 发送短信
|
||||
|
||||
sendMessage(params) {
|
||||
let actionData = {};
|
||||
actionData.contactObjects = JSON.stringify(params);
|
||||
actionData.pageFlag = 'conversation';
|
||||
this.jumpToContract(actionData);
|
||||
},
|
||||
// 跳转至短彩信app
|
||||
|
||||
jumpToContract(actionData) {
|
||||
var str = {
|
||||
'want': {
|
||||
@@ -175,8 +173,8 @@ export default {
|
||||
};
|
||||
featureAbility.startAbility(str)
|
||||
.then((data) => {
|
||||
LOG.info(TAG + 'jumpToContract Operation successful. Data: ' + JSON.stringify(data));
|
||||
}).catch((error) => {
|
||||
LOG.info(TAG + 'jumpToContract Operation successful. Data: ' + JSON.stringify(data));
|
||||
}).catch((error) => {
|
||||
LOG.error(TAG + 'jumpToContract Operation failed. Cause: ' + JSON.stringify(error));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
$backgroundColorOnClick: gainsboro; /* 按钮点击时通用背景色 */
|
||||
$baseColorGreen: #41ba41; /* 绿色按钮通用色 */
|
||||
$baseColorGreenClicked: #3aa73a; /* 绿色按钮通用色 */
|
||||
$backgroundColorDialer: #f9f9f9; /* 拨号盘背景色 */
|
||||
$textColorTabBar:royalblue; /* tab-bar被激活时文本显示颜色 */
|
||||
$textColorDefault:#e6000000; /* 字体默认颜色 */
|
||||
$textColorDisabled:gray; /* 未激活项字体颜色 */
|
||||
$backgroundColorOnClick: gainsboro;
|
||||
$baseColorGreen: #41ba41;
|
||||
$baseColorGreenClicked: #3aa73a;
|
||||
$backgroundColorDialer: #f9f9f9;
|
||||
$textColorTabBar:royalblue;
|
||||
$textColorDefault:#e6000000;
|
||||
$textColorDisabled:gray;
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
.title_font{
|
||||
.title_font {
|
||||
font-size: 50px;
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -18,14 +18,14 @@
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
}
|
||||
/*列表容器*/
|
||||
|
||||
.list-group {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
/*item器样式*/
|
||||
|
||||
.list-item {
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
@@ -33,7 +33,6 @@
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
/*item父容器样式*/
|
||||
.list-item-body-group {
|
||||
padding-top: 20px;
|
||||
width: 100%;
|
||||
@@ -41,11 +40,11 @@
|
||||
padding-bottom: 20px;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.list-item-body-group:active {
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
/*头像文字父容器*/
|
||||
.list-item-head-group {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
@@ -53,7 +52,7 @@
|
||||
align-items: center;
|
||||
border-radius: 50px;
|
||||
}
|
||||
/*头像文字*/
|
||||
|
||||
.list-item-head-name {
|
||||
text-overflow: ellipsis;
|
||||
text-align: center;
|
||||
@@ -62,7 +61,7 @@
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
}
|
||||
/*默认头像*/
|
||||
|
||||
.child-image-default {
|
||||
border-radius: 50px;
|
||||
object-fit: contain;
|
||||
@@ -70,7 +69,7 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
/*头像*/
|
||||
|
||||
.todo-content-body-group {
|
||||
width: 85px;
|
||||
height: 85px;
|
||||
@@ -80,7 +79,7 @@
|
||||
flex-direction: row;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
/*姓名电话父容器*/
|
||||
|
||||
.list-item-body-name {
|
||||
text-align: left;
|
||||
margin-bottom: 20px;
|
||||
@@ -91,7 +90,7 @@
|
||||
max-lines: 1;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
/*姓名电话父容器*/
|
||||
|
||||
.list-item-body-name-search {
|
||||
text-align: left;
|
||||
margin-bottom: 20px;
|
||||
@@ -103,7 +102,7 @@
|
||||
max-lines: 1;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
/*姓名父容器*/
|
||||
|
||||
.list-item-name-search-group {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
@@ -111,6 +110,7 @@
|
||||
align-items: flex-start;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.list-item-name-search-txt {
|
||||
text-align: left;
|
||||
font-size: 30px;
|
||||
@@ -119,70 +119,70 @@
|
||||
align-items: flex-start;
|
||||
color: #007DFE;
|
||||
}
|
||||
/*默认电话父容器*/
|
||||
|
||||
.list-item-body-name-group {
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
height: 80px;
|
||||
flex-direction: column;
|
||||
}
|
||||
/*默认电话样式*/
|
||||
|
||||
.list-item-body-phone-check-box-group {
|
||||
flex-shrink: 1;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
/*默认电话样式*/
|
||||
.list-item-body-phone-group {
|
||||
flex-direction: row;
|
||||
background-color: #ff0000;
|
||||
flex-shrink: 1;
|
||||
}
|
||||
/*默认显示电话*/
|
||||
|
||||
.list-item-phone-group {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
/*电话列表父容器*/
|
||||
|
||||
.list-child-phone-group {
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.list-child-phone-group:active {
|
||||
background-color: lightgray;
|
||||
}
|
||||
/*电话列表容器*/
|
||||
|
||||
.list-child-phone-item {
|
||||
padding-left: 135px;
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/*电话列表容器*/
|
||||
.list-child-phone-item1 {
|
||||
padding-left: 50px;
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.list-child-phone-item:active {
|
||||
background-color: lightgray;
|
||||
}
|
||||
/*分割线*/
|
||||
|
||||
.list-child-phone-line-group {
|
||||
margin-right: 60px;
|
||||
width: 100%;
|
||||
}
|
||||
/*分割线*/
|
||||
|
||||
.line-group {
|
||||
width: 100%;
|
||||
margin-right: 60px;
|
||||
justify-content: flex-end;
|
||||
align-items: flex-end;
|
||||
}
|
||||
/*分割线样式*/
|
||||
|
||||
.list-group-line {
|
||||
stroke-width: 1px;
|
||||
line-cap: round;
|
||||
@@ -191,7 +191,7 @@
|
||||
justify-content: flex-end;
|
||||
align-items: flex-end;
|
||||
}
|
||||
/*分割线样式*/
|
||||
|
||||
.list-group-line1 {
|
||||
stroke-width: 1px;
|
||||
line-cap: round;
|
||||
@@ -202,13 +202,12 @@
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
/*分割线样式*/
|
||||
.list-child-phone-line {
|
||||
stroke-width: 1px;
|
||||
line-cap: round;
|
||||
color: #ccc;
|
||||
}
|
||||
/*电话父容器*/
|
||||
|
||||
.list-child-phone-number-group {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
@@ -216,13 +215,12 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/*电话样式手机*/
|
||||
.list-item-phone {
|
||||
text-align: left;
|
||||
font-size: 24px;
|
||||
color: #636363;
|
||||
}
|
||||
/*电话样式手机*/
|
||||
|
||||
.list-item-phone-label {
|
||||
text-align: left;
|
||||
font-size: 24px;
|
||||
@@ -232,8 +230,6 @@
|
||||
color: #636363;
|
||||
}
|
||||
|
||||
|
||||
/*电话样式手机*/
|
||||
.list-item-phone {
|
||||
text-align: left;
|
||||
max-lines: 2;
|
||||
@@ -242,6 +238,7 @@
|
||||
color: #636363;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.list-item-phone-search {
|
||||
text-align: left;
|
||||
max-lines: 2;
|
||||
@@ -251,9 +248,6 @@
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*电话样式手机*/
|
||||
.list-item-phone-absolute {
|
||||
text-align: left;
|
||||
position: absolute;
|
||||
@@ -269,14 +263,11 @@
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
/*电话样式手机*/
|
||||
.list-item-phone-div {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
/*电话样式*/
|
||||
.list-item-phone-number {
|
||||
text-align: left;
|
||||
max-lines: 2;
|
||||
@@ -286,12 +277,11 @@
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
/*搜索结果父容器*/
|
||||
.search-result-list {
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
}
|
||||
/*搜索提示title*/
|
||||
|
||||
.list-search-phone-num {
|
||||
padding-left: 30px;
|
||||
margin-bottom: 30px;
|
||||
@@ -302,30 +292,33 @@
|
||||
color: #a9a9a9;
|
||||
}
|
||||
|
||||
/*搜索结果列表容器*/
|
||||
.list-search-group {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.input-type-group {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
margin-right: 50px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.input-type-group1 {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin-left: 20px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.input-type {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
margin-left: 18px;
|
||||
}
|
||||
|
||||
.input-number-type {
|
||||
margin-right: 65px;
|
||||
height: 80px;
|
||||
@@ -334,6 +327,7 @@
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.input-number-type1 {
|
||||
margin-right: 50px;
|
||||
height: 80px;
|
||||
@@ -342,24 +336,24 @@
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
}
|
||||
/*内容布局*/
|
||||
|
||||
.list-item-body-content {
|
||||
align-items: center;
|
||||
flex-shrink: 1;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
/*内容布局*/
|
||||
.list-item-body-name-phone {
|
||||
flex-direction: column;
|
||||
width: 430px;
|
||||
}
|
||||
/*内容布局*/
|
||||
|
||||
.list-item-body-name-phone1 {
|
||||
flex-direction: column;
|
||||
width: 520px;
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.todo-content-name-last {
|
||||
width: 90%;
|
||||
height: 65%;
|
||||
@@ -369,12 +363,14 @@
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.todo-item-content-div {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.todo-name-suffix-div {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -388,6 +384,7 @@
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.todo-content-div-div {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
@@ -395,6 +392,7 @@
|
||||
margin-start: 32px;
|
||||
width: 88%;
|
||||
}
|
||||
|
||||
.todo-content-name {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
@@ -403,6 +401,7 @@
|
||||
max-lines: 1;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.todo-content {
|
||||
margin-top: 9px;
|
||||
width: 100%;
|
||||
|
||||
@@ -12,11 +12,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/-->
|
||||
<!-- 联系人列表 加上show="{{!searchLayoutShow}}" 预览布局会错乱,实际运行正常-->
|
||||
<div class="list-div-group">
|
||||
<list class="list-group" indexer="true" if="{{ ! searchLayoutShow }}" cachedcount="200" onrequestitem="requestItem">
|
||||
|
||||
<!-- 名称电话头像列表-->
|
||||
<!-- Name Phone profile picture list-->
|
||||
<list-item class="list-item" for="{{ (index, item) in contactList }}" section="{{ item.name.namePrefix }}">
|
||||
<div class="list-item-body-group" on:click="listItemTouchStart(index,0)">
|
||||
<div class="todo-content-body-group" if="{{layoutState}}">
|
||||
@@ -55,7 +54,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 电话列表 show="{{index != 0}}"-->
|
||||
<!--The phone list show="{{index != 0}}"-->
|
||||
<div class="list-child-phone-group" for="{{ item.phoneNumbers }}" if="{{ showNumberList }}"
|
||||
on:click="listItemTouchStart(index,{{ $idx }})">
|
||||
<div class="{{ layoutState?'list-child-phone-item':'list-child-phone-item1' }}" if="{{ $idx != 0 }}">
|
||||
@@ -79,14 +78,14 @@
|
||||
</list-item>
|
||||
</list>
|
||||
|
||||
<!-- 搜索列表-->
|
||||
<!-- Search listings-->
|
||||
<div class="search-result-list" if="{{ searchLayoutShow }}">
|
||||
<text class="list-search-phone-num">
|
||||
{{ $t('value.selectContact.page.find') }}{{ searchPhoneNum }}{{ $t('value.selectContact.page.findEnd') }}
|
||||
</text>
|
||||
<list class="list-search-group" show="true">
|
||||
|
||||
<!-- 名称电话头像列表-->
|
||||
<!-- Name Phone profile picture list-->
|
||||
<list-item class="list-item" for="{{ (index, item) in searchContactList }}">
|
||||
<div class="list-item-body-group" on:click="listItemTouchStartSearch(index,0)">
|
||||
<div class="todo-content-body-group" if="{{layoutState}}">
|
||||
@@ -138,7 +137,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 电话列表 show="{{index != 0}}"-->
|
||||
<!-- The phone list show="{{index != 0}}"-->
|
||||
<div class="list-child-phone-group" for="{{ item.phoneNumbers }}"
|
||||
if="{{ showNumberList }}"
|
||||
on:click="listItemTouchStartSearch(index,{{ $idx }})">
|
||||
|
||||
@@ -14,28 +14,28 @@
|
||||
*/
|
||||
export default {
|
||||
props: ['contactList', 'searchContactList', 'searchLayoutShow', 'searchPhoneNum', 'phoneCheckShow',
|
||||
'showDefaultNumber', 'childPhoneCheckShow', 'showNumberList', 'selectType'],
|
||||
'showDefaultNumber', 'childPhoneCheckShow', 'showNumberList', 'selectType'],
|
||||
data: {
|
||||
layoutState: true,
|
||||
},
|
||||
onInit() {
|
||||
this.conciseLayoutInit();
|
||||
},
|
||||
/* 批量删除选中的通话记录 */
|
||||
|
||||
deleteCheckedCalls() {
|
||||
this.$element('deleteCheckDialog').show(); // 显示删除提示框
|
||||
this.$element('deleteCheckDialog').show();
|
||||
},
|
||||
/* 确认删除 */
|
||||
|
||||
doDelete() {
|
||||
this.$emit('sureProcess', {});
|
||||
this.$element('deleteCheckDialog').close();
|
||||
},
|
||||
// 简洁布局选项初始化
|
||||
|
||||
conciseLayoutInit: function () {
|
||||
let data = this.$app.$def.globalData.storage.getSync('contacts_settings_concise_layout_switch', 'false');
|
||||
this.layoutState = data === 'true' ? false : true;
|
||||
},
|
||||
/* 取消删除 */
|
||||
|
||||
cancelDialog() {
|
||||
this.$element('deleteCheckDialog').close();
|
||||
},
|
||||
@@ -43,28 +43,28 @@ export default {
|
||||
this.listItemTouchStart(index, indexChild);
|
||||
},
|
||||
listItemTouchStart(index, indexChild) {
|
||||
if (this.selectType === 'batchSelect') { // 批量选择联系人界面
|
||||
if (this.selectType === 'batchSelect') { // Select contacts in batches
|
||||
this.$emit('checkChange', {
|
||||
contactIndex: index,
|
||||
numberIndex: indexChild,
|
||||
checked: this.searchLayoutShow ? !this.searchContactList[index].phoneNumbers[indexChild].checked
|
||||
: !this.contactList[index].phoneNumbers[indexChild].checked
|
||||
});
|
||||
} else { // 从快速拨号界面跳转到选择联系人
|
||||
} else { // The speed dial screen is displayed
|
||||
this.$emit('eventType', {
|
||||
index: index,
|
||||
indexChild: indexChild
|
||||
});
|
||||
}
|
||||
},
|
||||
/* 选择要编辑的联系人 */
|
||||
|
||||
editContacts(index) {
|
||||
this.$emit('contactsSelected', {
|
||||
contacts: this.contactList[index]
|
||||
});
|
||||
},
|
||||
requestItem() {
|
||||
// 数据缓存刷新
|
||||
// Data cache refresh
|
||||
this.$emit('requestItem', {});
|
||||
},
|
||||
changeCheckState: function (contactIndex, numberIndex, event) {
|
||||
|
||||
@@ -16,11 +16,13 @@
|
||||
width: 92%;
|
||||
height: 15%;
|
||||
}
|
||||
|
||||
.dialog-div {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.inner-txt {
|
||||
height: 40%;
|
||||
width: 100%;
|
||||
@@ -28,15 +30,18 @@
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.txt {
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.inner-btn {
|
||||
width: 100%;
|
||||
height: 50%;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn-txt {
|
||||
width: 40%;
|
||||
height: 70%;
|
||||
@@ -45,6 +50,7 @@
|
||||
text-color: #175cfe;
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.btn-txt-delete {
|
||||
width: 40%;
|
||||
height: 70%;
|
||||
|
||||
@@ -15,11 +15,12 @@
|
||||
<dialog id="deleteCheckDialog" class="dialog-main" oncancel="cancelDialog">
|
||||
<div class="dialog-div">
|
||||
<div class="inner-txt">
|
||||
<text class="txt">{{deleteMessage}}</text>
|
||||
<text class="txt">{{ deleteMessage }}</text>
|
||||
</div>
|
||||
<div class="inner-btn">
|
||||
<button type="capsule" value="{{$t('phone.cancel')}}" onclick="cancelDialog" class="btn-txt"></button>
|
||||
<button type="capsule" value="{{$t('value.callRecords.delete')}}" onclick="doDelete" class="btn-txt-delete"></button>
|
||||
<button type="capsule" value="{{ $t('phone.cancel') }}" onclick="cancelDialog" class="btn-txt"></button>
|
||||
<button type="capsule" value="{{ $t('value.callRecords.delete') }}" onclick="doDelete"
|
||||
class="btn-txt-delete"></button>
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
@@ -17,19 +17,17 @@
|
||||
*/
|
||||
export default {
|
||||
props: ['deleteMessage'],
|
||||
data: {
|
||||
data: {},
|
||||
|
||||
},
|
||||
/* 批量删除选中的通话记录 */
|
||||
deleteCheckedCalls() {
|
||||
this.$element('deleteCheckDialog').show();
|
||||
},
|
||||
/* 确认删除 */
|
||||
|
||||
doDelete() {
|
||||
this.$emit('sureProcess', {});
|
||||
this.$element('deleteCheckDialog').close();
|
||||
},
|
||||
/* 取消删除 */
|
||||
|
||||
cancelDialog() {
|
||||
this.$element('deleteCheckDialog').close();
|
||||
},
|
||||
|
||||
@@ -17,11 +17,13 @@
|
||||
width: 100%;
|
||||
height: 17%;
|
||||
}
|
||||
|
||||
.page-title-box-small {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 9%;
|
||||
}
|
||||
|
||||
.page-title-text {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
@@ -29,6 +31,7 @@
|
||||
font-size: 60px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.page-title-text-small {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
@@ -36,6 +39,7 @@
|
||||
font-size: 50px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.page-title-more-image-box {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
@@ -46,9 +50,11 @@
|
||||
height: 90px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.page-title-more-image-box:active {
|
||||
background-color: #dcdcdc;
|
||||
}
|
||||
|
||||
.page-title-more-image {
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
|
||||
@@ -12,9 +12,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/-->
|
||||
<div class="{{titleType != 1 ? 'page-title-box' : 'page-title-box-small'}}" show="{{showTitle}}">
|
||||
<div class="{{ titleType != 1 ? 'page-title-box' : 'page-title-box-small' }}" show="{{ showTitle }}">
|
||||
<div class="page-title-more-image-box" id="moreOperation">
|
||||
<image src="../../../../default/res/image/ic_more_24x24.svg" class="page-title-more-image"></image>
|
||||
</div>
|
||||
<text id="phoneTitleId" class="{{titleType != 1 ? 'page-title-text' : 'page-title-text-small'}}">{{titleName}}</text>
|
||||
<text id="phoneTitleId" class="{{ titleType != 1 ? 'page-title-text' : 'page-title-text-small' }}">{{ titleName }}
|
||||
</text>
|
||||
</div>
|
||||
@@ -16,7 +16,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
export default {
|
||||
|
||||
props: ['titleName', 'titleType', 'showTitle'],
|
||||
data: {
|
||||
titleSmall: 'page-title-box-small',
|
||||
|
||||
@@ -14,21 +14,21 @@
|
||||
*/
|
||||
export default {
|
||||
uri: {
|
||||
CONTACT_DB_URI: 'dataability:///com.ohos.contactsdataability', // 连接联系人数据库的uri,用于获取联系人数据库DAHelper
|
||||
VOICEMAIL_DB_URI: 'dataability:///com.ohos.voicemailability', // 连接语音信箱数据库的uri,用于获取语音信箱数据库DAHelper
|
||||
CALLLOG_DB_URI: 'dataability:///com.ohos.calllogability', // 通话记录数据库uri,用于获取通话记录数据库DAHelper
|
||||
CONTACTS_URI_PREFIX: 'dataability:///com.ohos.contactsdataability/contacts/', // 查询contacts库各种表uri前缀
|
||||
CALLS_URI_PREFIX: 'dataability:///com.ohos.calllogability/calls/', // 查询calls库各种表uri前缀
|
||||
VOICEMAIL_URI_PREFIX: 'dataability:///com.ohos.voicemailability/calls/', // 查询voicemail库各种表uri前缀
|
||||
CONTACT_DB_URI: 'dataability:///com.ohos.contactsdataability', // Uri for connecting to the contact database to obtain the contact database DAHelper
|
||||
VOICEMAIL_DB_URI: 'dataability:///com.ohos.voicemailability', // Uri for connecting to the voice mailbox database to obtain the voice mailbox database DAHelper
|
||||
CALLLOG_DB_URI: 'dataability:///com.ohos.calllogability', // Call record database URI, used to obtain the call record database DAHelper
|
||||
CONTACTS_URI_PREFIX: 'dataability:///com.ohos.contactsdataability/contacts/', // Query the various table URI prefixes in the Contacts library
|
||||
CALLS_URI_PREFIX: 'dataability:///com.ohos.calllogability/calls/', // SQL > alter TABLE URI prefixes
|
||||
VOICEMAIL_URI_PREFIX: 'dataability:///com.ohos.voicemailability/calls/', // Example Query the URI prefixes of various tables in the Voicemail library
|
||||
SEARCH_CONTACT_URI: 'dataability:///com.ohos.contactsdataability/contacts/search_contact',
|
||||
ROW_CONTACTS_URI: 'dataability:///com.ohos.contactsdataability/contacts/raw_contact', // 对row_contacts表操作的uri
|
||||
CONTACT_DATA_URI: 'dataability:///com.ohos.contactsdataability/contacts/contact_data', // 对contact_data表操作的uri
|
||||
ROW_CONTACTS_URI: 'dataability:///com.ohos.contactsdataability/contacts/raw_contact', // // Uri of the operation on the row_contacts table
|
||||
CONTACT_DATA_URI: 'dataability:///com.ohos.contactsdataability/contacts/contact_data', // Uri of operation on contact_data table
|
||||
CONTACT_URI: 'dataability:///com.ohos.contactsdataability/contacts/contact',
|
||||
CONTACT_TYPE_URI: 'dataability:///com.ohos.contactsdataability/contacts/contact_type',
|
||||
GROUPS_URI: 'dataability:///com.ohos.contactsdataability/contacts/groups',
|
||||
CALL_LOG_URI: 'dataability:///com.ohos.calllogability/calls/calllog', // 通话记录表操作uri
|
||||
PROFILE_ROW_CONTACTS_URI: 'dataability:///com.ohos.contactsdataability/profile/raw_contact', // 我的名片raw_contact表操作uri
|
||||
PROFILE_CONTACT_DATA_URI: 'dataability:///com.ohos.contactsdataability/profile/contact_data', // 我的名片contact_data表操作的uri
|
||||
CALL_LOG_URI: 'dataability:///com.ohos.calllogability/calls/calllog', // Uri of call record table operation
|
||||
PROFILE_ROW_CONTACTS_URI: 'dataability:///com.ohos.contactsdataability/profile/raw_contact', // My business card raw_contact table operation URI
|
||||
PROFILE_CONTACT_DATA_URI: 'dataability:///com.ohos.contactsdataability/profile/contact_data', // The URI of the contact_data table operation on my business card
|
||||
VOICEMAIL_URI: 'dataability:///com.ohos.voicemailability/calls/voicemail'
|
||||
},
|
||||
int: {
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
export default {
|
||||
// 头像背景颜色
|
||||
Color: ['#FF53804D', '#FF406380', '#FF807240', '#FF664D80', '#FF8C465F', '#FF8C4F3F'],
|
||||
// 详情页背景色
|
||||
detailColor: ['#CCD9E4EE', '#CCE1DAED', '#CCD5E3D3', '#CCEBE0CC', '#CCF0DED8', '#CCEEDDE5'],
|
||||
Color: ['#FF53804D', '#FF406380', '#FF807240', '#FF664D80', '#FF8C465F', '#FF8C4F3F'],
|
||||
|
||||
detailColor: ['#CCD9E4EE', '#CCE1DAED', '#CCD5E3D3', '#CCEBE0CC', '#CCF0DED8', '#CCEEDDE5'],
|
||||
};
|
||||
@@ -125,6 +125,10 @@
|
||||
}
|
||||
},
|
||||
"contacts": {
|
||||
"noInfo": "No other information is available for this contact",
|
||||
"waitExport": "It will be exported later",
|
||||
"batchSelectContacts": "Batch Selecting Contacts",
|
||||
"samplePage": "The sample page",
|
||||
"tab": "Contacts",
|
||||
"page": {
|
||||
"title": "Contacts",
|
||||
@@ -291,7 +295,11 @@
|
||||
"warningInfo": "Import contacts from your SIM?",
|
||||
"cancelTxt": "CANCEL",
|
||||
"importTxt": "IMPORT",
|
||||
"prompt": "Successfully imported num contacts."
|
||||
"prompt": "Successfully imported num contacts.",
|
||||
"choose": "Select the VCard file",
|
||||
"selectAll": "select all",
|
||||
"isExport": "Whether to export the contact list to internal storage /",
|
||||
"safekeeping": "? After the export, keep your contact information safe"
|
||||
},
|
||||
"aboutPage": {
|
||||
"title": "About",
|
||||
|
||||
@@ -119,6 +119,10 @@
|
||||
}
|
||||
},
|
||||
"contacts": {
|
||||
"noInfo": "没有此联系人的其他信息",
|
||||
"waitExport": "将在稍后导出",
|
||||
"batchSelectContacts": "批量选择联系人",
|
||||
"samplePage": "样例页面",
|
||||
"tab": "联系人",
|
||||
"page": {
|
||||
"title": "联系人",
|
||||
@@ -270,7 +274,11 @@
|
||||
"warningInfo": "是否将SIM卡联系人导入到手机?",
|
||||
"cancelTxt": "取消",
|
||||
"importTxt": "导入",
|
||||
"prompt": "已成功导入 num 个联系人"
|
||||
"prompt": "已成功导入 num 个联系人",
|
||||
"choose": "选择VCard文件",
|
||||
"selectAll": "全选",
|
||||
"isExport": "是否将联系人列表导出至 内部存储/",
|
||||
"safekeeping": "?导出后,请妥善保管您的联系人信息"
|
||||
},
|
||||
"aboutPage": {
|
||||
"title": "关于",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 新建联系人model
|
||||
* @file: Create a Contact model
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -22,22 +22,23 @@ import Constants from '../common/constants/Constants.js';
|
||||
import LOG from '../utils/ContactsLog.js';
|
||||
import backgroundColor from '../common/constants/color.js';
|
||||
|
||||
// 头像背景默认颜色
|
||||
// Default color of avatar background
|
||||
var PortraitColor = backgroundColor.Color;
|
||||
// 头像背景深色颜色
|
||||
// Dark color of avatar background
|
||||
var DetailsBgColor = backgroundColor.detailColor;
|
||||
var TAG = 'accountantsModel';
|
||||
|
||||
export default {
|
||||
|
||||
/**
|
||||
* 添加联系人
|
||||
* Adding contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {Object} callBack 回调
|
||||
*/
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {Object} callBack The callback
|
||||
*/
|
||||
addContact: async function (DAHelper, addParams, callBack) {
|
||||
// 添加联系人
|
||||
// Adding contacts
|
||||
var stringValue = {
|
||||
'display_name': this.getDisplayName(addParams),
|
||||
};
|
||||
@@ -54,11 +55,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 编辑联系人
|
||||
* Edit contacts
|
||||
*
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @return {string} 联系人姓名
|
||||
*/
|
||||
* @param {Object} addParams Contact Information
|
||||
* @return {string} Contact Name
|
||||
*/
|
||||
getDisplayName: function (addParams) {
|
||||
let displayName = '';
|
||||
if (addParams.name != undefined && addParams.name.fullName.length > 0) {
|
||||
@@ -80,11 +81,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 将数据转换 存进数据库
|
||||
* Save the data conversion to the database
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {boolean} isCard 是否为名片信息
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {boolean} isCard Whether it is a business card
|
||||
*/
|
||||
dealParam: function (DAHelper, addParams, isCard) {
|
||||
var result = addParams.contactId;
|
||||
@@ -93,35 +94,35 @@ export default {
|
||||
this.dataContact(addParams, DAHelper, result, uri);
|
||||
// vnd.item/organization 41
|
||||
this.organizationContact(addParams, DAHelper, result, uri);
|
||||
// vnd.item/note 备注 48
|
||||
// vnd.item/note note 48
|
||||
this.noteContact(addParams, DAHelper, result, uri);
|
||||
// 电话号码 vnd.item/phone 42
|
||||
// The phone number vnd.item/phone 42
|
||||
this.phoneContact(addParams, DAHelper, result, uri);
|
||||
// 邮箱 vnd.item/email 38
|
||||
// email vnd.item/email 38
|
||||
this.emailContact(addParams, DAHelper, result, uri);
|
||||
// vnd.item/postal_address 地址 45
|
||||
// vnd.item/postal_address address 45
|
||||
this.postalContact(addParams, DAHelper, result, uri);
|
||||
// 昵称vnd.item/nickname 40
|
||||
// Nickname VND.item/nickname 40
|
||||
this.nickContact(addParams, DAHelper, result, uri);
|
||||
// 日期vnd.item/contact_event 49
|
||||
// The date of VND.item/contact_event 49
|
||||
this.eventContact(addParams, DAHelper, result, uri);
|
||||
// vnd.item/im 即时消息 39
|
||||
// vnd.item/im Instant messaging 39
|
||||
this.imContact(addParams, DAHelper, result, uri);
|
||||
// vnd.item/group_membership 群组
|
||||
// vnd.item/group_membership group
|
||||
this.groupsContact(addParams, DAHelper, result, uri);
|
||||
// vnd.item/website网址 50
|
||||
// vnd.item/websiteThe url 50
|
||||
this.websiteContact(addParams, DAHelper, result, uri);
|
||||
// vnd.item/relation 关联人 51
|
||||
// vnd.item/relation associates 51
|
||||
this.relationsContact(addParams, DAHelper, result, uri);
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人姓名存入数据库
|
||||
* The contact name is stored in the database
|
||||
*
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {string} result 联系人ID
|
||||
* @param {string} uri 数据库地址
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {string} result The contact ID
|
||||
* @param {string} uri The contact ID
|
||||
*/
|
||||
dataContact: function (addParams, DAHelper, result, uri) {
|
||||
var displayName = '';
|
||||
@@ -151,12 +152,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人群组信息存入数据库
|
||||
* The contact group information is saved to the database
|
||||
*
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {string} result 联系人ID
|
||||
* @param {string} uri 数据库地址
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {string} result The contact ID
|
||||
* @param {string} uri The contact ID
|
||||
*/
|
||||
organizationContact: function (addParams, DAHelper, result, uri) {
|
||||
if (addParams.organization != undefined) {
|
||||
@@ -179,12 +180,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人备注信息存入数据库
|
||||
* Contact remarks are stored in the database
|
||||
*
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {number} result 联系人ID
|
||||
* @param {string} uri 数据库地址
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {number} result The contact ID
|
||||
* @param {string} uri The contact ID
|
||||
*/
|
||||
noteContact: function (addParams, DAHelper, result, uri) {
|
||||
if (addParams.note != undefined && addParams.note.noteContent.length > 0) {
|
||||
@@ -196,19 +197,19 @@ export default {
|
||||
DAHelper.insert(
|
||||
uri,
|
||||
noteContact
|
||||
).catch(error=>{
|
||||
).catch(error => {
|
||||
LOG.error(TAG + 'noteContact' + 'insert contact error:' + error);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人手机号信息存入数据库
|
||||
* Contact manual number information stored in the database
|
||||
*
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {number} result 联系人ID
|
||||
* @param {string} uri 数据库地址
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {number} result The contact ID
|
||||
* @param {string} uri The contact ID
|
||||
*/
|
||||
phoneContact: function (addParams, DAHelper, result, uri) {
|
||||
if (addParams.phoneNumbers != undefined && addParams.phoneNumbers.length > 0) {
|
||||
@@ -231,12 +232,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人邮箱信息存入数据库
|
||||
* Contact email information is stored in the database
|
||||
*
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {number} result 联系人ID
|
||||
* @param {string} uri 数据库地址
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {number} result The contact ID
|
||||
* @param {string} uri The contact ID
|
||||
*/
|
||||
emailContact: function (addParams, DAHelper, result, uri) {
|
||||
if (addParams.emails != undefined && addParams.emails.length > 0) {
|
||||
@@ -259,12 +260,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人地址信息存入数据库
|
||||
* The contact address information is stored in the database
|
||||
*
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {number} result 联系人ID
|
||||
* @param {string} uri 数据库地址
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {number} result The contact ID
|
||||
* @param {string} uri The contact ID
|
||||
*/
|
||||
postalContact: function (addParams, DAHelper, result, uri) {
|
||||
if (addParams.postalAddresses != undefined && addParams.postalAddresses.length > 0) {
|
||||
@@ -287,12 +288,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人昵称信息存入数据库
|
||||
* Contact nicknames are stored in the database
|
||||
*
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {number} result 联系人ID
|
||||
* @param {string} uri 数据库地址
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {number} result The contact ID
|
||||
* @param {string} uri The contact ID
|
||||
*/
|
||||
nickContact: function (addParams, DAHelper, result, uri) {
|
||||
if (addParams.nickName != undefined && addParams.nickName.nickName.length > 0) {
|
||||
@@ -311,12 +312,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人特殊日期信息存入数据库
|
||||
* Contact specific date information is stored in the database
|
||||
*
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {number} result 联系人ID
|
||||
* @param {string} uri 数据库地址
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {number} result The contact ID
|
||||
* @param {string} uri The contact ID
|
||||
*/
|
||||
eventContact: function (addParams, DAHelper, result, uri) {
|
||||
if (addParams.events != undefined && addParams.events.length > 0) {
|
||||
@@ -338,12 +339,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人IMA信息存入数据库
|
||||
* Contact IMA information is stored in the database
|
||||
*
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {number} result 联系人ID
|
||||
* @param {string} uri 数据库地址
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {number} result The contact ID
|
||||
* @param {string} uri The contact ID
|
||||
*/
|
||||
imContact: function (addParams, DAHelper, result, uri) {
|
||||
if (addParams.imAddresses != undefined && addParams.imAddresses.length > 0) {
|
||||
@@ -368,12 +369,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人群组信息存入数据库
|
||||
* The contact group information is saved to the database
|
||||
*
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {number} result 联系人ID
|
||||
* @param {string} uri 数据库地址
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {number} result The contact ID
|
||||
* @param {string} uri The contact ID
|
||||
*/
|
||||
groupsContact: function (addParams, DAHelper, result, uri) {
|
||||
if (addParams.groups != undefined && addParams.groups.length > 0) {
|
||||
@@ -396,12 +397,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人website信息存入数据库
|
||||
* The contact website information is stored in the database
|
||||
*
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {number} result 联系人ID
|
||||
* @param {string} uri 数据库地址
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {number} result The contact ID
|
||||
* @param {string} uri The contact ID
|
||||
*/
|
||||
websiteContact: function (addParams, DAHelper, result, uri) {
|
||||
if (addParams.websites != undefined && addParams.websites.length > 0) {
|
||||
@@ -424,12 +425,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人relation信息存入数据库
|
||||
* Contact Relation information is stored in the database
|
||||
*
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {number} result 联系人ID
|
||||
* @param {string} uri 数据库地址
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {number} result The contact ID
|
||||
* @param {string} uri Database address
|
||||
*/
|
||||
relationsContact: function (addParams, DAHelper, result, uri) {
|
||||
if (addParams.relations != undefined && addParams.relations.length > 0) {
|
||||
@@ -454,37 +455,25 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理联系人数据库字段
|
||||
* Process contact database fields
|
||||
*
|
||||
* @param {Object} resultSet 结果集
|
||||
* @param {Object} contactDetailInfo 联系人详情
|
||||
* @param {Object} actionData 联系人信息
|
||||
* @param {Object} resultSet The result set
|
||||
* @param {Object} contactDetailInfo Contact Details
|
||||
* @param {Object} actionData Contact Information
|
||||
*/
|
||||
dealResult: function (resultSet, contactDetailInfo, actionData) {
|
||||
// 联系人id
|
||||
var contactId = resultSet.getString(resultSet.getColumnIndex('contact_id'));
|
||||
// 收藏字段
|
||||
var favorite = resultSet.getString(resultSet.getColumnIndex('favorite'));
|
||||
// 名称最后一个汉字
|
||||
var nameSuffix = resultSet.getString(resultSet.getColumnIndex('photo_first_name'));
|
||||
// 字段类型
|
||||
var typeText = resultSet.getString(resultSet.getColumnIndex('content_type'));
|
||||
// 字段值
|
||||
var detailInfo = resultSet.getString(resultSet.getColumnIndex('detail_info'));
|
||||
// 姓名
|
||||
var displayName = resultSet.getString(resultSet.getColumnIndex('display_name'));
|
||||
// 姓名
|
||||
var alphaName = resultSet.getString(resultSet.getColumnIndex('alpha_name'));
|
||||
// 拼音
|
||||
var familyNamePhonetic = resultSet.getString(resultSet.getColumnIndex('phonetic_name'));
|
||||
// 标签id
|
||||
var labelId = resultSet.getString(resultSet.getColumnIndex('extend7'));
|
||||
// 自定义标签名
|
||||
var labelName = resultSet.getString(resultSet.getColumnIndex('custom_data'));
|
||||
labelName = labelName ? labelName : '';
|
||||
// 职位
|
||||
var position = resultSet.getString(resultSet.getColumnIndex('position'));
|
||||
// 是否是默认号码
|
||||
var isPrimaryNum = resultSet.getString(resultSet.getColumnIndex('is_preferred_number'));
|
||||
|
||||
contactDetailInfo.emptyNameData = displayName;
|
||||
@@ -496,19 +485,15 @@ export default {
|
||||
contactDetailInfo.favorite = true;
|
||||
contactDetailInfo.starred = 1;
|
||||
}
|
||||
// 如果是搜索,则将匹配类型传出
|
||||
// If it is a search, the match type is passed out
|
||||
if (!Utils.isEmpty(actionData) && actionData.searchMimetype) {
|
||||
if (detailInfo.indexOf(actionData.searchValue) != -1) {
|
||||
contactDetailInfo.searchMimetype.push('/' + typeText);
|
||||
}
|
||||
}
|
||||
// 头像里汉字
|
||||
contactDetailInfo.nameSuffix = nameSuffix;
|
||||
// contactId
|
||||
contactDetailInfo.contactId = contactId;
|
||||
// 头像颜色
|
||||
contactDetailInfo.portraitColor = PortraitColor[contactId % 6];
|
||||
// 背景颜色
|
||||
contactDetailInfo.detailsBgColor = DetailsBgColor[contactId % 6];
|
||||
var dealResultInfo = {
|
||||
'contactId': contactId,
|
||||
@@ -526,150 +511,149 @@ export default {
|
||||
'contactDetailInfo': contactDetailInfo
|
||||
}
|
||||
this.switchTypeText(dealResultInfo);
|
||||
},
|
||||
|
||||
switchTypeText: function (dealResultInfo) {
|
||||
switch (dealResultInfo.typeText) {
|
||||
case 'email':
|
||||
var email = {
|
||||
'email': dealResultInfo.detailInfo,
|
||||
'labelId': dealResultInfo.labelId,
|
||||
'labelName': dealResultInfo.labelName,
|
||||
'showP': true
|
||||
};
|
||||
if (dealResultInfo.contactDetailInfo.emails) {
|
||||
dealResultInfo.contactDetailInfo.emails.push(email);
|
||||
} else {
|
||||
dealResultInfo.contactDetailInfo.emails = [email];
|
||||
}
|
||||
break;
|
||||
case 'im':
|
||||
var imAddress = {
|
||||
'imAddress': dealResultInfo.detailInfo,
|
||||
'labelId': dealResultInfo.labelId,
|
||||
'labelName': dealResultInfo.labelName,
|
||||
'showP': true
|
||||
};
|
||||
if (dealResultInfo.contactDetailInfo.imAddresses) {
|
||||
dealResultInfo.contactDetailInfo.imAddresses.push(imAddress);
|
||||
} else {
|
||||
dealResultInfo.contactDetailInfo.imAddresses = [imAddress];
|
||||
}
|
||||
break;
|
||||
case 'nickname':
|
||||
dealResultInfo.contactDetailInfo.nickName = {
|
||||
'nickName': dealResultInfo.detailInfo
|
||||
};
|
||||
break;
|
||||
case 'organization':
|
||||
dealResultInfo.contactDetailInfo.organization = {
|
||||
'name': dealResultInfo.detailInfo,
|
||||
'title': dealResultInfo.position
|
||||
};
|
||||
break;
|
||||
case 'phone':
|
||||
var phoneNumber = {
|
||||
'isPrimary': dealResultInfo.isPrimaryNum,
|
||||
'labelId': dealResultInfo.labelId,
|
||||
'labelName': dealResultInfo.labelName,
|
||||
'phoneAddress': 'N',
|
||||
'phoneNumber': dealResultInfo.detailInfo,
|
||||
'showP': true,
|
||||
'blueStyle': false
|
||||
};
|
||||
if (dealResultInfo.contactDetailInfo.phoneNumbers) {
|
||||
dealResultInfo.contactDetailInfo.phoneNumbers.push(phoneNumber);
|
||||
} else {
|
||||
dealResultInfo.contactDetailInfo.phoneNumbers = [phoneNumber];
|
||||
}
|
||||
break;
|
||||
case 'name':
|
||||
dealResultInfo.contactDetailInfo.name = {
|
||||
'familyNamePhonetic': dealResultInfo.familyNamePhonetic,
|
||||
'fullName': dealResultInfo.detailInfo,
|
||||
'middleName': '',
|
||||
'givenName': '',
|
||||
'nameSuffix': dealResultInfo.nameSuffix,
|
||||
'alphaName': dealResultInfo.alphaName
|
||||
};
|
||||
break;
|
||||
case 'postal_address':
|
||||
var postalAddress = {
|
||||
'labelId': dealResultInfo.labelId,
|
||||
'labelName': dealResultInfo.labelName,
|
||||
'postalAddress': dealResultInfo.detailInfo,
|
||||
'showP': true
|
||||
};
|
||||
if (dealResultInfo.contactDetailInfo.postalAddresses) {
|
||||
dealResultInfo.contactDetailInfo.postalAddresses.push(postalAddress);
|
||||
} else {
|
||||
dealResultInfo.contactDetailInfo.postalAddresses = [postalAddress];
|
||||
}
|
||||
break;
|
||||
case 'photo':
|
||||
break;
|
||||
case 'group_membership':
|
||||
break;
|
||||
case 'note':
|
||||
dealResultInfo.contactDetailInfo.note = {
|
||||
'noteContent': dealResultInfo.detailInfo
|
||||
};
|
||||
break;
|
||||
case 'contact_event':
|
||||
var event = {
|
||||
'labelId': dealResultInfo.labelId,
|
||||
'labelName': dealResultInfo.labelName,
|
||||
'eventDate': dealResultInfo.detailInfo,
|
||||
'showP': true,
|
||||
'showF': true,
|
||||
'showS': true
|
||||
};
|
||||
if (dealResultInfo.contactDetailInfo.events) {
|
||||
dealResultInfo.contactDetailInfo.events.push(event);
|
||||
} else {
|
||||
dealResultInfo.contactDetailInfo.events = [event];
|
||||
}
|
||||
break;
|
||||
case 'website':
|
||||
var website = {
|
||||
'website': dealResultInfo.detailInfo,
|
||||
'showP': false
|
||||
};
|
||||
if (dealResultInfo.contactDetailInfo.websites) {
|
||||
dealResultInfo.contactDetailInfo.websites.push(website);
|
||||
} else {
|
||||
dealResultInfo.contactDetailInfo.websites = [website];
|
||||
}
|
||||
break;
|
||||
case 'relation':
|
||||
var relation = {
|
||||
'labelId': dealResultInfo.labelId,
|
||||
'labelName': dealResultInfo.labelName,
|
||||
'relationName': dealResultInfo.detailInfo,
|
||||
'showP': true
|
||||
};
|
||||
if (dealResultInfo.contactDetailInfo.relations) {
|
||||
dealResultInfo.contactDetailInfo.relations.push(relation);
|
||||
} else {
|
||||
dealResultInfo.contactDetailInfo.relations = [relation];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
switchTypeText: function (dealResultInfo) {
|
||||
switch (dealResultInfo.typeText) {
|
||||
case 'email':
|
||||
var email = {
|
||||
'email': dealResultInfo.detailInfo,
|
||||
'labelId': dealResultInfo.labelId,
|
||||
'labelName': dealResultInfo.labelName,
|
||||
'showP': true
|
||||
};
|
||||
if (dealResultInfo.contactDetailInfo.emails) {
|
||||
dealResultInfo.contactDetailInfo.emails.push(email);
|
||||
} else {
|
||||
dealResultInfo.contactDetailInfo.emails = [email];
|
||||
}
|
||||
break;
|
||||
case 'im':
|
||||
var imAddress = {
|
||||
'imAddress': dealResultInfo.detailInfo,
|
||||
'labelId': dealResultInfo.labelId,
|
||||
'labelName': dealResultInfo.labelName,
|
||||
'showP': true
|
||||
};
|
||||
if (dealResultInfo.contactDetailInfo.imAddresses) {
|
||||
dealResultInfo.contactDetailInfo.imAddresses.push(imAddress);
|
||||
} else {
|
||||
dealResultInfo.contactDetailInfo.imAddresses = [imAddress];
|
||||
}
|
||||
break;
|
||||
case 'nickname':
|
||||
dealResultInfo.contactDetailInfo.nickName = {
|
||||
'nickName': dealResultInfo.detailInfo
|
||||
};
|
||||
break;
|
||||
case 'organization':
|
||||
dealResultInfo.contactDetailInfo.organization = {
|
||||
'name': dealResultInfo.detailInfo,
|
||||
'title': dealResultInfo.position
|
||||
};
|
||||
break;
|
||||
case 'phone':
|
||||
var phoneNumber = {
|
||||
'isPrimary': dealResultInfo.isPrimaryNum,
|
||||
'labelId': dealResultInfo.labelId,
|
||||
'labelName': dealResultInfo.labelName,
|
||||
'phoneAddress': 'N',
|
||||
'phoneNumber': dealResultInfo.detailInfo,
|
||||
'showP': true,
|
||||
'blueStyle': false
|
||||
};
|
||||
if (dealResultInfo.contactDetailInfo.phoneNumbers) {
|
||||
dealResultInfo.contactDetailInfo.phoneNumbers.push(phoneNumber);
|
||||
} else {
|
||||
dealResultInfo.contactDetailInfo.phoneNumbers = [phoneNumber];
|
||||
}
|
||||
break;
|
||||
case 'name':
|
||||
dealResultInfo.contactDetailInfo.name = {
|
||||
'familyNamePhonetic': dealResultInfo.familyNamePhonetic,
|
||||
'fullName': dealResultInfo.detailInfo,
|
||||
'middleName': '',
|
||||
'givenName': '',
|
||||
'nameSuffix': dealResultInfo.nameSuffix,
|
||||
'alphaName': dealResultInfo.alphaName
|
||||
};
|
||||
break;
|
||||
case 'postal_address':
|
||||
var postalAddress = {
|
||||
'labelId': dealResultInfo.labelId,
|
||||
'labelName': dealResultInfo.labelName,
|
||||
'postalAddress': dealResultInfo.detailInfo,
|
||||
'showP': true
|
||||
};
|
||||
if (dealResultInfo.contactDetailInfo.postalAddresses) {
|
||||
dealResultInfo.contactDetailInfo.postalAddresses.push(postalAddress);
|
||||
} else {
|
||||
dealResultInfo.contactDetailInfo.postalAddresses = [postalAddress];
|
||||
}
|
||||
break;
|
||||
case 'photo':
|
||||
break;
|
||||
case 'group_membership':
|
||||
break;
|
||||
case 'note':
|
||||
dealResultInfo.contactDetailInfo.note = {
|
||||
'noteContent': dealResultInfo.detailInfo
|
||||
};
|
||||
break;
|
||||
case 'contact_event':
|
||||
var event = {
|
||||
'labelId': dealResultInfo.labelId,
|
||||
'labelName': dealResultInfo.labelName,
|
||||
'eventDate': dealResultInfo.detailInfo,
|
||||
'showP': true,
|
||||
'showF': true,
|
||||
'showS': true
|
||||
};
|
||||
if (dealResultInfo.contactDetailInfo.events) {
|
||||
dealResultInfo.contactDetailInfo.events.push(event);
|
||||
} else {
|
||||
dealResultInfo.contactDetailInfo.events = [event];
|
||||
}
|
||||
break;
|
||||
case 'website':
|
||||
var website = {
|
||||
'website': dealResultInfo.detailInfo,
|
||||
'showP': false
|
||||
};
|
||||
if (dealResultInfo.contactDetailInfo.websites) {
|
||||
dealResultInfo.contactDetailInfo.websites.push(website);
|
||||
} else {
|
||||
dealResultInfo.contactDetailInfo.websites = [website];
|
||||
}
|
||||
break;
|
||||
case 'relation':
|
||||
var relation = {
|
||||
'labelId': dealResultInfo.labelId,
|
||||
'labelName': dealResultInfo.labelName,
|
||||
'relationName': dealResultInfo.detailInfo,
|
||||
'showP': true
|
||||
};
|
||||
if (dealResultInfo.contactDetailInfo.relations) {
|
||||
dealResultInfo.contactDetailInfo.relations.push(relation);
|
||||
} else {
|
||||
dealResultInfo.contactDetailInfo.relations = [relation];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 创建名片
|
||||
* Create a business card
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {Object} callBack 联系人ID
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {Object} callBack The contact ID
|
||||
*/
|
||||
addMyCard: function (DAHelper, addParams, callBack) {
|
||||
// 添加联系人
|
||||
// Adding contacts
|
||||
var stringValue = {
|
||||
'display_name': '',
|
||||
};
|
||||
@@ -686,11 +670,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 编辑我的名片
|
||||
* Edit my business card
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {Object} callBack 联系人ID
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {Object} callBack The contact ID
|
||||
*/
|
||||
updateMyCard: function (DAHelper, addParams, callBack) {
|
||||
var condition = new ohosDataAbility.DataAbilityPredicates();
|
||||
@@ -707,11 +691,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 编辑联系人信息
|
||||
* Edit Contact Information
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} addParams 联系人信息
|
||||
* @param {Object} callBack 联系人ID
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} addParams Contact Information
|
||||
* @param {Object} callBack The contact ID
|
||||
*/
|
||||
updateContact: async function (DAHelper, addParams, callBack) {
|
||||
var condition = new ohosDataAbility.DataAbilityPredicates();
|
||||
@@ -722,17 +706,17 @@ export default {
|
||||
).then(data => {
|
||||
this.dealParam(DAHelper, addParams);
|
||||
callBack(addParams.contactId);
|
||||
}).catch(error=>{
|
||||
}).catch(error => {
|
||||
LOG.error(TAG + 'updateContact' + 'update contact error: ' + error);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取我的名片信息
|
||||
* Get my business card information
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {number} contactId 联系人ID
|
||||
* @param {Object} callBack 返回联系人data
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {number} contactId The contact ID
|
||||
* @param {Object} callBack Return contact data
|
||||
*/
|
||||
getCardDetails: function (DAHelper, contactId, callBack) {
|
||||
var resultColumns = [
|
||||
@@ -770,10 +754,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取我的名片的contactId,display_name
|
||||
* Get my business card's contactId,display_name
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} callBack 返回名片详情
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} callBack Return business card Detail
|
||||
*/
|
||||
getMyCardId: function (DAHelper, callBack) {
|
||||
var resultColumns = [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 通话记录model
|
||||
* @file: Call record model
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -23,51 +23,50 @@ import telephony from '@ohos.telephony.call';
|
||||
|
||||
var TAG = 'calllogModel';
|
||||
|
||||
/* 定义通话记录数据库字段 */
|
||||
export const CALL_LOG_DB_COLUMNS = {
|
||||
ID: 'id', // 通话记录id
|
||||
PHONE_NUMBER: 'phone_number', // 电话号码
|
||||
CONTACT_NAME: 'display_name', // 联系人名称
|
||||
CALL_TIME: 'create_time', // 通话记录产生时间
|
||||
CALL_DIRECTION: 'call_direction', // 通话类型:1呼入,2呼出,3未接,5拒接
|
||||
NUMBER_LOCATION: 'number_location', // 号码归属地
|
||||
SIM_ID: 'sim_type', // 通话SIM卡,0:卡1, 1:卡2
|
||||
CALL_HD: 'is_hd', // 是否高清通话 true:高清通话,false:非高清通话
|
||||
FORMAT_NUMBER: 'format_number', // 格式化电话号码
|
||||
IS_READ: 'is_read', // 是否已读
|
||||
RING_TIME: 'ring_duration', // 响铃时长
|
||||
TALK_TIME: 'talk_duration', // 通话时长
|
||||
CONTACT_KEY: 'quicksearch_key', // 联系人id
|
||||
ID: 'id', // Call History ID
|
||||
PHONE_NUMBER: 'phone_number', // The phone number
|
||||
CONTACT_NAME: 'display_name', // Contact Name
|
||||
CALL_TIME: 'create_time', // Time when call records are generated
|
||||
CALL_DIRECTION: 'call_direction', // Call type: 1 Incoming call, 2 Outgoing call, 3 missed call, 5 rejected call
|
||||
NUMBER_LOCATION: 'number_location', // Address of number
|
||||
SIM_ID: 'sim_type', // Call SIM card: 0: card 1, 1: card 2
|
||||
CALL_HD: 'is_hd', // Hd call True: HD call false: non-HD call
|
||||
FORMAT_NUMBER: 'format_number', // Formatting a phone number
|
||||
IS_READ: 'is_read', // Have read
|
||||
RING_TIME: 'ring_duration', // The ring time
|
||||
TALK_TIME: 'talk_duration', // duration
|
||||
CONTACT_KEY: 'quicksearch_key', // The contact ID
|
||||
ANSWER_STATE: 'answer_state',
|
||||
VOICE_MAIL_URI: 'voicemail_uri', // 语音信箱相关
|
||||
VOICE_MAIL_URI: 'voicemail_uri', // Voice mail related
|
||||
}
|
||||
export const ANSWER_STATE = {
|
||||
MISSED_CALLS : 0, // 未接通
|
||||
RECEIVED_CALLS : 1, // 已接通
|
||||
REJECT_CALLS: 2 // 拒接
|
||||
MISSED_CALLS : 0, // Did not get through
|
||||
RECEIVED_CALLS : 1, // Has been switched on
|
||||
REJECT_CALLS: 2 // reject
|
||||
}
|
||||
export const CALL_DIRECTION = {
|
||||
CALL_IN: 0, // 呼入
|
||||
CALL_OUT: 1 // 呼出
|
||||
CALL_IN: 0, // inbound
|
||||
CALL_OUT: 1 // Breathe out
|
||||
}
|
||||
export const CALL_LOG_TYPE = {
|
||||
CALL_LOG_IN: 1, // 呼入
|
||||
CALL_LOG_OUT: 2, // 呼出
|
||||
CALL_LOG_VOICEMAIL: 4, // 语音信箱
|
||||
CALL_LOG_MISSED_CALLS: 3, // 未接
|
||||
CALL_LOG_REJECTED: 5, // 拒接
|
||||
CALL_LOG_IN: 1, // inbound
|
||||
CALL_LOG_OUT: 2, // Breathe out
|
||||
CALL_LOG_VOICEMAIL: 4, // voicemail
|
||||
CALL_LOG_MISSED_CALLS: 3, // Don't answer
|
||||
CALL_LOG_REJECTED: 5, // reject
|
||||
}
|
||||
export default {
|
||||
|
||||
/**
|
||||
* 获取全量(2000条)通话记录,并缓存
|
||||
* Obtain the full number of call records (2000) and cache them
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {string} mergeRule 通话记录类型
|
||||
* @param {Object} callBack 通话记录数据
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {string} mergeRule Call Record Type
|
||||
* @param {Object} callBack Call log data
|
||||
*/
|
||||
getAllCalls:async function(DAHelper, mergeRule, callBack) {
|
||||
// 返回的数据集字段
|
||||
// The returned dataset field
|
||||
var resultColumns = [
|
||||
CALL_LOG_DB_COLUMNS.ID,
|
||||
CALL_LOG_DB_COLUMNS.PHONE_NUMBER,
|
||||
@@ -117,13 +116,13 @@ export default {
|
||||
formattedNumber = resultSet.getString(1);
|
||||
}
|
||||
callLogItem.formatNumber = formattedNumber;
|
||||
callLogItem.contactKey = resultSet.getString(12); // 通话记录所关联的联系人id
|
||||
callLogItem.contactKey = resultSet.getString(12); // Id of a contact associated with call records
|
||||
callLogList.push(callLogItem);
|
||||
if (callLogItem.callType == CALL_LOG_TYPE.CALL_LOG_MISSED_CALLS ||
|
||||
callLogItem.callType == CALL_LOG_TYPE.CALL_LOG_REJECTED) {
|
||||
missedList.push(callLogItem);// 过滤未接来电数据
|
||||
missedList.push(callLogItem);// Filter missed call data
|
||||
let timeList = [];
|
||||
if (mergeRule == 'from_contact') { // 过滤按联系人未接电话后又重拨出
|
||||
if (mergeRule == 'from_contact') { // Filter calls by missed calls and redial calls
|
||||
for (var k = 0; k < missedList.length; k++) {
|
||||
let missedPhone = missedList[k].phone;
|
||||
for (var i = 0; i < callLogList.length; i++) {
|
||||
@@ -173,10 +172,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取语音信箱列表
|
||||
* Gets the voice mailbox list
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} callBack 语音信箱列表
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} callBack Voicemail list
|
||||
*/
|
||||
getVoicemailList: async function(DAHelper, callBack) {
|
||||
var condition = new ohosDataAbility.DataAbilityPredicates();
|
||||
@@ -225,10 +224,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 根据所给的秒数生成00:00类型字符串
|
||||
* Generates a string of type 00:00 based on the number of seconds given
|
||||
*
|
||||
* @param {number} secondsString 一段语音信箱的时间
|
||||
* @return {string} 语音信箱播放的时间
|
||||
* @param {number} secondsString A period of voicemail
|
||||
* @return {string} The time of voice mail playback
|
||||
*/
|
||||
getTimeString(secondsString) {
|
||||
var timeString = '00:00';
|
||||
@@ -244,35 +243,35 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取通话记录类型
|
||||
* Obtain the call record type
|
||||
*
|
||||
* @param {string} callDirection 呼叫类型
|
||||
* @param {string} answerState 通话是否接通
|
||||
* @return {string} 呼出类型
|
||||
* @param {string} callDirection Call type
|
||||
* @param {string} answerState Whether the call is connected
|
||||
* @return {string} Exhale type
|
||||
*/
|
||||
getCallLogType(callDirection, answerState) {
|
||||
if (callDirection == CALL_DIRECTION.CALL_IN) { // 呼入
|
||||
if (answerState == ANSWER_STATE.RECEIVED_CALLS) {// 呼入接通
|
||||
if (callDirection == CALL_DIRECTION.CALL_IN) {
|
||||
if (answerState == ANSWER_STATE.RECEIVED_CALLS) {
|
||||
return CALL_LOG_TYPE.CALL_LOG_IN;
|
||||
}
|
||||
if (answerState == ANSWER_STATE.MISSED_CALLS) {// 呼入未接
|
||||
if (answerState == ANSWER_STATE.MISSED_CALLS) {
|
||||
return CALL_LOG_TYPE.CALL_LOG_MISSED_CALLS
|
||||
}
|
||||
if (answerState == ANSWER_STATE.REJECT_CALLS) {// 呼入拒接
|
||||
if (answerState == ANSWER_STATE.REJECT_CALLS) {
|
||||
return CALL_LOG_TYPE.CALL_LOG_REJECTED;
|
||||
}
|
||||
} else { // 呼出
|
||||
} else {
|
||||
return CALL_LOG_TYPE.CALL_LOG_OUT;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 分页获取通话记录列表
|
||||
* Page to obtain the call history list
|
||||
*
|
||||
* @param {number} pageIndex 页面索引
|
||||
* @param {number} pageSize 一页多少条数据
|
||||
* @param {Array} callLogList 通话记录列表
|
||||
* @return {Array} 通话记录列表
|
||||
* @param {number} pageIndex Page index
|
||||
* @param {number} pageSize How many pieces of data on a page
|
||||
* @param {Array} callLogList Call history list
|
||||
* @return {Array} Call history list
|
||||
*/
|
||||
getCallLog:function(pageIndex, pageSize, callLogList) {
|
||||
var tempList = [];
|
||||
@@ -293,11 +292,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 根据电话号码数组获取这些号码的所有通话记录,用于通话记录详情展示
|
||||
* Obtain all call records of these numbers based on the phone number array for displaying call record details
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Array} phoneNumbers 电话号码
|
||||
* @param {Object} callBack 回调
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Array} phoneNumbers The phone number
|
||||
* @param {Object} callBack The callback
|
||||
*/
|
||||
async getCallLogListByPhoneNumber(DAHelper, phoneNumbers, callBack) {
|
||||
if (Utils.isEmptyList(phoneNumbers)) {
|
||||
@@ -309,7 +308,6 @@ export default {
|
||||
}
|
||||
var condition = new ohosDataAbility.DataAbilityPredicates();
|
||||
condition.in(CALL_LOG_DB_COLUMNS.PHONE_NUMBER, realPhoneNumbers).orderByDesc(CALL_LOG_DB_COLUMNS.CALL_TIME);
|
||||
// 返回的数据集字段
|
||||
var resultColumns = [
|
||||
CALL_LOG_DB_COLUMNS.ID,
|
||||
CALL_LOG_DB_COLUMNS.PHONE_NUMBER,
|
||||
@@ -358,10 +356,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 清空通话记录
|
||||
* Clearing Call History
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} callBack 回调
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} callBack
|
||||
*/
|
||||
clearCallLog(DAHelper, callBack) {
|
||||
var condition = new ohosDataAbility.DataAbilityPredicates();
|
||||
@@ -373,10 +371,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 清空语音信箱
|
||||
* Clearing voice Mail
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} callBack 回调
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} callBack
|
||||
*/
|
||||
clearVoicemailList(DAHelper, callBack) {
|
||||
var condition = new ohosDataAbility.DataAbilityPredicates();
|
||||
@@ -388,12 +386,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 按联系人合并情况下,通过指定的电话号码或联系人id删除通话记录
|
||||
* In the contact merge case, you can delete call records by phone number or contact ID
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Array} phoneNumbers 电话号码
|
||||
* @param {number} contactKeys 联系人ID
|
||||
* @param {Object} callBack 回调
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Array} phoneNumbers
|
||||
* @param {number} contactKeys The contact ID
|
||||
* @param {Object} callBack
|
||||
*/
|
||||
deleteCallLogByNumbersOrContacts:async function(DAHelper, phoneNumbers, contactKeys, callBack) {
|
||||
var condition = new ohosDataAbility.DataAbilityPredicates();
|
||||
@@ -411,11 +409,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 按照id删除指定通话记录
|
||||
* Delete specified call records by ID
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Array} ids 联系人ID
|
||||
* @param {Object} callBack 回调
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Array} ids The contact ID
|
||||
* @param {Object} callBack
|
||||
*/
|
||||
deleteCallLogByIds: async function (DAHelper, ids, callBack) {
|
||||
if (Utils.isEmptyList(ids)) {
|
||||
@@ -428,11 +426,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 按照id删除指定语音信箱记录
|
||||
* Delete specified voice mailbox records by ID
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Array} ids 联系人ID
|
||||
* @param {Object} callBack 回调
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Array} ids The contact ID
|
||||
* @param {Object} callBack
|
||||
*/
|
||||
deleteVoicemailByIds: async function (DAHelper, ids, callBack) {
|
||||
if (Utils.isEmptyList(ids)) {
|
||||
@@ -445,11 +443,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除除指定的ids之外的记录
|
||||
* Deletes records other than the specified IDS
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Array} ids 联系人ID
|
||||
* @param {Object} callBack 回调
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Array} ids The contact ID
|
||||
* @param {Object} callBack
|
||||
*/
|
||||
deleteOtherCallLog(DAHelper, ids, callBack) {
|
||||
if (Utils.isEmptyList(ids)) {
|
||||
@@ -468,10 +466,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 按联系人合并的情况下,在原通话记录数据基础上完善通话记录业务数据后处理
|
||||
* In the case of merging by contact, improve the post-processing of call record service data based on the original call record data
|
||||
*
|
||||
* @param {Array} callLogList 通话记录
|
||||
* @return {Array} 通话记录
|
||||
* @param {Array} callLogList
|
||||
* @return {Array} Call records
|
||||
*/
|
||||
fillCallLogDataMergeByContact: function(callLogList) {
|
||||
var resultList = [];
|
||||
@@ -483,14 +481,14 @@ export default {
|
||||
for (var i = 0; i < callLogList.length; i++) {
|
||||
var element = this.fillServiceProperty(callLogList[i]);
|
||||
element.callTime = this.getCallTime(callLogList[i].callTime);
|
||||
element.num = 1; // 按联系人合并的情况下,合并记录条目固定为1
|
||||
element.ids = [element.id]; // 按联系人合并的情况下,合并记录ids固定为本身id
|
||||
if (Utils.isEmpty(element.contactKey)) { // 没有联系人的通话记录,按照电话号码合并
|
||||
element.num = 1; // In the case of contact merge, the merged record entry is fixed as 1
|
||||
element.ids = [element.id]; // In the case of contact merging, the ids of the merged record is its own ID
|
||||
if (Utils.isEmpty(element.contactKey)) { // If there is no call record of the contact, merge it by phone number
|
||||
if (!phoneNumberMap.has(element.phone)) {
|
||||
resultList.push(element);
|
||||
phoneNumberMap.set(element.phone);
|
||||
}
|
||||
} else { // 有联系人的通话记录,按照联系人合并
|
||||
} else { // If contact call records exist, merge calls based on contacts
|
||||
let isContactKey = contactTempMap.has(element.contactKey);
|
||||
if (!isContactKey) {
|
||||
resultList.push(element);
|
||||
@@ -502,9 +500,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 按时间合并情况下,在原通话记录数据基础上完善通话记录业务数据后处理
|
||||
* In the case of time consolidation, improve the post-processing of call record service data based on the original call record data
|
||||
*
|
||||
* @param callLogList 通话记录
|
||||
* @param callLogList
|
||||
* @return
|
||||
*/
|
||||
fillCallLogDataMergeByTime: function(callLogList) {
|
||||
@@ -512,25 +510,23 @@ export default {
|
||||
if (Utils.isEmptyList(callLogList)) {
|
||||
return resultList;
|
||||
}
|
||||
var tempElement = this.fillServiceProperty(callLogList[0]); // 从第一条记录开始,缓存通话记录
|
||||
var tempCallTime = tempElement.callTime; // 保留最近一条记录的创建时间,在通话记录合并后,显示该时间。
|
||||
var tempCallType = tempElement.callType; // 保留最近一条记录的通话记录类型,在通话记录合并后,显示该类型。
|
||||
var tempElement = this.fillServiceProperty(callLogList[0]); // Caches call records starting from the first record
|
||||
var tempCallTime = tempElement.callTime; // Retain the creation time of the last call record and display the time after the call record is merged.
|
||||
var tempCallType = tempElement.callType; // The type of the latest call record is saved and displayed after the call record is merged.
|
||||
var num = 1;
|
||||
var ids = [];
|
||||
ids.push(callLogList[0].id);
|
||||
for (var i = 1; i < callLogList.length; i++) {
|
||||
var element = callLogList[i];
|
||||
if(this.callLogMergeCheck(tempElement, element)) {// 缓存字段与当前字段校验是否需要合并
|
||||
if(this.callLogMergeCheck(tempElement, element)) {// Check whether the cache field needs to be merged with the current field
|
||||
num++;
|
||||
ids.push(element.id);// 将最新记录id放入合并数组
|
||||
ids.push(element.id);// Puts the latest record ID into the merge array
|
||||
} else {
|
||||
/* 最新数据和缓存不一致,则替换缓存数据的num及ids数据,并将缓存的数据记录放入结果集*/
|
||||
tempElement.num = num;
|
||||
tempElement.ids = ids;
|
||||
tempElement.callTime = this.getCallTime(tempCallTime); // 显示已保存的最近一条记录的创建时间
|
||||
tempElement.callTime = this.getCallTime(tempCallTime); // Displays the creation time of the last saved record
|
||||
tempElement.callType = tempCallType;
|
||||
resultList.push(tempElement);
|
||||
/* 重置num及ids为最新计数及记录 ,重置tempCallTime为下条记录的最新创建时间*/
|
||||
num = 1;
|
||||
ids = [];
|
||||
tempCallTime = element.callTime;
|
||||
@@ -539,7 +535,6 @@ export default {
|
||||
}
|
||||
tempElement = this.fillServiceProperty(element);
|
||||
}
|
||||
/* 将最后一条缓存数据放入结果集*/
|
||||
if (tempElement != null) {
|
||||
tempElement.num = num;
|
||||
tempElement.ids = ids;
|
||||
@@ -551,18 +546,14 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 按时间合并情况下,校验两条通话记录是否需要合并,需要合并返回true,否则返回false
|
||||
* To verify whether two call records need to be merged by time, return true if the call records need to be merged; otherwise return false
|
||||
*
|
||||
* @param oldElement 合并前通话记录
|
||||
* @param newElement 合并后通话记录
|
||||
* @param oldElement Merge call records before
|
||||
* @param newElement Merged call records
|
||||
* @return
|
||||
*/
|
||||
callLogMergeCheck:function(oldElement, newElement){
|
||||
/* 合并规则:
|
||||
1.电话号码相同前提下才会合并。
|
||||
2.号码相同的前提下,呼叫类型为1,2或3,5则合并。1,2和3,5类型不合并。
|
||||
*/
|
||||
if (oldElement.phone.trim() == newElement.phone.trim()) { // 电话号码相同
|
||||
if (oldElement.phone.trim() == newElement.phone.trim()) {
|
||||
if (oldElement.callType == 1||oldElement.callType == 2) {
|
||||
if (newElement.callType == 1 || newElement.callType ==2) {
|
||||
return true;
|
||||
@@ -577,16 +568,16 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加业务所需数据属性
|
||||
* Add data attributes required by the business
|
||||
*
|
||||
* @param element 通话记录
|
||||
* @param element Call records
|
||||
* @return
|
||||
*/
|
||||
fillServiceProperty:function (element) {
|
||||
element.leftDst = 0; // 初始化左移偏移量
|
||||
element.checked = false; // 初始化复选框状态
|
||||
if (element.callType == CALL_LOG_TYPE.CALL_LOG_VOICEMAIL) { // 语音信箱时,初始化额外的语音信箱相关属性
|
||||
element.showMail = false; // 默认不显示语音信箱播放器
|
||||
element.leftDst = 0;
|
||||
element.checked = false;
|
||||
if (element.callType == CALL_LOG_TYPE.CALL_LOG_VOICEMAIL) {
|
||||
element.showMail = false;
|
||||
element.start = '00:00';
|
||||
element.percent = 0;
|
||||
element.playState = 'start';
|
||||
@@ -599,51 +590,43 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取通话时间
|
||||
* Get talk time
|
||||
*
|
||||
* @param date 通话记录创建时间戳
|
||||
* @return {object} 通话时间
|
||||
*/
|
||||
* @param date Call record creation time stamp
|
||||
* @return {object} Talk time
|
||||
*/
|
||||
getCallTime(date) {
|
||||
let result = "";
|
||||
if (isNaN(date)) { // 非数字时,不进行解析
|
||||
if (isNaN(date)) { // If the value is not a number, it is not parsed
|
||||
return date;
|
||||
}
|
||||
var timestamp = parseInt(date)*1000;
|
||||
// 通话时间
|
||||
let callTime = new Date(timestamp);
|
||||
// 当前时间
|
||||
let now = new Date();
|
||||
if (callTime.getTime() > now.getTime()) {
|
||||
result = callTime.getFullYear() + '/' + (callTime.getMonth()+1) + '/' + callTime.getDate();
|
||||
} else if (callTime.getFullYear() == now.getFullYear()) {
|
||||
// 同年
|
||||
if (callTime.getMonth() == now.getMonth()) {
|
||||
// 同年同月
|
||||
let timeDiff = parseInt((now.getTime() - callTime.getTime()) / 60000);
|
||||
let dayDiff = now.getDate() - callTime.getDate();
|
||||
if (dayDiff == 0) {
|
||||
// 同天
|
||||
if (timeDiff == 0) {
|
||||
result = '刚刚';
|
||||
result = this.$t('recordDetail.language.justNow');
|
||||
} else if (timeDiff < 60) {
|
||||
result = timeDiff + '分钟前';
|
||||
result = timeDiff + this.$t('recordDetail.language.minutesAgo');
|
||||
} else {
|
||||
// 'hh:mm'
|
||||
result = callTime.getHours()
|
||||
+ ':' + (callTime.getMinutes() < 10 ? '0' + callTime.getMinutes() : callTime.getMinutes());
|
||||
}
|
||||
} else if (dayDiff == 1) {
|
||||
// 昨天
|
||||
result = '昨天';
|
||||
result = this.$t('recordDetail.language.yesterday');
|
||||
} else {
|
||||
result = (callTime.getMonth()+1) + '/' + callTime.getDate();// 'MM/dd'
|
||||
result = (callTime.getMonth()+1) + '/' + callTime.getDate();
|
||||
}
|
||||
} else {
|
||||
result = (callTime.getMonth()+1) + '/' + callTime.getDate();
|
||||
}
|
||||
} else {
|
||||
// 'yyyy/MM/dd'
|
||||
result = callTime.getFullYear() + '/' + (callTime.getMonth()+1) + '/' + callTime.getDate();
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 联系人详情model
|
||||
* @file: Contact Details Model
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -22,9 +22,7 @@ import LOG from '../utils/ContactsLog.js';
|
||||
import CONSTANTS from '../common/constants/Constants.js';
|
||||
import backgroundColor from '../common/constants/color.js';
|
||||
|
||||
// 头像背景默认颜色
|
||||
var PortraitColor = backgroundColor.Color;
|
||||
// 头像背景深色颜色
|
||||
var DetailsBgColor = backgroundColor.detailColor;
|
||||
|
||||
var TAG = 'contactDetailModel';
|
||||
@@ -32,11 +30,11 @@ var TAG = 'contactDetailModel';
|
||||
export default {
|
||||
|
||||
/**
|
||||
* 获取联系人详细数据
|
||||
* Obtain contact details
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} actionData 联系人数据
|
||||
* @param {Object} callback 联系人详情
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} actionData Contact data
|
||||
* @param {Object} callback Contact Details
|
||||
*/
|
||||
getContactById: function (DAHelper, actionData, callback) {
|
||||
var contactId = actionData.contactId;
|
||||
@@ -60,7 +58,7 @@ export default {
|
||||
condition.equalTo('contact_id', contactId);
|
||||
DAHelper.query(CONSTANTS.uri.CONTACT_DATA_URI, resultColumns, condition).then(resultSet => {
|
||||
var contactDetailInfo = {};
|
||||
// 如果是搜索,则将匹配类型传出
|
||||
// If it is a search, the match type is passed out
|
||||
if (actionData.searchMimetype) {
|
||||
contactDetailInfo.searchMimetype = [];
|
||||
}
|
||||
@@ -78,41 +76,27 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理联系人详细数据
|
||||
* Process contact details
|
||||
*
|
||||
* @param {Object} resultSet 结果集
|
||||
* @param {Object} contactDetailInfo 联系人详情数据
|
||||
* @param {Object} actionData 联系人数据
|
||||
* @param {Object} resultSet
|
||||
* @param {Object} contactDetailInfo Contact Details
|
||||
* @param {Object} actionData Contact data
|
||||
*/
|
||||
dealResult: function (resultSet, contactDetailInfo, actionData) {
|
||||
// 联系人id
|
||||
var contactId = resultSet.getString(resultSet.getColumnIndex('contact_id'));
|
||||
// 联系人id
|
||||
var rawContactId = resultSet.getString(resultSet.getColumnIndex('raw_contact_id'));
|
||||
// 收藏字段
|
||||
var favorite = resultSet.getString(resultSet.getColumnIndex('favorite'));
|
||||
// 名称最后一个汉字
|
||||
var nameSuffix = resultSet.getString(resultSet.getColumnIndex('photo_first_name'));
|
||||
// 字段类型
|
||||
var typeText = resultSet.getString(resultSet.getColumnIndex('content_type'));
|
||||
// 字段值
|
||||
var detailInfo = resultSet.getString(resultSet.getColumnIndex('detail_info'));
|
||||
// 姓名
|
||||
var displayName = resultSet.getString(resultSet.getColumnIndex('display_name'));
|
||||
// 姓名
|
||||
var alphaName = resultSet.getString(resultSet.getColumnIndex('alpha_name'));
|
||||
// 拼音
|
||||
var familyNamePhonetic = resultSet.getString(resultSet.getColumnIndex('phonetic_name'));
|
||||
// 标签id
|
||||
var labelId = resultSet.getString(resultSet.getColumnIndex('extend7'));
|
||||
// 自定义标签名
|
||||
var labelName = resultSet.getString(resultSet.getColumnIndex('custom_data'));
|
||||
labelName = labelName ? labelName : '';
|
||||
// 群组名
|
||||
var groupName = resultSet.getString(resultSet.getColumnIndex('group_name'));
|
||||
// 职位
|
||||
var position = resultSet.getString(resultSet.getColumnIndex('position'));
|
||||
// 是否是默认号码
|
||||
var isPrimaryNum = resultSet.getString(resultSet.getColumnIndex('is_preferred_number'));
|
||||
|
||||
contactDetailInfo.emptyNameData = displayName;
|
||||
@@ -125,22 +109,21 @@ export default {
|
||||
contactDetailInfo.starred = 1;
|
||||
}
|
||||
|
||||
// 如果是搜索,则将匹配类型传出
|
||||
// If it is a search, the match type is passed out
|
||||
if (actionData.searchMimetype) {
|
||||
if (detailInfo.indexOf(actionData.searchValue) != -1 || position.indexOf(actionData.searchValue) != -1) {
|
||||
contactDetailInfo.searchMimetype.push('/' + typeText);
|
||||
}
|
||||
}
|
||||
|
||||
// 头像里汉字
|
||||
contactDetailInfo.nameSuffix = nameSuffix;
|
||||
// contactId
|
||||
|
||||
contactDetailInfo.contactId = contactId;
|
||||
// rawContactId
|
||||
|
||||
contactDetailInfo.rawContactId = rawContactId;
|
||||
// 头像颜色
|
||||
|
||||
contactDetailInfo.portraitColor = PortraitColor[contactId % 6];
|
||||
// 背景颜色
|
||||
|
||||
contactDetailInfo.detailsBgColor = DetailsBgColor[contactId % 6];
|
||||
|
||||
this.determineFieldType(typeText, detailInfo, labelId, labelName, contactDetailInfo, position, isPrimaryNum,
|
||||
@@ -148,19 +131,19 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 确定字段类型
|
||||
* Determine the field type
|
||||
*
|
||||
* @param {string} typeText 字段类型
|
||||
* @param {string} detailInfo 详情数据
|
||||
* @param {number} labelId 类型ID
|
||||
* @param {string} labelName 类型名称
|
||||
* @param {Object} contactDetailInfo 联系人详情数据
|
||||
* @param {string} position 地址
|
||||
* @param {number} isPrimaryNum 是否为默认号码
|
||||
* @param {string} familyNamePhonetic 姓
|
||||
* @param {string} nameSuffix 名
|
||||
* @param {string} groupName 群组名称
|
||||
* @param {string} alphaName 名称
|
||||
* @param {string} typeText
|
||||
* @param {string} detailInfo
|
||||
* @param {number} labelId
|
||||
* @param {string} labelName
|
||||
* @param {Object} contactDetailInfo Contact Details
|
||||
* @param {string} position
|
||||
* @param {number} isPrimaryNum
|
||||
* @param {string} familyNamePhonetic
|
||||
* @param {string} nameSuffix
|
||||
* @param {string} groupName
|
||||
* @param {string} alphaName
|
||||
*/
|
||||
determineFieldType: function (typeText, detailInfo, labelId, labelName, contactDetailInfo, position, isPrimaryNum,
|
||||
familyNamePhonetic, nameSuffix, groupName, alphaName) {
|
||||
@@ -177,7 +160,7 @@ export default {
|
||||
'groupName': groupName,
|
||||
'alphaName': alphaName
|
||||
}
|
||||
// 判断字段类型
|
||||
|
||||
switch (determineInfo.typeText) {
|
||||
case 'email':
|
||||
var email = {
|
||||
@@ -323,11 +306,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 通过电话号码获取该号码的联系人id
|
||||
* Obtain the contact ID of a phone number
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {number} number 手机号号码
|
||||
* @param {Object} callBack 联系人Id
|
||||
* @param {string} DAHelper
|
||||
* @param {number} number
|
||||
* @param {Object} callBack The contact ID
|
||||
*/
|
||||
getContactIdByNumber: async function (DAHelper, number, callBack) {
|
||||
if (Utils.isEmpty(number)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 联系人model
|
||||
* @file: The contact model
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -28,11 +28,11 @@ var TAG = 'contactModel';
|
||||
export default {
|
||||
|
||||
/**
|
||||
* 查询创建的群组
|
||||
* Query the created group
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} data 群组相关数据
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryCustomizeGroups: async function (DAHelper, data, callback) {
|
||||
var defaultData = {
|
||||
@@ -44,7 +44,6 @@ export default {
|
||||
var value = ret == 'false' ? defaultData : JSON.parse(ret);
|
||||
if (value.isCheckedOtherCustomize) {
|
||||
|
||||
// 查询has_group不是1的
|
||||
data.hasGroup = 0;
|
||||
}
|
||||
var groupIds = [];
|
||||
@@ -52,7 +51,6 @@ export default {
|
||||
value.checkedList.forEach(id => {
|
||||
groupIds.push(id);
|
||||
});
|
||||
// 查询在groupIds中的联系人id
|
||||
if (!Utils.isEmptyList(groupIds)) {
|
||||
var actionData = {
|
||||
'groupIds': groupIds
|
||||
@@ -66,11 +64,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询联系人
|
||||
* Querying Contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} data 群组相关数据
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryContacts: async function (DAHelper, data, callback) {
|
||||
var resultColumns = ['id as contactId', 'display_name as emptyNameData', 'sort_first_letter as namePrefix',
|
||||
@@ -130,12 +128,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询联系人数量
|
||||
* Querying the Number of Contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} data 联系人相关数据
|
||||
* @param {Object} result 联系人数据
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} data
|
||||
* @param {Object} result Contact data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryContactsCount: async function (DAHelper, data, result, callback) {
|
||||
var resultColumns = ['id'];
|
||||
@@ -166,11 +164,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人分页
|
||||
* Contact paging
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} data 联系人分页相关数据
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryPageContacts: async function (DAHelper, data, callback) {
|
||||
var resultColumns = ['id as contactId', 'display_name as emptyNameData', 'sort_first_letter as namePrefix',
|
||||
@@ -221,11 +219,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除联系人
|
||||
* Deleting contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} data 联系人数据
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} data Contact data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
deleteContacts: async function (DAHelper, data, callback) {
|
||||
var conditionArgs = new ohosDataAbility.DataAbilityPredicates();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 自定义model
|
||||
* @file: The custom model
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -26,10 +26,10 @@ var TAG = 'customizeModel';
|
||||
export default {
|
||||
|
||||
/**
|
||||
* 查询群组
|
||||
* Query group
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryGroups: async function (DAHelper, callback) {
|
||||
var resultColumns = ['id as id', 'group_name as title'];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 收藏Model
|
||||
* @file: Collect the Model
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -25,13 +25,12 @@ import backgroundColor from '../common/constants/color.js';
|
||||
var TAG = 'favoritesModel';
|
||||
|
||||
export default {
|
||||
|
||||
/**
|
||||
* 查询非收藏联系人
|
||||
* Query unfavorites contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {Object} data 页面最多联系人个数以及是否收藏
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {Object} data Maximum number of contacts on the page and whether to favorites
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryUnFavoritesContacts: async function (DAHelper, data, callback) {
|
||||
var resultColumns = ['id as contactId', 'display_name as emptyNameData', 'sort_first_letter as namePrefix',
|
||||
@@ -65,11 +64,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询收藏联系人
|
||||
* Querying Favorite Contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {Object} data 页面最多联系人个数以及是否收藏
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {Object} data Maximum number of contacts on the page and whether to favorites
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryFavoritesContacts: async function (DAHelper, data, callback) {
|
||||
var resultColumns = ['id as contactId', 'display_name as emptyNameData', 'sort_first_letter as namePrefix',
|
||||
@@ -104,12 +103,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询收藏联系人数量
|
||||
* Query the number of favorite contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {number} star 是否收藏
|
||||
* @param {Object} result 收藏的联系人数据
|
||||
* @param {Object} callback 返回result
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {number} star Whether the collection
|
||||
* @param {Object} result Collected contact data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryFavoriteContactsCount: async function (DAHelper, star, result, callback) {
|
||||
var resultColumns = ['id'];
|
||||
@@ -122,12 +121,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询常用联系人
|
||||
* Querying Common Contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {Object} data 页面最多联系人个数以及是否收藏
|
||||
* @param {Object} result 常用联系人数据
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {Object} data Maximum number of contacts on the page and whether to favorites
|
||||
* @param {Object} result Common Contact Data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryFrequentlyContact: async function (DAHelper, data, result, callback) {
|
||||
var resultColumns = ['type_id as type', 'raw_contact_id as contactId', 'detail_info as detailInfo',
|
||||
@@ -192,12 +191,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 通过联系人ID查询手机号码
|
||||
* Query mobile phone numbers by contact ID
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {number} contactId 联系人ID
|
||||
* @param {Array} phoneNumberLabelNames 手机号码类型名称
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {number} contactId The contact ID
|
||||
* @param {Array} phoneNumberLabelNames
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryPhoneNumByContactId: async function (DAHelper, contactId, phoneNumberLabelNames, callback) {
|
||||
var resultColumns = ['detail_info AS phoneNumber', 'extend7 AS labelId', 'is_preferred_number AS isPrimary'];
|
||||
@@ -234,11 +233,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新联系人收藏状态
|
||||
* Update the favorite status of contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {Object} actionData 联系人数据
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {Object} actionData Contact data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
updateFavoriteState(DAHelper, actionData, callback) {
|
||||
var condition = new ohosDataAbility.DataAbilityPredicates();
|
||||
@@ -267,11 +266,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 取消收藏联系人的收藏
|
||||
* Deselect a favorite contact
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {Object} actionData 联系人数据
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {Object} actionData Contact data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
async removeFavoriteState(DAHelper, actionData, callback) {
|
||||
var condition = new ohosDataAbility.DataAbilityPredicates();
|
||||
@@ -297,14 +296,13 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 收藏点击拨号时设置默认电话
|
||||
* Click to set the default phone number when dialing
|
||||
*
|
||||
* @param {string} DAHelper 数据库名称
|
||||
* @param {Object} actionData 电话数据
|
||||
* @param {Object} callback 返回code
|
||||
* @param {string} DAHelper
|
||||
* @param {Object} actionData
|
||||
* @param {Object} callback
|
||||
*/
|
||||
setOrCancelDefaultPhoneNumber: async function (DAHelper, actionData, callback) {
|
||||
// 通过contactId查询rawContactId
|
||||
var resultColumns = ['id AS rawContactId'];
|
||||
var conditionArgs = new ohosDataAbility.DataAbilityPredicates();
|
||||
conditionArgs.equalTo('contact_id', actionData.contactId);
|
||||
@@ -324,7 +322,6 @@ export default {
|
||||
}
|
||||
var typeId = this.getTypeId(DAHelper, 'phone');
|
||||
if (actionData.isPrimary == 1) {
|
||||
// 设置其他号码为非默认值
|
||||
var params = new ohosDataAbility.DataAbilityPredicates();
|
||||
params.equalTo('type_id', typeId);
|
||||
params.equalTo('raw_contact_id', rawContactIds);
|
||||
@@ -344,7 +341,6 @@ export default {
|
||||
});
|
||||
}
|
||||
|
||||
// 设置当前号码默认值
|
||||
var condition = new ohosDataAbility.DataAbilityPredicates();
|
||||
condition.equalTo('type_id', typeId);
|
||||
condition.equalTo('raw_contact_id', rawContactIds);
|
||||
@@ -368,10 +364,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询群组类型id
|
||||
* Example Query the GROUP type ID
|
||||
*
|
||||
* @param {string} DAHelper 数据库
|
||||
* @param {string} typeText key值
|
||||
* @param {string} DAHelper
|
||||
* @param {string} typeText
|
||||
*/
|
||||
getTypeId: async function (DAHelper, typeText) {
|
||||
var params = new ohosDataAbility.DataAbilityPredicates();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 应答语model
|
||||
* @file: Should answer the model
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -25,11 +25,11 @@ var TAG = 'greetingModel';
|
||||
export default {
|
||||
|
||||
/**
|
||||
* 查询应答语
|
||||
* Inquiries should be answered
|
||||
*
|
||||
* @param {string} DAHelper 数据库
|
||||
* @param {Object} data 页面最大数量
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper The database
|
||||
* @param {Object} data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryGreeting: async function (DAHelper, data, callback) {
|
||||
var resultColumns = ['id', 'name', 'synced'];
|
||||
@@ -58,11 +58,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加应答语
|
||||
* Add answers
|
||||
*
|
||||
* @param {string} DAHelper 数据库
|
||||
* @param {Object} data 应答语名称以及应答语储存路径
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper The database
|
||||
* @param {Object} data Answer name and answer storage path
|
||||
* @param {Object} callback
|
||||
*/
|
||||
insertGreeting: async function (DAHelper, data, callback) {
|
||||
var insertParamValue = {
|
||||
@@ -76,11 +76,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除应答语
|
||||
* Delete answers
|
||||
*
|
||||
* @param {string} DAHelper 数据库
|
||||
* @param {Object} data 应答语名称以及应答语储存路径
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper The database
|
||||
* @param {Object} data Answer name and answer storage path
|
||||
* @param {Object} callback
|
||||
*/
|
||||
deleteGreeting: async function (DAHelper, data, callback) {
|
||||
var conditionArgs = new ohosDataAbility.DataAbilityPredicates();
|
||||
@@ -90,11 +90,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 保存选中的应答语
|
||||
* Save the selected answer
|
||||
*
|
||||
* @param {string} DAHelper 数据库
|
||||
* @param {Object} data 应答语名称以及应答语储存路径
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper The database
|
||||
* @param {Object} data Answer name and answer storage path
|
||||
* @param {Object} callback
|
||||
*/
|
||||
saveCheckedGreeting: async function (DAHelper, data, callback) {
|
||||
var conditionArgs = new ohosDataAbility.DataAbilityPredicates();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 群组model
|
||||
* @file: The model group
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -26,16 +26,15 @@ var TAG = 'groupsModel';
|
||||
export default {
|
||||
|
||||
/**
|
||||
* 添加群组
|
||||
* Add a group
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {string} title 群组title
|
||||
* @param {Object} callback 返回数据
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {string} title
|
||||
* @param {Object} callback
|
||||
*/
|
||||
addGroup: function (DAHelper, title, callback) {
|
||||
this.isSameGroupName(DAHelper, title, data => {
|
||||
if (data) {
|
||||
// 重名
|
||||
callback(-2);
|
||||
} else {
|
||||
var group = {
|
||||
@@ -56,11 +55,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询群组列表
|
||||
* Querying the Group List
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} actionData 查询数据
|
||||
* @param {Object} callback 返回数据
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} actionData
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryGroups: async function (DAHelper, actionData, callback) {
|
||||
var resultColumns = [
|
||||
@@ -97,13 +96,13 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询群组成员id
|
||||
* Example Query the ID of a group member
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} group 群组value
|
||||
* @param {Array} groups 群组value
|
||||
* @param {number} i 查询value
|
||||
* @param {Object} callback 返回数据
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} group
|
||||
* @param {Array} groups
|
||||
* @param {number} i
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryGroupContacts: async function (DAHelper, group, groups, i, callback) {
|
||||
try {
|
||||
@@ -151,16 +150,16 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新群组
|
||||
* Update the group
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} actionData 群组Value
|
||||
* @param {Object} callback 返回数据
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} actionData
|
||||
* @param {Object} callback
|
||||
*/
|
||||
updateGroup: function (DAHelper, actionData, callback) {
|
||||
this.isSameGroupName(DAHelper, actionData.title, data => {
|
||||
if (data) {
|
||||
// 重名
|
||||
// The nuptial
|
||||
callback(-2);
|
||||
} else {
|
||||
var condition = new ohosDataAbility.DataAbilityPredicates();
|
||||
@@ -185,21 +184,19 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除群组
|
||||
* Delete the group
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Array} groupIds 群组ID
|
||||
* @param {Object} callback 返回结果
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Array} groupIds
|
||||
* @param {Object} callback
|
||||
*/
|
||||
deleteGroups: async function (DAHelper, groupIds, callback) {
|
||||
// 删除群组
|
||||
|
||||
var conditionArgs = new ohosDataAbility.DataAbilityPredicates();
|
||||
conditionArgs.in('id', groupIds);
|
||||
var result = await DAHelper.delete(CONSTANTS.uri.GROUPS_URI, conditionArgs);
|
||||
LOG.info(TAG + 'deleteGroups' + 'deleteGroups delete result = ' + result.length);
|
||||
|
||||
|
||||
// 删除群组联系人
|
||||
var typeText = 'group_membership';
|
||||
var condition = new ohosDataAbility.DataAbilityPredicates();
|
||||
condition.equalTo('content_type', typeText).in('detail_info', groupIds);
|
||||
@@ -209,13 +206,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询群组成员ID
|
||||
* Example Query the ID of a group member
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {number} groupId 群组ID
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {number} groupId
|
||||
*/
|
||||
queryGroupMemberIds: async function (DAHelper, groupId) {
|
||||
// 从DATA表查询出来群组成员ID
|
||||
var resultColumns = [
|
||||
'detail_info AS groupId',
|
||||
'raw_contact_id AS contactId'
|
||||
@@ -240,14 +236,13 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询群组内成员列表
|
||||
* Example Query the member list of a group
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} actionData 查询Value值
|
||||
* @param {Object} callback 返回值
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} actionData
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryGroupMembers: async function (DAHelper, actionData, callback) {
|
||||
// 从DATA表查询出来群组成员ID
|
||||
var resultColumns = [
|
||||
'detail_info AS groupId',
|
||||
'raw_contact_id AS contactId'
|
||||
@@ -268,7 +263,7 @@ export default {
|
||||
} else {
|
||||
LOG.info(TAG + 'queryGroupMembers' + 'getOutOfGroupMembers: groupMembers is null.');
|
||||
}
|
||||
// 查询contact表
|
||||
|
||||
var result = {
|
||||
code: 0,
|
||||
resultList: [],
|
||||
@@ -280,8 +275,8 @@ export default {
|
||||
var resultColumns = [
|
||||
'id AS contactId',
|
||||
'display_name AS emptyNameData',
|
||||
'sort_first_letter AS namePrefix', // 字母序列
|
||||
'photo_first_name AS nameSuffix', // 头像里的汉字
|
||||
'sort_first_letter AS namePrefix',
|
||||
'photo_first_name AS nameSuffix',
|
||||
'company AS company',
|
||||
'position AS position',
|
||||
];
|
||||
@@ -316,7 +311,6 @@ export default {
|
||||
result.resultList = contacts;
|
||||
resultSet.close();
|
||||
|
||||
// 查询群组联系人数量
|
||||
LOG.info(TAG + 'queryGroupMembers' + 'start queryGroupContacts count.');
|
||||
var resultColumns = [
|
||||
'detail_info AS groupId',
|
||||
@@ -336,10 +330,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询多个群组内成员列表
|
||||
* Example Query the member lists of multiple groups
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} actionData 查看Value值
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} actionData
|
||||
*/
|
||||
queryGroupsMembers: async function (DAHelper, actionData) {
|
||||
LOG.info(TAG + 'queryGroupsMembers' + 'start queryGroupsMembers.');
|
||||
@@ -371,11 +365,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加群组成员
|
||||
* Adding a Group Member
|
||||
*
|
||||
* @param {string} DAHelper 数据库名称
|
||||
* @param {Object} actionData 添加key/value值
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper
|
||||
* @param {Object} actionData
|
||||
* @param {Object} callback
|
||||
*/
|
||||
addGroupMembers: function (DAHelper, actionData, callback) {
|
||||
LOG.info(TAG + 'addGroupMembers' + 'start addGroupMembers');
|
||||
@@ -385,14 +379,12 @@ export default {
|
||||
};
|
||||
|
||||
if (actionData.isOperationAll) {
|
||||
// 反选的数据
|
||||
let queryParams = {
|
||||
page: 0,
|
||||
limit: 2000,
|
||||
groupId: actionData.groupId
|
||||
};
|
||||
var unCheckContactIds = [];
|
||||
// 正选数据
|
||||
actionData.contactBeans.forEach((contact) => {
|
||||
unCheckContactIds.push(contact.contactId);
|
||||
});
|
||||
@@ -422,7 +414,6 @@ export default {
|
||||
callback();
|
||||
} else {
|
||||
LOG.info(TAG + 'addGroupMembers' + 'addGroupMembers actionData is ' + actionData);
|
||||
// 正选数据
|
||||
|
||||
actionData.contactBeans.forEach((contact) => {
|
||||
contactDataItem.raw_contact_id = contact.contactId;
|
||||
@@ -439,11 +430,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取群组外成员列表
|
||||
* Obtain the list of members outside the group
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} actionData 查询Value值
|
||||
* @param {Object} callback 返回结果
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} actionData
|
||||
* @param {Object} callback
|
||||
*/
|
||||
getOutOfGroupMembers: async function (DAHelper, actionData, callback) {
|
||||
LOG.info(TAG + 'getOutOfGroupMembers' + 'start getOutOfGroupMembers');
|
||||
@@ -476,8 +467,8 @@ export default {
|
||||
resultColumns = [
|
||||
'id AS contactId',
|
||||
'display_name AS emptyNameData',
|
||||
'sort_first_letter AS namePrefix', // 字母序列
|
||||
'photo_first_name AS nameSuffix', // 头像里的汉字
|
||||
'sort_first_letter AS namePrefix',
|
||||
'photo_first_name AS nameSuffix',
|
||||
'company AS company',
|
||||
'position AS position',
|
||||
];
|
||||
@@ -514,7 +505,6 @@ export default {
|
||||
result.resultList = contacts;
|
||||
res.close();
|
||||
|
||||
// 查询群组外联系人数量
|
||||
LOG.info(TAG + 'getOutOfGroupMembers' + 'start queryGroupContacts count.');
|
||||
resultColumns = [
|
||||
'name_raw_contact_id AS contactId'
|
||||
@@ -538,22 +528,20 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 移除群组成员
|
||||
* Removing a Group Member
|
||||
*
|
||||
* @param {string} DAHelper 数据库
|
||||
* @param {Object} actionData 移除值
|
||||
* @param {Object} callback 回调
|
||||
* @param {string} DAHelper The database
|
||||
* @param {Object} actionData
|
||||
* @param {Object} callback
|
||||
*/
|
||||
deleteGroupMembers: async function (DAHelper, actionData, callback) {
|
||||
var typeText = 'group_membership';
|
||||
var typeId = this.getTypeId(DAHelper, typeText);
|
||||
LOG.info(TAG + 'deleteGroupMembers' + 'deleteGroupMembers actionData is ' + actionData);
|
||||
var contactIds = [];
|
||||
// 正选数据
|
||||
actionData.contactBeans.forEach((contact) => {
|
||||
contactIds.push(contact.contactId);
|
||||
});
|
||||
// 移除成员
|
||||
var conditionArgs = new ohosDataAbility.DataAbilityPredicates();
|
||||
if (actionData.isOperationAll) {
|
||||
conditionArgs.equalTo('type_id', typeId).equalTo('detail_info', actionData.groupId + '');
|
||||
@@ -572,11 +560,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询群组成员列表
|
||||
* Example Query the group member list
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} actionData 查询value值
|
||||
* @param {Object} callback 返回数据
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} actionData
|
||||
* @param {Object} callback
|
||||
*/
|
||||
getGroupMemberList: function (DAHelper, actionData, callback) {
|
||||
this.queryGroupMembers(DAHelper, actionData, result => {
|
||||
@@ -644,11 +632,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询最近联系人
|
||||
* Querying Recent Contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} actionData 查询value值
|
||||
* @param {Object} callback 返回数据
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} actionData
|
||||
* @param {Object} callback
|
||||
*/
|
||||
getRecentContacts: function (DAHelper, actionData, callback) {
|
||||
this.queryRecentContacts(DAHelper, actionData, result => {
|
||||
@@ -723,11 +711,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取群里列表和联系人
|
||||
* Get the list and contacts in the group
|
||||
*
|
||||
* @param {string} DAHelper 数据库字段
|
||||
* @param {Object} actionData 查询value值
|
||||
* @param {Object} callback 返回数据
|
||||
* @param {string} DAHelper
|
||||
* @param {Object} actionData
|
||||
* @param {Object} callback
|
||||
*/
|
||||
getGroupListAndContacts: function (DAHelper, actionData, callback) {
|
||||
this.queryGroups(DAHelper, actionData, result => {
|
||||
@@ -755,10 +743,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询群组类型id
|
||||
* Example Query the GROUP type ID
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {string} typeText key值
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {string} typeText key
|
||||
*/
|
||||
getTypeId: async function (DAHelper, typeText) {
|
||||
var params = new ohosDataAbility.DataAbilityPredicates();
|
||||
@@ -778,11 +766,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询最近联系人
|
||||
* Querying Recent Contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} data 查询值
|
||||
* @param {Object} callback 返回数据
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryRecentContacts: async function (DAHelper, data, callback) {
|
||||
LOG.info(TAG + 'addGroup' + 'Model: queryRecentContacts start.');
|
||||
@@ -832,10 +820,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询最近联系人总数
|
||||
* Query the total number of recent contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} callback 返回数据集
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryRecentContactsCount: async function (DAHelper, callback) {
|
||||
var result = {
|
||||
@@ -876,11 +864,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询联系人数量
|
||||
* Querying the Number of Contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库路径
|
||||
* @param {Object} data 查询key数据
|
||||
* @param {Object} callback 查询返回结果
|
||||
* @param {string} DAHelper Database path
|
||||
* @param {Object} data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryContactsCount: async function (DAHelper, data, callback) {
|
||||
var now = Date.now();
|
||||
@@ -905,25 +893,21 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 搜索联系人
|
||||
* Searching for Contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {Object} data 搜索框内容
|
||||
* @param {Object} callback 返回结果
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {Object} data
|
||||
* @param {Object} callback
|
||||
* */
|
||||
searchContacts: async function (DAHelper, data, callback) {
|
||||
var conditionArgs = new ohosDataAbility.DataAbilityPredicates();
|
||||
conditionArgs.equalTo('is_deleted', '0').notEqualTo('content_type', 'relation')
|
||||
.notEqualTo('content_type', 'photo');
|
||||
// 群组界面搜索
|
||||
if (data.groupId > 0) {
|
||||
// 先查询出来群组的所有人id
|
||||
var contactIds = await this.queryGroupMemberIds(DAHelper, data.groupId);
|
||||
// 群组内搜索
|
||||
if (data.searchType == 2) {
|
||||
conditionArgs.in('raw_contact_id', contactIds);
|
||||
} else if (data.searchType == 3) {
|
||||
// 群组外搜索
|
||||
if (contactIds.length > 0) {
|
||||
contactIds.forEach(id => {
|
||||
conditionArgs.notEqualTo('raw_contact_id', id);
|
||||
@@ -933,7 +917,6 @@ export default {
|
||||
LOG.error(TAG + 'addGroup' + 'searchType is error. searchType: ' + data.searchType);
|
||||
}
|
||||
}
|
||||
// 收藏界面搜索
|
||||
if (data.starred == 0 || data.starred == 1) {
|
||||
conditionArgs.and().equalTo('favorite', data.starred);
|
||||
}
|
||||
@@ -954,7 +937,6 @@ export default {
|
||||
},
|
||||
queryData: function (DAHelper,data,conditionArgs,callback) {
|
||||
var resultColumns = ['contact_id AS contactId'];
|
||||
// 匹配到的联系人id
|
||||
var contactIds = [];
|
||||
DAHelper.query(CONSTANTS.uri.SEARCH_CONTACT_URI, resultColumns, conditionArgs).then(resultSet => {
|
||||
LOG.info(TAG + 'addGroup' + 'query contactIds success. resultSet.rowCount is ' + resultSet.rowCount);
|
||||
@@ -986,7 +968,6 @@ export default {
|
||||
LOG.info(TAG + 'addGroup' + 'start getContactById!!!');
|
||||
contactModel.getContactById(DAHelper, actionData, result => {
|
||||
if (!data.pinYinArr || data.pinYinArr.length == 0) {
|
||||
// 删除多余匹配的数组字段;例如电话号码有多个,但是只匹配到一个,则删除其余多余电话号码
|
||||
this.deleteProperties(result.data, data.likeValue);
|
||||
}
|
||||
searchResult.data.push(result.data);
|
||||
@@ -1003,10 +984,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除多余匹配的数组字段;例如电话号码有多个,但是只匹配到一个,则删除其余多余电话号码
|
||||
* Delete array fields that are redundant matches.
|
||||
* For example, if only one of multiple phone numbers is matched, delete the remaining numbers
|
||||
*
|
||||
* @param {Object} detailInfo 删除数量
|
||||
* @param {string} likeValue 删除字段
|
||||
* @param {Object} detailInfo
|
||||
* @param {string} likeValue
|
||||
*/
|
||||
deleteProperties: function (detailInfo, likeValue) {
|
||||
var searchType = detailInfo.searchMimetype[0];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 选择联系人列表Model
|
||||
* @file: Select the contact list Model
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -28,12 +28,12 @@ var TAG = 'selectContactsListModel';
|
||||
export default {
|
||||
|
||||
/**
|
||||
* 删除选中联系人
|
||||
* Deleting selected Contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {boolean} isChecked 是否被选中
|
||||
* @param {Array} contactIds 选中的联系人ID集
|
||||
* @param {Object} callback 返回结果
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {boolean} isChecked
|
||||
* @param {Array} contactIds
|
||||
* @param {Object} callback
|
||||
* */
|
||||
checkedDelete: async function (DAHelper, isChecked, contactIds, callback) {
|
||||
var conditionArgs = new ohosDataAbility.DataAbilityPredicates();
|
||||
@@ -52,11 +52,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询联系人列表
|
||||
* Querying a Contact List
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {Object} actionData 页面数以及一页最大数据量
|
||||
* @param {Object} callback 返回数据结果
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {Object} actionData
|
||||
* @param {Object} callback
|
||||
* */
|
||||
queryContactList: async function (DAHelper, actionData, callback) {
|
||||
var resultColumns = ['id as contactId', 'display_name as emptyNameData', 'sort_first_letter as namePrefix',
|
||||
@@ -89,9 +89,9 @@ export default {
|
||||
callback(result);
|
||||
},
|
||||
|
||||
getTypeId :async function (DAHelper, actionData, callback) {
|
||||
getTypeId: async function (DAHelper, actionData, callback) {
|
||||
let contactIds = [];
|
||||
for(let id of actionData.contactIds) {
|
||||
for (let id of actionData.contactIds) {
|
||||
contactIds.push(id + '');
|
||||
}
|
||||
var resultColumns = [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 选择联系人Model
|
||||
* @file: Select contact Model
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -27,13 +27,13 @@ var TAG = 'selectContactsModel';
|
||||
export default {
|
||||
|
||||
/**
|
||||
* 查询联系人
|
||||
* Querying Contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {Object} callBack 返回数据集
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {Object} callBack
|
||||
*/
|
||||
queryContacts: async function (DAHelper, callBack) {
|
||||
var contactNumberMap = await this.getAllContactNumbers(DAHelper); // 获取所有联系人及其电话号码的Map映射关系
|
||||
var contactNumberMap = await this.getAllContactNumbers(DAHelper);
|
||||
var resultColumns = ['id as contactId', 'display_name as emptyNameData', 'sort_first_letter as namePrefix',
|
||||
'photo_first_name as nameSuffix', 'company as company', 'position as position'];
|
||||
var conditionArgs = new ohosDataAbility.DataAbilityPredicates();
|
||||
@@ -64,12 +64,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询所有联系人手机号
|
||||
* Query all contact phone numbers
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {string} DAHelper Database address
|
||||
*/
|
||||
getAllContactNumbers: async function (DAHelper) {
|
||||
var resultColumns = ['raw_contact_id', 'detail_info', 'extend7'];// extend7代表labelId
|
||||
var resultColumns = ['raw_contact_id', 'detail_info', 'extend7'];
|
||||
var conditionArgs = new ohosDataAbility.DataAbilityPredicates();
|
||||
conditionArgs.equalTo('type_id', '5').orderByAsc('raw_contact_id');
|
||||
var resultSet = await DAHelper.query(Constants.uri.CONTACT_DATA_URI, resultColumns, conditionArgs);
|
||||
@@ -77,22 +77,22 @@ export default {
|
||||
LOG.error(TAG + 'getAllContactNumbers' + ' Selectcontacts Model getAllContactNumbers resultSet is empty!');
|
||||
return new Map();
|
||||
}
|
||||
var contactNumberMap = new Map(); // 用于存储联系人及其电话号码的对应关系
|
||||
var contactNumberMap = new Map();
|
||||
resultSet.goToFirstRow();
|
||||
var oldContact = resultSet.getString(0);
|
||||
var numberList = [];
|
||||
do {
|
||||
var newContact = resultSet.getString(0);
|
||||
if (oldContact == String(newContact)) { // 如果是同一联系人则把手机号放到同一个list中
|
||||
if (oldContact == String(newContact)) {
|
||||
numberList.push({
|
||||
'phoneNumber': resultSet.getString(1),
|
||||
'labelId': resultSet.getString(2)
|
||||
});
|
||||
} else {
|
||||
// 联系人变化时,存储联系人与手机号码列表的对应关系
|
||||
|
||||
contactNumberMap.set(oldContact, numberList);
|
||||
oldContact = newContact;
|
||||
// 将最新的号码数据存储到新的numberList
|
||||
|
||||
numberList = [{
|
||||
'phoneNumber': resultSet.getString(1),
|
||||
'labelId': resultSet.getString(2)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 合并Model
|
||||
* @file Combined Model
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -28,11 +28,11 @@ var TAG = 'mergeModel';
|
||||
export default {
|
||||
|
||||
/**
|
||||
* 查询合并的联系人
|
||||
* Query merged contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库
|
||||
* @param {string} DAHelper The database
|
||||
* @param {null} data null
|
||||
* @param {Object} callback 返回数据集
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryMergeContactsList: async function (DAHelper, data, callback) {
|
||||
var resultColumns = [];
|
||||
@@ -72,11 +72,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询合并的联系人
|
||||
* Query merged contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库
|
||||
* @param {string} DAHelper The database
|
||||
* @param {null} data null
|
||||
* @param {Object} callback 返回数据集
|
||||
* @param {Object} callback
|
||||
*/
|
||||
autoMergeContacts: async function (DAHelper, data, callback) {
|
||||
var conditionArgs = new ohosDataAbility.DataAbilityPredicates();
|
||||
@@ -88,11 +88,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询合并的联系人
|
||||
* Query merged contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库
|
||||
* @param {Object} data 联系人ID集
|
||||
* @param {Object} callback 返回数据集
|
||||
* @param {string} DAHelper The database
|
||||
* @param {Object} data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
mergeContacts: async function (DAHelper, data, callback) {
|
||||
var conditionArgs = new ohosDataAbility.DataAbilityPredicates();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 最近删除model
|
||||
* @file: Recently deleted model
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -24,11 +24,11 @@ var TAG = 'recentlydelModel';
|
||||
export default {
|
||||
|
||||
/**
|
||||
* 查询最近删除联系人
|
||||
* Query recently deleted contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {Object} data 页面数以及页面一页最大数据量
|
||||
* @param {Object} callback 返回数据集
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {Object} data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
queryRecentlyDelContacts: async function (DAHelper, data, callback) {
|
||||
var resultColumns = ['contact_id as contactId', 'display_name as name', 'delete_time as deleteTime'];
|
||||
@@ -66,11 +66,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 清除最近删除联系人
|
||||
* Clear recently deleted contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {Object} data 清除的联系人ID集
|
||||
* @param {Object} callback 返回结果集
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {Object} data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
clearRecentlyDelContacts: async function (DAHelper, data, callback) {
|
||||
var conditionArgs = new ohosDataAbility.DataAbilityPredicates();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 恢复删除联系人model
|
||||
* @file: Restore deleting contact Model
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -25,11 +25,11 @@ var TAG = 'recoverModel';
|
||||
export default {
|
||||
|
||||
/**
|
||||
* 恢复删除联系人
|
||||
* Resume Deleting contacts
|
||||
*
|
||||
* @param {string} DAHelper 数据库地址
|
||||
* @param {Object} data 需要恢复的删除的联系人ID集
|
||||
* @param {Object} callback 返回结果
|
||||
* @param {string} DAHelper Database address
|
||||
* @param {Object} data
|
||||
* @param {Object} callback
|
||||
*/
|
||||
recoverRlyDelContacts: async function (DAHelper, data, callback) {
|
||||
var conditionArgs = new ohosDataAbility.DataAbilityPredicates();
|
||||
|
||||
@@ -15,17 +15,14 @@
|
||||
<element name="dialogscomp" src="../../common/component/dialog/dialog.hml"></element>
|
||||
<div id="callLogContainerId" class="container">
|
||||
|
||||
<!--/* 定义页签容器 */-->
|
||||
<tabs id="callLogTab" class="tabs-records" index="{{tabIndex}}" onchange="changeCallListTab">
|
||||
|
||||
<!-- 定义页签标题,当子组件的宽度大于 -->
|
||||
<tab-bar class="tab-bar-box" mode="fixed" show="{{ showTabTitle }}" id="tabBarBox">
|
||||
<text class="tab-bar-title" id="callLogBarId">{{ $t('value.callRecords.allCalls') }}</text>
|
||||
<text class="tab-bar-title" id="missedCallsBarId">{{ $t('value.callRecords.missedCalls') }}</text>
|
||||
<text if="{{showVoicemail}}" class="tab-bar-title" id="voiceMailBarId">{{ $t('value.callRecords.voiceMails') }}</text>
|
||||
</tab-bar>
|
||||
|
||||
<!-- 定义页签实体部分 -->
|
||||
<tab-content class="tab-content-box" scrollable="false" ontouchmove="touchMoveContent"
|
||||
ontouchend="touchEndContent">
|
||||
<div class="tab-content-container">
|
||||
@@ -42,36 +39,35 @@
|
||||
style="left : {{ ($item.leftDst != undefined && ! this.batchDelete) ? $item.leftDst : 0 }} px;">
|
||||
<div class="allrecords-list-item" on:click.bubble="callLogProcess({{ $idx }}, 0)">
|
||||
|
||||
<!-- 最左侧通话记录标志显示 -->
|
||||
<!-- The leftmost call record flag is displayed -->
|
||||
<div class="allrecords-item-icon-left">
|
||||
|
||||
<!-- 呼入记录 -->
|
||||
<!-- Inbound record -->
|
||||
<image if="{{ $item.callType == 1 }}" id="callInIconId{{ $idx }}"
|
||||
class="allrecords-item-icon-left-image" src="{{ icContactsCallIn }}">
|
||||
</image>
|
||||
|
||||
<!-- 呼出记录 -->
|
||||
<!-- Breathe out record -->
|
||||
<image if="{{ $item.callType == 2 }}" id="callOutIconId{{ $idx }}"
|
||||
class="allrecords-item-icon-left-image" src="{{ icContactsCallOut }}">
|
||||
</image>
|
||||
|
||||
<!-- 语音信箱 -->
|
||||
<!-- voicemail -->
|
||||
<image if="{{ $item.callType == 4 }}" id="callOutIconId{{ $idx }}"
|
||||
class="voicemail-item-icon-left-image"
|
||||
src="{{ icContactsVoicemailMini }}"></image>
|
||||
|
||||
<!-- 拒接来电,未接来电通话记录列表界面不显示状态 -->
|
||||
<!-- Reject calls. The status of missed calls is not displayed on the call record list screen -->
|
||||
<image if="{{ $item.callType == 5 }}" id="callRejectId{{ $idx }}"
|
||||
class="allrecords-item-icon-left-image"
|
||||
src="{{ icContactsCallRejected }}"></image>
|
||||
</div>
|
||||
|
||||
<!-- 中间号码及高清图标 -->
|
||||
|
||||
<div class="allrecords-item-content">
|
||||
<div class="allrecords-item-content-middle-data">
|
||||
<div class="allrecords-item-content-middle-box">
|
||||
|
||||
<!--未接或拒接来电时、文本显示红色-->
|
||||
<text id="callLogTopTextId{{ $idx }}"
|
||||
class="{{
|
||||
($item.callType == 3 || $item.callType == 5) ? 'allrecords-item-content-middle-text-red' : 'allrecords-item-content-middle-text'
|
||||
@@ -114,7 +110,6 @@
|
||||
$item.callTime }}</text>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<div class="allrecords-item-right">
|
||||
<div if="{{ batchDelete }}" class="allrecords-item-right-checkbox"
|
||||
id="callLogCheckBoxId{{ $idx }}">
|
||||
@@ -135,7 +130,7 @@
|
||||
@click="deleteSingleLog({{ $idx }})"></image>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 语音信箱详情相关div -->
|
||||
|
||||
<div class="voicemail-detail" if="{{ $item.showMail }}">
|
||||
<div class="voicemail-progress-box">
|
||||
<text class="voicemail-duration-text-start">{{ $item.start }}</text>
|
||||
@@ -179,10 +174,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 批量删除时,不创建未接来电页签 -->
|
||||
<div class="tab-content-container" if="{{ ! batchDelete }}">
|
||||
|
||||
<!--未/拒接来电列表-->
|
||||
<!--Missed/rejected call list-->
|
||||
<list if="{{ (missedCallLogs.length > 0 && missedCallLogs != undefined) }}" scrollpage="true"
|
||||
scrollbar="auto" class="allrecords-list" scrolleffect="spring"
|
||||
onscrolltop="listScrollTop" onscrollbottom="listScrollBottom"
|
||||
@@ -197,16 +191,13 @@
|
||||
style="left : {{ ($item.leftDst != undefined && ! this.batchDelete) ? $item.leftDst : 0 }} px;">
|
||||
<div class="allrecords-list-item" onclick="callLogProcess({{ $idx }}, 1)">
|
||||
|
||||
<!-- 最左侧通话记录标志显示 -->
|
||||
<div class="allrecords-item-icon-left">
|
||||
|
||||
<!-- 拒接来电 -->
|
||||
<image id="rejectIconId{{ $idx }}" if="{{ $item.callType == 5 }}"
|
||||
class="allrecords-item-icon-left-image"
|
||||
src="{{ icContactsCallRejected }}"></image>
|
||||
</div>
|
||||
|
||||
<!-- 中间号码及高清图标 -->
|
||||
<div class="allrecords-item-content">
|
||||
<div class="allrecords-item-content-middle-data">
|
||||
<div class="allrecords-item-content-middle-box">
|
||||
@@ -248,7 +239,6 @@
|
||||
</text>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节图标-->
|
||||
<div class="allrecords-item-right">
|
||||
<div id="listItemDetail{{ $idx }}" class="allrecords-item-right-image"
|
||||
data="{{ $item.number }}"
|
||||
@@ -289,23 +279,19 @@
|
||||
on:click="clickVoicemailMessage({{ $idx }})">
|
||||
<div class="allrecords-item-icon-left">
|
||||
|
||||
<!-- 语音信箱小图标 -->
|
||||
<image id="rejectIconId{{ $idx }}" class="voicemail-item-icon-left-image"
|
||||
src="{{ icContactsVoicemailMini }}"></image>
|
||||
</div>
|
||||
|
||||
<!-- 中间号码及高清图标 -->
|
||||
<div class="allrecords-item-content">
|
||||
<div class="allrecords-item-content-middle-data">
|
||||
|
||||
<!-- 中间上侧主要号码及联系人名称 -->
|
||||
<div class="allrecords-item-content-middle-box">
|
||||
<text class="allrecords-item-content-middle-text }}">
|
||||
{{ ($item.name == '' || $item.name == undefined || $item.name == null) ? $item.formatNumber : $item.name }}
|
||||
</text>
|
||||
</div>
|
||||
|
||||
<!-- 中间下侧号码归属地,号码类型等相关信息 -->
|
||||
<div class="allrecords-item-content-middle-box">
|
||||
<image if="{{ ($item.simType == 0) && (! singleCardMode) }}"
|
||||
src="{{ icContactsSim1 }}"
|
||||
@@ -325,11 +311,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 中间右侧text记录时间展示 -->
|
||||
<text class="allrecords-item-right-text">{{ $item.callTime }}</text>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标展示-->
|
||||
<div class="allrecords-item-right">
|
||||
<div if="{{ batchDelete }}" class="allrecords-item-right-checkbox">
|
||||
<input type="checkbox" checked="{{ $item.checked }}"
|
||||
@@ -344,7 +328,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 最右侧隐藏的删除图标 -->
|
||||
<div class="allrecords-item-delete one-btn" if="{{ ! batchDelete }}">
|
||||
<image src="{{ icDeleteM }}" class="records-delete-image"
|
||||
on:touchstart.bubble="deleteSingleLog({{ $idx }})">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 通话记录
|
||||
* @file: Call records
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -25,17 +25,16 @@ export default {
|
||||
props: ['allCalls', 'batchDelete', 'missedCallLogs', 'voicemailList', 'singleCardMode', 'showVoicemail'],
|
||||
data: {
|
||||
voicemailIntervalId: 0,
|
||||
tabIndex: 0, // 当前页签页,默认为全部通话(第一页)
|
||||
lastVoicemailDetailIndex: -1, // 记录最后一次显示详情的语音信箱下标。如果后续点击其他的语音信息,则上次打开的详情复原。
|
||||
/* 是否显示tab-bar标题栏 */
|
||||
showTabTitle: false, // 当列表滑动到顶部时,显示出tab-bar,当列表滑动到底部时,隐藏tab-bar
|
||||
tabIndex: 0,
|
||||
lastVoicemailDetailIndex: -1,
|
||||
showTabTitle: false,
|
||||
isFirstTop: true,
|
||||
/* 图标资源 */
|
||||
|
||||
icContactsCallIn: '/res/image/ic_contacts_call_in_mini.svg',
|
||||
icContactsCallMissed: '/res/image/ic_contacts_call_missed_mini.svg',
|
||||
icContactsCallRejected: '/res/image/ic_contacts_call_rejected_mini.svg',
|
||||
icContactsCallOut: '/res/image/ic_contacts_callout_mini.svg',
|
||||
icContactsVoicemailMini: '/res/image/ic_contacts_voicemail_mini.svg', // 语音信箱左侧小图标
|
||||
icContactsVoicemailMini: '/res/image/ic_contacts_voicemail_mini.svg',
|
||||
icContactsSim1: '/res/image/ic_contacts_sim_1_mini.svg',
|
||||
icContactsSim2: '/res/image/ic_contacts_sim_2_mini.svg',
|
||||
icContactsHd: '/res/image/ic_contacts_HD_mini.svg',
|
||||
@@ -43,18 +42,18 @@ export default {
|
||||
icContactsEmptyCallLog: '/res/image/ic_contacts_empty_calllog_72.svg',
|
||||
icContactsEmptyVoicemail: '/res/image/ic_contacts_empty_voicemaile_72.svg',
|
||||
icDeleteM: '/res/image/ic_delete_white.svg',
|
||||
/* 语音信箱UI资源 */
|
||||
|
||||
icVoicemailPlay: '/res/image/ic_play_filled_m.svg',
|
||||
icVoicemailPause: '/res/image/ic_contacts_pause voicemail_m.svg',
|
||||
icVoicemailVolume: '/res/image/ic_volume_m.svg', // 扬声器
|
||||
icVoicemailVolume: '/res/image/ic_volume_m.svg',
|
||||
icVoicemailEarpiece: '/res/image/ic_contacts_Earpiece_m.svg',
|
||||
icVoicemailMessage: '/res/image/ic_massage_m.svg',
|
||||
icVoicemailPhone: '/res/image/ic_phonecall_m_block.svg',
|
||||
icVoicemailDelete: '/res/image/ic_delete_m.svg',
|
||||
/* 是否显示复选框 */
|
||||
|
||||
useCheckBox: true,
|
||||
checked: true,
|
||||
/* 是否需要切换父页面小标题 */
|
||||
|
||||
needSmallTitle: true,
|
||||
touchMoveData: {
|
||||
touchStartX: 0,
|
||||
@@ -64,14 +63,14 @@ export default {
|
||||
isTouchMove: false
|
||||
},
|
||||
listAnimateId: 0,
|
||||
/* 长按通话记录,弹出子菜单信息 */
|
||||
|
||||
callMenuData: {
|
||||
index: '',
|
||||
itemId: [],
|
||||
name: '',
|
||||
number: ''
|
||||
},
|
||||
/* 异步menu加载id */
|
||||
|
||||
showMenuTimeOutId: '',
|
||||
contactCount: 0,
|
||||
contacts: [],
|
||||
@@ -81,9 +80,9 @@ export default {
|
||||
LOG.info(TAG + 'onInit' + 'logMessage: onInit calllog: length = ' + this.allCalls.length);
|
||||
this.$app.$def.globalData.refreshFunctions.push(() => {
|
||||
LOG.info(TAG + 'onInit' + 'logMessage callBack callLog!');
|
||||
if (this.$app.$def.dialerStateData.isGoToMissedCalls) { // 初次跳转到未接来电页签
|
||||
if (this.$app.$def.dialerStateData.isGoToMissedCalls) {
|
||||
this.tabIndex = 1;
|
||||
this.showTabTitle = true;// 显示标签主题
|
||||
this.showTabTitle = true;
|
||||
this.$app.$def.dialerStateData.isGoToMissedCalls = false;
|
||||
}
|
||||
});
|
||||
@@ -98,9 +97,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 播放或者暂停
|
||||
* Play or pause
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {number} index
|
||||
*/
|
||||
startOrPause: function (index) {
|
||||
LOG.info(TAG + 'startOrPause' + 'logMessage startOrPause index = ' + index);
|
||||
@@ -114,7 +113,6 @@ export default {
|
||||
this.voicemailList[index].percent = parseInt(parseFloat(this.voicemailList[index].percentProgress)
|
||||
/ parseFloat(this.voicemailList[index].timeDuration) * 10, 10);
|
||||
|
||||
// 播放完成
|
||||
if (this.voicemailList[index].percentProgress
|
||||
== this.voicemailList[index].timeDuration * 10) {
|
||||
clearInterval(this.voicemailIntervalId);
|
||||
@@ -133,9 +131,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 改变声音大小
|
||||
* Change the volume
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {number} index
|
||||
*/
|
||||
changeVolume: function (index) {
|
||||
LOG.info(TAG + 'changeVolume' + 'logMessage changeVolume index = ' + index);
|
||||
@@ -147,20 +145,17 @@ export default {
|
||||
LOG.info(TAG + 'onInit' + 'logMessage startOrPause voicemailList = ' + this.voicemailList);
|
||||
},
|
||||
deleteVoicemail() {
|
||||
/* 由于显示详情时,已将信息存入this.callMenuData, 此处无需再作其他处理 */
|
||||
this.$element('deleteDialog').show();
|
||||
},
|
||||
/* 长按列表发送短信 */
|
||||
sendMessageByLog() {
|
||||
var params = [];
|
||||
params.push({
|
||||
contactsName: this.callMenuData.name,
|
||||
telephone: this.callMenuData.number.replace(' ','').replace(' ',''),
|
||||
telephone: this.callMenuData.number.replace(' ', '').replace(' ', ''),
|
||||
telephoneFormat: this.callMenuData.number,
|
||||
});
|
||||
this.$app.$def.sendMessage(params);
|
||||
},
|
||||
/* 语音信箱详情呼叫前编辑 */
|
||||
editBeforeByLog() {
|
||||
this.$emit('editCall', {
|
||||
number: this.callMenuData.number,
|
||||
@@ -168,16 +163,16 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击语音信箱信息
|
||||
* Click on a voicemail message
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {number} index
|
||||
*/
|
||||
clickVoicemailMessage: function (index) {
|
||||
this.callMenuData.index = index;
|
||||
this.callMenuData.itemId = this.voicemailList[index].ids;
|
||||
this.callMenuData.name = this.voicemailList[index].name;
|
||||
this.callMenuData.number = this.voicemailList[index].formatNumber;
|
||||
if (this.lastVoicemailDetailIndex != -1 && this.lastVoicemailDetailIndex != index) { // 若已经有其他细节被打开,则隐藏其他细节
|
||||
if (this.lastVoicemailDetailIndex != -1 && this.lastVoicemailDetailIndex != index) {
|
||||
this.voicemailList[this.lastVoicemailDetailIndex].showMail = false;
|
||||
this.voicemailList[this.lastVoicemailDetailIndex].start = '00:00';
|
||||
this.voicemailList[this.lastVoicemailDetailIndex].percent = 0;
|
||||
@@ -185,22 +180,22 @@ export default {
|
||||
}
|
||||
this.voicemailList[index].showMail = !this.voicemailList[index].showMail;
|
||||
if (this.voicemailList[index].showMail) {
|
||||
this.lastVoicemailDetailIndex = index; // 记录打开细节的 item 的下标
|
||||
} else { // 若最终未打开细节,则不记录。
|
||||
this.lastVoicemailDetailIndex = index;
|
||||
} else {
|
||||
this.lastVoicemailDetailIndex = -1;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除单条通话记录
|
||||
* Example Delete a single call record
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {number} index
|
||||
*/
|
||||
deleteSingleLog: function (index) {
|
||||
var tempList = [];
|
||||
if (this.tabIndex == 2) { // 语音信箱列表
|
||||
if (this.tabIndex == 2) {
|
||||
tempList = this.voicemailList;
|
||||
} else if (this.tabIndex == 1) { // 未接来电列表
|
||||
} else if (this.tabIndex == 1) {
|
||||
tempList = this.missedCallLogs;
|
||||
} else {
|
||||
tempList = this.allCalls;
|
||||
@@ -215,50 +210,52 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量删除的情况,点击单条通话记录则选中或取消复选框 非批量删除情况时判断卡1卡2情况拨出电话
|
||||
* In the case of batch deletion, click a call record to select or deselect the check box. In the case of non-batch deletion, dial the call based on card 1 and card 2
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {number} type 类型
|
||||
* @param {number} e 类型
|
||||
* @param {number} index
|
||||
* @param {number} type
|
||||
* @param {number} e
|
||||
*/
|
||||
callLogProcess(index, type, e) {
|
||||
if (this.batchDelete) { // 批量删除的情况,点击单条通话记录则选中或取消复选框
|
||||
if (this.batchDelete) {
|
||||
var checked = !this.allCalls[index].checked;
|
||||
this.changeCheckState(index, {'checked': checked});
|
||||
this.changeCheckState(index, {
|
||||
'checked': checked
|
||||
});
|
||||
|
||||
} else { // 正常点击单条通话记录
|
||||
this.$emit('callProcess', {number: Number(type) === 0 ? this.allCalls[index].formatNumber
|
||||
: this.missedCallLogs[index].formatNumber,});
|
||||
}
|
||||
},
|
||||
|
||||
/* list滑动到页面顶端事件 */
|
||||
listScrollTop() {
|
||||
if (!this.batchDelete) { // 批量删除时,不显示标签栏
|
||||
this.showTabTitle = true; // 显示tab-bar标题栏
|
||||
this.needSmallTitle = true;
|
||||
this.$emit('changeTitle', {
|
||||
type: 0 // 大标题
|
||||
} else {
|
||||
this.$emit('callProcess', {
|
||||
number: Number(type) === 0 ? this.allCalls[index].formatNumber
|
||||
: this.missedCallLogs[index].formatNumber,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
listScrollTop() {
|
||||
if (!this.batchDelete) {
|
||||
this.showTabTitle = true;
|
||||
this.needSmallTitle = true;
|
||||
this.$emit('changeTitle', {
|
||||
type: 0
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/* list滑动到页面底端事件 */
|
||||
listScrollBottom() {
|
||||
this.showTabTitle = false; // 隐藏tab-bar标题栏
|
||||
this.showTabTitle = false;
|
||||
},
|
||||
listScroll(e) {
|
||||
if (this.isFirstTop && e.scrollY < 0 && !this.batchDelete) {
|
||||
this.showTabTitle = true; // 初次加载并且向下滑动时,显示标题栏
|
||||
this.isFirstTop = false; // 回置
|
||||
this.showTabTitle = true;
|
||||
this.isFirstTop = false;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 显示具体通话记录细节
|
||||
* Display specific call history details
|
||||
*
|
||||
* @param {number} id 当前通话记录的ID
|
||||
* @param {Object} e event事件
|
||||
* @param {number} id
|
||||
* @param {Object} e
|
||||
*/
|
||||
showRecordDetails: function (id, e) {
|
||||
this.$emit('showDetails', {
|
||||
@@ -268,23 +265,23 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 改变选中状态
|
||||
* Change the selected state
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {Object} e event事件
|
||||
* @param {number} index
|
||||
* @param {Object} e
|
||||
*/
|
||||
changeCheckState(index, e) {
|
||||
this.$emit('changeChecked', {
|
||||
checked: e.checked,
|
||||
index: index,
|
||||
num: this.allCalls[index].num
|
||||
}); // 将列表参数向上传递到批量删除页面
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 选中通话
|
||||
* Select the call
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {number} index
|
||||
*/
|
||||
selectCall(index) {
|
||||
this.$emit('checkCall', {
|
||||
@@ -292,7 +289,6 @@ export default {
|
||||
index: index
|
||||
});
|
||||
},
|
||||
// 请求通话记录
|
||||
requestCallLog() {
|
||||
this.$emit('requestLog', {});
|
||||
},
|
||||
@@ -301,13 +297,13 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 开始触摸通话list子元素事件
|
||||
* Start touching the Call List child event
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {Object} e event事件
|
||||
* @param {number} index
|
||||
* @param {Object} e
|
||||
*/
|
||||
touchStartListItemDiv(index, e) {
|
||||
if (this.batchDelete) { // 批量删除状态下不触发左滑
|
||||
if (this.batchDelete) {
|
||||
return;
|
||||
}
|
||||
LOG.info(TAG + 'touchStartListItemDiv' + 'logMessage touchStartListItemDiv : ' + e);
|
||||
@@ -321,13 +317,13 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 滑动通话list子元素事件
|
||||
* Slide the call List child event
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {Object} e event事件
|
||||
* @param {number} index
|
||||
* @param {Object} e
|
||||
*/
|
||||
touchMoveListItem(index, e) {
|
||||
if (this.batchDelete) { // 批量删除状态下不触发左滑
|
||||
if (this.batchDelete) {
|
||||
return;
|
||||
}
|
||||
this.$emit('itemTouchMove', {
|
||||
@@ -338,13 +334,13 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 结束触摸通话list子元素事件
|
||||
* End touch Call List child event
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {Object} e event事件
|
||||
* @param {number} index
|
||||
* @param {Object} e
|
||||
*/
|
||||
touchEndListItem(index, e) {
|
||||
if (this.batchDelete) { // 批量删除状态下不触发左滑
|
||||
if (this.batchDelete) {
|
||||
return;
|
||||
}
|
||||
this.$emit('itemTouchEnd', {
|
||||
@@ -355,26 +351,26 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 长按显示单条记录菜单项
|
||||
* Long press to display a single record menu item
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {number} type 类型
|
||||
* @param {number} index
|
||||
* @param {number} type
|
||||
*/
|
||||
showCallMenu(index, type) {
|
||||
if (this.batchDelete) { // 批量删除时,不显示长按菜单
|
||||
if (this.batchDelete) {
|
||||
return;
|
||||
}
|
||||
if (type == 2) { // 语音信箱列表
|
||||
if (type == 2) {
|
||||
this.callMenuData.index = index;
|
||||
this.callMenuData.itemId = this.voicemailList[index].ids;
|
||||
this.callMenuData.name = this.voicemailList[index].name;
|
||||
this.callMenuData.number = this.voicemailList[index].formatNumber;
|
||||
} else if (type == 1) { // 未接来电列表
|
||||
} else if (type == 1) {
|
||||
this.callMenuData.index = index;
|
||||
this.callMenuData.itemId = this.missedCallLogs[index].ids;
|
||||
this.callMenuData.name = this.missedCallLogs[index].name;
|
||||
this.callMenuData.number = this.missedCallLogs[index].formatNumber;
|
||||
} else { // 通话记录列表
|
||||
} else {
|
||||
this.callMenuData.index = index;
|
||||
this.callMenuData.itemId = this.allCalls[index].ids;
|
||||
this.callMenuData.name = this.allCalls[index].name;
|
||||
@@ -383,11 +379,10 @@ export default {
|
||||
var tempX = this.touchMoveData.touchStartX;
|
||||
var tempY = this.touchMoveData.touchStartY;
|
||||
|
||||
/* 控制菜单在屏幕的左右及上下的出现位置,数字代表的为逻辑像素px */
|
||||
if (this.touchMoveData.touchStartX > 360) {
|
||||
tempX = 360;
|
||||
}
|
||||
if (this.callMenuData.name == '' || this.callMenuData.name == undefined) { // 无联系人姓名
|
||||
if (this.callMenuData.name == '' || this.callMenuData.name == undefined) {
|
||||
if ((tempX > 320 && tempX < 330) && tempY > 450) {
|
||||
tempY = 450;
|
||||
} else if (tempX < 320 && tempY > 510) {
|
||||
@@ -395,11 +390,11 @@ export default {
|
||||
} else if (tempY > 420) {
|
||||
tempY = 420;
|
||||
}
|
||||
} else { // 有联系人
|
||||
} else {
|
||||
tempY = tempY > 700 ? 700 : tempY;
|
||||
}
|
||||
clearTimeout(this.showMenuTimeOutId);
|
||||
/* 此处需要异步延时显示菜单,否则值刷新不过来 */
|
||||
|
||||
this.showMenuTimeOutId = setTimeout(() => {
|
||||
this.$element('callLogMenu').show({
|
||||
x: tempX,
|
||||
@@ -409,20 +404,20 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 长按菜单项各操作处理
|
||||
* Long press the menu item to process each operation
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
onCallMenuSelected(e) {
|
||||
switch (parseInt(e.value, 10)) {
|
||||
case 1: // 新建联系人this.callMenuData.number,
|
||||
case 1:
|
||||
router.push({
|
||||
uri: 'pages/contacts/accountants/accountants',
|
||||
params: {
|
||||
phoneNumbers: [
|
||||
{
|
||||
'labelId': 2,
|
||||
'labelName': '手机',
|
||||
'labelName': this.$t('accountants.phone'),
|
||||
'phoneNumber': this.callMenuData.number,
|
||||
'phoneAddress': 'N',
|
||||
'showP': true,
|
||||
@@ -432,7 +427,7 @@ export default {
|
||||
},
|
||||
});
|
||||
break;
|
||||
case 2: // 保存至已有联系人
|
||||
case 2:
|
||||
router.push({
|
||||
uri: 'pages/contacts/selectContactsList/selectContactsList',
|
||||
params: {
|
||||
@@ -441,23 +436,22 @@ export default {
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 3: // 发送信息
|
||||
case 3:
|
||||
this.sendMessageByLog();
|
||||
break;
|
||||
case 4: // 复制号码
|
||||
case 4:
|
||||
this.$emit('copyNumber', {
|
||||
number: this.callMenuData.number
|
||||
});
|
||||
break;
|
||||
case 5: // 呼叫前编辑
|
||||
/* 将号码传递给上层组件dialer */
|
||||
case 5: // Pre-call editing
|
||||
this.$emit('editCall', {
|
||||
number: this.callMenuData.number,
|
||||
});
|
||||
break;
|
||||
case 6: // 加入黑名单
|
||||
case 6: // Add to the blacklist
|
||||
break;
|
||||
case 7: // 删除通话记录
|
||||
case 7: // Deleting Call History
|
||||
this.$element('deleteDialog').show();
|
||||
break;
|
||||
default:
|
||||
@@ -472,21 +466,18 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 监测滑动距离判断拨号盘是否需要隐藏
|
||||
* Monitor the sliding distance to determine whether the dial needs to be hidden
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
touchMoveContent(e) {
|
||||
/* 向下滑屏距离大于100px时,显示标题 */
|
||||
if (e.touches[0].globalY - this.touchMoveData.touchStartY > 100 && !this.touchMoveData.isTouchMove) {
|
||||
/* 隐藏拨号盘 */
|
||||
this.$emit('hideDialer', {});
|
||||
if (!this.batchDelete && this.allCalls.length > 0) {
|
||||
this.showTabTitle = true;
|
||||
}
|
||||
this.touchMoveData.isTouchMove = true;
|
||||
}
|
||||
/* 向上滑屏距离大于100px时,隐藏标题 */
|
||||
if ((e.touches[0].globalY - this.touchMoveData.touchStartY < -100) && this.allCalls.length > 0
|
||||
&& !this.touchMoveData.isTouchMove) {
|
||||
this.$emit('hideDialer', {});
|
||||
@@ -505,23 +496,22 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 通话记录与未接来电切换事件
|
||||
* Call history and missed call switchover event
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
changeCallListTab(e) {
|
||||
this.tabIndex = e.index; // 设置当前通话记录页签为所切换的页签。
|
||||
this.tabIndex = e.index;
|
||||
this.$emit('changeLog', {
|
||||
logIndex: e.index,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 参数说明:
|
||||
* Parameters that:
|
||||
*
|
||||
* 截取字符串的前五个字符外加.. 例如:'哈哈哈哈哈哈哈哈' => '哈哈哈哈哈..'
|
||||
* @param {string} str 对象字符串
|
||||
* @return {string} newStr 截取之后的字符串
|
||||
* @param {string} str
|
||||
* @return {string} newStr
|
||||
*/
|
||||
subStringWithEllipsis(str) {
|
||||
let newLength = 0;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
/* 页签标题样式盒 */
|
||||
|
||||
.tab-bar-box {
|
||||
width: 72%;
|
||||
height: 100px;
|
||||
@@ -37,7 +37,7 @@
|
||||
animation-duration: 3000ms;
|
||||
animation-delay: 0ms;
|
||||
}
|
||||
/* tab-bar 被激活时,标题文本显示为蓝色 */
|
||||
|
||||
.tab-bar-box text:active{
|
||||
font-weight: 600;
|
||||
color: $textColorTabBar;
|
||||
@@ -75,7 +75,7 @@
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
/* list-item 子组件 */
|
||||
|
||||
.allrecords-item-icon-left {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -89,7 +89,7 @@
|
||||
flex-grow:1;
|
||||
align-items: flex-start;
|
||||
}
|
||||
/* 联系人item项右侧时间及细节图标 */
|
||||
|
||||
.allrecords-item-right {
|
||||
height: 100%;
|
||||
width:130px;
|
||||
@@ -172,16 +172,7 @@
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
/*#callsListItem0 {
|
||||
width: 120%;
|
||||
height: 12%;
|
||||
padding-top: 14px;
|
||||
padding-bottom: 15px;
|
||||
animation-name: displayDeleteButton;
|
||||
animation-fill-mode: forwards;
|
||||
animation-duration: 3000ms;
|
||||
animation-delay: 1000ms;
|
||||
}*/
|
||||
|
||||
.allrecords-list-item-delete {
|
||||
width: 120%;
|
||||
height: 12%;
|
||||
@@ -234,7 +225,7 @@
|
||||
width:50px;
|
||||
height:50px;
|
||||
}
|
||||
/* 进度条两侧的时间文本 */
|
||||
|
||||
.voicemail-duration-text-start {
|
||||
color:gray;
|
||||
width:130px;
|
||||
@@ -312,8 +303,6 @@
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* 未接来电项 */
|
||||
|
||||
.tab-content-no-missed-calls {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
.text-style {
|
||||
margin-top: 30px;
|
||||
align-items: center;
|
||||
margin-left: 15px;/* font-weight:600;*/
|
||||
margin-left: 15px;
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
width: 100%;
|
||||
height: 160px;
|
||||
margin-left: 25px;
|
||||
margin-right: 25px;/* margin-top: 20px;*/
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
||||
.title-image {
|
||||
@@ -58,7 +58,7 @@
|
||||
}
|
||||
|
||||
.button-click:active {
|
||||
background-color: lightgray;
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
.title-image:disabled {
|
||||
@@ -111,6 +111,7 @@
|
||||
align-items: center;
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
.const-note {
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
@@ -136,7 +137,7 @@
|
||||
|
||||
.const-text-sub {
|
||||
font-size: 26px;
|
||||
color: darkgrey;
|
||||
color: #a9a9a9;
|
||||
}
|
||||
|
||||
.const-div-div {
|
||||
@@ -305,14 +306,14 @@
|
||||
width: 100%;
|
||||
flex-direction: row;
|
||||
background-color: transparent;
|
||||
color: grey;
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.right-image {
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
border-radius: 25px;
|
||||
background-color: darkgrey;
|
||||
background-color: #a9a9a9;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 30px;
|
||||
}
|
||||
@@ -321,7 +322,7 @@
|
||||
height: 50px;
|
||||
width: 55px;
|
||||
border-radius: 25px;
|
||||
background-color: darkgrey;
|
||||
background-color: #a9a9a9;
|
||||
|
||||
}
|
||||
|
||||
@@ -395,7 +396,7 @@ delete-txt {
|
||||
|
||||
.card-test-div {
|
||||
height: 50%;
|
||||
color: grey;
|
||||
color: #6c6c6c;
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/-->
|
||||
<!--新建联系人-->
|
||||
<!--Creating a Contact-->
|
||||
<div class="container">
|
||||
<div id="title" class="title">
|
||||
<div class="button-click" ontouchend="back">
|
||||
@@ -37,7 +37,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 姓名 1 -->
|
||||
<list-item id="name" class="const-fisrt" clickeffect="false">
|
||||
<div class="const-image-div">
|
||||
<image class="fisrt-image" src="/res/image/name.svg"></image>
|
||||
@@ -49,7 +48,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 2 姓名拼音-->
|
||||
<list-item id="letter" class="{{ flexInputStyle }}" show="{{ LetterShow }}">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
</div>
|
||||
@@ -60,7 +58,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- middleName-中间名-->
|
||||
<list-item id="MiddleName" class="{{ flexInputStyle }}" show="{{ usStatus }}" clickeffect="false">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
</div>
|
||||
@@ -71,7 +68,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- givenName-中间名-->
|
||||
<list-item id="givenName" class="{{ flexInputStyle }}" show="{{ usStatus }}" clickeffect="false">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
</div>
|
||||
@@ -82,7 +78,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 3 公司-->
|
||||
<list-item id="company" class="{{ flexInputStyle }}" clickeffect="false">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
<image class="{{ flexImageSize }}" src="/res/image/company.svg"></image>
|
||||
@@ -94,7 +89,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 4 职务 -->
|
||||
<list-item id="work" class="{{ flexInputStyle }}"
|
||||
show="{{ contactForm.organization.title.length > 0 || showWork }}" clickeffect="false">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
@@ -106,7 +100,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!--手机 -->
|
||||
<list-item class="const-fisrt" id="phoneList{{ $idx }}" for="{{ contactForm.phoneNumbers }}"
|
||||
clickeffect="false">
|
||||
<div class="const-image-div">
|
||||
@@ -136,7 +129,7 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!--添加更多号码 -->
|
||||
<!--Adding More Numbers -->
|
||||
<list-item id="morePhone" class="const-fisrt" ontouchend="addNumber" show="{{ phonShow }}">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
</div>
|
||||
@@ -146,14 +139,12 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!--个人Email6 "-->
|
||||
<list-item id="emaillist{{ $idx }}" for="{{ contactForm.emails }}" tid="id" clickeffect="false">
|
||||
<div class="{{ flexInputStyle }}">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
<image class="{{ flexImageSize }}" src="/res/image/email.svg" show="{{ $idx==0 }}"></image>
|
||||
</div>
|
||||
<div class="{{ flexCenterSize }}">
|
||||
<!-- 可选择私人、单位、其他、自定义 -->
|
||||
<select data="{{ $item.labelId }}" onchange="selectChange('2',{{ $idx }})">
|
||||
<option value="1" selected="{{ $item.labelId == 1 }}">{{ $t('accountants.private') }}</option>
|
||||
<option value="2" selected="{{ $item.labelId == 2 }}">{{ $t('accountants.unit') }}</option>
|
||||
@@ -174,7 +165,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!--添加邮件-->
|
||||
<list-item id="moremails" class="const-fisrt" ontouchend="addEmail" show="{{ emailShow }}">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
</div>
|
||||
@@ -184,7 +174,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 备注-->
|
||||
<list-item id="note" class="{{ flexInputStyle }}" clickeffect="false">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
<image class="{{ flexImageSize }}" src="/res/image/note.svg"></image>
|
||||
@@ -199,7 +188,7 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 加入群组show ="{{!(carteFlag || updateCard)}}"-->
|
||||
<!-- Join a Group show ="{{!(carteFlag || updateCard)}}"-->
|
||||
<list-item id="groupId" class="{{ flexInputStyle }}" onclick="onGroup" show="{{ ! (carteFlag || updateCard) }}">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
<image class="{{ flexImageSize }}" src="/res/image/group.svg"></image>
|
||||
@@ -213,7 +202,7 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!--即时消息 -->
|
||||
<!--Instant messaging -->
|
||||
<list-item id="message{{ $idx }}" for="{{ contactForm.imAddresses }}" tid="id" show="{{ upMessShow }}"
|
||||
clickeffect="false">
|
||||
<div class="{{ flexInputStyle }}">
|
||||
@@ -249,7 +238,7 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!--添加更多即时消息-->
|
||||
<!--Add more instant messages-->
|
||||
<list-item id="moremessage" class="const-fisrt" ontouchend="addMess" show="{{messShow}}">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
</div>
|
||||
@@ -259,7 +248,7 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 电话铃声 -->
|
||||
<!-- The phone ringing -->
|
||||
<list-item class="{{ flexInputStyle }}" show="false">>
|
||||
<div class="{{ flexImageStyle }}">
|
||||
<image class="{{ flexImageSize }}" src="/res/image/company.svg"></image>
|
||||
@@ -270,7 +259,6 @@
|
||||
|
||||
</list-item>
|
||||
|
||||
<!-- 住宅 -->
|
||||
<list-item id="house{{ $idx }}" class="{{ flexInputStyle }}" for="{{ contactForm.postalAddresses }}" tid="id"
|
||||
show="{{ contactForm.postalAddresses[0].postalAddress || upHouseShow }}" clickeffect="false">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
@@ -279,7 +267,6 @@
|
||||
<div class="{{ flexCenterSize }}">
|
||||
<select data="{{ $item.labelId }}" onchange="selectChange('4',{{ $idx }})">
|
||||
|
||||
<!-- 住宅、单位、其他、自定义-->
|
||||
<option value="1" selected="{{ $item.labelId == 1 }}">{{ $t('accountants.house') }}</option>
|
||||
<option value="2" selected="{{ $item.labelId == 2 }}">{{ $t('accountants.unit') }}</option>
|
||||
<option value="3" selected="{{ $item.labelId == 3 }}">{{ $t('accountants.others') }}</option>
|
||||
@@ -298,7 +285,6 @@
|
||||
|
||||
</list-item>
|
||||
|
||||
<!--添加地址-->
|
||||
<list-item id="morehouse" class="const-fisrt" ontouchend="addHouse" show="{{ houseShow }}">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
</div>
|
||||
@@ -308,7 +294,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!--昵称-->
|
||||
<list-item id="nick" class="{{ flexInputStyle }}" show="{{ contactForm.nickName.nickName || upNickShow }}"
|
||||
clickeffect="false">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
@@ -324,7 +309,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 网站 -->
|
||||
<list-item id="websites{{ $idx }}" class="{{ flexInputStyle }}" for="{{ contactForm.websites }}"
|
||||
show="{{ contactForm.websites[0].website || upWebShow }}" clickeffect="false">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
@@ -342,7 +326,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!--添加website-->
|
||||
<list-item id="morewebsites" class="const-fisrt" ontouchend="addWebsite" show="{{ websiteShow }}">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
</div>
|
||||
@@ -352,7 +335,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!--生日 生日、农历生日、周年纪念、其他重要日期 -->
|
||||
<list-item for="{{ contactForm.events }}" id="events{{ $idx }}" class="{{ flexInputStyle }}" tid="id"
|
||||
show="{{ upBirthShow }}" clickeffect="false">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
@@ -362,7 +344,6 @@
|
||||
<div class="{{ flexCenterSize }}">
|
||||
<select data="{{ $item.birthType }}" onchange="getBirType({{ $idx }})" id="{{ $idx }}">
|
||||
|
||||
<!-- 3生日、2农历生日、1周年纪念、4其他重要日期 "Lunar Birthday": "农历生日","Anniversary": "周年纪念日"-->
|
||||
<option value="3" selected="{{ $item.labelId == 3 }}" show="{{ $item.showF }}">
|
||||
{{ $t('accountants.birth') }}</option>
|
||||
<option value="2" selected="{{ $item.labelId == 2 }}" show="{{ $item.showS }}">
|
||||
@@ -379,7 +360,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 其他重要日期-->
|
||||
<list-item id="moredate" class="const-fisrt" onclick="addBirth" show="{{ birthShow }}">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
</div>
|
||||
@@ -389,14 +369,12 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 助理 -->
|
||||
<list-item id="relation{{ $idx }}" class="{{ flexInputStyle }}" for="{{ contactForm.relations }}" tid="id"
|
||||
clickeffect="false" show="{{ contactForm.relations[0].relationName || upAssShow }}">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
<image class="{{ flexImageSize }}" src="/res/image/assistant.svg" show="{{ $idx==0 }}"></image>
|
||||
</div>
|
||||
|
||||
<!-- 助理、兄弟、子女、伴侣、父亲、朋友、上司、母亲、父母、合作伙伴、介绍人、亲属、姐妹,配偶,自定义-->
|
||||
<div class="{{ flexCenterSize }}">
|
||||
<select data="{{ $item.labelId }}" onchange="selectChange('5',{{ $idx }})">
|
||||
<option value="1" selected="{{ $item.labelId == 1 }}">{{ $t('accountants.assistant') }}</option>
|
||||
@@ -427,7 +405,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 更多关系-->
|
||||
<list-item id="moreass" class="const-fisrt" ontouchend="addAss" show="{{ assisShow }}">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
</div>
|
||||
@@ -437,7 +414,7 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!--添加更多项-->
|
||||
<!--Add more items-->
|
||||
<list-item id="moreshow" class="{{ flexInputStyle }}" show="{{ MoreDivStatus }}">
|
||||
<div class="{{ flexImageStyle }}">
|
||||
</div>
|
||||
@@ -463,7 +440,7 @@
|
||||
<list-item class="item-padding-bottom"></list-item>
|
||||
</list>
|
||||
|
||||
<!--自定义弹窗-->
|
||||
<!--Custom pop-ups-->
|
||||
<dialog id="simpledialog" class="dialog-main">
|
||||
<div class="dialog-div">
|
||||
<div class="inner-txt">
|
||||
@@ -480,7 +457,7 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!--是否保存修改弹窗-->
|
||||
<!--Whether to save the modification popover-->
|
||||
<dialog id="reset" class="delete-main" oncancel="cancelDialog">
|
||||
<div class="delete-div">
|
||||
<text class="txt-v">{{ $t('accountants.dosave') }}</text>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 新建联系人
|
||||
* @file Creating a Contact
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -28,65 +28,51 @@ var TAG = ' accountants...: ';
|
||||
|
||||
export default {
|
||||
data: {
|
||||
// 新增联系人状态
|
||||
// New Contact Status
|
||||
addShow: true,
|
||||
// 编辑联系人状态
|
||||
// Editing contact Status
|
||||
updataShow: false,
|
||||
// 名片
|
||||
// Business card
|
||||
carteFlag: false,
|
||||
// 编辑名片
|
||||
// Edit card
|
||||
updateCard: false,
|
||||
/*电话号码展示*/
|
||||
phonShow: false,
|
||||
/*添加更多选项div的状态*/
|
||||
MoreDivStatus: true,
|
||||
// 拼音状态
|
||||
// State of pinyin
|
||||
LetterShow: false,
|
||||
// 即时消息状态
|
||||
// Instant Message Status
|
||||
upMessShow: false,
|
||||
// 铃声状态
|
||||
// The bell state
|
||||
upRingShow: false,
|
||||
// 住宅状态
|
||||
// Residential status
|
||||
upHouseShow: false,
|
||||
// 昵称状态
|
||||
// The nickname status
|
||||
upNickShow: false,
|
||||
// 网址状态
|
||||
// Site condition
|
||||
upWebShow: false,
|
||||
// 生日状态
|
||||
// State of birthday
|
||||
upBirthShow: false,
|
||||
// 助理
|
||||
// assistant
|
||||
upAssShow: false,
|
||||
/**职务隐藏**/
|
||||
showWork: false,
|
||||
/**保存图标状态控制*/
|
||||
isEmpty: false,
|
||||
|
||||
/**div*/
|
||||
flexInputStyle: 'const-fisrt',
|
||||
flexImageStyle: 'const-image-div',
|
||||
flexImageSize: 'fisrt-image',
|
||||
flexInputSize: 'font-color-first',
|
||||
flexInputFont: 'font-color-note',
|
||||
flexCenterSize: 'text-note',
|
||||
ringText: '', // 电话铃声
|
||||
ringText: '',
|
||||
id: 0,
|
||||
// 添加多个email状态
|
||||
emailShow: false,
|
||||
// 添加多个即时消息装
|
||||
messShow: false,
|
||||
// 添加多个住宅状态
|
||||
houseShow: false,
|
||||
// 添加多个网址状态
|
||||
websiteShow: false,
|
||||
// 添加多个助理状态
|
||||
assisShow: false,
|
||||
// 群组list
|
||||
groups: [],
|
||||
// 新增至已有联系人
|
||||
saveContact: false,
|
||||
// 新增已有联系热number
|
||||
phoneNumber: '',
|
||||
// 页面显示群组值
|
||||
groupContext: '',
|
||||
emails: [
|
||||
{
|
||||
@@ -158,7 +144,7 @@ export default {
|
||||
'familyName': '',
|
||||
'middleName': '',
|
||||
'familyNamePhonetic': '',
|
||||
'alphaName':''
|
||||
'alphaName': ''
|
||||
},
|
||||
nickName: {
|
||||
'nickName': ''
|
||||
@@ -173,7 +159,6 @@ export default {
|
||||
birthShow: false,
|
||||
showF: true,
|
||||
showS: true,
|
||||
// 日期类型
|
||||
types: ['3', '2', '4', '1'],
|
||||
typeShow: false,
|
||||
labType: '',
|
||||
@@ -183,33 +168,25 @@ export default {
|
||||
DialogStatus: true,
|
||||
year: '',
|
||||
endyear: '',
|
||||
customizeInputValue: '', // 自定义输入框的值
|
||||
customizeInputValue: '', // Customize the value of the input box
|
||||
oldCustomizeLabelId: '2',
|
||||
oldParam: {},
|
||||
isInitFirst: true,
|
||||
// 删除我的名片
|
||||
delCard: false,
|
||||
// 群组是否添加标识
|
||||
// Whether to add an id to the group
|
||||
groupStatus: false,
|
||||
contactId: 0,
|
||||
contacts: {},
|
||||
language: '',
|
||||
// 默认中文
|
||||
langStatus: true,
|
||||
// 英文拼音状态
|
||||
usStatus: false,
|
||||
// 中英文拼音
|
||||
letter: '',
|
||||
// givenName-名
|
||||
givenName: '',
|
||||
// 英文场景出现familyName-姓、
|
||||
familyName: '',
|
||||
// middleName-中间名、
|
||||
middleName: '',
|
||||
familyNamePhonetic: '',
|
||||
},
|
||||
|
||||
/* 页面初始化时触发 */
|
||||
onInit() {
|
||||
LOG.info(TAG + 'onInit......');
|
||||
this.events[0].eventDate = this.$t('accountants.date');
|
||||
@@ -242,7 +219,7 @@ export default {
|
||||
'groups': this.groups
|
||||
}
|
||||
}
|
||||
// 群组返回值拼接页面展示值
|
||||
// Group return value Splicing page display value
|
||||
if (!this.contactForm.groups || this.contactForm.groups.length == 0) {
|
||||
this.contactForm.groups = this.groups;
|
||||
}
|
||||
@@ -257,7 +234,7 @@ export default {
|
||||
}
|
||||
this.groupContext = temp;
|
||||
}
|
||||
// 更新页面初始化
|
||||
// Update page initialization
|
||||
if (this.updataShow && !this.groupStatus) {
|
||||
if (this.saveContact) {
|
||||
var requestData = {
|
||||
@@ -282,7 +259,7 @@ export default {
|
||||
});
|
||||
}
|
||||
this.initUpdateData(this.contactForm);
|
||||
// 页面上number类型自动将电话号码的空格去掉了,导致数据前后不一致
|
||||
// The number type on the page automatically removes the space for the phone number, resulting in inconsistent data
|
||||
if (this.contactForm.phoneNumbers) {
|
||||
this.contactForm.phoneNumbers.forEach(element => {
|
||||
element.phoneNumber = element.phoneNumber.replace(/\s+/g, '');
|
||||
@@ -298,7 +275,7 @@ export default {
|
||||
if (this.contactForm.organization.title == undefined) {
|
||||
this.contactForm.organization.title = ''
|
||||
}
|
||||
// 页面上number类型自动将电话号码的空格去掉了,导致数据前后不一致
|
||||
// The number type on the page automatically removes the space for the phone number, resulting in inconsistent data
|
||||
if (this.contactForm.phoneNumbers) {
|
||||
this.contactForm.phoneNumbers.forEach(element => {
|
||||
element.phoneNumber = element.phoneNumber.replace(/\s+/g, '');
|
||||
@@ -369,7 +346,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化组数据
|
||||
initGroupData() {
|
||||
if (this.$app.$def.globalData.pushToGroup && this.$app.$def.globalData.groupParams) {
|
||||
let params = this.$app.$def.globalData.groupParams;
|
||||
@@ -394,9 +370,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 初始化时更新页面数据
|
||||
* Update page data during initialization
|
||||
*
|
||||
* @param {Object} contact 联系人数据
|
||||
* @param {Object} contact Contact data
|
||||
*/
|
||||
initUpdateData(contact) {
|
||||
if (!contact.emails || contact.emails.length == 0) {
|
||||
@@ -442,7 +418,7 @@ export default {
|
||||
contact.organization = this.organization;
|
||||
}
|
||||
|
||||
// 群组返回值拼接页面展示值
|
||||
// Group return value Splicing page display value
|
||||
if (!contact.groups || contact.groups.length == 0) {
|
||||
contact.groups = this.groups;
|
||||
}
|
||||
@@ -475,7 +451,6 @@ export default {
|
||||
this.$element('reset').show();
|
||||
} else if (this.updataShow) {
|
||||
if (this.updateCard || this.carteFlag) {
|
||||
// 如果查询我的名片
|
||||
this.getCardDetail(21001);
|
||||
} else {
|
||||
router.replace({
|
||||
@@ -493,7 +468,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 拍照
|
||||
takePhotos: function () {
|
||||
router.push({
|
||||
uri: 'pages/contacts/accountants/takephone/takephone',
|
||||
@@ -502,10 +476,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理编辑页面日期
|
||||
* Process edit page dates
|
||||
*
|
||||
* @param {Object} events events事件
|
||||
* @param {Object} contact 联系人数据
|
||||
* @param {Object} events
|
||||
* @param {Object} contact Contact data
|
||||
*/
|
||||
dealBirthTypes(events, contact) {
|
||||
var flagF = false;
|
||||
@@ -544,12 +518,11 @@ export default {
|
||||
this.$app.$def.groups.group = ''
|
||||
},
|
||||
|
||||
// 不保存
|
||||
anSave() {
|
||||
this.$app.$def.setRefreshContacts(false);
|
||||
if (this.saveContact) {
|
||||
this.$app.$def.dialerStateData.isEditNumber = false;
|
||||
this.$app.$def.globalData.navigationType = 0; // 返回时,返回到拨号盘
|
||||
this.$app.$def.globalData.navigationType = 0;
|
||||
this.$app.$def.globalData.menuType = 0;
|
||||
router.back({
|
||||
path: 'pages/navigation/navigation'
|
||||
@@ -563,14 +536,13 @@ export default {
|
||||
this.showWork = true;
|
||||
},
|
||||
|
||||
// 自定义弹窗
|
||||
showDialog(e) {
|
||||
this.DialogStatus = true;
|
||||
this.$element('simpledialog').show()
|
||||
},
|
||||
|
||||
cancelSchedule(e) {
|
||||
// 手机号码自定义
|
||||
|
||||
if (this.labType == '1') {
|
||||
this.contactForm.phoneNumbers[this.labId].labelId = this.oldCustomizeLabelId;
|
||||
}
|
||||
@@ -592,7 +564,6 @@ export default {
|
||||
setSchedule(id) {
|
||||
this.$element('simpledialog').close();
|
||||
|
||||
// 手机号码自定义
|
||||
if (this.labType == '1' && this.customizeInputValue) {
|
||||
this.contactForm.phoneNumbers[this.labId].labelId = '0';
|
||||
this.contactForm.phoneNumbers[this.labId].labelName = this.customizeInputValue;
|
||||
@@ -604,19 +575,19 @@ export default {
|
||||
this.contactForm.emails[this.labId].labelName = this.customizeInputValue;
|
||||
}
|
||||
|
||||
// 即时消息
|
||||
// Instant messaging
|
||||
if (this.labType == '3' && this.customizeInputValue) {
|
||||
this.contactForm.imAddresses[this.labId].labelId = '0';
|
||||
this.contactForm.imAddresses[this.labId].labelName = this.customizeInputValue;
|
||||
}
|
||||
|
||||
// 自定义住宅地址
|
||||
// Custom residential address
|
||||
if (this.labType == '4' && this.customizeInputValue) {
|
||||
this.contactForm.postalAddresses[this.labId].labelId = '0';
|
||||
this.contactForm.postalAddresses[this.labId].labelName = this.customizeInputValue;
|
||||
}
|
||||
|
||||
// 自定义关联人
|
||||
// User-defined association person
|
||||
if (this.labType == '5' && this.customizeInputValue) {
|
||||
this.contactForm.relations[this.labId].labelId = '0';
|
||||
this.contactForm.relations[this.labId].labelName = this.customizeInputValue;
|
||||
@@ -624,9 +595,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 自定义标签
|
||||
* Custom labels
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
getLabel(e) {
|
||||
if (e.value) {
|
||||
@@ -638,9 +609,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取姓名
|
||||
* Get name
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
getName(e) {
|
||||
this.contactForm.name.fullName = e.value;
|
||||
@@ -664,9 +635,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取英文 只支持英文字母^[A-Za-z]+$
|
||||
* Obtain only letters ^[a-za-z]+$
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
getLetter(e) {
|
||||
var temp = '';
|
||||
@@ -699,9 +670,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取姓名的中间名
|
||||
* Gets the middle name of the name
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
getMiddleName(e) {
|
||||
this.contactForm.name.middleName = e.value;
|
||||
@@ -727,9 +698,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 姓名中的名
|
||||
* First name of first name
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
getGivenName(e) {
|
||||
this.contactForm.name.givenName = e.value;
|
||||
@@ -754,7 +725,7 @@ export default {
|
||||
this.ListenParam(obj);
|
||||
},
|
||||
|
||||
// 英文场景出现familyName-姓、 middleName-中间名、 givenName-名
|
||||
// FamilyName - familyName, middleName- middleName, givenName- first name
|
||||
showEnDiv() {
|
||||
if (!this.langStatus) {
|
||||
this.letter = this.$t('accountants.surname');
|
||||
@@ -764,9 +735,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 公司
|
||||
* The company
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
getComp(e) {
|
||||
this.contactForm.organization.name = e.value;
|
||||
@@ -790,9 +761,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 职位
|
||||
* position
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
getWork(e) {
|
||||
this.contactForm.organization.title = e.value;
|
||||
@@ -816,11 +787,11 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 电话类型
|
||||
* The phone type
|
||||
*
|
||||
* @param {string} labType select组件里切换的类型
|
||||
* @param {string} labType
|
||||
* @param {number} id labelId
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
selectChange(labType, id, e) {
|
||||
this.labType = labType;
|
||||
@@ -864,10 +835,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 电话号码
|
||||
* The phone number
|
||||
*
|
||||
* @param {number} id onchange事件带过来的id
|
||||
* @param {Object} e event事件
|
||||
* @param {number} id
|
||||
* @param {Object} e
|
||||
*/
|
||||
getPhone: function (id, e) {
|
||||
if (e.value) {
|
||||
@@ -903,9 +874,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 重新输入电话
|
||||
* Reenter the phone
|
||||
*
|
||||
* @param {number} id onchange事件带过来的id
|
||||
* @param {number} id
|
||||
*/
|
||||
cleanNum(id) {
|
||||
let phones = JSON.parse(JSON.stringify(this.contactForm.phoneNumbers));
|
||||
@@ -940,7 +911,6 @@ export default {
|
||||
}, 0);
|
||||
},
|
||||
|
||||
/**新增多个电话号码*/
|
||||
addNumber: function () {
|
||||
var i = this.contactForm.phoneNumbers.length;
|
||||
this.contactForm.phoneNumbers.push({
|
||||
@@ -951,7 +921,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
/**添加更多选项*/
|
||||
getMore: function () {
|
||||
var l = this.bigsize + 600;
|
||||
this.bigsize = l;
|
||||
@@ -968,10 +937,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取邮箱
|
||||
* Access to email
|
||||
*
|
||||
* @param {number} id onchange事件带过来的id
|
||||
* @param {Object} e event事件
|
||||
* @param {number} id
|
||||
* @param {Object} e
|
||||
*/
|
||||
getEmail: function (id, e) {
|
||||
this.contactForm.emails[id].email = '';
|
||||
@@ -1004,9 +973,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 清除当前Email
|
||||
* Clear current Email
|
||||
*
|
||||
* @param {number} id 当前Email的ID
|
||||
* @param {number} id
|
||||
*/
|
||||
cleanEmail(id) {
|
||||
if (this.contactForm.emails.length > 1) {
|
||||
@@ -1037,7 +1006,6 @@ export default {
|
||||
this.ListenParam(obj);
|
||||
},
|
||||
|
||||
/**增加多个邮箱*/
|
||||
addEmail: function () {
|
||||
var i = this.contactForm.emails.length;
|
||||
this.contactForm.emails.push({
|
||||
@@ -1049,9 +1017,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取备注
|
||||
* Get note
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
getNote(e) {
|
||||
this.contactForm.note.noteContent = e.value;
|
||||
@@ -1075,9 +1043,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 清除消息
|
||||
* Clear message
|
||||
*
|
||||
* @param id onchange事件带过来的id
|
||||
* @param id
|
||||
*/
|
||||
cleanMessage(id) {
|
||||
if (this.contactForm.imAddresses.length > 1) {
|
||||
@@ -1106,10 +1074,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取ima及时消息
|
||||
* Get IMA timely messages
|
||||
*
|
||||
* @param {number} id onchange事件带过来的id
|
||||
* @param {Object} e event事件
|
||||
* @param {number} id
|
||||
* @param {Object} e
|
||||
*/
|
||||
getMessage: function (id, e) {
|
||||
if (e.value) {
|
||||
@@ -1140,7 +1108,6 @@ export default {
|
||||
this.ListenParam(obj);
|
||||
},
|
||||
|
||||
/*新增多条消息**/
|
||||
addMess: function () {
|
||||
var i = this.contactForm.imAddresses.length;
|
||||
this.contactForm.imAddresses.push({
|
||||
@@ -1152,9 +1119,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取铃声
|
||||
* To get the bell
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
getRing(e) {
|
||||
this.ringText = e.value;
|
||||
@@ -1164,10 +1131,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取住宅地址
|
||||
* Obtain residential Address
|
||||
*
|
||||
* @param {number} id onchange事件带过来的id
|
||||
* @param {Object} e event事件
|
||||
* @param {number} id
|
||||
* @param {Object} e
|
||||
*/
|
||||
getHouText: function (id, e) {
|
||||
if (e.value.length > 0) {
|
||||
@@ -1199,9 +1166,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取邮箱
|
||||
* Access to email
|
||||
*
|
||||
* @param {number} id 当前需要清除的节点的ID
|
||||
* @param {number} id
|
||||
*/
|
||||
cleanHouse(id) {
|
||||
if (this.contactForm.postalAddresses.length > 1) {
|
||||
@@ -1229,7 +1196,6 @@ export default {
|
||||
this.ListenParam(obj);
|
||||
},
|
||||
|
||||
/**新增多个住宅地址*/
|
||||
addHouse() {
|
||||
var i = this.contactForm.postalAddresses.length;
|
||||
this.contactForm.postalAddresses.push({
|
||||
@@ -1241,9 +1207,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取昵称
|
||||
* To obtain a nickname
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
getNick(e) {
|
||||
this.contactForm.nickName.nickName = e.value;
|
||||
@@ -1267,10 +1233,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取网址
|
||||
* Access to the website
|
||||
*
|
||||
* @param {number} id onchange事件带过来的id
|
||||
* @param {Object} e event事件
|
||||
* @param {number} id
|
||||
* @param {Object} e
|
||||
*/
|
||||
getWebsite(id, e) {
|
||||
if (e.value) {
|
||||
@@ -1301,9 +1267,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 清除当前网址
|
||||
* Clear current URL
|
||||
*
|
||||
* @param {number} id 需要清除当前网址的id
|
||||
* @param {number} id
|
||||
*/
|
||||
cleanWebsite(id) {
|
||||
if (this.contactForm.websites.length > 1) {
|
||||
@@ -1323,7 +1289,7 @@ export default {
|
||||
'mess': this.contactForm.imAddresses[0].imAddress,
|
||||
'address': this.contactForm.postalAddresses[0].postalAddress,
|
||||
'nick': this.contactForm.nickName.nickName,
|
||||
'website': this.contactForm.websites[0].website,
|
||||
'website': this.contactForm.websites[0].website,
|
||||
'birth': this.year,
|
||||
'assistant': this.contactForm.relations[0].relationName,
|
||||
'groupContext': this.groupContext
|
||||
@@ -1331,7 +1297,6 @@ export default {
|
||||
this.ListenParam(obj);
|
||||
},
|
||||
|
||||
/**添加更多网址*/
|
||||
addWebsite() {
|
||||
var i = this.contactForm.events.length;
|
||||
this.contactForm.websites.push({
|
||||
@@ -1342,10 +1307,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取日期类型
|
||||
* Get date type
|
||||
*
|
||||
* @param {number} id onchange事件带过来的id
|
||||
* @param {Object} e event事件
|
||||
* @param {number} id
|
||||
* @param {Object} e
|
||||
*/
|
||||
getBirType(id, e) {
|
||||
this.contactForm.events[id].labelId = e.newValue;
|
||||
@@ -1367,10 +1332,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取生日
|
||||
* For birthday
|
||||
*
|
||||
* @param {number} id onchange事件带过来的id
|
||||
* @param {Object} e event事件
|
||||
* @param {number} id
|
||||
* @param {Object} e
|
||||
*/
|
||||
getBirthText(id, e) {
|
||||
var year = e.year;
|
||||
@@ -1421,7 +1386,7 @@ export default {
|
||||
'mess': this.contactForm.imAddresses[0].imAddress,
|
||||
'address': this.contactForm.postalAddresses[0].postalAddress,
|
||||
'nick': this.contactForm.nickName.nickName,
|
||||
'website': this.contactForm.websites[0].website,
|
||||
'website': this.contactForm.websites[0].website,
|
||||
'birth': birthText,
|
||||
'assistant': this.contactForm.relations[0].relationName,
|
||||
'groupContext': this.groupContext
|
||||
@@ -1429,7 +1394,6 @@ export default {
|
||||
this.ListenParam(obj);
|
||||
},
|
||||
|
||||
/*新增多个重要日期**/
|
||||
addBirth: function () {
|
||||
var id = this.contactForm.events.length;
|
||||
id = id + 1;
|
||||
@@ -1444,9 +1408,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 清除当前的生日日期
|
||||
* Clears the current birthday date
|
||||
*
|
||||
* @param {number} id 需要清除当前的生日日期的id
|
||||
* @param {number} id
|
||||
*/
|
||||
cleanBirth(id) {
|
||||
if (this.contactForm.events.length > 1) {
|
||||
@@ -1483,7 +1447,7 @@ export default {
|
||||
'mess': this.contactForm.imAddresses[0].imAddress,
|
||||
'address': this.contactForm.postalAddresses[0].postalAddress,
|
||||
'nick': this.contactForm.nickName.nickName,
|
||||
'website': this.contactForm.websites[0].website,
|
||||
'website': this.contactForm.websites[0].website,
|
||||
'birth': this.year,
|
||||
'assistant': this.contactForm.relations[0].relationName,
|
||||
'groupContext': this.groupContext
|
||||
@@ -1492,10 +1456,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取更多关系
|
||||
* Get more relationships
|
||||
*
|
||||
* @param {number} id onchange事件带过来的id
|
||||
* @param {Object} e event事件
|
||||
* @param {number} id
|
||||
* @param {Object} e
|
||||
*/
|
||||
getAssText(id, e) {
|
||||
if (e.value.length > 0) {
|
||||
@@ -1518,7 +1482,7 @@ export default {
|
||||
'mess': this.contactForm.imAddresses[0].imAddress,
|
||||
'address': this.contactForm.postalAddresses[0].postalAddress,
|
||||
'nick': this.contactForm.nickName.nickName,
|
||||
'website': this.contactForm.websites[0].website,
|
||||
'website': this.contactForm.websites[0].website,
|
||||
'birth': this.year,
|
||||
'assistant': this.contactForm.relations[0].relationName,
|
||||
'groupContext': this.groupContext
|
||||
@@ -1527,9 +1491,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 清除当前关系
|
||||
* Clear current relationship
|
||||
*
|
||||
* @param {number} id 需要清楚当前关系的id
|
||||
* @param {number} id
|
||||
*/
|
||||
cleanAss(id) {
|
||||
if (this.contactForm.relations.length > 1) {
|
||||
@@ -1549,7 +1513,7 @@ export default {
|
||||
'mess': this.contactForm.imAddresses[0].imAddress,
|
||||
'address': this.contactForm.postalAddresses[0].postalAddress,
|
||||
'nick': this.contactForm.nickName.nickName,
|
||||
'website': this.contactForm.websites[0].website,
|
||||
'website': this.contactForm.websites[0].website,
|
||||
'birth': this.year,
|
||||
'assistant': this.contactForm.relations[0].relationName,
|
||||
'groupContext': this.groupContext
|
||||
@@ -1557,7 +1521,6 @@ export default {
|
||||
this.ListenParam(obj);
|
||||
},
|
||||
|
||||
/**添加多项*/
|
||||
addAss() {
|
||||
var id = this.contactForm.relations.length;
|
||||
id = id + 1;
|
||||
@@ -1569,7 +1532,7 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
// 跳转至群组
|
||||
// Jumping to a Group
|
||||
onGroup() {
|
||||
this.$app.$def.globalData.pushToGroup = true;
|
||||
router.push({
|
||||
@@ -1596,9 +1559,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 将obj对象实现深拷贝
|
||||
* Deep copy obJ objects
|
||||
*
|
||||
* @param {Object} obj 联系人的contactForm
|
||||
* @param {Object} obj Contact's contactForm
|
||||
* @return
|
||||
*/
|
||||
copy(obj) {
|
||||
@@ -1606,12 +1569,12 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 监控编辑页面的数据是否变动
|
||||
* Monitor whether the data on the edit page has changed
|
||||
*
|
||||
* @param {Array} existData 已经存在的数据
|
||||
* @param {Array} newData 滨化后的新数据
|
||||
* @param {string} type = 'Object' 定义类型为'Object'
|
||||
* @return {Boolean} 返回监控数据是否变化
|
||||
* @param {Array} existData
|
||||
* @param {Array} newData
|
||||
* @param {string} type = 'Object' Define the type as 'Object'
|
||||
* @return {Boolean}
|
||||
*/
|
||||
isSameData(existData, newData, type = 'Object') {
|
||||
if (type == 'Array') {
|
||||
@@ -1656,22 +1619,22 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 监听所有输入的参数
|
||||
* Listen for all input parameters
|
||||
*
|
||||
* @param {string} name 姓名
|
||||
* @param {string} Pname 姓名拼音
|
||||
* @param {string} company 公司
|
||||
* @param {string} position 职位
|
||||
* @param {string} phone 电话号码
|
||||
* @param {string} email 邮箱
|
||||
* @param {string} note 备注
|
||||
* @param {string} mess 即时消息
|
||||
* @param {string} address 住宅地址
|
||||
* @param {string} nick 昵称
|
||||
* @param {string} website 网站
|
||||
* @param {string} birth 生日
|
||||
* @param {string} assistant 助理
|
||||
* @param {string} groupContext 群组
|
||||
* @param {string} name
|
||||
* @param {string} Pname
|
||||
* @param {string} company
|
||||
* @param {string} position
|
||||
* @param {string} phone
|
||||
* @param {string} email
|
||||
* @param {string} note
|
||||
* @param {string} mess
|
||||
* @param {string} address
|
||||
* @param {string} nick
|
||||
* @param {string} website
|
||||
* @param {string} birth
|
||||
* @param {string} assistant
|
||||
* @param {string} groupContext
|
||||
*/
|
||||
|
||||
|
||||
@@ -1718,14 +1681,14 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 刪除我的名片
|
||||
|
||||
deleteCard() {
|
||||
LOG.info(TAG + 'deleteCard' + 'del contactForm' + this.contactForm);
|
||||
var delParams = {};
|
||||
delParams.contactId = this.contactForm.contactId;
|
||||
},
|
||||
|
||||
/**新增联系人*/
|
||||
|
||||
addAccountants() {
|
||||
LOG.info(TAG + 'addAccountants' + 'logMessage addAccountants is start');
|
||||
|
||||
@@ -1743,26 +1706,21 @@ export default {
|
||||
this.listFieldIsNull(addParams.websites);
|
||||
var that = this;
|
||||
if (this.carteFlag) {
|
||||
// 增加我的名片信息
|
||||
this.addCard(addParams);
|
||||
} else if (this.updateCard) {
|
||||
// 编辑我的名片
|
||||
this.editCard(addParams);
|
||||
} else {
|
||||
that.addShow ? that.$app.$def.setAddAccount(true) : that.$app.$def.setEditContacts(true);
|
||||
if (this.addShow) {
|
||||
// 添加联系人
|
||||
this.isaddContact(addParams);
|
||||
} else {
|
||||
// 编辑联系人
|
||||
this.updateContact(addParams);
|
||||
}
|
||||
that.addShow ? that.$app.$def.setAddAccount(true) : that.$app.$def.setEditContacts(true);
|
||||
if (this.addShow) {
|
||||
this.isaddContact(addParams);
|
||||
} else {
|
||||
this.updateContact(addParams);
|
||||
}
|
||||
}
|
||||
},
|
||||
addCard(addParams) {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
contactReq.addMyCard(DAHelper, addParams, (contactId) => {
|
||||
/* 新建名片完成后,延时跳转到我的名片界面,避免数据同步阻塞问题 */
|
||||
setTimeout(() => {
|
||||
this.goToMyCard(contactId);
|
||||
}, 500);
|
||||
@@ -1771,7 +1729,6 @@ export default {
|
||||
editCard(addParams) {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
contactReq.updateMyCard(DAHelper, addParams, (contactId) => {
|
||||
/* 编辑名片完成后,延时跳转到我的名片界面,避免数据同步阻塞问题 */
|
||||
setTimeout(() => {
|
||||
this.goToMyCard(contactId);
|
||||
}, 500);
|
||||
@@ -1780,7 +1737,7 @@ export default {
|
||||
updateContact(addParams) {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
contactReq.updateContact(DAHelper, addParams, (contactId) => {
|
||||
/* 插入联系人数据完成后,跳转至联系人详情页面 */
|
||||
LOG.info(TAG + 'addAccountants' + 'logMessage addContact callBack success! contactId = ' + ', route = ' + router);
|
||||
router.replace({
|
||||
uri: 'pages/contacts/contactDetail/contactDetail',
|
||||
params: {
|
||||
@@ -1793,7 +1750,7 @@ export default {
|
||||
addContacts(addParams) {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
contactReq.addContact(DAHelper, addParams, (contactId) => {
|
||||
/* 插入联系人数据完成后,跳转至联系人详情页面 */
|
||||
LOG.info(TAG + 'addAccountants' + 'logMessage addContact callBack success! contactId = ' + ', route = ' + router);
|
||||
router.replace({
|
||||
uri: 'pages/contacts/contactDetail/contactDetail',
|
||||
params: {
|
||||
@@ -1822,10 +1779,10 @@ export default {
|
||||
let websites = addParams.phoneNumbers == '' ? false : true;
|
||||
let groups = addParams.groups == '' ? false : true;
|
||||
|
||||
if(!(emails || events || imAddresses || fullName || givenName || familyName || middleName || familyNamePhonetic ||
|
||||
nickName || note || organizationName || organizationTitle || phoneNumbers || postalAddresses || relations || websites) && groups){
|
||||
if (!(emails || events || imAddresses || fullName || givenName || familyName || middleName || familyNamePhonetic ||
|
||||
nickName || note || organizationName || organizationTitle || phoneNumbers || postalAddresses || relations || websites) && groups) {
|
||||
Prompt.showToast({
|
||||
message: '没有此联系人的其他信息。',
|
||||
message: this.$t('value.contacts.noInfo'),
|
||||
duration: 2000,
|
||||
bottom: '150px'
|
||||
});
|
||||
@@ -1836,9 +1793,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除空数据并且移除labelName字段
|
||||
* Delete empty data and remove the labelName field
|
||||
*
|
||||
* @param {Array} field 联系人的某一个数据
|
||||
* @param {Array} field Data of a contact
|
||||
*/
|
||||
listFieldIsNull: function (field) {
|
||||
if (field && field.length > 0) {
|
||||
@@ -1854,9 +1811,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 跳转到我的名片
|
||||
* Jump to my business card
|
||||
*
|
||||
* @param {number} contactId 联系人ID
|
||||
* @param {number} contactId The contact ID
|
||||
*/
|
||||
goToMyCard(contactId) {
|
||||
LOG.info(TAG + 'goToMyCard' + 'logMessage goToMyCard start!');
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
position: relative;
|
||||
background-color: black;
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
.customize-title-div {
|
||||
@@ -62,16 +62,16 @@
|
||||
height: 81%;
|
||||
}
|
||||
|
||||
.page-footer-div{
|
||||
.page-footer-div {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 200px;
|
||||
background-color: black;
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
.shoot-image {
|
||||
width: 130px;
|
||||
height: 130px;
|
||||
background-color: aqua;
|
||||
background-color: #00ffff;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 拍照功能
|
||||
* @file camera
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -22,8 +22,6 @@ import router from '@system.router';
|
||||
export default {
|
||||
data: {},
|
||||
|
||||
|
||||
/* 页面初始化时触发 */
|
||||
onInit() {
|
||||
console.info('maobingbing');
|
||||
},
|
||||
@@ -33,9 +31,8 @@ export default {
|
||||
back() {
|
||||
router.back();
|
||||
},
|
||||
// 拍摄按钮
|
||||
|
||||
shootButton() {
|
||||
// 相机拍摄按钮
|
||||
this.$element('cameraApp').takePhoto({
|
||||
quality: 'low',
|
||||
success: function (data) {
|
||||
|
||||
+16
-59
@@ -17,7 +17,7 @@
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
flex-direction: column;/*background-color: gold;*/
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tabs-records {
|
||||
@@ -40,8 +40,6 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 页签标题样式盒 */
|
||||
|
||||
.tab-bar-box {
|
||||
width: 75%;
|
||||
height: 120px;
|
||||
@@ -49,12 +47,12 @@
|
||||
|
||||
.tab-bar-title {
|
||||
font-size: 30px;
|
||||
color: gray;
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.tab-bar-box text:active {
|
||||
font-weight: 600;
|
||||
color: royalblue;
|
||||
color: #4169e1;
|
||||
}
|
||||
|
||||
.select-contacts-title {
|
||||
@@ -72,7 +70,7 @@
|
||||
}
|
||||
|
||||
.select-contacts-title-image-button:active {
|
||||
background-color: lightgray;
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
.select-contacts-title-image-button-right {
|
||||
@@ -86,7 +84,7 @@
|
||||
}
|
||||
|
||||
.select-contacts-title-image-button-right:active {
|
||||
background-color: lightgray;
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
.select-contacts-title-image-button-right:disabled {
|
||||
@@ -206,7 +204,7 @@
|
||||
.allrecords-item-content-middle-bottom-text {
|
||||
font-size: 26px;
|
||||
font-weight: 500;
|
||||
color: gray;
|
||||
color: #808080;
|
||||
max-lines: 2;
|
||||
max-width: 310px;
|
||||
min-width: 50px;
|
||||
@@ -228,6 +226,7 @@
|
||||
height: 110px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.item-check-box {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
@@ -239,7 +238,7 @@
|
||||
margin-left: 146px;
|
||||
height: 1px;
|
||||
border-bottom: 1px;
|
||||
border-color: lightgray;
|
||||
border-color: #d3d3d3;
|
||||
}
|
||||
|
||||
.allrecords-list-item-line1 {
|
||||
@@ -248,7 +247,7 @@
|
||||
margin-left: 50px;
|
||||
height: 1px;
|
||||
border-bottom: 1px;
|
||||
border-color: lightgray;
|
||||
border-color: #d3d3d3;
|
||||
}
|
||||
|
||||
.tab-content-no-data {
|
||||
@@ -265,7 +264,7 @@
|
||||
|
||||
.tab-content-no-data-text {
|
||||
font-size: 28px;
|
||||
color: gray;
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.select-contacts-operation {
|
||||
@@ -284,7 +283,7 @@
|
||||
}
|
||||
|
||||
.select-contacts-operation-button:active {
|
||||
background-color: lightgray;
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
.select-contacts-image-icon {
|
||||
@@ -304,11 +303,9 @@
|
||||
|
||||
.batch-select-list-container {
|
||||
width: 100%;
|
||||
height: 84%;/*background-color: lightgray;*/
|
||||
height: 84%;
|
||||
}
|
||||
|
||||
/* 删除确认弹框样式 */
|
||||
|
||||
.dialog-main {
|
||||
width: 92%;
|
||||
height: 15%;
|
||||
@@ -353,12 +350,10 @@
|
||||
height: 70%;
|
||||
border-radius: 30px;
|
||||
background-color: transparent;
|
||||
text-color: red;
|
||||
text-color: #ff0000;
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
/* 联系人列表样式 */
|
||||
|
||||
.select-contacts-list {
|
||||
flex-direction: column;
|
||||
}
|
||||
@@ -387,8 +382,6 @@
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/*item器样式*/
|
||||
|
||||
.list-item {
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
@@ -396,8 +389,6 @@
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
/*item父容器样式*/
|
||||
|
||||
.list-item-body-group {
|
||||
padding-top: 20px;
|
||||
width: 100%;
|
||||
@@ -411,8 +402,6 @@
|
||||
background-color: lightgray;
|
||||
}
|
||||
|
||||
/*头像文字父容器*/
|
||||
|
||||
.list-item-head-group {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
@@ -422,8 +411,6 @@
|
||||
border-radius: 50px;
|
||||
}
|
||||
|
||||
/*头像文字*/
|
||||
|
||||
.list-item-head-name {
|
||||
text-align: center;
|
||||
font-size: 40px;
|
||||
@@ -431,8 +418,6 @@
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/*头像*/
|
||||
|
||||
.todo-content-body-group {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
@@ -441,8 +426,6 @@
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
/*姓名电话父容器*/
|
||||
|
||||
.list-item-body-name {
|
||||
text-align: left;
|
||||
font-size: 30px;
|
||||
@@ -451,8 +434,6 @@
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
/*默认电话父容器*/
|
||||
|
||||
.list-item-body-name-group {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -460,8 +441,6 @@
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/*默认电话样式*/
|
||||
|
||||
.list-item-body-phone-check-box-group {
|
||||
width: 580px;
|
||||
align-items: center;
|
||||
@@ -469,30 +448,22 @@
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/*默认电话样式*/
|
||||
|
||||
.list-item-body-phone-group {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
/*默认显示电话*/
|
||||
|
||||
.list-item-phone-group {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/*电话列表父容器*/
|
||||
|
||||
.list-child-phone-group {
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/*电话列表容器*/
|
||||
|
||||
.list-child-phone-item {
|
||||
padding-left: 140px;
|
||||
width: 100%;
|
||||
@@ -502,50 +473,38 @@
|
||||
}
|
||||
|
||||
.list-child-phone-item:active {
|
||||
background-color: lightgray;
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
/*分割线*/
|
||||
|
||||
.list-child-phone-line-group {
|
||||
margin-right: 60px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/*分割线样式*/
|
||||
|
||||
.list-child-phone-line {
|
||||
stroke-width: 1px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/*电话父容器*/
|
||||
|
||||
.list-child-phone-number-group {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
/*电话样式*/
|
||||
|
||||
.list-item-phone-number {
|
||||
align-items: center;
|
||||
text-align: left;
|
||||
font-size: 24px;
|
||||
justify-content: center;
|
||||
text-color: darkgray;
|
||||
text-color: #808080;
|
||||
}
|
||||
|
||||
/*搜索结果父容器*/
|
||||
|
||||
.search-result-list {
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/*搜索提示title*/
|
||||
|
||||
.list-search-phone-num {
|
||||
padding-left: 30px;
|
||||
margin-bottom: 30px;
|
||||
@@ -553,11 +512,9 @@
|
||||
text-align: left;
|
||||
font-size: 24px;
|
||||
align-items: center;
|
||||
text-color: darkgray;
|
||||
text-color: #808080;
|
||||
}
|
||||
|
||||
/*搜索结果列表容器*/
|
||||
|
||||
.list-search-group {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
|
||||
+1
-7
@@ -27,17 +27,14 @@
|
||||
</div>
|
||||
<div class="batch-select-list-container">
|
||||
|
||||
<!--/* 定义页签容器 */-->
|
||||
<tabs id="callLogTab" class="tabs-records" onchange="changeSelectTab">
|
||||
|
||||
<!-- 定义页签标题,当子组件的宽度大于 -->
|
||||
<tab-bar id="tabBarId" class="tab-bar-box" mode="fixed">
|
||||
<text id="recentTabId" class="tab-bar-title">{{ $t('value.contacts.selectContacts.recent') }}</text>
|
||||
<text id="contactsTabId" class="tab-bar-title">{{ $t('value.contacts.selectContacts.contacts') }}</text>
|
||||
<text id="groupTabId" class="tab-bar-title">{{ $t('value.contacts.selectContacts.group') }}</text>
|
||||
</tab-bar>
|
||||
|
||||
<!-- 定义页签实体部分 -->
|
||||
<tab-content id="tabContentId" class="tab-content-box" scrollable="false" ontouchmove="touchMoveContent"
|
||||
ontouchstart="touchStartContent">
|
||||
<div class="tab-content-contacts">
|
||||
@@ -48,7 +45,6 @@
|
||||
<list-item id="callsListItem{{ $idx }}" for="{{ callLogTemp }}" tid="id" class="list-item-log">
|
||||
<div class="allrecords-list-item" on:click="clickCallLog({{ $idx }})">
|
||||
|
||||
<!-- 最左侧头像显示 -->
|
||||
<div class="todo-item-content-div" if="{{ $item.portraitPath && layoutState }}">
|
||||
<image class="todo-item-content-image" src="{{ $item.portraitPath }}"></image>
|
||||
</div>
|
||||
@@ -68,7 +64,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 中间号码及高清图标 -->
|
||||
<div class="{{ layoutState ? 'allrecords-item-content' : 'allrecords-item-content1' }}">
|
||||
<div class="allrecords-item-content-middle-data">
|
||||
<div class="allrecords-item-content-middle-box">
|
||||
@@ -92,7 +87,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<div class="allrecords-item-right" on:touchstart.bubble="touchStartCapture">
|
||||
<div class="allrecords-item-right-checkbox">
|
||||
<input id="recentCheckId" type="checkbox" checked="{{ $item.checked }}"
|
||||
@@ -113,7 +107,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 联系人列表页签 -->
|
||||
<!-- Contact list TAB -->
|
||||
<div class="tab-content-contacts">
|
||||
<div class="select-contacts-list" if="{{ contactsList != undefined && contactsList.length > 0 }}">
|
||||
<div class="search-div">
|
||||
|
||||
+140
-176
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 批量选择联系人
|
||||
* @file Batch Selecting Contacts
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -26,37 +26,37 @@ import featureAbility from '@ohos.ability.featureAbility';
|
||||
import backgroundColor from '../../../common/constants/color.js';
|
||||
import router from '@system.router';
|
||||
|
||||
const SELECT_CONFIRM = 1000; // 确认选择接口
|
||||
const SEARCH_CONTACTS = 2012; // 搜索联系人
|
||||
const SELECT_CONFIRM = 1000; // Confirm interface selection
|
||||
const SEARCH_CONTACTS = 2012; // Searching for Contacts
|
||||
|
||||
var TAG = 'batchSelectContacts';
|
||||
|
||||
export default {
|
||||
data: {
|
||||
callLogTemp: [], // 最近通话记录
|
||||
contactsList: [], // 联系人列表
|
||||
layoutState: true, // 简洁布局
|
||||
groupList: [], // 群组列表
|
||||
backgroundColor: backgroundColor.Color, // 头像背景色
|
||||
showGroupList: true, // 是否显示群组列表。当群组列表无数据时,不显示
|
||||
selectedNumberMap: new Map(), // 当前总体已选择的数据,key为电话号码,value为 包含电话号码和姓名的obj
|
||||
searchText: '', // 搜索关键字
|
||||
callLogTemp: [], // Recent call history
|
||||
contactsList: [], // Contact list
|
||||
layoutState: true, // Concise layout
|
||||
groupList: [],
|
||||
backgroundColor: backgroundColor.Color,
|
||||
showGroupList: true,
|
||||
selectedNumberMap: new Map(),
|
||||
searchText: '',
|
||||
icCancelM: '/res/image/ic_cancel_m.svg',
|
||||
icDeleteM: '/res/image/ic_delete_m.svg',
|
||||
icSelectAll: '/res/image/ic_select all_m.svg',
|
||||
icComFirm: '/res/image/ic_comfirm.svg',
|
||||
titleMessage: '', // 选择联系人界面标题信息
|
||||
selectCount: 0, // 选择联系人界面总体已选中条数计数
|
||||
titleMessage: '',
|
||||
selectCount: 0,
|
||||
allSelectMessage: '',
|
||||
allSelectTextStyle: 'batch-select-text',
|
||||
selectMessage: '', // 最终选择信息,暂时保留
|
||||
selectMessage: '',
|
||||
isSelectAll: false,
|
||||
selectAllClicked: false, // 标识是否点击过全选按钮,如果点击过,则按照排除法批量删除数据
|
||||
selectAllClicked: false,
|
||||
selectDisabled: true,
|
||||
refreshBatchDeleteLogId: 0,
|
||||
isFirstInit: true,
|
||||
showOption: false, // 是否显示底部全选按钮,当本页签无数据时,不显示
|
||||
contactListShow: false, // 是否显示联系人列表,当联系人列表不为空时,显示联系人列表,否则显示空页面
|
||||
showOption: false,
|
||||
contactListShow: false,
|
||||
pageInfo: {
|
||||
pageIndex: 0,
|
||||
pageSize: 50,
|
||||
@@ -71,27 +71,27 @@ export default {
|
||||
recentTotal: 0,
|
||||
contactsTotal: 0,
|
||||
groupsTotal: 0,
|
||||
allClickedRecent: false, // 是否点击过全选 :当点击全选时置为true,当点击取消全选时置为false,适配大数据时的情况
|
||||
allClickedRecent: false,
|
||||
allClickedContacts: false,
|
||||
allClickedGroups: false,
|
||||
recentCount: 0, // 各页签的计数
|
||||
recentCount: 0,
|
||||
contactsCount: 0,
|
||||
groupsCount: 0,
|
||||
refreshGroupItemState: false
|
||||
},
|
||||
contactsInfo: { // 联系人列表相关数据
|
||||
contactsInfo: { // Contact list data
|
||||
searchContactList: [],
|
||||
selectedContactMap: new Map(), // 当前已选择的联系人列表,后续大数据时使用
|
||||
searchLayoutShow: false, // 是否显示搜索页
|
||||
searchPhoneNum: 0, // 搜索匹配条数
|
||||
showSearchList: false, // 是否是搜索列表
|
||||
showDefaultNumber: true, // 是否显示默认号码
|
||||
showNumberList: true, // 是否显示子号码列表
|
||||
phoneCheckShow: true, // 是否显示主号码复选框
|
||||
childPhoneCheckShow: true, // 是否显示子号码列表复选框
|
||||
selectedContactMap: new Map(),
|
||||
searchLayoutShow: false, // Whether to display the search page
|
||||
searchPhoneNum: 0,
|
||||
showSearchList: false,
|
||||
showDefaultNumber: true,
|
||||
showNumberList: true,
|
||||
phoneCheckShow: true,
|
||||
childPhoneCheckShow: true,
|
||||
contactsListCount: 0,
|
||||
contactsListTotal: 0,
|
||||
contactsNumberCount: 0, // 对联系人列表已选择的号码计数
|
||||
contactsNumberCount: 0,
|
||||
}
|
||||
},
|
||||
onInit() {
|
||||
@@ -105,36 +105,35 @@ export default {
|
||||
onShow() {
|
||||
},
|
||||
|
||||
// 简洁布局选项初始化
|
||||
// The clean layout option is initialized
|
||||
conciseLayoutInit: function () {
|
||||
let data = this.$app.$def.globalData.storage.getSync('contacts_settings_concise_layout_switch', 'false');
|
||||
this.layoutState = data == 'true' ? false : true;
|
||||
},
|
||||
|
||||
/**
|
||||
* 改变选择tab
|
||||
* Change the TAB selection
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
changeSelectTab(e) {
|
||||
this.tabInfo.tabIndex = e.index;
|
||||
this.checkTabListStyle(); // 校验当前页签列表数据选中状态
|
||||
this.checkOptionState(); // 校验当前页签选择按钮是否显示
|
||||
this.checkTabListStyle(); // Verify the current TAB list data selection status
|
||||
this.checkOptionState(); // Verify that the current TAB selection button is displayed
|
||||
},
|
||||
|
||||
/* 校验是否需要显示底部全选按钮 */
|
||||
checkOptionState() {
|
||||
switch (this.tabInfo.tabIndex) {
|
||||
case 0:
|
||||
Utils.isEmptyList(this.callLogTemp) ? this.showOption = false : this.showOption = true;
|
||||
Utils.isEmptyList(this.callLogTemp) ? this.showOption = false : this.showOption = true;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
Utils.isEmptyList(this.contactsList) ? this.showOption = false : this.showOption = true;
|
||||
Utils.isEmptyList(this.contactsList) ? this.showOption = false : this.showOption = true;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
Utils.isEmptyList(this.groupList) ? this.showOption = false : this.showOption = true;
|
||||
Utils.isEmptyList(this.groupList) ? this.showOption = false : this.showOption = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -142,34 +141,33 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/* 点击全选按钮 */
|
||||
clickSelectAll(e) {
|
||||
switch (this.tabInfo.tabIndex) {
|
||||
case 0: // 最近页签
|
||||
case 0:
|
||||
if (this.tabInfo.recentCount != 0 && this.tabInfo.recentCount == this.tabInfo.recentTotal) { // 已经全选,则取消全选
|
||||
this.tabInfo.allClickedRecent = false;
|
||||
this.unSelectAll();
|
||||
} else { // 未全选,则全部选中
|
||||
} else {
|
||||
this.tabInfo.allClickedRecent = true;
|
||||
this.selectAll();
|
||||
}
|
||||
break;
|
||||
|
||||
case 1: // 联系人列表页签
|
||||
case 1: // Contact list TAB
|
||||
if (this.tabInfo.contactsCount != 0 && this.tabInfo.contactsCount == this.tabInfo.contactsTotal) { // 已经全选,则取消全选
|
||||
this.tabInfo.allClickedContacts = false;
|
||||
this.unSelectAll();
|
||||
} else { // 未全选,则全部选中
|
||||
} else {
|
||||
this.tabInfo.allClickedContacts = true;
|
||||
this.selectAll();
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: // 群组页签
|
||||
case 2: // Groups TAB
|
||||
if (this.tabInfo.groupsCount != 0 && this.tabInfo.groupsCount == this.tabInfo.groupsTotal) { // 已经全选,则取消全选
|
||||
this.tabInfo.allClickedGroups = false;
|
||||
this.unSelectAll();
|
||||
} else { // 未全选,则全部选中
|
||||
} else {
|
||||
this.tabInfo.allClickedGroups = true;
|
||||
this.selectAll();
|
||||
}
|
||||
@@ -182,14 +180,14 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 列表复选框状态变化
|
||||
* The status of the list check box changes
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {Object} e event事件
|
||||
* @param {number} index
|
||||
* @param {Object} e
|
||||
*/
|
||||
checkStateChange(index, e) {
|
||||
switch (this.tabInfo.tabIndex) {
|
||||
case 0: // 最近
|
||||
case 0:
|
||||
this.changeCallLogItemState(index, e);
|
||||
break;
|
||||
|
||||
@@ -208,10 +206,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 最近页签通话记录复选框状态变化
|
||||
* The status of the TAB Call History check box changed recently
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {Object} e event事件
|
||||
* @param {number} index
|
||||
* @param {Object} e
|
||||
*/
|
||||
changeCallLogItemState: function (index, e) {
|
||||
this.callLogTemp[index].checked = e.checked;
|
||||
@@ -225,33 +223,34 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人列表页签通话记录复选框状态变化
|
||||
* Contact list TAB The status of the call history check box changes
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {Object} e event事件
|
||||
* @param {number} index
|
||||
* @param {Object} e
|
||||
*/
|
||||
changeContactsItemState: function (index, e) {
|
||||
var contactId = '';
|
||||
if (!this.contactsInfo.searchLayoutShow) { // 联系人主列表界面点击复选框
|
||||
if (!this.contactsInfo.searchLayoutShow) { // Contact main list interface click the check box
|
||||
contactId = this.contactsList[index].contactId;
|
||||
} else { // 联系人搜索列表界面点击复选框
|
||||
} else { // On the contact search list screen, click the check box
|
||||
contactId = this.contactsInfo.searchContactList[index].contactId;
|
||||
}
|
||||
this.checkContactsCount(e, contactId);
|
||||
},
|
||||
|
||||
/**
|
||||
* 判断当前是否需要增加或减小联系人计数,若所有子号码及主号码都变为未选中,则减1,如果有任何的号码变为选中,则加一
|
||||
* Determine whether to increase or decrease the contact count. If all subnumbers and major numbers are unselected,
|
||||
* decrease by 1. If all numbers are selected, increase by 1
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {number} contactId 联系人ID
|
||||
* @param {Object} e
|
||||
* @param {number} contactId The contact ID
|
||||
*/
|
||||
checkContactsCount(e, contactId) {
|
||||
if (this.contactsInfo.searchLayoutShow) { // 当前为搜索页面
|
||||
if (this.contactsInfo.searchLayoutShow) {
|
||||
this.contactsInfo.searchContactList.forEach(element => {
|
||||
if (contactId == element.contactId) {
|
||||
if (e.detail.checked) {
|
||||
if (!this.checkIfNeedCount(element)) { // 修改前原数据中不存在已选项时,页签计数加1;
|
||||
if (!this.checkIfNeedCount(element)) {
|
||||
this.tabInfo.contactsCount++;
|
||||
}
|
||||
element.phoneNumbers[e.detail.numberIndex].checked = true;
|
||||
@@ -261,18 +260,18 @@ export default {
|
||||
} else {
|
||||
element.phoneNumbers[e.detail.numberIndex].checked = false;
|
||||
this.contactsInfo.contactsNumberCount--;
|
||||
if (!this.checkIfNeedCount(element)) { // 修改后原数据中不存在已选项时,页签计数减1;
|
||||
if (!this.checkIfNeedCount(element)) {
|
||||
this.tabInfo.contactsCount--;
|
||||
}
|
||||
this.deleteSelectedNumber(element.phoneNumbers[e.detail.numberIndex].phoneNumber);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else { // 当前为主列表
|
||||
} else {
|
||||
this.contactsList.forEach(element => {
|
||||
if (contactId == element.contactId) {
|
||||
if (e.detail.checked) {
|
||||
if (!this.checkIfNeedCount(element)) { // 修改前原数据中不存在已选项时,页签计数加1;
|
||||
if (!this.checkIfNeedCount(element)) {
|
||||
this.tabInfo.contactsCount++;
|
||||
}
|
||||
element.phoneNumbers[e.detail.numberIndex].checked = true;
|
||||
@@ -282,7 +281,7 @@ export default {
|
||||
} else {
|
||||
element.phoneNumbers[e.detail.numberIndex].checked = false;
|
||||
this.contactsInfo.contactsNumberCount--;
|
||||
if (!this.checkIfNeedCount(element)) { // 修改后原数据中不存在已选项时,页签计数减1;
|
||||
if (!this.checkIfNeedCount(element)) {
|
||||
this.tabInfo.contactsCount--;
|
||||
}
|
||||
this.deleteSelectedNumber(element.phoneNumbers[e.detail.numberIndex].phoneNumber);
|
||||
@@ -293,10 +292,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 判断当前联系人元素是否存在已选项,存在则反true,不存在则反false
|
||||
* Checks whether the current contact element has an option, negating true if it does, and false if it does not
|
||||
*
|
||||
* @param {Object} contact 联系人数据
|
||||
* @return {boolean} 存在则反true,不存在则反false
|
||||
* @param {Object} contact Contact data
|
||||
* @return {boolean}
|
||||
*/
|
||||
checkIfNeedCount: function (contact) {
|
||||
if (contact.phoneNumbers.length > 0) {
|
||||
@@ -311,10 +310,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 群组页签通话记录复选框状态变化
|
||||
* Group TAB The status of the call record check box changes
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {Object} e event事件
|
||||
* @param {number} index
|
||||
* @param {Object} e
|
||||
*/
|
||||
changeGroupsItemState: function (index, e) {
|
||||
this.groupList[index].checked = e.checked;
|
||||
@@ -325,18 +324,17 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/* 全选列表项, 每个页签在全选时,将自身的选择结果追加给selectCount */
|
||||
selectAll() {
|
||||
switch (this.tabInfo.tabIndex) {
|
||||
case 0: // 最近页签
|
||||
case 0: // Recent TAB.
|
||||
this.selectAllRecentProc();
|
||||
break;
|
||||
|
||||
case 1: // 联系人列表页签
|
||||
case 1: // Contact list TAB
|
||||
this.selectAllContactProc();
|
||||
break;
|
||||
|
||||
case 2: // 群组页签
|
||||
case 2: // Groups TAB.
|
||||
this.groupList.forEach(element => {
|
||||
element.checked = true;
|
||||
});
|
||||
@@ -348,7 +346,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/* 最近联系页签全选操作 */
|
||||
selectAllRecentProc: function () {
|
||||
this.callLogTemp.forEach(element => {
|
||||
element.checked = true;
|
||||
@@ -357,16 +354,15 @@ export default {
|
||||
this.tabInfo.recentCount = this.tabInfo.recentTotal;
|
||||
},
|
||||
|
||||
/* 联系人全选操作 */
|
||||
selectAllContactProc: function () {
|
||||
if (this.contactsInfo.searchLayoutShow) { // 搜索界面
|
||||
if (this.contactsInfo.searchLayoutShow) {
|
||||
this.contactsInfo.searchContactList.forEach(element => {
|
||||
if (!element.phoneNumbers[0].checked) {
|
||||
element.phoneNumbers[0].checked = true;
|
||||
this.addOrUpdateSelectedNumberMap(element.phoneNumbers[0].phoneNumber, element.name.fullName);
|
||||
}
|
||||
});
|
||||
} else { // 若是主列表,则只修改主列表数据
|
||||
} else {
|
||||
this.contactsList.forEach(element => {
|
||||
if (!element.phoneNumbers[0].checked) {
|
||||
element.phoneNumbers[0].checked = true;
|
||||
@@ -378,10 +374,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 校验主列表联系人是否需要选中,如果已被选中则返回true,否则返回false
|
||||
* Verifies whether the master list contact needs to be selected, returning true if selected, false otherwise
|
||||
*
|
||||
* @param {Array} element 当前元素的数据
|
||||
* @return {boolean} 如果已被选中则返回true,否则返回false
|
||||
* @param {Array} element Data for the current element
|
||||
* @return {boolean}
|
||||
*/
|
||||
checkIfNeedSelected: function (element) {
|
||||
if (this.contactsInfo.selectedContactList.length > 0) {
|
||||
@@ -394,18 +390,17 @@ export default {
|
||||
return false;
|
||||
},
|
||||
|
||||
/* 取消全选 */
|
||||
unSelectAll() {
|
||||
switch (this.tabInfo.tabIndex) {
|
||||
case 0: // 最近页签
|
||||
case 0: // Recent TAB.
|
||||
this.unSelectAllRecentProc();
|
||||
break;
|
||||
|
||||
case 1: // 联系人列表页签
|
||||
case 1: // Contact list TAB
|
||||
this.unSelectAllContactProc();
|
||||
break;
|
||||
|
||||
case 2: // 群组页签
|
||||
case 2: // Groups TAB.
|
||||
this.groupList.forEach(element => {
|
||||
element.checked = false;
|
||||
});
|
||||
@@ -417,7 +412,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/* 最近联系列表取消全选 */
|
||||
unSelectAllRecentProc: function () {
|
||||
this.callLogTemp.forEach(element => {
|
||||
element.checked = false;
|
||||
@@ -428,9 +422,8 @@ export default {
|
||||
this.tabInfo.recentCount = 0;
|
||||
},
|
||||
|
||||
/* 联系人列表取消全选 */
|
||||
unSelectAllContactProc: function () {
|
||||
if (this.contactsInfo.searchLayoutShow) { // 搜索界面
|
||||
if (this.contactsInfo.searchLayoutShow) {
|
||||
this.contactsInfo.searchContactList.forEach(element => {
|
||||
for (var i = 0; i < element.phoneNumbers.length; i++) {
|
||||
if (element.phoneNumbers[i].checked) {
|
||||
@@ -439,7 +432,7 @@ export default {
|
||||
}
|
||||
}
|
||||
});
|
||||
} else { // 主列表
|
||||
} else {
|
||||
this.contactsList.forEach(element => {
|
||||
for (var i = 0; i < element.phoneNumbers.length; i++) {
|
||||
if (element.phoneNumbers[i].checked) {
|
||||
@@ -453,10 +446,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 刷新已选map数据
|
||||
* Refresh selected Map data
|
||||
*
|
||||
* @param {number} number 号码
|
||||
* @param {string} name 姓名
|
||||
* @param {number} number
|
||||
* @param {string} name
|
||||
*/
|
||||
addOrUpdateSelectedNumberMap: function (number, name) {
|
||||
if (Utils.isEmpty(number)) {
|
||||
@@ -469,9 +462,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 从已选号码中删除
|
||||
* Delete the selected number from the list
|
||||
*
|
||||
* @param {number} number 号码
|
||||
* @param {number} number
|
||||
*/
|
||||
deleteSelectedNumber: function (number) {
|
||||
if (Utils.isEmpty(number)) {
|
||||
@@ -481,10 +474,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 校验当前号码是否已被选择
|
||||
* Verify whether the current number is selected
|
||||
*
|
||||
* @param {number} number 号码
|
||||
* @return {Object} 校验当前号码是否已被选择
|
||||
* @param {number} number
|
||||
* @return {Object}
|
||||
*/
|
||||
checkIfSelectedNumber: function (number) {
|
||||
if (Utils.isEmpty(number)) {
|
||||
@@ -493,7 +486,6 @@ export default {
|
||||
return this.selectedNumberMap.has(number.replace(/\s+/g, ''));
|
||||
},
|
||||
|
||||
/* 标题计数刷新函数 */
|
||||
refreshPageMessage() {
|
||||
if (this.selectedNumberMap.size > 0) {
|
||||
this.titleMessage = this.$t('value.callRecords.titleMessageSelect') + this.selectedNumberMap.size
|
||||
@@ -510,64 +502,60 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/* 校验当前列表电话号码的选中情况 */
|
||||
checkTabListStyle: function () {
|
||||
switch (this.tabInfo.tabIndex) {
|
||||
case 0: // 最近页签,更新通话记录列表
|
||||
case 0: // Recent TAB to update the call history list
|
||||
this.checkRecentListSelectState();
|
||||
break;
|
||||
|
||||
case 1: // 联系人列表页签
|
||||
case 1: // Contact list TAB
|
||||
this.checkContactsListSelectState();
|
||||
break;
|
||||
|
||||
case 2: // 群组页签
|
||||
case 2: // Groups TAB.
|
||||
this.checkGroupsListSelectState();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.checkAllClickButtonStyle(); // 校验选择按钮状态
|
||||
this.checkAllClickButtonStyle();
|
||||
},
|
||||
|
||||
/* 校验最近页签列表数据选中状态 */
|
||||
checkGroupsListSelectState: function () {
|
||||
if (this.$app.$def.globalData.batchSelectContactsRefreshFunction.length > 0) {
|
||||
this.$app.$def.globalData.batchSelectContactsRefreshFunction.forEach((refreshFunction) => {
|
||||
refreshFunction(); // 调用下层页面groupListWithContacts注册的刷新函数。
|
||||
refreshFunction();
|
||||
});
|
||||
} // 此处只做属性值变化,下层群组组件检测到变化刷新其列表复选框状态
|
||||
} // Only the property value changes. The lower level group component refreshes its list check box status when it detects the change
|
||||
},
|
||||
|
||||
/* 校验最近页签列表数据选中状态 */
|
||||
checkRecentListSelectState: function () {
|
||||
this.tabInfo.recentCount = 0;
|
||||
this.callLogTemp.forEach(element => {
|
||||
if (this.checkIfSelectedNumber(element.phone)) { // 当前该号码已被选择
|
||||
if (this.checkIfSelectedNumber(element.phone)) { // The number is selected
|
||||
element.checked = true;
|
||||
} else if (element.checked) {
|
||||
element.checked = false;
|
||||
}
|
||||
if (element.checked) { // 根据最终判断的结果,若是选定状态,则页签计数加1;
|
||||
if (element.checked) { // According to the result of final judgment, if the status is selected, then the TAB count is increased by 1;
|
||||
this.tabInfo.recentCount++;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/* 校验联系人页签列表数据选中状态 */
|
||||
checkContactsListSelectState: function () {
|
||||
var tempList = this.contactsInfo.searchLayoutShow ? this.contactsInfo.searchContactList : this.contactsList;
|
||||
this.tabInfo.contactsCount = 0; // 现将页签计数清0
|
||||
this.tabInfo.contactsCount = 0;
|
||||
tempList.forEach(element => {
|
||||
for (var i = 0; i < element.phoneNumbers.length; i++) {
|
||||
if (this.checkIfSelectedNumber(element.phoneNumbers[i].phoneNumber)) {
|
||||
element.phoneNumbers[i].checked = true;
|
||||
} else if (element.phoneNumbers[i].checked) { // 若选中状态 但已选列表中不存在,则取消选中
|
||||
} else if (element.phoneNumbers[i].checked) {
|
||||
element.phoneNumbers[i].checked = false;
|
||||
}
|
||||
}
|
||||
if (this.checkIfNeedCount(element)) { // 根据最终选择结果判断是否需要增加页签计数
|
||||
if (this.checkIfNeedCount(element)) {
|
||||
this.tabInfo.contactsCount++;
|
||||
}
|
||||
});
|
||||
@@ -575,10 +563,9 @@ export default {
|
||||
= tempList : this.contactsList = tempList;
|
||||
},
|
||||
|
||||
/* 校验全选按钮的显示样式 */
|
||||
checkAllClickButtonStyle: function () {
|
||||
switch (this.tabInfo.tabIndex) {
|
||||
case 0: // 最近页签
|
||||
case 0:
|
||||
if (this.tabInfo.recentCount == this.tabInfo.recentTotal) {
|
||||
this.changeToFullSelect();
|
||||
this.tabInfo.allClickedRecent = true;
|
||||
@@ -587,7 +574,7 @@ export default {
|
||||
}
|
||||
break;
|
||||
|
||||
case 1: // 联系人列表页签
|
||||
case 1:
|
||||
if (this.tabInfo.contactsCount == this.tabInfo.contactsTotal) {
|
||||
this.changeToFullSelect();
|
||||
this.tabInfo.allClickedContacts = true;
|
||||
@@ -596,7 +583,7 @@ export default {
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: // 群组页签
|
||||
case 2:
|
||||
if (this.tabInfo.groupsCount == this.tabInfo.groupsTotal) {
|
||||
this.changeToFullSelect();
|
||||
this.tabInfo.allClickedGroups = true;
|
||||
@@ -607,14 +594,12 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/* 按钮变换为已经全选样式 */
|
||||
changeToFullSelect: function () {
|
||||
this.icSelectAll = '/res/image/ic_select all_filled_m.svg';
|
||||
this.allSelectMessage = this.$t('value.callRecords.unSelectAll');
|
||||
this.allSelectTextStyle = 'batch-select-text-selected';
|
||||
},
|
||||
|
||||
/* 按钮变换为未全选样式 */
|
||||
changeToUnFullSelect: function () {
|
||||
this.icSelectAll = '/res/image/ic_select all_m.svg';
|
||||
this.allSelectMessage = this.$t('value.callRecords.selectAll');
|
||||
@@ -622,9 +607,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击单条通话记录时也会选中或取消复选框
|
||||
* The checkbox is also selected or deselected when clicking on a single call record
|
||||
*
|
||||
* @param {number} index 下标
|
||||
* @param {number} index
|
||||
*/
|
||||
clickCallLog(index) {
|
||||
this.checkStateChange(index, {
|
||||
@@ -632,7 +617,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
/* 提交选择结果 */
|
||||
doSelect() {
|
||||
var checkedList = [];
|
||||
this.selectedNumberMap.forEach((value) => {
|
||||
@@ -648,19 +632,18 @@ export default {
|
||||
parameters: parameters
|
||||
}
|
||||
};
|
||||
if (this.selectType == 1) { // 转发
|
||||
if (this.selectType == 1) {
|
||||
} else {
|
||||
// 短信新建选择联系人
|
||||
featureAbility.finishWithResult(result);
|
||||
featureAbility.terminateSelf();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理选中的联系人的信息
|
||||
* Processes information about the selected contact
|
||||
*
|
||||
* @param {Array} checkedList 选中的list
|
||||
* @return {boolean} 返回处理后的联系人
|
||||
* @param {Array} checkedList
|
||||
* @return {boolean}
|
||||
*/
|
||||
dealContactName(checkedList) {
|
||||
let contacts = [];
|
||||
@@ -674,16 +657,13 @@ export default {
|
||||
return contacts;
|
||||
},
|
||||
|
||||
/* 返回上一个页面 */
|
||||
back() {
|
||||
router.back();
|
||||
},
|
||||
|
||||
/* 获取最近通话记录 */
|
||||
initCallLog() {
|
||||
/* 获取通话记录 */
|
||||
var tempMap = new Map();// 用于防止号码重复校验
|
||||
var tempList = [];// 用于临时存放不重复的item
|
||||
var tempMap = new Map();
|
||||
var tempList = [];
|
||||
var mergeRule = this.$app.$def.globalData.storage.getSync('call_log_merge_rule', 'from_time');
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CALLLOG_DB_URI);
|
||||
callLogService.getAllCalls(DAHelper, mergeRule, data => {
|
||||
@@ -693,11 +673,11 @@ export default {
|
||||
var bgColorIndex = parseInt(element.id, 10) % (this.backgroundColor.length);
|
||||
element.portraitColor = this.backgroundColor[bgColorIndex];
|
||||
element.suffix = Utils.isEmpty(element.name) ? '' : element.name.substr(element.name.length - 1);
|
||||
if (!tempMap.has(Utils.removeSpace(element.phone))) { // 重复的号码无需显示
|
||||
if (!tempMap.has(Utils.removeSpace(element.phone))) {
|
||||
tempList.push(element);
|
||||
tempMap.set(element.phone, null);
|
||||
}
|
||||
if (tempList.length > 50) { // 显示最近产生通话记录的50条号码
|
||||
if (tempList.length > 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -707,7 +687,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
/* 根据手机号的LabelId获取LabelName */
|
||||
getPhoneLabelNameById: function (phoneLabelId) {
|
||||
var labelName = '';
|
||||
switch (parseInt(phoneLabelId, 10)) {
|
||||
@@ -753,9 +732,6 @@ export default {
|
||||
return labelName;
|
||||
},
|
||||
|
||||
/*
|
||||
* 初始化联系人列表数据
|
||||
*/
|
||||
initContactsList: function () {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
selectContactsAbility.queryContacts(DAHelper, (resultList) => {
|
||||
@@ -786,10 +762,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 电话号码去重
|
||||
* The phone number is resold
|
||||
*
|
||||
* @param {Object} result 号码详情
|
||||
* @return {Object} result 处理后的号码
|
||||
* @param {Object} result
|
||||
* @return {Object} result
|
||||
*/
|
||||
duplicateRemoval: function (result) {
|
||||
if (Utils.isEmptyList(result.data)) {
|
||||
@@ -799,16 +775,13 @@ export default {
|
||||
for (var i = 0; i < resultList.length; i++) {
|
||||
var item = resultList[i];
|
||||
var phoneNumbersList = [];
|
||||
// 倒序排序,去重复的最后一个添加
|
||||
for (var j = item.phoneNumbers.length - 1; j >= 0; j--) {
|
||||
item.phoneNumbers[j].checked = false;
|
||||
var indexOf = this.indexOf(item.phoneNumbers[j], phoneNumbersList);
|
||||
// 不存在则添加
|
||||
if (indexOf == -1) {
|
||||
phoneNumbersList.push(item.phoneNumbers[j]);
|
||||
}
|
||||
}
|
||||
// 为了减少一次循环搜索名称颜色可变加入此处,初始化可变字体
|
||||
this.initVariableSpan(item);
|
||||
item.phoneNumbers = phoneNumbersList;
|
||||
}
|
||||
@@ -816,9 +789,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击事件
|
||||
* Click on the event
|
||||
*
|
||||
* @param {Object} params 点击下标
|
||||
* @param {Object} params
|
||||
*/
|
||||
selectClick: function (params) {
|
||||
var item = this.contactsList[params.detail.index];
|
||||
@@ -829,7 +802,7 @@ export default {
|
||||
},
|
||||
|
||||
onTextChange: function (text) {
|
||||
// 搜索输入框
|
||||
|
||||
this.searchText = text.text;
|
||||
this.onSearchTextChange(text.text);
|
||||
},
|
||||
@@ -838,7 +811,6 @@ export default {
|
||||
focus: true
|
||||
})
|
||||
},
|
||||
// 查询联系人电话是否已在电话列表中
|
||||
indexOf: function (item, phoneNumbersList) {
|
||||
var index = -1;
|
||||
if (Utils.isEmptyList(phoneNumbersList)) {
|
||||
@@ -854,9 +826,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击事件
|
||||
* Click on the event
|
||||
*
|
||||
* @param {string} text Value值
|
||||
* @param {string} text Value
|
||||
*/
|
||||
onSearchTextChange: function (text) {
|
||||
var requestData = {
|
||||
@@ -879,56 +851,49 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击事件
|
||||
*
|
||||
* @param {string} text Value值
|
||||
*/
|
||||
refreshSearchList: function (text) {
|
||||
this.contactsInfo.searchPhoneNum = this.contactsInfo.searchContactList.length;
|
||||
if (Utils.isEmpty(text)) {
|
||||
this.contactsInfo.searchLayoutShow = false;
|
||||
this.tabInfo.contactsTotal = this.contactsInfo.contactsListTotal; // 搜索无数据时,总数刷新为主列表总数
|
||||
this.tabInfo.contactsTotal = this.contactsInfo.contactsListTotal;
|
||||
this.emptyText = this.$t('value.selectContact.page.empty');
|
||||
if (this.tabInfo.tabIndex == 1) {
|
||||
this.checkTabListStyle(); // 校验当前列表数据选中状态
|
||||
this.checkTabListStyle();
|
||||
}
|
||||
} else if (Utils.isEmptyList(this.contactsInfo.searchContactList)) {
|
||||
// 搜索列表为空,更新搜索文字描述
|
||||
this.emptyText = this.$t('value.selectContact.page.emptyText');
|
||||
this.contactListShow = false;
|
||||
this.contactsInfo.searchLayoutShow = false;
|
||||
this.tabInfo.contactsTotal = this.contactsInfo.contactsListTotal; // 搜索无数据时,总数刷新为主列表总数
|
||||
this.tabInfo.contactsTotal = this.contactsInfo.contactsListTotal;
|
||||
if (this.tabInfo.tabIndex == 1) {
|
||||
this.checkTabListStyle(); // 校验当前列表数据选中状态
|
||||
this.checkTabListStyle();
|
||||
}
|
||||
} else {
|
||||
this.contactsInfo.searchLayoutShow = true;
|
||||
this.tabInfo.contactsTotal = this.contactsInfo.searchContactList.length; // 搜索有数据时,页签总数刷新为搜索列表总记录数
|
||||
this.tabInfo.contactsTotal = this.contactsInfo.searchContactList.length;
|
||||
this.contactListShow = true;
|
||||
this.emptyText = this.$t('value.selectContact.page.empty');
|
||||
if (this.tabInfo.tabIndex == 1) {
|
||||
this.checkTabListStyle(); // 校验当前列表数据选中状态
|
||||
this.checkTabListStyle();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 联系人主列表或搜索列表点击复选框事件
|
||||
* Contact the main list or search list by clicking the checkbox event
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
*/
|
||||
changeContactState: function (e) {
|
||||
this.checkStateChange(e.detail.contactIndex, e); // 调用统一的复选框变化函数
|
||||
this.checkStateChange(e.detail.contactIndex, e);
|
||||
},
|
||||
|
||||
/**
|
||||
* 赋值自定义属性,为后面可变字体搜索做准备
|
||||
* Assign custom attributes in preparation for later variable font searches
|
||||
*
|
||||
* @param {Object} item 联系人数据
|
||||
* @param {Object} item Contact data
|
||||
*/
|
||||
initVariableSpan: function (item) {
|
||||
// 初始化可变名称
|
||||
var matchString = Utils.getMatchedString(item.emptyNameData, this.searchText);
|
||||
if (Utils.isEmpty(matchString) || Utils.isEmpty(this.searchText.trim())) {
|
||||
item.name.searchTextStart = '';
|
||||
@@ -941,7 +906,6 @@ export default {
|
||||
item.name.searchTextMiddle = name.substr(index, matchString.length);
|
||||
item.name.searchTextEnd = name.substr(index + matchString.length);
|
||||
}
|
||||
// 初始化可变手机号
|
||||
for (var i = 0; i < item.phoneNumbers.length; i++) {
|
||||
var phoneNumber = item.phoneNumbers[i].phoneNumber;
|
||||
var matchStringPhone = Utils.getMatchedString(phoneNumber, this.searchText);
|
||||
@@ -959,9 +923,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 从群组列表添加联系人
|
||||
* Add a contact from the group list
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
addCheckedContact(e) {
|
||||
e.detail.checkedList.forEach(element => {
|
||||
@@ -971,9 +935,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 从群组列表删除联系人
|
||||
* Delete a contact from the group list
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
deleteCheckedContact(e) {
|
||||
e.detail.checkedList.forEach(element => {
|
||||
@@ -983,9 +947,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改群组列表状态
|
||||
* Example Change the group list status
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
changeGroupShowState(e) {
|
||||
this.showGroupList = e.detail.showGroupList;
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 90%;
|
||||
height: 1360px;/* background-color: #d6e1ec;*/
|
||||
height: 1360px;
|
||||
border-top-left-radius: 30px;
|
||||
border-top-right-radius: 30px;
|
||||
border-top-style: dotted;
|
||||
@@ -50,7 +50,7 @@
|
||||
.list-details-item-first-image-box {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
border-radius: 100px;/* background-color:#aec4d4;*/
|
||||
border-radius: 100px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
@@ -211,7 +211,7 @@
|
||||
.list-card-number-text-down {
|
||||
width: 100%;
|
||||
font-size: 27px;
|
||||
color: gray;
|
||||
color: #808080;
|
||||
margin-top: 10px;
|
||||
max-lines: 2;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
@@ -38,18 +38,15 @@
|
||||
<list id="listItem" class="list-wraper" scrollbar="auto" onscrollbottom="scrollTend" ontouchmove="moveSroll"
|
||||
ontouchstart="srtartMove">
|
||||
|
||||
<!--用户信息二维码-->
|
||||
<list-item class="item-extent-div">
|
||||
<div class="qrcode-div">
|
||||
<qrcode value="{{ qrcodeParam }}}"></qrcode>
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!--电话-->
|
||||
<list-item class="item-card-number" for="{{ contactForm.phoneNumbers }}">
|
||||
<div class="item-card-number-div">
|
||||
<div class="item-card-number-inner">
|
||||
<!-- 电话号码 -->
|
||||
<text class="item-card-number-text">{{ $item.phoneNumber }}</text>
|
||||
<text class="list-card-number-text-down">
|
||||
{{ (($item.labelName == undefined || $item.labelName == '') ? '' : ($item.labelName + ' - ')) }}
|
||||
@@ -60,7 +57,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户邮箱列表 -->
|
||||
<list-item class="item-card-number" if="{{ contactForm.emails && contactForm.emails.length > 0 }}"
|
||||
for="{{ contactForm.emails }}">
|
||||
<div class="item-card-number-div">
|
||||
@@ -71,7 +67,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:及时消息 -->
|
||||
<list-item class="item-card-number" if="{{ contactForm.imAddresses && contactForm.imAddresses.length > 0 }}"
|
||||
for="{{ contactForm.imAddresses }}">
|
||||
<div class="item-card-number-div">
|
||||
@@ -99,7 +94,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:昵称 -->
|
||||
<list-item class="item-card-number"
|
||||
if="{{ contactForm.nickName.nickName && contactForm.nickName.nickName.length > 0 && contactForm.nickName != undefined }}">
|
||||
<div class="item-card-number-div">
|
||||
@@ -110,7 +104,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:网站 -->
|
||||
<list-item class="item-card-number" if="{{ contactForm.websites && contactForm.websites.length > 0 }}"
|
||||
for="{{ contactForm.websites }}">
|
||||
<div class="item-card-number-div">
|
||||
@@ -121,7 +114,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:住宅 -->
|
||||
<list-item class="item-card-number"
|
||||
if="{{ contactForm.postalAddresses && contactForm.postalAddresses.length > 0 }}"
|
||||
for="{{ contactForm.postalAddresses }}">
|
||||
@@ -140,7 +132,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:events 事件记录 -->
|
||||
<list-item class="item-card-number" if="{{ contactForm.events && contactForm.events.length > 0 }}"
|
||||
for="{{ contactForm.events }}">
|
||||
<div class="item-card-number-div">
|
||||
@@ -158,7 +149,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:姓名拼音 -->
|
||||
<list-item class="item-card-number"
|
||||
if="{{ contactForm.name.familyNamePhonetic && contactForm.name.familyNamePhonetic.length > 0 }}">
|
||||
<div class="item-card-number-div">
|
||||
@@ -169,7 +159,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:关联关系 -->
|
||||
<list-item class="item-carte-number" if="{{ contactForm.relations && contactForm.relations.length > 0 }}"
|
||||
for="{{ contactForm.relations }}">
|
||||
<div class="item-card-number-div">
|
||||
@@ -209,7 +198,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:备注 -->
|
||||
<list-item class="item-card-number"
|
||||
if="{{ contactForm.note.noteContent && contactForm.note.noteContent.length > 0 }}">
|
||||
<div class="item-card-number-div">
|
||||
@@ -227,7 +215,6 @@
|
||||
</list-item>
|
||||
</list>
|
||||
|
||||
<!--bottom-->
|
||||
<div class="global-bottom-div">
|
||||
<div show="{{ countStaus }}">
|
||||
<div if="{{ scrollDown }}" class="up-botton-div" onclick="scrollToBottom">
|
||||
@@ -237,7 +224,7 @@
|
||||
<image class="up-image-div" src="{{ arrowUp }}"></image>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 编辑、分享、个人紧急信息-->
|
||||
|
||||
<div class="bottom-three-div">
|
||||
<div class="bottom-div-edit" onclick="editCard">
|
||||
<image class="image-div" src="{{ $t('svg.favorites.diageEdit') }}"></image>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 名片
|
||||
* @file: card
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -29,7 +29,6 @@ export default {
|
||||
icContactsAllergies: '/res/image/ic_contacts_allergies_m.svg',
|
||||
icShare: '/res/image/ic_share_m.svg',
|
||||
arrowUnfold: '/res/image/ic_contacts_arrow_unfold_s.svg',
|
||||
// 底部图标
|
||||
arrowUp: '/res/image/ic_contacts_arrow_unfold.svg',
|
||||
scrollDown: true,
|
||||
scrollUp: false,
|
||||
@@ -70,9 +69,9 @@ export default {
|
||||
this.contactForm.name = this.name;
|
||||
}
|
||||
this.showNameLast = this.contactForm.name && this.contactForm.name.fullName ? this.contactForm.name.fullName
|
||||
: ((this.contactForm.emptyNameData && this.contactForm.emptyNameData.length > 0)
|
||||
? this.contactForm.emptyNameData : (this.contactForm.phoneNumbers && this.contactForm.phoneNumbers[0])
|
||||
? this.contactForm.phoneNumbers[0].phoneNumber : '');
|
||||
: ((this.contactForm.emptyNameData && this.contactForm.emptyNameData.length > 0)
|
||||
? this.contactForm.emptyNameData : (this.contactForm.phoneNumbers && this.contactForm.phoneNumbers[0])
|
||||
? this.contactForm.phoneNumbers[0].phoneNumber : '');
|
||||
if (!this.contactForm.emails || this.contactForm.emails.length == 0) {
|
||||
this.contactForm.emails = this.emails;
|
||||
} else {
|
||||
@@ -158,7 +157,6 @@ export default {
|
||||
router.back();
|
||||
},
|
||||
|
||||
// 二维码获取
|
||||
getQrcode() {
|
||||
var name = (this.contactForm.name && this.contactForm.name.fullName
|
||||
&& this.contactForm.name.fullName.length > 0) ? 'N:' + this.contactForm.name.fullName + ';' : '';
|
||||
@@ -167,8 +165,7 @@ export default {
|
||||
&& this.contactForm.organization.name.length > 0) ? 'ORG:' + this.contactForm.organization.name + ';' : '';
|
||||
|
||||
var postalAddresses = (this.contactForm.postalAddresses && this.contactForm.postalAddresses[0]
|
||||
&& this.contactForm.postalAddresses[0].postalAddress.length > 0) ? 'ADR:' + this.contactForm.postalAddresses[0].
|
||||
postalAddress + ';' : '';
|
||||
&& this.contactForm.postalAddresses[0].postalAddress.length > 0) ? 'ADR:' + this.contactForm.postalAddresses[0].postalAddress + ';' : '';
|
||||
|
||||
var phoneNumbersString = '';
|
||||
var phoneNumberLength = (this.contactForm && this.contactForm.phoneNumbers)
|
||||
@@ -206,7 +203,6 @@ export default {
|
||||
+ stringEmails + websites + position + note + imAddresses;
|
||||
},
|
||||
|
||||
// 返回主页
|
||||
routerBack() {
|
||||
router.back();
|
||||
},
|
||||
@@ -215,9 +211,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 滚动到列表底部
|
||||
* Scroll to the bottom of the list
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
scrollTend(e) {
|
||||
LOG.info(TAG + 'scrollTend' + e);
|
||||
@@ -225,9 +221,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 手指触摸后移动 手指触摸动作开始。
|
||||
* Move after finger touch finger touch action begins.
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
moveSroll(e) {
|
||||
this.moveGlobalY = e.touches[0].globalY;
|
||||
@@ -238,9 +234,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 手指触摸动作开始。
|
||||
* Finger touch begins。
|
||||
*
|
||||
* @param {Object} e event事件
|
||||
* @param {Object} e
|
||||
*/
|
||||
srtartMove(e) {
|
||||
this.startGlobalY = e.touches[0].globalY;
|
||||
@@ -253,7 +249,6 @@ export default {
|
||||
this.$element('listItem').scrollBottom(true);
|
||||
},
|
||||
|
||||
// 编辑我的名片
|
||||
editCard() {
|
||||
this.setContactForm();
|
||||
|
||||
@@ -337,9 +332,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 将数组中的每个元素的showP属性展示
|
||||
* Displays the showP attribute for each element in the array
|
||||
*
|
||||
* @param {Array} array 联系人的各个数据
|
||||
* @param {Array} array
|
||||
*/
|
||||
addShowPField(array) {
|
||||
if (array || array.length > 0) {
|
||||
@@ -350,31 +345,30 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 分享弹窗
|
||||
shareCarte() {
|
||||
this.$element('shareCartedialog').show();
|
||||
},
|
||||
|
||||
/**
|
||||
* 分享联系人
|
||||
* Share Contacts
|
||||
*
|
||||
* @param {number} idx 联系人的各个数据
|
||||
* @param {number} idx Contact data
|
||||
*/
|
||||
shareClick(idx) {
|
||||
switch (idx) {
|
||||
case 0:
|
||||
prompt.showToast({
|
||||
message: '调用分享二维码三方'
|
||||
message: 'Call share qr code three parties'
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
prompt.showToast({
|
||||
message: '调用分享vCard三方'
|
||||
message: 'Call share vCard three parties'
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
prompt.showToast({
|
||||
message: '调用文本三方'
|
||||
message: 'Call text tripartite'
|
||||
});
|
||||
break;
|
||||
default:
|
||||
@@ -382,7 +376,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 弹窗取消
|
||||
shareCancelClick() {
|
||||
this.$element('shareCartedialog').close();
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 用户头像、姓名、职业 -->
|
||||
<list id="contactDetailAndDialRecordList" class="list-details" scrollbar="on">
|
||||
<list-item>
|
||||
<div id="headerIfDiv" if="{{ showHeaderFlag }}" class="div-details-item-first"
|
||||
@@ -67,7 +66,6 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户电话号码列表 -->
|
||||
<list-item id="contactPhoneNumbersListItem" class="list-details-number-list-item"
|
||||
for="{{ contactForm.phoneNumbers }}" ontouchstart="listItemTouchStart"
|
||||
onlongpress="listItemOnLongPressNumber({{ $idx }})">
|
||||
@@ -96,7 +94,6 @@
|
||||
class="todo-divider" show="{{ $item.showElement }}"></divider>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户邮箱列表 -->
|
||||
<list-item id="contactEmailsListItem" class="list-details-number-list-item" for="{{ contactForm.emails }}"
|
||||
ontouchstart="listItemTouchStart">
|
||||
<div id="contactEmailsDiv{{ $idx }}" class="list-details-number-div" show="{{ $item.showElement }}"
|
||||
@@ -115,7 +112,6 @@
|
||||
show="{{ $item.showElement }}"></divider>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:及时消息 -->
|
||||
<list-item id="contactImMessagesListItem" class="list-details-number-list-item"
|
||||
for="{{ contactForm.imAddresses }}" ontouchstart="listItemTouchStart">
|
||||
<div id="contactImMessagesDiv{{ $idx }}" class="list-details-number-div" show="{{ $item.showElement }}"
|
||||
@@ -149,7 +145,6 @@
|
||||
show="{{ $item.showElement }}"></divider>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:昵称 -->
|
||||
<list-item id="contactNicknameListItem" class="list-details-number-list-item"
|
||||
if="{{ contactForm.nickName && contactForm.nickName.length > 0 }}" ontouchstart="listItemTouchStart">
|
||||
<div id="contactNicknameDiv" class="list-details-email-sub-div-left" show="{{ contactForm.showNickNameP }}"
|
||||
@@ -161,7 +156,6 @@
|
||||
show="{{ contactForm.showNickNameP }}"></divider>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:网站 -->
|
||||
<list-item id="contactWebsitesListItem" class="list-details-number-list-item" for="{{ contactForm.websites }}"
|
||||
onclick="openBrowser({{ $idx }})" ontouchstart="listItemTouchStart">
|
||||
<div id="contactWebsitesDiv{{ $idx }}" class="list-details-number-div" show="{{ $item.showElement }}"
|
||||
@@ -178,7 +172,6 @@
|
||||
show="{{ $item.showElement }}"></divider>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:住宅 -->
|
||||
<list-item class="list-details-number-list-item"
|
||||
for="{{ contactForm.postalAddresses }}" id="todo-item-{{ $idx }}" ontouchstart="listItemTouchStart">
|
||||
<div id="contactPostalAddressDiv{{ $idx }}" class="list-details-number-div" show="{{ $item.showElement }}"
|
||||
@@ -198,7 +191,6 @@
|
||||
class="todo-divider" show="{{ $item.showElement }}"></divider>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:events 事件记录 -->
|
||||
<list-item id="contactEventsListItem" class="list-details-number-list-item" for="{{ contactForm.events }}">
|
||||
<div id="contactEventsDiv{{ $idx }}" class="list-details-number-div" show="{{ $item.showElement }}"
|
||||
onclick="openCalenderApp({{ $idx }})" onlongpress="listItemOnLongPressContent({{ $item.eventDate }})" ontouchstart="listItemTouchStart">
|
||||
@@ -222,7 +214,6 @@
|
||||
show="{{ $item.showElement }}"></divider>
|
||||
</list-item>
|
||||
|
||||
<!-- 群组 -->
|
||||
<list-item id="contactGroupListItem" class="list-details-number-list-item"
|
||||
if="{{ contactForm.showGroupsString && contactForm.showGroupsString.length > 0 }}" ontouchstart="listItemTouchStart">
|
||||
<div id="contactGroupDiv" class="list-details-email-sub-div-left" show="{{ contactForm.showGroupsP }}"
|
||||
@@ -234,7 +225,6 @@
|
||||
show="{{ contactForm.showGroupsP }}"></divider>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:姓名拼音 -->
|
||||
<list-item id="contactPinyinNameListItem" class="list-details-number-list-item"
|
||||
if="{{ contactForm.pinYinName && contactForm.pinYinName.length > 0 }}" ontouchstart="listItemTouchStart">
|
||||
<div id="contactPinyinNameDiv" class="list-details-email-sub-div-left"
|
||||
@@ -248,7 +238,6 @@
|
||||
show="{{ contactForm.showPinYinNameP }}"></divider>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:关联关系 -->
|
||||
<list-item id="contactRelationsListItem" class="list-details-number-list-item"
|
||||
for="{{ contactForm.relations }}" ontouchstart="listItemTouchStart">
|
||||
<div id="contactRelationsDiv{{ $idx }}" class="list-details-number-div" show="{{ $item.showElement }}"
|
||||
@@ -268,7 +257,6 @@
|
||||
show="{{ $item.showElement }}"></divider>
|
||||
</list-item>
|
||||
|
||||
<!-- 用户更多信息列表:备注 -->
|
||||
<list-item id="contactRemarkListItem" class="list-details-number-list-item"
|
||||
if="{{ contactForm.note && contactForm.note.length > 0 }}" ontouchstart="listItemTouchStart">
|
||||
<div id="contactRemarkDiv" class="list-details-email-sub-div-left" show="{{ contactForm.showNoteP }}"
|
||||
@@ -280,7 +268,6 @@
|
||||
show="{{ contactForm.showNoteP }}"></divider>
|
||||
</list-item>
|
||||
|
||||
<!-- 更多折叠框 -->
|
||||
<list-item id="contactMoreButtonListItem" class="list-details-email-operate-more" onclick="getMore"
|
||||
if="{{ contactForm.showMoreButton }}">
|
||||
<div id="contactMoreButtonDiv" class="list-details-number-operate">
|
||||
@@ -294,21 +281,18 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 界限分割 -->
|
||||
<list-item id="contactListItemDetailAndRecordDivider"
|
||||
if="{{ contactForm.numRecords && contactForm.numRecords.length > 0 }}"
|
||||
class="list-details-email-divider-record">
|
||||
<divider class="todo-divider-record"></divider>
|
||||
</list-item>
|
||||
|
||||
<!-- 通话记录列表 -->
|
||||
<list-item id="contactDialRecordsHeaderListItem" class="list-details-calls-title">
|
||||
<div id="contactDialRecordsHeaderListItemDiv"
|
||||
if="{{ contactForm.numRecords && contactForm.numRecords.length > 0 }}"
|
||||
class="list-details-calls-title-div">
|
||||
<text class="list-details-calls-title-text-left">{{ $t('value.callRecords.calls') }}</text>
|
||||
|
||||
<!--清空-->
|
||||
<text class="list-details-calls-title-text-right" onclick="clearPhoneRecords">{{
|
||||
$t('value.callRecords.clear') }}</text>
|
||||
</div>
|
||||
@@ -327,15 +311,12 @@
|
||||
<image if="{{ $item.callType == 1 }}" class="list-details-calls-type-image"
|
||||
src="{{ icContactsCallIn }}"></image>
|
||||
|
||||
<!-- 呼出记录 -->
|
||||
<image if="{{ $item.callType == 2 }}" class="list-details-calls-type-image"
|
||||
src="{{ icContactsCallOut }}"></image>
|
||||
|
||||
<!-- 未接来电 -->
|
||||
<image if="{{ $item.callType == 3 }}" class="list-details-calls-type-image"
|
||||
src="{{ icContactsCallMissed }}"></image>
|
||||
|
||||
<!-- 拒接来电 -->
|
||||
<image if="{{ $item.callType == 5 }}" class="list-details-calls-type-image"
|
||||
src="{{ icContactsCallRejected }}"></image>
|
||||
<text class="list-details-calls-type-text">{{ $item.formatNumber }}</text>
|
||||
@@ -351,7 +332,6 @@
|
||||
</list-item>
|
||||
</list>
|
||||
|
||||
<!-- 新号码操作 -->
|
||||
<div id="contactNewNumberBottomButtonDiv"
|
||||
if="{{ contactForm.showNewContact != undefined && contactForm.showNewContact }}"
|
||||
class="records-detail-contacts-operate">
|
||||
@@ -371,7 +351,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 已存在联系人操作 -->
|
||||
<!-- The contact operation already exists -->
|
||||
<div id="contactSaveContactBottomButtonDiv" else class="records-detail-contacts-operate">
|
||||
<div id="contactSaveContactBottomButtonSub1Div" class="contacts-operate-detail-box" ontouchend="selectFavorite">
|
||||
<image if="{{ (contacts.starred && contacts.starred == 1) }}" class="contacts-operate-detail-image"
|
||||
@@ -394,7 +374,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--点击通话记录最上侧:清除通话记录清除按钮弹窗-->
|
||||
<!--Click top of call History: Clear Call History Clear button pops up-->
|
||||
<dialog id="clearRecordsDialog" class="delete-main">
|
||||
<div id="clearRecordsDialogSubDiv" class="delete-div">
|
||||
<text class="txt-v">{{ $t('phone.clearRecords') }}</text>
|
||||
@@ -408,7 +388,7 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!-- 长按电话号码,弹出呼叫前编辑等 -->
|
||||
<!-- Long press the phone number, pop up call before editing, etc -->
|
||||
<menu id="itemMenuNumber" class="item-menu" onselected="todoSelectedPhoneNumber">
|
||||
<option class="share-name-text-big" value="phoneNumbers">
|
||||
{{ (showPhoneNumber && showPhoneNumber.length > 0) ? showPhoneNumber : '' }}
|
||||
@@ -428,7 +408,7 @@
|
||||
</option>
|
||||
</menu>
|
||||
|
||||
<!-- 长按详情内容,弹出复制到剪贴板 -->
|
||||
<!-- Hold down the details to copy to the clipboard -->
|
||||
<menu id="itemMenuContent" class="item-menu" onselected="todoSelectedContent">
|
||||
<option class="share-name-text-big" value="copyToClickBoardName">
|
||||
{{ (copyToClipBoardContent && copyToClipBoardContent.length > 0) ? copyToClipBoardContent : '' }}
|
||||
@@ -438,7 +418,7 @@
|
||||
</option>
|
||||
</menu>
|
||||
|
||||
<!-- 点击住宅等地址,弹出地图选择框,显示查看地图,弹出复制到剪贴板 -->
|
||||
<!-- Click the address such as residence, popup map selection box, display view map, popup copy to clipboard -->
|
||||
<dialog id="dialogPostalAddressMap" class="delete-main-map">
|
||||
<div id="deleteCheckDialogPostalAddressMapDiv" class="delete-div-map">
|
||||
<div id="deleteCheckDialogPostalAddressMapSubDivSub1" class="delete-btn-map">
|
||||
@@ -461,7 +441,7 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!-- 长按通话记录:弹出呼叫前删除和呼叫前编辑等 -->
|
||||
<!-- Long press call history to delete or edit a call before a call is displayed -->
|
||||
<menu id="itemMenu" onselected="todoSelected">
|
||||
<option class="share-name-text-big" value="phoneNumbers">
|
||||
{{ showNameLastMenu && showNameLastMenu.length > 0 ? showNameLastMenu : '' }}
|
||||
@@ -474,7 +454,7 @@
|
||||
</option>
|
||||
</menu>
|
||||
|
||||
<!--长按通话记录:删除通话记录弹窗-->
|
||||
<!--Hold down call History: Delete call history pop-up window-->
|
||||
<dialog id="deleteCheckDialog" class="delete-main">
|
||||
<div id="deleteCheckDialogDiv" class="delete-div">
|
||||
<text class="txt-v">{{
|
||||
@@ -490,7 +470,6 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!--1.新建联系(尚未保存联系人):进入后只可以弹出擦除通话记录-->
|
||||
<menu id="contactNewNumberBottom" onselected="shareSelectRecord">
|
||||
<option class="share-name-text" value="deleteRecord"
|
||||
disabled='{{ (! contactForm.numRecords || contactForm.numRecords.length == 0) }}'>
|
||||
@@ -498,7 +477,6 @@
|
||||
</option>
|
||||
</menu>
|
||||
|
||||
<!--2.已保存联系人:点击更多弹出删除联系人,如果同时有通话记录,也要弹出擦除通话记录-->
|
||||
<menu id="contactSaveContactBottom" onselected="shareSelectContact">
|
||||
<option show="{{ contactForm.numRecords && contactForm.numRecords.length > 0 }}" class="share-name-text"
|
||||
value="deleteRecord">
|
||||
@@ -512,7 +490,6 @@
|
||||
</option>
|
||||
</menu>
|
||||
|
||||
<!--删除联系人 deletedialogcontact 弹出框-->
|
||||
<dialog id="deletedialogcontact" class="delete-main">
|
||||
<div id="deletedialogcontactDiv" class="delete-div">
|
||||
<text class="txt-v">{{ $t('value.contacts.page.menu.deleteInfo.warningInfo') }}</text>
|
||||
@@ -527,7 +504,6 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!--删除通话记录 deletedialogrecord 弹出框-->
|
||||
<dialog id="deletedialogrecord" class="delete-main">
|
||||
<div id="deletedialogrecordDiv" class="delete-div">
|
||||
<text class="txt-v">{{ $t('value.contacts.page.menu.deleteInfo.warningInfoRecord') }}</text>
|
||||
@@ -541,7 +517,6 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!-- 点击右上角二维码,弹出生成的二维码图标 -->
|
||||
<dialog id="dialogContactsDetailQrCode" class="delete-main-qrcode">
|
||||
<div id="deleteCheckDialogPostalAddressMapDiv" class="qrcode-main-div">
|
||||
<div id="dialogContactsDetailQrCodeSubDiv1" class="qrcode-div">
|
||||
@@ -560,7 +535,6 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!--更多分享联系人弹窗选择-->
|
||||
<dialog id="shareDialogDetails" class="share-dialog-main" oncancel="firstDialogCancel">
|
||||
<div id="shareDialogDiv" class="share-dialog-div">
|
||||
<div id="shareDialogDivSub1" class="share-inner-div">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,7 +34,7 @@
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
margin-left: 25px;
|
||||
margin-right: 25px;/* margin-top: 20px;*/
|
||||
margin-right: 25px;
|
||||
}
|
||||
.div-details-item-first {
|
||||
flex-direction: column;
|
||||
@@ -336,7 +336,6 @@
|
||||
.list-details-calls-time {
|
||||
height: 50%;
|
||||
width: 100%;
|
||||
/*border-bottom: 1px;*/
|
||||
}
|
||||
.list-details-calls-time-text {
|
||||
font-size: 32px;
|
||||
@@ -596,12 +595,6 @@
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.share-name-text-map {
|
||||
/*font-size: 30px;
|
||||
text-color: #000000;
|
||||
text-align: left;
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
background-color: grey;*/
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
font-size: 30px;
|
||||
|
||||
@@ -234,7 +234,6 @@
|
||||
}
|
||||
|
||||
.free-space-content {
|
||||
margin-top: 100px;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@@ -255,7 +254,7 @@
|
||||
}
|
||||
|
||||
.free-btn-div {
|
||||
margin-top: 33px;
|
||||
margin-bottom: 60px;
|
||||
width: 350px;
|
||||
height: 71px;
|
||||
border-radius: 50px;
|
||||
@@ -520,7 +519,7 @@
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 28px;
|
||||
color: grey;
|
||||
color: #808080;
|
||||
max-lines: 1;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
@@ -806,9 +805,7 @@
|
||||
height: 200px;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
align-items: center;/* align-content: center;*/
|
||||
/* align-items: flex-start;*/
|
||||
/* justify-content: space-around;*/
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.import-dialog-div {
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-->
|
||||
<!--联系人-->
|
||||
<!--The contact-->
|
||||
<div id="container" class="container">
|
||||
<!-- 联系人标题-->
|
||||
<!-- Contact Title-->
|
||||
<div class="todo-title-div">
|
||||
<div class="contacts-back-but-div {{ animation.backBut }}" ontouchstart="back">
|
||||
<image class="contacts-back-image" src="/res/image/ic_back.svg"></image>
|
||||
@@ -194,7 +194,6 @@
|
||||
onscrolltop="scrollTop" onscroll="scroll" cachedcount="{{limit}}" onrequestitem="requestItem"
|
||||
updateeffect="false">
|
||||
|
||||
<!-- 群组 -->
|
||||
<list-item id="todo-item-one" class="todo-item" onclick="onClickGroups"
|
||||
if="{{this.$app.$def.globalData.isDisplay}}">
|
||||
<div id="todo-content-div-one" class="todo-content-div first" show="{{layoutState }}">
|
||||
@@ -259,7 +258,7 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 联系人列表-->
|
||||
<!-- Contact list-->
|
||||
<list-item for="{{contactsList}}" id="todo-item-{{$idx}}" class="todo-item"
|
||||
section="{{$item.namePrefix}}" ontouchstart="listItemTouchStart"
|
||||
onclick="showRecordDetails({{$idx}},'contacts')"
|
||||
@@ -359,7 +358,7 @@
|
||||
</div>
|
||||
</dialog>
|
||||
</div>
|
||||
<!--导入联系人弹窗-->
|
||||
<!--Import contacts popup-->
|
||||
<dialog id="importContactsDialog" class="share-dialog-main" oncancel="firstDialogCancel">
|
||||
<div class="import-div">
|
||||
<div class="share-inner-div">
|
||||
@@ -384,7 +383,6 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!-- 导入弹窗-->
|
||||
<dialog id="ImportDialog" class="import-dialog-main">
|
||||
<div class="import-dialog-div" >
|
||||
<div class="import-inner-txt">
|
||||
|
||||
@@ -38,9 +38,9 @@ export default {
|
||||
Y: 0
|
||||
},
|
||||
myCardInfo: {
|
||||
cardId: '', // 我的名片联系人id
|
||||
cardName: '', // 我的名片联系人名称
|
||||
hasMyCard: false, // 是否存在我的名片
|
||||
cardId: '',
|
||||
cardName: '',
|
||||
hasMyCard: false,
|
||||
},
|
||||
nameSuffix: '',
|
||||
portraitPath: '',
|
||||
@@ -104,7 +104,6 @@ export default {
|
||||
LOG.info(TAG + 'onBackPress contacts page.');
|
||||
},
|
||||
|
||||
// 刷新页面
|
||||
onRefresh: function () {
|
||||
LOG.info(TAG + 'Contacts onRefresh --------------start');
|
||||
this.contactCount = 0;
|
||||
@@ -127,7 +126,6 @@ export default {
|
||||
text: this.$t('value.contacts.page.menu.shareInfo.content.text')
|
||||
}];
|
||||
|
||||
// 初始化动画元素隐藏
|
||||
this.animation.isSearch = this.$app.$def.globalData.contactsAnimation.isSearch;
|
||||
this.animation.title = this.$app.$def.globalData.contactsAnimation.title;
|
||||
this.animation.setting = this.$app.$def.globalData.contactsAnimation.setting;
|
||||
@@ -147,8 +145,6 @@ export default {
|
||||
LOG.info(TAG + 'Contacts onRefresh --------------end');
|
||||
},
|
||||
|
||||
|
||||
// radio选项初始化
|
||||
radioInit: function () {
|
||||
let data = this.$app.$def.globalData.storage.getSync('contacts_settings_display_account_radio', 'allContacts');
|
||||
switch (data) {
|
||||
@@ -178,11 +174,9 @@ export default {
|
||||
};
|
||||
|
||||
this.requestInit(2001, requestData);
|
||||
/* 此处延时请求,避免概率性数据阻塞问题 */
|
||||
this.conciseLayoutInit();
|
||||
},
|
||||
|
||||
// 缓存分页加载
|
||||
requestItem: function () {
|
||||
if (this.contactsList.length < this.contactCount) {
|
||||
this.page++;
|
||||
@@ -194,9 +188,7 @@ export default {
|
||||
this.requestPage(2001, requestData);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 初始化列表数据
|
||||
*/
|
||||
|
||||
requestInit: function (code, data) {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
LOG.info(TAG + 'requestInit get DAHelper --------------');
|
||||
@@ -243,10 +235,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 初始化列表数据
|
||||
*/
|
||||
requestRefresh: function (code, data) {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
LOG.info(TAG + 'Contacts requestRefresh get DAHelper --------------');
|
||||
@@ -287,15 +275,11 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 简洁布局选项初始化
|
||||
conciseLayoutInit: function () {
|
||||
let data = this.$app.$def.globalData.storage.getSync('contacts_settings_concise_layout_switch', 'false');
|
||||
this.layoutState = data == 'true' ? false : true;
|
||||
},
|
||||
|
||||
|
||||
// 线程暂停函数
|
||||
sleep: function (milliSeconds) {
|
||||
var startTime = new Date().getTime();
|
||||
while (new Date().getTime() < startTime + milliSeconds) {
|
||||
@@ -303,11 +287,8 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 分页列表数据
|
||||
*/
|
||||
requestPage: function (code, data) {
|
||||
LOG.info(TAG + 'requestPage code' +'data')
|
||||
LOG.info(TAG + 'requestPage code' + 'data')
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
if (data.queryContactsType == 'custom') {
|
||||
let ret = this.$app.$def.globalData.storage.getSync('contacts_settings_customize_view_input', 'false');
|
||||
@@ -352,15 +333,14 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 列表滑动到最低
|
||||
scrollBottom: function () {
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除联系人列表数据
|
||||
* Delete contact list data
|
||||
*
|
||||
* @param code 2005 FA与PA通行协议码
|
||||
* @param data contactId 联系人ID
|
||||
* @param code
|
||||
* @param data contactId The contact ID
|
||||
*/
|
||||
deleteContactData: function (code, data) {
|
||||
LOG.info(TAG + 'deleteContactData code' + 'data')
|
||||
@@ -391,17 +371,17 @@ export default {
|
||||
switch (idx) {
|
||||
case 0:
|
||||
prompt.showToast({
|
||||
message: '调用分享二维码三方'
|
||||
message: 'Call share qr code three parties'
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
prompt.showToast({
|
||||
message: '调用分享vCard三方'
|
||||
message: 'Call share vCard three parties'
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
prompt.showToast({
|
||||
message: '调用文本三方'
|
||||
message: 'Call text tripartite'
|
||||
});
|
||||
break;
|
||||
default:
|
||||
@@ -427,16 +407,15 @@ export default {
|
||||
};
|
||||
this.deleteContactData(2003, requestData);
|
||||
},
|
||||
// 导入联系人弹窗出现
|
||||
|
||||
importContactClicked: function () {
|
||||
this.$element('importContactsDialog').show();
|
||||
},
|
||||
|
||||
// 导入联系人弹窗消失
|
||||
importCancelClick: function () {
|
||||
this.$element('importContactsDialog').close();
|
||||
},
|
||||
//
|
||||
|
||||
importClick: function (idx) {
|
||||
LOG.info(TAG + 'shareClick idx' + idx)
|
||||
switch (idx) {
|
||||
@@ -449,14 +428,14 @@ export default {
|
||||
closeImportDialog: function () {
|
||||
this.$element('ImportDialog').close();
|
||||
},
|
||||
// 页面无列表数据显示新建联系人事件
|
||||
|
||||
newContactClicked: function () {
|
||||
router.push({
|
||||
uri: 'pages/contacts/accountants/accountants',
|
||||
params: {},
|
||||
});
|
||||
},
|
||||
// 页面添加联系人按钮
|
||||
|
||||
addContactClicked: function () {
|
||||
router.push({
|
||||
uri: 'pages/contacts/accountants/accountants',
|
||||
@@ -469,7 +448,7 @@ export default {
|
||||
this.position.Y = Math.round(event.touches[0].globalY);
|
||||
},
|
||||
listItemOnLongPress: function (index, event) {
|
||||
LOG.info(TAG + 'listItemOnLongPress index' + index + 'event' )
|
||||
LOG.info(TAG + 'listItemOnLongPress index' + index + 'event')
|
||||
this.contactsName = event.emptyNameData == undefined || event.emptyNameData == '' ? '' : this.slice(event.emptyNameData, 9);
|
||||
this.isShowName = event.emptyNameData == '' || event.emptyNameData == undefined ? false : true;
|
||||
this.deleteIndex = event.contactId;
|
||||
@@ -484,7 +463,7 @@ export default {
|
||||
});
|
||||
}, 1);
|
||||
},
|
||||
// 处理字符串问题
|
||||
|
||||
slice: function (str, maxLength) {
|
||||
LOG.info(TAG + 'slice str' + str + 'maxLength' + maxLength)
|
||||
var result = '';
|
||||
@@ -542,26 +521,19 @@ export default {
|
||||
return result;
|
||||
},
|
||||
|
||||
/* 通过文字二进制得到文字字节数 */
|
||||
getByteByBinary: function (binaryCode) {
|
||||
LOG.info(TAG + 'getByteByBinary binaryCode' + binaryCode)
|
||||
/**
|
||||
* 二进制 Binary system,es6表示时以0b开头
|
||||
* 八进制 Octal number system,es5表示时以0开头,es6表示时以0o开头
|
||||
* 十进制 Decimal system
|
||||
* 十六进制 Hexadecimal,es5、es6表示时以0x开头
|
||||
**/
|
||||
var byteLengthDatas = [0, 1, 2, 3, 4];
|
||||
var len = byteLengthDatas[Math.ceil(binaryCode.length / 8)];
|
||||
return len;
|
||||
},
|
||||
/* 通过文字十六进制得到文字字节数 */
|
||||
|
||||
getByteByHex: function (hexCode) {
|
||||
LOG.info(TAG + 'getByteByHex hexCode' + hexCode)
|
||||
return this.getByteByBinary(parseInt(hexCode, 16).toString(2));
|
||||
},
|
||||
|
||||
// Menu选择项
|
||||
|
||||
todoSelected: function (event) {
|
||||
LOG.info(TAG + 'todoSelected event' + event)
|
||||
if (event.value == 'delete') {
|
||||
@@ -577,7 +549,6 @@ export default {
|
||||
this.deleteIndex = '';
|
||||
},
|
||||
|
||||
// 搜索框聚焦事件
|
||||
focusSearch: function (e) {
|
||||
LOG.info(TAG + 'focusSearch e' + e);
|
||||
},
|
||||
@@ -603,7 +574,6 @@ export default {
|
||||
this.isSearchList = false;
|
||||
this.$app.$def.setIsSearchList(this.isSearchList);
|
||||
this.listHeight = '72%';
|
||||
// 动画变换
|
||||
this.animation.title = 'show-title';
|
||||
this.animation.setting = 'show-setting';
|
||||
this.animation.contactTitle = 'show-contact-title';
|
||||
@@ -622,7 +592,6 @@ export default {
|
||||
},
|
||||
touchStartSearch: function () {
|
||||
LOG.info(TAG + 'search is touchStartSearch');
|
||||
// 动画效果变换
|
||||
this.animation.contactTitle = '';
|
||||
this.animation.setting = '';
|
||||
this.animation.backBut = '';
|
||||
@@ -655,7 +624,6 @@ export default {
|
||||
focus: true
|
||||
})
|
||||
},
|
||||
// 搜索框
|
||||
changeSearch: function (e) {
|
||||
LOG.info(TAG + 'changeSearch e.text');
|
||||
if (e.text == '') {
|
||||
@@ -673,16 +641,12 @@ export default {
|
||||
});
|
||||
this.isSearchList = true;
|
||||
this.$app.$def.setIsSearchList(this.isSearchList);
|
||||
// 调用后台接口
|
||||
var data = {};
|
||||
data.likeValue = e.text;
|
||||
this.searchResult(data);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取查询数据结果
|
||||
*/
|
||||
searchResult: function (data) {
|
||||
LOG.info(TAG + 'searchResult data' + data);
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
@@ -701,49 +665,48 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 处理高亮数据函数
|
||||
processHighLight: function (searchList, likeValue) {
|
||||
LOG.info(TAG + 'processHighLight searchList' + 'likeValue' + likeValue);
|
||||
LOG.info(TAG + 'processHighLight searchList' + 'likeValue' + likeValue);
|
||||
searchList.forEach((element) => {
|
||||
if (element.searchMimetype[0].search('/name') != -1) {
|
||||
|
||||
this.conditionOne(element,likeValue)
|
||||
this.conditionOne(element, likeValue)
|
||||
|
||||
} else if (element.searchMimetype[0].search('/organization') != -1) {
|
||||
|
||||
this.conditionTwo(element,likeValue)
|
||||
this.conditionTwo(element, likeValue)
|
||||
|
||||
this.conditionThree(element,likeValue)
|
||||
this.conditionThree(element, likeValue)
|
||||
|
||||
} else if (element.searchMimetype[0].search('/phone') != -1) {
|
||||
|
||||
this.conditionFour(element,likeValue)
|
||||
this.conditionFour(element, likeValue)
|
||||
|
||||
} else if (element.searchMimetype[0].search('/email') != -1) {
|
||||
|
||||
this.conditionFive(element,likeValue)
|
||||
this.conditionFive(element, likeValue)
|
||||
|
||||
} else if (element.searchMimetype[0].search('/im') != -1) {
|
||||
|
||||
this.conditionSix(element,likeValue)
|
||||
this.conditionSix(element, likeValue)
|
||||
|
||||
} else if (element.searchMimetype[0].search('/postal-address_v2') != -1) {
|
||||
|
||||
this.conditionSeven(element,likeValue)
|
||||
this.conditionSeven(element, likeValue)
|
||||
}
|
||||
else if (element.searchMimetype[0].search('/note') != -1) {
|
||||
|
||||
this.conditionEight(element,likeValue)
|
||||
this.conditionEight(element, likeValue)
|
||||
|
||||
} else if (element.searchMimetype[0].search('/nickname') != -1) {
|
||||
|
||||
this.conditionNine(element,likeValue)
|
||||
this.conditionNine(element, likeValue)
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
conditionOne:function(element,likeValue){
|
||||
conditionOne: function (element, likeValue) {
|
||||
LOG.info(TAG + 'conditionOne element' + 'likeValue' + likeValue);
|
||||
var emptyName = element.emptyNameData;
|
||||
var emptyNameMatch = this.highLightChars(emptyName, likeValue);
|
||||
@@ -763,8 +726,8 @@ export default {
|
||||
element.emptyNameSuf = emptyNameSuf;
|
||||
},
|
||||
|
||||
conditionTwo:function(element,likeValue){
|
||||
LOG.info(TAG + 'conditionTwo element' + 'likeValue' + likeValue);
|
||||
conditionTwo: function (element, likeValue) {
|
||||
LOG.info(TAG + 'conditionTwo element' + 'likeValue' + likeValue);
|
||||
var organizationTitle = element.organization.title;
|
||||
if (this.isEmpty(organizationTitle)) {
|
||||
organizationTitlePre = '';
|
||||
@@ -789,7 +752,7 @@ export default {
|
||||
element.organization.organizationTitleSuf = organizationTitleSuf;
|
||||
},
|
||||
|
||||
conditionThree:function(element,likeValue){
|
||||
conditionThree: function (element, likeValue) {
|
||||
LOG.info(TAG + 'conditionThree element' + 'likeValue' + likeValue);
|
||||
var organizationName = element.organization.name;
|
||||
if (this.isEmpty(organizationName)) {
|
||||
@@ -814,7 +777,7 @@ export default {
|
||||
element.organization.organizationNameSuf = organizationNameSuf;
|
||||
},
|
||||
|
||||
conditionFour:function(element,likeValue){
|
||||
conditionFour: function (element, likeValue) {
|
||||
LOG.info(TAG + 'conditionFour element' + 'likeValue' + likeValue);
|
||||
var phoneNumber = element.phoneNumbers[0].phoneNumber;
|
||||
var phoneNumberMatch = this.highLightChars(phoneNumber, likeValue);
|
||||
@@ -833,7 +796,7 @@ export default {
|
||||
element.phoneNumbers[0].phoneNumberSuf = phoneNumberSuf;
|
||||
},
|
||||
|
||||
conditionFive:function(element,likeValue){
|
||||
conditionFive: function (element, likeValue) {
|
||||
LOG.info(TAG + 'conditionFive element' + 'likeValue' + likeValue);
|
||||
var email = element.emails[0].email;
|
||||
var emailMatch = this.highLightChars(email, likeValue);
|
||||
@@ -852,7 +815,7 @@ export default {
|
||||
element.emails[0].emailSuf = emailSuf;
|
||||
},
|
||||
|
||||
conditionSix:function(element,likeValue){
|
||||
conditionSix: function (element, likeValue) {
|
||||
LOG.info(TAG + 'conditionSix element' + 'likeValue' + likeValue);
|
||||
var imAddress = element.imAddresses[0].imAddress;
|
||||
var imAddressMatch = this.highLightChars(imAddress, likeValue);
|
||||
@@ -871,7 +834,7 @@ export default {
|
||||
element.imAddresses[0].imAddressSuf = imAddressSuf;
|
||||
},
|
||||
|
||||
conditionSeven:function(element,likeValue){
|
||||
conditionSeven: function (element, likeValue) {
|
||||
LOG.info(TAG + 'conditionSeven element' + 'likeValue' + likeValue);
|
||||
var postalAddress = element.postalAddresses[0].postalAddress;
|
||||
var postalAddressMatch = this.highLightChars(postalAddress, likeValue);
|
||||
@@ -890,7 +853,7 @@ export default {
|
||||
element.postalAddresses[0].postalAddressSuf = postalAddressSuf;
|
||||
},
|
||||
|
||||
conditionEight:function(element,likeValue){
|
||||
conditionEight: function (element, likeValue) {
|
||||
LOG.info(TAG + 'conditionEight element' + 'likeValue' + likeValue);
|
||||
var note = element.note.noteContent;
|
||||
var noteMatch = this.highLightChars(note, likeValue);
|
||||
@@ -909,8 +872,8 @@ export default {
|
||||
element.note.noteSuf = noteSuf;
|
||||
},
|
||||
|
||||
conditionNine:function(element,likeValue){
|
||||
LOG.info(TAG + 'conditionEight element'+ 'likeValue' + likeValue);
|
||||
conditionNine: function (element, likeValue) {
|
||||
LOG.info(TAG + 'conditionEight element' + 'likeValue' + likeValue);
|
||||
var nickName = element.nickName.nickName;
|
||||
var nickNameMatch = this.highLightChars(nickName, likeValue);
|
||||
var nickNamePre = '';
|
||||
@@ -928,9 +891,8 @@ export default {
|
||||
element.nickName.nickNameSuf = nickNameSuf;
|
||||
},
|
||||
|
||||
// 高亮显示函数
|
||||
highLightChars: function (targetStr, matchStr) {
|
||||
LOG.info(TAG + 'highLightChars targetStr'+ 'matchStr');
|
||||
LOG.info(TAG + 'highLightChars targetStr' + 'matchStr');
|
||||
if (this.isEmpty(targetStr) || this.isEmpty(matchStr)) {
|
||||
return '';
|
||||
}
|
||||
@@ -961,7 +923,6 @@ export default {
|
||||
}
|
||||
return result;
|
||||
},
|
||||
// 判空函数
|
||||
isEmpty: function (str) {
|
||||
LOG.info(TAG + 'isEmpty str');
|
||||
return str == undefined || str == null || str == '';
|
||||
@@ -973,7 +934,6 @@ export default {
|
||||
LOG.log(TAG + 'cancelSearchDialog');
|
||||
},
|
||||
|
||||
// 点击群组跳转
|
||||
onClickGroups: function () {
|
||||
LOG.log(TAG + 'click groups');
|
||||
router.push({
|
||||
@@ -982,10 +942,9 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 点击跳转我的名片
|
||||
redirectCard: function () {
|
||||
LOG.info(TAG + 'onclick card ');
|
||||
if (this.myCardInfo.hasMyCard) { // 存在我的名片则获取名片详情后,跳转到我的名片界面
|
||||
if (this.myCardInfo.hasMyCard) {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
cardModel.getCardDetails(DAHelper, this.myCardInfo.cardId, (result) => {
|
||||
var contactForm = result.data;
|
||||
@@ -996,9 +955,9 @@ export default {
|
||||
},
|
||||
});
|
||||
});
|
||||
} else { // 不存在我的名片则先获取到默认卡号,再跳转到新建名片界面
|
||||
} else {
|
||||
this.getDefaultSimNumber((defaultSimNumber) => {
|
||||
if(Utils.isEmpty(defaultSimNumber)) { // 无默认卡号时,直接跳转
|
||||
if (Utils.isEmpty(defaultSimNumber)) {
|
||||
router.push({
|
||||
uri: 'pages/contacts/accountants/accountants',
|
||||
params: {
|
||||
@@ -1030,17 +989,17 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
/* 获取默认sim卡号 */
|
||||
|
||||
async getDefaultSimNumber(callBack) {
|
||||
var defaultSimSlot = 0;
|
||||
var defaultSimNumber = '';
|
||||
try{
|
||||
defaultSimSlot = await sim.getDefaultVoiceSlotId(); // 获取默认卡槽
|
||||
}catch{
|
||||
try {
|
||||
defaultSimSlot = await sim.getDefaultVoiceSlotId();
|
||||
} catch {
|
||||
defaultSimSlot = 0;
|
||||
LOG.error(TAG + 'get default sim slot error!');
|
||||
}
|
||||
try{
|
||||
try {
|
||||
defaultSimNumber = await sim.getSimTelephoneNumber(defaultSimSlot);
|
||||
} catch {
|
||||
defaultSimNumber = '';
|
||||
@@ -1052,16 +1011,16 @@ export default {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
cardModel.getMyCardId(DAHelper, (cardMainInfo) => {
|
||||
LOG.error(TAG + 'initMyCard cardMainInfo');
|
||||
if (Utils.isEmpty(cardMainInfo)) { // 不存在我的名片
|
||||
if (Utils.isEmpty(cardMainInfo)) {
|
||||
this.myCardInfo.hasMyCard = false;
|
||||
} else { // 存在我的名片
|
||||
} else {
|
||||
this.myCardInfo.hasMyCard = true;
|
||||
this.myCardInfo.cardName = cardMainInfo.cardName;
|
||||
this.myCardInfo.cardId = cardMainInfo.cardId;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 点击跳转显示详情
|
||||
|
||||
showRecordDetails: function (index, type) {
|
||||
LOG.error(TAG + 'showRecordDetails index' + index);
|
||||
var contactId = type == 'search' ? this.searchList[index].contactId : this.contactsList[index].contactId;
|
||||
@@ -1074,7 +1033,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 选择跳转到设置页面
|
||||
settingOnSelected: function (event) {
|
||||
if (event.value == 'settings') {
|
||||
router.push({
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
}
|
||||
|
||||
.batch-delete-operation-button:active {
|
||||
background-color: lightgray;
|
||||
background-color: #FFD3D3D3;
|
||||
}
|
||||
|
||||
.batch-delete-operation-button:disabled {
|
||||
@@ -250,6 +250,7 @@
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn-txt {
|
||||
width: 40%;
|
||||
height: 70%;
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
</text>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<!-- Right detail and checkbox Icon -->
|
||||
<div style="margin-right : 10px;">
|
||||
<input type="checkbox" checked="{{ item.checked }}" onchange="itemClick(item)"></input>
|
||||
</div>
|
||||
@@ -93,7 +93,7 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!--新建群组-->
|
||||
<!-- New group -->
|
||||
<dialog id="addGroupDialog" class="dialog-main">
|
||||
<div class="dialog-div">
|
||||
<div class="inner-txt">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file: 操作群组
|
||||
* @file: Group operating
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -25,7 +25,7 @@ var TAG = 'deleteGroup...:';
|
||||
|
||||
export default {
|
||||
data: {
|
||||
// 新增联系人标识
|
||||
// New contact ID
|
||||
addContactStatus: false,
|
||||
reset: '/res/image/ic_cancel_m.svg',
|
||||
save: '/res/image/ic_comfirm.svg',
|
||||
@@ -37,13 +37,13 @@ export default {
|
||||
deleteDialogTitle: '',
|
||||
checkedNum: 0,
|
||||
contactForm: {},
|
||||
// 新建群组
|
||||
// New group
|
||||
newGroupName: '',
|
||||
page: 0,
|
||||
limit: 20, // 一页显示条目数量
|
||||
limit: 20, // Number of entries per page
|
||||
addShow: false,
|
||||
updataShow: false,
|
||||
screenDirection: 0, // 0:竖屏,1:横屏
|
||||
screenDirection: 0, // 0: vertical screen, 1: horizontal screen
|
||||
oldParam: [],
|
||||
dataflag: false,
|
||||
groups: []
|
||||
@@ -58,7 +58,6 @@ export default {
|
||||
this.getGroupList(requestData);
|
||||
},
|
||||
|
||||
// 缓存分页加载
|
||||
requestItem: function () {
|
||||
this.page++;
|
||||
var requestData = {
|
||||
@@ -120,7 +119,7 @@ export default {
|
||||
this.isEmpty = false;
|
||||
}
|
||||
},
|
||||
// 监控编辑页面的数据是否变动
|
||||
|
||||
isSameData(existData, newData, type = 'Object') {
|
||||
if (type == 'Array') {
|
||||
if (Object.prototype.toString.call(existData) != '[object Array]' || Object.prototype.toString.call(newData) != '[object Array]') {
|
||||
@@ -248,7 +247,6 @@ export default {
|
||||
|
||||
},
|
||||
|
||||
// 选择群组
|
||||
selectGroups() {
|
||||
var addConGroups = [];
|
||||
this.groupList.forEach((item) => {
|
||||
@@ -285,7 +283,7 @@ export default {
|
||||
this.$app.$def.globalData.groupParams = params;
|
||||
router.back();
|
||||
},
|
||||
// 返回上层页面
|
||||
|
||||
back () {
|
||||
router.back({
|
||||
path:'pages/contacts/accountants/accountants'
|
||||
|
||||
+2
-2
@@ -103,7 +103,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<!-- Right detail and checkbox Icon -->
|
||||
<div class="{{ layoutState ? 'phoneNumber-checkbox-div' : 'phoneNumber-checkbox-div1'
|
||||
}}">
|
||||
<input type="checkbox" class="checkbox" checked="{{ phoneNumber.checked }}"
|
||||
@@ -207,7 +207,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<!-- Right detail and checkbox Icon -->
|
||||
<div class="{{ layoutState ? 'phoneNumber-checkbox-div' : 'phoneNumber-checkbox-div1'
|
||||
}}">
|
||||
<input type="checkbox" class="checkbox" checked="{{ phoneNumber.checked }}"
|
||||
|
||||
+18
-30
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 联系人分组列表
|
||||
* @file Contact Group List
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -26,7 +26,7 @@ var TAG = 'groupListWithContacts...:';
|
||||
export default {
|
||||
props: ['titleShow', 'checkItemState', 'checkedNumberMap'],
|
||||
data: {
|
||||
page: 0, // 初始加载当前页
|
||||
page: 0, // Initial load current page
|
||||
limit: 20,
|
||||
groupList: [],
|
||||
favoritesItem: {
|
||||
@@ -36,9 +36,9 @@ export default {
|
||||
contactCount: 0,
|
||||
},
|
||||
phoneNumberLabelNames: [],
|
||||
title: '', // 页面标题
|
||||
layoutState: true, // 简介布局
|
||||
checkedNum: 0 // 已选数量
|
||||
title: '', // Page title
|
||||
layoutState: true, // Introduction layout
|
||||
checkedNum: 0 // Selected quantity
|
||||
},
|
||||
onInit() {
|
||||
LOG.info(TAG + 'onInit success');
|
||||
@@ -58,48 +58,42 @@ export default {
|
||||
};
|
||||
this.getGroupList(requestData);
|
||||
this.$app.$def.globalData.batchSelectContactsRefreshFunction.push(()=> {
|
||||
/* 刷新群组联系人列表复选框状态 */
|
||||
this.groupList.forEach((groupItem) => {
|
||||
this.refreshContactCheckState(groupItem);
|
||||
});
|
||||
/* 刷新收藏列表复选框状态 */
|
||||
this.refreshContactCheckState(this.favoritesItem);
|
||||
});
|
||||
},
|
||||
|
||||
// 简洁布局选项初始化
|
||||
conciseLayoutInit: function () {
|
||||
LOG.info(TAG + 'conciseLayoutInit success');
|
||||
let data = this.$app.$def.globalData.storage.getSync('contacts_settings_concise_layout_switch', 'false');
|
||||
this.layoutState = data == 'true' ? false : true;
|
||||
},
|
||||
|
||||
/* 刷新群组列表复选框状态 */
|
||||
refreshCheckState: function () {
|
||||
/* 刷新群组联系人列表复选框状态 */
|
||||
this.groupList.forEach((groupItem) => {
|
||||
LOG.info(TAG + 'refreshCheckState groupItem' + groupItem);
|
||||
this.refreshContactCheckState(groupItem);
|
||||
});
|
||||
/* 刷新收藏列表复选框状态 */
|
||||
this.refreshContactCheckState(this.favoritesItem);
|
||||
},
|
||||
refreshContactCheckState: function (groupItem) {
|
||||
LOG.info(TAG + 'refreshContactCheckState groupItem' + groupItem);
|
||||
groupItem.checked = false;
|
||||
var expandChecked = true; // 是否需要选中群组;
|
||||
var expandChecked = true; // Do you want to select a group;
|
||||
var tempContactBeans = [];
|
||||
groupItem.contactBeans.forEach((contactItem) => {
|
||||
if (contactItem.phoneNumbers && contactItem.phoneNumbers.length != 0) {
|
||||
for (var i = 0; i < contactItem.phoneNumbers.length; i++) {
|
||||
var phoneNumber = contactItem.phoneNumbers[i];
|
||||
if (this.checkedNumberMap.has(phoneNumber.phoneNumber.replace(/\s+/g, ''))) { // 已被选中
|
||||
if (this.checkedNumberMap.has(phoneNumber.phoneNumber.replace(/\s+/g, ''))) { // Selected
|
||||
phoneNumber.checked = true;
|
||||
} else {
|
||||
if (phoneNumber.checked) { // 若原来已选中但 已选列表中没有,则说明在其他页签取消
|
||||
if (phoneNumber.checked) {
|
||||
phoneNumber.checked = false;
|
||||
}
|
||||
if (i == 0) { // 群组中的首个联系人未被选中时,不选中群组
|
||||
if (i == 0) { // When the first contact in the group is not selected, the group is not selected
|
||||
expandChecked = false;
|
||||
}
|
||||
}
|
||||
@@ -113,7 +107,7 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 缓存分页加载
|
||||
// Cache paging load
|
||||
requestItem: function () {
|
||||
this.page++;
|
||||
var requestData = {
|
||||
@@ -126,14 +120,14 @@ export default {
|
||||
this.getGroupList(requestData);
|
||||
},
|
||||
|
||||
// 获取群组列表
|
||||
// Get group list
|
||||
getGroupList: function (actionData) {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
groupReq.getGroupListAndContacts(DAHelper, actionData, result=>{
|
||||
if (result.code == 0) {
|
||||
LOG.info(TAG + 'get group list come code');
|
||||
if (result.resultList.length > 0) {
|
||||
// 遍历给复选框默认值
|
||||
// Traverse the default values for the check boxes
|
||||
result.resultList.forEach((groupItem) => {
|
||||
groupItem.checked = false;
|
||||
groupItem.expand = false;
|
||||
@@ -166,7 +160,6 @@ export default {
|
||||
groupItem.expand = !groupItem.expand;
|
||||
},
|
||||
|
||||
// 群组复选框选中事件
|
||||
groupItemChecked: function (groupItem) {
|
||||
LOG.info(TAG + 'groupItemChecked groupItem' + groupItem);
|
||||
groupItem.checked = !groupItem.checked;
|
||||
@@ -191,7 +184,7 @@ export default {
|
||||
this.checkedNum = this.checkedNum + temNum;
|
||||
if (checkedList.length > 0) {
|
||||
this.$emit('addCheckedContact', {
|
||||
checkedList: checkedList // 需要增加的已选号码
|
||||
checkedList: checkedList // Selected number to add
|
||||
});
|
||||
}
|
||||
} else {
|
||||
@@ -211,7 +204,7 @@ export default {
|
||||
});
|
||||
if (checkedList.length > 0) {
|
||||
this.$emit('deleteCheckedContact', {
|
||||
checkedList: checkedList // 需要删除的已选号码
|
||||
checkedList: checkedList // Selected number to delete
|
||||
});
|
||||
}
|
||||
this.checkedNum = this.checkedNum - temNum;
|
||||
@@ -219,7 +212,6 @@ export default {
|
||||
this.initTitle();
|
||||
},
|
||||
|
||||
// 联系人点击事件
|
||||
contactItemClick: function (phoneNumIndex, contactItem, groupItem) {
|
||||
LOG.info(TAG + 'contactItemClick contactItem' + contactItem);
|
||||
contactItem.phoneNumbers[phoneNumIndex].checked = !contactItem.phoneNumbers[phoneNumIndex].checked;
|
||||
@@ -230,7 +222,7 @@ export default {
|
||||
checkedList: [{
|
||||
name: contactItem.emptyNameData,
|
||||
number: contactItem.phoneNumbers[phoneNumIndex].phoneNumber.replace(/\s+/g, '')
|
||||
}] // 需要增加的已选号码
|
||||
}] // Selected number to add
|
||||
});
|
||||
} else {
|
||||
this.checkedNum--;
|
||||
@@ -239,7 +231,7 @@ export default {
|
||||
checkedList: [{
|
||||
name: contactItem.emptyNameData,
|
||||
number: contactItem.phoneNumbers[phoneNumIndex].phoneNumber.replace(/\s+/g, '')
|
||||
}] // 需要取消的已选号码
|
||||
}] // Selected number to cancel
|
||||
});
|
||||
}
|
||||
this.initTitle();
|
||||
@@ -247,20 +239,18 @@ export default {
|
||||
|
||||
initOtherGroupCheckbox: function (phoneNumIndex, contactItem) {
|
||||
LOG.info(TAG + 'initOtherGroupCheckbox contactItem' + contactItem);
|
||||
// 遍历其他group,如果选中的同一个联系人,则其他的也需要选中
|
||||
// Traverse other groups. If the same contact is selected, other groups also need to be selected
|
||||
this.groupList.forEach((group) => {
|
||||
this.initGroupContactsCheckBox(group, phoneNumIndex, contactItem);
|
||||
});
|
||||
// 遍历收藏联系人列表,如果选中同一个联系人,收藏列表的联系人也要选中
|
||||
this.initGroupContactsCheckBox(this.favoritesItem, phoneNumIndex, contactItem);
|
||||
},
|
||||
|
||||
/* 初始化指定群组联系人的复选框状态 */
|
||||
initGroupContactsCheckBox: function (group, phoneNumIndex, contactItem) {
|
||||
LOG.info(TAG + 'initGroupContactsCheckBox contactItem' + contactItem);
|
||||
var checkedNum = 0;
|
||||
group.contactBeans.forEach((contact) => {
|
||||
// 同一个联系人下的同一个号码选中状态一致
|
||||
// The same number under the same contact has the same selected status
|
||||
if (contact.contactId == contactItem.contactId) {
|
||||
contact.phoneNumbers[phoneNumIndex].checked = contactItem.phoneNumbers[phoneNumIndex].checked;
|
||||
}
|
||||
@@ -276,7 +266,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 加载title
|
||||
initTitle: function () {
|
||||
if (this.checkedNum != 0) {
|
||||
this.title = this.$t('value.contacts.groupsPage.alreadySelect').replace('num', this.checkedNum + '');
|
||||
@@ -285,7 +274,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
},
|
||||
|
||||
+2
-2
@@ -135,7 +135,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--群组重命名-->
|
||||
<!-- group rename -->
|
||||
<dialog id="renameGroupDialog" class="dialog-main">
|
||||
<div class="dialog-div">
|
||||
<div class="inner-txt" >
|
||||
@@ -156,7 +156,7 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!--删除群组-->
|
||||
<!-- Delete Group -->
|
||||
<dialog id="deleteGroupDialog" class="dialog-main">
|
||||
<div class="dialog-div">
|
||||
<div class="inner-txt">
|
||||
|
||||
+7
-16
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 组成员列表
|
||||
* @file Group membership list
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -29,17 +29,17 @@ export default {
|
||||
data: {
|
||||
groupItem: {
|
||||
title: ''
|
||||
}, // 群组对象
|
||||
}, // Group object
|
||||
contactCount: 0,
|
||||
layoutState: true,
|
||||
dialogInputActive: false, // dialog的input框默认不激活
|
||||
contactsList: [], // 数据列表
|
||||
operateItem: {}, // 长按操作的联系人item
|
||||
dialogInputActive: false, // The input box of dialog is not activated by default
|
||||
contactsList: [], // Data list
|
||||
operateItem: {}, // Long press and hold the contact item
|
||||
newGroupName: '',
|
||||
showEmptyPage: false,
|
||||
menuContactName: '', // 长按menu的标题
|
||||
menuContactName: '', // Long press the title of the menu
|
||||
page: 0,
|
||||
limit: 20, // 一页显示条目数量
|
||||
limit: 20, // Number of entries per page
|
||||
backgroundColor: backgroundColor.Color
|
||||
},
|
||||
onInit() {
|
||||
@@ -52,19 +52,16 @@ export default {
|
||||
this.getContactsList();
|
||||
},
|
||||
|
||||
// 简洁布局选项初始化
|
||||
conciseLayoutInit: function () {
|
||||
LOG.info(TAG + 'conciseLayoutInit success');
|
||||
let data = this.$app.$def.globalData.storage.getSync('contacts_settings_concise_layout_switch', 'false');
|
||||
this.layoutState = data == 'true' ? false : true;
|
||||
},
|
||||
|
||||
// 缓存分页加载
|
||||
requestItem: function () {
|
||||
this.page++;
|
||||
},
|
||||
|
||||
// 群组信息查询
|
||||
getContactsList: function () {
|
||||
var actionData = {
|
||||
page: this.page,
|
||||
@@ -136,7 +133,6 @@ export default {
|
||||
});
|
||||
}, 1);
|
||||
},
|
||||
// Menu选择项
|
||||
menuSelected: function (event) {
|
||||
if (event.value == 'deleteFromGroup') {
|
||||
let contactBeans = {};
|
||||
@@ -152,7 +148,6 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
// Menu选择项
|
||||
moreMenuSelected: function (event) {
|
||||
if (event.value == 'deleteMember') {
|
||||
router.push({
|
||||
@@ -176,7 +171,6 @@ export default {
|
||||
this.dialogInputActive = true;
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
},
|
||||
@@ -191,7 +185,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 发送短信
|
||||
clickSendMsg: function () {
|
||||
router.push({
|
||||
uri: 'pages/contacts/groups/selectGroupMembers/selectGroupMembers',
|
||||
@@ -202,7 +195,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 发送邮件
|
||||
clickSendEmail: function () {
|
||||
router.push({
|
||||
uri: 'pages/contacts/groups/selectGroupMembers/selectGroupMembers',
|
||||
@@ -234,7 +226,6 @@ export default {
|
||||
|
||||
moreTouchStart: function (e) {
|
||||
LOG.info(TAG + 'moreTouchStart e' + e);
|
||||
/* 记录底部更多触摸起点 */
|
||||
this.touchMoveStartX = e.touches[0].globalX;
|
||||
this.touchMoveStartY = e.touches[0].globalY;
|
||||
},
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/-->
|
||||
<div id="container" class="container">
|
||||
<div class="groups-title-div">
|
||||
<!-- back键和群组title -->
|
||||
<!-- Back key and group title -->
|
||||
<div class="groups-back-but-div" onclick="back">
|
||||
<image class="groups-back-image" src="/res/image/ic_back.svg"></image>
|
||||
</div>
|
||||
@@ -24,7 +24,7 @@
|
||||
</div>
|
||||
|
||||
<list class="group-list" cachedcount="{{ limit }}" onrequestitem="requestItem">
|
||||
<!-- 智能群组 -->
|
||||
<!-- Intelligent group -->
|
||||
<list-item class="list-item" style="height: 50px;">
|
||||
<div class="contact-phone-groups-div">
|
||||
<text class="contact-smart-groups-text">
|
||||
@@ -32,7 +32,7 @@
|
||||
</text>
|
||||
</div>
|
||||
</list-item>
|
||||
<!-- 最近联系人 -->
|
||||
<!-- recent contacts -->
|
||||
<list-item class="list-item">
|
||||
<div class="mobile-groups-content-div" onclick="recentContactsClicked">
|
||||
<div class="mobile-groups-div">
|
||||
@@ -52,7 +52,7 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 群组循环列表 -->
|
||||
<!-- Group loop list -->
|
||||
<list-item class="list-item" for="{{ item in groupList }}" @touchstart="listItemTouchStart"
|
||||
onlongpress="groupLongPress(item)" >
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--新建群组-->
|
||||
<!-- New group -->
|
||||
<dialog id="addGroupDialog" class="dialog-main">
|
||||
<div class="dialog-div">
|
||||
<div class="inner-txt">
|
||||
@@ -116,7 +116,7 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!--群组重命名-->
|
||||
<!-- group rename -->
|
||||
<dialog id="renameGroupDialog" class="dialog-main">
|
||||
<div class="dialog-div">
|
||||
<div class="inner-txt">
|
||||
@@ -138,7 +138,7 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!--删除群组-->
|
||||
<!-- Delete Group -->
|
||||
<dialog id="deleteGroupDialog" class="dialog-main">
|
||||
<div class="dialog-div">
|
||||
<div class="inner-txt">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 群组
|
||||
* @file group
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -25,11 +25,11 @@ var TAG = 'Groups...:';
|
||||
|
||||
export default {
|
||||
data: {
|
||||
page: 0, // 初始加载当前页
|
||||
page: 0, // Initial load current page
|
||||
limit: 20,
|
||||
groupList: [],
|
||||
newGroupName: '', // 新增群组的群组名
|
||||
updateGroupName: '', // 更新群组的群组名
|
||||
newGroupName: '', // Group name of the new group
|
||||
updateGroupName: '', // Update the group name of the group
|
||||
menuGroupName: '',
|
||||
dialogInputActive: false,
|
||||
showEmptyPage: false,
|
||||
@@ -39,7 +39,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化页面
|
||||
onInit() {
|
||||
LOG.info(TAG + 'onInit success');
|
||||
},
|
||||
@@ -73,7 +72,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 缓存分页加载
|
||||
requestItem: function () {
|
||||
this.page++;
|
||||
var requestData = {
|
||||
@@ -83,7 +81,6 @@ export default {
|
||||
this.getGroupList(requestData);
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
},
|
||||
@@ -103,7 +100,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 群组循环列表点击
|
||||
groupItemClick: function (item) {
|
||||
LOG.info(TAG + 'groupItemClick item' + item);
|
||||
router.push({
|
||||
@@ -139,7 +135,6 @@ export default {
|
||||
}, 1);
|
||||
},
|
||||
|
||||
// Menu选择项
|
||||
todoSelected: function (event) {
|
||||
if (event.value == 'delete') {
|
||||
this.$element('deleteGroupDialog').show();
|
||||
@@ -149,7 +144,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 确认删除群组
|
||||
confirmDeleteGroup: function () {
|
||||
this.$element('deleteGroupDialog').close();
|
||||
var actionData = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 最近联系人
|
||||
* @file recent contacts
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,7 @@ import LOG from '../../../../utils/ContactsLog.js';
|
||||
var TAG = 'recentContacts...:';
|
||||
|
||||
/**
|
||||
* @file 最近联系人
|
||||
* @file recent contacts
|
||||
*/
|
||||
export default {
|
||||
data: {
|
||||
@@ -59,26 +59,25 @@ export default {
|
||||
}];
|
||||
},
|
||||
|
||||
// 跳转联系人列表界面
|
||||
itemClick: function (item) {
|
||||
LOG.info(TAG + 'itemClick item' + item);
|
||||
var params = {
|
||||
title: item.name
|
||||
};
|
||||
switch (item.id) {
|
||||
case 1: // 7天
|
||||
case 1: // 7 days
|
||||
params.startDate = 0;
|
||||
params.endDate = 7;
|
||||
break;
|
||||
case 2: // 一个月
|
||||
case 2: // one month
|
||||
params.startDate = 7;
|
||||
params.endDate = 30;
|
||||
break;
|
||||
case 3: // 三个月
|
||||
case 3: // three months
|
||||
params.startDate = 30;
|
||||
params.endDate = 90;
|
||||
break;
|
||||
case 4: // 三个月以上
|
||||
case 4: // More than three months
|
||||
params.startDate = -1;
|
||||
params.endDate = 90;
|
||||
break;
|
||||
@@ -94,7 +93,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
},
|
||||
|
||||
+1
@@ -105,6 +105,7 @@
|
||||
width: 100%;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.contact-pho
|
||||
ne-groups-div {
|
||||
width: 100%;
|
||||
|
||||
+7
-12
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 最近联系人列表
|
||||
* @file Recent Contact list
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -31,17 +31,17 @@ export default {
|
||||
title: '',
|
||||
endDate: 0,
|
||||
startDate: 0
|
||||
}, // 群组对象
|
||||
}, // Group object
|
||||
contactCount: 0,
|
||||
layoutState: true,
|
||||
dialogInputActive: false, // dialog的input框默认不激活
|
||||
contactsList: [], // 数据列表
|
||||
operateItem: {}, // 长按操作的联系人item
|
||||
dialogInputActive: false, // The input box of dialog is not activated by default
|
||||
contactsList: [], // Data list
|
||||
operateItem: {}, // Long press and hold the contact item
|
||||
newGroupName: '',
|
||||
showEmptyPage: false,
|
||||
menuContactName: '', // 长按menu的标题
|
||||
menuContactName: '', // Long press the title of the menu
|
||||
page: 0,
|
||||
limit: 20, // 一页显示条目数量
|
||||
limit: 20, // Number of entries per page
|
||||
backgroundColor: backgroundColor.Color
|
||||
},
|
||||
onInit() {
|
||||
@@ -54,13 +54,11 @@ export default {
|
||||
this.page = 0;
|
||||
},
|
||||
|
||||
// 简洁布局选项初始化
|
||||
conciseLayoutInit: function () {
|
||||
let data = this.$app.$def.globalData.storage.getSync('contacts_settings_concise_layout_switch', 'false');
|
||||
this.layoutState = data == 'true' ? false : true;
|
||||
},
|
||||
|
||||
// 缓存分页加载
|
||||
requestItem: function () {
|
||||
this.page++;
|
||||
},
|
||||
@@ -114,12 +112,10 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
},
|
||||
|
||||
// 发送短信
|
||||
clickSendMsg: function () {
|
||||
router.push({
|
||||
uri: 'pages/contacts/groups/selectGroupMembers/selectGroupMembers',
|
||||
@@ -133,7 +129,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 发送邮件
|
||||
clickSendEmail: function () {
|
||||
router.push({
|
||||
uri: 'pages/contacts/groups/selectGroupMembers/selectGroupMembers',
|
||||
|
||||
+2
-2
@@ -69,7 +69,7 @@
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.todo-search-div {/* position: relative;*/
|
||||
.todo-search-div {
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
@@ -348,7 +348,7 @@
|
||||
}
|
||||
|
||||
.batch-delete-operation-button:active {
|
||||
background-color: lightgray;
|
||||
background-color: #FFD3D3D3;
|
||||
}
|
||||
|
||||
.batch-delete-operation-button:disabled {
|
||||
|
||||
+4
-4
@@ -97,7 +97,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<!-- Right detail and checkbox Icon -->
|
||||
<div class="contact-checkbox-div">
|
||||
<input type="checkbox" checked="{{ phoneNumber.checked }}"
|
||||
onchange="contactItemClick(phoneNumIndex,contactItem)">
|
||||
@@ -158,7 +158,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<!-- Right detail and checkbox Icon -->
|
||||
<div class="contact-checkbox-div">
|
||||
<input type="checkbox" checked="{{ email.checked }}"
|
||||
onchange="emailItemClick(emailIndex,contactItem)">
|
||||
@@ -244,7 +244,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<!-- Right detail and checkbox Icon -->
|
||||
<div class="contact-checkbox-div">
|
||||
<input type="checkbox" checked="{{ phoneNumber.checked }}"
|
||||
onchange="searchContactItemClick(phoneNumIndex,contactItem)">
|
||||
@@ -315,7 +315,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<!-- Right detail and checkbox Icon -->
|
||||
<div class="contact-checkbox-div">
|
||||
<input type="checkbox" checked="{{ email.checked }}"
|
||||
onchange="searchEmailItemClick(emailIndex,contactItem)">
|
||||
|
||||
+47
-72
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 选择组成员
|
||||
* @file Select group members
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -27,36 +27,36 @@ var TAG = 'selectGroupMembers...:';
|
||||
const PHONE_ITEM_TYPE = 'phone';
|
||||
const EMAIL_ITEM_TYPE = 'email';
|
||||
const NAME_ITEM_TYPE = 'name';
|
||||
const SEARCH_TYPE_IN_GROUP = 2; // 群组内搜索
|
||||
const SEARCH_TYPE_IN_GROUP = 2; // Intra group search
|
||||
|
||||
/**
|
||||
* @file 选择组成员
|
||||
* @file Select group members
|
||||
*/
|
||||
export default {
|
||||
data: {
|
||||
page: 0,
|
||||
limit: 100, // 一页显示条目数量
|
||||
title: '', // 标题
|
||||
type: '', // 操作类型
|
||||
groupId: 0, // 群组id
|
||||
checkedNum: 0, // 已选择联系人数量
|
||||
contactsList: [], // 联系人列表
|
||||
matchingResults: [], // 搜索结果
|
||||
checkedList: [], // 已选中的数据
|
||||
phoneNumberLabelNames: [], // 电话号码标签集合
|
||||
emailsLabelNames: [], // 邮箱标签集合
|
||||
showEmptyPage: false, // 显示空页面
|
||||
noMatchingResults: false, // 显示搜索结果为空
|
||||
showSelectAll: true, // 全选,
|
||||
layoutState: true, // 简洁布局
|
||||
showContactList: true, // 显示联系人列表
|
||||
showMatchContactsList: false, // 显示搜索结果
|
||||
limit: 100, // Number of entries per page
|
||||
title: '', // title
|
||||
type: '', // Operation type
|
||||
groupId: 0, // Group ID
|
||||
checkedNum: 0, // Number of contacts selected
|
||||
contactsList: [], // contact list
|
||||
matchingResults: [], // search result
|
||||
checkedList: [], // Selected data
|
||||
phoneNumberLabelNames: [], // Phone number label collection
|
||||
emailsLabelNames: [], // Mailbox label collection
|
||||
showEmptyPage: false, // Show empty page
|
||||
noMatchingResults: false, // The displayed search results are empty
|
||||
showSelectAll: true, // Select all
|
||||
layoutState: true, // Concise layout
|
||||
showContactList: true, // Show contact list
|
||||
showMatchContactsList: false, // Display search results
|
||||
addMemberDisabled: true,
|
||||
showPhoneNumber: true, // 是否是展示电话号码
|
||||
showEmail: false, // 是否是展示邮箱
|
||||
pageParams: '', // 最近联系人参数
|
||||
startDate: '', // 最近联系人参数开始时间
|
||||
endDate: '', // 最近联系人参数结束时间
|
||||
showPhoneNumber: true, // Show phone number
|
||||
showEmail: false, // Is it a display mailbox
|
||||
pageParams: '', // Recent contact parameters
|
||||
startDate: '', // Last contact parameter start time
|
||||
endDate: '', // Last contact parameter end time
|
||||
index: ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
|
||||
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '…']
|
||||
},
|
||||
@@ -89,15 +89,11 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 简洁布局选项初始化
|
||||
conciseLayoutInit: function () {
|
||||
let data = this.$app.$def.globalData.storage.getSync('contacts_settings_concise_layout_switch', 'false');
|
||||
this.layoutState = data == 'true' ? false : true;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取群组列表
|
||||
*/
|
||||
getGroupMemberList: function () {
|
||||
let filterItem = '';
|
||||
if (this.showPhoneNumber) {
|
||||
@@ -146,7 +142,7 @@ export default {
|
||||
LOG.info(TAG + 'conditionOne item' + item);
|
||||
if (this.showPhoneNumber && item.phoneNumbers && item.phoneNumbers.length != 0) {
|
||||
let tempContacts = utils.copy(item);
|
||||
tempContacts.phoneNumbers.length = 0; // 将电话数组置为空
|
||||
tempContacts.phoneNumbers.length = 0; // Leave the phone array empty
|
||||
item.phoneNumbers.forEach((phoneNumber, index) => {
|
||||
phoneNumber.backGroundColor = '#FFFFFF';
|
||||
if (index == 0) {
|
||||
@@ -167,7 +163,7 @@ export default {
|
||||
LOG.info(TAG + 'conditionTwo item' + item);
|
||||
if (this.showEmail && item.emails && item.emails.length != 0) {
|
||||
let tempContacts = utils.copy(item);
|
||||
tempContacts.emails.length = 0; // 将电话数组置为空
|
||||
tempContacts.emails.length = 0; // Leave the phone array empty
|
||||
item.emails.forEach((email, index) => {
|
||||
if (index == 0) {
|
||||
this.checkedNum++;
|
||||
@@ -183,9 +179,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取最近联系人列表
|
||||
*/
|
||||
getRecentContacts: function () {
|
||||
let filterItem = '';
|
||||
if (this.showPhoneNumber) {
|
||||
@@ -229,7 +222,7 @@ export default {
|
||||
result.resultList.forEach((item) => {
|
||||
if (this.showPhoneNumber && item.phoneNumbers && item.phoneNumbers.length != 0) {
|
||||
let tempContacts = utils.copy(item);
|
||||
tempContacts.phoneNumbers.length = 0; // 将电话数组置为空
|
||||
tempContacts.phoneNumbers.length = 0; // Leave the phone array empty
|
||||
item.phoneNumbers.forEach((phoneNumber, index) => {
|
||||
phoneNumber.backGroundColor = '#FFFFFF';
|
||||
if (index == 0) {
|
||||
@@ -246,7 +239,7 @@ export default {
|
||||
}
|
||||
if (this.showEmail && item.emails && item.emails.length != 0) {
|
||||
let tempContacts = utils.copy(item);
|
||||
tempContacts.emails.length = 0; // 将电话数组置为空
|
||||
tempContacts.emails.length = 0; // Leave the phone array empty
|
||||
item.emails.forEach((email, index) => {
|
||||
if (index == 0) {
|
||||
this.checkedNum++;
|
||||
@@ -265,7 +258,6 @@ export default {
|
||||
|
||||
clickSearch: function (e) {
|
||||
LOG.info(TAG + 'clickSearch e' + e);
|
||||
// 搜索输入框
|
||||
if (e.text) {
|
||||
this.showContactList = false;
|
||||
this.showMatchContactsList = true;
|
||||
@@ -280,9 +272,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 搜索请求后台
|
||||
* Search request background
|
||||
*
|
||||
* @param {string} keyText 输入框文本内容
|
||||
* @param {string} keyText Input box text content
|
||||
*/
|
||||
searchRequest: function (keyText) {
|
||||
let searchProperty = [NAME_ITEM_TYPE];
|
||||
@@ -303,7 +295,7 @@ export default {
|
||||
groupReq.searchContacts(DAHelper, requestData, result => {
|
||||
this.matchingResults = [];
|
||||
if (result.code == 0 && result.contactCount > 0) {
|
||||
// 判断如果是已经选中的,则初始化为选中状态
|
||||
// Judge that if it is already selected, it will be initialized to the selected status
|
||||
result.data.forEach((item) => {
|
||||
this.conditionThree(item);
|
||||
this.conditionFour(item);
|
||||
@@ -327,20 +319,20 @@ export default {
|
||||
LOG.info(TAG + 'conditionThree item' + item);
|
||||
if (this.showPhoneNumber && item.phoneNumbers && item.phoneNumbers.length != 0) {
|
||||
let tempContacts = utils.copy(item);
|
||||
tempContacts.phoneNumbers = []; // 将电话数组置为空
|
||||
tempContacts.phoneNumbers = []; // Leave the phone array empty
|
||||
item.phoneNumbers.forEach((phoneNumber) => {
|
||||
if (this.indexOf(tempContacts.phoneNumbers, phoneNumber.phoneNumber) == -1) {
|
||||
tempContacts.phoneNumbers.push(phoneNumber);
|
||||
phoneNumber.checked = false;
|
||||
phoneNumber.backGroundColor = '#FFFFFF';
|
||||
|
||||
// 初始化可变名称
|
||||
// Initialize variable name
|
||||
this.variableName(item, keyText);
|
||||
|
||||
// 初始化可变手机号
|
||||
// Initialize variable phone number
|
||||
this.variablePhoneNumber(item, keyText);
|
||||
this.contactsList.forEach((checkedContact) => {
|
||||
// 如果联系人id一样,则初始化选中状态
|
||||
// If the contact ID is the same, the selected status will be initialized
|
||||
if (checkedContact.contactId == item.contactId) {
|
||||
checkedContact.phoneNumbers.forEach((checkedPhoneNumber) => {
|
||||
if (checkedPhoneNumber.phoneNumber == phoneNumber.phoneNumber
|
||||
@@ -360,19 +352,19 @@ export default {
|
||||
LOG.info(TAG + 'conditionFour item' + item);
|
||||
if (this.showEmail && item.emails && item.emails.length != 0) {
|
||||
let tempContacts = utils.copy(item);
|
||||
tempContacts.emails = []; // 将电话数组置为空
|
||||
tempContacts.emails = []; // Leave the phone array empty
|
||||
item.emails.forEach((email) => {
|
||||
if (this.indexOf(tempContacts.emails, email.email) == -1) {
|
||||
tempContacts.emails.push(email);
|
||||
email.checked = false;
|
||||
|
||||
// 初始化可变名称
|
||||
// Initialize variable name
|
||||
this.variableName(item, keyText);
|
||||
// 初始化可变邮箱号
|
||||
// Initialize variable mailbox number
|
||||
this.variableEmail(item, keyText);
|
||||
|
||||
this.contactsList.forEach((checkedContact) => {
|
||||
// 如果联系人id一样,则初始化选中状态
|
||||
// If the contact ID is the same, the selected status will be initialized
|
||||
if (checkedContact.contactId == item.contactId) {
|
||||
checkedContact.emails.forEach((checkedEmail) => {
|
||||
if (checkedEmail.email == email.email && checkedEmail.checked) {
|
||||
@@ -406,9 +398,9 @@ export default {
|
||||
} else {
|
||||
this.checkedNum--;
|
||||
}
|
||||
// 修改contactList数据的选中状态
|
||||
// Modify the selected status of contactlist data
|
||||
this.contactsList.forEach((checkedContact) => {
|
||||
// 如果联系人id一样,则初始化选中状态
|
||||
// If the contact ID is the same, the selected status will be initialized
|
||||
if (checkedContact.contactId == contactItem.contactId) {
|
||||
checkedContact.phoneNumbers.forEach((checkedPhoneNumber) => {
|
||||
if (checkedPhoneNumber.phoneNumber == contactItem.phoneNumbers[phoneNumIndex].phoneNumber) {
|
||||
@@ -422,10 +414,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* email选中事件
|
||||
* Email selected event
|
||||
*
|
||||
* @param {number} emailIndex 邮件索引
|
||||
* @param {Object} emailItem 邮件对象
|
||||
* @param {number} emailIndex Mail index
|
||||
* @param {Object} emailItem Mail object
|
||||
*/
|
||||
emailItemClick: function (emailIndex, emailItem) {
|
||||
LOG.info(TAG + 'emailItemClick emailIndex' + emailIndex + 'emailItem' + emailItem);
|
||||
@@ -446,9 +438,9 @@ export default {
|
||||
} else {
|
||||
this.checkedNum--;
|
||||
}
|
||||
// 修改contactList数据的选中状态
|
||||
// Modify the selected status of contactlist data
|
||||
this.contactsList.forEach((checkedContact) => {
|
||||
// 如果联系人id一样,则初始化选中状态
|
||||
// If the contact ID is the same, the selected status will be initialized
|
||||
if (checkedContact.contactId == contactItem.contactId) {
|
||||
checkedContact.emails.forEach((checkedEmail) => {
|
||||
if (checkedEmail.email == contactItem.emails[emailNumIndex].email) {
|
||||
@@ -462,7 +454,7 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 跳转至发送短信或者邮件界面
|
||||
* Jump to send SMS or email interface
|
||||
*/
|
||||
clickAddMember: function () {
|
||||
if (this.showPhoneNumber) {
|
||||
@@ -506,7 +498,6 @@ export default {
|
||||
phoneNumber.backGroundColor = '#FFFFFF';
|
||||
},
|
||||
|
||||
// 更新操作按钮状态
|
||||
updateOperateButton: function (contactList) {
|
||||
LOG.info(TAG + 'updateOperateButton contactList' + contactList);
|
||||
var checkedList = [];
|
||||
@@ -541,9 +532,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 全选事件
|
||||
*/
|
||||
clickSelectAll: function () {
|
||||
var temNum = 0;
|
||||
if (this.showMatchContactsList) {
|
||||
@@ -581,9 +569,6 @@ export default {
|
||||
this.updateTitle();
|
||||
},
|
||||
|
||||
/**
|
||||
* 同步搜索结果的数据状态到联系人列表
|
||||
*/
|
||||
syncCheckedState: function () {
|
||||
if (this.showPhoneNumber) {
|
||||
for (let i = 0; i < this.contactsList.length; i++) {
|
||||
@@ -623,9 +608,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 取消全选事件
|
||||
*/
|
||||
clickCancelSelectAll: function () {
|
||||
var temNum = 0;
|
||||
if (this.showContactList) {
|
||||
@@ -680,9 +662,6 @@ export default {
|
||||
this.updateTitle();
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新标题
|
||||
*/
|
||||
updateTitle: function () {
|
||||
if (this.checkedNum != 0) {
|
||||
this.title = this.$t('value.contacts.groupsPage.alreadySelect').replace('num', this.checkedNum + '');
|
||||
@@ -691,7 +670,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
},
|
||||
@@ -710,7 +688,6 @@ export default {
|
||||
return -1;
|
||||
},
|
||||
|
||||
// 初始化可变颜色邮箱号
|
||||
variableEmail(item, keyText) {
|
||||
LOG.info(TAG + 'variableEmail item' + item);
|
||||
for (var i = 0; i < item.emails.length; i++) {
|
||||
@@ -729,7 +706,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化可变颜色名称
|
||||
variableName(item, keyText) {
|
||||
LOG.info(TAG + 'variableName item' + item);
|
||||
var matchString = utils.getMatchedString(item.emptyNameData, keyText);
|
||||
@@ -746,7 +722,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化可变颜色号码
|
||||
variablePhoneNumber(item, keyText) {
|
||||
LOG.info(TAG + 'variablePhoneNumber item' + item);
|
||||
for (var i = 0; i < item.phoneNumbers.length; i++) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*-->
|
||||
<div id="container" class="container">
|
||||
<!-- 收藏标题-->
|
||||
<!-- Collection Title-->
|
||||
<div if="{{ (type == 'editFavorites') && (contactsList.length != 0 || todoList.length != 0) }}"
|
||||
class="todo-search-div-favorite">
|
||||
<div class="setting-parent-div">
|
||||
@@ -27,7 +27,7 @@
|
||||
</text>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 未选择-->
|
||||
<!-- Not selected-->
|
||||
<div if="{{ ! ((type == 'editFavorites') && (contactsList.length != 0 || todoList.length != 0)) }}" class="title-div">
|
||||
<div class="back-but-div" ontouchend="back">
|
||||
<image if="{{type == 'saveContacts'}}" class="back-image" src="/res/image/ic_back.svg"></image>
|
||||
@@ -41,7 +41,7 @@
|
||||
<image src="/res/image/ic_comfirm.svg" class="select-contacts-title-image-right"></image>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 搜索联系人-->
|
||||
<!-- Search for contacts-->
|
||||
<div class="todo-search-div" if="{{ (contactsList.length != 0) && (type != 'editFavorites') }}"
|
||||
show="{{this.$app.$def.globalData.isDisplay}}">
|
||||
<search id="search" focusable="true" hint="{{ $t('value.contacts.page.search') }}" onchange="clickSearch"
|
||||
@@ -101,7 +101,7 @@
|
||||
</text>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<!-- Right detail and checkbox Icon-->
|
||||
<div if="{{ type != 'saveContacts' }}">
|
||||
<div class="allrecords-item-right-checkbox">
|
||||
<input type="checkbox" checked="{{ item.checked }}" onchange="itemClick(item)">
|
||||
@@ -120,7 +120,7 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 常用标题-->
|
||||
<!-- Common title-->
|
||||
<list-item class="todo-item-frequently" if="{{ (type == 'editFavorites') && (todoList.length != 0) }}" clickeffect="false">
|
||||
<div class="todo-user-title-div">
|
||||
<text class="title-text-unselect-favorite-size">
|
||||
@@ -129,7 +129,7 @@
|
||||
</div>
|
||||
</list-item>
|
||||
|
||||
<!-- 常用标题下列表内容-->
|
||||
<!-- List contents under common headings-->
|
||||
<list-item for="{{ todoList }}" class="todo-item" if="{{ (type == 'editFavorites') && (todoList.length != 0) }}">
|
||||
<div class="list-item-div" onclick="itemClick({{ $item }})">
|
||||
<div class="todo-content-div first" if="{{ layoutState }}">
|
||||
@@ -163,7 +163,7 @@
|
||||
<text class="todo-content" elif="{{ $item.numberType == 12 }}">{{ $t('accountants.switchboard') }} {{ $item.numbers }}</text>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<!-- Right detail and checkbox Icon-->
|
||||
<div>
|
||||
<div class="allrecords-item-right-checkbox">
|
||||
<input type="checkbox" checked="{{ $item.checked }}" onchange="itemClick({{ $item }})">
|
||||
@@ -294,7 +294,7 @@
|
||||
</text>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<!-- Right detail and checkbox Icon-->
|
||||
<div if="{{ type != 'saveContacts' }}">
|
||||
<div class="allrecords-item-right-checkbox">
|
||||
<input type="checkbox" checked="{{ item.checked }}" onchange="searchItemClick(item)">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 选择联系人列表
|
||||
* @file Selecting a Contact list
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -27,9 +27,9 @@ import Constants from '../../../../default/common/constants/Constants.js';
|
||||
|
||||
var TAG = 'selectContactsList...:';
|
||||
|
||||
const SEARCH_TYPE_FAVORITE = 1; // 搜索收藏
|
||||
const SEARCH_TYPE_IN_GROUP = 2; // 群组内搜索
|
||||
const SEARCH_TYPE_OUTSIDE_GROUP = 3; // 群组外搜索
|
||||
const SEARCH_TYPE_FAVORITE = 1; // Search collection
|
||||
const SEARCH_TYPE_IN_GROUP = 2; // Intra group search
|
||||
const SEARCH_TYPE_OUTSIDE_GROUP = 3; // Out of group search
|
||||
// 数字解释
|
||||
const NUMBERS_MEANING = {
|
||||
HEADER_MIN_HEIGHT: 60,
|
||||
@@ -44,23 +44,21 @@ const NUMBERS_MEANING = {
|
||||
const IS_FAVORITE = 1;
|
||||
const IS_NOT_FAVORITE = 0;
|
||||
|
||||
/**
|
||||
* @file 选择联系列表
|
||||
*/
|
||||
|
||||
export default {
|
||||
data: {
|
||||
title: '', // 标题
|
||||
title: '', // title
|
||||
type: '',
|
||||
groupId: 0,
|
||||
page: 0,
|
||||
limit: 20, // 一页显示条目数量
|
||||
showEmptyPage: false, // 列表页面为空
|
||||
noMatchingResults: false, // 显示搜索结果为空
|
||||
checkedNum: 0, // 已选择联系人数量
|
||||
contactsList: [], // 联系人列表
|
||||
todoList: [], // 收藏常用联系人
|
||||
matchingResults: [], // 搜索结果
|
||||
showSelectAll: true, // 全选,
|
||||
limit: 20, // Number of entries per page
|
||||
showEmptyPage: false, // The list page is empty
|
||||
noMatchingResults: false, // The displayed search results are empty
|
||||
checkedNum: 0, // Number of contacts selected
|
||||
contactsList: [], // contact list
|
||||
todoList: [], // Favorite contacts
|
||||
matchingResults: [], // search result
|
||||
showSelectAll: true, // SelectAll
|
||||
addMemberDisabled: true,
|
||||
layoutState: true,
|
||||
showContactList: true,
|
||||
@@ -76,8 +74,8 @@ export default {
|
||||
headerFavoriteMaginLeft: NUMBERS_MEANING.HEADER_MIN_MAGIN_LENGTH,
|
||||
headerFavoriteFontSize: NUMBERS_MEANING.HEADER_MAX_FONT_SIZE,
|
||||
checkedList: [],
|
||||
contactCount: 0, // 联系人总数
|
||||
frequentlyCount: 0, // 收藏常用总数
|
||||
contactCount: 0, // Total contacts
|
||||
frequentlyCount: 0, // Total number of favorites
|
||||
language: '',
|
||||
dialog: {
|
||||
dialogHeight: '',
|
||||
@@ -87,9 +85,9 @@ export default {
|
||||
warningChecked: false,
|
||||
buttonDisable: false,
|
||||
},
|
||||
isClickSelectAll: false, // 是否点过全选
|
||||
checkedContactIds: [], // 已选联系人集合
|
||||
unCheckedContactIds: [] // 反选联系人集合
|
||||
isClickSelectAll: false, // whether clicked select all
|
||||
checkedContactIds: [], // Selected contact collection
|
||||
unCheckedContactIds: [] // Unselect contact collection
|
||||
},
|
||||
onInit() {
|
||||
LOG.info(TAG + 'onInit success');
|
||||
@@ -118,7 +116,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 缓存分页加载
|
||||
requestItem: function () {
|
||||
this.page++;
|
||||
if (this.type == 'editFavorites') {
|
||||
@@ -258,7 +255,7 @@ export default {
|
||||
},
|
||||
clickSearch: function (e) {
|
||||
LOG.info(TAG + 'clickSearch e' + e);
|
||||
// 搜索输入框
|
||||
// Search input box
|
||||
if (e.text) {
|
||||
this.showContactList = false;
|
||||
this.showMatchContactsList = true;
|
||||
@@ -317,7 +314,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/* 选择联系人最终已选项发送 */
|
||||
saveSelectedContacts(selectedContacts) {
|
||||
let contacts = this.dealContactName(selectedContacts);
|
||||
let parameters = {
|
||||
@@ -348,9 +344,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 搜索请求后台
|
||||
* Search request background
|
||||
*
|
||||
* @param {string} keyText 输入框文本内容
|
||||
* @param {string} keyText Input box text content
|
||||
*/
|
||||
searchRequest: function (keyText) {
|
||||
LOG.info(TAG + 'searchRequest keyText');
|
||||
@@ -365,7 +361,7 @@ export default {
|
||||
requestData.searchType = SEARCH_TYPE_IN_GROUP;
|
||||
requestData.groupId = this.groupId;
|
||||
}
|
||||
// 未收藏列表页搜索
|
||||
// No favorite list page search
|
||||
if (this.type == 'getContactsListFavorites') {
|
||||
requestData.searchType = SEARCH_TYPE_FAVORITE;
|
||||
requestData.starred = IS_NOT_FAVORITE;
|
||||
@@ -374,7 +370,7 @@ export default {
|
||||
groupReq.searchContacts(DAHelper, requestData, result => {
|
||||
if (result.code == 0 && result.contactCount > 0) {
|
||||
let matchCheckedNum = 0;
|
||||
// 判断如果是已经选中的,则初始化为选中状态
|
||||
// Judge that if it is already selected, it will be initialized to the selected status
|
||||
result.data.forEach((item) => {
|
||||
if (this.isClickSelectAll) {
|
||||
if (this.indexOfArray(this.unCheckedContactIds, item.contactId) == -1) {
|
||||
@@ -393,7 +389,7 @@ export default {
|
||||
this.processHighLight(result.data, keyText);
|
||||
this.matchingResults = [];
|
||||
this.matchingResults = result.data;
|
||||
// 如果搜索出来的结果全部为选中状态,则全选点亮
|
||||
// If all the search results are selected, select all will be on
|
||||
if (matchCheckedNum == this.matchingResults.length) {
|
||||
this.showSelectAll = false;
|
||||
} else {
|
||||
@@ -431,7 +427,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 处理高亮数据函数
|
||||
processHighLight: function (searchList, likeValue) {
|
||||
searchList.forEach((element) => {
|
||||
if (element.searchMimetype[0].search('/name') != -1) {
|
||||
@@ -653,7 +648,6 @@ export default {
|
||||
element.nickName.nickNameSuf = nickNameSuf;
|
||||
},
|
||||
|
||||
// 高亮显示函数
|
||||
highLightChars: function (targetStr, matchStr) {
|
||||
if (this.isEmpty(targetStr) || this.isEmpty(matchStr)) {
|
||||
return '';
|
||||
@@ -686,7 +680,6 @@ export default {
|
||||
return result;
|
||||
},
|
||||
|
||||
// 判空函数
|
||||
isEmpty: function (str) {
|
||||
LOG.info(TAG + 'isEmpty str');
|
||||
return str == undefined || str == null || str == '';
|
||||
@@ -695,8 +688,7 @@ export default {
|
||||
itemClick: function (item) {
|
||||
LOG.info(TAG + 'itemClick item');
|
||||
if (this.type == 'saveContacts') {
|
||||
/* 先获取到联系人详情,再跳转呼叫前编辑页面 */
|
||||
if (!this.isEmpty(this.number)) { // 保存新号码到联系人
|
||||
if (!this.isEmpty(this.number)) { // Save new number to contact
|
||||
router.push(
|
||||
{
|
||||
uri: 'pages/contacts/accountants/accountants',
|
||||
@@ -730,10 +722,9 @@ export default {
|
||||
this.initTitle();
|
||||
},
|
||||
|
||||
/* 跳转到联系人编辑界面 */
|
||||
toSaveContactsInfo(contacts) {
|
||||
LOG.info(TAG + 'toSaveContactsInfo contacts');
|
||||
if (!contacts.isPushed) { // 防止同一个联系人多次添加号码
|
||||
if (!contacts.isPushed) { // Prevent the same contact from adding numbers more than once
|
||||
if (contacts.phoneNumbers && contacts.phoneNumbers.length == 0) {
|
||||
contacts.phoneNumbers = [];
|
||||
}
|
||||
@@ -777,7 +768,7 @@ export default {
|
||||
} else {
|
||||
this.removeFromArray(this.unCheckedContactIds, item.contactId);
|
||||
}
|
||||
// 如果搜索结果选中了,那么联系人列表跟随选中
|
||||
// If the search result is selected, the contact list follows the selection
|
||||
this.contactsList.forEach((contact) => {
|
||||
if (item.contactId == Number(contact.contactId)) {
|
||||
contact.checked = true;
|
||||
@@ -1040,12 +1031,10 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
},
|
||||
clickAddFavorites: function () {
|
||||
// 获取到当前的时间戳
|
||||
let timestamp = (new Date()).valueOf();
|
||||
var actionData = {
|
||||
favorite: '1',
|
||||
@@ -1151,7 +1140,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 手指触摸动作开始
|
||||
onTouchStartList: function (e) {
|
||||
if (this.type == 'editFavorites') {
|
||||
this.globalX = e.touches[0].globalX;
|
||||
@@ -1163,7 +1151,7 @@ export default {
|
||||
if (this.type == 'editFavorites') {
|
||||
this.pYMove = this.pYStart - e.touches[0].globalY;
|
||||
if (this.pYMove != 0 && this.pYMove > 0) {
|
||||
// 向上移动,隐藏状态,不需要处理;向上移动显示状态,需要设置隐藏
|
||||
// Move up, hidden, no processing required; To move the display status upward, you need to set the hide
|
||||
if (this.headerFavoriteHeight <= NUMBERS_MEANING.HEADER_MIN_HEIGHT) {
|
||||
this.isScrollTopPosition = true;
|
||||
this.headerFavoriteFontSize = NUMBERS_MEANING.HEADER_MIN_FONT_SIZE;
|
||||
@@ -1181,7 +1169,7 @@ export default {
|
||||
- NUMBERS_MEANING.HEADER_MAX_FONT_SIZE) / NUMBERS_MEANING.HEADER_MIN_TO_MAX_HEIGHT_SIZE);
|
||||
}
|
||||
} else if (this.pYMove != 0 && this.pYMove < 0) {
|
||||
// 向下移动,显示状态,不需要处理;隐藏状态,需要结合是否是顶部,如果是顶部,就要将顶部显示
|
||||
// Whether the combination is the top. If it is the top, the top should be displayed
|
||||
if (this.headerFavoriteHeight >= NUMBERS_MEANING.HEADER_MAX_HEIGHT) {
|
||||
this.headerFavoriteFontSize = NUMBERS_MEANING.HEADER_MAX_FONT_SIZE;
|
||||
this.isScrollTopPosition = false;
|
||||
@@ -1205,18 +1193,17 @@ export default {
|
||||
onTouchFavoriteEnd: function (e) {
|
||||
if (this.type == 'editFavorites') {
|
||||
if (this.pYMove != 0 && this.pYMove > 0 && this.headerFavoriteHeight <= NUMBERS_MEANING.HEADER_MIN_HEIGHT) {
|
||||
// 向上移动,隐藏状态,不需要处理;向上移动显示状态,需要设置隐藏
|
||||
// Move up, hidden, no processing required; To move the display status upward, you need to set the hide
|
||||
this.headerFavoriteHeight = NUMBERS_MEANING.HEADER_MIN_HEIGHT;
|
||||
this.headerFavoriteFontSize = NUMBERS_MEANING.HEADER_MIN_FONT_SIZE;
|
||||
this.headerFavoriteMaginLeft = NUMBERS_MEANING.HEADER_MAX_MAGIN_LENGTH;
|
||||
} else if (this.pYMove != 0 && this.pYMove < 0 && this.headerFavoriteHeight
|
||||
>= NUMBERS_MEANING.HEADER_MAX_HEIGHT && this.isScrollTopPosition == true) {
|
||||
// 向下移动,显示状态,不需要处理;隐藏状态,需要结合是否是顶部,如果是顶部,就要将顶部显示
|
||||
// Whether the combination is the top. If it is the top, the top should be displayed
|
||||
this.headerFavoriteHeight = NUMBERS_MEANING.HEADER_MAX_HEIGHT;
|
||||
this.headerFavoriteFontSize = NUMBERS_MEANING.HEADER_MAX_FONT_SIZE;
|
||||
this.headerFavoriteMaginLeft = NUMBERS_MEANING.HEADER_MIN_MAGIN_LENGTH;
|
||||
} else if (this.pYMove != 0 && this.pYMove < 0 && this.onScrollTopNum == 0) {
|
||||
// 如果数据量较少,导致下拉条不生效,这种情况时,下拉即展示头部
|
||||
this.headerFavoriteHeight = NUMBERS_MEANING.HEADER_MAX_HEIGHT;
|
||||
this.headerFavoriteFontSize = NUMBERS_MEANING.HEADER_MAX_FONT_SIZE;
|
||||
this.headerFavoriteMaginLeft = NUMBERS_MEANING.HEADER_MIN_MAGIN_LENGTH;
|
||||
@@ -1247,13 +1234,12 @@ export default {
|
||||
},
|
||||
onScrollFavoriteTop: function (e) {
|
||||
if (this.type == 'editFavorites') {
|
||||
// 如果判断是顶部,做标记
|
||||
// If it is judged to be the top, mark it
|
||||
this.isScrollTopPosition = true;
|
||||
this.onScrollTopNum = this.onScrollTopNum + 1;
|
||||
}
|
||||
},
|
||||
|
||||
// 简洁布局选项初始化
|
||||
conciseLayoutInit: function () {
|
||||
let data = this.$app.$def.globalData.storage.getSync('contacts_settings_concise_layout_switch', 'false');
|
||||
this.layoutState = data == 'true' ? false : true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 关于
|
||||
* @file about
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -23,17 +23,14 @@ export default {
|
||||
appVersion: '1.0'
|
||||
},
|
||||
|
||||
// 初始化页面
|
||||
onInit() {
|
||||
this.appVersion = app.getInfo().versionName;
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
},
|
||||
|
||||
// 点击开源代码许可
|
||||
openSourceClick: function () {
|
||||
router.push({
|
||||
uri: 'pages/contacts/settings/about/license/license',
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<image class="about-back-image" src="/res/image/ic_back.svg"></image>
|
||||
</div>
|
||||
<text class="about-title-text">
|
||||
开放源代码许可
|
||||
{{ $t('value.contacts.settingPage.license.openSource') }}
|
||||
</text>
|
||||
</div>
|
||||
<div class="about-content-div">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 许可证
|
||||
* @file License group
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -22,12 +22,9 @@ export default {
|
||||
data: {
|
||||
},
|
||||
|
||||
// 初始化页面
|
||||
onInit() {
|
||||
},
|
||||
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
<list>
|
||||
<list-item>
|
||||
<!-- 手机-->
|
||||
<!-- phone-->
|
||||
<div class="customize-phone-div" onclick="unfoldClicked">
|
||||
<div class="customize-image-div">
|
||||
<image class="customize-arrow-image" src="{{ customizeArrowImage }}"></image>
|
||||
@@ -60,7 +60,7 @@
|
||||
<list-item class="empty-group-item">
|
||||
<divider class="divider" show="{{ isUnfold }}"></divider>
|
||||
<div class="custom-all-div" onclick="onClickGroupChange(-1)" show="{{ isUnfold }}">
|
||||
<!-- 其他所有联系人-->
|
||||
<!-- All other contacts-->
|
||||
<div class="all-parent-div">
|
||||
<text class="display-contacts-text">
|
||||
{{ $t('value.contacts.displayPage.customizePage.unGrouped') }}
|
||||
@@ -71,7 +71,7 @@
|
||||
</div>
|
||||
</list-item>
|
||||
<block for="{{ groupList }}">
|
||||
<!-- 列表展开内容-->
|
||||
<!-- List expansion content-->
|
||||
<list-item class="empty-group-item">
|
||||
<divider class="short-divider" show="{{ isUnfold }}"></divider>
|
||||
<div class="custom-all-div" onclick="onClickGroupChange({{ $idx }})" show="{{ isUnfold }}">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 自定义视图
|
||||
* @file Custom view
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -40,7 +40,6 @@ export default {
|
||||
groupList: []
|
||||
},
|
||||
|
||||
// 初始化页面
|
||||
onInit() {
|
||||
this.customizeArrowImage = this.arrowFoldImage.fold;
|
||||
var defaultData = {
|
||||
@@ -58,7 +57,6 @@ export default {
|
||||
LOG.info(TAG + 'Customize onShow --------------end');
|
||||
},
|
||||
|
||||
// input全选~~
|
||||
checkboxOnChange: function (event) {
|
||||
LOG.info(TAG + 'checkboxOnChange event');
|
||||
this.isCheckedCustomize = !this.isCheckedCustomize;
|
||||
@@ -75,12 +73,10 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 点击所有联系人事件~~
|
||||
onClickChange: function () {
|
||||
this.isCheckedCustomize = !this.isCheckedCustomize;
|
||||
},
|
||||
|
||||
// 点击其他所有人或者群组~~
|
||||
onClickGroupChange: function (index) {
|
||||
LOG.info(TAG + 'onClickGroupChange index' + index);
|
||||
switch (index) {
|
||||
@@ -100,19 +96,16 @@ export default {
|
||||
this.isCheckedCustomize = isCheckedGroup ? this.isCheckedOtherCustomize ? true : false : false;
|
||||
},
|
||||
|
||||
// 是否展开选项事件
|
||||
unfoldClicked: function () {
|
||||
this.isUnfold = !this.isUnfold;
|
||||
this.customizeArrowImage = this.customizeArrowImage == this.arrowFoldImage.fold
|
||||
? this.arrowFoldImage.unFold : this.arrowFoldImage.fold;
|
||||
},
|
||||
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
},
|
||||
// 保存设置
|
||||
|
||||
saveCustomize: function () {
|
||||
var checkedList = [];
|
||||
this.groupList.forEach(element => {
|
||||
@@ -141,10 +134,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取群组列表数据
|
||||
* Get group list data
|
||||
*
|
||||
* @param {number} code 2005 FA与PA通行协议码
|
||||
* @param {number} data contactId 联系人ID
|
||||
* @param {number} code 2005 FA and PA access protocol code
|
||||
* @param {number} data contactId The contact ID
|
||||
*/
|
||||
initGroupData: function () {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
{{ $t('value.contacts.displayPage.title') }}
|
||||
</text>
|
||||
</div>
|
||||
<!-- 简洁布局-->
|
||||
<!-- Concise layout-->
|
||||
<div class="concise-layout-div" onclick="accountClicked">
|
||||
<div class="layout-parent-div">
|
||||
<text class="concise-layout-text">
|
||||
@@ -38,7 +38,7 @@
|
||||
{{ $t('value.contacts.displayPage.displayAccount') }}
|
||||
</text>
|
||||
</div>
|
||||
<!-- 所有联系人-->
|
||||
<!-- all contacts-->
|
||||
<div class="display-all-div" onclick="onRadioChange('allContacts')">
|
||||
<div class="all-parent-div">
|
||||
<text class="display-contacts-text">
|
||||
@@ -53,7 +53,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<divider class="divider"></divider>
|
||||
<!-- 手机-->
|
||||
<!-- phone -->
|
||||
<div class="phone-all-div" onclick="onRadioChange('phoneContacts')">
|
||||
<div class="all-parent-div">
|
||||
<text class="display-contacts-text">
|
||||
@@ -68,7 +68,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<divider class="divider"></divider>
|
||||
<!-- 自定义-->
|
||||
<!-- custom-->
|
||||
<div class="custom-all-div" onclick="onRadioChange('customize')">
|
||||
<div class="all-parent-div">
|
||||
<text class="display-contacts-text">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 显示联系人
|
||||
* @file Show Contacts
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -41,12 +41,10 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化页面
|
||||
onInit() {
|
||||
LOG.info(TAG + 'Display onInit --------------start');
|
||||
},
|
||||
|
||||
// radio选项初始化
|
||||
radioInit: function () {
|
||||
let data = this.$app.$def.globalData.storage.getSync('contacts_settings_display_account_radio', 'allContacts');
|
||||
LOG.info(TAG + 'radioInit data');
|
||||
@@ -92,12 +90,11 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 简洁布局选项初始化
|
||||
conciseLayoutInit: function () {
|
||||
let data = this.$app.$def.globalData.storage.getSync('contacts_settings_concise_layout_switch', 'false');
|
||||
this.layoutState = data == 'true' ? true : false;
|
||||
},
|
||||
// 初始化获取联系合并个数
|
||||
|
||||
getDisplayCount: function () {
|
||||
var resultSet = {};
|
||||
var data = {};
|
||||
@@ -129,9 +126,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 简洁布局按钮
|
||||
* Simple layout button
|
||||
*
|
||||
* @param {Object} event event事件
|
||||
* @param {Object} event event
|
||||
*/
|
||||
isCheckedConciseLayout: function (event) {
|
||||
LOG.info(TAG + 'isCheckedConciseLayout event');
|
||||
@@ -142,7 +139,7 @@ export default {
|
||||
this.$app.$def.globalData.storage.flushSync();
|
||||
}, 0);
|
||||
},
|
||||
// radio状态改变事件
|
||||
|
||||
radioChange: function (inputValue, e) {
|
||||
LOG.info(TAG + 'radioChange inputValue...:');
|
||||
switch (inputValue) {
|
||||
@@ -177,7 +174,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 显示账户选项
|
||||
onRadioChange: function (inputValue) {
|
||||
LOG.info(TAG + 'onRadioChange inputValue');
|
||||
switch (inputValue) {
|
||||
@@ -201,7 +197,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
{{ $t('value.contacts.imorexportPage.title') }}
|
||||
</text>
|
||||
</div>
|
||||
<!-- 导入-->
|
||||
<!-- Import-->
|
||||
<div class="import-manage-div">
|
||||
<text class="import-manage-text">
|
||||
{{ $t('value.contacts.imorexportPage.import') }}
|
||||
@@ -38,7 +38,7 @@
|
||||
<divider class="divider"></divider>
|
||||
</block>
|
||||
|
||||
<!-- 从存储设备导入-->
|
||||
<!-- Import from storage device-->
|
||||
<div class="storage-device-div" onclick="showImportDialog">
|
||||
<div class="storage-parent-div">
|
||||
<text class="storage-device-text">
|
||||
@@ -51,13 +51,13 @@
|
||||
<image class="flex-image" src="/res/image/ic_contacts_arrow_up.svg"></image>
|
||||
</div>
|
||||
<div class="blank-article-div"></div>
|
||||
<!-- 导出-->
|
||||
<!-- export-->
|
||||
<div class="export-manage-div">
|
||||
<text class="export-manage-text">
|
||||
{{ $t('value.contacts.imorexportPage.export') }}
|
||||
</text>
|
||||
</div>
|
||||
<!-- 导出到存储设备-->
|
||||
<!-- Export to storage device-->
|
||||
<div class="export-storage-div" onclick="showExportDialog">
|
||||
<div class="export-parent-div">
|
||||
<text class="export-storage-text">
|
||||
@@ -70,7 +70,7 @@
|
||||
<image class="flex-image" src="/res/image/ic_contacts_arrow_up.svg"></image>
|
||||
</div>
|
||||
<divider class="divider"></divider>
|
||||
<!-- 分享联系人-->
|
||||
<!-- Share contacts-->
|
||||
<div class="share-contacts-div" disabled="{{ this.$app.$def.globalData.contactCount == 0}}" onclick="shareContactsList">
|
||||
<text class="share-contacts-text" disabled="{{ this.$app.$def.globalData.contactCount == 0}}">
|
||||
{{ $t('value.contacts.imorexportPage.shareContacts') }}
|
||||
@@ -78,7 +78,7 @@
|
||||
<image class="flex-image" src="/res/image/ic_contacts_arrow_up.svg"></image>
|
||||
</div>
|
||||
|
||||
<!-- 导入null弹窗-->
|
||||
<!-- Import null Popup-->
|
||||
<dialog id="ImportDialog" class="dialog-main">
|
||||
<div class="dialog-div">
|
||||
<div class="inner-txt">
|
||||
@@ -96,21 +96,22 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!-- 导入date弹窗-->
|
||||
<!-- Import date pop-up-->
|
||||
<dialog id="ImportDateDialog" style="width : 650px;
|
||||
margin-left : 25px;
|
||||
margin-right : 25px;
|
||||
margin-bottom : 25px;">
|
||||
<div class="dialog-div" style="height : {{ height }} px;">
|
||||
<div class="inner-txt">
|
||||
<text class="txt" style="font-weight : 600; font-size : 40px; margin-left : 20px;">选择VCard文件
|
||||
<text class="txt" style="font-weight : 600; font-size : 40px; margin-left : 20px;">
|
||||
{{ $t('value.contacts.imorexportPage.choose') }}
|
||||
</text>
|
||||
</div>
|
||||
<list class="share-dialog-wraper" scrollbar="on" shapemode="rect">
|
||||
<list-item class="select-dialog-Item" show="{{ vcardParams.length > 1 }}">
|
||||
<div onclick="itemClickAll">
|
||||
<div class="share-dialog-content-div">
|
||||
<text class="share-dialog-content-name">全选
|
||||
<text class="share-dialog-content-name">{{ $t('value.contacts.imorexportPage.selectAll') }}
|
||||
</text>
|
||||
</div>
|
||||
<div class="allrecords-item-right-checkbox">
|
||||
@@ -119,7 +120,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<!-- Right detail and checkbox Icon-->
|
||||
<divider class="share-todo-divider" if="true"></divider>
|
||||
</list-item>
|
||||
<list-item for="{{ vcardParams }}" class="share-dialog-item">
|
||||
@@ -142,7 +143,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<!-- Right detail and checkbox Icon-->
|
||||
<divider class="share-todo-divider" if="{{ $idx != (vcardParams.length - 1) }}"></divider>
|
||||
</list-item>
|
||||
</list>
|
||||
@@ -152,13 +153,11 @@
|
||||
<text style="color : darkgrey; font-size : 40px;">|</text>
|
||||
<button type="text" value="{{ $t('accountants.submit') }}" onclick="cancelSchedule"
|
||||
disabled="{{ DialogStatus }}" class="btn-txt"></button>
|
||||
|
||||
<!-- show="{{DialogStatus}}"-->
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!--导出弹窗-->
|
||||
<!--Export Popup-->
|
||||
<dialog id="ExportDialog" class="dialog-main">
|
||||
<div class="dialog-export-div">
|
||||
<div class="inner-txt">
|
||||
@@ -166,7 +165,9 @@
|
||||
$t('value.contacts.imorexportPage.importContact') }}</text>
|
||||
</div>
|
||||
<div class="inner-export-content" style="margin-left : 30px;">
|
||||
<text class="txt">是否将联系人列表导出至 内部存储/{{ fileName }}?导出后,请妥善保管您的联系人信息</text>
|
||||
<text class="txt">
|
||||
{{ $t('value.contacts.imorexportPage.isExport') }}
|
||||
{{ fileName }}{{ $t('value.contacts.imorexportPage.safekeeping') }}</text>
|
||||
</div>
|
||||
<div class="inner-btn">
|
||||
<button type="text" value="{{ $t('accountants.reset') }}" onclick="closeExportDialog" class="btn-txt">
|
||||
@@ -174,13 +175,11 @@
|
||||
<text style="color : darkgrey; font-size : 40px;">|</text>
|
||||
<button type="text" value="{{ $t('value.contacts.imorexportPage.export') }}" onclick="exportContacts"
|
||||
disabled="{{ DialogStatus }}" class="btn-txt"></button>
|
||||
|
||||
<!-- show="{{DialogStatus}}"-->
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!--SIM卡导入提示-->
|
||||
<!--SIM card import prompt-->
|
||||
<dialog id="SIMDialog" class="sim-dialog-main">
|
||||
<div class="sim-dialog-div">
|
||||
<div class="sim-inner-div">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 导入/导出联系人
|
||||
* @file Import or export contacts
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -38,12 +38,12 @@ export default {
|
||||
height: 800,
|
||||
vcardParams: [],
|
||||
fileName: '00001.cvf',
|
||||
checkedNum: 0, // 已选择file数量
|
||||
checkedNum: 0, // Number of files selected
|
||||
showSelectAll: false,
|
||||
SimState: false,
|
||||
isDisabled: false
|
||||
},
|
||||
// 初始化页面
|
||||
|
||||
onInit() {
|
||||
},
|
||||
onReady() {
|
||||
@@ -57,7 +57,7 @@ export default {
|
||||
LOG.log(TAG + '--------------onHide');
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
|
||||
back: function () {
|
||||
router.back();
|
||||
},
|
||||
@@ -117,7 +117,8 @@ export default {
|
||||
},
|
||||
|
||||
timestampToTime: function (timestamp) {
|
||||
var date = new Date(timestamp * INT_1000); // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
|
||||
LOG.info(TAG + 'timestampToTime timestamp = ');
|
||||
var date = new Date(timestamp * INT_1000);
|
||||
var Y = date.getFullYear() + '-';
|
||||
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
|
||||
var D = date.getDate() + ' ';
|
||||
@@ -128,13 +129,16 @@ export default {
|
||||
},
|
||||
|
||||
uriToFileName: function (fileName) {
|
||||
LOG.info(TAG + 'uriToFileName fileName = ');
|
||||
fileName = fileName.replace('internal:// app/', '');
|
||||
return fileName;
|
||||
},
|
||||
|
||||
itemClick: function (item) {
|
||||
LOG.info(TAG + 'itemClick item = ');
|
||||
LOG.info(TAG + 'select vcardParams');
|
||||
var checkedList = [];
|
||||
LOG.info(TAG + 'select vcardParams item');
|
||||
item.checked = !item.checked;
|
||||
this.vcardParams.forEach((element) => {
|
||||
if (element.checked) {
|
||||
@@ -170,10 +174,9 @@ export default {
|
||||
LOG.info(TAG + 'select status vcardParams' + this.showSelectAll);
|
||||
|
||||
},
|
||||
/*从存储设备导入弹窗**/
|
||||
|
||||
showImportDialog: function () {
|
||||
LOG.info(TAG + 'showImportDialog success');
|
||||
// 获取获取vcf列表文件
|
||||
this.$app.$def.globalData.file.list({
|
||||
uri: 'internal:// app/',
|
||||
success: (data) => {
|
||||
@@ -201,13 +204,10 @@ export default {
|
||||
|
||||
},
|
||||
|
||||
/*导出vcf名称**/
|
||||
showExportDialog: function () {
|
||||
// 获取vcf名称
|
||||
this.getName();
|
||||
},
|
||||
|
||||
// fileName获取导出的vcf文件名称
|
||||
getName() {
|
||||
this.$element('ExportDialog').show();
|
||||
|
||||
@@ -216,17 +216,14 @@ export default {
|
||||
this.$element('ExportDialog').close();
|
||||
},
|
||||
|
||||
/**导出联系人*/
|
||||
exportContacts() {
|
||||
LOG.info(TAG + 'start export contacts');
|
||||
// 获取到contactIds
|
||||
var requestData = {
|
||||
page: 0,
|
||||
limit: 200
|
||||
};
|
||||
var contactResults = contactsService.queryContacts(requestData);
|
||||
let contactDatas = [];
|
||||
// 调用听歌contactId获取联系人详情
|
||||
if (contactResults.resultList.length > 0) {
|
||||
contactResults.resultList.forEach((element) => {
|
||||
var param = {};
|
||||
@@ -237,7 +234,6 @@ export default {
|
||||
});
|
||||
});
|
||||
}
|
||||
// 拼接result.data
|
||||
let result = {};
|
||||
result.code = 0;
|
||||
result.data = contactDatas;
|
||||
@@ -247,7 +243,7 @@ export default {
|
||||
text: JSON.stringify(result),
|
||||
success: function () {
|
||||
prompt.showToast({
|
||||
message: this.fileName.concat('将在稍后导出')
|
||||
message: this.fileName.concat(this.$t('value.contacts.waitExport'))
|
||||
});
|
||||
},
|
||||
fail: function (data, code) {
|
||||
@@ -259,7 +255,6 @@ export default {
|
||||
this.$element('ExportDialog').close();
|
||||
},
|
||||
|
||||
/**分享联系人*/
|
||||
shareContactsList: function () {
|
||||
router.push({
|
||||
uri: 'pages/contacts/settings/shareContactsList/shareContactsList'
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
{{ $t('value.contacts.managePage.title') }}
|
||||
</text>
|
||||
</div>
|
||||
<!-- 合并重复联系人-->
|
||||
<!-- Merge Duplicate Contacts-->
|
||||
<div class="merge-content-div" onclick="mergeContactsClicked" if="{{this.$app.$def.globalData.isDisplay}}">
|
||||
<text class="merge-content-text">
|
||||
{{ $t('value.contacts.managePage.mergeContacts') }}
|
||||
@@ -29,7 +29,7 @@
|
||||
<image class="flex-image" src="/res/image/ic_contacts_arrow_up.svg"></image>
|
||||
</div>
|
||||
<divider class="divider" if="{{this.$app.$def.globalData.isDisplay}}"></divider>
|
||||
<!-- 复制联系人-->
|
||||
<!-- Copy contacts-->
|
||||
<div class="copy-content-div" disabled="true" if="{{this.$app.$def.globalData.isDisplay}}">
|
||||
<text class="copy-content-text">
|
||||
{{ $t('value.contacts.managePage.copyContacts') }}
|
||||
@@ -37,7 +37,7 @@
|
||||
<image class="flex-image" src="/res/image/ic_contacts_arrow_up.svg"></image>
|
||||
</div>
|
||||
<divider class="divider" if="{{this.$app.$def.globalData.isDisplay}}"></divider>
|
||||
<!-- 批量删除-->
|
||||
<!-- Batch delete-->
|
||||
<div class="delete-content-div" onclick="deleteBatchClicked">
|
||||
<text class="delete-content-text">
|
||||
{{ $t('value.contacts.managePage.deleteContacts') }}
|
||||
@@ -45,7 +45,7 @@
|
||||
<image class="flex-image" src="/res/image/ic_contacts_arrow_up.svg"></image>
|
||||
</div>
|
||||
<divider class="divider" if="{{this.$app.$def.globalData.isDisplay}}"></divider>
|
||||
<!-- 最近删除-->
|
||||
<!-- Recently deleted-->
|
||||
<div class="recently-deleted-div" onclick="recentlyDeleteClicked" if="{{this.$app.$def.globalData.isDisplay}}">
|
||||
<div class="recently-parent-div">
|
||||
<text class="recently-deleted-text">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 整理联系人
|
||||
* @file Sorting out Contacts
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ var TAG = 'Manage...:';
|
||||
export default {
|
||||
data: {},
|
||||
|
||||
// 初始化页面
|
||||
// Initialization page
|
||||
onReady() {
|
||||
LOG.log(TAG + 'onReady');
|
||||
},
|
||||
@@ -55,7 +55,7 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
// Return to the upper page
|
||||
back: function () {
|
||||
router.back();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 合并联系人
|
||||
* @file Merge contacts
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -40,7 +40,6 @@ export default {
|
||||
timeOutId: ''
|
||||
},
|
||||
|
||||
// 初始化页面
|
||||
onInit: function () {
|
||||
LOG.info(TAG + 'merge onInit --------------end');
|
||||
},
|
||||
@@ -56,14 +55,14 @@ export default {
|
||||
this.mergeInitContact(2013, null);
|
||||
LOG.info(TAG + 'merge onShow --------------end');
|
||||
},
|
||||
// 合并
|
||||
|
||||
doMerge: function () {
|
||||
LOG.info(TAG + 'merge contacts--------------');
|
||||
this.$element('progressDialog').show();
|
||||
var checkedList = [];
|
||||
var unCheckedList = [];
|
||||
var contactIds = [];
|
||||
if (this.isSelectAll) { // 全选合并
|
||||
if (this.isSelectAll) { // Select all merge
|
||||
checkedList = this.mergeList;
|
||||
this.mergeList.forEach(element => {
|
||||
element.contactBeans.forEach(item => {
|
||||
@@ -71,7 +70,7 @@ export default {
|
||||
});
|
||||
});
|
||||
this.mergeList = [];
|
||||
} else { // 非全部选中
|
||||
} else { // Not all selected
|
||||
this.mergeList.forEach(element => {
|
||||
if (element.checked) {
|
||||
checkedList.push(element);
|
||||
@@ -85,7 +84,6 @@ export default {
|
||||
this.mergeList = unCheckedList;
|
||||
}
|
||||
this.checkedCount = 0;
|
||||
// 执行后台合并操作
|
||||
var data = {};
|
||||
data.contactIds = contactIds;
|
||||
clearTimeout(this.timeOutId);
|
||||
@@ -95,29 +93,26 @@ export default {
|
||||
this.$element('progressDialog').close();
|
||||
},
|
||||
|
||||
// 全选
|
||||
clickCheckedAll: function () {
|
||||
LOG.log(TAG + 'select all contacts');
|
||||
if (!this.isSelectAll) {
|
||||
// 全选
|
||||
// Select all
|
||||
this.selectAll();
|
||||
} else {
|
||||
// 取消全选
|
||||
// Deselect all
|
||||
this.unSelectAll();
|
||||
}
|
||||
this.refreshPageTabs();
|
||||
},
|
||||
|
||||
/* 全选列表项 */
|
||||
selectAll: function () {
|
||||
this.checkedCount = 0; // 将已选择的计数清除后重新增加
|
||||
this.checkedCount = 0; // Clear the selected count and increase it again
|
||||
this.mergeList.forEach(element => {
|
||||
element.checked = true;
|
||||
this.checkedCount++;
|
||||
});
|
||||
},
|
||||
|
||||
/* 取消全选 */
|
||||
unSelectAll: function () {
|
||||
this.mergeList.forEach(element => {
|
||||
element.checked = false;
|
||||
@@ -127,7 +122,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 点击单选按钮
|
||||
changeCheckState: function (index, e) {
|
||||
LOG.info(TAG + 'index is=' + index);
|
||||
this.mergeList[index].checked = e.checked;
|
||||
@@ -135,7 +129,6 @@ export default {
|
||||
this.refreshPageTabs();
|
||||
},
|
||||
|
||||
/* 标题计数刷新函数 */
|
||||
refreshPageTabs: function () {
|
||||
LOG.info(TAG + 'refreshPageTabs checkedCount' + this.checkedCount);
|
||||
if (this.checkedCount > 0) {
|
||||
@@ -153,7 +146,7 @@ export default {
|
||||
break;
|
||||
}
|
||||
this.mergeDisabled = false;
|
||||
if (this.checkedCount == this.mergeList.length) { // 全选情况按钮状态刷新
|
||||
if (this.checkedCount == this.mergeList.length) { // Select all button status refresh
|
||||
this.icSelectAll = '/res/image/ic_select all_filled_m.svg';
|
||||
this.allSelectMessage = this.$t('value.contacts.managePage.mergePage.unSelectAll');
|
||||
this.isSelectAll = true;
|
||||
@@ -181,7 +174,6 @@ export default {
|
||||
return true;
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
},
|
||||
@@ -194,10 +186,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询合并联系人列表数据
|
||||
* Query and merge contact list data
|
||||
*
|
||||
* @param {number} code 2005 FA与PA通行协议码
|
||||
* @param {string} data contactId 联系人ID
|
||||
* @param {number} code 2005 FA and PA access protocol code
|
||||
* @param {string} data contactId The contact ID
|
||||
*/
|
||||
mergeInitContact: function (code, data) {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
@@ -221,10 +213,10 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 合并联系人列表数据
|
||||
* Merge contact list data
|
||||
*
|
||||
* @param {number} code 2005 FA与PA通行协议码
|
||||
* @param {number} data contactId 联系人ID
|
||||
* @param {number} code 2005 FA and PA access protocol code
|
||||
* @param {number} data contactId The contact ID
|
||||
*/
|
||||
mergeContactData: function (code, data) {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@
|
||||
<element name="recoverComp" src="./recover/recover.hml"></element>
|
||||
<div id="container" class="container">
|
||||
<block if="{{ isRecover }}">
|
||||
<!-- 最近删除-->
|
||||
<!-- Recently deleted-->
|
||||
<div class="recently-title-div">
|
||||
<div class="recently-back-but-div" onclick="back">
|
||||
<image class="recently-back-image" src="/res/image/ic_back.svg"></image>
|
||||
@@ -24,7 +24,7 @@
|
||||
{{ $t('value.contacts.managePage.recentlyPage.title') }}
|
||||
</text>
|
||||
</div>
|
||||
<!-- 联系人将保留 30 天,之后永久删除。-->
|
||||
<!-- Contacts will be retained for 30 days and then permanently deleted-->
|
||||
<div class="recently-instruction-div">
|
||||
<text class="recently-instruction-text">
|
||||
{{ $t('value.contacts.managePage.recentlyPage.instruction') }}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 最近删除
|
||||
* @file Recently deleted
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -42,7 +42,6 @@ export default {
|
||||
limit: 200
|
||||
},
|
||||
|
||||
// 初始化页面
|
||||
onInit() {
|
||||
LOG.info(TAG + 'onInit success');
|
||||
this.language = 'zh';
|
||||
@@ -128,7 +127,6 @@ export default {
|
||||
this.isRecover = false;
|
||||
},
|
||||
|
||||
// 子页面恢复事件
|
||||
changePage: function (e) {
|
||||
LOG.info(TAG + 'changePage e');
|
||||
switch (e.detail.type) {
|
||||
@@ -166,7 +164,6 @@ export default {
|
||||
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
}
|
||||
|
||||
+5
-18
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 恢复删除联系人
|
||||
* @file Resume Deleting contacts
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -46,10 +46,8 @@ export default {
|
||||
recentlyList: []
|
||||
},
|
||||
|
||||
// 初始化页面
|
||||
onInit() {
|
||||
LOG.info(TAG + 'onInit success');
|
||||
// this.language = configuration.getLocale().language;
|
||||
this.language = 'zh';
|
||||
switch (this.language) {
|
||||
case 'zh':
|
||||
@@ -93,7 +91,6 @@ export default {
|
||||
unCheckList.push(element);
|
||||
}
|
||||
});
|
||||
// 调用后台恢复联系人
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
recoverService.recoverRlyDelContacts(DAHelper, data, result => {
|
||||
LOG.info(TAG + 'doRecover result');
|
||||
@@ -113,7 +110,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 弹出删除确认菜单
|
||||
doDelete: function () {
|
||||
LOG.info(TAG + 'doDelete isSelectAll');
|
||||
if (this.isSelectAll) {
|
||||
@@ -133,7 +129,6 @@ export default {
|
||||
}
|
||||
this.$element('deleteDialog').show();
|
||||
},
|
||||
// 确认删除
|
||||
deleteClick: function () {
|
||||
this.$element('deleteDialog').close();
|
||||
var data = {
|
||||
@@ -175,22 +170,19 @@ export default {
|
||||
this.refreshPageTabs();
|
||||
},
|
||||
|
||||
|
||||
// 全选
|
||||
clickCheckedAll: function () {
|
||||
if (!this.isSelectAll) {
|
||||
// 全选
|
||||
// Select all
|
||||
this.selectAll();
|
||||
} else {
|
||||
// 取消全选
|
||||
// Deselect all
|
||||
this.unSelectAll();
|
||||
}
|
||||
this.refreshPageTabs();
|
||||
},
|
||||
|
||||
/* 全选列表项 */
|
||||
selectAll: function () {
|
||||
this.checkedCount = 0; // 将已选择的计数清除后重新增加
|
||||
this.checkedCount = 0; // Clear the selected count and increase it again
|
||||
LOG.info(TAG + 'select All this');
|
||||
this.recentlyList.forEach(element => {
|
||||
element.checked = true;
|
||||
@@ -198,7 +190,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
/* 取消全选 */
|
||||
unSelectAll: function () {
|
||||
LOG.info(TAG + 'unselect All this');
|
||||
this.recentlyList.forEach(element => {
|
||||
@@ -209,8 +200,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 点击单选按钮
|
||||
changeCheckState: function (index, e) {
|
||||
LOG.info(TAG + 'changeCheckState index' + index);
|
||||
this.recentlyList[index].checked = e.checked;
|
||||
@@ -218,7 +207,6 @@ export default {
|
||||
this.refreshPageTabs();
|
||||
},
|
||||
|
||||
/* 标题计数刷新函数 */
|
||||
refreshPageTabs: function () {
|
||||
LOG.info(TAG + 'refreshPageTabs checkedCount' + this.checkedCount);
|
||||
if (this.checkedCount > 0) {
|
||||
@@ -237,7 +225,7 @@ export default {
|
||||
}
|
||||
this.deleteDisabled = false;
|
||||
this.recoverDisabled = false;
|
||||
if (this.checkedCount == this.recentlyList.length) { // 全选情况按钮状态刷新
|
||||
if (this.checkedCount == this.recentlyList.length) { // Select all button status refresh
|
||||
this.icSelectAll = '/res/image/ic_select all_filled_m.svg';
|
||||
this.allSelectMessage = this.$t('value.contacts.managePage.recentlyPage.unSelectAll');
|
||||
this.isSelectAll = true;
|
||||
@@ -257,7 +245,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
{{ $t('value.contacts.settingPage.manager') }}
|
||||
</text>
|
||||
</div>
|
||||
<!-- 显示联系人-->
|
||||
<!-- Show contacts-->
|
||||
<div class="display-content-div" onclick="displayContactClicked" if="{{this.$app.$def.globalData.isDisplay}}">
|
||||
<text class="display-content-text">
|
||||
{{ $t('value.contacts.settingPage.displayContact') }}
|
||||
@@ -45,7 +45,7 @@
|
||||
<image class="flex-manage-image" src="/res/image/ic_contacts_arrow_up.svg"></image>
|
||||
</div>
|
||||
<divider class="divider" if="{{this.$app.$def.globalData.isDisplay}}"></divider>
|
||||
<!-- 整理联系人-->
|
||||
<!-- Organize contacts-->
|
||||
<div class="display-content-div" onclick="manageContactsClicked">
|
||||
<text class="display-content-text">
|
||||
{{ $t('value.contacts.settingPage.organizeContacts') }}
|
||||
@@ -53,7 +53,7 @@
|
||||
<image class="flex-manage-image" src="/res/image/ic_contacts_arrow_up.svg"></image>
|
||||
</div>
|
||||
<divider class="divider"></divider>
|
||||
<!-- 导入/导出-->
|
||||
<!-- Import / export-->
|
||||
<div class="display-content-div" onclick="importExportClicked" if="{{this.$app.$def.globalData.isDisplay}}">
|
||||
<text class="display-content-text">
|
||||
{{ $t('value.contacts.settingPage.importExport') }}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 设置
|
||||
* @file Set up the
|
||||
*/
|
||||
/**
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
@@ -23,7 +23,6 @@ var TAG = 'Settings...: ';
|
||||
export default {
|
||||
data: {},
|
||||
|
||||
// 初始化页面
|
||||
onInit() {
|
||||
LOG.info(TAG + ' onInit --------------end');
|
||||
},
|
||||
@@ -31,12 +30,10 @@ export default {
|
||||
LOG.info(TAG + ' onDestroy --------------end');
|
||||
},
|
||||
|
||||
// 点击账户div
|
||||
accountClicked: function () {
|
||||
LOG.info(TAG + 'accountClicked');
|
||||
},
|
||||
|
||||
// 显示联系人已点击
|
||||
displayContactClicked: function () {
|
||||
router.push({
|
||||
uri: 'pages/contacts/settings/display/display',
|
||||
@@ -56,7 +53,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
}
|
||||
|
||||
+2
-2
@@ -196,7 +196,7 @@
|
||||
margin-left: 45px;
|
||||
height: 1px;
|
||||
border-bottom: 1px;
|
||||
border-color: lightgray;
|
||||
border-color: #d3d3d3;
|
||||
}
|
||||
|
||||
.name-text {
|
||||
@@ -350,7 +350,7 @@
|
||||
}
|
||||
|
||||
.batch-delete-operation-button:active {
|
||||
background-color: lightgray;
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.batch-delete-operation-button:disabled {
|
||||
|
||||
+3
-3
@@ -24,7 +24,7 @@
|
||||
{{ title }}
|
||||
</text>
|
||||
</div>
|
||||
<!-- 搜索联系人-->
|
||||
<!-- Search for contacts-->
|
||||
<div class="todo-search-div" if="{{ (contactsList.length != 0) && (type != 'editFavorites') }}">
|
||||
<search id="search" hint="{{ $t('value.contacts.page.search') }}" onchange="clickSearch"></search>
|
||||
</div>
|
||||
@@ -71,7 +71,7 @@
|
||||
</text>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<!-- Right detail and checkbox Icon-->
|
||||
<div>
|
||||
<div class="allrecords-item-right-checkbox">
|
||||
<input type="checkbox" class="checkbox" checked="{{ item.checked }}" onchange="itemClick(item)">
|
||||
@@ -121,7 +121,7 @@
|
||||
</text>
|
||||
</div>
|
||||
|
||||
<!-- 右侧细节及checkBox图标-->
|
||||
<!-- Right detail and checkbox Icon-->
|
||||
<div>
|
||||
<div class="allrecords-item-right-checkbox">
|
||||
<input type="checkbox" class="checkbox" checked="{{ item.checked }}" onchange="itemClick(item)">
|
||||
|
||||
+15
-14
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 共享联系人列表
|
||||
* @file Sharing a Contact List
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -28,14 +28,14 @@ var TAG = 'shareContactsList...:';
|
||||
export default {
|
||||
data: {
|
||||
icShare: '/res/image/ic_share_m.svg',
|
||||
title: '', // 标题
|
||||
title: '', // title
|
||||
groupId: 0,
|
||||
showEmptyPage: false, // 列表页面为空
|
||||
noMatchingResults: false, // 显示搜索结果为空
|
||||
checkedNum: 0, // 已选择联系人数量
|
||||
contactsList: [], // 联系人列表
|
||||
matchingResults: [], // 搜索结果
|
||||
showSelectAll: true, // 全选,
|
||||
showEmptyPage: false, // The list page is empty
|
||||
noMatchingResults: false, // The displayed search results are empty
|
||||
checkedNum: 0, // Number of contacts selected
|
||||
contactsList: [], // contact list
|
||||
matchingResults: [], // search result
|
||||
showSelectAll: true, // Select all,
|
||||
addMemberDisabled: true,
|
||||
showContactList: true,
|
||||
showMatchContactsList: false,
|
||||
@@ -81,7 +81,8 @@ export default {
|
||||
|
||||
},
|
||||
clickSearch: function (e) {
|
||||
// 搜索输入框
|
||||
LOG.info(TAG + 'clickSearch e');
|
||||
// Search input box
|
||||
if (e.text) {
|
||||
this.showContactList = false;
|
||||
this.showMatchContactsList = true;
|
||||
@@ -94,9 +95,9 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 搜索请求后台
|
||||
* Search request background
|
||||
*
|
||||
* @param {string} keyText 输入框内容
|
||||
* @param {string} keyText Input box content
|
||||
*/
|
||||
searchRequest: function (keyText) {
|
||||
var requestData = {
|
||||
@@ -145,7 +146,7 @@ export default {
|
||||
}
|
||||
this.initTitle();
|
||||
},
|
||||
// 分享联系人
|
||||
// Share contacts
|
||||
shareContacts: function () {
|
||||
var checkedList = [];
|
||||
this.contactsList.forEach((item) => {
|
||||
@@ -155,7 +156,7 @@ export default {
|
||||
});
|
||||
LOG.info(TAG + 'shareContacts contactsList' + this.contactsList);
|
||||
prompt.showToast({
|
||||
message: '调用分享vCard三方'
|
||||
message: 'Call share vCard three parties'
|
||||
});
|
||||
},
|
||||
clickSelectAll: function () {
|
||||
@@ -183,7 +184,7 @@ export default {
|
||||
this.title = this.$t('value.contacts.groupsPage.noSelect');
|
||||
}
|
||||
},
|
||||
// 返回上层页面
|
||||
|
||||
back: function () {
|
||||
router.back();
|
||||
},
|
||||
|
||||
@@ -22,9 +22,8 @@
|
||||
|
||||
.batch-delete-title {
|
||||
width: 100%;
|
||||
height: 8%;/*background-color: gray;*/
|
||||
align-items: center;/*border-bottom: 1;
|
||||
border-top: 1;*/
|
||||
height: 8%;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
@@ -37,7 +36,7 @@
|
||||
}
|
||||
|
||||
.batch-delete-title-image-button:active {
|
||||
background-color: lightgray;
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
.batch-delete-title-image {
|
||||
@@ -52,7 +51,7 @@
|
||||
|
||||
.batch-delete-operation {
|
||||
width: 100%;
|
||||
height: 8%;/*background-color: lightgray;*/
|
||||
height: 8%;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@@ -60,13 +59,13 @@
|
||||
width: 30%;
|
||||
height: 100%;
|
||||
border-radius: 15px;
|
||||
flex-direction: column;/*background-color: gray;*/
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.batch-delete-operation-button:active {
|
||||
background-color: lightgray;
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
.batch-delete-operation-button:disabled {
|
||||
@@ -90,11 +89,9 @@
|
||||
|
||||
.batch-delete-list-container {
|
||||
width: 100%;
|
||||
height: 84%;/*background-color: lightgray;*/
|
||||
height: 84%;
|
||||
}
|
||||
|
||||
/* 删除确认弹框样式 */
|
||||
|
||||
.dialog-main {
|
||||
width: 92%;
|
||||
height: 15%;
|
||||
|
||||
@@ -34,11 +34,10 @@ export default {
|
||||
allSelectTextStyle: 'batch-delete-text',
|
||||
deleteMessage: '',
|
||||
isSelectAll: false,
|
||||
selectAllClicked: false, // 标识是否点击过全选按钮,如果点击过,则按照排除法批量删除数据
|
||||
selectAllClicked: false,
|
||||
deleteDisabled: true,
|
||||
refreshBatchDeleteLogId: 0,
|
||||
from_contact: ' from_contact',
|
||||
/*isFirstInit: true,*/
|
||||
pageInfo: {
|
||||
pageIndex: 0,
|
||||
pageSize: 20,
|
||||
@@ -46,7 +45,7 @@ export default {
|
||||
},
|
||||
onInit() {
|
||||
LOG.info(TAG + 'onInit success')
|
||||
if (this.logIndex == 2) {// 语音信箱
|
||||
if (this.logIndex == 2) {// Voice mail
|
||||
this.totalCount = this.$app.$def.globalData.voicemailTotalData.voicemailCount;
|
||||
} else if (this.logIndex == 1) {
|
||||
this.totalCount = this.$app.$def.globalData.callLogTotalData.missedCount;
|
||||
@@ -62,26 +61,26 @@ export default {
|
||||
onDestroy() {
|
||||
LOG.info(TAG + 'logMessage onDestroy calllogDelete');
|
||||
},
|
||||
/* 点击全选按钮 */
|
||||
|
||||
clickSelectAll(e) {
|
||||
LOG.info(TAG + 'clickSelectAll e' + e.target);
|
||||
if (!this.isSelectAll) { // 全选
|
||||
if (!this.isSelectAll) { // Select all
|
||||
this.selectAllClicked = true;
|
||||
this.selectAll();
|
||||
} else { // 点击取消全选按钮,
|
||||
} else { // Click the deselect all button,
|
||||
this.selectAllClicked = false;
|
||||
this.unSelectAll();
|
||||
}
|
||||
this.refreshPageMessage();
|
||||
},
|
||||
/* 列表复选框状态变化 */
|
||||
|
||||
checkStateChange(e) {
|
||||
LOG.info(TAG + 'checkStateChange e' + e.target);
|
||||
this.callLogTemp[e.detail.index].checked = e.detail.checked;
|
||||
this.selectCount = e.detail.checked ? this.selectCount + e.detail.num : this.selectCount - e.detail.num; // 若复选框选中,则计数加1,未选中则计数-1
|
||||
this.refreshPageMessage();
|
||||
},
|
||||
/* 全选列表项 */
|
||||
|
||||
selectAll() {
|
||||
LOG.info('logMessage selectAll!!!');
|
||||
this.callLogTemp.forEach(element => {
|
||||
@@ -90,26 +89,26 @@ export default {
|
||||
this.selectCount = this.totalCount;
|
||||
},
|
||||
|
||||
/* 取消全选 */
|
||||
|
||||
unSelectAll() {
|
||||
this.callLogTemp.forEach(element => {
|
||||
element.checked = false;
|
||||
});
|
||||
this.selectCount = 0; // selectCount清零
|
||||
this.selectCount = 0; // selectCount Clear
|
||||
},
|
||||
|
||||
/* 标题计数刷新函数 */
|
||||
|
||||
refreshPageMessage() {
|
||||
if (this.selectCount > 0) {
|
||||
this.titleMessage = this.$t('value.callRecords.titleMessageSelect') + this.selectCount +
|
||||
this.$t('value.callRecords.titleMessageUnit');
|
||||
this.deleteDisabled = false;
|
||||
if (this.selectCount == this.totalCount) { // 全选情况按钮状态刷新
|
||||
if (this.selectCount == this.totalCount) { // Select all button status refresh
|
||||
this.ic_select_all = '/res/image/ic_select all_filled_m.svg';
|
||||
this.allSelectMessage = this.$t('value.callRecords.unSelectAll');
|
||||
this.allSelectTextStyle = 'batch-delete-text-selected';
|
||||
this.isSelectAll = true;
|
||||
/* 是否删除全部通话记录 */
|
||||
|
||||
this.deleteMessage = this.$t('value.callRecords.deleteMessageAsk') +
|
||||
this.$t('value.callRecords.deleteMessageAll') + this.$t('value.callRecords.deleteMessageCalls');
|
||||
} else {
|
||||
@@ -118,11 +117,11 @@ export default {
|
||||
this.allSelectTextStyle = 'batch-delete-text';
|
||||
this.isSelectAll = false;
|
||||
if (this.selectCount == 1) {
|
||||
/* 是否删除此通话记录 */
|
||||
|
||||
this.deleteMessage = this.$t('value.callRecords.deleteMessageAsk') +
|
||||
this.$t('value.callRecords.deleteMessageThis') + this.$t('value.callRecords.deleteMessageCalls');
|
||||
} else {
|
||||
/* 是否删除selectCount条通话记录 */
|
||||
|
||||
this.deleteMessage = this.$t('value.callRecords.deleteMessageAsk') + this.selectCount +
|
||||
this.$t('value.callRecords.deleteMessageUnit') + this.$t('value.callRecords.deleteMessageCalls');
|
||||
}
|
||||
@@ -137,15 +136,15 @@ export default {
|
||||
this.isSelectAll = false;
|
||||
}
|
||||
},
|
||||
/* 批量删除选中的通话记录 */
|
||||
|
||||
deleteCheckedCalls() {
|
||||
LOG.info('logMessage click delete !!!');
|
||||
this.$element('deleteCheckDialog').show(); // 显示删除提示框
|
||||
this.$element('deleteCheckDialog').show(); // Show delete prompt box
|
||||
},
|
||||
doDelete() {
|
||||
if (this.isSelectAll && this.logIndex == 0) { // 全选删除,全部通话记录
|
||||
if (this.isSelectAll && this.logIndex == 0) { // Select all to delete all call records
|
||||
this.callLogTemp = [];
|
||||
/* 清空通话记录 */
|
||||
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CALLLOG_DB_URI);
|
||||
callLogService.clearCallLog(DAHelper, () => {
|
||||
this.$app.$def.globalData.callLogTotalData.callLogList = [];
|
||||
@@ -155,21 +154,19 @@ export default {
|
||||
router.back();
|
||||
});
|
||||
} else {
|
||||
if (this.logIndex == 2) { // 语音信箱
|
||||
if (this.isSelectAll) { // 语音信箱全量删除
|
||||
if (this.logIndex == 2) { // Voice mail
|
||||
if (this.isSelectAll) { // Full deletion of voice mailbox
|
||||
this.callLogTemp = [];
|
||||
/* 清空通话记录 */
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.VOICEMAIL_DB_URI);
|
||||
callLogService.clearVoicemailList(DAHelper, () => {
|
||||
this.$app.$def.globalData.voicemailTotalData.voicemailList = [];
|
||||
this.$app.$def.globalData.voicemailTotalData.voicemailCount = 0;
|
||||
router.back();
|
||||
});
|
||||
} else { // 语音信箱非全量删除
|
||||
} else { // Partial deletion of voice mailbox
|
||||
this.doDeleteVoicemail();
|
||||
}
|
||||
} else {
|
||||
/* 通话记录非全选情况批量删除 */
|
||||
if (this.callLogMergeRule == this.from_contact) {
|
||||
this.doDeleteByContactMerge();
|
||||
} else {
|
||||
@@ -179,12 +176,11 @@ export default {
|
||||
}
|
||||
this.$element('deleteCheckDialog').close();
|
||||
},
|
||||
/* 执行语音信箱删除操作 */
|
||||
doDeleteVoicemail() {
|
||||
var unCheckedList = [];
|
||||
var voicemailIds = [];
|
||||
this.callLogTemp.forEach(element => {
|
||||
if (element.checked) { // 被选中的元素
|
||||
if (element.checked) { // Selected element
|
||||
voicemailIds.push(element.id);
|
||||
} else {
|
||||
unCheckedList.push(element);
|
||||
@@ -196,16 +192,15 @@ export default {
|
||||
this.back();
|
||||
});
|
||||
},
|
||||
/* 按联系人合并通话记录情况下,批量删除的处理函数 */
|
||||
doDeleteByContactMerge() {
|
||||
var unCheckedList = [];
|
||||
var numberList = []; // 用于存储没有联系人的通话记录的电话号码
|
||||
var contactIds = []; // 用于存储有联系人通话记录的quicksearch_key(联系人id)
|
||||
var numberList = []; // Phone number used to store call records without contacts
|
||||
var contactIds = []; // QuickSearch for storing contact call records_ key(The contact ID)
|
||||
this.callLogTemp.forEach(element => {
|
||||
if (element.checked) { // 被选中的元素
|
||||
if (Utils.isEmpty(element.contactKey)) {// 号码没有关联联系人
|
||||
if (element.checked) { // Selected element
|
||||
if (Utils.isEmpty(element.contactKey)) {// Number has no associated contact
|
||||
numberList.push(element.phone);
|
||||
} else { // 号码已关联联系人
|
||||
} else { // The number is already associated with a contact
|
||||
contactIds.push(element.contactKey);
|
||||
}
|
||||
} else {
|
||||
@@ -220,23 +215,21 @@ export default {
|
||||
});
|
||||
|
||||
},
|
||||
/* 按时间合并通话记录情况下,批量删除的处理函数 */
|
||||
doDeleteByTimeMerge() {
|
||||
var unCheckedList = [];
|
||||
var checkedList = [];
|
||||
var removeIds = [];
|
||||
this.callLogTemp.forEach(element => {
|
||||
if (element.checked) { // 被选中的元素
|
||||
if (element.checked) { // Selected element
|
||||
checkedList.push(element);
|
||||
if (!this.selectAllClicked || this.logIndex == 1) {
|
||||
// 非全选的情况 或未接来电 将选中的元素传给后台删除
|
||||
element.ids.forEach(elementId => {
|
||||
removeIds.push(elementId);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
unCheckedList.push(element);
|
||||
if (this.selectAllClicked && this.logIndex != 1) { // 全选且非未拒接来电跳转的情况,将未选中的元素传给后台排除删除
|
||||
if (this.selectAllClicked && this.logIndex != 1) {
|
||||
element.ids.forEach(elementId => {
|
||||
removeIds.push(elementId);
|
||||
});
|
||||
@@ -244,7 +237,7 @@ export default {
|
||||
}
|
||||
});
|
||||
this.callLogTemp = unCheckedList;
|
||||
if (!this.selectAllClicked || this.logIndex == 1) { // 未点击全选或当前是未拒接来电,则按照选中id删除。
|
||||
if (!this.selectAllClicked || this.logIndex == 1) {
|
||||
LOG.info('logMessage delete by ids:' + removeIds);
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CALLLOG_DB_URI);
|
||||
callLogService.deleteCallLogByIds(DAHelper, removeIds, () => {
|
||||
@@ -259,11 +252,9 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
/* 取消删除 */
|
||||
cancelDialog() {
|
||||
this.$element('deleteCheckDialog').close();
|
||||
},
|
||||
/* 返回上一个页面 */
|
||||
back() {
|
||||
router.back();
|
||||
},
|
||||
@@ -275,12 +266,12 @@ export default {
|
||||
},
|
||||
getCallLog(pageIndex, pageSize) {
|
||||
var pageList = [];
|
||||
if (this.logIndex == 2) {// 语音信箱
|
||||
if (this.logIndex == 2) {// voiceMail
|
||||
pageList = this.callLogList;
|
||||
} else {
|
||||
pageList = callLogService.getCallLog(pageIndex, pageSize, this.callLogList);
|
||||
}
|
||||
if (this.selectAllClicked) { // 点击过全选
|
||||
if (this.selectAllClicked) { // Click Select all
|
||||
pageList.forEach((element) => {
|
||||
element.checked = true;
|
||||
});
|
||||
|
||||
@@ -35,17 +35,15 @@
|
||||
{{ $t('phone.greeting') }}
|
||||
</option>
|
||||
|
||||
<!--TODO:当前为方便跳转批量选择联系人界面,临时添加该项,后续删除-->
|
||||
<option value="5" if="{{$app.$def.globalData.isDisplay}}">
|
||||
批量选择联系人
|
||||
<option value="5" if="{{ $app.$def.globalData.isDisplay }}">
|
||||
{{ this.$t('value.contacts.batchSelectContacts') }}
|
||||
</option>
|
||||
|
||||
<!--TODO:当前为测试,临时添加通话记录合并配置项,后续根据实际需要删除-->
|
||||
<option value="6" if="{{$app.$def.globalData.isDisplay}}">
|
||||
{{ $t('phone.callLogMergeRule') }}
|
||||
</option>
|
||||
<option value="8" if="{{$app.$def.globalData.isDisplay}}">
|
||||
样例页面
|
||||
<option value="8" if="{{ $app.$def.globalData.isDisplay }}">
|
||||
{{ this.$t('value.contacts.samplePage') }}
|
||||
</option>
|
||||
</menu>
|
||||
<div class="num-text-area" show="{{ ifShowConfig.showNumTextAera }}">
|
||||
@@ -54,16 +52,13 @@
|
||||
style="padding-left : {{ numTextPaddingLeft }} px; font-size : {{ numTextSize }} px;"></input>
|
||||
</div>
|
||||
|
||||
<!-- 拨号搜索list -->
|
||||
<list class="matched-call-records-list" show="{{ ifShowConfig.showMatchedList }}" ontouchstart="touchStartDialer"
|
||||
scrollpage="false" scrollbar="auto">
|
||||
<list-item id="matchedItemId{{ $idx }}" for="{{ matchedRecordsList }}" class="matched-list-item"
|
||||
on:click.bubble="callOutByMatchedList({{ $idx }})" onlongpress="showMatchedListMenu({{ $idx }})">
|
||||
<div>
|
||||
|
||||
<!-- 左侧号码及号码信息显示 -->
|
||||
<div class="matched-list-item-left">
|
||||
<!-- 未拒接来电 红色字体显示-->
|
||||
<div if="{{ $item.callType == 3 || $item.callType == 5 }}" class="matched-item-left-top-text-red">
|
||||
<div if="{{ $item.name == '' || $item.name == undefined }}">
|
||||
<text id="firstPartTextId{{ $idx }}" class="matched-item-main-text-red">{{ $item.firstPart
|
||||
@@ -108,7 +103,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--右侧细节图标-->
|
||||
<div class="matched-list-item-right">
|
||||
<div id="matchedItemDetailId{{ $idx }}" class="matched-list-item-right-image"
|
||||
grab:touchstart.bubble="touchStartMatchedItem"
|
||||
@@ -122,7 +116,6 @@
|
||||
</list-item>
|
||||
</list>
|
||||
|
||||
<!--通话记录子组件 -->
|
||||
<div id="callLogWindowId" if="{{ ifShowConfig.showCallRecords }}"
|
||||
class="{{ titleType == 0 ? 'call-records-container' : 'call-records-container-small-title' }}">
|
||||
<recordscomp all-calls="{{ recordList }}" batch-delete="{{ false }}" missed-call-logs="{{ missedList }}"
|
||||
@@ -136,11 +129,9 @@
|
||||
</recordscomp>
|
||||
</div>
|
||||
|
||||
<!-- 该组件承载联系人操作组件和拨号盘组件的显示隐藏动画,联系人操作组件及拨号盘组件按照container设置宽高,-->
|
||||
<!-- 不可以给该组件添加宽高度限制 -->
|
||||
<div id="numBoardId" show="{{ dialerStyle }}" class="{{ dialerStyle }}">
|
||||
|
||||
<!-- 联系人操作组件-->
|
||||
<!-- Contact Action Component-->
|
||||
<div class="contacts-operate" show="{{ ifShowConfig.showContactsOperates }}">
|
||||
<div id="addContactsId" class="contacts-operate-box" onclick="addContacts({{ numText }})">
|
||||
<image class="contacts-image" src="{{ iconResource.ic_contacts_add }}"></image>
|
||||
@@ -157,7 +148,7 @@
|
||||
</div>
|
||||
<div class="board-space"></div>
|
||||
|
||||
<!-- 拨号盘 -->
|
||||
<!-- dial -->
|
||||
<div class="board-num" ontouchstart="touchStartDialer" ontouchmove="touchMoveDialer">
|
||||
<div class="board-numline">
|
||||
<div id="buttonId1" class="board-button" ontouchstart="buttonTouchStart" ontouchend="buttonTouchEnd(1)"
|
||||
@@ -323,7 +314,6 @@
|
||||
<div class="board-space-bottom"></div>
|
||||
</div>
|
||||
|
||||
<!-- 拨号盘缩略绿色图标 -->
|
||||
<div id="boardThunmbnail" show="{{ showBoardThumbnail }}" class="{{ boardThumbnailStyle }}"
|
||||
style="margin-right : {{ bordButtonMarginRight }} px; width : {{ bordButtonWidth }} px;"
|
||||
ontouchstart="boardThunmbnailTouchStart"
|
||||
@@ -351,27 +341,27 @@
|
||||
</div>
|
||||
<menu id="matchedListMenu" onselected="onMatchedListSelected">
|
||||
|
||||
<!-- 电话号码或名称 -->
|
||||
<!-- Telephone number or name -->
|
||||
<option value="0" style="font-weight : bold; font-size : 40px;">
|
||||
{{
|
||||
(matchedMenuData.name == '' || matchedMenuData.name == undefined) ? ((matchedMenuData.number && matchedMenuData.number.length > 4) ? matchedMenuData.number.substring(0, 7) + '..' : matchedMenuData.number) : ((matchedMenuData.name && matchedMenuData.name.length > 4) ? this.subStringWithEllipsis(matchedMenuData.name) : matchedMenuData.name)
|
||||
}}
|
||||
</option>
|
||||
|
||||
<!-- 新建联系人 -->
|
||||
<!-- Creating a Contact -->
|
||||
<option value="1" show="{{ matchedMenuData.name == '' || matchedMenuData.name == undefined }}">
|
||||
{{ $t('phone.addContacts') }}
|
||||
</option>
|
||||
|
||||
<!-- 保存至已有联系人 -->
|
||||
<!-- Save to an existing contact -->
|
||||
<option value="2" show="{{ matchedMenuData.name == '' || matchedMenuData.name == undefined }}">
|
||||
{{ $t('phone.saveContacts') }}
|
||||
</option>
|
||||
|
||||
<!-- 发送信息 -->
|
||||
<!-- Send a message -->
|
||||
<option value="3">{{ $t('value.callRecords.sendMessage') }}</option>
|
||||
|
||||
<!-- 呼叫前编辑 -->
|
||||
<!-- Pre-call editing -->
|
||||
<option value="4">{{ $t('value.callRecords.editBeforeCall') }}</option>
|
||||
</menu>
|
||||
<dialog id="simpledialog" class="dialog-main" oncancel="cancelDialog">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@
|
||||
@import '../../base/base_color.scss';
|
||||
@import '../../base/base_style.css';
|
||||
.container {
|
||||
position: relative; /* 使内部组件按照声明顺序流式分层展示,排在下边的在上层 */
|
||||
position: relative;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
@@ -71,7 +71,6 @@
|
||||
align-items: center;
|
||||
width: 200px;
|
||||
height: 100%;
|
||||
/*background-color: gold;*/
|
||||
}
|
||||
.board-button-circle {
|
||||
width: 120px;
|
||||
@@ -182,7 +181,6 @@
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 83%;
|
||||
/*background-color: silver;*/
|
||||
bottom: 0px;
|
||||
}
|
||||
.call-records-container-small-title {
|
||||
@@ -192,7 +190,6 @@
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 91%;
|
||||
/*background-color: silver;*/
|
||||
bottom: 0px;
|
||||
}
|
||||
.board-attention {
|
||||
@@ -265,7 +262,7 @@
|
||||
.board-button div:active {
|
||||
background-color: $backgroundColorOnClick;
|
||||
}
|
||||
/* 双卡情况底部按钮样式适配 */
|
||||
|
||||
.board-button-two-card-side {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@@ -322,7 +319,7 @@
|
||||
.board-button-square:active {
|
||||
background-color: $backgroundColorOnClick;
|
||||
}
|
||||
/* 双卡状态下方形按钮置灰样式 */
|
||||
|
||||
.board-button-square-onpress2 {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
@@ -376,8 +373,6 @@
|
||||
.board-image {
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
/*border-left:1px;
|
||||
border-right:1px;*/
|
||||
}
|
||||
.delete-button-normal {
|
||||
height: 50px;
|
||||
@@ -417,7 +412,7 @@
|
||||
width: 15%;
|
||||
height: 10%;
|
||||
}
|
||||
/* 拨号盘缩略图样式控制 */
|
||||
|
||||
.board-thumbnail-button {
|
||||
position: absolute;
|
||||
background-color: $baseColorGreen;
|
||||
@@ -514,14 +509,14 @@
|
||||
border-radius: 5px;
|
||||
background-color: white;
|
||||
}
|
||||
/* 快捷拨号设置弹框 */
|
||||
|
||||
.dialog-main {
|
||||
width: 92%;
|
||||
height: 16%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
/* 暗码弹窗 */
|
||||
|
||||
.dialog-secret-code {
|
||||
width: 92%;
|
||||
justify-content: center;
|
||||
@@ -648,7 +643,6 @@
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
/* 拨号搜索相关样式 */
|
||||
.matched-call-records-list {
|
||||
flex-direction: column;
|
||||
columns: 1;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
background-color: #FFFFFF;
|
||||
background-color: #FFF;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
@@ -123,12 +123,10 @@
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: 90px;
|
||||
color: darkgray;
|
||||
color: #a9a9a9;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.greeting-parent-div {
|
||||
position: relative;
|
||||
flex-direction: column;
|
||||
@@ -149,7 +147,7 @@
|
||||
.divider {
|
||||
line-cap: round;
|
||||
stroke-width: 1px;
|
||||
color: #cccccc;
|
||||
color: #ccc;
|
||||
width: 93%;
|
||||
margin-left: -25px;
|
||||
}
|
||||
@@ -170,7 +168,7 @@
|
||||
}
|
||||
|
||||
.batch-add-operation-button:active {
|
||||
background-color: lightgray;
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
.batch-add-image-icon {
|
||||
@@ -195,7 +193,7 @@
|
||||
}
|
||||
|
||||
.batch-delete-operation-button:active {
|
||||
background-color: lightgray;
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
.batch-delete-image-icon {
|
||||
|
||||
@@ -30,7 +30,6 @@ export default {
|
||||
greetingTitle: '',
|
||||
},
|
||||
|
||||
//初始化页面
|
||||
onInit() {
|
||||
this.greetingList = this.defaultGreetingList;
|
||||
this.refreshPageTabs();
|
||||
@@ -42,7 +41,6 @@ export default {
|
||||
this.refreshPageTabs();
|
||||
},
|
||||
|
||||
//返回上层页面
|
||||
back: function () {
|
||||
this.$emit('eventType', {
|
||||
isDelete: true,
|
||||
@@ -50,21 +48,17 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
//全选
|
||||
clickCheckedAll: function () {
|
||||
if (!this.isSelectAll) {
|
||||
//全选
|
||||
this.selectAll();
|
||||
} else {
|
||||
//取消全选
|
||||
this.unSelectAll();
|
||||
}
|
||||
this.refreshPageTabs();
|
||||
},
|
||||
|
||||
/* 全选列表项 */
|
||||
selectAll: function () {
|
||||
this.checkedCount = 0; //将已选择的计数清除后重新增加
|
||||
this.checkedCount = 0; //Clear the selected count and increase it again
|
||||
this.greetingList.forEach((element, index) => {
|
||||
if (index == 0) {
|
||||
return;
|
||||
@@ -74,7 +68,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
/* 取消全选 */
|
||||
unSelectAll: function () {
|
||||
this.greetingList.forEach((element, index) => {
|
||||
if (index == 0) {
|
||||
@@ -87,7 +80,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
/* 标题计数刷新函数 */
|
||||
refreshPageTabs: function () {
|
||||
if (this.checkedCount > 0) {
|
||||
switch (this.language) {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
background-color: #FFFFFF;
|
||||
background-color: #FFF;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
@@ -136,7 +136,7 @@
|
||||
.divider {
|
||||
line-cap: round;
|
||||
stroke-width: 1px;
|
||||
color: #cccccc;
|
||||
color: #ccc;
|
||||
width: 93%;
|
||||
margin-left: -25px;
|
||||
}
|
||||
@@ -157,7 +157,7 @@
|
||||
}
|
||||
|
||||
.batch-add-operation-button:active {
|
||||
background-color: lightgray;
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
.batch-add-image-icon {
|
||||
@@ -172,7 +172,7 @@
|
||||
}
|
||||
|
||||
.batch-add-text:disabled {
|
||||
color: darkgray;
|
||||
color: #a9a9a9;
|
||||
}
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
}
|
||||
|
||||
.batch-delete-operation-button:active {
|
||||
background-color: lightgray;
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
.batch-delete-image-icon {
|
||||
@@ -259,5 +259,5 @@
|
||||
border-left: -20px;
|
||||
width: 85%;
|
||||
background-color: transparent;
|
||||
border-bottom: 1px solid lightgray;
|
||||
border-bottom: 1px solid #d3d3d3;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ export default {
|
||||
this.progressStart = '00:' + index;
|
||||
}
|
||||
|
||||
//最大时间15秒,根据当前时间算进度条
|
||||
//The maximum time is 15 seconds, and the progress bar is calculated according to the current time
|
||||
this.progressNum = index / 15 * 100;
|
||||
if (index > 14) {
|
||||
clearInterval(this.timeOutId);
|
||||
@@ -82,8 +82,6 @@ export default {
|
||||
this.$element('confirmAddGreeting').show();
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
//保存录音产生的文件
|
||||
},
|
||||
addGreetingDialog: function () {
|
||||
this.showStartRecordBtn = false;
|
||||
@@ -98,7 +96,6 @@ export default {
|
||||
this.progressStart = '00:00';
|
||||
this.progressNum = 0;
|
||||
this.showStartRecordBtn = true;
|
||||
//删除录音产生的文件
|
||||
},
|
||||
|
||||
groupNameChanged: function (e) {
|
||||
@@ -146,11 +143,9 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
//返回上层页面
|
||||
back: function () {
|
||||
router.back();
|
||||
},
|
||||
//保存设置
|
||||
saveGreeting: function () {
|
||||
var checkedId = '';
|
||||
var uncheckedIds = [];
|
||||
@@ -194,10 +189,10 @@ export default {
|
||||
this.$element('addGreetingDialog').show();
|
||||
},
|
||||
/**
|
||||
* 获取应答语列表数据
|
||||
* Get response list data
|
||||
*
|
||||
* @param code 2005 FA与PA通行协议码
|
||||
* @param data contactId 联系人ID
|
||||
* @param code 2005 FA and PA access protocol code
|
||||
* @param data contactId The contact ID
|
||||
*/
|
||||
initGreeting: function (code, data) {
|
||||
var defaultList = [{
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
/*标题*/
|
||||
|
||||
.todo-title-div {
|
||||
align-items: center;
|
||||
@@ -29,7 +28,8 @@
|
||||
height: 200px;
|
||||
width: 100%;
|
||||
}
|
||||
.title-image-box{
|
||||
|
||||
.title-image-box {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-right: 25px;
|
||||
@@ -39,25 +39,21 @@
|
||||
border-radius: 8px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.title-image-box:active{
|
||||
background-color: lightgray;
|
||||
|
||||
.title-image-box:active {
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
/*标题图片*/
|
||||
|
||||
.title-image {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
/*标题文字*/
|
||||
|
||||
.todo-title-name {
|
||||
text-align: left;
|
||||
font-size: 50px;
|
||||
}
|
||||
|
||||
/*无联系人布局父容器*/
|
||||
|
||||
.empty-group {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@@ -66,22 +62,17 @@
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/*内容图片*/
|
||||
|
||||
.empty-image {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
/*标题文字*/
|
||||
|
||||
.empty-text {
|
||||
margin-top: 10px;
|
||||
color: darkgray;
|
||||
color: #a9a9a9;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
/*搜索父容器*/
|
||||
|
||||
.body-group {
|
||||
width: 100%;
|
||||
@@ -89,7 +80,6 @@
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/*搜索*/
|
||||
|
||||
.search-div {
|
||||
flex-direction: row;
|
||||
@@ -101,8 +91,6 @@
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
||||
/*列表容器*/
|
||||
|
||||
.list-div-group {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
@@ -110,7 +98,6 @@
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
.list-div-group {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
<element src="../../../../common/component/contactlist/contactlist" name="contactlistcomp"></element>
|
||||
<div class="container">
|
||||
|
||||
<!--标题-->
|
||||
<div class="todo-title-div">
|
||||
<div class="title-image-box" ontouchend="back">
|
||||
<image class="title-image" src="{{ $t('svg.selectContact.back') }}" onclick="back"></image>
|
||||
@@ -24,14 +23,12 @@
|
||||
</text>
|
||||
</div>
|
||||
|
||||
<!-- 搜索框-->
|
||||
<div class="search-div" if="{{ searchTitleLayout }}">
|
||||
<search id="search" hint="{{ $t('value.selectContact.page.search') }}" focusable="true"
|
||||
onchange="onTextChange" ontouchstart="touchStartSearch"
|
||||
value="{{ (searchDefaultName && searchDefaultName.length > 0) ? searchDefaultName : '' }}"></search>
|
||||
</div>
|
||||
|
||||
<!-- 空白布局-->
|
||||
<div class="empty-group">
|
||||
<div class="empty-group" show="{{ showEmpty }}">
|
||||
<image class="empty-image" src="{{ $t('svg.selectContact.emptyImage') }}"></image>
|
||||
|
||||
@@ -29,11 +29,11 @@ export default {
|
||||
emptyText: '',
|
||||
searchContactList: [],
|
||||
showEmpty: false,
|
||||
//是否显示内容布局
|
||||
//Show content layout
|
||||
contentShow: false,
|
||||
//是否显示搜索标题
|
||||
//Show search title
|
||||
searchTitleLayout: true,
|
||||
//是否显示搜索列表
|
||||
//Show search list
|
||||
searchLayoutShow: false,
|
||||
searchPhoneNum: 0,
|
||||
searchDefaultName: '',
|
||||
@@ -51,7 +51,7 @@ export default {
|
||||
onInit() {
|
||||
this.emptyText = this.$t('value.selectContact.page.empty');
|
||||
if (Utils.isEmpty(this.searchDefaultName)) {
|
||||
//初始化联系人数据
|
||||
//Initialize contact data
|
||||
this.initData();
|
||||
} else {
|
||||
this.searchText = this.searchDefaultName;
|
||||
@@ -67,11 +67,9 @@ export default {
|
||||
this.requestInit(requestData);
|
||||
},
|
||||
back() {
|
||||
//返回
|
||||
router.back();
|
||||
},
|
||||
onTextChange(text) {
|
||||
//搜索输入框
|
||||
if (Utils.isEmpty(text.text)) {
|
||||
this.emptyText = this.$t('value.selectContact.page.empty');
|
||||
this.refreshLayout();
|
||||
@@ -112,9 +110,7 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 缓存分页加载,由组件提供的方法接口调用
|
||||
*/
|
||||
|
||||
requestItem: function () {
|
||||
this.page++;
|
||||
var requestData = {
|
||||
@@ -123,9 +119,7 @@ export default {
|
||||
};
|
||||
this.requestInit(requestData);
|
||||
},
|
||||
/**
|
||||
* 初始化列表数据
|
||||
*/
|
||||
|
||||
requestInit: function (data) {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
selectContactsAbility.queryContacts(DAHelper, resultList=>{
|
||||
@@ -134,7 +128,7 @@ export default {
|
||||
} else {
|
||||
var listTemp = [];
|
||||
var speedNumberMap = new Map();
|
||||
if (this.type == 'saveSpeedDial') {// 快速拨号跳转本页面情况下,取出所有已设置快速拨号的联系人号码放入speedNumberMap,供后续过滤已选择的联系人号码使用
|
||||
if (this.type == 'saveSpeedDial') {
|
||||
for(let i = 1; i <=9; i++) {
|
||||
var speedItemString = this.$app.$def.globalData.storage.getSync('speedDial'+i,'');
|
||||
if (!Utils.isEmpty(speedItemString)) {
|
||||
@@ -151,18 +145,18 @@ export default {
|
||||
element.name.nameSuffix = element.nameSuffix;
|
||||
element.portraitPath = false;
|
||||
if (!Utils.isEmpty(element.phoneNumbers) && element.phoneNumbers.length > 0) {
|
||||
var phoneNumbersTemp = []; //创建过滤后的电话号码容器
|
||||
var phoneNumbersTemp = []; //Create filtered phone number container
|
||||
element.phoneNumbers.forEach(childEle => {
|
||||
childEle.checked = false;
|
||||
childEle.labelName = this.getPhoneLabelNameById(childEle.labelId);
|
||||
this.initVariableSpan(element);
|
||||
// When speed dialing jumps to this page, if speed dialing has been set, no container will be added
|
||||
if (!speedNumberMap.has(Utils.removeSpace(childEle.phoneNumber))) {
|
||||
// 快速拨号跳转本页面的情况下,如果已设置快速拨号则不添加容器
|
||||
phoneNumbersTemp.push(childEle);
|
||||
}
|
||||
})
|
||||
if (phoneNumbersTemp.length > 0) {
|
||||
//只有在存在未被设置为快速拨号的电话号码时,才显示在contact列表中。
|
||||
// Displayed in the contact list only if there are phone numbers that are not set to speed dial.
|
||||
element.phoneNumbers = phoneNumbersTemp;
|
||||
listTemp.push(element);
|
||||
}
|
||||
@@ -171,11 +165,10 @@ export default {
|
||||
this.contactList = listTemp;
|
||||
}
|
||||
}
|
||||
//请求数据完成刷新界面,保证空布局和数据列表正常显示
|
||||
this.refreshLayout();
|
||||
});
|
||||
},
|
||||
/* 根据手机号的LabelId获取LabelName */
|
||||
|
||||
getPhoneLabelNameById: function(phoneLabelId) {
|
||||
var labelName = '';
|
||||
switch (parseInt(phoneLabelId)) {
|
||||
@@ -212,11 +205,9 @@ export default {
|
||||
return labelName;
|
||||
},
|
||||
|
||||
/**
|
||||
* 赋值自定义属性,为后面可变字体搜索做准备
|
||||
*/
|
||||
|
||||
initVariableSpan: function (item) {
|
||||
//初始化可变名称
|
||||
//Initialize variable name
|
||||
var matchString = Utils.getMatchedString(item.emptyNameData, this.searchText);
|
||||
if (Utils.isEmpty(matchString) || Utils.isEmpty(this.searchText.trim())) {
|
||||
item.name.searchTextStart = '';
|
||||
@@ -229,7 +220,7 @@ export default {
|
||||
item.name.searchTextMiddle = name.substr(index, matchString.length);
|
||||
item.name.searchTextEnd = name.substr(index + matchString.length);
|
||||
}
|
||||
//初始化可变手机号
|
||||
//Initialize variable phone number
|
||||
for (var i = 0; i < item.phoneNumbers.length; i++) {
|
||||
var phoneNumber = item.phoneNumbers[i].phoneNumber;
|
||||
var matchStringPhone = Utils.getMatchedString(phoneNumber, this.searchText);
|
||||
@@ -245,9 +236,8 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 电话号码去重
|
||||
*/
|
||||
|
||||
|
||||
duplicateRemoval: function (result) {
|
||||
if (Utils.isEmptyList(result.data)) {
|
||||
return result;
|
||||
@@ -256,21 +246,20 @@ export default {
|
||||
for (var i = 0; i < resultList.length; i++) {
|
||||
var item = resultList[i];
|
||||
var phoneNumbersList = [];
|
||||
//倒序排序,去重复的最后一个添加
|
||||
//Sort in reverse order to repeat the last addition
|
||||
for (var j = item.phoneNumbers.length - 1; j >= 0; j--) {
|
||||
var indexOf = this.indexOf(item.phoneNumbers[j], phoneNumbersList);
|
||||
//不存在则添加
|
||||
//Add if it does not exist
|
||||
if (indexOf == -1) {
|
||||
phoneNumbersList.push(item.phoneNumbers[j]);
|
||||
}
|
||||
}
|
||||
//为了减少一次循环搜索名称颜色可变加入此处,初始化可变字体
|
||||
this.initVariableSpan(item);
|
||||
item.phoneNumbers = phoneNumbersList;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
//查询联系人电话是否已在电话列表中,通过电话号码去重,显示最后一次添加的
|
||||
|
||||
indexOf: function (item, phoneNumbersList) {
|
||||
var index = -1;
|
||||
if (Utils.isEmptyList(phoneNumbersList)) {
|
||||
@@ -285,9 +274,8 @@ export default {
|
||||
}
|
||||
return index;
|
||||
},
|
||||
/**
|
||||
* 去除已选中的联系人电话或联系人
|
||||
*/
|
||||
|
||||
|
||||
filterContact: function (contactData, result) {
|
||||
if (Utils.isEmptyList(contactData)) {
|
||||
return result;
|
||||
@@ -303,7 +291,7 @@ export default {
|
||||
var phoneNumbers = resultItem.phoneNumbers;
|
||||
tempNumber = [];
|
||||
for (var j = 0; j < phoneNumbers.length; j++) {
|
||||
//通过电话号码和电话类型过滤
|
||||
//Filter by phone number and phone type
|
||||
if (!((phoneNumbers[j].phoneNumber == routerItem.selectNumber)
|
||||
&& (phoneNumbers[j].labelId == routerItem.selectLabelId))) {
|
||||
tempNumber.push(phoneNumbers[j]);
|
||||
@@ -312,7 +300,7 @@ export default {
|
||||
resultItem.phoneNumbers = tempNumber;
|
||||
}
|
||||
}
|
||||
//如果电话列表中没有元素
|
||||
//If there is no element in the phone list
|
||||
if (resultItem.phoneNumbers.length <= 0) {
|
||||
continue;
|
||||
}
|
||||
@@ -321,26 +309,24 @@ export default {
|
||||
result.data = resultList;
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* 显示布局
|
||||
*/
|
||||
|
||||
|
||||
refreshLayout() {
|
||||
if (Utils.isEmptyList(this.contactList)) {
|
||||
//联系人数据为空
|
||||
//Contact data is empty
|
||||
this.searchTitleLayout = false;
|
||||
this.showEmpty = true;
|
||||
this.contentShow = false;
|
||||
} else {
|
||||
//联系人数据不为空
|
||||
//Contact data is not empty
|
||||
this.searchTitleLayout = true;
|
||||
this.showEmpty = false;
|
||||
this.contentShow = true;
|
||||
this.searchLayoutShow = false;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 点击事件
|
||||
*/
|
||||
|
||||
|
||||
selectClick: function (params) {
|
||||
if (Utils.isEmpty(this.searchDefaultName)) {
|
||||
LOG.info(TAG + 'selectClick' + 'logMessage select=====>selectClick index:' + params.detail.index + ' indexChild:');
|
||||
@@ -352,14 +338,14 @@ export default {
|
||||
}
|
||||
LOG.info(TAG + 'selectClick' + 'logMessage item = '+item);
|
||||
var indexChild = params.detail.indexChild;
|
||||
if (this.type == 'saveVoicemail') { //语音信箱选择联系人号码
|
||||
if (this.type == 'saveVoicemail') { //Voice mailbox select contact number
|
||||
var voicemailNumber = item.phoneNumbers[indexChild].phoneNumber;
|
||||
this.$app.$def.globalData.voicemailNumber = voicemailNumber;// 通过全局变量回传选中的voicemailNumber;
|
||||
} else if (this.type == 'saveSpeedDial') {//快速拨号选择联系人
|
||||
this.$app.$def.globalData.voicemailNumber = voicemailNumber;
|
||||
} else if (this.type == 'saveSpeedDial') {//Speed dial select contact
|
||||
var speedNumber = item.phoneNumbers[indexChild].phoneNumber
|
||||
var speedItem = {}; //根据选择的联系人生成快速拨号数据
|
||||
var speedItem = {}; //Generate speed dial data based on the selected contact
|
||||
speedItem.emptyNameData = item.emptyNameData;
|
||||
speedItem.routerIndex = this.speedDialIndex + 1;//显示的标识比数组坐标大1
|
||||
speedItem.routerIndex = this.speedDialIndex + 1;
|
||||
speedItem.contactId = item.contactId;
|
||||
speedItem.nameSuffix = item.nameSuffix;
|
||||
speedItem.portraitColor = item.portraitColor;
|
||||
@@ -384,9 +370,8 @@ export default {
|
||||
onSearchTextChange: function (text) {
|
||||
this.searchRequest(this.searchRequestCode, text);
|
||||
},
|
||||
/**
|
||||
* 搜索请求后台
|
||||
*/
|
||||
|
||||
|
||||
searchRequest: function (code, keyText) {
|
||||
var DAHelper = this.$app.$def.getDAHelper(Constants.uri.CONTACT_DB_URI);
|
||||
var data = {};
|
||||
@@ -405,9 +390,8 @@ export default {
|
||||
this.refreshSearchList(keyText, this.searchContactList);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 刷新搜索界面
|
||||
*/
|
||||
|
||||
|
||||
refreshSearchList: function (keyText, searchContactList) {
|
||||
if (Utils.isEmpty(keyText)) {
|
||||
this.searchLayoutShow = false;
|
||||
@@ -417,7 +401,7 @@ export default {
|
||||
this.searchLayoutShow = false;
|
||||
} else {
|
||||
if (Utils.isEmptyList(searchContactList)) {
|
||||
//搜索列表为空,更新搜索文字描述
|
||||
//The search list is empty. Update the search text description
|
||||
this.emptyText = this.$t('value.selectContact.page.emptyText');
|
||||
this.showEmpty = true;
|
||||
this.contentShow = false;
|
||||
@@ -430,9 +414,8 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 查找可变字体下标
|
||||
* **/
|
||||
|
||||
|
||||
searchIndexOf: function (keyText, source) {
|
||||
return source.indexOf(keyText);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user