From eb4d171a50e4940d4822ec57641ba24be7747afa Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期三, 26 七月 2023 14:05:41 +0800 Subject: [PATCH] no message --- uniapp/pages/index/index.vue | 233 ++++++++++++++++++++++++++++++++------------------------- 1 files changed, 130 insertions(+), 103 deletions(-) diff --git a/uniapp/pages/index/index.vue b/uniapp/pages/index/index.vue index 5104307..65d18af 100644 --- a/uniapp/pages/index/index.vue +++ b/uniapp/pages/index/index.vue @@ -1,9 +1,11 @@ <template> - <view v-if="isshowtype"> - <indexnewPage :Topheight="Topheight" :recomendType="recomendType" :canrefush='canrefush' :fixedClass='fixedClass'></indexnewPage> + <view v-if="isshowtype"> + <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')"> @@ -24,10 +26,13 @@ </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> @@ -68,15 +73,20 @@ </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> @@ -84,14 +94,15 @@ </view> <!-- 寮规骞垮憡 --> <u-mask :show="showBulletFrame"> - <view class="warp"> - <!-- <view @tap.stop> --> - <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> - </view> - </view> + <view class="warp"> + <!-- <view @tap.stop> --> + <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> + </view> + </view> </u-mask> </view> </template> @@ -109,9 +120,9 @@ }, data() { return { - BulletFrameData:{}, - showBulletFrame:false, // 鐢ㄤ簬鎺у埗寮规骞垮憡鐨勬樉绀� - isNewMessage:false, + BulletFrameData: {}, + showBulletFrame: false, // 鐢ㄤ簬鎺у埗寮规骞垮憡鐨勬樉绀� + isNewMessage: false, shareShow: false, bannerColor: '', cateModel: false, @@ -120,28 +131,27 @@ current: 1, scrollTop: 0, fixedClass: false, - canrefush:true, + canrefush: true, categoryList: [], - canswiper:false, - scrollleftnum:0, - rowLeft:0, - nowcurrentid:'', - recomendType:1, - isshowtype:false, - hasshow:false + canswiper: false, + scrollleftnum: 0, + rowLeft: 0, + nowcurrentid: '', + recomendType: 1, + isshowtype: false, + hasshow: false } }, onLoad() { this.getCategoryList(); - this.getPopBannerInfo(); - + this.getCusPopupInfo(); + }, onShow() { - if(!this.hasshow) - { + if (!this.hasshow) { this.shShow(); - } - if(this.categoryList){ + } + if (this.categoryList) { this.getCategoryList(); } this.getNewMessage(); @@ -154,31 +164,29 @@ }, watch: {}, methods: { - - shShow() - { - var that=this; - var istoLogin=true; + + shShow() { + var that = this; + var istoLogin = true; this.$u.api.comminInt({}).then(e => { - that.hasshow=true; + that.hasshow = true; // #ifdef APP-PLUS if (plus.os.name == 'iOS') { if (e.data.basic.iosExamine && plus.runtime.version == e.data.basic.IosExamineV) { - that.isshowtype=true; - istoLogin=false; + that.isshowtype = true; + istoLogin = false; } else { - that.isshowtype=false; + that.isshowtype = false; } } - if(istoLogin) - { - if(!that.hasLogin){ + if (istoLogin) { + if (!that.hasLogin) { setTimeout(() => { uni.reLaunch({ - url:"/pages/login/wxlogin" + url: "/pages/login/wxlogin" }) }, 1000) - + } /* var user= uni.getStorageSync('userInfo'); if(!user.invitation_code) @@ -192,15 +200,32 @@ return; } */ } - + // #endif }).catch(function(err) { console.log(err); }) }, - goToShowBulletFrame(info){ - this.showBulletFrame = false + goToShowBulletFrame(info) { + 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鏁版嵁 @@ -210,46 +235,46 @@ }).then(e => { if (e.code == 1) return that.$alert(e.msg); var res = e.data.info; - if(res.length > 0){ + if (res.length > 0) { this.showBulletFrame = true; this.BulletFrameData = res[0] } - }).catch(function(err) { - }) + }).catch(function(err) {}) }, - getNewMessage(){ + getNewMessage() { var that = this; this.$u.api.getTopMessId({}).then(e => { - if(e.code != 0)return that.$alert(e.msg) - if(e.data.id){ + if (e.code != 0) return that.$alert(e.msg) + if (e.data.id) { let oldId = uni.getStorageSync('topMessageId'); - if(oldId != e.data.id)that.isNewMessage = true; + if (oldId != e.data.id) that.isNewMessage = true; } - }).catch(function (err) { - }) + }).catch(function(err) {}) }, - rowscroll(e){ + rowscroll(e) { this.rowLeft = e.scrollLeft }, - currentscroll(left){ + currentscroll(left) { this.nowcurrentid = '' this.scrollleftnum = this.rowLeft - this.$nextTick(()=>{ + this.$nextTick(() => { this.nowcurrentid = 'category-items-active' }) }, getCategoryList() { var that = this; - this.$u.api.getTopCalss({ctype:1,parentId:0}).then(e => { - if(e.code != 0)return that.$alert(e.msg) + this.$u.api.getTopCalss({ + ctype: 1, + parentId: 0 + }).then(e => { + if (e.code != 0) return that.$alert(e.msg) var obj = {} obj.cname = '鎺ㄨ崘'; obj.cid = 0; obj.ctype = 0; that.categoryList = e.data.list; that.categoryList.unshift(obj); - }).catch(function (err) { - }) + }).catch(function(err) {}) }, // 椤甸潰鏍峰紡澶勭悊 @@ -283,12 +308,12 @@ this.$refs.indexPage[0].getNextPage() } }, - - swipering(){ + + swipering() { this.canrefush = false }, - - stopswiper(){ + + stopswiper() { this.canrefush = true }, // 璺敱璺宠浆 @@ -301,9 +326,7 @@ uni.navigateTo({ url: './officialNotice' }) - } - else if(url=='turnChain') - { + } else if (url == 'turnChain') { uni.navigateTo({ url: '../mine/tools/turnChain' }) @@ -369,11 +392,11 @@ </script> <style lang="scss"> - uni-image - { - width:30rem; - height:25rem + uni-image { + width: 30rem; + height: 25rem } + .index-wrapper { height: 100vh; overflow: hidden; @@ -440,8 +463,9 @@ color: #FFFFFF; } } - .searchImg{ - image{ + + .searchImg { + image { width: 40rpx; height: 40rpx; font-size: 50rpx; @@ -576,30 +600,33 @@ } } } - .warp{ - position: relative; - top:50%; - left:50%; - transform: translate(-50%, -50%); - display:flex; - align-items: center; - justify-content: center; + + .warp { + position: relative; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + display: flex; + align-items: center; + justify-content: center; width: 100%; - .pic{ - // width: 86.6%; + + .pic { + // width: 86.6%; // height: 100vw; - } + } } - + .clone { - position:absolute; - bottom: -30rpx; - transform: translate(calc(50% - 32rpx)); - .image { - width: 64rpx; - margin: 0 auto; - height: 64rpx; - display: block; - } + position: absolute; + bottom: -30rpx; + transform: translate(calc(50% - 32rpx)); + + .image { + width: 64rpx; + margin: 0 auto; + height: 64rpx; + display: block; + } } -</style> +</style> \ No newline at end of file -- Gitblit v1.9.3