conversation.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <view class="main">
  3. <view class="padding-lr-sm">
  4. <u-search placeholder="请输入搜索用户姓名" v-if="qiehuan == true" action-text="通话记录" @custom="tonghua" :action-style="{width:'110rpx'}"
  5. v-model="keyword"></u-search>
  6. <u-search placeholder="请输入搜索用户姓名" v-if="qiehuan == false" action-text="聊天列表" @custom="tonghua" :action-style="{width:'110rpx'}"
  7. v-model="keyword"></u-search>
  8. </view>
  9. <!-- 这是聊天列表 当值为true时显示-->
  10. <view class="cu-list menu-avatar margin-top-xs" v-if="qiehuan == true">
  11. <view class="cu-item u-border-bottom" v-for="(item,index) in 5" :key="index" @click="goliaotian">
  12. <view class="cu-avatar radius lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/img/champion/Taric.png);">
  13. <view class="cu-tag badge">10</view>
  14. </view>
  15. <view class="content">
  16. <view class="text-grey">
  17. <text class="text-cut">用户昵称</text>
  18. <view class="cu-tag round bg-orange sm">备注</view>
  19. </view>
  20. <view class="text-gray text-sm flex">
  21. <text class="text-cut">信息发送者:最近一条消息</text>
  22. </view>
  23. </view>
  24. <view class="action">
  25. <view class="text-grey text-xs">22:20</view>
  26. </view>
  27. </view>
  28. </view>
  29. <!-- 这是通话记录 当值为false1时显示 -->
  30. <view class="cu-list menu-avatar margin-top-xs" v-if="qiehuan == false" @click="call">
  31. <view class="cu-item u-border-bottom" v-for="(item,index) in 5" :key="index" @click="call">
  32. <view class="cu-avatar radius lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/img/champion/Taric.png);border-radius: 50%;">
  33. <view class="cu-tag badge">10</view>
  34. </view>
  35. <view class="content">
  36. <view class="text-grey">
  37. <text class="text-cut">用户昵称</text>
  38. <view class="cu-tag round bg-orange sm">备注</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. components: {
  48. },
  49. onLoad() {
  50. },
  51. mounted() {
  52. },
  53. data() {
  54. return {
  55. //控制聊天列表和通话记录
  56. //false为通话记录,true为聊天列表
  57. qiehuan: true,
  58. keyword: ""
  59. }
  60. },
  61. methods: {
  62. tonghua() {
  63. console.log("点击了通话记录");
  64. if (this.qiehuan) {
  65. this.qiehuan = false
  66. } else {
  67. this.qiehuan = true
  68. }
  69. },
  70. goliaotian() {
  71. uni.navigateTo({
  72. url: "conversationWindow"
  73. })
  74. },
  75. call(){
  76. uni.navigateTo({
  77. url: "call"
  78. })
  79. }
  80. }
  81. };
  82. </script>
  83. <style scoped lang="scss">
  84. </style>