taskTips.vue 1.3 KB

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