You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

order-info-item.vue 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <view class="as-layout-horizontal as-gravity-center-start" v-if="!hide">
  3. <text class="label">{{label}}</text>
  4. <text class="value" @click="copy(value,label)">{{value}}</text>
  5. <image :src="`${$imgUrl}order/copy-template.png`" mode="" v-if="label == '物流单号:'" @click="copy(value,label)">
  6. </image>
  7. </view>
  8. </template>
  9. <script setup lang="ts">
  10. import { msg } from "@/utils/utils";
  11. defineProps({
  12. label: {
  13. type: String,
  14. default: ''
  15. },
  16. value: {
  17. type: String,
  18. default: ''
  19. },
  20. hide: {
  21. type: Boolean,
  22. default: false
  23. }
  24. })
  25. const copy = (value, lable) => {
  26. console.log(value, lable)
  27. if (lable == "物流单号:") {
  28. uni.setClipboardData({
  29. data: value,
  30. success(res) {
  31. uni.getClipboardData({
  32. success(res) {
  33. console.log(res.data) // data
  34. }
  35. })
  36. }
  37. })
  38. }
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .label {
  43. font-size: 26rpx;
  44. color: #999999;
  45. min-width: 112rpx;
  46. }
  47. .value {
  48. font-size: 26rpx;
  49. color: #333333;
  50. padding: 0 30rpx
  51. }
  52. image {
  53. width: 36rpx;
  54. height: 36rpx;
  55. position: relative;
  56. left: -22rpx;
  57. top: -4rpx;
  58. }
  59. </style>