detail.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view class="container">
  3. <view class="main">
  4. <fs-cell-group justify="right" border full>
  5. <fs-cell title="姓名" :value="detail.name"></fs-cell>
  6. <fs-cell title="电话" :value="detail.phone"></fs-cell>
  7. <fs-cell title="职位" :value="detail.position"></fs-cell>
  8. <!-- <fs-cell title="照片">
  9. <fs-avatar slot="value" :src="detail.icon && config.imgBaseUrl + detail.icon || config.defaultStaffLogo"></fs-avatar>
  10. </fs-cell> -->
  11. <fs-cell title="入职日期" :value="detail.enterDate"></fs-cell>
  12. </fs-cell-group>
  13. </view>
  14. <fs-grid class="text-center" style="padding-bottom: 60rpx;" bgColor="transparent">
  15. <fs-grid-item @click="handleCall">
  16. <fs-avatar>
  17. <fs-icon type="icon-call" size="20px"></fs-icon>
  18. </fs-avatar>
  19. <view class="content fs12">拨打电话</view>
  20. </fs-grid-item>
  21. <fs-grid-item @click="handleSave">
  22. <fs-avatar colorType="success">
  23. <fs-icon type="icon-tongxunlu" size="20px"></fs-icon>
  24. </fs-avatar>
  25. <view class="content fs12">保存到通讯录</view>
  26. </fs-grid-item>
  27. <fs-grid-item @click="handleDelete">
  28. <fs-avatar colorType="error">
  29. <fs-icon type="icon-user-minus" size="20px"></fs-icon>
  30. </fs-avatar>
  31. <view class="content fs12">移除联系人</view>
  32. </fs-grid-item>
  33. </fs-grid>
  34. </view>
  35. </template>
  36. <script setup>
  37. const detail = getApp().globalData.addrbookDetail
  38. const handleCall = () => {
  39. uni.makePhoneCall({
  40. phoneNumber: detail.phone
  41. })
  42. }
  43. const handleSave = () => {
  44. uni.addPhoneContact({
  45. firstName: detail.name,
  46. mobilePhoneNumber: detail.phone
  47. })
  48. }
  49. const handleDelete = () => {
  50. uni.showModal({
  51. title: '您确定移除该联系人吗?'
  52. }).then(res => {
  53. if (res.confirm) {
  54. uni.showToast({
  55. title: '移除成功'
  56. })
  57. setTimeout(() => {
  58. uni.navigateBack()
  59. }, 1500)
  60. }
  61. })
  62. }
  63. </script>
  64. <style lang="scss">
  65. page{
  66. height: 100%;
  67. }
  68. </style>