|
|
|
@@ -15,8 +15,9 @@ const contacts = useContactsStore() |
|
|
|
const contact = useContactItemStore() |
|
|
|
contact.setNewAvatar("") |
|
|
|
|
|
|
|
const onShowSuggestionsMenu = ref(false) |
|
|
|
|
|
|
|
const state = reactive({ |
|
|
|
isNickNameSuggestionsShow: false, |
|
|
|
newAvatar: undefined, |
|
|
|
isDateSelectorVisible: false |
|
|
|
}); |
|
|
|
@@ -32,8 +33,8 @@ const setChooseDate = (param) => { |
|
|
|
contact.contact.nextVisitDate = param[3] |
|
|
|
} |
|
|
|
|
|
|
|
function setShowSuggestions(isShow: Boolean) { |
|
|
|
state.isNickNameSuggestionsShow = isShow |
|
|
|
function onShowSuggestions() { |
|
|
|
onShowSuggestionsMenu.value = true |
|
|
|
} |
|
|
|
|
|
|
|
const updateFacePhoto = () => { |
|
|
|
@@ -48,13 +49,9 @@ const updateFacePhoto = () => { |
|
|
|
}, |
|
|
|
}) |
|
|
|
} |
|
|
|
const updateNickName = (value) => { |
|
|
|
if (value === null) { |
|
|
|
state.isNickNameSuggestionsShow = false |
|
|
|
} |
|
|
|
else { |
|
|
|
contact.contact.nickName = BjxHelper.getBJXFirstChar(contact.contact.name) + value; |
|
|
|
} |
|
|
|
const onNickNameSelected = (value) => { |
|
|
|
console.log(value) |
|
|
|
contact.contact.nickName = value.name; |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
@@ -81,21 +78,25 @@ const updateNickName = (value) => { |
|
|
|
<nut-input v-model="contact.contact.name" class="nut-input-text" /> |
|
|
|
</nut-form-item> |
|
|
|
<nut-form-item label="称呼"> |
|
|
|
<nut-input v-model="contact.contact.nickName" @change="state.isNickNameSuggestionsShow = false" class="nut-input-text" @focus="setShowSuggestions(true)" @blur="setShowSuggestions(false)" /> |
|
|
|
<nut-input v-model="contact.contact.nickName" class="nut-input-text"> |
|
|
|
<template #right> |
|
|
|
<nut-button type="default" plain size="small" @tap="onShowSuggestions">选择</nut-button> |
|
|
|
</template> |
|
|
|
</nut-input> |
|
|
|
</nut-form-item> |
|
|
|
<view class="suggestions" style="background-color: #EEE" v-show="state.isNickNameSuggestionsShow"> |
|
|
|
<view @tap="updateNickName('先生')">{{BjxHelper.getBJXFirstChar(contact.contact.name)}}先生</view> |
|
|
|
<view @tap="updateNickName('女士')">{{BjxHelper.getBJXFirstChar(contact.contact.name)}}女士</view> |
|
|
|
<view @tap="updateNickName('小姐')">{{BjxHelper.getBJXFirstChar(contact.contact.name)}}小姐</view> |
|
|
|
<view @tap="updateNickName(null)"> |
|
|
|
<View class="d-flex"> |
|
|
|
<View class="flex-grow-1"> |
|
|
|
<Text className="fas fa-info-circle text-info"/> 您可以从列表中选择或直接填写 |
|
|
|
</View> |
|
|
|
<View class="text-primary pr-3">关闭</View> |
|
|
|
</View> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- <view class="suggestions" style="background-color: #EEE" v-show="state.isNickNameSuggestionsShow">--> |
|
|
|
<!-- <view @tap="updateNickName('先生')">{{BjxHelper.getBJXFirstChar(contact.contact.name)}}先生</view>--> |
|
|
|
<!-- <view @tap="updateNickName('女士')">{{BjxHelper.getBJXFirstChar(contact.contact.name)}}女士</view>--> |
|
|
|
<!-- <view @tap="updateNickName('小姐')">{{BjxHelper.getBJXFirstChar(contact.contact.name)}}小姐</view>--> |
|
|
|
<!-- <view @tap="updateNickName(null)">--> |
|
|
|
<!-- <View class="d-flex">--> |
|
|
|
<!-- <View class="flex-grow-1">--> |
|
|
|
<!-- <Text className="fas fa-info-circle text-info"/> 您可以从列表中选择或直接填写--> |
|
|
|
<!-- </View>--> |
|
|
|
<!-- <View class="text-primary pr-3">关闭</View>--> |
|
|
|
<!-- </View>--> |
|
|
|
<!-- </view>--> |
|
|
|
<!-- </view>--> |
|
|
|
|
|
|
|
<nut-form-item label="电话"> |
|
|
|
<nut-input v-model="contact.contact.phone" class="nut-input-text" /> |
|
|
|
@@ -138,4 +139,12 @@ const updateNickName = (value) => { |
|
|
|
> |
|
|
|
</nut-calendar> |
|
|
|
|
|
|
|
<nut-action-sheet v-model:visible="onShowSuggestionsMenu" title="此联系人到访时将会发出警告通知。" |
|
|
|
:menu-items="[ |
|
|
|
{name: BjxHelper.getBJXFirstChar(contact.contact.name) + '先生'}, |
|
|
|
{name: BjxHelper.getBJXFirstChar(contact.contact.name) + '女士'}, |
|
|
|
{name: BjxHelper.getBJXFirstChar(contact.contact.name) + '小姐'}, |
|
|
|
]" cancel-txt="取消" @choose="onNickNameSelected"> |
|
|
|
</nut-action-sheet> |
|
|
|
|
|
|
|
</template> |