From 6710ed4fc4d67d4f6551d13dd38f7f2b21451d9d Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期五, 30 六月 2023 09:05:48 +0800 Subject: [PATCH] no message --- uniapp/pages/active/tmsearch.vue | 176 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 154 insertions(+), 22 deletions(-) diff --git a/uniapp/pages/active/tmsearch.vue b/uniapp/pages/active/tmsearch.vue index 2de88e6..5dc18e4 100644 --- a/uniapp/pages/active/tmsearch.vue +++ b/uniapp/pages/active/tmsearch.vue @@ -8,7 +8,7 @@  </view> <view class="titleBox rowCen" :style="'color:'+ (scrollTop<fiexdtop?'#DD2425;':'#ffffff;')"> - 澶╃尗 + </view> <view class="rightEmpty"> </view> @@ -18,11 +18,11 @@ <view class="search-region colCen"> <view class="pageTitle-bar rowCenCen"> <view class="leftIcon defIcon"> - <image src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/tmlogo.png" mode="aspectFill"></image> + <image src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/tblogo.jpeg" mode="aspectFill"></image> </view> <view class="titleInfo colSta"> <view class="topfont"> - 澶╃尗浼樻儬鍒稿ぇ鏀鹃�� + 娣樺疂浼樻儬鍒稿ぇ鏀鹃�� </view> <view class="bottomfont"> 鍏堥鍒� 鍐嶈喘鐗� 鐪佸崈鍏� @@ -61,11 +61,28 @@ </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" style="font-size: 13px;margin-right: 30rpx; color: #8b8686;" :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" v-for="(items,index) in goodsList" :key='index' @click="goDetail(items)"> + <!-- <colGoodsImg :popBannerSList="popBannerSList"></colGoodsImg> --> + <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,27 +93,63 @@ <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, navList: [], - fiexdHeight: '', fiexdtop: '', goodsList: [], pageCurrent: 1, canloadmore: false, - loadstatus: 'loading' + loadstatus: 'loading', + nowsec:0, + isinsert:false, + 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 @@ -108,11 +161,9 @@ }, mounted() { uni.createSelectorQuery().in(this).select('.fixed-container').boundingClientRect(data => { - console.log(data.top); this.fiexdHeight = data.height }).exec(); uni.createSelectorQuery().in(this).select('.rangeList-container').boundingClientRect(data => { - console.log(data.top); this.fiexdtop = data.top - this.fiexdHeight }).exec(); }, @@ -120,9 +171,10 @@ getNav() { var that = this; 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,12 +184,14 @@ 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) var res = e.data; uni.stopPullDownRefresh(); @@ -152,8 +206,30 @@ that.loadstatus = 'loading' that.pageCurrent ++ } + /* if(!that.isinsert&&res&&res.length>0) + { + that.goodsList.unshift(res[0]); + that.isinsert=true; + } */ that.goodsList = that.goodsList.concat(res) }).catch(function(err) {}) + }, + getPageImg() + { + var that=this; + this.$u.api.getBanner({ + type: '11,16' + }).then(e => { + if (e.code == 1) return that.$alert(e.msg); + var res = e.data.info; + this.popBannerSList=res.tmImg; + if(res.tmImg&&res.tmImg.length>0) + { + that.goodsList.unshift(res[0]); + } + }).catch(function(err) { + console.log(err) + }) }, changeRange(id) { this.pageCurrent = 1 @@ -163,11 +239,23 @@ this.goodsList = [] this.getData() }, + changeSeRange(id) { + this.pageCurrent = 1 + this.canloadmore = false + this.nowsec = id + this.loadstatus = 'loading' + this.goodsList = [] + this.getData() + }, 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() { @@ -202,7 +290,7 @@ top: 0; left: 0; z-index: 110; - background: linear-gradient(266deg, #E7251C, #E7251C); + background: linear-gradient(266deg, #F97B24, #F97B24); .headerBar-container { width: 100%; @@ -235,7 +323,7 @@ width: 100%; height: 340rpx; padding: 0 75rpx; - background: linear-gradient(266deg, #E7251C, #E7251C); + background: linear-gradient(266deg, #F97B24, #F97B24); .pageTitle-bar { width: 100%; @@ -291,11 +379,55 @@ .right-btn { width: 116rpx; height: 60rpx; - background: linear-gradient(266deg, #FF012E, #FF1017); + background: linear-gradient(266deg, #F97B24, #F97B24); border-radius: 30rpx; font-size: 24rpx; font-weight: 500; color: #FFFFFF; + } + } + } + + .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; + } + + + } } } } @@ -366,7 +498,7 @@ .goods-items { width: 336rpx; - height: 526rpx; + height: 546rpx; margin-bottom: 20rpx; .items-container { -- Gitblit v1.9.3