| | |
| | | <template> |
| | | <view class="pddsearch-wrapper wrapperLayer borderBox" style="background: #fff;"> |
| | | <view class="pddsearch-wrapper wrapperLayer borderBox"> |
| | | <view class="topbarbox"></view> |
| | | <view class="fixed-container colCen"> |
| | | <view class="topbarbox"></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="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}} |
| | |
| | | </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> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import colGoods from '../../components/colGoodsImg.vue' |
| | | 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: [], |
| | |
| | | canloadmore: false, |
| | | loadstatus: 'loading', |
| | | nowsec:0, |
| | | isinsert:false, |
| | | secrendSearch:[ |
| | | { |
| | | id:0, |
| | |
| | | } |
| | | }, |
| | | onLoad() { |
| | | this.getNav() |
| | | this.getNav(); |
| | | this.getPageImg(); |
| | | |
| | | }, |
| | | onPageScroll(e) { |
| | | this.scrollTop = e.scrollTop |
| | |
| | | }, |
| | | 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(); |
| | | }, |
| | |
| | | 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"}); |
| | |
| | | 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(); |
| | |
| | | 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 |
| | |
| | | }, |
| | | |
| | | 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() { |