From 2448e587f6b62c5ec922248b695d58c5b9387ee4 Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期三, 21 六月 2023 09:33:30 +0800 Subject: [PATCH] no message --- uniapp/components/sh_page/indexNewPage.vue | 98 +++++++++++++++++++++++++++++++++++-------------- 1 files changed, 70 insertions(+), 28 deletions(-) diff --git a/uniapp/components/sh_page/indexNewPage.vue b/uniapp/components/sh_page/indexNewPage.vue index 266b390..8050ddd 100644 --- a/uniapp/components/sh_page/indexNewPage.vue +++ b/uniapp/components/sh_page/indexNewPage.vue @@ -1,6 +1,6 @@ <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')"> @@ -8,7 +8,7 @@ <view></view> </view> <view class="hotSearchbox rowCenCen"> - <view>杈撳叆鍟嗗搧鍚�</view> + <view>杈撳叆鍟嗗搧鍚嶆垨绮樿创瀹濊礉鏍囬鎼滅储</view> </view> </view> <view class="rightgoMsg rowCenCen iconfont searchImg" @click="goPath('turnChain')"> @@ -19,8 +19,8 @@ <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"> @@ -33,11 +33,11 @@ </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> @@ -79,6 +79,47 @@ </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"> @@ -99,7 +140,18 @@ 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, @@ -113,21 +165,20 @@ 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){ @@ -139,14 +190,6 @@ 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) @@ -160,9 +203,6 @@ return; } - }, - onReady() { - this.getTopheight() }, watch: {}, methods: { @@ -301,9 +341,9 @@ }, changeCatepage(e) { // 婊戝姩鍒囨崲 - /* this.bannerColor = '#EE1B14' + this.bannerColor = '#EE1B14' this.categoryCurrent = e.detail.current - this.currentscroll() */ + this.currentscroll() }, cateChange(idx) { // 鍒嗙被鐐瑰嚮 @@ -312,6 +352,7 @@ }, getTopheight() { // 鑾峰彇椤堕儴楂樺害 + console.log("寮�濮嬭幏鍙栭珮搴�") uni.createSelectorQuery().in(this).select('.fixed-container').boundingClientRect(data => { console.log("寰楀埌甯冨眬浣嶇疆淇℃伅" + JSON.stringify(data)); this.Topheight = data.height @@ -338,14 +379,15 @@ } </script> + <style lang="scss"> .index-wrapper { height: 100vh; overflow: hidden; -margin-top: 160rpx; + .body-container { width: 100%; - + .pageSwiper { width: 100%; overflow: hidden; @@ -366,8 +408,7 @@ 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 { @@ -568,3 +609,4 @@ } } </style> + -- Gitblit v1.9.3