gcz 2 жил өмнө
parent
commit
da778e4a2b

+ 22 - 1
common/apiurl.js

@@ -67,7 +67,7 @@ const apiurl = {
 		url: '/goods/commentList',
 		type: 'get'
 	},
-	// 查询类型简介
+	// 旭烁简介
 	xsGetIntro: {
 		url: '/shop/getIntro',
 		type: 'get'
@@ -168,6 +168,27 @@ const apiurl = {
 		url: '/order/selectById',
 		type: 'get'
 	},
+	// 订单
+	// 订单提交
+	submitOrder: {
+		url: '/order/submit',
+		type: 'post'
+	},
+	// 订单结算详情
+	getSettlement: {
+		url: '/order/getSettlement',
+		type: 'post'
+	},
+	// 订单支付
+	gotoPay: {
+		url: '/payment/gotoPay',
+		type: 'post'
+	},
+	// 支付查询
+	payQuery: {
+		url: '/payment/payQuery',
+		type: 'post'
+	},
 }
 
 

+ 7 - 0
pages.json

@@ -66,6 +66,13 @@
 						"navigationStyle": "custom"
 					}
 				},
+				{
+					"path": "productsearch",
+					"style": {
+						"navigationBarTitleText": "产品搜索",
+						"navigationStyle": "custom"
+					}
+				},
 				{
 					"path": "producTypetList",
 					"style": {

+ 54 - 5
pages/index/index.vue

@@ -4,12 +4,23 @@
 			<img class="img" :src="staticUrl+'/img/index-bg.png'" alt="">
 		</view>
 		<view class="page-wrap">
+			<view class="search-out">
+				<u-search
+					placeholder="请输入搜索的商品" 
+					:clearabled="true"
+					:showAction="false"
+					height="80rpx"
+					@search="topSearch"
+					bgColor="transparent"
+					v-model="goodsName">
+				</u-search>
+			</view>
 			<u-swiper
 				:list="bannerList"
 				indicator
 				keyName="sliderImg"
 				indicatorMode="dot"
-				@click="bannerClick"
+				@click="bannerClick()"
 			></u-swiper>
 			<view class="advantage u-flex u-row-around">
 				<view class="u-flex">
@@ -46,7 +57,14 @@
 			</view>
 			
 			<view class="index-img">
-				<u--image class="image" src="https://cdn.uviewui.com/uview/swiper/swiper2.png" width="100%" height="161rpx" radius="15rpx" @click="click"></u--image>
+				<u-swiper
+					:list="centerImg"
+					:indicator="centerImg.length>1"
+					keyName="sliderImg"
+					indicatorMode="dot"
+					height="161rpx"
+					@click="centerImgClick()"
+				></u-swiper>
 			</view>
 			<view class="hot-product">
 				<view class="single-til u-flex u-row-between">
@@ -99,20 +117,23 @@
 		},
 		data() {
 			return {
+				goodsName:'',
 				staticUrl:this.$commonConfig.staticUrl,
 				advantageSize:20,
 				bannerList: [],
+				centerImg:[],
 				hotGoods:[]
 			}
 		},
 		onLoad() {
 			// let userInfo = uni.getStorageSync('userInfo');
 			// console.log('userInfo',userInfo);
-			this.getHotGoods()
+			this.getCenterImg();
+			this.swiperList();
 		},
 		onShow() {
 			this.$refs.cartfixed.getCartList();
-			this.swiperList();
+			this.getHotGoods();
 		},
 		methods: {
 			swiperList(){
@@ -123,11 +144,28 @@
 					console.log('swiperList',err.data);
 				})
 			},
+			getCenterImg(){
+				this.$u.api.swiperList({postion:2}).then(res=>{
+					this.centerImg = res.data.rows;
+					// console.log('res',res.data.rows);
+				}).catch(err=>{
+					console.log('swiperList',err.data);
+				})
+			},
 			bannerClick(e){
+				// console.log('e',e);
 				// console.log('bannerClick',this.bannerList[e]);
+				let item = this.bannerList[e];
 				uni.$u.route('/xushuo/dynamicdetails', {
 					type: 'swiperDetail',
-					id: e.id
+					id: item.id
+				});
+			},
+			centerImgClick(e){
+				let item = this.centerImg[e];
+				uni.$u.route('/xushuo/dynamicdetails', {
+					type: 'swiperDetail',
+					id: item.id
 				});
 			},
 			getHotGoods(){
@@ -150,6 +188,12 @@
 					}).catch(err=>{
 					console.log('addCart',err.data);
 				})
