猫妈狗爸伴宠师小程序前端代码
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.

110 lines
2.1 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="card-item flex-colc" :style="{'background-image':`url(${data.bgUrl})`}">
  3. <!-- <view class="num">
  4. {{data.methodNum}}
  5. </view> -->
  6. <view class="size-30 fw700 mb30" :style="{'color':data.titleColour}">
  7. {{data.title}}
  8. </view>
  9. <view class="color-aea size-22">
  10. {{data.des}}
  11. </view>
  12. <view class="y-input flex-rowc" :style="{background:data.inputBg}" v-if="data.copy">
  13. <input class="codeInput" type="text" v-model="data.code" />
  14. <view class="copy flex-rowc size-30" @click="copyHandle(data)">
  15. 复制
  16. </view>
  17. </view>
  18. <view class="btn flex-rowc mt16 " @click="goToShare" v-else>
  19. 保存海报
  20. </view>
  21. </view>
  22. </template>
  23. <script setup>
  24. import tab from '../../../plugins/tab';
  25. const {
  26. data
  27. } = defineProps({
  28. data: {
  29. type: Object,
  30. default: () => {}
  31. }
  32. })
  33. const emit = defineEmits(['emitCopy', 'savePoster']);
  34. const copyHandle = (data) => {
  35. uni.setClipboardData({
  36. data: data.code,
  37. success: () => {
  38. uni.showToast({
  39. title: "复制成功"
  40. })
  41. },
  42. fail: () => {
  43. uni.showToast({
  44. title: "复制失败",
  45. icon: "none"
  46. })
  47. }
  48. })
  49. }
  50. const goToShare = () => {
  51. emit("savePoster")
  52. // tab.navigateTo("/otherPages/binding/share/index")
  53. }
  54. </script>
  55. <style scoped lang="scss">
  56. .card-item {
  57. width: 684rpx;
  58. padding: 106rpx 0 26rpx;
  59. position: relative;
  60. border-radius: 16rpx;
  61. // background-color: #eee;
  62. margin-bottom: 10rpx;
  63. background-repeat: no-repeat;
  64. background-size: 685rpx;
  65. .num {
  66. position: absolute;
  67. left: 0;
  68. top: 0;
  69. color: #FE8165;
  70. background-color: #FFC6B9;
  71. padding: 0 12rpx;
  72. border-radius: 16rpx 0 16rpx 0;
  73. }
  74. .y-input {
  75. width: 570rpx;
  76. height: 90rpx;
  77. background-color: #FDD6CE;
  78. margin-top: 24rpx;
  79. border-radius: 16rpx;
  80. .codeInput {
  81. white-space: nowrap;
  82. overflow: hidden;
  83. text-overflow: ellipsis;
  84. }
  85. .copy {
  86. width: 109rpx;
  87. height: 58rpx;
  88. border-radius: 58rpx;
  89. border: 2rpx solid #C4867A;
  90. color: #C4867A;
  91. }
  92. }
  93. .btn {
  94. width: 570rpx;
  95. height: 90rpx;
  96. border: 2rpx solid #587CA1;
  97. color: #587CA1;
  98. border-radius: 90rpx;
  99. }
  100. }
  101. </style>