index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div class="mianBox">
  3. <van-row class="headerBox">
  4. <van-icon name="arrow-left" @click="$router.go(-1)" />
  5. {{title}}
  6. </van-row>
  7. <!-- 消息页 -->
  8. <van-row class="msgWrap" >
  9. <van-loading size="24px" v-if="loading" vertical style="margin-top:40px">加载中...</van-loading>
  10. <van-row class="msg" v-for="(item, index) in fkMsg" :key="index">
  11. <van-row class="top" style="color:#ccc">
  12. {{item.updateTime}}
  13. </van-row>
  14. <van-row class="bottom">
  15. <van-row class="left">
  16. <van-image :src="require('../../assets/image/function/icon6.png')" />
  17. </van-row>
  18. <van-row class="right" >
  19. <van-row class="top">{{item.createBy}} 提出申请</van-row>
  20. <van-row class="middle">到访事由:{{item.forVisiting}}</van-row>
  21. <van-row class="bottom" @click="fkId(item)">查看详情</van-row>
  22. </van-row>
  23. </van-row>
  24. </van-row>
  25. </van-row>
  26. </div>
  27. </template>
  28. <script>
  29. import Cookies from "js-cookie";
  30. export default {
  31. data() {
  32. return {
  33. title:"消息详情",
  34. fkMsg:[],
  35. nonce:undefined,
  36. timestamp:undefined,
  37. loading:true,
  38. };
  39. },
  40. created(){
  41. if(Cookies.get("nonce57")){
  42. this.nonce = Cookies.get("nonce57")
  43. }
  44. if(Cookies.get("timestamp57")){
  45. this.timestamp = Cookies.get("timestamp57")
  46. }
  47. if(!Cookies.get("openid57") || !Cookies.get("username57") || !Cookies.get("password57")){
  48. this.$router.push({ path: "/"})
  49. }
  50. this.fk()
  51. },
  52. mounted() {
  53. document.title = '中国东信智慧园区'
  54. },
  55. methods: {
  56. fk(){//访客列表查询
  57. axios.post(`${process.env.VUE_APP_CARD_BASE_API}api/thirdparty/v1/openInterface/queryDmVisitorsApply?page=0&size=100`,{timestamp:Cookies.get("timestamp57"),nonce:Cookies.get("nonce57"),query:{
  58. userNumber:Cookies.get("userId57"),applyStatus:0,}},
  59. {
  60. headers: {
  61. 'Content-Type': "application/json",
  62. "XYTACCESSTOKEN":Cookies.get("token57")
  63. }
  64. }).then(res => {
  65. let data = res.data.data.content
  66. this.fkMsg = data
  67. this.loading = false
  68. })
  69. },
  70. //访客信息已读消除及页面跳转
  71. fkId(item){
  72. axios.post(`${process.env.VUE_APP_CARD_BASE_API}api/thirdparty/v1/openInterface/editDmVisitorsApplyStatus`,
  73. {
  74. "timestamp":Cookies.get("timestamp57"),
  75. "nonce":Cookies.get("nonce57"),
  76. "query": {
  77. "ids":[item.id],
  78. "applyStatus": 1
  79. },
  80. },
  81. { headers: {
  82. 'Content-Type': "application/json",
  83. "XYTACCESSTOKEN":Cookies.get("token57")
  84. }
  85. }).then(res => {
  86. window.location.href = `${process.env.VUE_APP_BASE_API}h5/#/myVisitor?id=${item.id}`
  87. }).catch(err =>{
  88. })
  89. },
  90. }
  91. };
  92. </script>
  93. <style lang="scss" scoped>
  94. .mianBox{
  95. height: 100%;
  96. width: 100%;
  97. color: #F4F5F7;
  98. padding-top: 44px;
  99. box-sizing: border-box;
  100. background-color: rgba(244,245,247,0.8);
  101. .msgWrap{
  102. width:92%;
  103. margin:0 auto;
  104. height:calc(100% - 44px);
  105. overflow-y:scroll;
  106. .msg{
  107. padding:15px 0;
  108. text-align: center;
  109. .top{
  110. color:#454545;
  111. text-align: center;
  112. margin:0px auto 10px;
  113. }
  114. .bottom{
  115. .left{
  116. width:auto;
  117. display: inline-block;
  118. text-align: left;
  119. float:left;
  120. img{
  121. width:25px;
  122. }
  123. }
  124. .right{
  125. display: inline-block;
  126. margin-left:0%;
  127. width:80%;
  128. box-sizing: border-box;
  129. background-color: #fff;
  130. border-radius: 8px;
  131. }
  132. }
  133. .left{
  134. width:15%;
  135. position: relative;
  136. text-align: middle;
  137. display: inline-block;
  138. .van-image{
  139. width:45px !important;
  140. }
  141. .badge{
  142. position: absolute;
  143. top:-10px;
  144. right:-10px;
  145. }
  146. }
  147. .center{
  148. width:55%;
  149. text-align: left;
  150. display: inline-block;
  151. color:#454545;
  152. overflow: hidden;
  153. margin-left:5%;
  154. .title{
  155. font-size: 15px;
  156. overflow: hidden;
  157. text-overflow: ellipsis;
  158. display: -webkit-box;
  159. -webkit-line-clamp: 1;
  160. -webkit-box-orient: vertical;
  161. }
  162. .p{
  163. margin-top:10px;
  164. font-size: 13px;
  165. color:#7C7C7C;
  166. overflow: hidden;
  167. text-overflow: ellipsis;
  168. display: -webkit-box;
  169. -webkit-line-clamp: 1;
  170. -webkit-box-orient: vertical;
  171. }
  172. }
  173. .right{
  174. width:25%;
  175. display: inline-block;
  176. color:#A8A8A8;
  177. text-align: left;
  178. line-height: 20px;
  179. vertical-align: top;
  180. padding:4px 8px;
  181. .top,.middle{
  182. text-align: left;
  183. font-size: 14px;
  184. }
  185. .top{margin-top:5px;}
  186. .middle{margin:-5px 0 10px;}
  187. .bottom{
  188. text-align: center;
  189. font-size: 14px;
  190. padding:4px 0 2px;
  191. border-top:1px solid #ccc;
  192. color:#EA2F3D;
  193. }
  194. }
  195. }
  196. }
  197. }
  198. </style>