From eb72c032f2528fec972c4cc1c7008f135d6f3c33 Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期四, 17 七月 2025 08:28:43 +0800 Subject: [PATCH] 11 --- pages/BasePages/main.vue | 332 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 280 insertions(+), 52 deletions(-) diff --git a/pages/BasePages/main.vue b/pages/BasePages/main.vue index 776461d..9bd27f9 100644 --- a/pages/BasePages/main.vue +++ b/pages/BasePages/main.vue @@ -2,27 +2,24 @@ <uni-base-page :footer="false"> <view slot="page"> <view v-if="loginInfo.hasLogin"> - <!-- 鏁欏瑙嗛銆佸叕鍙稿唴閮ㄥ浼犲浘鐗囩瓑 --> -<!-- <swiper indicator-dots="true" :autoplay="true" :interval="3000">--> -<!-- <swiper-item v-for="(img,key) in imgUrls" :key="key">--> -<!-- <image :src="img"/>--> -<!-- </swiper-item>--> -<!-- </swiper>--> <!-- 閫氭姤鎵硅瘎銆佹秷鎭璀︺�佸叕鍛娿�佹姤鍛� --> <uni-notice-bar :show-icon="true" :scrollable="true" :speed="30" :single="true" - :text="msg"/> + :text="msg" class="notice-bar"></uni-notice-bar> <!-- 鐢ㄦ埛绯荤粺鑿滃崟妯″潡 --> <view class="example-body"> - <uni-grid :column="col" :showBorder="false"> + <view class="menu-header"> + <text class="menu-title">绯荤粺鍔熻兘</text> + <view class="decorative-line"></view> + </view> + <uni-grid :column="col" :showBorder="false" class="menu-grid"> <uni-grid-item v-for="(item, index) in userMenu" :index="index" :key="index" class="grid-item"> <navigator navigateTo class="grid-item-box" hover-class="none" :url="`../${item.path}`"> - <image v-if="item.icoimg" class="imgMenu" :src="`${item.icoimg}`"></image> - <image v-else class="imgMenu" src="/static/img/imgMenu/WARBAAHtml.png"></image> - <!-- <uni-notice-bar v-if="item.pagE_VIEW.length>6" :speed="30" - style="padding:0;margin-bottom:0;font-weight: 900;" textSize="13px" - background-color="#ffffff" color="#000000" :scrollable="item.pagE_VIEW.length>6" - :single="true" :text="item.pagE_VIEW"/>--> + <view class="icon-container"> + <image v-if="item.icoimg" class="imgMenu" :src="`${item.icoimg}`"></image> + <image v-else class="imgMenu default-icon" src="/static/img/imgMenu/WARBAAHtml.png"></image> + <view class="icon-badge" v-if="item.badge">{{ item.badge }}</view> + </view> <text class="text" style="text-align: center;padding:5px 0px 5px 0px">{{ item.pagE_VIEW }}</text> </navigator> </uni-grid-item> @@ -30,12 +27,17 @@ </view> </view> <view v-if="!loginInfo.hasLogin"> - <view class="title"> - 鎮ㄥソ 娓稿銆� - </view> - <view class="ul"> - <view>杩欐槸 XXMES 棣栭〉銆�</view> - <view>鍦� 鈥滄垜鐨勨�� 涓偣鍑� 鈥滅櫥褰曗�� 鍙互 鈥滅櫥褰曟偍鐨勮处鎴封��</view> + <view class="guest-container"> + <view class="title"> + 鎮ㄥソ锛屾父瀹€�� + </view> + <view class="ul"> + <view>杩欐槸 骞挎繁MES 棣栭〉銆�</view> + <view>鍦� 鈥滄垜鐨勨�� 涓偣鍑� 鈥滅櫥褰曗�� 鍙互 鈥滅櫥褰曟偍鐨勮处鎴封��</view> + </view> + <view class="login-prompt"> + <text class="login-note">鐧诲綍鍚庡彲璁块棶鍏ㄩ儴鍔熻兘</text> + </view> </view> </view> </view> @@ -47,7 +49,22 @@ data() { return { loginInfo: this.$loginInfo, - color: this.$defaultColor, + // 浼樺寲鍚庣殑涓婚棰滆壊鏂规锛屽鍔犲眰娆℃劅 + primaryColor: '#1677FF', + primaryLight: '#E6F7FF', + secondaryColor: '#36CFC9', + successColor: '#52C41A', + warningColor: '#FAAD14', + errorColor: '#F5222D', + // 涓�ц壊浼樺寲 + neutral1: '#FFFFFF', + neutral2: '#F7F8FA', + neutral3: '#E5E6EB', + neutral4: '#C9CDD4', + neutral5: '#86909C', + neutral6: '#4E5969', + neutral7: '#1F2329', + userMenu: [], imgUrls: [ "../../static/img/SN-GG.png", @@ -100,8 +117,63 @@ }); } }) + }, + checkForUpdate() { + this.$post({ + url: "/Login/getAppUpgradeInfo", + data: {} + }).then(res => { + + let newVersion = res.data.version; + let currentVersion = uni.getSystemInfoSync(); // 鑾峰彇褰撳墠 APK 鐗堟湰鍙� + + if (newVersion > currentVersion.appVersion) { + uni.showModal({ + title: "鍙戠幇鏂扮増鏈�", + content: "鏄惁涓嬭浇鏈�鏂扮増鏈�?", + success: (modalRes) => { + if (modalRes.confirm) { + this.downloadNewApk(res.data.apkUrl); + } + } + }); + this.updateChecked = true; // 鏍囪鏇存柊宸叉鏌ヨ繃 + } + }) + }, + + downloadNewApk(apkUrl) { + uni.showToast({ + title: "寮�濮嬩笅杞芥洿鏂�...", + icon: "none", + duration: 2000 + }); + + uni.downloadFile({ + url: apkUrl, + success: (res) => { + if (res.statusCode === 200) { + plus.runtime.install(res.tempFilePath, { + force: true + }, function() { + console.log("瀹夎鎴愬姛锛岄噸鍚簲鐢�"); + }, function(e) { + console.error("瀹夎澶辫触:", e); + }); + } + }, + fail: (err) => { + console.error("涓嬭浇澶辫触:", err); + uni.showToast({ + title: "涓嬭浇澶辫触锛岃妫�鏌ョ綉缁�", + icon: "none", + duration: 2000 + }); + } + }); } }, + onLoad() { if (!this.loginInfo.hasLogin) { uni.showModal({ @@ -130,9 +202,8 @@ }); } else { this.getMenu(true); + this.checkForUpdate(); } - - }, onShow() { this.getIsMsg(); @@ -140,60 +211,217 @@ onPullDownRefresh() { if (this.loginInfo.hasLogin) this.getMenu(true); - }, + } } </script> <style> +/* 鍏ㄥ眬鏍峰紡閲嶇疆 */ +page { + background-color: #F7F8FA; + color: #1F2329; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu; + display: flex; + flex-direction: column; + height: 100vh; +} + +/* 浼樺寲鍚庣殑鏂囨湰鏍峰紡 */ .text { - /* color: #ffffff; */ - /* font-size: 15px; */ - font-weight: 900; + font-weight: 500; + color: #4E5969; + font-size: 24rpx; + margin-top: 10rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .example-body { - flex-direction: row; - flex-wrap: wrap; - justify-content: center; - padding: 0; - font-size: 14px; - /* background-color: #ffffff; */ + padding: 30rpx; + flex: 1; + display: flex; + flex-direction: column; } + +/* 鑿滃崟澶撮儴鏍峰紡 */ +.menu-header { + margin-bottom: 30rpx; + position: relative; +} + +.menu-title { + font-size: 36rpx; + font-weight: 600; + color: #1F2329; + display: inline-block; + position: relative; + padding-bottom: 10rpx; +} + +.decorative-line { + height: 4rpx; + width: 120rpx; + background: linear-gradient(to right, #1677FF, #36CFC9); + border-radius: 2rpx; + margin-top: 10rpx; +} + +/* 缃戞牸鑿滃崟浼樺寲 */ +.menu-grid { + flex: 1; + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} + .grid-item { - display: flex; - flex-wrap: wrap; - height: 100% !important; - display: flex; - flex-direction: column; - align-items: stretch; /* 淇濊瘉鍨傜洿鎷変几浠ラ�傚簲鍐呭 */ - } + display: flex; + flex-wrap: wrap; + height: 100% !important; + display: flex; + flex-direction: column; + align-items: stretch; + margin-bottom: 20rpx; +} + .grid-item-box { flex: 1; - /* position: relative;*/ - /* #ifndef APP-NVUE */ display: flex; - /* #endif */ flex-direction: column; align-items: center; justify-content: center; - padding: 5px; + padding: 20rpx; + background-color: #FFFFFF; + border-radius: 20rpx; + box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.08); + transition: all 0.3s ease; + position: relative; + overflow: hidden; +} + +.grid-item-box::before { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 4rpx; + background: linear-gradient(to right, #1677FF, #36CFC9); + opacity: 0; + transition: opacity 0.3s ease; +} + +.grid-item-box:hover { + transform: translateY(-8rpx); + box-shadow: 0 12rpx 30rpx rgba(22, 119, 255, 0.15); +} + +.grid-item-box:hover::before { + opacity: 1; +} + +/* 鍥炬爣瀹瑰櫒浼樺寲 */ +.icon-container { + width: 140rpx; + height: 140rpx; + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 15rpx; + position: relative; } .imgMenu { width: 100rpx; height: 100rpx; + border-radius: 50%; + background-color: #F7F8FA; + padding: 16rpx; + box-sizing: border-box; + transition: transform 0.3s ease; } -image, -swiper, -.img-view { +.imgMenu.default-icon { + background-color: #E6F7FF; + color: #1677FF; +} + +.grid-item-box:hover .imgMenu { + transform: scale(1.1); +} + +.icon-badge { + position: absolute; + top: -10rpx; + right: -10rpx; + width: 30rpx; + height: 30rpx; + background-color: #F5222D; + color: #FFFFFF; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 18rpx; + box-shadow: 0 2rpx 8rpx rgba(245, 34, 45, 0.3); +} + +/* 閫氱煡鏍忔牱寮忎紭鍖� */ +.notice-bar { + background: linear-gradient(90deg, #1677FF, #36CFC9); + color: #FFFFFF; + font-weight: 500; + padding: 20rpx 30rpx; + border-radius: 10rpx; + margin-bottom: 20rpx; + box-shadow: 0 4rpx 12rpx rgba(22, 119, 255, 0.2); +} + +/* 鏈櫥褰曠姸鎬佹牱寮忎紭鍖� */ +.guest-container { + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + padding: 0 40rpx; +} + +.title { + font-size: 36rpx; + font-weight: 600; + color: #1F2329; + margin: 40rpx 0 30rpx; + text-align: center; +} + +.ul { + background-color: #FFFFFF; + border-radius: 20rpx; + padding: 30rpx; + box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08); width: 100%; - height: 350rpx; - margin-bottom: 10rpx; + max-width: 600rpx; } -.example-body { - flex-direction: row; - justify-content: flex-start; +.ul view { + font-size: 28rpx; + color: #4E5969; + line-height: 1.8; + margin-bottom: 20rpx; +} + +.login-prompt { + margin-top: 40rpx; + padding: 15rpx 30rpx; + background-color: #E6F7FF; + border-radius: 30rpx; + font-size: 24rpx; + color: #1677FF; +} + +.login-note { + font-weight: 500; } </style> \ No newline at end of file -- Gitblit v1.9.3