|
@@ -23,7 +23,7 @@
|
|
|
<!-- <u-loadmore :status="arrayList.loadStatus" loadingText="" loadmoreText="" :icon="true" /> -->
|
|
|
<view class="uni-content-body">
|
|
|
<!-- 下拉列表 开始 -->
|
|
|
- <u-transition :show="arrayList.dialogFlag" :duration="200" mode="fade">
|
|
|
+ <u-transition :show="dialogFlag" :duration="200" mode="fade">
|
|
|
<view class="transition" @click="rightButtonClick()">
|
|
|
<view class="transition-section" :style="{ top: proxy.$settingStore.barHightTop }">
|
|
|
<view class="transition-section-content" @click="scanCode()">
|
|
@@ -41,27 +41,12 @@
|
|
|
<!-- 下拉列表 结束 -->
|
|
|
|
|
|
<!-- 轮播图 开始 -->
|
|
|
- <u-swiper
|
|
|
- v-if="arrayList.swiperBool"
|
|
|
- :list="arrayList.swiperList"
|
|
|
- :interval="arrayList.swiperTime"
|
|
|
- indicator
|
|
|
- indicatorMode="line"
|
|
|
- radius="0"
|
|
|
- height="160"
|
|
|
- circular
|
|
|
- @click="swiperClick"
|
|
|
- @change="swiperChange"
|
|
|
- :displayMultipleItems="6"
|
|
|
- >
|
|
|
- </u-swiper>
|
|
|
-
|
|
|
- <image v-if="!arrayList.swiperBool" src="@/static/images/index/banner1.png" style="width: 100%; height: 160px"></image>
|
|
|
+ <u-swiper :list="swiperList" :interval="swiperTime" indicatorMode="line" radius="0" height="160" indicator circular keyName="url" @click="swiperClick" @change="swiperChange"> </u-swiper>
|
|
|
|
|
|
<view class="app-info-notice bg-white radius shadow-default margin-lr-sm margin-bottom-sm">
|
|
|
<view class="flex">
|
|
|
<view class="info-title text-df">综合智慧云</view>
|
|
|
- <view class="info-time text-sm">03-21 19:23</view>
|
|
|
+ <view class="info-time text-sm">07-25 19:23</view>
|
|
|
</view>
|
|
|
<view class="info-content text-sm">综合智慧云app,助力企业数字化转型升级,超多业务功能,全新部署上线,操作简单流畅...</view>
|
|
|
</view>
|
|
@@ -69,10 +54,10 @@
|
|
|
<!-- 轮播图 结束 -->
|
|
|
|
|
|
<!-- 宫格列表 -->
|
|
|
- <view class="section2 section bg-white margin-bottom-sm" v-if="arrayList.recentlyUsed.length > 0">
|
|
|
+ <view class="section2 section bg-white margin-bottom-sm" v-if="recentlyUsed.length > 0">
|
|
|
<view style="color: #000000; font-size: 14px; padding: 10px 10px 5px 10px">最近使用</view>
|
|
|
<view class="cu-list grid col-5 no-border">
|
|
|
- <view class="cu-item justify-center align-center" @tap="navItemClick(item)" v-for="(item, index) in arrayList.recentlyUsed.slice(0, 5)" :key="index">
|
|
|
+ <view class="cu-item justify-center align-center" @tap="navItemClick(item)" v-for="(item, index) in recentlyUsed.slice(0, 5)" :key="index">
|
|
|
<image :src="item.meta.icon" style="width: 40px; height: 40px"></image>
|
|
|
<!-- <view class="cu-tag badge" v-if="item.badge != 0">
|
|
|
<block v-if="item.badge != 0">{{ item.badge > 99 ? "99+" : item.badge }}</block>
|
|
@@ -87,7 +72,7 @@
|
|
|
<view class="section2 section bg-white">
|
|
|
<view style="color: #000000; font-size: 14px; padding: 10px 10px 5px 10px">常用功能</view>
|
|
|
<view class="cu-list grid col-5 no-border">
|
|
|
- <view class="cu-item justify-center align-center" @tap="navItemClick(item)" v-for="(item, index) in arrayList.cuIconList" :key="index">
|
|
|
+ <view class="cu-item justify-center align-center" @tap="navItemClick(item)" v-for="(item, index) in cuIconList" :key="index">
|
|
|
<image :src="item.meta.icon" style="width: 40px; height: 40px"></image>
|
|
|
<!-- <view class="cu-tag badge" v-if="item.badge != 0">
|
|
|
<block v-if="item.badge != 0">{{ item.badge > 99 ? "99+" : item.badge }}</block>
|
|
@@ -109,7 +94,7 @@ import searchSelect from "@/components/searchSelect/searchSelect.vue";
|
|
|
import * as jwx from "@/utils/jssdk.js"; //引入js sdk的封装
|
|
|
|
|
|
import { onReady, onLoad, onShow, onNavigationBarButtonTap, onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app";
|
|
|
-import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance } from "vue";
|
|
|
+import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance, toRefs } from "vue";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import { useStores, publicStores } from "@/store/modules/index";
|
|
|
|
|
@@ -128,16 +113,18 @@ const arrayList = reactive({
|
|
|
swiperTime: 5000,
|
|
|
swiperList: [],
|
|
|
|
|
|
- // cuIconList: proxy.$grid.cuIconList,
|
|
|
+ cuIconList: [],
|
|
|
recentlyUsed: [],
|
|
|
});
|
|
|
|
|
|
+const { dialogFlag, swiperBool, swiperIndex, swiperTime, swiperList, cuIconList, recentlyUsed } = toRefs(arrayList);
|
|
|
+
|
|
|
/**
|
|
|
* @获取轮播图下标
|
|
|
* @change事件
|
|
|
*/
|
|
|
function swiperChange(e) {
|
|
|
- arrayList.swiperIndex = e.current;
|
|
|
+ swiperIndex.value = e.current;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -145,8 +132,8 @@ function swiperChange(e) {
|
|
|
*/
|
|
|
function swiperClick(list) {
|
|
|
if (typeof list == "object") {
|
|
|
- let linkType = arrayList.swiperList[arrayList.swiperIndex].linkType;
|
|
|
- let url = arrayList.swiperList[arrayList.swiperIndex].link;
|
|
|
+ let linkType = swiperList.value[swiperIndex.value].linkType;
|
|
|
+ let url = swiperList.value[swiperIndex.value].link;
|
|
|
|
|
|
if (url) {
|
|
|
if (linkType == 1) {
|
|
@@ -171,18 +158,30 @@ function getMobileBannerApi() {
|
|
|
tenantId: useStore.$state.tenantId,
|
|
|
}).then((res) => {
|
|
|
if (res.data.length > 0) {
|
|
|
- arrayList.swiperList = [];
|
|
|
- arrayList.swiperBool = res.data[0].openNot == 1 ? true : false;
|
|
|
- arrayList.swiperTime = res.data[0].carouselTime * 1000;
|
|
|
-
|
|
|
- for (let i = 1; i <= 5; i++) {
|
|
|
- if (res.data[0]["bannerPath" + i]) {
|
|
|
- arrayList.swiperList.push({
|
|
|
- url: res.data[0]["bannerPath" + i],
|
|
|
- link: res.data[0]["linkUrl" + i],
|
|
|
- linkType: res.data[0]["linkType" + i],
|
|
|
- });
|
|
|
+ swiperList.value = [];
|
|
|
+ swiperBool.value = res.data[0].openNot == 1 ? true : false;
|
|
|
+ swiperTime.value = res.data[0].carouselTime * 1000;
|
|
|
+
|
|
|
+ if (swiperBool.value) {
|
|
|
+ for (let i = 1; i <= 5; i++) {
|
|
|
+ if (res.data[0]["bannerPath" + i]) {
|
|
|
+ swiperList.value.push({
|
|
|
+ url: res.data[0]["bannerPath" + i],
|
|
|
+ link: res.data[0]["linkUrl" + i],
|
|
|
+ linkType: res.data[0]["linkType" + i],
|
|
|
+ type: "image",
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
+ } else {
|
|
|
+ swiperList.value = [
|
|
|
+ {
|
|
|
+ url: "../static/images/index/banner1.png",
|
|
|
+ link: "",
|
|
|
+ linkType: 1,
|
|
|
+ type: "image",
|
|
|
+ },
|
|
|
+ ];
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -192,7 +191,7 @@ onLoad((option) => {
|
|
|
uni.hideTabBar(); //隐藏自带tabbar
|
|
|
|
|
|
if (uni.getStorageSync(useStore.$state.name + useStore.$state.tenantId)) {
|
|
|
- arrayList.recentlyUsed = uni.getStorageSync(useStore.$state.name + useStore.$state.tenantId);
|
|
|
+ recentlyUsed.value = uni.getStorageSync(useStore.$state.name + useStore.$state.tenantId);
|
|
|
}
|
|
|
|
|
|
getAppRoutersData();
|
|
@@ -269,23 +268,23 @@ function navItemClick(item) {
|
|
|
if (item.path) {
|
|
|
item.sort = 0;
|
|
|
|
|
|
- arrayList.recentlyUsed.push(item);
|
|
|
+ recentlyUsed.value.push(item);
|
|
|
|
|
|
- if (arrayList.recentlyUsed.length > 0) {
|
|
|
- arrayList.recentlyUsed = arrayList.recentlyUsed.filter((currentValue, currentIndex, selfArr) => {
|
|
|
+ if (recentlyUsed.value.length > 0) {
|
|
|
+ recentlyUsed.value = recentlyUsed.value.filter((currentValue, currentIndex, selfArr) => {
|
|
|
return selfArr.findIndex((x) => x.path === currentValue.path) === currentIndex;
|
|
|
});
|
|
|
|
|
|
- arrayList.recentlyUsed.filter((el) => {
|
|
|
+ recentlyUsed.value.filter((el) => {
|
|
|
if (el.path === item.path) {
|
|
|
el.sort++;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- arrayList.recentlyUsed = publicStore.sortEvent(arrayList.recentlyUsed, 1);
|
|
|
+ recentlyUsed.value = publicStore.sortEvent(recentlyUsed.value, 1);
|
|
|
|
|
|
- uni.setStorageSync(useStore.$state.name + useStore.$state.tenantId, arrayList.recentlyUsed);
|
|
|
+ uni.setStorageSync(useStore.$state.name + useStore.$state.tenantId, recentlyUsed.value);
|
|
|
|
|
|
if (item.path.indexOf("http") != -1) {
|
|
|
uni.navigateTo({
|
|
@@ -315,7 +314,7 @@ function navItemClick(item) {
|
|
|
*/
|
|
|
function rightButtonClick() {
|
|
|
console.log(1);
|
|
|
- arrayList.dialogFlag = !arrayList.dialogFlag;
|
|
|
+ dialogFlag.value = !dialogFlag.value;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -334,7 +333,7 @@ function getAppRoutersData() {
|
|
|
el.meta.icon = `/static/icons/index/${el.meta.icon}.svg`;
|
|
|
});
|
|
|
|
|
|
- arrayList.cuIconList = res.data;
|
|
|
+ cuIconList.value = res.data;
|
|
|
});
|
|
|
}
|
|
|
|