| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376 |
- <template>
- <bgImg />
- <view class="container">
- <view class="nav">
- <view class="slid">
- <swiper class="swiper" circular :indicator-dots="true" :autoplay="true" interval="2000" duration="500">
- <swiper-item v-for="(item, index) in state.slidImg" :key="index">
- <image :src="item" mode="" style="width: 100%;height: 100%;"></image>
- </swiper-item>
- </swiper>
- </view>
- </view>
- <!-- 公告 -->
- <view class="notices">
- <view class="title">
- <image src="@/static/SVG/公告资讯.svg" style="width: 70rpx;height: 70rpx;" mode=""></image>
- </view>
- <view class="news">
- <view class="btn" v-for="(item, index) in state.noticeList" :key="index">最新</view>
- </view>
- <view class="box">
- <view class="bar" v-for="(item, index) in state.noticeList" :key="index">
- <up-notice-bar icon='' bgColor="white" color="black" :text="changeContent(item)"></up-notice-bar>
- </view>
- </view>
- </view>
- <uni-section title="决策支持" titleColor="#038CFF" type="line" :padding="false">
- <view class="board">
- <view class="box">
- <view class="text">管理驾驶舱</view>
- <image src="@/static/SVG/智能驾驶舱.svg" style="width: 100%;height: 100%;" mode=""></image>
- </view>
- <view class="box">
- <view class="text">全景图</view>
- <image src="@/static/SVG/数据看板.svg" style="width: 100%;height: 100%;" mode=""></image>
- </view>
- </view>
- </uni-section>
- <uni-section title="营销赋能" titleColor="#038CFF" type="line" :padding="false">
- <uni-grid :column="4" :showBorder="false" :highlight="true">
- <uni-grid-item>
- <view class="grid-item-box">
- <image src="@/static/SVG/进销存分析.svg" class="img" mode=""></image>
- <text class="text">进销存分析</text>
- </view>
- </uni-grid-item>
- <uni-grid-item>
- <view class="grid-item-box">
- <image src="@/static/SVG/客户分析.svg" class="img" mode=""></image>
- <text class="text">客户分析</text>
- </view>
- </uni-grid-item>
- <uni-grid-item>
- <view class="grid-item-box">
- <image src="@/static/SVG/订单分析.svg" class="img" mode=""></image>
- <text class="text">订单分析</text>
- </view>
- </uni-grid-item>
- <uni-grid-item>
- <view class="grid-item-box">
- <image src="@/static/SVG/活动赋能.svg" class="img" mode=""></image>
- <text class="text">活动赋能</text>
- </view>
- </uni-grid-item>
- <uni-grid-item>
- <view class="grid-item-box">
- <image src="@/static/SVG/终端概览.svg" class="img" mode=""></image>
- <text class="text">客户档案</text>
- </view>
- </uni-grid-item>
- <uni-grid-item>
- <view class="grid-item-box">
- <image src="@/static/城市纯销.png" class="img" mode=""></image>
- <text class="text">城市纯销</text>
- </view>
- </uni-grid-item>
- </uni-grid>
- </uni-section>
- <uni-section title="智能预警" titleColor="#038CFF" type="line" :padding="false">
- <uni-grid :column="4" :showBorder="false" :highlight="true">
- <uni-grid-item>
- <view class="grid-item-box">
- <image src="@/static/SVG/客户库存预警.svg" class="img" mode=""></image>
- <text class="text">客户库存预警</text>
- </view>
- </uni-grid-item>
- <uni-grid-item>
- <view class="grid-item-box">
- <image src="@/static/SVG/客户风险预警.svg" class="img" mode=""></image>
- <text class="text">渠道风险预警</text>
- </view>
- </uni-grid-item>
- </uni-grid>
- </uni-section>
- <uni-section title="鱼跃龙门" titleColor="#038CFF" type="line" :padding="false">
- <uni-grid :column="4" :showBorder="false" :highlight="true">
- <uni-grid-item>
- <view class="grid-item-box" @click="goScan">
- <view class="img-box">
- <image src="@/static/scan.png" class="img" mode=""></image>
- </view>
- <text class="text">溯源扫码</text>
- </view>
- </uni-grid-item>
- <uni-grid-item>
- <view class="grid-item-box" @click="goReport">
- <view class="img-box">
- <image src="@/static/report.png" class="img" mode=""></image>
- </view>
- <text class="text">溯源报表</text>
- </view>
- </uni-grid-item>
- </uni-grid>
- </uni-section>
- <view style="height: 140rpx;"></view>
- </view>
- </template>
- <script setup>
- import useCounterStore from '@/stores/counter.js';
- import {
- ref,
- getCurrentInstance,
- reactive,
- onMounted
- } from 'vue';
- import {
- onReady,
- onShow,
- onLoad
- } from '@dcloudio/uni-app'
- import {
- Storage
- } from '@/service/storage'
- const storage = new Storage()
- const {
- proxy
- } = getCurrentInstance()
- const counterStore = useCounterStore()
- const menu = reactive({
- menu: uni.getStorageSync('menu').menu
- })
- const changeContent = (e) => {
- const isoDateString = e.msgDate;
- const date = new Date(isoDateString);
- const year = date.getFullYear();
- const month = String(date.getMonth() + 1).padStart(2, '0');
- const day = String(date.getDate()).padStart(2, '0');
- const formattedDate = `${year}-${month}-${day}`;
- let data = formattedDate + ' ' + e.msgContent.replace(/\n/g, ' ')
- return data
- }
- const state = reactive({
- noticeList: [],
- slideId: [],
- slidImg: []
- })
- onMounted(() => {
- const baseUrl = import.meta.env.VITE_APP_API_BASEURL
- const accessToken = uni.getStorageSync('accessToken')
- uni.request({
- url: baseUrl + '/v1/api/basic/home/menu?type=3',
- method: 'GET',
- header: {
- accessToken
- },
- success: (res) => {
- console.log(res)
- },
- fail(res) {
- console.log(res)
- }
- })
- getUserInfo()
- })
- const getUserInfo = async () => {
- let res = await proxy.$api.login.getInfo()
- uni.setStorageSync('userInfo', res.data)
- }
- const skip = (url) => {
- let posn = uni.getStorageSync('userInfo').posn
- uni.navigateTo({
- url
- })
- }
- // 跳转溯源扫码
- const goScan = () => {
- uni.navigateTo({
- url: '/packages/traceabilityCodeQuery/pages/index'
- })
- }
- // 跳转溯源报表
- const goReport = () => {
- uni.navigateTo({
- url: "/packages/traceabilityReport/pages/index",
- });
- }
- </script>
- <style lang="scss" scoped>
- .container {
- position: absolute;
- width: 750rpx;
- top: 150rpx;
- z-index: -1;
- }
- .board {
- width: 95%;
- height: 170rpx;
- // background-color: red;
- margin: auto;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .box {
- width: 332rpx;
- height: 165rpx;
- // background-color: green;
- border-radius: 20rpx;
- position: relative;
- .text {
- position: absolute;
- top: 40rpx;
- left: 30rpx;
- color: #FFFFFF;
- }
- }
- }
- .nav {
- width: 100%;
- padding-top: 20rpx;
- padding-bottom: 5rpx;
- background-color: transparent;
- .slid {
- width: 690rpx;
- height: 294rpx;
- margin: 30rpx auto;
- position: relative;
- }
- }
- .notices {
- width: 690rpx;
- height: 122rpx;
- margin: 0rpx auto;
- background-color: white;
- border-radius: 15rpx;
- box-shadow: 5rpx 5rpx 20rpx rgba(0, 0, 0, 0.2);
- display: flex;
- align-items: center;
- justify-content: space-evenly;
- .news {
- width: 12%;
- height: 100%;
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- justify-content: center;
- }
- .title {
- width: 18%;
- height: 100%;
- text-align: center;
- display: flex;
- flex-wrap: wrap;
- justify-content: center;
- align-items: center;
- font-weight: bold;
- }
- .btn {
- background-color: #fef0ef;
- width: 100%;
- height: 50rpx;
- color: #ec204c;
- font-size: 25rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 5rpx;
- }
- .box {
- width: 70%;
- height: 100%;
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- position: relative;
- .bar {
- width: 100%;
- height: 45rpx;
- display: flex;
- align-items: center;
- overflow: hidden;
- }
- }
- }
- .grid-item-box {
- flex: 1;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex-direction: column;
- align-items: center;
- justify-content: center;
- background-color: #fff;
- .img {
- width: 76rpx;
- height: 76rpx;
- }
- .text {
- font-size: 27rpx;
- margin-top: 5px;
- }
- .img-box {
- width: 76rpx;
- height: 76rpx;
- border-radius: 50%;
- background-color: #379AFF;
- display: flex;
- align-items: center;
- justify-content: center;
- .img {
- width: 40rpx;
- height: 40rpx;
- }
- }
- }
- </style>
|