| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447 |
- <template>
- <view>
- <!-- 轮播 -->
- <u-swiper :list="list" height="280"></u-swiper>
- <!-- 分类 -->
- <view class="px3 py2 d-flex f-wrap mt-1 bg-color-white cate">
- <block v-for="(item, index) in cateList" :key="index">
- <view @tap="handleView(item.type, item.url)" class="d-flex a-center j-center f-column col4 mb-2">
- <image :src="item.logo" class="mb-1" mode=""></image>
- <text class="f-size-24">{{ item.name }}</text>
- </view>
- </block>
- </view>
- <!-- 广告 -->
- <!-- <view class="px3 ad bg-color-white">
- <view class="py2">
- <u-section
- title="灵活用工优势"
- font-size="34"
- :show-line="false"
- >
- <view slot="right" class="f-size-26 text-color-6">
- <text class="mr-1">灵活结算</text>
- <text class="mr-1">员工自由</text>
- <text>效能提升</text>
- </view>
- </u-section>
- </view>
- <view class="d-flex j-between f-wrap bottom pb-2">
- <block v-for="(item, index) in adList" :key="index">
- <view class="mt-2" style="width: 330rpx">
- <image
- :src="item.icon"
- class="bottom-img"
- mode=""
- ></image>
- </view>
- </block>
- </view>
- </view>-->
- <!-- 最新消息 -->
- <view style="background-color: #f2f3f4" class="pb-1">
- <view class="f-size-32 f-weight-bold py2 border-bottom main-color-text" style="padding-left: 15px">最新消息</view>
- <view class="mx3 my2 p3 bg-color-white" v-for="(item, index) in listData" :key="index" @tap="handleDetail(item)" style="border-radius: 16rpx">
- <view class="d-flex j-between">
- <view class="f-size-32 f-weight-bold main-color-text">{{
- typeDict[item.detailType]
- }}</view>
- <view class="f-size-26 text-color-b">{{
- item.createdTime
- }}</view>
- </view>
- <view class="f-size-28 text-color-3 f-weight-4 mt-2">
- <rich-text :nodes="item.content"></rich-text>
- </view>
- </view>
- </view>
- <!-- 维修工单 -->
- <!-- <view style="background-color: #f2f3f4" class="" >
- <view class="mx3 pb-1 pt-3" @tap="handleRepair()">
- <u-section
- title="维修工单"
- sub-title="查看更多"
- font-size="34"
- :show-line="false"
- ></u-section>
- </view>
- <serve-list :order-list="orderList" />
- </view>-->
- <!-- 热门 -->
- <!-- <view class="hot-p">
- <view class="mx3 py3">
- <u-section
- title="热门接单人"
- sub-title="查看更多"
- font-size="34"
- :show-line="false"
- @click="goMineList"
- >
- </u-section>
- </view>
- <view class="mx3 d-flex f-wrap bottom">
- <view class="d-flex j-center">
- <view
- class="d-flex f-column bg-color-white mb-2 pl-3 pt-3 pb-2 bottom-item"
- >
- <image
- src="https://www.xingzhits.cn/xzts/static/images/avatar1.png"
- class="bg-color-light mb-2 bottom-img"
- ></image>
- <text class="f-weight-6 one-ellipsis">慕容晓晓</text>
- <view class="f-size-24 mt-1 one-ellipsis bottom-desc">
- UI设计师</view
- >
- </view>
- </view>
- <view class="d-flex j-center">
- <view
- class="d-flex f-column bg-color-white mb-2 pl-3 pt-3 pb-2 bottom-item"
- >
- <image
- src="https://www.xingzhits.cn/xzts/static/images/avatar1.png"
- class="bg-color-light mb-2 bottom-img"
- ></image>
- <text class="f-weight-6 one-ellipsis">慕容晓晓</text>
- <view class="f-size-24 mt-1 one-ellipsis bottom-desc">
- UI设计师</view
- >
- </view>
- </view>
- </view>
- </view>-->
- <u-popup v-model="show" :mask-close-able="false" :border-radius="20" mode="bottom">
- <view class="account-title">
- <u-avatar src="../../static/logo.png" :size="30"></u-avatar>
- <span class="ml-3">设备管理系统</span>
- </view>
- <view class="px3 py3 f-size-24 f-weight-bold text-color-6">请选择以下账号做为你的登录账号</view>
- <view class="accounts">
- <view class="account-item" v-for="item in accounts" :key="item" @click="handleSelectLogin(item)">{{item}}</view>
- </view>
- </u-popup>
- <u-tabbar :list="tabbar" :mid-button="true" active-color="#0082ff"></u-tabbar>
- </view>
- </template>
- <script>
- const basePath = 'https://www.xingzhits.cn/xzts/static'
- export default {
- data() {
- return {
- listData: [],
- typeDict: {},
- list: [
- {
- image: 'http://www.qykh2009.com/images/sbgl_banner.png'
- },
- {
- image: 'http://www.qykh2009.com/upload/pic/50921544089534569.jpg'
- },
- {
- image: 'http://www.qykh2009.com/upload/pic/84401544089632806.jpg'
- },
- {
- image: 'http://www.qykh2009.com/upload/pic/69531466063518453.png'
- }
- ],
- cateList: [
- {
- logo: basePath + '/images/icon1.png',
- name: '设备扫码',
- url: '',
- type: 1
- },
- /* {
- logo: basePath + '/images/icon2.png',
- name: '点检管理',
- url: '../check/check',
- type: 2
- },
- {
- logo: basePath + '/images/icon4.png',
- name: '巡检填报',
- url: '../inspection/inspection',
- type: 2
- }, */
- {
- logo: basePath + '/images/icon3.png',
- name: '保养管理',
- url: '../maintain/maintain',
- type: 2
- },
- /* {
- logo: basePath + '/images/icon4.png',
- name: '运行填报',
- url: '../running/running',
- type: 2
- }, */
- {
- logo: basePath + '/images/icon5.png',
- name: '设备报修',
- url: '../repair/repair',
- type: 2
- },
- /* {
- logo: basePath + '/images/icon7.png',
- name: '备品备件',
- url: '../receive/receive',
- type: 2
- }, */
- {
- logo: basePath + '/images/icon8.png',
- name: '设备台账',
- url: '../equipment/equipment',
- type: 2
- }
- ],
- adList: [
- {
- icon: basePath + '/images/ad1.png'
- },
- {
- icon: basePath + '/images/ad2.png'
- },
- {
- icon: basePath + '/images/ad3.png'
- },
- {
- icon: basePath + '/images/ad4.png'
- }
- ],
- orderList: [{}, {}],
- companyList: [{}, {}],
- accounts: [],
- tabbar: [
- {
- iconPath: '/static/tabars/home.png',
- pagePath: '/pages/home/home',
- selectedIconPath: '/static/tabars/home_s.png',
- text: '首页'
- },
- {
- iconPath: '/static/tabars/order.png',
- pagePath: '/pages/operate/operate',
- selectedIconPath: '/static/tabars/order_s.png',
- text: '功能'
- },
- {
- iconPath: '/static/tabars/publish.png',
- pagePath: '/pages/middle/middle',
- selectedIconPath: '/static/tabars/publish.png',
- text: '报修',
- midButton: true
- },
- {
- iconPath: '/static/tabars/tiding.png',
- pagePath: '/pages/tidings/tidings',
- selectedIconPath: '/static/tabars/tiding_s.png',
- text: '消息'
- },
- {
- iconPath: '/static/tabars/mine.png',
- pagePath: '/pages/my/my',
- selectedIconPath: '/static/tabars/mine_s.png',
- text: '我的'
- }
- ],
- show: false
- }
- },
- onLoad(options) {
- this.initData()
- if (options.code) {
- this.login(options.code)
- }
- },
- onShow() {
- this.initData()
- },
- methods: {
- login(code) {
- this.$Http.loginQuicklyOauth(code).then(res => {
- if (res.data.length > 1) {
- this.accounts = res.data
- this.show = true
- } else {
- this.handleSelectLogin(res.data[0])
- }
- })
- },
- handleSelectLogin(params) {
- console.log(2)
- this.$Http
- .mobileLogin({
- username: params,
- password: 'quickly_login',
- grant_type: 'quickly_login',
- scope: 'server'
- })
- .then(res => {
- this.show = false
- })
- },
- handleRepair() {
- uni.navigateTo({
- url: '/pages/repair/repair'
- })
- },
- handleView(type, url) {
- if (type === 1) {
- this.handleCode()
- } else {
- uni.navigateTo({
- url: url
- })
- }
- },
- handleMessage() {
- uni.navigateTo({
- url: '/pages/tidings/tidings'
- })
- },
- // 去详情
- handleDetail(detail) {
- if (detail.status == 1) {
- this.$Http.updateWorkplaceBacklog({ id: detail.backlogId }).then(res => {
- console.log('已置为已办')
- })
- }
- uni.navigateTo({
- url: '/pages/tidings-detail/tidings-detail?detail=' + JSON.stringify(detail)
- })
- },
- handleCode() {
- // #ifdef H5
- uni.showToast({
- title: '暂不支持该功能',
- icon: 'none'
- })
- // #endif
- // #ifndef H5
- uni.scanCode({
- success(e) {
- const sbId = e.result.split('=')[1]
- if (sbId != null) {
- uni.navigateTo({
- url: '/pages/equipment-detail/equipment-detail?detailId=' + sbId
- })
- } else {
- uni.showToast('非本系统二维码,无法识别')
- }
- }
- })
- // #endif
- },
- getDict() {
- this.typeDict = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.WORKPLACE_BACKLOG_DETAIL_TYPE)
- },
- initData() {
- const that = this
- this.$Http
- .getWorkplaceBacklogUserPage({
- pageNum: 1,
- pageSize: 4,
- dataScope: {
- sortBy: 'desc',
- sortName: 'task_create_time'
- }
- })
- .then(res => {
- that.getDict()
- console.log(res)
- const data = res.data.rows
- that.listData = data
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .uni-swiper-slides {
- inset: 0px 0px !important;
- }
- .cate {
- image {
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- }
- text {
- color: #595c68;
- }
- }
- .hot-p {
- .bottom {
- & > view {
- width: 33%;
- }
- .bottom-item {
- border-radius: 15rpx;
- width: 210rpx;
- .bottom-desc {
- border: 1rpx solid #fa5445;
- width: 150rpx;
- text-align: center;
- border-radius: 7rpx;
- color: #fa5445;
- }
- }
- }
- }
- .ad {
- .bottom {
- &-img {
- width: 330rpx;
- height: 240rpx;
- border-radius: 20rpx;
- }
- }
- }
- .hot-p {
- background-color: #f2f3f4;
- .bottom {
- &-img {
- width: 80rpx;
- height: 80rpx;
- border-radius: 50%;
- }
- }
- }
- .account-title {
- padding: 30rpx;
- display: flex;
- align-items: center;
- font-weight: bold;
- background: #fff;
- }
- .accounts {
- padding: 40rpx;
- height: 600rpx;
- line-height: 60rpx;
- overflow-y: auto;
- .account-item {
- padding: 40rpx;
- margin: 0 auto;
- font-size: 40rpx;
- text-align: center;
- border-radius: 20rpx;
- background: #fff;
- margin-bottom: 20rpx;
- &:hover {
- cursor: pointer;
- }
- }
- }
- ::v-deep .u-drawer-content {
- background: #eee !important;
- }
- </style>
|