+			},
+			topSearch(){
+				uni.$u.route('/shopping/productsearch', {
+					goodsName: this.goodsName
+				});
+				// console.log('topSearch',this.goodsName);
 			}
 		}
 	}
@@ -160,6 +204,11 @@ page{
 }
 </style>
 <style lang="scss" scoped>
+.search-out{
+	background-color: rgba(0,0,0,0.04);
+	border-radius: 100rpx;
+	margin-bottom: 20rpx;
+}
 .advantage{
 	margin-top: 20rpx;
 	margin-bottom: 50rpx;

+ 32 - 11
shopping/producTypetList.vue

@@ -7,14 +7,18 @@
 		>
 		</u-navbar>
 		<view class="search-wrap">
-			<u--input 
-				placeholder="输入搜索内容" 
-				prefixIcon="search" 
-				shape="circle"
-				v-model="params.goodsName"
-				@confirm="search"
-				:customStyle="{'border-color':'#00A447!important'}"
-				prefixIconStyle="font-size: 22px;color: #333"></u--input>
+			<u-search
+				placeholder="请输入搜索的商品" 
+				:clearabled="true"
+				:showAction="false"
+				height="80rpx"
+				@search="search"
+				@custom="search"
+				@clear="reloadList"
+				bgColor="#fff"
+				borderColor="#00A447"
+				v-model="params.goodsName">
+			</u-search>
 		</view>
 		<view class="out-wrap u-flex u-col-top">
 			<view class="types">
@@ -75,7 +79,7 @@
 												<text class="sales gray">销量 {{item.saleCount}}</text>
 											</view>
 										</view>
-										<u--image :showLoading="false" :src="staticUrl+'/img/add.png'" width="48rpx" height="48rpx"></u--image>
+										<u--image :showLoading="false" @click.native.stop="addCart(item.id)" :src="staticUrl+'/img/add.png'" width="48rpx" height="48rpx"></u--image>
 									</view>
 								</view>
 							</view>
@@ -85,6 +89,7 @@
 			</view>
 		</view>
 		<tabbar :tabbarIndexProps="Number(1)" />
+		<cartfixed ref="cartfixed" @getCartList="getCartList" />
 	</view>
 </template>
 
@@ -92,10 +97,12 @@
 	// 引入mescroll-mixins.js
 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	import tabbar from "../components/tabbar.vue";
+	import cartfixed from "../components/cartfixed.vue"
 	export default {
 		mixins: [MescrollMixin], // 使用mixin
 		components: {
-			tabbar
+			tabbar,
+			cartfixed
 		},
 		data() {
 			return {
@@ -145,7 +152,8 @@
 			}
 		},
 		onShow() {
-			this.getgoodsTypeTree()
+			this.getgoodsTypeTree();
+			this.$refs.cartfixed.getCartList();
 		},
 		methods: {
 			/*下拉刷新的回调, 重置列表为第一页 (此处可删,mixins已默认)
@@ -245,6 +253,19 @@
 				}else{
 					this.showMoreSecondTypesIcon = 'list'
 				}
+			},
+			addCart(id){
+				// console.log('addCart',id);
+				this.$u.api.addCart({goodsId:id}).then(res=>{
+					this.$refs.uToast.show({
+						type:"success",
+						message:res.msg
+					});
+					this.$refs.cartfixed.getCartList();
+					console.log('res',res);
+					}).catch(err=>{
+					console.log('addCart',err.data);
+				})
 			}
 		}
 	}

+ 236 - 0
shopping/productsearch.vue

@@ -0,0 +1,236 @@
+<template>
+	<view class="">
+		<u-navbar
+			:title="title"
+			:autoBack="true"
+			 :safeAreaInsetTop="true"
+		>
+		</u-navbar>
+		<view class="search-wrap">
+			<u-search
+				placeholder="请输入搜索的商品" 
+				:clearabled="true"
+				:showAction="false"
+				height="80rpx"
+				@search="search"
+				@custom="search"
+				@clear="reloadList"
+				bgColor="#fff"
+				borderColor="#00A447"
+				v-model="params.goodsName">
+			</u-search>
+		</view>
+		<view class="search-history page-wrap" v-if="searchHistory.length>0">
+			<view class="search-title u-flex u-row-between">
+				<text>最近搜索</text>
+				<u-icon @click="clearStorage" name="trash" color="#666" size="35"></u-icon>
+			</view>
+			<view class="history-wrap">
+				<text class="history" v-for="(item,index) in searchHistory" :key="index">
+					{{item.name}}
+				</text>
+			</view>
+		</view>
+		<mescroll-body class="" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
+			<view class="page-wrap" >
+				<view class="" v-for="item in dataList" :key="item.id" @click="$u.route('/shopping/productdetails',{id:item.id})">
+					<view class="product u-flex">
+						<u--image :showLoading="true" :src="item.mainImg" width="180rpx" height="180rpx"></u--image>
+						<view class="text">
+							<view class="name ellipsis-2">{{item.goodsName}}</view>
+							<view class="u-flex u-row-between">
+								<view class="left">
+									<view class="up">
+										<view class="" v-if="vuex_member_info.levelType>1">
+											<text class="price">¥ <text class="price-num">{{item.vipPrice}}</text></text>
+											<text class="vip-icon">VIP</text>
+										</view>
+										<view class="" v-else>
+											<text class="price">¥ <text class="price-num">{{item.salePrice}}</text></text>
+										</view>
+									</view>
+									<view class="down">
+										<!-- <text class="discount">8.8折</text> -->
+										<text v-if="vuex_member_info.levelType>1" class="original-price gray line-through">¥ {{item.salePrice}}</text>
+										<text class="sales gray">销量 {{item.saleCount}}</text>
+									</view>
+								</view>
+								<u--image :showLoading="false" @click.native.stop="addCart(item.id)" :src="staticUrl+'/img/add.png'" width="48rpx" height="48rpx"></u--image>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</mescroll-body>
+		<cartfixed ref="cartfixed" @getCartList="getCartList" />
+		<u-toast ref="uToast"></u-toast>
+	</view>
+</template>
+
+<script>
+	// 引入mescroll-mixins.js
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+	import cartfixed from "../components/cartfixed.vue"
+	export default {
+		mixins: [MescrollMixin], // 使用mixin
+		components: {
+			cartfixed
+		},
+		data() {
+			return {
+				staticUrl:this.$commonConfig.staticUrl,
+				downOption: {},
+				// 上拉加载的配置(可选, 绝大部分情况无需配置)
+				upOption: {
+					page: {
+						size: 10 // 每页数据的数量,默认10
+					},
+					noMoreSize: 3, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
+					empty: {
+						tip: '暂无相关数据'
+					}
+				},
+				title:'产品搜索',
+				params:{
+					goodsName:'',
+					// isExplode:0,//是否爆款 0不是,1是
+				},
+				// 列表数据
+				dataList: [],
+				searchHistory:[],
+			}
+		},
+		onLoad(page) {
+			let that = this;
+			this.params.goodsName = page.goodsName;
+			uni.getStorage({
+				key:'searchgoodshistory',
+				 success: function(storagedata) {
+					 that.searchHistory = storagedata.data;
+					 console.log('storagedata',storagedata.data);
+				 }
+			})
+		},
+		onShow() {
+			this.$refs.cartfixed.getCartList();
+		},
+		methods: {
+			/*下拉刷新的回调, 重置列表为第一页 (此处可删,mixins已默认)
+			downCallback(){
+				this.mescroll.resetUpScroll();
+			},
+			/*上拉加载的回调*/
+			upCallback(page) {
+				let that = this;
+				// 此处可以继续请求其他接口
+				// if(page.num == 1){
+				// 	// 请求其他接口...
+				// }
+				let pageNum = page.num; // 页码, 默认从1开始
+				let pageSize = page.size; // 页长, 默认每页10条
+				this.params = Object.assign(this.params,{pageNum:pageNum,pageSize:pageSize});
+				console.log('this.params',this.params);
+				this.$u.api.memberGoodList(this.params).then(data => {
+					console.log('data',JSON.parse(JSON.stringify(data)));
+					// 接口返回的当前页数据列表 (数组)
+					let curPageData = data.data.rows;
+					console.log('curPageData',JSON.parse(JSON.stringify(curPageData)));
+					// 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
+					let curPageLen = curPageData.length; 
+					// 接口返回的总页数 (如列表有26个数据,每页10条,共3页; 则totalPage=3)
+					// let totalPage =  data.data.data.totalPage; 
+					// 接口返回的总数据量(如列表有26个数据,每页10条,共3页; 则totalSize=26)
+					let totalSize = data.data.total; 
+					// 接口返回的是否有下一页 (true/false)
+					// let hasNext = data.xxx; 
+					// console.log('totalPage',totalPage,'curPageLen',curPageLen);
+					//设置列表数据
+					if(page.num == 1) this.dataList = []; //如果是第一页需手动置空列表
+					this.dataList = this.dataList.concat(curPageData); //追加新数据
+					// 请求成功,隐藏加载状态
+					//方法一(推荐): 后台接口有返回列表的总页数 totalPage
+					// this.mescroll.endByPage(curPageLen, totalPage); 
+					//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+					this.mescroll.endBySize(curPageLen, totalSize); 
+				}).catch(err => {
+					this.mescroll.endErr()
+					console.log(err)
+				});	
+				
+				// 存储历史数据
+				let index = this.searchHistory.findIndex(item => item.name === that.params.goodsName);
+				console.log('index',index);
+				if (index !== -1) {
+				  // 已经存在,不用重复添加了
+				  return;
+				}
+				this.searchHistory.push({ name: that.params.goodsName });
+				uni.setStorage({
+				  key: 'searchgoodshistory',
+				  data: that.searchHistory,
+				  success: function() {
+				    // console.log('数据存储成功')
+				  },
+				  fail: function() {
+				    // console.log('数据存储失败')
+				  }
+				});
+			},
+			/*若希望重新加载列表,只需调用此方法即可(内部会自动page.num=1,再主动触发up.callback)*/
+			reloadList() {
+				this.mescroll.resetUpScroll();
+			},
+			search(e){
+				this.mescroll.resetUpScroll();
+				// this.reloadList();
+				console.log('search',e)
+			},
+			addCart(id){
+				// console.log('addCart',id);
+				this.$u.api.addCart({goodsId:id}).then(res=>{
+					this.$refs.uToast.show({
+						type:"success",
+						message:res.msg
+					});
+					this.$refs.cartfixed.getCartList();
+					console.log('res',res);
+					}).catch(err=>{
+					console.log('addCart',err.data);
+				})
+			},
+			clearStorage(){
+				let that = this;
+				uni.clearStorage({
+					key:'searchgoodshistory',
+					success:function(){
+						that.searchHistory = []
+					}
+				})
+			}
+		}
+	}
+</script>
+<style lang="scss" scoped>
+.search-history{
+	color: #333333;
+	margin-bottom: 30rpx;
+	.search-title{
+		font-size: 32rpx;
+		font-weight: 600;
+		line-height: 45rpx;
+		margin-bottom: 20rpx;
+	}
+	.history{
+		display: inline-block;
+		height: 48rpx;
+		line-height: 48rpx;
+		background: #F5F5F5;
+		border-radius: 24rpx;
+		padding: 0 24rpx;
+		min-width: 100rpx;
+		margin-left: 20rpx;
+		margin-bottom: 20rpx;
+		text-align: center;
+	}
+}
+</style>

+ 21 - 0
static/css/common.scss

@@ -62,4 +62,25 @@
 		color: #999;
 	}
 }
