right-1.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <div id="right-1">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="right_one">
  6. <p class="right_one_name">{{ customer.name }}</p>
  7. <p class="right_one_address">
  8. {{ address.name }},{{ address.phone }},{{ address.province }},{{ address.city }},{{ address.area }},{{ address.address }}
  9. </p>
  10. </el-col>
  11. <el-col :span="24" class="right_two">
  12. <el-col :span="24" v-for="item in list" :key="item._id">
  13. <el-col :span="24" class="right_time">{{ item.time }}</el-col>
  14. <el-col :span="24" class="right_left" v-if="item.speaker._id != user._id">
  15. <el-col :span="24">
  16. <el-col :span="2" class="right_image">
  17. <el-image :src="item.speaker.icon[0].url" class="right_icon"> </el-image>
  18. </el-col>
  19. <el-col :span="20" class="right_left_cont">
  20. <p class="test">{{ item.content }}</p>
  21. </el-col>
  22. </el-col>
  23. </el-col>
  24. <el-col :span="24" class="right_right" v-else-if="item.speaker._id == user._id">
  25. <el-col :span="24">
  26. <el-col :span="20" class="right_right_cont">
  27. <p class="test">{{ item.content }}</p>
  28. </el-col>
  29. <el-col :span="2" class="right_image">
  30. <el-image :src="item.speaker.icon[0].url" class="right_icon"> </el-image>
  31. </el-col>
  32. </el-col>
  33. </el-col>
  34. </el-col>
  35. </el-col>
  36. <el-col :span="24" class="right_thr">
  37. <el-col :span="20" class="right_thr_1">
  38. <!-- <el-input v-model="message" :autosize="{ minRows: 5, maxRows: 7 }" maxlength="-1" placeholder="消息" type="textarea" size="small"></el-input> -->
  39. <el-form ref="form" :model="form" label-width="80px">
  40. <el-input v-model="form.message" :autosize="{ minRows: 5, maxRows: 7 }" maxlength="-1" placeholder="消息" type="textarea" size="small"></el-input>
  41. </el-form>
  42. </el-col>
  43. <el-col :span="4" class="right_thr_2">
  44. <el-col :span="12" class="btn"><el-button type="success" size="mini" @click="onSubmit('content')">发送</el-button></el-col>
  45. <el-col :span="12" class="icon">
  46. <i class="el-icon-circle-plus-outline" style="color: #666; font-size: 50px" @click="toUp()"></i>
  47. </el-col>
  48. </el-col>
  49. </el-col>
  50. </el-col>
  51. </el-row>
  52. </div>
  53. </template>
  54. <script>
  55. import { mapState, createNamespacedHelpers } from 'vuex';
  56. export default {
  57. name: 'right-1',
  58. props: {
  59. list: { type: Array },
  60. address: { type: Object },
  61. customer: { type: Object },
  62. form: { type: Object },
  63. },
  64. components: {},
  65. data: function () {
  66. return {};
  67. },
  68. created() {},
  69. methods: {
  70. toUp() {
  71. this.$emit('toUp');
  72. },
  73. onSubmit(data) {
  74. this.$emit('onSubmit', data);
  75. },
  76. },
  77. computed: {
  78. ...mapState(['user']),
  79. },
  80. metaInfo() {
  81. return { title: this.$route.meta.title };
  82. },
  83. watch: {
  84. test: {
  85. deep: true,
  86. immediate: true,
  87. handler(val) {},
  88. },
  89. },
  90. };
  91. </script>
  92. <style lang="less" scoped>
  93. .right_one {
  94. text-align: center;
  95. line-height: 30px;
  96. padding: 5px;
  97. .right_one_name {
  98. font-size: 22px;
  99. }
  100. .right_one_address {
  101. overflow: hidden;
  102. text-overflow: ellipsis;
  103. display: -webkit-box;
  104. -webkit-line-clamp: 1;
  105. -webkit-box-orient: vertical;
  106. color: #666;
  107. }
  108. }
  109. .right_two {
  110. background: rgb(246, 246, 246);
  111. height: 62vh;
  112. overflow-y: auto;
  113. .right_icon {
  114. border-radius: 10px;
  115. width: 50px;
  116. height: 50px;
  117. }
  118. .right_time {
  119. text-align: center;
  120. padding: 10px 0;
  121. color: #666;
  122. }
  123. .right_left {
  124. text-align: left;
  125. padding: 0 30px;
  126. .right_image {
  127. padding: 10px 15px;
  128. }
  129. .right_left_cont {
  130. padding: 10px 10px;
  131. .test {
  132. border-radius: 8px;
  133. border: 1px #ccc solid;
  134. background: rgb(235, 249, 162);
  135. padding: 10px;
  136. }
  137. }
  138. }
  139. .right_right {
  140. text-align: right;
  141. padding: 0 30px;
  142. .right_image {
  143. padding: 10px 15px;
  144. }
  145. .right_time {
  146. padding: 10px 0;
  147. }
  148. .right_right_cont {
  149. margin: 0 0 0 8.3%;
  150. padding: 10px 10px;
  151. text-align: left;
  152. .test {
  153. border-radius: 8px;
  154. border: 1px #ccc solid;
  155. background: rgb(174, 254, 149);
  156. padding: 10px;
  157. }
  158. }
  159. }
  160. }
  161. .right_thr {
  162. position: relative;
  163. bottom: 0;
  164. padding: 3px 5px;
  165. .right_thr_2 {
  166. padding: 20px;
  167. .btn {
  168. margin: 20px 0 0 0;
  169. }
  170. }
  171. }
  172. </style>