Procházet zdrojové kódy

首页接口联调

zhengjinyi před 2 roky
rodič
revize
1255393886

+ 10 - 3
pages/goods/good-floor.vue

@@ -1,6 +1,13 @@
 <template>
-	<view class="container clearfix" v-if="isRequest">
-		<view class="cm-member-main ">
+	<view class="container clearfix">
+		<tui-skeleton
+			v-if="skeletonShow"
+			backgroundColor="#fafafa"
+			borderRadius="10rpx"
+			:isLoading="true"
+			:loadingType="5"
+		></tui-skeleton>
+		<view class="cm-member-main " v-else>
 			<view class="cm-member-product clearfix">
 				<view
 					v-for="(pro, index) in productList"
@@ -44,6 +51,7 @@ export default {
 	},
 	data() {
 		return {
+			skeletonShow:true,
 			isModallayer: false,
 			banner: '',
 			listQuery: {
@@ -61,7 +69,6 @@ export default {
 			loadding: false,
 			pullUpOn: true,
 			pullFlag: true,
-			isRequest: false
 		}
 	},
 	onLoad() {

+ 4 - 3
pages/tabBar/home/components/banner.vue

@@ -11,7 +11,7 @@
 					:circular="true"
 				>
 					<swiper-item v-for="(item, index) in list" :key="index" @click.stop="NavToDetailPage(item)">
-						<image :src="item.image" class="tui-slide-image" mode="scaleToFill" />
+						<image :src="item.bannerImage" class="tui-slide-image" mode="scaleToFill" />
 					</swiper-item>
 				</swiper>
 				<view class="swiper__dots-box" v-if="list.length > 1">
@@ -44,7 +44,9 @@ export default {
 			current: 0
 		}
 	},
-	created() {},
+	created() {
+		console.log('list',this.list)
+	},
 	computed: {},
 	methods: {
 		swiperChange(e) {
@@ -54,7 +56,6 @@ export default {
 		},
 		NavToDetailPage(floor) {
 			//跳转
-			this.cmsSysStatistics(1)
 			this.$api.FlooryNavigateTo(floor)
 		}
 	}

+ 3 - 75
pages/tabBar/home/components/floors.vue

@@ -1,10 +1,10 @@
 <template name="floors">
 	<view>
 		<view class="floors-content clearfix">
-			<view class="tui-block__box tui-mtop__20" v-for="(floor,index) in floorList" :key="index">
+			<view class="tui-block__box tui-mtop__20" v-for="(floor,index) in list" :key="index">
 				<view class="tui-group-name" >
 					<view>
-						<text class="tui-sub__desc tui-color__pink">{{ floor.title }}</text>
+						<text class="tui-sub__desc tui-color__pink">{{ floor.topic }}</text>
 					</view>
 					<view class="tui-more__box" @click="handleFloor">
 						<text>更多</text>
@@ -15,7 +15,7 @@
 					<view class="tui-goods__list">
 						<view class="tui-goods__item" @tap="group(2)" v-for="pros in floor.products">
 							<view class="tui-goods__imgbox">
-								<image :src="pros.image" mode="widthFix" class="tui-goods__img"></image>
+								<image :src="pros.mainImage" mode="widthFix" class="tui-goods__img"></image>
 							</view>
 							<view class="tui-goods__namebox">
 								<text>{{ pros.name }}</text>
@@ -58,78 +58,6 @@
 		data() {
 			return{
 				current:100,
-				floorList:[
-					{
-						title:'集采商品',
-						products:[
-							{
-								image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-								name:'法国曼丽菲戈动能素抗衰DER...',
-								price:'5000.00',
-								priceGrade:1
-							},
-							{
-								image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-								name:'法国曼丽菲戈动能素抗衰DER...',
-								price:'5000.00',
-								priceGrade:2
-							},
-							{
-								image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-								name:'法国曼丽菲戈动能素抗衰DER...',
-								price:'5000.00',
-								priceGrade:3
-							},
-							{
-								image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-								name:'法国曼丽菲戈动能素抗衰DER...',
-								price:'5000.00',
-								priceGrade:4
-							},
-							{
-								image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-								name:'法国曼丽菲戈动能素抗衰DER...',
-								price:'5000.00',
-								priceGrade:5
-							}
-						]
-					},
-					{
-						title:'热门商品',
-						products:[
-							{
-								image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-								name:'法国曼丽菲戈动能素抗衰DER...',
-								price:'5000.00',
-								priceGrade:1
-							},
-							{
-								image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-								name:'法国曼丽菲戈动能素抗衰DER...',
-								price:'5000.00',
-								priceGrade:2
-							},
-							{
-								image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-								name:'法国曼丽菲戈动能素抗衰DER...',
-								price:'5000.00',
-								priceGrade:3
-							},
-							{
-								image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-								name:'法国曼丽菲戈动能素抗衰DER...',
-								price:'5000.00',
-								priceGrade:3
-							},
-							{
-								image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
-								name:'法国曼丽菲戈动能素抗衰DER...',
-								price:'5000.00',
-								priceGrade:5
-							}
-						]
-					}
-				]
 			}
 		},
 		created(){

+ 3 - 37
pages/tabBar/home/components/navbars.vue

@@ -1,11 +1,11 @@
 <template name="navbars">
 	<view>
 		<view class="navbars-content clearfix">
-			<view class="nav-item" v-for="(item,index) in navList" :key="index" @click="NavToDetailPage(item,index)">
+			<view class="nav-item" v-for="(item,index) in list" :key="index" @click="NavToDetailPage(item,index)">
 				<view class="icon">
-					<image class="icon-image" :src="item.icon" mode="widthFix"></image>
+					<image class="icon-image" :src="item.image" mode="widthFix"></image>
 				</view>
-				<view class="name">{{ item.name }}</view>
+				<view class="name">{{ item.topic }}</view>
 			</view>
 		</view>
 	</view>
@@ -22,40 +22,6 @@
 		data() {
 			return{
 				current:100,
-				navList:[
-					{
-						icon:'https://img-b.caimei365.com/group1/M00/04/30/rB-lHGRWI1iABlx4AAAY99ppI8M213.png',
-						name:'国产'
-					},
-					{
-						icon:'https://img-b.caimei365.com/group1/M00/04/30/rB-lHGRWI1iAT3-xAAAWkMn2pTE248.png',
-						name:'进口'
-					},
-					{
-						icon:'https://img-b.caimei365.com/group1/M00/04/30/rB-lHGRWI1iAZqveAAAZP05rdM4857.png',
-						name:'皮肤管理'
-					},
-					{
-						icon:'https://img-b.caimei365.com/group1/M00/04/30/rB-lHGRWI1iAXGqgAAAXb1UNnBQ046.png',
-						name:'抗衰'
-					},
-					{
-						icon:'https://img-b.caimei365.com/group1/M00/04/30/rB-lHGRWI1iAZVX0AAAW2oMOngI226.png',
-						name:'私密'
-					},
-					{
-						icon:'https://img-b.caimei365.com/group1/M00/04/30/rB-lHGRWI1iAbpnIAAAWmTGXZe4226.png',
-						name:'水光针'
-					},
-					{
-						icon:'https://img-b.caimei365.com/group1/M00/04/30/rB-lHGRWI1iART5pAAAWbNXCp6A170.png',
-						name:'易耗品'
-					},
-					{
-						icon:'https://img-b.caimei365.com/group1/M00/04/30/rB-lHGRWI1iAQ1UxAAAYn0g_csA191.png',
-						name:'除皱'
-					},
-				]
 			}
 		},
 		created(){

+ 38 - 15
pages/tabBar/home/index.js

@@ -5,7 +5,27 @@ import authorize from '@/common/config/authorize.js'
 const homeMiXins = {
     data() {
         return {
-            bankInfo:{}
+            nvabarData: {
+            	// 顶部自定义导航
+            	showCapsule: 1, // 是否显示左上角图标  1表示显示  0表示不显示,
+            	showSearch: 0,
+            	title: '联合丽格集采商城', // 导航栏 中间的标题
+            	haveBack: false,
+            	textLeft: this.$store.state.isIphone,
+            	textColor: '#FFFFFF'
+            },
+            CustomBar: this.CustomBar, // 顶部导航栏高度
+            skeletonShow: false,
+            clubId: 0,
+            clubStatus: '',
+            current: 0,
+            mode: 'round',
+            isLogin: false,
+            userIdentity: 0,
+            bannerList: [], // 轮播
+            mainmenu: [], // 导航分类
+            floorList: [], // 楼层
+            isScrollTop: false,
         }
     },
     computed: {
@@ -13,6 +33,23 @@ const homeMiXins = {
     },
     methods: {
         ...mapMutations(['login', 'logout','updateNoticeNum','updateRossShow']),
+        mallOrganizeHome() {
+            //初始化首页数据
+            this.CommonService.mallOrganizeHome({ organizeId: 1 })
+                .then(res => {
+                    let data = res.data
+		            this.bannerList = data.bannerList
+		            this.mainmenu = data.mainmenu
+		            this.floorList = data.floorList
+                    // if (this.hasLogin) {
+                    // 	// this.initShoppingCartCount()
+                    // }
+                    this.skeletonShow = true
+                })
+                .catch(error => {
+                    this.$util.msg(error.msg, 2000)
+                })
+        },
         async GetWxAuthorize() {
         	const wechatCode = await authorize.getCode('weixin') // 根据微信的code获取用户登录状态:1已登录过 -1未登录过
         	const getUserInfo = await authorize.getUserInfo('weixin')
@@ -49,20 +86,6 @@ const homeMiXins = {
         			this.getHomeInformation()
         		})
         },
-        mallOrganizeHome() {
-        	//初始化首页数据
-        	this.CommonService.mallOrganizeHome({ organizeId: 1 })
-        		.then(res => {
-        			let data = res.data
-        			if (this.hasLogin) {
-        				// this.initShoppingCartCount()
-        			}
-        			this.skeletonShow = false
-        		})
-        		.catch(error => {
-        			this.$util.msg(error.msg, 2000)
-        		})
-        },
         initShoppingCartCount() {
         	// 获取购物车数量
         	this.OrderService.ShoppingCartCount({ userId: this.userID }).then(res => {

+ 4 - 29
pages/tabBar/home/index.vue

@@ -10,13 +10,13 @@
 		></tui-skeleton>
 		<view class="container-home tui-skeleton">
 			<!-- 轮播 -->
-			<banner :list="bannerImageList" v-if="skeletonShow"></banner>
+			<banner :list="bannerList" v-if="skeletonShow"></banner>
 			<!-- 金刚区菜单 -->
-			<navbars :list="banners" v-if="skeletonShow"></navbars>
+			<navbars :list="mainmenu" v-if="skeletonShow"></navbars>
 			<!-- 活动模块 -->
-			<hotmode :list="navBars" v-if="skeletonShow"></hotmode>
+			<hotmode :list="mainmenu" v-if="skeletonShow"></hotmode>
 			<!-- 楼层模块 -->
-			<floors :list="flootData" v-if="skeletonShow"></floors>
+			<floors :list="floorList" v-if="skeletonShow"></floors>
 		</view>
 	</view>
 </template>
@@ -36,31 +36,6 @@ export default {
 		hotmode,
 		floors
 	},
-	data() {
-		return {
-			nvabarData: {
-				// 顶部自定义导航
-				showCapsule: 1, // 是否显示左上角图标  1表示显示  0表示不显示,
-				showSearch: 0,
-				title: '联合丽格集采商城', // 导航栏 中间的标题
-				haveBack: false,
-				textLeft: this.$store.state.isIphone,
-				textColor: '#FFFFFF'
-			},
-			CustomBar: this.CustomBar, // 顶部导航栏高度
-			skeletonShow: false,
-			clubId: 0,
-			clubStatus: '',
-			current: 0,
-			mode: 'round',
-			isLogin: false,
-			userIdentity: 0,
-			banners: [], // 轮播
-			navBars: [], // 导航分类
-			flootData: [], // 楼层
-			isScrollTop: false,
-		}
-	},
 	onLoad() {},
 	onPageScroll(e) {
 		//实时获取到滚动的值