leader-mailbox-list.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <div>
  3. <div class="leader-h1" v-if="show">
  4. <h1 class="h1">领导信箱</h1>
  5. <!-- 点击事件返回上一页面 -->
  6. <div class="leader-h1-img" @click="back">
  7. <img src="@/views/XiXianZhongXin/assets/返回.png" alt="" />
  8. </div>
  9. </div>
  10. <!-- 循环渲染姓名和留言内容 -->
  11. <div class="consult" v-for="item in value" :key="item.id">
  12. <van-cell-group class="consultAll">
  13. <van-field left-icon="manager-o" :value="item.name" readonly />
  14. <van-field
  15. rows="4"
  16. type="textarea"
  17. left-icon="records"
  18. :value="item.content"
  19. readonly
  20. />
  21. </van-cell-group>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. value: [],
  30. token:sessionStorage.getItem("mytoken")?sessionStorage.getItem("mytoken"):"",
  31. show:true,
  32. gettoken:""
  33. };
  34. },
  35. methods: {
  36. //返回上一页面
  37. back() {
  38. window.history.back();
  39. },
  40. //获取领导信箱的姓名和留言内容
  41. getleaderBox() {
  42. this.$http.post("/api/workbench/leader_mailbox/list").then((res) => {
  43. console.log(res);
  44. this.value=res.data.data
  45. console.log(this.value);
  46. });
  47. },
  48. },
  49. mounted() {
  50. this.gettoken=this.$route.query.token
  51. this.token=`Bearer ${this.gettoken}`
  52. this.show=this.$route.query.tabbar ? this.$route.query.tabbar : true
  53. sessionStorage.setItem("mytoken",this.token)
  54. this.getleaderBox();
  55. },
  56. };
  57. </script>
  58. <style>
  59. body {
  60. background: #3399ff;
  61. }
  62. .h1 {
  63. text-align: center;
  64. color: #fff;
  65. font-weight: 500;
  66. font-size: 20px;
  67. }
  68. .consult {
  69. width: 90%;
  70. margin: 3% auto;
  71. }
  72. .van-cell {
  73. border-radius: 10px;
  74. }
  75. .van-cell-group {
  76. border-radius: 10px;
  77. }
  78. .leader-h1{
  79. position: relative;
  80. }
  81. .leader-h1-img{
  82. position: absolute;
  83. left: 9%;
  84. top: 25%;
  85. }
  86. .leader-h1-img>img{
  87. width: 15px;
  88. height: 18px;
  89. }
  90. </style>