+.news-content{
+	font-size: 26rpx;
+	font-weight: 400;
+	color: #666666;
+	line-height: 44rpx;
+	p{
+		text-indent: 2em;
+	}
+	/deep/ .u-image{
+		margin-bottom: 20rpx;
+		max-width: 100%;
+	}
+	.title{
+		font-size: 30rpx;
+		font-weight: 400;
+		color: #333333;
+		line-height: 50rpx;
+		margin: 30rpx auto 15rpx;
+	}
+}
+
 

+ 1 - 0
uni.scss

@@ -298,5 +298,6 @@ page{
 	right: 0;
 	.img{
 		width: 100%;
+		height: 100vh;
 	}
 }

+ 48 - 3
xushuo/about.vue

@@ -15,6 +15,21 @@
 			activeColor="#00A447"
 			@change="sectionChange"
 			:current="curNow"></u-subsection>
+			<view class="content">
+				<view class="" v-if="curNow==0">
+					<view class="name">贵州旭烁食品有限公司简介</view>
+					<u--image v-if="pageData.uxImg" :src="pageData.uxImg" :showLoading="true" width="100%" mode="aspectFill"></u--image>
+					<view class="xsIntro">{{pageData.xsIntro}}</view>
+					<view class="shopIntro">
+						<view class="title">一、成立背景</view>
+						{{pageData.shopIntro}}
+					</view>
+					<!-- <view class="shopIntro">{{pageData.shopIntro}}</view> -->
+				</view>
+				<view class="" v-if="curNow==1">
+					
+				</view>
+			</view>
 		</view>
 	</view>
 </template>
