taskTips.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div class="tips">
  3. <span class="examples" v-if="examplePhoto" @click="openExamplesImg(examplePhoto)">示例</span>
  4. <span class="phone">
  5. <van-icon name="phone" size="18px" /><a :href="'tel:' + contactPhone" class="call">{{
  6. contactPhone
  7. }}</a>
  8. </span>
  9. </div>
  10. </template>
  11. <script>
  12. import { ImagePreview } from 'vant';
  13. export default {
  14. props: {
  15. contactPhone: {
  16. type: [String, Number],
  17. default: '',
  18. },
  19. examplePhoto: {
  20. type: [String, Number],
  21. default: '',
  22. },
  23. },
  24. data() {
  25. return {};
  26. },
  27. methods: {
  28. // 点击查看示例图片
  29. openExamplesImg(examplePhoto) {
  30. if (!examplePhoto) return;
  31. ImagePreview([examplePhoto]);
  32. // this.examplePhotoImg = examplePhoto;
  33. },
  34. },
  35. };
  36. </script>
  37. <style lang="scss" scoped>
  38. .tips {
  39. // position: absolute;
  40. // right: 0;
  41. // top: 11px;
  42. display: inline;
  43. height: 25px;
  44. line-height: 25px;
  45. .examples {
  46. margin: 0 10px;
  47. background: rgb(255, 151, 106);
  48. color: #fff;
  49. padding: 3px 5px;
  50. border-radius: 2px 2px 8px 2px;
  51. }
  52. .phone {
  53. display: inline-block;
  54. i {
  55. vertical-align: -2px;
  56. }
  57. a {
  58. color: #0057ba;
  59. text-decoration: underline;
  60. }
  61. }
  62. }
  63. </style>