微信小程序,访客邀约
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

92 line
2.2 KiB

  1. <script setup>
  2. import { Router } from 'tarojs-router-next'
  3. import './index.scss'
  4. import {useContactItemStore} from "../../stores/contact-item";
  5. import { useContactsStore } from "../../stores/contacts";
  6. import Taro from "@tarojs/taro";
  7. const contactData = Router.getData()
  8. const contact = useContactItemStore()
  9. const contacts = useContactsStore()
  10. contact.setContact(contactData)
  11. const goBack = () => {
  12. Router.back()
  13. }
  14. const onSaveClicked = () => {
  15. Taro.showLoading({
  16. title: 'loading',
  17. })
  18. console.log("onSaveClicked")
  19. console.log(contact.contact)
  20. contact.updateVisitor().then(r => {
  21. contacts.loadContactsFromServer().then( contactsResult => {
  22. Taro.hideLoading()
  23. Router.back()
  24. })
  25. }).catch(error => {
  26. Taro.hideLoading()
  27. Taro.showToast({
  28. title: '网络异常,请稍候重试',
  29. icon: 'none',
  30. duration: 2000
  31. })
  32. console.log("error", error)
  33. })
  34. }
  35. </script>
  36. <template>
  37. <view class="h-100 d-flex flex-column">
  38. <BackgroundBasic/>
  39. <NutNavbar title=""></NutNavbar>
  40. <view class="p-3 d-flex">
  41. <view class="flex-grow-1">
  42. <view class="h3">
  43. <Text className="fas fa-chevron-left text-primary" @tap="goBack()"/>
  44. 更新联系人
  45. </view>
  46. <view class="text-black-50">更新来访联系人信息,并设置下次到访时间</view>
  47. </view>
  48. <view class="d-flex align-items-end">
  49. <view class="text-primary save-button" @tap="onSaveClicked">保存</view>
  50. </view>
  51. </view>
  52. <view class="scroll">
  53. <ContactForm :data="contactData"/>
  54. <nut-cell title="来访记录">
  55. <template #desc>
  56. <Text className="fas fa-chevron-right"/>
  57. </template>
  58. </nut-cell>
  59. <nut-cell title="编辑记录" sub-title="本联系人在公司中的所有信息修改记录">
  60. <template #desc>
  61. <Text className="fas fa-chevron-right"/>
  62. </template>
  63. </nut-cell>
  64. <view class="p-3">
  65. <nut-button block color="red" plain>加入黑名单</nut-button>
  66. </view>
  67. <view class="p-3 pb-5">
  68. <nut-button block color="red">删除联系人</nut-button>
  69. </view>
  70. </view>
  71. </view>
  72. </template>