From fee11c59ab6c14449bb0441df1e390efe4453074 Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期三, 21 六月 2023 13:55:38 +0800 Subject: [PATCH] no message --- uniapp/pages/active/tmsearch.vue | 139 +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 131 insertions(+), 8 deletions(-) diff --git a/uniapp/pages/active/tmsearch.vue b/uniapp/pages/active/tmsearch.vue index 033b1a6..b35d96a 100644 --- a/uniapp/pages/active/tmsearch.vue +++ b/uniapp/pages/active/tmsearch.vue @@ -1,5 +1,5 @@ <template> - <view class="pddsearch-wrapper wrapperLayer borderBox"> + <view class="pddsearch-wrapper wrapperLayer borderBox" style="background: #fff;"> <view class="topbarbox"></view> <view class="fixed-container colCen"> <view class="topbarbox"></view> @@ -61,11 +61,30 @@ </block> </scroll-view> </view> + <!--浜岀骇鎼滅储--> + <view class="scrangeList-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 secrendSearch" :key="index"> + <view class="rangeItem" :class="nowsec==items.id?'rangeItem-active':''" @tap="changeSeRange(items.id)"> + <view class="boxcontent colCenCen"> + <view class="nameBox"> + {{items.name}} + </view> + <view class="border"></view> + </view> + </view> + </block> + </scroll-view> + </view> <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> + <view class="goods-items borderBox colCen"> + <colGoodsImg :popBannerSList="popBannerSList"></colGoodsImg> + <view v-for="(items,index) in goodsList" :key='index' @click="goDetail(items)"> + <colGoods :items="items"></colGoods> + </view> + </view> <aLoadMore :status="loadstatus" mode="loading3" :showTitle='true' color="#999999"></aLoadMore> </view> @@ -76,27 +95,61 @@ <script> import colGoods from '../../components/colGoods.vue' + import colGoodsImg from '../../components/colGoodsImg.vue' export default { components:{ colGoods }, data() { return { + popBannerSList:[], pageTop: 0, nowCurrent: 0, scrollTop: 0, navList: [], - fiexdHeight: '', fiexdtop: '', goodsList: [], pageCurrent: 1, canloadmore: false, - loadstatus: 'loading' + loadstatus: 'loading', + nowsec:0, + secrendSearch:[ + { + id:0, + name:'缁煎悎' + }, + { + id:1, + name:'60澶╂渶浣庝环' + }, + { + id:2, + name:'鑱氬垝绠�' + }, + { + id:3, + name:'娣樻姠璐�' + }, + { + id:4, + name:'澶氫拱澶氶��' + }, + { + id:5, + name:'闄愰噺鎶㈣喘' + }, + { + id:6, + name:'棰濆婊″噺' + } + ] } }, onLoad() { - this.getNav() + this.getNav(); + this.getPageImg(); + }, onPageScroll(e) { this.scrollTop = e.scrollTop @@ -122,7 +175,9 @@ this.$u.api.getTopCalss({ctype:1,parentId:0}).then(e => { console.log(e); if(e.code != 0)return that.$alert(e.msg) + e.data.list.unshift({cid:"-1",cname:"澶╃尗瓒呭競",ctype:"1"}); e.data.list.unshift({cid:"0",cname:"鍏ㄩ儴",ctype:"1"}); + that.navList = e.data.list; that.nowCurrent = that.navList[0].cid that.getData() @@ -132,10 +187,13 @@ getData() { var that = this; var cateid=that.nowCurrent=="0"?"":that.nowCurrent; + var tchaoshi=cateid==-1?1:0; this.$u.api.getTbGoodsList({ cateId: cateid, page: this.pageCurrent, - pageSize: 10 + pageSize: 10, + tchaoshi:tchaoshi, + secrend_search:this.nowsec }).then(e => { console.log(e); if (e.code != 0) return that.$alert(e.msg) @@ -155,10 +213,31 @@ that.goodsList = that.goodsList.concat(res) }).catch(function(err) {}) }, + getPageImg() + { + this.$u.api.getBanner({ + type: '12' + }).then(e => { + console.log(e) + if (e.code == 1) return that.$alert(e.msg); + var res = e.data.info; + this.popBannerSList=res.popBannerSList; + }).catch(function(err) { + console.log(err) + }) + }, changeRange(id) { this.pageCurrent = 1 this.canloadmore = false this.nowCurrent = id + this.loadstatus = 'loading' + this.goodsList = [] + this.getData() + }, + changeSeRange(id) { + this.pageCurrent = 1 + this.canloadmore = false + this.nowsec = id this.loadstatus = 'loading' this.goodsList = [] this.getData() @@ -299,6 +378,50 @@ } } } + + .scrangeList-container { + width: 100%; + height: 80rpx; + padding-left: 32rpx; + z-index: 101; + + .scrollview-content { + width: 100%; + height: 100%; + white-space: nowrap; + + .rangeItem { + display: inline-flex; + margin-right: 45rpx; + height: 100%; + + .boxcontent { + height: 100%; + + .nameBox { + + } + + .border { + width: 60%; + height: 2rpx; + background: transparent; + } + } + } + + .rangeItem-active { + .boxcontent { + .nameBox { + font-size: 32rpx; + color:#F97B24; + } + + + } + } + } + } .rangeList-container { width: 100%; @@ -366,7 +489,7 @@ .goods-items { width: 336rpx; - height: 526rpx; + height: 546rpx; margin-bottom: 20rpx; .items-container { -- Gitblit v1.9.3