From 40711118c33369ccad7ceda0fdd729bd9f117f65 Mon Sep 17 00:00:00 2001 From: loulijun2021 <1694218219@qq.com> Date: 星期六, 22 十月 2022 14:03:11 +0800 Subject: [PATCH] 1.安灯响应静态实现 --- pages/xtsy/index.html | 98 ++++++++++++++++++++++++++++++++----------------- 1 files changed, 64 insertions(+), 34 deletions(-) diff --git a/pages/xtsy/index.html b/pages/xtsy/index.html index 677e88d..619fb75 100644 --- a/pages/xtsy/index.html +++ b/pages/xtsy/index.html @@ -20,8 +20,19 @@ <script type="text/javascript" src="../../js/http.js"></script> <script type="text/javascript" src="../../js/global.js"></script> + + - <script type="text/javascript" src="../../js/global.css"></script> + <!-- <script src="http://121.196.36.24:8001/Scripts/jquery-3.4.1.min.js"></script> + <script src="http://121.196.36.24:8001/Scripts/jquery.signalR-2.2.2.min.js"></script> + <script src="http://121.196.36.24:8001/SignalR/Hubs"></script> --> + + <script src="../../js/jquery-3.4.1.min.js"></script> + <script src="../../js/jquery.signalR-2.2.2.min.js"></script> + <script src="../../js/Hubs.js"></script> + <script type="text/javascript" src="../../js/msg.js"></script> + + </head> <body> @@ -77,34 +88,36 @@ </van-nav-bar> + <van-pull-refresh v-model="isLoading" @refresh="onRefresh"> + <van-swipe :autoplay="3000"> + <van-swipe-item v-for="(image, index) in images" :key="index"> + <img v-lazy="image" :src='image' style="background-size: 100% 100%;width: 100%;" /> + </van-swipe-item> + </van-swipe> - <van-swipe :autoplay="3000"> - <van-swipe-item v-for="(image, index) in images" :key="index"> - <img v-lazy="image" :src='image' style="background-size: 100% 100%;width: 100%;" /> - </van-swipe-item> - </van-swipe> - - <van-grid :gutter="20" :border='false' square :column-num="3" style="margin: 30px auto 0; width: 90%;"> - <van-grid-item v-for="item in firstMenu" @click='vanGridItem(item)' :key="item" :text="item.name"> - <img :src="item.imgurl" alt="" - style="width: 56px;height:56px;margin-top: 10px;border-radius: 10px;"> - <div style="margin-top: 5px;font-size: 14px;color: #929399;">{{item.name}}</div> - </van-grid-item> - </van-grid> - - <van-action-sheet lazy-render :closeable='false' close-on-click-action close-on-click-overlay - safe-area-inset-bottom v-model="sheetShow" :title="firstMenuName"> - <van-grid :border='false' :gutter="5" square :column-num="3" style="width: 80%; margin: auto;"> - <van-grid-item v-for="item in secondMenu" @click='vanGridSecondItem(item)' :key="item" - icon="photo-o"> + <van-grid :gutter="20" :border='false' square :column-num="3" + style="margin: 30px auto 0; width: 90%;"> + <van-grid-item v-for="item in firstMenu" @click='vanGridItem(item)' :key="item" + :text="item.name"> <img :src="item.imgurl" alt="" - style="width: 48px;height:48px;margin-top: 10px;border-radius: 10px;"> - <div style="margin-top: 5px;font-size: 12px;color: #929399;">{{item.name}}</div> + style="width: 56px;height:56px;margin-top: 10px;border-radius: 10px;"> + <div style="margin-top: 5px;font-size: 14px;color: #929399;">{{item.name}}</div> </van-grid-item> </van-grid> - </van-action-sheet> - </div> + <van-action-sheet lazy-render :closeable='false' close-on-click-action close-on-click-overlay + safe-area-inset-bottom v-model="sheetShow" :title="firstMenuName"> + <van-grid :border='false' :gutter="5" square :column-num="3" style="width: 80%; margin: auto;"> + <van-grid-item v-for="item in secondMenu" @click='vanGridSecondItem(item)' :key="item" + icon="photo-o"> + <img :src="item.imgurl" alt="" + style="width: 48px;height:48px;margin-top: 10px;border-radius: 10px;"> + <div style="margin-top: 5px;font-size: 12px;color: #929399;">{{item.name}}</div> + </van-grid-item> + </van-grid> + </van-action-sheet> + </div> + </van-pull-refresh> <van-overlay :show="overlayShow" @click="overlayShow=false" /> @@ -116,6 +129,7 @@ el: '#app', data: function() { return { + isLoading: false, //涓嬫媺鍒锋柊 images: [ '../../static/images/swiper01.png', '../../static/images/swiper02.png', @@ -149,23 +163,39 @@ }, mounted() { this.getfirstMenu() + this.getLoginAppAnDonMessage() + setInterval(() => { + this.getLoginAppAnDonMessage() + }, 1000 * 10) + }, methods: { + onRefresh() { + setTimeout(() => { + vant.Toast('鍒锋柊鎴愬姛'); + this.getfirstMenu() + this.getLoginAppAnDonMessage() + // vant.Notify('鍒锋柊鎴愬姛'); + this.isLoading = false; + + }, 1000); + }, + // 鑾峰彇娑堟伅鎺ュ彛 - async getLoginAppAnDonMessage(){ - const data={ - userid:localStorage.getItem('userid'), - usercode:localStorage.getItem('usercode'), - username:localStorage.getItem('username'), - usertype:localStorage.getItem('usertype'), + async getLoginAppAnDonMessage() { + const data = { + userid: localStorage.getItem('userid'), + usercode: localStorage.getItem('usercode'), + username: localStorage.getItem('username'), + usertype: localStorage.getItem('usertype'), } - - const res=await post('Login/LoginAppAnDonMessage'+formatParams(data)) - this.messageNumber=res.data.length + + const res = await post('Login/LoginAppAnDonMessage' + formatParams(data)) + this.messageNumber = res.data.length // this.messageNumber=9 }, - + // 鑾峰彇涓�绾ц彍鍗� async getfirstMenu() { const data = { -- Gitblit v1.9.3