| | |
| | | <view class="content"> |
| | | <view class="header-section"> |
| | | <view class="currentFactory"> |
| | | <up-text type="primary" :text="userStore.currentFactoryName" @click="show = true" size="18" |
| | | class="factoryName" suffixIcon="arrow-right" :iconStyle="iconStyle"></up-text> |
| | | <up-text type="primary" :text="userStore.currentFactoryName" @click="show = true" size="18" class="factoryName" |
| | | suffixIcon="arrow-right" :iconStyle="iconStyle"></up-text> |
| | | </view> |
| | | <up-picker :show="show" :columns="factoryList" @confirm="changeFactory" @cancel="show = false"></up-picker> |
| | | </view> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="module-content"> |
| | | <up-grid |
| | | :border="false" |
| | | col="4" |
| | | > |
| | | <up-grid-item |
| | | v-for="(item, index) in marketingItems" |
| | | :key="index" |
| | | @click="handleCommonItemClick(item)" |
| | | > |
| | | <up-grid :border="false" col="4"> |
| | | <up-grid-item v-for="(item, index) in marketingItems" :key="index" @click="handleCommonItemClick(item)"> |
| | | <view class="icon-container" :style="{ background: item.bgColor }"> |
| | | <up-icon |
| | | :name="item.icon" |
| | | :size="58" |
| | | color="#ffffff" |
| | | ></up-icon> |
| | | <up-icon :name="item.icon" :size="58" color="#ffffff"></up-icon> |
| | | </view> |
| | | <text class="item-label">{{item.label}}</text> |
| | | </up-grid-item> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="module-content"> |
| | | <up-grid |
| | | :border="false" |
| | | col="4" |
| | | > |
| | | <up-grid-item |
| | | v-for="(item, index) in purchaseItems" |
| | | :key="index" |
| | | @click="handleCommonItemClick(item)" |
| | | > |
| | | <up-grid :border="false" col="4"> |
| | | <up-grid-item v-for="(item, index) in purchaseItems" :key="index" @click="handleCommonItemClick(item)"> |
| | | <view class="icon-container" :style="{ background: item.bgColor }"> |
| | | <up-icon |
| | | :name="item.icon" |
| | | :size="58" |
| | | color="#ffffff" |
| | | ></up-icon> |
| | | <up-icon :name="item.icon" :size="58" color="#ffffff"></up-icon> |
| | | </view> |
| | | <text class="item-label">{{item.label}}</text> |
| | | </up-grid-item> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="module-content"> |
| | | <up-grid |
| | | :border="false" |
| | | col="4" |
| | | > |
| | | <up-grid-item |
| | | v-for="(item, index) in collaborationItems" |
| | | :key="index" |
| | | @click="handleCommonItemClick(item)" |
| | | > |
| | | <up-grid :border="false" col="4"> |
| | | <up-grid-item v-for="(item, index) in collaborationItems" :key="index" @click="handleCommonItemClick(item)"> |
| | | <view class="icon-container" :style="{ background: item.bgColor }"> |
| | | <up-icon |
| | | :name="item.icon" |
| | | :size="58" |
| | | color="#ffffff" |
| | | ></up-icon> |
| | | <up-icon :name="item.icon" :size="58" color="#ffffff"></up-icon> |
| | | </view> |
| | | <text class="item-label">{{item.label}}</text> |
| | | </up-grid-item> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="module-content"> |
| | | <up-grid |
| | | :border="false" |
| | | col="4" |
| | | > |
| | | <up-grid-item |
| | | v-for="(item, index) in inventoryManagement" |
| | | :key="index" |
| | | @click="handleCommonItemClick(item)" |
| | | > |
| | | <up-grid :border="false" col="4"> |
| | | <up-grid-item v-for="(item, index) in inventoryManagement" :key="index" @click="handleCommonItemClick(item)"> |
| | | <view class="icon-container" :style="{ background: item.bgColor }"> |
| | | <up-icon |
| | | :name="item.icon" |
| | | :size="58" |
| | | color="#ffffff" |
| | | ></up-icon> |
| | | <up-icon :name="item.icon" :size="58" color="#ffffff"></up-icon> |
| | | </view> |
| | | <text class="item-label">{{item.label}}</text> |
| | | </up-grid-item> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="module-content"> |
| | | <up-grid |
| | | :border="false" |
| | | col="4" |
| | | > |
| | | <up-grid-item |
| | | v-for="(item, index) in productionItems" |
| | | :key="index" |
| | | @click="handleCommonItemClick(item)" |
| | | > |
| | | <up-grid :border="false" col="4"> |
| | | <up-grid-item v-for="(item, index) in productionItems" :key="index" @click="handleCommonItemClick(item)"> |
| | | <view class="icon-container" :style="{ background: item.bgColor }"> |
| | | <up-icon |
| | | :name="item.icon" |
| | | :size="58" |
| | | color="#ffffff" |
| | | ></up-icon> |
| | | <up-icon :name="item.icon" :size="58" color="#ffffff"></up-icon> |
| | | </view> |
| | | <text class="item-label">{{item.label}}</text> |
| | | </up-grid-item> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="module-content"> |
| | | <up-grid |
| | | :border="false" |
| | | col="4" |
| | | > |
| | | <up-grid-item |
| | | v-for="(item, index) in equipmentItems" |
| | | :key="index" |
| | | @click="handleCommonItemClick(item)" |
| | | > |
| | | <up-grid :border="false" col="4"> |
| | | <up-grid-item v-for="(item, index) in equipmentItems" :key="index" @click="handleCommonItemClick(item)"> |
| | | <view class="icon-container" :style="{ background: item.bgColor }"> |
| | | <up-icon |
| | | :name="item.icon" |
| | | :size="58" |
| | | color="#ffffff" |
| | | ></up-icon> |
| | | <up-icon :name="item.icon" :size="58" color="#ffffff"></up-icon> |
| | | </view> |
| | | <text class="item-label">{{item.label}}</text> |
| | | </up-grid-item> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref, onMounted, nextTick, reactive} from 'vue'; |
| | | import {userLoginFacotryList} from "@/api/login"; |
| | | import { |
| | | ref, |
| | | onMounted, |
| | | nextTick, |
| | | reactive |
| | | } from 'vue'; |
| | | import { |
| | | userLoginFacotryList, |
| | | noticesCount |
| | | } from "@/api/login"; |
| | | import modal from "@/plugins/modal"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import { onShow } from '@dcloudio/uni-app' |
| | | |
| | | const userStore = useUserStore() |
| | | const factoryId = ref(''); |
| | |
| | | } |
| | | |
| | | // 营销管理功能数据 |
| | | const marketingItems = reactive([ |
| | | { |
| | | const marketingItems = reactive([{ |
| | | icon: '/static/images/icon/xiaoshoutaizhang@2x.png', |
| | | label: '销售台账', |
| | | }, |
| | |
| | | ]); |
| | | |
| | | // 采购管理功能数据 |
| | | const purchaseItems = reactive([ |
| | | { |
| | | const purchaseItems = reactive([{ |
| | | icon: '/static/images/icon/caigoutaizhang@2x.png', |
| | | label: '采购台账', |
| | | }, |
| | |
| | | ]); |
| | | |
| | | // 协同办公功能数据 |
| | | const collaborationItems = reactive([ |
| | | { |
| | | const collaborationItems = reactive([{ |
| | | icon: '/static/images/icon/gongchuguanli@2x.png', |
| | | label: '公出管理', |
| | | }, |
| | |
| | | } |
| | | ]); |
| | | // 协同办公功能数据inventoryManagement/receiptManagement |
| | | const inventoryManagement = reactive([ |
| | | { |
| | | const inventoryManagement = reactive([{ |
| | | icon: '/static/images/icon/rukuguanli@2x.png', |
| | | label: '自定义入库', |
| | | }, |
| | |
| | | ]); |
| | | |
| | | // 生产管控功能数据 |
| | | const productionItems = reactive([ |
| | | { |
| | | const productionItems = reactive([{ |
| | | icon: '/static/images/icon/shengchandingdan@2x.png', |
| | | label: '生产订单', |
| | | bgColor: '#FF9800' |
| | |
| | | ]); |
| | | |
| | | // 设备管理功能数据 |
| | | const equipmentItems = reactive([ |
| | | { |
| | | const equipmentItems = reactive([{ |
| | | icon: '/static/images/icon/shebeitaizhang@2x.png', |
| | | label: '设备台账', |
| | | }, |
| | |
| | | const uToastRef = ref(null); |
| | | |
| | | function getUserLoginFacotryList() { |
| | | userLoginFacotryList({userName: userStore.nickName}).then(res => { |
| | | userLoginFacotryList({ |
| | | userName: userStore.nickName |
| | | }).then(res => { |
| | | // 检查res.data是否为数组 |
| | | factoryList.value[0] = [] |
| | | if (res.data && Array.isArray(res.data)) { |
| | |
| | | modal.closeLoading() |
| | | }) |
| | | } |
| | | |
| | | function loginSuccess(result) { |
| | | uni.reLaunch({ |
| | | url: '/pages/index' |
| | |
| | | uToastRef.value.success(`点击了第${name + 1}个`); // 注意:这里加1是因为通常我们是从第1个开始计数的 |
| | | } |
| | | }; |
| | | const isShowNoticesCount = ref(true) |
| | | // 获取公告数量 |
| | | const getNoticesCount = () => { |
| | | if(!isShowNoticesCount.value){ |
| | | return |
| | | } |
| | | noticesCount({}).then(resp => { |
| | | if (resp.code != 200 || !resp.data) { |
| | | return |
| | | } |
| | | const res = uni.getAppAuthorizeSetting(); |
| | | if (res.notificationAuthorized == 'denied') { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '请在设置中开启通知权限', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | uni.openAppAuthorizeSetting({ |
| | | success: (res) => { |
| | | console.log('openAppAuthorizeSetting',res) |
| | | // if (res.authSetting['scope.push']) { |
| | | // createPushMessage(resp.data) |
| | | // } |
| | | } |
| | | }); |
| | | }else{ |
| | | isShowNoticesCount.value = false |
| | | } |
| | | } |
| | | }); |
| | | return |
| | | } |
| | | createPushMessage(resp.data) |
| | | }).catch(error => { |
| | | modal.msgError('获取公告数量:', error) |
| | | console.log('获取公告数量:', error) |
| | | }) |
| | | } |
| | | |
| | | const createPushMessage = (_noticesCount) => { |
| | | uni.createPushMessage({ |
| | | title: '公告通知', |
| | | content: `当前有${_noticesCount}条公告通知,注意查看`, |
| | | success: (resp) => { |
| | | console.log('success', resp) |
| | | isShowNoticesCount.value = false |
| | | }, |
| | | fail: (resp) => { |
| | | console.log('fail', resp) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | // 设置用户信息 |
| | |
| | | getUserLoginFacotryList() |
| | | // 启动通知状态定时器 |
| | | startStatusTimer() |
| | | // getNoticesCount() |
| | | }); |
| | | onShow(()=>{ |
| | | getNoticesCount() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | |
| | | letter-spacing: 0.03125rem; |
| | | text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5); |
| | | } |
| | | .hero-subtitle { font-size: 0.8125rem; margin-top: 0.375rem; } |
| | | .hero-wave { height: 2.75rem; } |
| | | |
| | | .hero-subtitle { |
| | | font-size: 0.8125rem; |
| | | margin-top: 0.375rem; |
| | | } |
| | | |
| | | .hero-wave { |
| | | height: 2.75rem; |
| | | } |
| | | |
| | | .hero-subtitle { |
| | | color: rgba(255, 255, 255, 0.9); |
| | |
| | | 0% { |
| | | transform: translateX(-100%) translateY(-100%) rotate(45deg); |
| | | } |
| | | |
| | | 100% { |
| | | transform: translateX(100%) translateY(100%) rotate(45deg); |
| | | } |
| | |
| | | opacity: 0; |
| | | transform: translateY(-1.25rem); |
| | | } |
| | | |
| | | to { |
| | | opacity: 1; |
| | | transform: translateY(0); |
| | |
| | | opacity: 0; |
| | | transform: translateY(1.25rem); |
| | | } |
| | | |
| | | to { |
| | | opacity: 1; |
| | | transform: translateY(0); |
| | |
| | | } |
| | | |
| | | @keyframes fadeInScale { |
| | | 0% { opacity: 0; transform: translateY(0.5rem) scale(0.96); } |
| | | 100% { opacity: 1; transform: translateY(0) scale(1); } |
| | | 0% { |
| | | opacity: 0; |
| | | transform: translateY(0.5rem) scale(0.96); |
| | | } |
| | | |
| | | 100% { |
| | | opacity: 1; |
| | | transform: translateY(0) scale(1); |
| | | } |
| | | } |
| | | |
| | | .notice-content { |
| | |
| | | .content { |
| | | background: linear-gradient(135deg, #121317 0%, #161a20 100%); |
| | | } |
| | | |
| | | .content::before { |
| | | background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255, 255, 255, 0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>'); |
| | | } |
| | | |
| | | .common-module { |
| | | background: linear-gradient(135deg, #1e1f24 0%, #23252b 100%); |
| | | box-shadow: 0 0.375rem 1.5rem rgba(0,0,0,0.35); |
| | | } |
| | | |
| | | .module-title { |
| | | color: #e9edf3; |
| | | } |
| | | .module-subtitle, .item-label, .notice-text, .notice-unit, .notice-label { |
| | | |
| | | .module-subtitle, |
| | | .item-label, |
| | | .notice-text, |
| | | .notice-unit, |
| | | .notice-label { |
| | | color: #c7cbd3; |
| | | } |
| | | |
| | | .notice { |
| | | background: linear-gradient(135deg, #1b2330 0%, #1a2432 100%); |
| | | border-color: rgba(255,255,255,0.06); |
| | | box-shadow: 0 0.375rem 1.25rem rgba(0,0,0,0.4); |
| | | } |
| | | .notice-status, .notice-number { |
| | | |
| | | .notice-status, |
| | | .notice-number { |
| | | color: #8ab4ff; |
| | | } |
| | | |
| | | .bg-img { |
| | | background: linear-gradient(135deg, #1f4fb9 0%, #0e3a8a 100%); |
| | | } |
| | | } |
| | | |
| | | @keyframes rotate { |
| | | from { transform: rotate(0deg); } |
| | | to { transform: rotate(360deg); } |
| | | from { |
| | | transform: rotate(0deg); |
| | | } |
| | | |
| | | to { |
| | | transform: rotate(360deg); |
| | | } |
| | | } |
| | | |
| | | @keyframes fadeInDown { |
| | | from { opacity: 0; transform: translateY(-1.25rem); } |
| | | to { opacity: 1; transform: translateY(0); } |
| | | from { |
| | | opacity: 0; |
| | | transform: translateY(-1.25rem); |
| | | } |
| | | |
| | | to { |
| | | opacity: 1; |
| | | transform: translateY(0); |
| | | } |
| | | } |
| | | |
| | | @keyframes fadeInUp { |
| | | from { opacity: 0; transform: translateY(1.25rem); } |
| | | to { opacity: 1; transform: translateY(0); } |
| | | from { |
| | | opacity: 0; |
| | | transform: translateY(1.25rem); |
| | | } |
| | | |
| | | to { |
| | | opacity: 1; |
| | | transform: translateY(0); |
| | | } |
| | | } |
| | | |
| | | @keyframes fadeInScale { |
| | | 0% { opacity: 0; transform: translateY(0.5rem) scale(0.96); } |
| | | 100% { opacity: 1; transform: translateY(0) scale(1); } |
| | | 0% { |
| | | opacity: 0; |
| | | transform: translateY(0.5rem) scale(0.96); |
| | | } |
| | | |
| | | .notice-left { margin-right: 1rem; } |
| | | .notice-status { font-size: 1rem; } |
| | | .notice-separator { width: 0.0625rem; height: 1.5rem; margin-right: 1rem; } |
| | | .notice-label { font-size: 0.875rem; margin-right: 0.75rem; } |
| | | .notice-text { font-size: 0.875rem; } |
| | | .notice-number { font-size: 1rem; margin-left: 0.25rem; } |
| | | .notice-unit { font-size: 0.875rem; margin-left: 0.125rem; } |
| | | 100% { |
| | | opacity: 1; |
| | | transform: translateY(0) scale(1); |
| | | } |
| | | } |
| | | |
| | | .notice-left { |
| | | margin-right: 1rem; |
| | | } |
| | | |
| | | .notice-status { |
| | | font-size: 1rem; |
| | | } |
| | | |
| | | .notice-separator { |
| | | width: 0.0625rem; |
| | | height: 1.5rem; |
| | | margin-right: 1rem; |
| | | } |
| | | |
| | | .notice-label { |
| | | font-size: 0.875rem; |
| | | margin-right: 0.75rem; |
| | | } |
| | | |
| | | .notice-text { |
| | | font-size: 0.875rem; |
| | | } |
| | | |
| | | .notice-number { |
| | | font-size: 1rem; |
| | | margin-left: 0.25rem; |
| | | } |
| | | |
| | | .notice-unit { |
| | | font-size: 0.875rem; |
| | | margin-left: 0.125rem; |
| | | } |
| | | |
| | | .common-module { |
| | | margin-bottom: 1.5rem; |
| | |
| | | } |
| | | } |
| | | |
| | | .item-label { font-size: 0.8125rem; margin-top: 0.25rem; margin-bottom: 0.625rem; } |
| | | .grid-text { font-size: 0.875rem; } |
| | | .item-label { |
| | | font-size: 0.8125rem; |
| | | margin-top: 0.25rem; |
| | | margin-bottom: 0.625rem; |
| | | } |
| | | |
| | | .grid-text { |
| | | font-size: 0.875rem; |
| | | } |
| | | |
| | | @media (prefers-color-scheme: dark) { |
| | | .common-module { box-shadow: 0 0.375rem 1.5rem rgba(0,0,0,0.35); } |
| | | .notice { box-shadow: 0 0.375rem 1.25rem rgba(0,0,0,0.4); } |
| | | .common-module { |
| | | box-shadow: 0 0.375rem 1.5rem rgba(0, 0, 0, 0.35); |
| | | } |
| | | |
| | | .notice { |
| | | box-shadow: 0 0.375rem 1.25rem rgba(0, 0, 0, 0.4); |
| | | } |
| | | } |
| | | </style> |