From 83e49ed8b1ab05dd332def0fba6c3703d1e91373 Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期五, 11 八月 2023 16:32:28 +0800 Subject: [PATCH] Merge branch 'feature/v1.1.5开发' into develop --- uniapp/pages/index/index.vue | 284 +++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 187 insertions(+), 97 deletions(-) diff --git a/uniapp/pages/index/index.vue b/uniapp/pages/index/index.vue index b124795..0dcdf83 100644 --- a/uniapp/pages/index/index.vue +++ b/uniapp/pages/index/index.vue @@ -1,6 +1,11 @@ <template> - <view class="index-wrapper wrapperLayer borderBox"> - <view class="fixed-container colCen borderBox" :style="'background:'+ (categoryCurrent>0?'#EE1B14':(scrollTop>30?'#EE1B14;':bannerColor) +';')"> + <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="topbarbox"></view> <view class="headerSearch-container rowCenBet borderBox"> <view class="leftgoSearchbox rowCen borderBox" @click="goPath('search')"> @@ -11,6 +16,9 @@ <view>杈撳叆鍟嗗搧鍚嶆垨绮樿创瀹濊礉鏍囬鎼滅储</view> </view> </view> + <view class="rightgoMsg rowCenCen iconfont searchImg" @click="goPath('turnChain')"> + <image src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/zhuanlian.png"></image> + </view> <view class="rightgoMsg rowCenCen iconfont" @click="goPath('officialNotice')"> <view></view> <u-badge v-show="isNewMessage" :is-dot="true" type="success"></u-badge> @@ -18,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> @@ -62,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> @@ -78,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> @@ -94,16 +111,18 @@ import utils from '@/utils/utils.js' import indexPage from '../../components/indexPage.vue'; import categoryPage from '../../components/categoryPage.vue'; + import indexnewPage from '../../components/sh_page/indexNewPage.vue'; export default { components: { indexPage, - categoryPage + categoryPage, + indexnewPage }, data() { return { - BulletFrameData:{}, - showBulletFrame:false, // 鐢ㄤ簬鎺у埗寮规骞垮憡鐨勬樉绀� - isNewMessage:false, + BulletFrameData: {}, + showBulletFrame: false, // 鐢ㄤ簬鎺у埗寮规骞垮憡鐨勬樉绀� + isNewMessage: false, shareShow: false, bannerColor: '', cateModel: false, @@ -112,42 +131,27 @@ current: 1, scrollTop: 0, fixedClass: false, - canrefush:true, + canrefush: true, categoryList: [], - canswiper:false, - scrollleftnum:0, - rowLeft:0, - nowcurrentid:'', - recomendType:1 + canswiper: false, + scrollleftnum: 0, + rowLeft: 0, + nowcurrentid: '', + recomendType: 1, + isshowtype: false, + hasshow: false } }, onLoad() { this.getCategoryList(); - this.getPopBannerInfo(); + this.getCusPopupInfo(); + this.getArgument(); }, onShow() { - if(!this.hasLogin){ - setTimeout(function(){ - - uni.reLaunch({ - url:"/pages/login/wxlogin" - }) - },1000); - return; + if (!this.hasshow) { + this.shShow(); } - var user= uni.getStorageSync('userInfo'); - console.log(user); - if(!user.invitation_code) - { - setTimeout(function(){ - - uni.reLaunch({ - url:"/pages/login/wxlogin" - }) - },1000); - return; - } - if(this.categoryList){ + if (this.categoryList) { this.getCategoryList(); } this.getNewMessage(); @@ -156,13 +160,80 @@ this.recomendType = open_like_recommend == "" ? 1 : open_like_recommend; }, onReady() { - this.getTopheight() + this.getTopheight(); }, watch: {}, methods: { - goToShowBulletFrame(info){ - this.showBulletFrame = false + 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.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; + } else { + that.isshowtype = false; + } + } + if (istoLogin) { + if (!that.hasLogin) { + setTimeout(() => { + uni.reLaunch({ + url: "/pages/login/wxlogin" + }) + }, 1000) + + } + /* var user= uni.getStorageSync('userInfo'); + if(!user.invitation_code) + { + setTimeout(function(){ + + uni.reLaunch({ + url:"/pages/login/wxlogin" + }) + },1000); + return; + } */ + } + + // #endif + }).catch(function(err) { + console.log(err); + }) + }, + 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鏁版嵁 @@ -172,47 +243,46 @@ }).then(e => { if (e.code == 1) return that.$alert(e.msg); var res = e.data.info; - console.log(res) - 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) {}) }, // 椤甸潰鏍峰紡澶勭悊 @@ -246,15 +316,14 @@ this.$refs.indexPage[0].getNextPage() } }, - - swipering(){ + + swipering() { this.canrefush = false }, - - stopswiper(){ + + stopswiper() { this.canrefush = true }, - // 璺敱璺宠浆 goPath(url) { if (url == 'search') { @@ -264,6 +333,10 @@ } else if (url == 'officialNotice') { uni.navigateTo({ url: './officialNotice' + }) + } else if (url == 'turnChain') { + uni.navigateTo({ + url: '../mine/tools/turnChain' }) } }, @@ -302,7 +375,6 @@ getTopheight() { // 鑾峰彇椤堕儴楂樺害 uni.createSelectorQuery().in(this).select('.fixed-container').boundingClientRect(data => { - console.log("寰楀埌甯冨眬浣嶇疆淇℃伅" + JSON.stringify(data)); this.Topheight = data.height }).exec(); }, @@ -328,6 +400,11 @@ </script> <style lang="scss"> + uni-image { + width: 30rem; + height: 25rem + } + .index-wrapper { height: 100vh; overflow: hidden; @@ -364,7 +441,7 @@ z-index: 100; .leftgoSearchbox { - width: 615rpx; + width: 575rpx; height: 70rpx; background-color: #FFFFFF; border: 1rpx solid #EDEDED; @@ -388,6 +465,15 @@ } .rightgoMsg { + width: 40rpx; + height: 40rpx; + font-size: 50rpx; + color: #FFFFFF; + } + } + + .searchImg { + image { width: 40rpx; height: 40rpx; font-size: 50rpx; @@ -522,29 +608,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: -150rpx; - 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