dayOnlineItem.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view
  3. class="dayOnlineItem"
  4. @click.stop="$emit('click')"
  5. @longpress.stop="logLongpress"
  6. >
  7. <view class="info">
  8. <text class="text-xs">{{ item.date }}</text>
  9. <text class="text-xs margin-left">{{ item.timeCount }}</text>
  10. </view>
  11. <view class="arrow">
  12. <image
  13. class="icon"
  14. src="@/devTools/page/static/fold.png"
  15. />
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. props: {
  22. /**
  23. * logs单行数据
  24. */
  25. item: {
  26. type: Object,
  27. default() {
  28. return {
  29. date: "", //日期
  30. timeCount: "", //活跃时间
  31. page: [], //页面详细数据
  32. };
  33. },
  34. },
  35. },
  36. methods: {
  37. /**
  38. * 长按事件
  39. */
  40. logLongpress() {
  41. let that = this;
  42. let menu = [
  43. {
  44. text: `复制日志信息`,
  45. click() {
  46. uni.setClipboardData({
  47. data: JSON.stringify(that.item),
  48. });
  49. },
  50. },
  51. ];
  52. uni.showActionSheet({
  53. itemList: menu.map((x) => x.text),
  54. success({ tapIndex }) {
  55. menu[tapIndex].click();
  56. },
  57. });
  58. },
  59. },
  60. };
  61. </script>
  62. <style lang="scss" scoped>
  63. .dayOnlineItem:active {
  64. background-color: rgba(0, 0, 0, 0.03);
  65. }
  66. .dayOnlineItem {
  67. display: flex;
  68. flex-direction: row;
  69. align-items: flex-start;
  70. justify-content: space-between;
  71. width: 750rpx;
  72. padding: 10rpx 20rpx;
  73. border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  74. .info {
  75. width: 610rpx;
  76. display: flex;
  77. flex-direction: row;
  78. align-items: center;
  79. .text-xs {
  80. font-size: 20rpx;
  81. }
  82. .margin-left {
  83. margin-left: 30rpx;
  84. }
  85. }
  86. .arrow {
  87. .icon {
  88. width: 20rpx;
  89. height: 20rpx;
  90. transform: rotate(90deg);
  91. }
  92. }
  93. }
  94. </style>