wangjunchong il y a 2 semaines
Parent
commit
8020389346

+ 12 - 5
components/listModel/listModel.vue

@@ -4,12 +4,13 @@
 			class="i-h-p100 i-w-p100">
 			<view class="i-flex i-al-center i-jst-center">
 				<uni-transition ref="ani" :show="isShow" mode-class="slide-bottom" class="i-w-p80 ">
-					<view class="i-h-200"></view>
-					<uni-row class="i-h-p80">
+					<view class="i-h-110"></view>
+					<uni-row class="">
 						<uni-col :span="6" v-for="(item,index) in list" :key="index">
 							<view class="i-flex i-al-center i-jst-center i-mt-26">
-								<view class="i-pst-r i-w-p90" @click="toDetail(item)">
-									<image class="i-radius-20  i-w-p100" mode="aspectFill" :src="item.detail_img">
+								<view class="i-pst-r i-h-p70 i-w-p90" @click="toDetail(item)">
+									<image class="i-radius-20 i-w-p100" :class="styleType == 1?'i-h-350':'i-h-250'" mode="aspectFill"
+										:src="item.detail_img">
 									</image>
 									<view class="i-c-fff i-z-index1 i-pst-a i-t-center i-w-p100 i-t-p35">
 										<view>
@@ -52,6 +53,10 @@
 				type: Number,
 				default: 1,
 			},
+			styleType: {
+				type: Number,
+				default: 1
+			}
 		},
 		watch: {
 			// 监听显示状态,控制动画
@@ -73,8 +78,10 @@
 		},
 		methods: {
 			toDetail(item) {
-				if(item.have_detail === 1){
+				if (item.have_detail === 1) {
 					this.$emit('toDetailEvent', item)
+				} else {
+
 				}
 			},
 			// 动画

+ 6 - 10
components/pageButton/pageButton.vue

@@ -1,10 +1,10 @@
 <template>
 	<view class="i-z-index3" v-show="isShow">
 		<!-- 头部 -->
-		<uni-transition ref="button01" style="z-index: 3;" :show="isShow" class="i-pst-f i-l-p15 i-t-p15">
+		<uni-transition ref="button01" style="z-index: 3;" :show="isShow" class="i-pst-f i-l-p11 i-t-p5">
 			<view class=" i-flex i-al-center" @click="gotoLast()">
 				<view class="i-radius-p50 i-bd-1">
-					<uni-icons type="back" size="18" color="#FFF"></uni-icons>
+					<uni-icons type="back" size="1.6rem" color="#FFF"></uni-icons>
 				</view>
 				<span class="i-c-fff i-ml-10 i-fs-30">{{nowTitle}}</span>
 			</view>
@@ -14,7 +14,7 @@
 			<view class=" i-flex i-al-center i-z-index3 i-bd-1 i-radius-40 i-plr-20 i-ptb-20 i-b-c-fff"
 				@click="gotoLast()">
 				<view class="i-radius-p50 i-bd-3">
-					<uni-icons type="back" size="20" color="#000"></uni-icons>
+					<uni-icons type="back" size="1.7rem" color="#000"></uni-icons>
 				</view>
 				<span class="i-c-000 i-ml-10 i-fs-26">返回上一级</span>
 			</view>
@@ -23,7 +23,7 @@
 			<view class=" i-flex i-al-center i-z-index3 i-bd-1 i-radius-40 i-plr-20 i-ptb-20 i-b-c-fff"
 				@click="gotoBack()">
 				<!-- <view class="i-radius-p50 i-bd-3 i-p-2"> -->
-					<uni-icons type="home" size="20" color="#000"></uni-icons>
+					<uni-icons type="home" size="1.9rem" color="#000"></uni-icons>
 				<!-- </view> -->
 				<span class="i-c-000 i-ml-10 i-fs-26">回到首页</span>
 			</view>
@@ -51,17 +51,13 @@
 				type: Boolean,
 				default: true
 			},
-			// 页面状态 动画效果 1进入 2正常 3退出
+			// 页面状态 动画效果
 			pageStatus: {
 				type: Number,
 				default: 2,
 			},
 		},
