card.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="customer-card">
  3. <view class="card-title" @click="toEdit(data.id)">
  4. <view class="customer">
  5. {{data.name}}
  6. <view class="tag">{{data.types[0] == '102'?'销售':(data.types[0] == '104'?'采购':'其他')}}</view>
  7. </view>
  8. <u-icon name="edit-pen" color="#666" size="20"/>
  9. </view>
  10. <view class="link-phone">
  11. <view class="phone">联系人:{{data.companyContact}}</view>
  12. <view class="phone">手机:{{data.companyContactPhone}}</view>
  13. </view>
  14. <view class="link-phone">
  15. <view class="phone">地址:{{data.address}}</view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. props:{
  22. data:{
  23. type:Object,
  24. default:{},
  25. },
  26. path:{
  27. type:String,
  28. default:'customer'
  29. }
  30. },
  31. methods:{
  32. toEdit(id){
  33. uni.navigateTo({ url: `/subpages/${this.path}/add-edit?id=${id}`})
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="less" scoped>
  39. .customer-card{
  40. padding: 32rpx;
  41. // margin-bottom: 32rpx;
  42. border-bottom: 1px solid #eee;
  43. background-color: #fff;
  44. display: flex;
  45. flex-direction: column;
  46. .card-title{
  47. display: flex;
  48. align-items: center;
  49. justify-content: space-between;
  50. line-height: 44rpx;
  51. margin-bottom: 10rpx;
  52. .customer{
  53. display: flex;
  54. font-weight: 600;
  55. .tag{
  56. margin-left: 20rpx;
  57. padding:0 10rpx;
  58. line-height: 40rpx;
  59. font-size: 24rpx;
  60. color: #fff;
  61. background-color: #4680F9;
  62. border-radius: 6rpx;
  63. font-weight: normal;
  64. }
  65. }
  66. }
  67. .link-phone{
  68. display: flex;
  69. line-height: 72rpx;
  70. font-size: 24rpx;
  71. color: #aaa;
  72. .phone{
  73. flex: 1;
  74. }
  75. }
  76. }
  77. </style>