index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view class="index">
  3. <view class="index-header">
  4. <view class="index-header-box">
  5. <view class="index-header-box-1">
  6. <view class="left">
  7. <text>欢迎你!{{ vuex_user.operName }}</text>
  8. </view>
  9. <view class="right">
  10. <u-icon size="21" name="../../static/icons/logout-icon.svg" @click="logout"></u-icon>
  11. </view>
  12. </view>
  13. <view class="index-header-box-2">
  14. <text>普定智慧停车<br />运营中心</text>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="index-main">
  19. <view class="index-main-menu">
  20. <!-- 数据概览 -->
  21. <view class="index-main-menu-1">
  22. <view class="menu-item" v-for="(item, index) in analysisMenuList" :key="index" @click="jumpPage(item.url)">
  23. <view class="menu-item-icon">
  24. <u-icon size="48" :name="item.icon"></u-icon>
  25. </view>
  26. <view class="menu-item-name">
  27. <text>{{ item.name }}</text>
  28. </view>
  29. </view>
  30. </view>
  31. <!-- 订单管理 -->
  32. <view class="index-main-menu-2">
  33. <view class="index-main-menu-title">
  34. <text>订单管理</text>
  35. </view>
  36. <view class="menu">
  37. <view class="menu-item" v-for="(item, index) in orderMenuList" :key="index" @click="jumpPage(item.url, {}, true)">
  38. <view class="menu-item-icon" :style="{ width: item.width || '30px' }">
  39. <u--image :src="item.icon" :width="item.width || '30px'"
  40. :height="item.height || '31px'"></u--image>
  41. </view>
  42. <view class="menu-item-name">
  43. <text>{{ item.name }}</text>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 巡检管理 -->
  49. <view class="index-main-menu-2">
  50. <view class="index-main-menu-title">
  51. <text>巡检管理</text>
  52. </view>
  53. <view class="menu">
  54. <view class="menu-item" v-for="(item, index) in patrolMenuList" :key="index" @click="jumpPage(item.url, {}, item.flag)">
  55. <view class="menu-item-icon" :style="{ width: item.width || '30px', height: '33px' }">
  56. <u--image :src="item.icon" :width="item.width || '30px'"
  57. :height="item.height || '30px'"></u--image>
  58. </view>
  59. <view class="menu-item-name">
  60. <text>{{ item.name }}</text>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <u-toast ref="uToast"></u-toast>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. data() {
  73. return {
  74. todayData: {},
  75. analysisMenuList: [{
  76. icon: require('@/static/icons/today-overview-icon.svg'),
  77. name: '今日概况',
  78. url: 'pages/dataOverview/todayOverview/todayOverview'
  79. },
  80. {
  81. icon: require('@/static/icons/operational-analysis-icon.svg'),
  82. name: '运营分析',
  83. url: 'pages/dataOverview/operationalAnalysis/operationalAnalysis'
  84. },
  85. {
  86. icon: require('@/static/icons/statistical-report-icon.svg'),
  87. name: '统计报表',
  88. url: 'pages/dataOverview/statisticalReport/statisticalReport'
  89. }
  90. ],
  91. // 订单管理
  92. orderMenuList: [{
  93. icon: require('@/static/icons/parking-record-icon.svg'),
  94. name: '停车记录',
  95. url: 'pages/orderManagement/parkingRecord/parkingRecord',
  96. width: '28px'
  97. },
  98. {
  99. icon: require('@/static/icons/arrearage-record-icon.svg'),
  100. name: '欠费记录',
  101. url: 'pages/orderManagement/arrearageRecord/arrearageRecord'
  102. },
  103. {
  104. icon: require('@/static/icons/collection-record-icon.svg'),
  105. name: '收款记录',
  106. url: 'pages/orderManagement/collectionRecord/collectionRecord'
  107. },
  108. {
  109. icon: require('@/static/icons/fee-evasion-record-icon.svg'),
  110. name: '逃费记录',
  111. url: 'pages/orderManagement/feeEvasionRecord/feeEvasionRecord',
  112. width: '39px',
  113. height: '31px'
  114. },
  115. {
  116. icon: require('@/static/icons/void-record-icon.svg'),
  117. name: '作废记录',
  118. url: 'pages/orderManagement/voidRecord/voidRecord',
  119. height: '31px'
  120. },
  121. {
  122. icon: require('@/static/icons/recovery-record-icon.svg'),
  123. name: '追缴记录',
  124. url: 'pages/orderManagement/recoveryRecord/recoveryRecord',
  125. height: '31px'
  126. }
  127. ],
  128. // 巡检管理
  129. patrolMenuList: [{
  130. icon: require('@/static/icons/patrol-manage-icon.svg'),
  131. name: '巡检记录',
  132. url: 'pages/patrolManagement/patrolRecord/patrolRecord',
  133. width: '29px',
  134. height: '31px',
  135. flag: true
  136. },
  137. {
  138. icon: require('@/static/icons/device-error-records-icon.svg'),
  139. name: '设备异常记录',
  140. url: 'pages/patrolManagement/deviceAbnormalRecords/deviceAbnormalRecords',
  141. width: '35px',
  142. height: '31px'
  143. }
  144. ]
  145. }
  146. },
  147. onLoad() {
  148. // 为了验证token是否过期
  149. // this.getTodayData();
  150. },
  151. methods: {
  152. /**
  153. * 登出操作
  154. */
  155. logout() {
  156. uni.showModal({
  157. title: '提示',
  158. content: '你确认退出登录?',
  159. success: (res) => {
  160. if (res.confirm) {
  161. uni.$u.api.logoutApi().then(res => {
  162. if (res.code === 200) {
  163. uni.$u.vuex('vuex_token', '');
  164. uni.$u.vuex('vuex_user', {});
  165. uni.$u.vuex('vuex_isLogin', false);
  166. uni.redirectTo({
  167. url: "/pages/login/login"
  168. })
  169. } else {
  170. this.$refs.uToast.show({
  171. message: res.msg || '退出登录失败!',
  172. type: 'error'
  173. })
  174. }
  175. })
  176. }
  177. }
  178. })
  179. },
  180. /**
  181. * 获取今日概况
  182. */
  183. getTodayData() {
  184. uni.$u.api.todayOverviewApi.getTodayDataApi().then(res => {
  185. if (res.code === 200) {
  186. this.todayData = res.data
  187. } else {
  188. this.$refs.uToast.show({
  189. message: res.msg || '获取今日概况失败!',
  190. type: 'error'
  191. })
  192. }
  193. })
  194. },
  195. /**
  196. * 跳转页面
  197. * @param { String } url
  198. * @param { Object } params
  199. */
  200. jumpPage(url, params, flag) {
  201. if (flag) {
  202. this.$refs.uToast.show({
  203. message: '功能未开发!',
  204. type: 'info'
  205. })
  206. } else {
  207. uni.$u.route({
  208. url,
  209. params
  210. })
  211. }
  212. }
  213. }
  214. }
  215. </script>
  216. <style lang="scss">
  217. page {
  218. background-color: #EFEFEF;
  219. }
  220. </style>
  221. <style lang="scss" scoped>
  222. @import './index.scss';
  223. </style>