@@ -29,6 +44,7 @@
 				navbarTitle:'',
 				typeList:['旭烁简介','商行简介'],
 				curNow:0,
+				pageData:{}
 			}
 		},
 		watch:{
@@ -51,9 +67,10 @@
 			getIntro(){
 				let type = this.curNow + 1;
 				this.$u.api.xsGetIntro({type:type}).then(res=>{
-					console.log('res',res);
+					this.pageData = res.data;
+					// console.log('res',res);
 				}).catch(err=>{
-					console.log('err11111',err.data);
+					console.log('xsGetIntro',err.data);
 				})
 			}
 		}
@@ -65,6 +82,34 @@ page{
 }
 </style>
 <style lang="scss" scoped>
-
+.content{
+	font-size: 26rpx;
+	font-weight: 400;
+	color: #666666;
+	line-height: 44rpx;
+	.name{
+		font-size: 32rpx;
+		font-weight: 600;
+		color: #333333;
+		line-height: 45rpx;
+		text-align: center;
+		margin-top: 34rpx;
+		margin-bottom: 30rpx;
+	}
+	.title{
+		font-size: 30rpx;
+		font-weight: 400;
+		color: #333333;
+		line-height: 50rpx;
+		margin: 30rpx auto 15rpx;
+	}
+	.xsIntro{
+		font-size: 24rpx;
+		font-weight: 400;
+		color: #999999;
+		line-height: 33rpx;
+		margin: 20rpx auto 50rpx;
+	}
+}
 
 </style>

