Commit bb25672b by zhangxw

接待记录 客户姓名/手机号脱敏开发

1 parent d3cf45e6
......@@ -33,6 +33,30 @@ var convertCentsToYuan = function (cents) {
return dollars
}
// 客户姓名脱敏
var desensitizeName = function(name) {
if (name) {
var nameStr = name.trim() + ''
if (nameStr.length <= 1) {
return nameStr
} else {
return nameStr[0] + '**'
}
}
}
// 客户手机号脱敏
var desensitizePhoneNumber = function(phoneNumber) {
if (phoneNumber) {
var phoneNumberStr = phoneNumber.trim() + ''
if (phoneNumberStr.length !== 11) {
return phoneNumberStr
} else {
return phoneNumberStr.slice(0, 3) + '****' + phoneNumberStr.slice(7)
}
}
}
/*
* 导出
*/
......@@ -41,5 +65,7 @@ module.exports = {
isIncludesItem: isIncludesItem,
filterMerchantName: filterMerchantName,
isShowEmpty: isShowEmpty,
convertCentsToYuan: convertCentsToYuan
convertCentsToYuan: convertCentsToYuan,
desensitizeName: desensitizeName,
desensitizePhoneNumber: desensitizePhoneNumber
}
......@@ -5,10 +5,10 @@
<view class="base-message">
<view>
<view class="record-name text-hide">
<text class="value">{{itemInfo.customerName}}</text>
<text class="order-name" wx:if="{{itemInfo.realCustomerName && itemInfo.realCustomerName != itemInfo.customerName}}">({{itemInfo.realCustomerName}})</text>
<text class="value">{{filter.desensitizeName(itemInfo.customerName)}}</text>
<text class="order-name" wx:if="{{itemInfo.realCustomerName && itemInfo.realCustomerName != itemInfo.customerName}}">({{filter.desensitizeName(itemInfo.realCustomerName)}})</text>
</view>
<text class="record-phone" data-phone="{{itemInfo.phoneNumber}}">{{itemInfo.phoneNumber}}</text>
<text class="record-phone" data-phone="{{itemInfo.phoneNumber}}">{{filter.desensitizePhoneNumber(itemInfo.phoneNumber)}}</text>
</view>
<view wx:if="{{itemInfo.employeeName && showEmployeeName}}" catchtap="phoneCall" data-phone="{{itemInfo.employeePhone}}" class="employee-name text-hide">{{itemInfo.employeeName}}</view>
</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!