| | |
| | | <template> |
| | | <view style="background: #fff;" class="index-wrapper wrapperLayer borderBox"> |
| | | <view class="fixed-container colCen borderBox" :style="'background:'+ (categoryCurrent>0?'#EE1B14':(scrollTop>30?'#EE1B14;':bannerColor) +';')"> |
| | | <view class="fixed-container colCen borderBox" style="background: #0f0f0f;"> |
| | | <view class="topbarbox"></view> |
| | | <view class="headerSearch-container rowCenBet borderBox"> |
| | | <view class="leftgoSearchbox rowCen borderBox" @click="goPath('search')"> |
| | |
| | | <view></view> |
| | | </view> |
| | | <view class="hotSearchbox rowCenCen"> |
| | | <view>输入商品名</view> |
| | | <view>输入商品名或粘贴宝贝标题搜索</view> |
| | | </view> |
| | | </view> |
| | | <view class="rightgoMsg rowCenCen iconfont searchImg" @click="goPath('turnChain')"> |
| | |
| | | <u-badge v-show="isNewMessage" :is-dot="true" type="success"></u-badge> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- <view class="categoryNavbar-container rowCenBet"> |
| | | |
| | | <view class="categoryNavbar-container rowCenBet"> |
| | | <scroll-view class="categoryScroll" scroll-x scroll-with-animation @scroll="rowscroll" :scroll-into-view="nowcurrentid" :scroll-left="scrollleftnum"> |
| | | <block v-for="(items,index) in categoryList" :key='index'> |
| | | <view class="category-container"> |
| | |
| | | </view> |
| | | </block> |
| | | </scroll-view> |
| | | |
| | | |
| | | <view class="category-icon-box rowCenCen" @click="showCateModel()"> |
| | | <view class="iconfont"></view> |
| | | </view> |
| | | </view> --> |
| | | </view> |
| | | </view> |
| | | <!-- 弹框 --> |
| | | <view class="categoryModel-wrapper" @touchmove.prevent> |
| | |
| | | </swiper-item> |
| | | </swiper> |
| | | </view> |
| | | |
| | | <!-- 弹框 --> |
| | | <view class="categoryModel-wrapper" @touchmove.prevent> |
| | | <view class="shadow" :class="cateModel?'showShadow':''" @click="closeModel()"></view> |
| | | <view class="category-content" :style="'top:'+Topheight+'px'" :class="cateModel?'showcate':''"> |
| | | <view class="catelist-box colCen borderBox" v-if="cateModel"> |
| | | <view class="titlebar rowCen"> |
| | | <view>选择分类</view> |
| | | </view> |
| | | |
| | | <view class="list-container borderBox rowCen"> |
| | | <block v-for="(items,index) in categoryList" :key='index'> |
| | | <view class="cate-items colCen" v-if="index!=0" @click="changeCurrent(index,items.cid)"> |
| | | <view class="picbox defIcon"> |
| | | <image :src="items.cpic" mode="aspectFill" :lazy-load="true"></image> |
| | | </view> |
| | | <view class="catename"> |
| | | {{items.cname}} |
| | | </view> |
| | | </view> |
| | | </block> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="body-container colCen borderBox"> |
| | | <swiper class="pageSwiper" :disable-touch='canswiper' duration="200" :current='categoryCurrent' @change='changeCatepage' @transition='swipering' @animationfinish='stopswiper'> |
| | | <swiper-item v-for="(items,index) in categoryList" :key='index' :current-item-id='items.cid'> |
| | | <view v-if='index==0'> |
| | | <indexPage ref='indexPage' :recomendType="recomendType" :canrefush='canrefush' :fixedClass='fixedClass' @scrolltoTop='scrolltoTop' @scrolltoview='scrolltoview' |
| | | @pushfixed='getfixed' @scrollNum='getScroll' :Topheight='Topheight' @passColor='getColor'></indexPage> |
| | | </view> |
| | | <view v-else> |
| | | <categoryPage v-if="index==categoryCurrent+1 || index==categoryCurrent-1 || index==categoryCurrent" :parentId='items.cid' |
| | | :Topheight='Topheight' :canrefush='canrefush' :canload='index==categoryCurrent'> |
| | | </categoryPage> |
| | | </view> |
| | | </swiper-item> |
| | | </swiper> |
| | | </view> |
| | | <!-- 弹框广告 --> |
| | | <u-mask :show="showBulletFrame"> |
| | | <view class="warp"> |
| | |
| | | import categoryPage from '@/components/categoryPage.vue'; |
| | | export default { |
| | | props: { |
| | | |
| | | recomendType: { |
| | | type: Number, |
| | | default: 1 |
| | | }, |
| | | Topheight: { |
| | | type: Number, |
| | | default: 90 |
| | | }, |
| | | fixedClass: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | | }, |
| | | components: { |
| | | indexPage, |
| | |
| | | shareShow: false, |
| | | bannerColor: '', |
| | | cateModel: false, |
| | | Topheight: 0, |
| | | categoryCurrent: 0, |
| | | current: 1, |
| | | scrollTop: 0, |
| | | fixedClass: false, |
| | | canrefush:true, |
| | | categoryList: [], |
| | | canswiper:false, |
| | | scrollleftnum:0, |
| | | rowLeft:0, |
| | | canrefush:false, |
| | | nowcurrentid:'', |
| | | recomendType:1 |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | this.getCategoryList(); |
| | | this.getPopBannerInfo(); |
| | | if(this.categoryList){ |
| | |
| | | this.recomendType = open_like_recommend == "" ? 1 : open_like_recommend; |
| | | }, |
| | | onShow() { |
| | | if(!this.hasLogin){ |
| | | setTimeout(function(){ |
| | | uni.reLaunch({ |
| | | url:"/pages/login/wxlogin" |
| | | }) |
| | | },1000); |
| | | return; |
| | | } |
| | | var user= uni.getStorageSync('userInfo'); |
| | | console.log(user); |
| | | if(!user.invitation_code) |
| | |
| | | return; |
| | | } |
| | | |
| | | }, |
| | | onReady() { |
| | | this.getTopheight() |
| | | }, |
| | | watch: {}, |
| | | methods: { |
| | |
| | | }).then(e => { |
| | | if (e.code == 1) return that.$alert(e.msg); |
| | | var res = e.data.info; |
| | | console.log(res) |
| | | if(res.length > 0){ |
| | | this.showBulletFrame = true; |
| | | this.BulletFrameData = res[0] |
| | |
| | | }, |
| | | changeCatepage(e) { |
| | | // 滑动切换 |
| | | /* this.bannerColor = '#EE1B14' |
| | | this.bannerColor = '#EE1B14' |
| | | this.categoryCurrent = e.detail.current |
| | | this.currentscroll() */ |
| | | this.currentscroll() |
| | | }, |
| | | cateChange(idx) { |
| | | // 分类点击 |
| | |
| | | }, |
| | | getTopheight() { |
| | | // 获取顶部高度 |
| | | console.log("开始获取高度") |
| | | uni.createSelectorQuery().in(this).select('.fixed-container').boundingClientRect(data => { |
| | | console.log("得到布局位置信息" + JSON.stringify(data)); |
| | | this.Topheight = data.height |
| | |
| | | } |
| | | </script> |
| | | |
| | | |
| | | <style lang="scss"> |
| | | .index-wrapper { |
| | | height: 100vh; |
| | | overflow: hidden; |
| | | margin-top: 160rpx; |
| | | |
| | | .body-container { |
| | | width: 100%; |
| | | |
| | | |
| | | .pageSwiper { |
| | | width: 100%; |
| | | overflow: hidden; |
| | |
| | | left: 0; |
| | | padding: 0 32rpx; |
| | | z-index: 600; |
| | | background: linear-gradient(to right,#ee1b14,#ee1b144d); |
| | | //background-color: #EE1B14; |
| | | background-color: #EE1B14; |
| | | // transition: all 0.5s; |
| | | |
| | | .headerSearch-container { |
| | |
| | | } |
| | | } |
| | | </style> |
| | | |