+ 35 - 7
xushuo/dynamicdetails.vue

@@ -7,12 +7,26 @@
 		>
 		</u-navbar>
 		<view class="page-wrap">
-			<view class="title">{{pageData.title}}</view>
-			<view class="info u-flex u-row-between">
-				<view class="time">{{pageData.createTime}}</view>
-				<view class="view-count">{{pageData.viewCount}}</view>
+			<view class="base-info" v-if="type=='swiperDetail'">
+				<view class="title">{{swiperDetails.name}}</view>
+				<view class="info u-flex u-row-between">
+					<view class="time">{{swiperDetails.createTime}}</view>
+					<!-- <view class="view-count">{{swiperDetails.viewCount}}</view> -->
+				</view>
+			</view>
+			<view v-else class="base-info">
+				<view class="title">{{pageData.title}}</view>
+				<view class="info u-flex u-row-between">
+					<view class="time">{{pageData.createTime}}</view>
+					<view class="view-count">浏览量:{{pageData.viewCount}}</view>
+				</view>
 			</view>
-			<view class="content-wrap">
+			
+			<view class="" v-if="type=='swiperDetail'">
+				<u--image :src="swiperDetails.sliderImg" :showLoading="true" width="100%" mode="aspectFill"></u--image>
+				<view class="" v-html="swiperDetails.detail"></view>
+			</view>
+			<view v-else class="content-wrap">
 				<u--image :src="pageData.mainImg" :showLoading="true" width="100%" mode="aspectFill"></u--image>
 				<view class="content">
 					{{pageData.content}}
@@ -32,13 +46,15 @@ export default{
 				title:'',
 				content:''
 			},
