| | |
| | | <template> |
| | | <view v-if="isshowtype"> |
| | | <indexnewPage :Topheight="Topheight" :recomendType="recomendType" :canrefush='canrefush' :fixedClass='fixedClass'></indexnewPage> |
| | | <indexnewPage :Topheight="Topheight" :recomendType="recomendType" :canrefush='canrefush' |
| | | :fixedClass='fixedClass'></indexnewPage> |
| | | </view> |
| | | <view v-else 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:'+ (categoryCurrent>0?'#EE1B14':(scrollTop>30?'#EE1B14;':bannerColor) +';')"> |
| | | <view class="topbarbox"></view> |
| | | <view class="headerSearch-container rowCenBet borderBox"> |
| | | <view class="leftgoSearchbox rowCen borderBox" @click="goPath('search')"> |
| | |
| | | </view> |
| | | |
| | | <view class="categoryNavbar-container rowCenBet"> |
| | | <scroll-view class="categoryScroll" scroll-x scroll-with-animation @scroll="rowscroll" :scroll-into-view="nowcurrentid" :scroll-left="scrollleftnum"> |
| | | <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 class="category-items colCenCen" @click="cateChange(index)" :id="categoryCurrent==index?'category-items-active':''" :class="categoryCurrent==index?'category-items-active':''"> |
| | | <view class="category-items colCenCen" @click="cateChange(index)" |
| | | :id="categoryCurrent==index?'category-items-active':''" |
| | | :class="categoryCurrent==index?'category-items-active':''"> |
| | | <view class="categoryname"> |
| | | {{items.cname}} |
| | | </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 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> |
| | | <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 |
| | | v-if="index==categoryCurrent+1 || index==categoryCurrent-1 || index==categoryCurrent" |
| | | :parentId='items.cid' :Topheight='Topheight' :canrefush='canrefush' |
| | | :canload='index==categoryCurrent'> |
| | | </categoryPage> |
| | | </view> |
| | | </swiper-item> |
| | |
| | | <u-mask :show="showBulletFrame"> |
| | | <view class="warp"> |
| | | <!-- <view @tap.stop> --> |
| | | <image class="pic" :src="BulletFrameData.image" mode="aspectFit" @tap.stop="goToShowBulletFrame(BulletFrameData)"/> |
| | | <image class="pic" :src="BulletFrameData.image" mode="aspectFit" |
| | | @tap.stop="goToShowBulletFrame(BulletFrameData)" /> |
| | | <!-- </view> --> |
| | | <view class="clone" @click="showBulletFrame = false"> |
| | | <image class="image" width="64rpx" height="64rpx" src="/static/images/app/close.png"></image> |
| | |
| | | }, |
| | | onLoad() { |
| | | this.getCategoryList(); |
| | | this.getPopBannerInfo(); |
| | | |
| | | this.getCusPopupInfo(); |
| | | this.getArgument(); |
| | | }, |
| | | onShow() { |
| | | if(!this.hasshow) |
| | | { |
| | | if (!this.hasshow) { |
| | | this.shShow(); |
| | | } |
| | | if(this.categoryList){ |
| | |
| | | }, |
| | | watch: {}, |
| | | methods: { |
| | | |
| | | shShow() |
| | | getArgument() |
| | | { |
| | | var arg=getApp().globalData.argumentStr; |
| | | if(arg&&arg.length>0) |
| | | { |
| | | getApp().targetArgument(arg); |
| | | getApp().globalData.argumentStr=""; |
| | | } |
| | | }, |
| | | shShow() { |
| | | var that=this; |
| | | var istoLogin=true; |
| | | this.$u.api.comminInt({}).then(e => { |
| | |
| | | that.isshowtype=false; |
| | | } |
| | | } |
| | | if(istoLogin) |
| | | { |
| | | if (istoLogin) { |
| | | if(!that.hasLogin){ |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | |
| | | this.showBulletFrame = false |
| | | utils.goUrl(info, this) |
| | | }, |
| | | |
| | | getCusPopupInfo() { //获取自定义弹窗数据 |
| | | var that = this; |
| | | this.$u.api.getCustomizePopup({}).then(e => { |
| | | if (e.code == 0) { |
| | | var res = e.data; |
| | | if (res.haspop) { //有自定义弹窗 |
| | | this.showBulletFrame = true; |
| | | this.BulletFrameData = res.info; |
| | | } else { |
| | | this.getPopBannerInfo(); |
| | | } |
| | | } |
| | | }).catch(function(err) { |
| | | this.getPopBannerInfo(); |
| | | }) |
| | | }, |
| | | getPopBannerInfo() { |
| | | // banner数据 |
| | | var that = this; |
| | |
| | | this.showBulletFrame = true; |
| | | this.BulletFrameData = res[0] |
| | | } |
| | | }).catch(function(err) { |
| | | }) |
| | | }).catch(function(err) {}) |
| | | }, |
| | | getNewMessage(){ |
| | | var that = this; |
| | |
| | | let oldId = uni.getStorageSync('topMessageId'); |
| | | if(oldId != e.data.id)that.isNewMessage = true; |
| | | } |
| | | }).catch(function (err) { |
| | | }) |
| | | }).catch(function(err) {}) |
| | | }, |
| | | rowscroll(e){ |
| | | this.rowLeft = e.scrollLeft |
| | |
| | | }, |
| | | getCategoryList() { |
| | | var that = this; |
| | | this.$u.api.getTopCalss({ctype:1,parentId:0}).then(e => { |
| | | this.$u.api.getTopCalss({ |
| | | ctype: 1, |
| | | parentId: 0 |
| | | }).then(e => { |
| | | if(e.code != 0)return that.$alert(e.msg) |
| | | var obj = {} |
| | | obj.cname = '推荐'; |
| | |
| | | obj.ctype = 0; |
| | | that.categoryList = e.data.list; |
| | | that.categoryList.unshift(obj); |
| | | }).catch(function (err) { |
| | | }) |
| | | }).catch(function(err) {}) |
| | | }, |
| | | |
| | | // 页面样式处理 |
| | |
| | | uni.navigateTo({ |
| | | url: './officialNotice' |
| | | }) |
| | | } |
| | | else if(url=='turnChain') |
| | | { |
| | | } else if (url == 'turnChain') { |
| | | uni.navigateTo({ |
| | | url: '../mine/tools/turnChain' |
| | | }) |
| | |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | uni-image |
| | | { |
| | | uni-image { |
| | | width:30rem; |
| | | height:25rem |
| | | } |
| | | |
| | | .index-wrapper { |
| | | height: 100vh; |
| | | overflow: hidden; |
| | |
| | | color: #FFFFFF; |
| | | } |
| | | } |
| | | |
| | | .searchImg{ |
| | | image{ |
| | | width: 40rpx; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .warp{ |
| | | position: relative; |
| | | top:50%; |
| | |
| | | align-items: center; |
| | | justify-content: center; |
| | | width: 100%; |
| | | |
| | | .pic{ |
| | | // width: 86.6%; |
| | | // height: 100vw; |
| | |
| | | position:absolute; |
| | | bottom: -30rpx; |
| | | transform: translate(calc(50% - 32rpx)); |
| | | |
| | | .image { |
| | | width: 64rpx; |
| | | margin: 0 auto; |