messageCenter.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <!-- 消息中心 -->
  3. <el-drawer
  4. :close-on-press-escape="true"
  5. style="margin-top: 50px"
  6. :visible.sync="drawer"
  7. :modal="false"
  8. :show-close="false"
  9. size="90%">
  10. <div>
  11. <el-col :span="6" class="left-list">
  12. <div class="tabs">
  13. <el-badge :value="12" class="item">
  14. <a :class="switchMessageType=='unread'?'active':''" @click="switchMessage('unread')">未读信息</a>
  15. </el-badge>
  16. <el-badge class="item">
  17. <a :class="switchMessageType=='read'?'active':''" @click="switchMessage('read')">已读信息</a>
  18. </el-badge>
  19. </div>
  20. <ul class="message-list" v-if="switchMessageType == 'unread'">
  21. <li class="list-item">
  22. <p class="item-info">
  23. <span class="name">GFF_D345</span>
  24. <span class="time">11:30:54</span>
  25. </p>
  26. <p>我是未读信息123213213</p>
  27. </li>
  28. </ul>
  29. <ul class="message-list" v-if="switchMessageType == 'read'">
  30. <li class="list-item">
  31. <p class="item-info">
  32. <span class="name">GFF_D345</span>
  33. <span class="time">11:30:54</span>
  34. </p>
  35. <p>客服满意度调查</p>
  36. </li>
  37. <li class="list-item">
  38. <p class="item-info">
  39. <span class="name">GFF_D345</span>
  40. <span class="time">11:30:54</span>
  41. </p>
  42. <p>客服满意度调查</p>
  43. </li>
  44. </ul>
  45. </el-col>
  46. <el-col :span="18">
  47. <el-row class="title">
  48. <strong>客服满意度调查!</strong>
  49. <i @click="handleClose" class="el-icon-close"></i>
  50. </el-row>
  51. <el-row class="messageBox">
  52. <ul>
  53. <li><p>发件人:管理员</p></li>
  54. <li><p>收件人:客服小王</p></li>
  55. <li><p>时 间:2019年7月2日(星期二) 上午9:53</p></li>
  56. </ul>
  57. <div class="message-content">
  58. 如果您在一份订单里订购了多种商品并且销售方只给您发出了部分商品时,您与销售方之间仅就实际直接向您发出的商品建立了合同关系;只有在销售方实际直接向
  59. 您发出了订单中订购的其他商品时,您和销售方之间就订单中该其他已实际直接向您发出的商品建立了合同关系。
  60. </div>
  61. </el-row>
  62. </el-col>
  63. </div>
  64. </el-drawer>
  65. </template>
  66. <script>
  67. export default {
  68. name: "messageCenter",
  69. data() {
  70. return {
  71. drawer: false,
  72. switchMessageType: "unread",
  73. }
  74. },
  75. computed: {
  76. get_drawer() {
  77. return this.$store.getters.get_drawer;
  78. },
  79. },
  80. watch: {
  81. get_drawer(data) {
  82. console.log(data)
  83. this.drawer = data;
  84. },
  85. },
  86. methods: {
  87. handleClose() {
  88. this.$store.dispatch("SET_DRAWER", false);
  89. },
  90. switchMessage(num) {
  91. this.switchMessageType = num;
  92. },
  93. },
  94. }
  95. </script>
  96. <style lang="less" scoped>
  97. .left-list {
  98. border-right: 1px solid #D5E5FF;
  99. height: 100vh;
  100. }
  101. .tabs {
  102. display: flex;
  103. justify-content: space-around;
  104. height: 48px;
  105. line-height: 48px;
  106. border-bottom: 1px solid #D5E5FF;
  107. a {
  108. font-size: 14px;
  109. cursor: pointer;
  110. }
  111. a.active {
  112. color: #5399F5;
  113. border-bottom: 2px solid #5399F5;
  114. }
  115. }
  116. .message-list {
  117. margin: 0;
  118. /* 奇数背景色 */
  119. .list-item:nth-of-type(odd) {
  120. background: #F6F8FF;
  121. }
  122. /* 偶数背景色 */
  123. .list-item:nth-of-type(even) {
  124. background: #fff;
  125. }
  126. .list-item {
  127. padding: 10px 20px;
  128. p {
  129. color: #666;
  130. font-size: 14px;
  131. overflow: hidden;
  132. text-overflow:ellipsis;
  133. white-space: nowrap;
  134. }
  135. }
  136. .item-info {
  137. margin-bottom: 10px;
  138. display: flex;
  139. justify-content: space-between;
  140. span {
  141. font-size: 14px;
  142. color: #666;
  143. }
  144. span.time {
  145. color: #999;
  146. }
  147. }
  148. }
  149. .title {
  150. padding: 0 10px;
  151. height: 48px;
  152. line-height: 48px;
  153. border-bottom: 1px solid #D5E5FF;
  154. i {
  155. margin-top: 15px;
  156. font-size: 18px;
  157. cursor: pointer;
  158. float: right;
  159. }
  160. }
  161. .messageBox {
  162. padding: 15px 20px;
  163. li {
  164. margin: 10px 0;
  165. p {
  166. font-size: 14px;
  167. color: #999999;
  168. }
  169. }
  170. .message-content {
  171. margin-top: 20px;
  172. background: #F5F5F5;
  173. border: 1px solid #EEEEEE;
  174. padding: 20px;
  175. font-size: 14px;
  176. color: #666;
  177. line-height: 1.8;
  178. }
  179. }
  180. </style>
  181. <style>
  182. .left-list .el-badge__content.is-fixed {
  183. position: absolute;
  184. top: 12px !important;
  185. right: 10px !important;
  186. }
  187. .el-drawer__container {
  188. outline: none !important;
  189. }
  190. .el-drawer__header {
  191. padding: 0 !important;
  192. height: 10px !important;
  193. margin-bottom: 0 !important;
  194. }
  195. </style>