From a5b825873529c9a8d6039c3638494019318221c3 Mon Sep 17 00:00:00 2001
From: zhaojs <349234519@qq.com>
Date: 星期三, 09 八月 2023 15:44:57 +0800
Subject: [PATCH] no message

---
 uniapp/pages/active/dysearch.vue |   56 ++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 42 insertions(+), 14 deletions(-)

diff --git a/uniapp/pages/active/dysearch.vue b/uniapp/pages/active/dysearch.vue
index a16864e..f924ddf 100644
--- a/uniapp/pages/active/dysearch.vue
+++ b/uniapp/pages/active/dysearch.vue
@@ -50,10 +50,10 @@
 			<view class="rangeList-container rowCen" :class="scrollTop>fiexdtop?'tofixed':''" :style="'top:'+(scrollTop>fiexdtop?fiexdHeight:'0')+'px;'">
 				<scroll-view class="scrollview-content" scroll-x scroll-with-animation="true">
 					<block v-for="(items,index) in navList" :key="index">
-						<view class="rangeItem" :class="nowCurrent==items.cid?'rangeItem-active':''" @tap="changeRange(items.cid)">
+						<view class="rangeItem" :class="nowCurrent==items.cat_id?'rangeItem-active':''" @tap="changeRange(items.cat_id)">
 							<view class="boxcontent colCenCen">
 								<view class="nameBox">
-									{{items.cname}}
+									{{items.cat_name}}
 								</view>
 								<view class="border"></view>
 							</view>
@@ -65,7 +65,8 @@
 			<view class="goodsList-container colCen borderBox">
 				<view class="goods-content rowStaBet">
 					<view class="goods-items borderBox colCen" v-for="(items,index) in goodsList" :key='index' @click="goDetail(items)">
-						<colGoods :items="items"></colGoods>
+						  <colGoodsImg v-if="index==0&&popBannerSList&&popBannerSList.length>0" :popBannerSList="popBannerSList"></colGoodsImg>
+						<colGoods v-else :items="items"></colGoods>
 					</view>
 					<aLoadMore :status="loadstatus" mode="loading3" :showTitle='true' color="#999999"></aLoadMore>
 				</view>
@@ -76,12 +77,15 @@
 
 <script>
 	import colGoods from '../../components/colGoods.vue'
+	import colGoodsImg from '../../components/colGoodsImg.vue'
 	export default {
 		components:{
-			colGoods
+			colGoods,
+			colGoodsImg
 		},
 		data() {
 			return {
+				popBannerSList:[],
 				pageTop: 0,
 				nowCurrent: 0,
 				scrollTop: 0,
@@ -96,7 +100,8 @@
 			}
 		},
 		onLoad() {
-			this.getNav()
+			this.getNav();
+			this.getPageImg();
 		},
 		onPageScroll(e) {
 			this.scrollTop = e.scrollTop
@@ -117,24 +122,44 @@
 			}).exec();
 		},
 		methods: {
+			getPageImg()
+			{
+			 	var that=this;
+				this.$u.api.getBanner({
+					type: '11,18'
+				}).then(e => {
+					console.log(e)
+					if (e.code == 1) return that.$alert(e.msg);
+					var res = e.data.info;
+					this.popBannerSList=res.dyImg;
+					if(res.dyImg&&res.dyImg.length>0)
+					{
+						that.goodsList.unshift(res[0]);
+					}
+				}).catch(function(err) {
+					console.log(err)
+				})
+			},
 			getNav() {
 				var that = this;
-				that.getData();
-				/* this.$u.api.getTopCalss({ctype:3}).then(e => {
+			    this.$u.api.getHdkCategoryList({type:4}).then(e => {
+				    console.log(e);
 					if(e.code != 0)return that.$alert(e.msg)
 					that.navList = e.data.list;
-					that.nowCurrent = that.navList[0].cid
+					that.nowCurrent = that.navList[0].cat_id
 					that.getData()
 				}).catch(function (err) {
-				}) */
+				}) 
 			},
 			getData() {
 				var that = this;
+				console.log(this.nowCurrent);
 				this.$u.api.goodsSearch({
 					type: 'dy',
 					pageId: this.pageCurrent,
 					pageSize: 10,
 					sort: 0,
+					catid:this.nowCurrent,
 					//owner: this.selfsupport ? 'g' : '',
 					//selectCoupon: this.selectCoupon == true ? 1 : 0
 				}).then(e => {
@@ -142,7 +167,7 @@
 					var res = e.data;
 					uni.stopPullDownRefresh();
 					var res = e.data.list;
-					console.log(res);
+					
 					if (res.length < 10) {
 						that.pageCurrent ++
 						that.canloadmore = false
@@ -191,9 +216,12 @@
 			},
 
 			goDetail(info) {
-				uni.navigateTo({
-					url: '../goods/goodsDetail?info=' + encodeURIComponent(JSON.stringify(info))
-				})
+				if(info&&info!=undefined)
+				{
+					uni.navigateTo({
+						url: '../goods/goodsDetail?info=' + encodeURIComponent(JSON.stringify(info))
+					})
+				}
 			},
 
 			goback() {
@@ -392,7 +420,7 @@
 
 					.goods-items {
 						width: 336rpx;
-						height: 526rpx;
+						height: 546rpx;
 						margin-bottom: 20rpx;
 
 						.items-container {

--
Gitblit v1.9.3