index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. <template>
  2. <div class="mianBox">
  3. <van-row class="headerBox">
  4. <!-- <van-icon name="arrow-left" @click="$router.go(-1)" /> -->
  5. <van-image :src="portrait" class="img" @click="information" />
  6. <div class="headerTitle">{{title}}</div>
  7. </van-row>
  8. <!-- 消息页 -->
  9. <van-row class="msgWrap" v-if="active == 0">
  10. <van-loading size="24px" v-if="loading" vertical style="margin-top:40px">加载中...</van-loading>
  11. <van-row class="msg" v-if="cz.status" @click="msgSaut('/record',1)">
  12. <van-row class="left">
  13. <van-image :src="require('../../assets/image/function/icon3.png')" />
  14. <van-badge :content="cz.num" max="99" class="badge" />
  15. </van-row>
  16. <van-row class="center">
  17. <van-row class="title">充值通知</van-row>
  18. <van-row class="p">{{cz.msg}}</van-row>
  19. </van-row>
  20. <van-row class="right">
  21. {{cz.updateTime}}
  22. </van-row>
  23. </van-row>
  24. <van-row class="msg" v-if="xf.status" @click="msgSaut('/record',2)">
  25. <van-row class="left">
  26. <van-image :src="require('../../assets/image/function/icon5.png')" />
  27. <van-badge :content="cz.num" max="99" class="badge" />
  28. </van-row>
  29. <van-row class="center">
  30. <van-row class="title">消费通知</van-row>
  31. <van-row class="p">{{cz.msg}}</van-row>
  32. </van-row>
  33. <van-row class="right">
  34. {{cz.updateTime}}
  35. </van-row>
  36. </van-row>
  37. <van-row class="msg" v-if="fk.status" @click="msgSaut('/fk')">
  38. <van-row class="left">
  39. <van-image :src="require('../../assets/image/function/icon6.png')" />
  40. <van-badge :content="fk.num" max="99" class="badge" />
  41. </van-row>
  42. <van-row class="center">
  43. <van-row class="title">访客申请{{fk.title}}</van-row>
  44. <van-row class="p">{{fk.msg}}</van-row>
  45. </van-row>
  46. <van-row class="right">
  47. {{fk.updateTime}}
  48. </van-row>
  49. </van-row>
  50. <van-row class="noMsg" v-if="noMsg">
  51. 暂无数据
  52. </van-row>
  53. </van-row>
  54. <!-- 功能页 -->
  55. <van-row class="functionWrap" v-if="active == 1">
  56. <van-row type="flex" justify="space-between" gutter="10" >
  57. <!-- <van-col span="6" class="function">
  58. <van-image :src="require('../../assets/image/function/icon1.png')" />
  59. <van-col >运营中心</van-col>
  60. </van-col> -->
  61. <van-col span="6" class="function" @click="sm('https://smartpark.caih.com/h5/#/licence',1)">
  62. <van-image :src="require('../../assets/image/function/icon2.png')" />
  63. <div class="title">停车管理</div>
  64. </van-col>
  65. <van-col span="6" class="function" @click="ykt">
  66. <van-image :src="require('../../assets/image/function/icon3.png')" />
  67. <div class="title">一卡通</div>
  68. </van-col>
  69. <!-- <van-col span="6" class="function" @click="sm('https://smartpark.caih.com/h5/#/Food')">
  70. <van-image :src="require('../../assets/image/function/icon5.png')" />
  71. <van-col >智慧餐饮</van-col>
  72. </van-col> -->
  73. <van-col span="6" class="function" @click="sm('https://smartpark.caih.com/h5/#/myVisitor',2)">
  74. <van-image :src="require('../../assets/image/function/icon6.png')" />
  75. <div class="title">访客申请</div>
  76. </van-col>
  77. <!-- <van-col span="6" class="function">
  78. <van-image :src="require('../../assets/image/function/icon4.png')" />
  79. <van-col >智能会议</van-col>
  80. </van-col> -->
  81. </van-row>
  82. <!-- <van-row type="flex" justify="space-between" gutter="10">
  83. <van-col span="6" class="function">
  84. <van-image :src="require('../../assets/image/function/icon6.png')" />
  85. <van-col>访客申请</van-col>
  86. </van-col>
  87. <van-col span="6" class="function">
  88. <van-image :src="require('../../assets/image/function/icon7.png')" />
  89. <van-col >文印助手</van-col>
  90. </van-col>
  91. <van-col span="6" class="function">
  92. <van-image :src="require('../../assets/image/function/icon8.png')" />
  93. <van-col >厕卫管理</van-col>
  94. </van-col>
  95. </van-row>
  96. <van-row type="flex" justify="space-between" gutter="10">
  97. <van-col span="6" class="function">
  98. <van-image :src="require('../../assets/image/function/icon9.png')" />
  99. <van-col >智能阅览室</van-col>
  100. </van-col>
  101. </van-row> -->
  102. </van-row>
  103. <van-tabbar v-model="active" class="foot" >
  104. <van-tabbar-item @click="tab">
  105. <van-image :src="require('../../assets/image/msg1.png')" class="img" v-show="active==1" />
  106. <van-image :src="require('../../assets/image/msg2.png')" class="img" v-show="active==0"/>
  107. <p>消息</p>
  108. </van-tabbar-item>
  109. <van-tabbar-item @click="tab">
  110. <van-image :src="require('../../assets/image/fun1.png')" class="img" v-show="active==0" />
  111. <van-image :src="require('../../assets/image/fun2.png')" class="img" v-show="active==1"/>
  112. <p>功能</p>
  113. </van-tabbar-item>
  114. </van-tabbar>
  115. <!-- <van-loading
  116. size="24px"
  117. v-if="loading"
  118. color="#fff"
  119. vertical
  120. style="z-index: 999999; position: fixed; top: 40%; left: 0; right: 0"
  121. >加载中...</van-loading
  122. >
  123. <van-overlay :show="loading" style="z-index: 100; position: fixed" /> -->
  124. </div>
  125. </template>
  126. <script>
  127. import Cookies from "js-cookie";
  128. import { encrypt, decrypt } from '../../utils/jsencrypt';
  129. import { getDateStrNowDay} from '@/assets/js/dataFormate.js'
  130. export default {
  131. data() {
  132. return {
  133. user:undefined,
  134. type:undefined,
  135. loading: false,
  136. active: 1,
  137. title:"功能",
  138. img:{
  139. msg:require('../../assets/image/msg1.png'),
  140. fun:require('../../assets/image/fun2.png'),
  141. },
  142. portrait:undefined,
  143. noMsg:false,
  144. fk:{//访客数据
  145. title:undefined,
  146. status:false,//状态
  147. msg:undefined,//简讯
  148. num:undefined,//未读数量
  149. updateTime:undefined//最新时间
  150. },
  151. cz:{//充值数据
  152. status:false,//状态
  153. msg:undefined,//简讯
  154. num:undefined,//未读数量
  155. updateTime:undefined//最新时间
  156. },
  157. xf:{//消费数据
  158. status:false,//状态
  159. msg:undefined,//简讯
  160. num:undefined,//未读数量
  161. updateTime:undefined//最新时间
  162. },
  163. xs1:false,
  164. xs2:false,
  165. xs3:false,
  166. loading:true,
  167. };
  168. },
  169. created(){
  170. this.portrait = Cookies.get("portrait57")
  171. if(!Cookies.get("openid57") || !Cookies.get("username57") || !Cookies.get("password57")){
  172. this.$router.push({ path: "/"})
  173. }
  174. },
  175. mounted() {
  176. document.title = '中国东信智慧园区'
  177. },
  178. methods: {
  179. tab(){//tab切换
  180. if(this.active == "0"){
  181. //充值未读查询
  182. axios.post(`/dxtop/charge/page`,{
  183. "size":100,
  184. "current":1,
  185. "messageFlag":0,
  186. "userId":Cookies.get("userId57")
  187. }).then(res1 => {
  188. let data = res1.data.data.records
  189. if (data.length > 0) {
  190. this.cz.msg = `充值到帐:${data[data.length-1].amt}元`
  191. this.cz.num = data.length
  192. let time = ((data[data.length-1].createTime).split(" "))
  193. if(getDateStrNowDay() != time[0]){
  194. this.cz.updateTime = data[data.length-1].createTime
  195. }else{
  196. this.cz.updateTime = time[1]
  197. }
  198. this.xs1 = true
  199. }else{
  200. this.xs1 = false
  201. }
  202. //消费未读查询
  203. axios.post(`/dxtop/dish/page`,{
  204. "size":100,
  205. "current":1,
  206. "messageFlag":0,
  207. "userId":Cookies.get("userId57")
  208. }).then(res2 => {
  209. let data = res2.data.data.records
  210. if (data.length > 0) {
  211. this.xf.msg = `${data[data.length-1].shopName}扣款${data[data.length-1].amt}元`
  212. this.xf.num = data.length
  213. let time = ((data[data.length-1].createTime).split(" "))
  214. if(getDateStrNowDay() != time[0]){
  215. this.xf.updateTime = data[data.length-1].createTime
  216. }else{
  217. this.xf.updateTime = time[1]
  218. }
  219. this.xs2 = true
  220. }else{
  221. this.xs2 = false
  222. }
  223. this.loading = false
  224. //访客查询
  225. axios.post(`https://smartpark.caih.com/ykt/api/thirdparty/v1/openInterface/queryDmVisitorsApply?page=0&size=100`,
  226. {
  227. timestamp:Cookies.get("timestamp57"),
  228. nonce:Cookies.get("nonce57"),
  229. query:{
  230. userNumber:Cookies.get("userId57"),
  231. applyStatus:0,
  232. }
  233. },
  234. {
  235. headers: {
  236. 'Content-Type': "application/json",
  237. "XYTACCESSTOKEN":Cookies.get("token57")
  238. }
  239. }
  240. ).then(res3 => {
  241. let data = res3.data.data.content
  242. if(data.length>0){
  243. this.fk.title = `(${data[data.length-1].createBy})`
  244. this.fk.msg = `到访事由:${data[data.length-1].forVisiting}`
  245. this.fk.num = data.length
  246. let time = ((data[data.length-1].updateTime).split(" "))
  247. if(getDateStrNowDay() != time[0]){
  248. this.fk.updateTime = data[data.length-1].updateTime
  249. }else{
  250. this.fk.updateTime = time[1]
  251. }
  252. this.xs3 = true
  253. }else{
  254. this.xs3 = false
  255. }
  256. if(this.xs1 == true){
  257. this.cz.status = true
  258. }
  259. if(this.xs2 == true){
  260. this.xf.status = true
  261. }
  262. if(this.xs3 == true){
  263. this.fk.status = true
  264. }
  265. if(!this.cz.status && !this.xf.status && !this.fk.status){
  266. this.noMsg = true
  267. }
  268. })
  269. })
  270. })
  271. }
  272. },
  273. msgSaut(url,id){//消息跳转
  274. this.$router.push({ path: url,query:{id:id}})
  275. },
  276. //我的信息
  277. information(){
  278. let parmas = encrypt(123)
  279. let url = window.location.host
  280. //window.location.href = `http://${url}/vuepay/html/company.html?params=${parmas}`
  281. this.$router.push({ path: "/information"})
  282. },
  283. //一卡通
  284. ykt(){
  285. this.$router.push({ path: `/amount?token=${localStorage.getItem('cipher57')}&classify`})
  286. },
  287. //世茂
  288. sm(url,id){
  289. if(id == "2"){
  290. window.location.href = `${url}?userId=${Cookies.get("userId57")}`
  291. }
  292. if(id == "1"){
  293. let param = {
  294. userid:encrypt(Cookies.get("username57")),
  295. password:Cookies.get("password57"),
  296. type:"wx_yt",
  297. id:""
  298. }
  299. window.location.href = `${url}?param=${encodeURIComponent(JSON.stringify(param))}`
  300. }
  301. },
  302. },
  303. };
  304. </script>
  305. <style lang="scss" scoped>
  306. .mianBox{
  307. height: 100%;
  308. width: 100%;
  309. color: #FFF;
  310. padding-top: 44px;
  311. box-sizing: border-box;
  312. background-color: #F7F7F7;
  313. .headerTitle{
  314. text-align: center;
  315. position: absolute;
  316. width:100px;
  317. left:50%;
  318. margin-left:-50px;
  319. }
  320. .msgWrap{
  321. width:96%;
  322. margin:0 auto;
  323. height:calc(100% - 44px);
  324. overflow-y:scroll;
  325. .msg{
  326. padding:15px 0;
  327. border-bottom:1px solid #ccc;
  328. text-align: center;
  329. .left{
  330. width:15%;
  331. position: relative;
  332. text-align: middle;
  333. display: inline-block;
  334. .van-image{
  335. width:45px !important;
  336. }
  337. .badge{
  338. position: absolute;
  339. top:-10px;
  340. right:-10px;
  341. }
  342. }
  343. .center{
  344. width:55%;
  345. text-align: left;
  346. display: inline-block;
  347. color:#454545;
  348. overflow: hidden;
  349. margin-left:5%;
  350. .title{
  351. font-size: 15px;
  352. overflow: hidden;
  353. text-overflow: ellipsis;
  354. display: -webkit-box;
  355. -webkit-line-clamp: 1;
  356. -webkit-box-orient: vertical;
  357. }
  358. .p{
  359. margin-top:10px;
  360. font-size: 13px;
  361. color:#7C7C7C;
  362. overflow: hidden;
  363. text-overflow: ellipsis;
  364. display: -webkit-box;
  365. -webkit-line-clamp: 1;
  366. -webkit-box-orient: vertical;
  367. }
  368. }
  369. .right{
  370. width:25%;
  371. display: inline-block;
  372. color:#A8A8A8;
  373. text-align: right;
  374. line-height: 16px;
  375. vertical-align: top;
  376. font-size: 12px;
  377. }
  378. }
  379. .noMsg{
  380. text-align: center;
  381. color:#7C7C7C;
  382. margin-top:20px;
  383. }
  384. }
  385. .functionWrap{
  386. width: 94%;
  387. margin:20px 3%;
  388. padding: 15px 20px;
  389. box-sizing: border-box;
  390. overflow: hidden;
  391. background-color: #fff;
  392. border-radius: 15px;
  393. .function{
  394. width:20%;margin:10px 2.5%;
  395. }
  396. .van-row{
  397. .van-image{
  398. width:100%;
  399. vertical-align: middle;
  400. }
  401. }
  402. .title{
  403. text-align: center;
  404. color:#323232;
  405. font-size: 10px;
  406. margin-top:6px;
  407. }
  408. }
  409. .foot {
  410. .img{
  411. width:15px;
  412. margin:0px auto 0;
  413. display: block;
  414. }
  415. p{
  416. margin-top:6px;
  417. }
  418. }
  419. }
  420. .van-tabbar-item{
  421. color:#666666;
  422. }
  423. .van-tabbar-item--active{
  424. color:#EA2F3D;
  425. }
  426. </style>