tanxue преди 2 месеца
родител
ревизия
d760538515
променени са 5 файла, в които са добавени 97 реда и са изтрити 3 реда
  1. 12 0
      api/login.js
  2. 6 1
      common/styles/global/components.scss
  3. 38 0
      components/dialog/tipDialog.vue
  4. 20 1
      pages/Login/components/adminloginBox.vue
  5. 21 1
      pages/admin/ShouYe/shouye.vue

+ 12 - 0
api/login.js

@@ -24,3 +24,15 @@ export function getConfig(data = {}) {
     timeout: 20000
   })
 }
+
+export function getVersion(data = {}) {
+  return request({
+    'url': '/common/app/version',
+    headers: {
+      isToken: false
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}

+ 6 - 1
common/styles/global/components.scss

@@ -478,4 +478,9 @@ margin-right: 18rpx;display: inline-block;vertical-align: middle;}
 	.not-confirm-btn{color: #666;}
 	.confirm-btn{border-left-color: #f0f0f0;border-left-style: solid;border-left-width: 1px;color: #3fd2a1;}
 	.code-img{width: 500rpx;height: 500rpx;display: block;margin: 0 auto;}
-}	
+}	
+.phone-tip-dialog{
+	width: 580rpx;border-radius: 12rpx;background-color: #fff;padding: 24rpx;
+	.tip-title{padding-top: 24rpx;font-size: 34rpx;color: #333;text-align: center;}
+	.tip-content{font-size: 32rpx;color: #666;margin:32rpx 30rpx 56rpx;line-height: 1.6;}
+}

+ 38 - 0
components/dialog/tipDialog.vue

@@ -0,0 +1,38 @@
+<template>
+	<uni-popup ref="tipPopup" :animation="false" :is-mask-click="false"
+	 mask-background-color="rgba(0, 0, 0, 0.4)">
+	 <view class="phone-tip-dialog">
+			<view class="common-body-box">
+				<view class="tip-title">{{title}}</view>
+				<view class="tip-content" :class="dialogContentClass">{{content}}</view>
+			</view>
+	 </view>
+	</uni-popup>
+</template>
+
+<script setup>
+	import { ref } from 'vue';
+	const props = defineProps({
+		title: {
+		  type: String,
+		  default: ''
+		},
+	  content: {
+	    type: String,
+		require: true,
+	    default: ''
+	  },
+	});
+	const tipPopup = ref(null); // 索引
+	const $emit = defineEmits(['confirm-btn'])
+	// 打开弹窗
+	function handleShow() {
+		tipPopup.value.open();
+	}
+	defineExpose({
+			handleShow
+		})
+</script>
+
+<style>
+</style>

+ 20 - 1
pages/Login/components/adminloginBox.vue

@@ -23,10 +23,12 @@
 		<!-- 已加密的:{{lliPassword}} -->
 		</view>
 		<passwordLli ref="passLLiRef" :password="password" @lli-password="onLliPassword" />
+		<tip-dialog ref="tipDialogRef" :title="tipTitle" :content="tipContent"></tip-dialog>
 	</view>
 </template>
 
 <script setup>
+	import {onShow} from '@dcloudio/uni-app';
 	import cacheManager from '@/utils/cacheManager.js'
 	import * as httpApi from "@/api/login.js"
 	import passwordLli from "@/components/password-lli/password-lli.vue";
@@ -34,6 +36,7 @@
 	import {toast} from "@/utils/common";
 	import {useIsCanBack} from "@/store/isCanBack.js"
 	import config from '../../../config.js'
+	import tipDialog from '@/components/dialog/tipDialog.vue';
 	
 	
 	const userName = ref('') // 用户名
@@ -45,7 +48,10 @@
 	const clearPwIcon= ref(false)
 	
 	const store = useIsCanBack();
-	const version = config.version;
+	const version = config.appInfo.version;
+	const tipDialogRef = ref(null);
+	const tipTitle = '升级提醒';
+	const tipContent = '您的APP不是最新版本,请升级至最新版本。';
 	
 	// 加密
 	function handleUpdateLLiPassword() {
@@ -134,6 +140,19 @@
           url: `/pages/admin/ShouYe/shouye`
         })
 		}
+		
+	function getLoginInit(){
+		httpApi.getVersion({}).then(res => {
+			console.log(version,res,'version+res');
+			if(version!=res.data.version){
+				tipDialogRef.value.handleShow();
+			}
+		})
+	}
+	
+	onShow(() => {
+		// getLoginInit()
+	})	
 </script>
 
 <style>

+ 21 - 1
pages/admin/ShouYe/shouye.vue

@@ -68,6 +68,7 @@
 	</view>	
 	<!-- 页面底端 -->
 	<customTabbarAdminVue :current-tab="0"></customTabbarAdminVue>
+	<tip-dialog ref="tipDialogRef" :title="tipTitle" :content="tipContent"></tip-dialog>
   </view>
 </template>
 
@@ -76,7 +77,14 @@ import {onLoad,onShow} from '@dcloudio/uni-app';
 import {reactive,ref} from "vue";
 import customTabbarAdminVue from "@/components/custom-tabbar/custom-tabbar-admin.vue";
 import {getAppNoticeList,getAppNoticeWait,getGlIndexInfo,getIndexKechengList} from '@/api/shouye.js'
-
+import tipDialog from '@/components/dialog/tipDialog.vue';
+import config from '../../../config.js'
+import * as httpApi from "@/api/login.js"
+const version = config.appInfo.version;
+const tipDialogRef = ref(null);
+const tipTitle = '升级提醒';
+const tipContent = '您的APP不是最新版本,请升级至最新版本。';
+	
 const tjBtn = ref(1);
 const tzNum = ref(0);
 const tzContent = ref('');
@@ -208,5 +216,17 @@ function tjBtnClick(data){
 				break;
 		}
 	}
+	function getLoginInit(){
+			httpApi.getVersion({}).then(res => {
+				console.log(version,res,'version+res');
+				if(version!=res.data.version){
+					tipDialogRef.value.handleShow();
+				}
+			})
+		}
+		
+		onShow(() => {
+			// getLoginInit()
+		})
 </script>