index.vue 5.6 KB

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