SearchActionRow.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view class="search_row">
  3. <text class="title">聊天内容</text>
  4. <view class="action_list">
  5. <view @click="clickAction(item)" class="action_item" v-for="item in searchActions" :key="item.idx">
  6. <image style="width: 46rpx; height: 46rpx" :src="item.icon" alt="" />
  7. <text>{{ item.title }}</text>
  8. </view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. name: '',
  15. components: {},
  16. props: {},
  17. data() {
  18. return {
  19. searchActions: [
  20. {
  21. idx: 0,
  22. title: '搜索',
  23. icon: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/single_setting_text.png'
  24. },
  25. {
  26. idx: 1,
  27. title: '图片',
  28. icon: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/single_setting_image.png'
  29. },
  30. {
  31. idx: 2,
  32. title: '视频',
  33. icon: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/single_setting_video.png'
  34. },
  35. {
  36. idx: 3,
  37. title: '文件',
  38. icon: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/single_setting_file.png'
  39. }
  40. ]
  41. };
  42. },
  43. methods: {
  44. clickAction({ idx }) {
  45. switch (idx) {
  46. case 0:
  47. uni.navigateTo({
  48. url: '/pages_im/pages/conversation/searchMessage/index'
  49. });
  50. break;
  51. case 1:
  52. case 2:
  53. uni.navigateTo({
  54. url: `/pages_im/pages/conversation/searchMediaMessage/index?isVideo=${idx === 2}`
  55. });
  56. break;
  57. case 3:
  58. uni.navigateTo({
  59. url: '/pages_im/pages/conversation/searchFileMessage/index'
  60. });
  61. break;
  62. default:
  63. return;
  64. }
  65. }
  66. }
  67. };
  68. </script>
  69. <style lang="scss" scoped>
  70. .search_row {
  71. @include colBox(false);
  72. padding: 16rpx 36rpx;
  73. margin: 12rpx 0;
  74. background-color: #fff;
  75. color: $uni-text-color;
  76. .title {
  77. font-size: 28rpx;
  78. color: $u-tips-color;
  79. }
  80. .action_list {
  81. display: flex;
  82. justify-content: space-between;
  83. margin-top: 26rpx;
  84. margin-bottom: 12rpx;
  85. .action_item {
  86. @include colBox(true);
  87. align-items: center;
  88. image {
  89. width: 46rpx;
  90. height: 46rpx;
  91. }
  92. text {
  93. font-size: 24rpx;
  94. color: #666;
  95. }
  96. }
  97. }
  98. }
  99. </style>