zhengkaixin 2 سال پیش
والد
کامیت
216de8ef3b
2فایلهای تغییر یافته به همراه98 افزوده شده و 9 حذف شده
  1. 97 8
      pages/index/index.vue
  2. 1 1
      pages/searchPile/chargeProcess/charge.vue

+ 97 - 8
pages/index/index.vue

@@ -6,7 +6,7 @@
 	<view class="background">
 		<view class="banner">
 					 <ujp-swiper  bg-color="#fff" 
-					 :img-mode="'scaleToFill'" height="240" 
+					 :img-mode="'scaleToFill'" height="120" 
 					 :list="bannerList" @click="clickBanner"  :name="'picUrl'" >
 					</ujp-swiper> 
 			
@@ -67,18 +67,50 @@
 </view>
 
 		<u-modal v-model="showOss"  class="showOss"
-		    
 		:show-title="false" :show-confirm-button="false" >
 			<view class="slot-content">
-					<u-image width="250px"  style="margin: auto;"
+					<u-image width="250px"  style="margin: auto;min-height: 250px;"
 					mode="widthFix" @click="clickBanner(showOssIndex,true)"
-					:src="showOssImg"></u-image>
+					:src="showOssImg">
+					
+					<view slot="loading" style="height: 200px;" >
+						<u-loading mode="flower" size="186" >
+						
+						</u-loading>
+							
+					</view>
+					
+					</u-image>
 					<u-image width="36px"  style="margin: auto;"
 					mode="widthFix"  @click="showOss=false"
 					src="../../assets/img/if-close-line-circled.png"></u-image>
 					
 			</view>
 		</u-modal>
+		
+		<u-modal v-model="showTop"  class="showOss"
+		:show-title="false" :show-confirm-button="false" >
+			<view class="slot-content">
+					<u-image width="250px;" 
+					 bgColor="#ff000000"
+					 style="margin: auto;min-height: 250px;"
+					mode="widthFix" @click="clickBannerTop()"
+					:src="showTopImg" 
+					>
+					<view slot="loading" style="height: 200px;" >
+						<u-loading mode="flower" size="186" >
+						
+						</u-loading>
+							
+					</view>
+					
+					</u-image>
+					<u-image width="36px"  style="margin: auto;"
+					mode="widthFix"  @click="showTop=false"
+					src="../../assets/img/if-close-line-circled.png"></u-image>
+					
+			</view>
+		</u-modal>
 		<!-- 模式选择 -->
 
 		<u-mask :show="show">
@@ -366,9 +398,15 @@
 	import Tabbar from '@/components/Tabbar.vue'
 	import {
 		newDate,
+		currentTimeStamp,
+		parseUnixTime,
 		secondsDistance,
 		hourDistanceArr
 	} from '@/utils'
+	
+
+	
+	
 	export default {
 		components: {
 			Tabbar
@@ -378,6 +416,7 @@
 				listShow:false,
 				stationList: [],
 				bannerList:[],
+				bannerListTop:[],
 				timeOut: false,
 				pointTimeOut: true,
 		 
@@ -394,6 +433,11 @@
 				showOss:false,
 				showOssImg:'',
 				showOssIndex:'',
+				
+				showTop:false,
+				showTopImg:'',
+				showTopIndex:'',
+				
 				show: false,
 				list: [{
 						name: '长辈模式',
@@ -479,7 +523,8 @@
 				//(res)
 			})
 
-			this.getBannerInfo("homepage")
+			this.getBannerInfo("homepage");
+			this.getBannerInfoTop("home-top");
 			this.getPointTimeOut();
 			this.getNewsList();
 			this.getActivityInfoList();
@@ -648,9 +693,17 @@
 				 		})
 				 })
 			},
-			clickBanner(index,bl){
+			clickBannerTop(){
+				var mod = this.bannerListTop[this.showTopIndex];
+				this.showTop=false;
+				this.clickBanner(0,true,mod)
+			},
+			clickBanner(index,bl,modout){
 				var uurl="";
 				var mod = this.bannerList[index]
+				if(modout){
+					mod=modout;
+				}
 				mod.clickUrl=mod.linkUrl
 				
 				if (mod.linkPicUrl&&!bl) {
@@ -684,6 +737,40 @@
 					})
 				}
 			},
+			getBannerInfoTop(code){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				var nowtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
+				
+				newsApi.getBannerInfo(code).then((res) => {
+					this.bannerListTop =res.data;
+					
+					for(var i in this.bannerListTop ){
+						var mod=this.bannerListTop[i];
+						var time=this.carhelp.get("bannerListTop"+mod.id);
+						if(time&&nowtime==time){
+							
+						}else{
+							this.showTop=true;
+							this.showTopImg=mod.picUrl;
+							this.showTopIndex=i;
+							this.carhelp.set("bannerListTop"+mod.id,nowtime);
+							break;
+						}
+					}
+				
+					
+					uni.hideLoading()
+					//document.getElementsByClassName("uni-swiper-wrapper")[0].parentNode.style="background-color: rgb(255, 255, 255); height: 120px;"
+				 }).catch(error => {
+						uni.showToast({
+						
+							title: error,icon: "none"
+						})
+				})
+			},
 			getBannerInfo(code){
 				uni.showLoading({
 					title: "加载中",
@@ -692,7 +779,7 @@
 				newsApi.getBannerInfo(code).then((res) => {
 					this.bannerList =res.data;
 					uni.hideLoading()
-					 document.getElementsByClassName("uni-swiper-wrapper")[0].parentNode.style="background-color: rgb(255, 255, 255); height: 120px;"
+					//document.getElementsByClassName("uni-swiper-wrapper")[0].parentNode.style="background-color: rgb(255, 255, 255); height: 120px;"
 				 }).catch(error => {
 						uni.showToast({
 						
@@ -972,7 +1059,9 @@
 </script>
 
 <style lang="scss" scoped>
-	 
+	/deep/.u-image__loading{
+		 background:#ff000000;
+	 }
 	// 头部图片
 	img {
 		width: 100%;

+ 1 - 1
pages/searchPile/chargeProcess/charge.vue

@@ -99,7 +99,7 @@
 				</view>
 				
 			 </view>
-			 <view class="couponsuse"  ><span style="color:red">*</span>{{couponsuse}}</view>
+			 <view class="couponsuse" v-if="couponsuse" ><span style="color:red">*</span>{{couponsuse}}</view>
 			 
 			 
 			 <!-- 会员活动 -->