WIN-2CJ8FMUT9OF\Administrator 3 veckor sedan
förälder
incheckning
30f608fb34
2 ändrade filer med 31 tillägg och 26 borttagningar
  1. 14 11
      components/en-utils/en-nav/en-nav.vue
  2. 17 15
      service/tools.js

+ 14 - 11
components/en-utils/en-nav/en-nav.vue

@@ -15,15 +15,14 @@
 				<text>{{title}}</text>
 			</view>
 		</view>
-		<view :style="[{height:is_fixed? `${60+bgHeight}px`:`${60+fixedHeight}px`}]">
-			<!-- {{fixedHeight}}{{bgHeight}} -->
+		<view :style="[{height:is_fixed? `${$tools.topHeight()+bgHeight}px`:`${$tools.topHeight()+fixedHeight}px`}]">
 		</view>
 		<!-- 带背景插槽 start-->
 		<slot></slot>
 		<!-- 带背景插槽 end-->
-		<view class="sys-list-background-color header" style="z-index: 2;"
-			:style="[{height:is_fixed?`${navsHeight}px` :`${fixedHeight}px`},{opacity:is_fixed?navOpacity:1}]">
-			<image class="" style="width: 100%;height: 100%;" :src="bgList[genre].nav_path" mode="">
+		<view class="header" style="z-index: 2;"
+			:style="[{height:is_fixed?`${$tools.topHeight()+navsHeight}px` :`${$tools.topHeight()+fixedHeight}px`},{opacity:is_fixed?navOpacity:1},{'background':bgckgroundBox}]">
+			<image v-if="genre>= 0" class="" style="width: 100%;height: 100%;" :src="bgList[genre].nav_path" mode="">
 			</image>
 		</view>
 	</view>
@@ -127,10 +126,12 @@
 		},
 
 		created() {
-			// const navTop = uni.getMenuButtonBoundingClientRect()
-			// this.height = navTop.height + 'px'
-			// this.paddingTop = navTop.top + 'px'
-			// this.navHeight = `${navTop.height+navTop.top}px`
+			// #ifdef MP-WEIXIN
+			const navTop = uni.getMenuButtonBoundingClientRect()
+			this.height = navTop.height + 'px'
+			this.paddingTop = navTop.top + 'px'
+			this.navHeight = `${navTop.height+navTop.top}px`
+			// #endif
 		},
 		watch: {
 			opacity(newValue, oldValue) {
@@ -178,7 +179,7 @@
 			position: absolute;
 			width: 100rpx;
 			height: 42rpx;
-			top: 60rpx;
+			top: 12rpx;
 			bottom: 0;
 			left: 30rpx;
 			color: #fff;
@@ -194,7 +195,9 @@
 			font-size: 32rpx;
 			font-weight: bold;
 			font-family: Source Han Sans CN;
-			padding-top: 60rpx;
+			// #ifdef H5 || APP-PLUS
+			padding-top: 30rpx;
+			// #endif
 		}
 	}
 

+ 17 - 15
service/tools.js

@@ -1,4 +1,6 @@
-import {wxLogin} from "@/api/login";
+import {
+	wxLogin
+} from "@/api/login";
 
 let tools = {}
 /**
@@ -268,11 +270,11 @@ tools.getDate = function(type) {
 	// let myHour = myDate.getHours(); //获取当前小时数(0-23)
 	// let myMinute = myDate.getMinutes(); //获取当前分钟数(0-59)
 	// let mySecond = myDate.getSeconds(); //获取当前秒数(0-59)
-	if(myMonth<10){
-		myMonth='0'+myMonth
+	if (myMonth < 10) {
+		myMonth = '0' + myMonth
 	}
-	if(myToday<10){
-		myToday='0'+myToday
+	if (myToday < 10) {
+		myToday = '0' + myToday
 	}
 	if (type === '-') {
 		return myDate.getFullYear() + '-' + (myMonth) + '-' + myToday
@@ -509,12 +511,12 @@ tools.topHeight = function() {
 	return navTop.height + navTop.top + 10
 	//#endif
 	// #ifdef H5
-   return  10
-    //#endif
+	return 40
+	//#endif
 }
 
 
-tools.weiXinLogin=async function () {
+tools.weiXinLogin = async function() {
 	return new Promise((resolve, reject) => {
 		uni.login({
 			provider: "weixin",
@@ -524,17 +526,17 @@ tools.weiXinLogin=async function () {
 				}).then((res) => {
 					if (res.code === 403) {
 						tools.error('当前用户未注册')
-						resolve( -1)
+						resolve(-1)
 					} else if (res.code === 1) {
-						if(res.data.status===0){
+						if (res.data.status === 0) {
 							tools.setLoginData(res.data, false)
-							resolve( true)
-						}else {
+							resolve(true)
+						} else {
 							tools.error('信息正在审核...')
-							resolve( false)
+							resolve(false)
 						}
 					} else {
-						resolve( false)
+						resolve(false)
 					}
 				})
 			}
@@ -542,4 +544,4 @@ tools.weiXinLogin=async function () {
 	})
 }
 
-export default tools
+export default tools