123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- <template name="apps">
- <view>
- <cu-custom bgColor="bg-blue">
- <block slot="content">首页</block>
- </cu-custom>
- <swiper class="swiper" circular :indicator-dots="true" :autoplay="true" :interval="3000" :duration="800">
- <swiper-item>
- <image src="../../static/img/banner.png" class="swiper-item"></image>
- </swiper-item>
- </swiper>
- <view class="line-box">
- <view class="btn-box-1 mart-t" v-if="stype != 3">
- <navigator class="h-200" hover-class="none" url="/pages/buildList/buildList">
- </navigator>
- </view>
- <view class="btn-box-2 mart-t">
- <navigator class="h-200" hover-class="none" url="/pages/comList/comList">
- </navigator>
- </view>
- <view class="btn-box-3 mart-t">
- <navigator class="h-200" hover-class="none" url="/pages/revenue/RevenueList">
- </navigator>
- </view>
- <view class="btn-box-4 mart-t">
- <navigator class="h-200" hover-class="none" url="/pages/map/mapVisualization-th">
- </navigator>
- </view>
- <view class="btn-box-5 mart-t">
- <navigator class="h-200" hover-class="none" url="/pages/analysis/analysis">
- </navigator>
- </view>
- <view class="btn-box-6 mart-t" @click="outlogin">
- </view>
- </view>
- </view>
- </template>
- <script>
- import loginService from "@/api/auth/loginService"
- export default {
- name: "apps",
- data() {
- return {
- stype: "", // 企业 => 3 楼宇 => 2 园区 => 1 zfadmin => 4 admin=> 5
- };
- },
- onShow() {
-
- },
-
- created() {
- this.$auth.checkLogin()
- this.getRole()
- },
- methods: {
- getRole() {
- let userInfo = uni.getStorageSync('WMS-userinfo')
- var officeId = userInfo.officeDTO.id;
- var roleIds = userInfo.roleIds;
- if (roleIds.indexOf("17bac1f980264e3e8193bc965538e2c6") != -1) {
- //// 管理员
- this.stype = 5
- uni.setStorageSync('stype', this.stype);
- } else if (roleIds.indexOf("ade960e8f02544998b07397304c059c1") != -1) {
- // 政府管理员
- this.stype = 4
- uni.setStorageSync('stype', this.stype);
- } else {
- console.log('==================>这里走了么','================>存一个stape')
- loginService
- .getOtherIdByOffceid({
- officeid: officeId,
- })
- .then(({
- data
- }) => {
- console.log(data, "====================>getOtherIdByOffceid");
- this.stype = data.stype;
- uni.setStorageSync('stype', this.stype);
- });
- }
-
- },
- outlogin() {
- uni.showModal({
- title: '您确认退出么?',
- showCancel: true,
- success: (res) => {
- if (res.confirm) {
- uni.showLoading()
- loginService.logout().then(({
- data
- }) => {
- this.$store.commit('logout');
- uni.clearStorage();
- uni.reLaunch({
- url: '/pages/login/login'
- })
- })
- }
- }
- });
- }
- }
- }
- </script>
- <style>
- .page {
- height: 100vh;
- }
- .line-box {
- display: flex;
- padding-left: 20rpx;
- padding-right: 20rpx;
- justify-content: space-between;
- margin-top: 20rpx;
- flex-wrap: wrap;
- }
- .mart-t {
- margin-top: 30rpx;
- }
- .btn-box-1 {
- width: 337rpx;
- height: 200rpx;
- background-image: url('../../static/img/btn1.png');
- background-size: 100% 100%;
- }
- .btn-box-2 {
- width: 337rpx;
- height: 200rpx;
- background-image: url('../../static/img/btn4.png');
- background-size: 100% 100%;
- }
- .btn-box-3 {
- width: 337rpx;
- height: 200rpx;
- background-image: url('../../static/img/btn2.png');
- background-size: 100% 100%;
- }
- .btn-box-4 {
- width: 337rpx;
- height: 200rpx;
- background-image: url('../../static/img/btn5.png');
- background-size: 100% 100%;
- }
- .btn-box-5 {
- width: 337rpx;
- height: 200rpx;
- background-image: url('../../static/img/btn3.png');
- background-size: 100% 100%;
- }
- .btn-box-6 {
- width: 337rpx;
- height: 200rpx;
- background-image: url('../../static/img/btn6.png');
- background-size: 100% 100%;
- }
- .h-200 {
- height: 200rpx;
- }
- .swiper {
- width: 750rpx;
- height: 360rpx;
- }
- .swiper-item {
- width: 750rpx;
- height: 360rpx;
- background-color: aliceblue;
- }
- .font-size-35 {
- font-size: 35px !important;
- }
- .img-size {
- width: 80rpx;
- height: 80rpx;
- }
- .content-box {
- width: 337rpx;
- height: 200rpx;
- }
- .my-app .padding-sm {
- padding: 6px;
- }
- .grid .padding-sm .bg-white {
- box-shadow: 0 1px 4px #f9f9f9, 1px 1px 40px rgba(0, 0, 0, .06);
- }
- .bg-blue {
- background: #fff;
- color: #0081ff !important;
- }
- .text-white,
- .line-white,
- .lines-white {
- color: #0081ff !important;
- }
- </style>
|