index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template name="apps">
  2. <view>
  3. <cu-custom bgColor="bg-blue">
  4. <block slot="content">首页</block>
  5. </cu-custom>
  6. <swiper class="swiper" circular :indicator-dots="true" :autoplay="true" :interval="3000" :duration="800">
  7. <swiper-item>
  8. <image src="../../static/img/banner.png" class="swiper-item"></image>
  9. </swiper-item>
  10. </swiper>
  11. <view class="line-box">
  12. <view class="btn-box-1 mart-t" v-if="stype != 3">
  13. <navigator class="h-200" hover-class="none" url="/pages/buildList/buildList">
  14. </navigator>
  15. </view>
  16. <view class="btn-box-2 mart-t">
  17. <navigator class="h-200" hover-class="none" url="/pages/comList/comList">
  18. </navigator>
  19. </view>
  20. <view class="btn-box-3 mart-t">
  21. <navigator class="h-200" hover-class="none" url="/pages/revenue/RevenueList">
  22. </navigator>
  23. </view>
  24. <view class="btn-box-4 mart-t">
  25. <navigator class="h-200" hover-class="none" url="/pages/map/mapVisualization-th">
  26. </navigator>
  27. </view>
  28. <view class="btn-box-5 mart-t">
  29. <navigator class="h-200" hover-class="none" url="/pages/analysis/analysis">
  30. </navigator>
  31. </view>
  32. <view class="btn-box-6 mart-t" @click="outlogin">
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import loginService from "@/api/auth/loginService"
  39. export default {
  40. name: "apps",
  41. data() {
  42. return {
  43. stype: "", // 企业 => 3 楼宇 => 2 园区 => 1 zfadmin => 4 admin=> 5
  44. };
  45. },
  46. onShow() {
  47. },
  48. created() {
  49. this.$auth.checkLogin()
  50. this.getRole()
  51. },
  52. methods: {
  53. getRole() {
  54. let userInfo = uni.getStorageSync('WMS-userinfo')
  55. var officeId = userInfo.officeDTO.id;
  56. var roleIds = userInfo.roleIds;
  57. if (roleIds.indexOf("17bac1f980264e3e8193bc965538e2c6") != -1) {
  58. //// 管理员
  59. this.stype = 5
  60. uni.setStorageSync('stype', this.stype);
  61. } else if (roleIds.indexOf("ade960e8f02544998b07397304c059c1") != -1) {
  62. // 政府管理员
  63. this.stype = 4
  64. uni.setStorageSync('stype', this.stype);
  65. } else {
  66. console.log('==================>这里走了么','================>存一个stape')
  67. loginService
  68. .getOtherIdByOffceid({
  69. officeid: officeId,
  70. })
  71. .then(({
  72. data
  73. }) => {
  74. console.log(data, "====================>getOtherIdByOffceid");
  75. this.stype = data.stype;
  76. uni.setStorageSync('stype', this.stype);
  77. });
  78. }
  79. },
  80. outlogin() {
  81. uni.showModal({
  82. title: '您确认退出么?',
  83. showCancel: true,
  84. success: (res) => {
  85. if (res.confirm) {
  86. uni.showLoading()
  87. loginService.logout().then(({
  88. data
  89. }) => {
  90. this.$store.commit('logout');
  91. uni.clearStorage();
  92. uni.reLaunch({
  93. url: '/pages/login/login'
  94. })
  95. })
  96. }
  97. }
  98. });
  99. }
  100. }
  101. }
  102. </script>
  103. <style>
  104. .page {
  105. height: 100vh;
  106. }
  107. .line-box {
  108. display: flex;
  109. padding-left: 20rpx;
  110. padding-right: 20rpx;
  111. justify-content: space-between;
  112. margin-top: 20rpx;
  113. flex-wrap: wrap;
  114. }
  115. .mart-t {
  116. margin-top: 30rpx;
  117. }
  118. .btn-box-1 {
  119. width: 337rpx;
  120. height: 200rpx;
  121. background-image: url('../../static/img/btn1.png');
  122. background-size: 100% 100%;
  123. }
  124. .btn-box-2 {
  125. width: 337rpx;
  126. height: 200rpx;
  127. background-image: url('../../static/img/btn4.png');
  128. background-size: 100% 100%;
  129. }
  130. .btn-box-3 {
  131. width: 337rpx;
  132. height: 200rpx;
  133. background-image: url('../../static/img/btn2.png');
  134. background-size: 100% 100%;
  135. }
  136. .btn-box-4 {
  137. width: 337rpx;
  138. height: 200rpx;
  139. background-image: url('../../static/img/btn5.png');
  140. background-size: 100% 100%;
  141. }
  142. .btn-box-5 {
  143. width: 337rpx;
  144. height: 200rpx;
  145. background-image: url('../../static/img/btn3.png');
  146. background-size: 100% 100%;
  147. }
  148. .btn-box-6 {
  149. width: 337rpx;
  150. height: 200rpx;
  151. background-image: url('../../static/img/btn6.png');
  152. background-size: 100% 100%;
  153. }
  154. .h-200 {
  155. height: 200rpx;
  156. }
  157. .swiper {
  158. width: 750rpx;
  159. height: 360rpx;
  160. }
  161. .swiper-item {
  162. width: 750rpx;
  163. height: 360rpx;
  164. background-color: aliceblue;
  165. }
  166. .font-size-35 {
  167. font-size: 35px !important;
  168. }
  169. .img-size {
  170. width: 80rpx;
  171. height: 80rpx;
  172. }
  173. .content-box {
  174. width: 337rpx;
  175. height: 200rpx;
  176. }
  177. .my-app .padding-sm {
  178. padding: 6px;
  179. }
  180. .grid .padding-sm .bg-white {
  181. box-shadow: 0 1px 4px #f9f9f9, 1px 1px 40px rgba(0, 0, 0, .06);
  182. }
  183. .bg-blue {
  184. background: #fff;
  185. color: #0081ff !important;
  186. }
  187. .text-white,
  188. .line-white,
  189. .lines-white {
  190. color: #0081ff !important;
  191. }
  192. </style>