+			swiperDetails:{},
 		}
 	},
 	onLoad(page) {
 		this.id = page.id;
 		this.type = page.type;
 		if(this.type=='swiperDetail'){
-			this.swiperDetails(this.id);
+			console.log('this.id',this.id);
+			this.getSwiperDetails(this.id);
 		}else{
 			this.getDetails(this.id);
 			this.addViewCount(this.id);
@@ -56,7 +72,7 @@ export default{
 		},
 		getSwiperDetails(id){
 			this.$u.api.swiperDetails({id:id}).then(res=>{
-				this.pageData = res.data;
+				this.swiperDetails = res.data;
 				// console.log('res',res);
 				}).catch(err=>{
 				console.log('getSwiperDetails',err.data);
@@ -90,6 +106,18 @@ page{background-color: #F5F5F5;}
 	color: #999999;
 	line-height: 33rpx;
 }
+.page-wrap{
+	font-size: 26rpx;
+	font-weight: 400;
+	color: #666666;
+	line-height: 44rpx;
+	p{
+		text-indent: 2em;
+	}
+	/deep/ .u-image{
+		margin-bottom: 20rpx;
+	}
+}
 .content{
 	font-size: 26rpx;
 	font-weight: 400;

+ 9 - 4
xushuo/experience.vue

@@ -6,8 +6,11 @@
 			 :safeAreaInsetTop="true"
 		>
 		</u-navbar>
-		<view class="page-wrap">
-			
+		<view class="page-wrap news-content">
+			<view class="title">一、体验中心介绍</view>
+			<view class="">{{xsIntro.uxIntro}}</view>
+			<view class="title">二、体验店分布</view>
+			<u--image :src="xsIntro.uxImg" :showLoading="true" width="100%" mode="aspectFill"></u--image>
 		</view>
 	</view>
 </template>
@@ -19,6 +22,7 @@
 		},
 		data() {
 			return {
+				xsIntro:{}
 			}
 		},
 		watch:{
@@ -29,10 +33,11 @@
 		},
 		methods: {
 			getIntro(){
-				this.$u.api.xsGetIntro({type:3}).then(res=>{
+				this.$u.api.xsGetIntro().then(res=>{
+					this.xsIntro = res.data;
 					console.log('res',res);
 				}).catch(err=>{
-					console.log('err11111',err.data);
+					console.log('getIntro',err.data);
 				})
 			}
 		}

+ 33 - 13
xushuo/xushuo.vue

@@ -4,6 +4,7 @@
 			<u-swiper
 				:list="bannerList"
 				indicator
+				keyName="sliderImg"
 				indicatorMode="dot"
 				@click="bannerClick"
 			></u-swiper>
@@ -43,8 +44,8 @@
 						<u-icon name="arrow-right" color="#676767" size="24rpx"></u-icon>
 					</view>
 				</view>
-				<view class="index-img">
-					<u--image class="image" src="https://cdn.uviewui.com/uview/swiper/swiper2.png" width="100%" height="161rpx" radius="15rpx" @click="experienceClick"></u--image>
+				<view class="index-img" @click="$u.route('/xushuo/experience')">
+					<u--image class="image" :src="xsIntro.uxImg" width="100%" height="500rpx" radius="15rpx"></u--image>
 				</view>
 			</view>
 			
@@ -89,24 +90,43 @@
 			return {
 				staticUrl:this.$commonConfig.staticUrl,
 				advantageSize:20,
-				bannerList: [{
-                    url: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
-                    title: '昨夜星辰昨夜风,画楼西畔桂堂东'
-                },{
-                    url: 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
-                    title: '身无彩凤双飞翼,心有灵犀一点通'
-                },{
-                    url: 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
-                    title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
-                }],
+				bannerList: [],
 				tabsList:[],
-				newsList:[]
+				newsList:[],
+				xsIntro:{}
 			}
 		},
 		onLoad() {
 			this.shopNewsType()
+			this.swiperList();
+			this.getIntro();
 		},
 		methods: {
+			swiperList(){
+				this.$u.api.swiperList({postion:3}).then(res=>{
+					this.bannerList = res.data.rows;
+					// console.log('res',res.data.rows);
+				}).catch(err=>{
+					console.log('swiperList',err.data);
+				})
+			},
+			bannerClick(e){
+				// console.log('e',e);
+				// console.log('bannerClick',this.bannerList[e]);
+				let item = this.bannerList[e];
+				uni.$u.route('/xushuo/dynamicdetails', {
+					type: 'swiperDetail',
+					id: item.id
+				});
+			},
+			getIntro(){
+				this.$u.api.xsGetIntro().then(res=>{
+					this.xsIntro = res.data;
+					console.log('res',res.data);
+				}).catch(err=>{
+					console.log('xsGetIntro',err.data);
+				})
+			},
 			shopNewsType(){
 				this.$u.api.shopNewsType().then(res=>{
 					this.tabsList = res.data.splice(0,3);