|
- <script setup>
- import { Router } from 'tarojs-router-next'
- import './index.scss'
- import {useContactItemStore} from "../../stores/contact-item";
- import { useContactsStore } from "../../stores/contacts";
- import Taro from "@tarojs/taro";
-
-
- const contactData = Router.getData()
- const contact = useContactItemStore()
- const contacts = useContactsStore()
- contact.setContact(contactData)
-
- const goBack = () => {
- Router.back()
- }
- const onSaveClicked = () => {
- Taro.showLoading({
- title: 'loading',
- })
-
- console.log("onSaveClicked")
- console.log(contact.contact)
- contact.updateVisitor().then(r => {
- contacts.loadContactsFromServer().then( contactsResult => {
- Taro.hideLoading()
- Router.back()
- })
- }).catch(error => {
- Taro.hideLoading()
- Taro.showToast({
- title: '网络异常,请稍候重试',
- icon: 'none',
- duration: 2000
- })
- console.log("error", error)
- })
- }
- </script>
-
- <template>
-
-
- <view class="h-100 d-flex flex-column">
- <BackgroundBasic/>
- <NutNavbar title=""></NutNavbar>
- <view class="p-3 d-flex">
- <view class="flex-grow-1">
- <view class="h3">
- <Text className="fas fa-chevron-left text-primary" @tap="goBack()"/>
- 更新联系人
- </view>
- <view class="text-black-50">更新来访联系人信息,并设置下次到访时间</view>
- </view>
- <view class="d-flex align-items-end">
- <view class="text-primary save-button" @tap="onSaveClicked">保存</view>
- </view>
- </view>
-
-
- <view class="scroll">
- <ContactForm :data="contactData"/>
-
- <nut-cell title="来访记录">
- <template #desc>
- <Text className="fas fa-chevron-right"/>
- </template>
- </nut-cell>
-
- <nut-cell title="编辑记录" sub-title="本联系人在公司中的所有信息修改记录">
- <template #desc>
- <Text className="fas fa-chevron-right"/>
- </template>
- </nut-cell>
-
- <view class="p-3">
- <nut-button block color="red" plain>加入黑名单</nut-button>
- </view>
-
- <view class="p-3 pb-5">
- <nut-button block color="red">删除联系人</nut-button>
- </view>
- </view>
- </view>
-
-
-
-
-
-
- </template>
|