card.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="safe-area-inset-bottom">
  3. <navigator :url="`/pages/enterprise/detail?id=${item.id}`" class="card" v-for="(item,index) in list" :key="index">
  4. <view class="item">
  5. <view class="left">
  6. <view class="tag" :class="item.tagColor">
  7. <text>{{item.enterpriseName.substr(0,1)}}</text>
  8. </view>
  9. <view class="content">
  10. <text class="text-cut-1">{{item.enterpriseName}}</text>
  11. <text class="text-cut-1">{{item.enterpriseTypeName}}</text>
  12. </view>
  13. </view>
  14. <view class="right">
  15. <image @click.stop="$util.callPhone(item.officeNum)" src="../../../static/index/call.png" mode=""></image>
  16. </view>
  17. </view>
  18. </navigator>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. list: Array
  25. },
  26. data() {
  27. return {
  28. callPhone(phone) {
  29. uni.showModal({
  30. title: '提示',
  31. content: `确定要拨打电话:${phone}吗?`,
  32. success: function(res) {
  33. if (res.confirm) {
  34. uni.makePhoneCall({
  35. phoneNumber: phone //仅为示例
  36. });
  37. }
  38. }
  39. });
  40. }
  41. }
  42. },
  43. methods: {
  44. }
  45. }
  46. </script>
  47. <style lang="scss">
  48. .card {
  49. position: relative;
  50. background-color: #FFFFFF;
  51. padding: 35rpx;
  52. margin: 20rpx;
  53. .item {
  54. display: flex;
  55. justify-content: space-between;
  56. }
  57. .left {
  58. display: flex;
  59. width: 88%;
  60. .tag {
  61. border-radius: 50%;
  62. display: flex;
  63. justify-content: center;
  64. align-items: center;
  65. height: 80rpx;
  66. width: 80rpx;
  67. font-size: 32rpx;
  68. }
  69. .content {
  70. padding-left: 30rpx;
  71. display: flex;
  72. flex-direction: column;
  73. text:first-child {
  74. font-size: 32rpx;
  75. }
  76. text:last-child {
  77. font-size: 28rpx;
  78. color: #9f9f9f;
  79. padding-top: 15rpx;
  80. }
  81. }
  82. }
  83. .right {
  84. display: flex;
  85. justify-content: center;
  86. align-items: center;
  87. image {
  88. width: 50rpx;
  89. height: 50rpx;
  90. }
  91. }
  92. }
  93. </style>