| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- <template>
- <view>
- <view class="uni-margin-wrap">
- <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
- :duration="duration">
- <swiper-item v-for="item in bannnerData" :key="item.id">
- <image :src="item.imgPath" mode=""></image>
- </swiper-item>
- </swiper>
- </view>
- <view class="orderManage">
- <view class="orderTit" style="padding-left: 15px;color: rgb(126, 131, 125);">
- <text style="width: 4px;background-color: rgb(26, 188, 156);height: 20px;margin-top: 10px;margin-right: 5px;"></text>
- <text style="font-size: 14px;">工单模块</text>
- </view>
- <view class="orderCon">
- <view class="orderList" v-for="item in orderListData" :key="item.id" @click="workOrderListClick(item)">
- <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
- <text>{{ item.text }}</text>
- </view>
- </view>
- <view class="orderTit" @click="changeStore" v-if="noticState">
- <image style="background: #ff9600" src="/static/icon_noticefi.png"></image>
- <text>公告通知</text>
- </view>
- <view class="notification">
- <view class="notifiList" v-for="item in noticListData" :key="item.id">
- <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
- <view class="">
- <text>{{ item.textTit }}</text>
- <text>{{ item.textCon }}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { mapGetters } from "vuex"
- import store from '@/store';
- import { getToken } from '@/utils/auth'
- export default {
- data() {
- return {
- indicatorDots: true,
- autoplay: true,
- interval: 2000,
- noticState: false,
- duration: 500,
- bannnerData: [],
- orderListData: [],
- noticListData: [],
- }
- },
- computed: {
- ...mapGetters(["State"]),
- },
- onLoad() {
- this.init()
- },
- methods: {
- init() {
- // // #ifdef APP-PLUS
- // let timer
- // timer = setInterval(() => {
- // plus.push.getClientInfoAsync((info) => {
- // let cid = info["clientid"];
- // if (cid) {
- // clearInterval(timer)
- // this.clienGet(cid) //获取cid
- // }
- // });
- // }, 5000)
- // // #endif
- if (!getToken()) {
- uni.reLaunch({
- url: '/pages/login/login'
- });
- } else {
- //banner数据
- this.bannnerData = this.$mConstDataConfig.bannnerData
- this.getMenuPermissions() //获取用户权限
- // 公告数据
- //this.noticListData = this.$mConstDataConfig.noticListData
- }
- },
- changeStore() {
- this.$mStore.dispatch("STATE", 3)
- },
- workOrderListClick(item) {
- uni.navigateTo({
- url: item.navigateToUrl,
- })
- },
- getMenuPermissions() {
- let code = uni.getStorageSync("roleCode");
- /*
- GLY:管理员
- */
- if ( code === 'WXY') {
- this.orderListData = this.$mConstDataConfig.roleListData.UnitList
- }else if(code === "GLY") {
- this.orderListData = this.$mConstDataConfig.roleListData.administratorList
- }else if(code === "BXY" || code === 'CK_GLY') {
- this.orderListData = this.$mConstDataConfig.roleListData.applyRepairList
- }else if(code === "DDZX" ) {
- this.orderListData = this.$mConstDataConfig.roleListData.dispatchList
- } else if(code === "SJ" ){
- this.orderListData = this.$mConstDataConfig.roleListData.driverList
- }
- },
- },
- }
- </script>
- <style lang="scss">
- .uni-margin-wrap {
- width: 690rpx;
- width: 100%;
- }
- .swiper {
- height: 225px;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .orderManage {
- .orderTit {
- margin-top: 15rpx;
- width: 100%;
- height: 80rpx;
- line-height: 80rpx;
- background: #ffffff;
- display: flex;
- border-bottom: 1rpx solid #eeeeee;
- text {
- font-size: 32rpx;
- }
- image {
- width: 24rpx;
- height: 24rpx;
- padding: 8rpx;
- border-radius: 12px;
- background: #1972c2;
- margin: 20rpx 10rpx 20rpx 26rpx;
- }
- }
- .orderCon {
- background: #ffffff;
- display: flex;
- flex-wrap: wrap;
- .orderList {
- width: 186rpx;
- height: 206rpx;
- text-align: center;
- border-right: 2rpx solid #eeeeee;
- border-bottom: 2rpx solid #eeeeee;
- image {
- width: 40rpx;
- height: 40rpx;
- margin: 0 auto;
- display: block;
- border-radius: 35rpx;
- padding: 15rpx;
- margin-top: 45rpx;
- }
- text {
- font-size: 24rpx;
- line-height: 60rpx;
- }
- }
- .orderList:nth-child(4n + 4) {
- border-right: none;
- }
- .orderList:last-child {
- border-right: none;
- }
- }
- .notification {
- background: #ffffff;
- margin-bottom: 100rpx;
- display: flex;
- flex-wrap: wrap;
- border-bottom: 1rpx solid #eeeeee;
- .notifiList {
- width: 375rpx;
- height: 172rpx;
- padding: 46rpx 30rpx 46rpx 30rpx;
- text-align: left;
- border-right: 1rpx solid #eeeeee;
- border-bottom: 1rpx solid #eeeeee;
- box-sizing: border-box;
- display: flex;
- image {
- width: 48rpx;
- height: 48rpx;
- box-sizing: border-box;
- border-radius: 24rpx;
- padding: 10rpx;
- margin: 19rpx;
- }
- text {
- font-size: 24rpx;
- line-height: 30rpx;
- }
- }
- .notifiList:nth-child(2n + 2) {
- border-right: none;
- }
- }
- }
- </style>
|