index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view>
  3. <image src="../../static/index/banner.png" class="banner"></image>
  4. <div class="map">
  5. <div
  6. class="mapdom"
  7. style="float: left"
  8. v-for="(item, index) in mapList"
  9. :key="index"
  10. @click="jumpPage(item.path)"
  11. >
  12. <img class="mapIcon" :src="item.url" />
  13. <div class="maptxt">{{ item.label }}</div>
  14. </div>
  15. </div>
  16. </view>
  17. </template>
  18. <script>
  19. // import {demo} from "@/js_sdk/http"
  20. import { getUserPower, getUserLocalStorageInfo } from "@/js_sdk/http";
  21. export default {
  22. data() {
  23. return {
  24. mapList: [
  25. // {
  26. // label: "经发填报",
  27. // url: "https://hswkxc.idea-sf.com/fileService/static/slices/1@2x.png",
  28. // path: "/pages/subPackages/companyHouse/companyHouse",
  29. // },
  30. // {
  31. // label: "企业库",
  32. // url: "https://hswkxc.idea-sf.com/fileService/static/slices/2@2x.png",
  33. // path: "/pages/subPackages/companyHouse/companyHouse",
  34. // },
  35. // {
  36. // label: "走访上报",
  37. // url: "https://hswkxc.idea-sf.com/fileService/static/slices/3@2x.png",
  38. // path: "/pages/subPackages/companyreport/companyreport",
  39. // },
  40. {
  41. label: "走访任务",
  42. url: "https://hswkxc.idea-sf.com/fileService/static/slices/4@2x.png",
  43. path: "/pages/subPackages/visits_task/index",
  44. },
  45. {
  46. label: "辖区资产",
  47. url: "https://hswkxc.idea-sf.com/fileService/static/slices/5@2x.png",
  48. path: "/pages/subPackages/area_asset/index",
  49. },
  50. // {
  51. // label: "我的待办",
  52. // url: "https://hswkxc.idea-sf.com/fileService/static/slices/7@2x.png",
  53. // path: "/pages/subPackages/todo/index",
  54. // },
  55. {
  56. label: "我的待阅",
  57. url: "https://hswkxc.idea-sf.com/fileService/static/slices/6@2x.png",
  58. path: "/pages/subPackages/toread/index",
  59. },
  60. // {
  61. // label: "会议室审核",
  62. // url: "https://hswkxc.idea-sf.com/fileService/static/slices/12@2x.png",
  63. // path: "/pages/subPackages/meetingroom/meetingroom",
  64. // },
  65. // {
  66. // label: "安全自检管理",
  67. // url: "https://hswkxc.idea-sf.com/fileService/static/slices/8@2x.png",
  68. // path: "/pages/subPackages/secureselftest/index",
  69. // },
  70. // {
  71. // label: "安全自检计划",
  72. // url: "https://hswkxc.idea-sf.com/fileService/static/slices/9@2x.png",
  73. // path: "/pages/subPackages/secureselfplan/index",
  74. // },
  75. // {
  76. // label: "报修派单",
  77. // url: "https://hswkxc.idea-sf.com/fileService/static/slices/11@2x.png",
  78. // path: "/pages/subPackages/repairDispatch-app/index",
  79. // },
  80. // {
  81. // label: "报修处理",
  82. // url: "https://hswkxc.idea-sf.com/fileService/static/slices/10@2x.png",
  83. // path: "/pages/subPackages/repairprocessing-app/index",
  84. // },
  85. // {
  86. // label: "整改填报",
  87. // url: "https://hswkxc.idea-sf.com/fileService/static/slices/15@2x.png",
  88. // path: "/pages/subPackages/modifyReport/index",
  89. // },
  90. // {
  91. // label: "整改派单",
  92. // url: "https://hswkxc.idea-sf.com/fileService/static/slices/14@2x.png",
  93. // path: "/pages/subPackages/modifySend/index",
  94. // },
  95. // {
  96. // label: "整改处理",
  97. // url: "https://hswkxc.idea-sf.com/fileService/static/slices/13@2x.png",
  98. // path: "/pages/subPackages/modifyHandle/index",
  99. // },
  100. // {
  101. // label: "活动核销",
  102. // url: "https://hswkxc.idea-sf.com/fileService/static/slices/1@2x.png",
  103. // path: "/pages/subPackages/activity/index",
  104. // },
  105. ],
  106. };
  107. },
  108. onShareAppMessage() {},
  109. mounted() {
  110. // demo();
  111. },
  112. onShow() {
  113. uni.getStorage({
  114. key: "laocui_user_token",
  115. success: function (res) {
  116. // console.log("resresresresresresresresresres", res);
  117. // uni.switchTab({
  118. // url: "/pages/index/index",
  119. // });
  120. },
  121. fail(res) {
  122. console.log("resresresresresresresresresres", res);
  123. uni.redirectTo({
  124. url: "/pages/login/login",
  125. });
  126. },
  127. });
  128. },
  129. onLoad() {
  130. this.getUserPower();
  131. },
  132. methods: {
  133. // getUserLocalStorageInfo
  134. async getUserPower() {
  135. if (getUserLocalStorageInfo().user.id == 1) return;
  136. let that = this;
  137. let newList = [];
  138. let { data } = await getUserPower(getUserLocalStorageInfo().user.id);
  139. for (let i = 0; i < that.mapList.length; i++) {
  140. let index = data.findIndex((e) => e == that.mapList[i].label);
  141. if (index != -1) {
  142. newList.push(that.mapList[i]);
  143. }
  144. }
  145. that.mapList = newList;
  146. },
  147. jumpPage(path) {
  148. uni.navigateTo({
  149. url: path,
  150. fail: (fail) => {},
  151. });
  152. },
  153. },
  154. };
  155. </script>
  156. <style lang="scss">
  157. page {
  158. background: white;
  159. }
  160. .banner {
  161. width: 100%;
  162. height: 450rpx;
  163. position: absolute;
  164. z-index: 1;
  165. }
  166. .mapdom {
  167. width: 25%;
  168. height: 184rpx;
  169. }
  170. .maptxt {
  171. width: 100%;
  172. height: 34rpx;
  173. font-size: 24rpx;
  174. font-family: PingFang SC-Medium, PingFang SC;
  175. font-weight: 500;
  176. color: #333333;
  177. text-align: center;
  178. }
  179. .mapIcon {
  180. width: 160rpx;
  181. height: 160rpx;
  182. //background: linear-gradient(141deg, #89BCFF 0%, #2782FA 100%);
  183. display: block;
  184. margin: auto;
  185. }
  186. .map {
  187. position: absolute;
  188. z-index: 2;
  189. width: calc(100% - 64rpx);
  190. height: 450rpx;
  191. border-radius: 48rpx 48rpx 0rpx 0rpx;
  192. background: white;
  193. margin-top: 402rpx;
  194. padding: 48rpx 32rpx;
  195. }
  196. </style>