-		watch: {
-			// nowTitle(pageStatus){
-			// 	this.buttonAnimation()
-			// }
-		},
+		watch: {},
 		methods: {
 			buttonAnimation() {
 				// 按钮1

+ 1 - 1
custom/config.js

@@ -1,4 +1,4 @@
-let baseUrl="http://www.jdf.com/index.php/promotion/promotion.promotionapi"
+let baseUrl="https://jdfdzxc.app2.hbdrwh.cn/index.php/promotion/promotion.PromotionApi"
 
 export default{
 	// 获取数据

+ 9 - 0
custom/custom.scss

@@ -21,8 +21,13 @@
 .i-w-p100{width: 100%;}
 .i-w-v100{width: 100vw;}
 
+.i-h-100{height: 6.25rem;}
+.i-h-110{height: 6.88rem;}
 .i-h-200{height: 12.50rem;}
+.i-h-250{height: 15.63rem;}
 .i-h-300{height: 18.75rem;}
+.i-h-350{height: 21.88rem;}
+.i-h-380{height: 23.75rem;}
 .i-h-400{height: 25rem;}
 .i-h-600{height: 37.5rem;}
 .i-h-800{height: 50rem;}
@@ -170,6 +175,8 @@
 .i-t-150{top: 150rpx;}
 .i-t-180{top: 180rpx;}
 .i-t-260{top: 260rpx;}
+.i-t-p5{top: 5%;}
+.i-t-p10{top: 10%;}
 .i-t-p15{top: 15%;}
 .i-t-p20{top: 20%;}
 .i-t-p35{top: 35%;}
@@ -181,6 +188,8 @@
 .i-b-p35{bottom: 35%;}
 .i-b-150{bottom: 150rpx;}
 .i-l-p10{left: 10%;}
+.i-l-p11{left: 11%;}
+.i-l-p12{left: 12%;}
 .i-l-p15{left: 15%;}
 .i-l-p20{left: 20%;}
 .i-r-p10{right: 10%;}

+ 9 - 4
custom/data.js

@@ -3,9 +3,14 @@ import config from './config.js'
 
 export default {
 	get_home_list(_this, data = {}, isLoading = false){
-		http.Post(config.homeData, data, isLoading).then((res) => {
-			let list = res['data']['data']
-			_this['list'] = list
-		}).catch(err=>{})
+		if(uni.getStorageSync('list')){
+			_this['list'] = uni.getStorageSync('list')
+		}else{
+			http.Post(config.homeData, data, isLoading).then((res) => {
+				let list = res['data']['data']
+				uni.setStorageSync('list',list)
+				_this['list'] = list
+			}).catch(err=>{})
+		}
 	}
 }

+ 21 - 10
pages/index/home.vue

@@ -2,7 +2,7 @@
 	<view class="i-h-v100 i-w-v100">
 		<!-- 背景图片 -->
 		<view class="i-pst-f i-z-index01">
-			<image class="i-h-v100 i-w-v100" mode="scaleToFill" src="/static/image/homeBg.jpg"></image>
+			<image class="i-h-v100 i-w-v100" mode="scaleToFill" src="/static/image/homeBg.png"></image>
 		</view>
 		<!-- 内页按钮 -->
 		<pageButton :buttonData="buttonData" :isShow="showModel != 'default'" :nowTitle="nowTitle"
@@ -15,7 +15,7 @@
 		<homeDetails :itemInfo="detail_info" :isShow="showModel === 'model_detail'" :pageStatus="pageStatus">
 		</homeDetails>
 		<!-- 列表 -->
-		<listModel :list="detail_list" :isShow="showModel === 'model_list'" :pageStatus="pageStatus"
+		<listModel :list="detail_list" :isShow="showModel === 'model_list'" :pageStatus="pageStatus" :styleType = "style_type"
 			@toDetailEvent="toDetailEvent"></listModel>
 	</view>
 </template>
@@ -29,21 +29,23 @@
 					lastpage: ['default'],
 					lastpageIndex: 0 // 页面计数器
 				},
+				lastpageTitle: 'default',
 				nowTitle: '',
 				showModel: 'default',
-				pageStatus: 2, //页面状态 动画效果 1进入 2正常 3退出
+				pageStatus: 2, //页面状态 组件通过监听控制动画效果 
 				homeAnimation: {},
 				list: [], // 导航信息
 				detail_list: [], // 列表信息
 				detail_info: {
 					img: '/static/image/homeBg.jpg', // 详情信息
 				},
-				resData: []
+				style_type:1
 			}
 		},
 		onLoad() {
-			//加载字体
+			// 加载字体
 			uni.iCommon.getFontFamily()
+			// 获取数据
 			this.get_data()
 		},
 		watch: {
@@ -59,24 +61,32 @@
 			}
 		},
 		methods: {
+			// 获取数据
 			get_data() {
 				data.get_home_list(this)
 			},
 			// 清除缓存并重新获取数据
 			clearCache(e) {
+				uni.removeStorageSync('list')
 				console.log('已清除缓存')
+				// 清空原有数据
+				this.list = []
+				this.detail_info = {}
+				// 重新获取数据
+				this.get_data()
 			},
 			// list导航组件传递
 			homeListEvent(e) {
-				// console.log('ss',e)
 				this.pageStatus = 1
 				this.buttonData.lastpageIndex = 1
 				setTimeout(() => {
 					if (e.model_type != undefined) {
 						// 按钮组件title
 						this.nowTitle = e.title
+						this.lastpageTitle = e.title
 						// 当前显示组件
 						this.detail_list = e.list
+						this.style_type = e.style_type
 						if(e.list[0].have_detail === 1){
 							this.detail_info.img = e.list[0].inner_img
 							this.showModel = e.model_type
@@ -88,14 +98,14 @@
 			},
 			// 按钮组件回到首页传递
 			backEvent() {
-				this.pageStatus = 3
+				this.pageStatus = 6
 				setTimeout(() => {
 					this.showModel = 'default'
 				}, 300);
 			},
 			// 按钮组件返回上一页
 			tolastEvent() {
-				// 返回首页
+				// 返回首页
 				if (this.buttonData.lastpage.length === 2) {
 					this.pageStatus = 2
 					this.buttonData.lastpage = ['default']
@@ -108,7 +118,8 @@
 					this.pageStatus = 3
 					this.buttonData.lastpageIndex -= 1
 					this.buttonData.lastpage.pop()
-
+					this.nowTitle = this.lastpageTitle
+				console.log('aa',this.lastpageTitle)
 					setTimeout(() => {
 						this.showModel = this.buttonData.lastpage[1]
 					}, 300);
@@ -129,7 +140,7 @@
 </script>
 
 <style>
-	/* 基准大小 */
+	/* rem基准大小 */
 	html {
 		font-size: 9px;
 	}

BIN
static/image/homeBg.png