|
@@ -114,7 +114,19 @@
|
|
|
<!-- 图表 end-->
|
|
|
|
|
|
<!-- 轮播图 开始 -->
|
|
|
- <u-swiper :list="arrayList.swiperList" indicator indicatorMode="line" radius="0" height="160" circular> </u-swiper>
|
|
|
+ <u-swiper
|
|
|
+ v-if="arrayList.swiperBool"
|
|
|
+ :list="arrayList.swiperList"
|
|
|
+ :interval="arrayList.swiperTime"
|
|
|
+ indicator
|
|
|
+ indicatorMode="line"
|
|
|
+ radius="0"
|
|
|
+ height="160"
|
|
|
+ circular
|
|
|
+ @click="swiperClick"
|
|
|
+ @change="swiperChange"
|
|
|
+ >
|
|
|
+ </u-swiper>
|
|
|
<!-- 轮播图 结束 -->
|
|
|
|
|
|
<!-- 宫格列表 -->
|
|
@@ -162,7 +174,7 @@ import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance } from
|
|
|
import useStores from "@/store/modules/user.js";
|
|
|
import publicStore from "@/store/modules/public";
|
|
|
|
|
|
-import { scan_push, getHomePageData, getFunctionalModuleStatistics, getAppRouters, qrCodeSend } from "@/api/index";
|
|
|
+import { scan_push, getHomePageData, getFunctionalModuleStatistics, getAppRouters, qrCodeSend, getMobileBanner } from "@/api/index";
|
|
|
|
|
|
const useStore = useStores();
|
|
|
const publicStores = publicStore(); //全局公共Store
|
|
@@ -183,11 +195,83 @@ const arrayList = reactive({
|
|
|
selectedCode: 10012,
|
|
|
codeResult: "",
|
|
|
|
|
|
- swiperList: ["../static/images/index/banner1.png", "../static/images/index/banner2.jpg", "../static/images/index/banner3.jpg"],
|
|
|
+ swiperBool: true,
|
|
|
+ swiperIndex: 0,
|
|
|
+ swiperTime: 5000,
|
|
|
+ swiperList: [
|
|
|
+ {
|
|
|
+ url: "../static/images/index/banner1.png",
|
|
|
+ link: "https://www.baidu.com/",
|
|
|
+ linkType: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: "../static/images/index/banner2.jpg",
|
|
|
+ link: "",
|
|
|
+ linkType: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: "../static/images/index/banner3.jpg",
|
|
|
+ link: "",
|
|
|
+ linkType: 1,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+
|
|
|
// cuIconList: json.cuIconList,
|
|
|
recentlyUsed: [],
|
|
|
});
|
|
|
|
|
|
+/**
|
|
|
+ * @获取轮播图下标
|
|
|
+ * @change事件
|
|
|
+ */
|
|
|
+function swiperChange(e) {
|
|
|
+ arrayList.swiperIndex = e.current;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @轮播图点击事件
|
|
|
+ */
|
|
|
+function swiperClick(list) {
|
|
|
+ if (list instanceof Object) {
|
|
|
+ let linkType = arrayList.swiperList[arrayList.swiperIndex].linkType;
|
|
|
+ let url = arrayList.swiperList[arrayList.swiperIndex].link;
|
|
|
+
|
|
|
+ if (url) {
|
|
|
+ if (linkType == 1) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: url,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/common/webview/index?url=" + url,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function getMobileBannerApi() {
|
|
|
+ getMobileBanner({
|
|
|
+ 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],
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
onLoad((option) => {
|
|
|
//获取首页标题
|
|
|
if (uni.getStorageSync("homeTitle")) {
|
|
@@ -219,32 +303,14 @@ onLoad((option) => {
|
|
|
// });
|
|
|
|
|
|
getAppRoutersData();
|
|
|
+
|
|
|
+ getMobileBannerApi();
|
|
|
});
|
|
|
|
|
|
async function init() {
|
|
|
window.location.href = BASE_URL + "Com/getPageAuthorization1";
|
|
|
}
|
|
|
|
|
|
-//微信扫码
|
|
|
-function scanQRCode() {
|
|
|
- // scanCode();
|
|
|
- jwx.configWeiXin((jweixin) => {
|
|
|
- jweixin.scanQRCode({
|
|
|
- needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
|
|
- scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
|
|
|
- success: function (res) {
|
|
|
- setTimeout(function () {
|
|
|
- /* 放1000ms后执行的代码 */
|
|
|
- alert(res.resultStr);
|
|
|
- getCodeResult({
|
|
|
- ercode: res.resultStr,
|
|
|
- });
|
|
|
- }, 1000);
|
|
|
- },
|
|
|
- });
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
//APP扫码
|
|
|
function scanCode() {
|
|
|
uni.scanCode({
|
|
@@ -270,7 +336,24 @@ function scanCode() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-// 扫码成功后请求
|
|
|
+//微信扫码
|
|
|
+function scanQRCode() {
|
|
|
+ jwx.configWeiXin((jweixin) => {
|
|
|
+ jweixin.scanQRCode({
|
|
|
+ needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
|
|
+ scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
|
|
|
+ success: function (res) {
|
|
|
+ setTimeout(function () {
|
|
|
+ getCodeResult({
|
|
|
+ ercode: res.resultStr,
|
|
|
+ });
|
|
|
+ }, 1000);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+//微信扫码成功后请求
|
|
|
async function getCodeResult(param = {}) {
|
|
|
scan_push(param).then((res) => {
|
|
|
if (res.data.flag) {
|
|
@@ -295,7 +378,7 @@ function getLocation() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-// 九宫格页面跳转
|
|
|
+//九宫格页面跳转
|
|
|
function navItemClick(item) {
|
|
|
if (item.path) {
|
|
|
item.sort = 0;
|
|
@@ -379,8 +462,6 @@ function getAppRoutersData() {
|
|
|
// domain :'172.16.120.165:13201'
|
|
|
// domain :'172.16.120.165:13203'
|
|
|
}).then((res) => {
|
|
|
- console.log(res.data);
|
|
|
-
|
|
|
res.data.forEach((el) => {
|
|
|
// const modules = import.meta.glob("@/static/icons/*.svg");
|
|
|
el.meta.icon = `/static/icons/index/${el.meta.icon}.svg`;
|
|
@@ -391,7 +472,7 @@ function getAppRoutersData() {
|
|
|
}
|
|
|
|
|
|
//echarts图表请求
|
|
|
-async function getHomeData(param = {}) {
|
|
|
+function getHomeData(param = {}) {
|
|
|
getHomePageData(param).then((res) => {
|
|
|
// console.log('首页请求staticData')
|
|
|
// console.log(res.data.data[0])
|
|
@@ -437,7 +518,7 @@ async function getHomeData(param = {}) {
|
|
|
}
|
|
|
|
|
|
// 未处理告警请求
|
|
|
-async function getHandleData(param = {}) {
|
|
|
+function getHandleData(param = {}) {
|
|
|
getFunctionalModuleStatistics(param).then((res) => {
|
|
|
arrayList.cuIconList[0].badge = res.data.data[0].comprehensive_alarm_count;
|
|
|
arrayList.cuIconList[2].badge = res.data.data[0].fire_brigade_inspector_count;
|