From 6b4ede1806da26d93f5fad839199fe8b2e0641f5 Mon Sep 17 00:00:00 2001 From: zhao_js <349234519@qq.com> Date: 星期二, 28 十一月 2023 16:28:34 +0800 Subject: [PATCH] no message --- uniapp/components/indexPage.vue | 201 +++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 165 insertions(+), 36 deletions(-) diff --git a/uniapp/components/indexPage.vue b/uniapp/components/indexPage.vue index bc0f62c..d375a0f 100644 --- a/uniapp/components/indexPage.vue +++ b/uniapp/components/indexPage.vue @@ -39,7 +39,7 @@ <swiper-item v-for="(sliderItem, index) in navbarShowList" :key="index"> <view class="slider_itemslist rowSta"> <view class="item colCen" v-for="(item, idx) in sliderItem" :key="idx" - @click="goUrl(item)"> + @click="perVerification(item)"> <image :src="item.image" :lazy-load="true" mode="aspectFit"></image> <view class="desc">{{ item.mname }}</view> </view> @@ -404,6 +404,9 @@ </view> </scroll-view> <slideTop v-if="scrollTop>1000" @toTop='scrolltoTops'></slideTop> + + <u-modal v-model="showConModel" show-cancel-button :content="conContent" @confirm="modConfirm" :async-close="true"> + </u-modal> </view> </template> @@ -503,6 +506,11 @@ dybanner:[], pddbanner:[], wphbanner:[], + haspreference:false, + preferData:{}, + showConModel:false, + conContent:'', + urlInfo:{} } }, watch: { @@ -530,12 +538,13 @@ }, created() { this._freshing = false; - this.changeRecommend(); + //this.changeRecommend(); + this.checkPreferenceGoods(); uni.$emit('initpage') this.getBannerInfo(); this.getHomeMenuList(); this.getrecommendGoods(); - this.getbottomGoodsList(this.bottomType); + //this.getbottomGoodsList(this.bottomType); this.getGOODSfalling(); this.getRQList(); //this.getPageImg(); @@ -548,6 +557,76 @@ }, 1500) }, methods: { + perVerification(info) + { + this.urlInfo=info; + var mapPer="鏈湴鐢熸椿,鐢靛奖7鎶�" + var menuName=info.mname; + if(mapPer.indexOf(menuName)>-1) + { + this.conContent='搴旂敤灏嗙敵璇蜂綅缃潈闄愶紝鐢ㄤ簬蹇�熼�夊畾鎵�鍦ㄥ煄甯�'; + this.showConModel=true; + } + else + { + this.goUrl(info); + } + }, + modConfirm() + { + this.showConModel=false; + this.goUrl(this.urlInfo); + }, + checkPreferenceGoods() + {//鏄惁鏈夋帹鑽� + var that = this; + var tmp_1 = { + mainTitle: '澶╃尗', + subTitle: '澶╃尗鐑攢', + type: 5 + }; + var tmp_2 = { + mainTitle: '澶╃尗', + subTitle: '涓轰綘鎺ㄨ崘', + type: 1 + }; + var tmp_3= { + mainTitle: '鎺ㄨ崘', + subTitle: '鐚滀綘鍠滄', + type: 7 + }; + var open_like_recommend = uni.getStorageSync('open_like_recommend'); + if(this.typedataList.length == 5)this.typedataList.shift() + if(open_like_recommend == 1){ + this.typedataList.unshift(tmp_2); + this.bottomType = tmp_2.type; + }else{ + this.typedataList.unshift(tmp_1); + this.bottomType = tmp_1.type; + } + this.$u.api.checkPreferenceGoods({ + }).then(e => { + console.log(e); + if(e.code != 0) + { + that.currentPage = 1; + that.getbottomGoodsList(that.bottomType); + return; + }; + if(e.data&&e.data.p_cids) + {//鏈夊亸濂� + that.preferData=e.data; + that.typedataList.unshift(tmp_3); + that.bottomType = tmp_3.type; + //鍘婚櫎鍞搧浼� + that.typedataList = that.typedataList.filter(function(item) {return item.type !== 4}); + } + that.currentPage = 1; + that.getbottomGoodsList(that.bottomType); + }).catch(function (err) { + this.changeRecommend(); + }) + }, changeRecommend(){ var tmp_1 = { mainTitle: '澶╃尗', @@ -555,7 +634,7 @@ type: 5 }; var tmp_2 = { - mainTitle: '鎺ㄨ崘', + mainTitle: '澶╃尗', subTitle: '涓轰綘鎺ㄨ崘', type: 1 }; @@ -742,39 +821,37 @@ }, getbottomGoodsList(type) { var that = this; - this.$u.api.getGoodThing({ - deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < 10 ? - 'IMEI' : 'OAID') : 'IDFA', - deviceValue: getApp().globalData.equipmentNumber, - pageId: 1, - pageSize: 10, - type: type - }).then(e => { - if (e.code != 0) return that.$alert(e.msg) - var res = e.data.list; - if (res.length < 10) { - that.loadingState = false - that.loadstatus = 'normal' - } else { - that.currentPage++ - that.loadstatus = 'loading' - that.loadingState = true - } - that.bottomGoodsList = res - }).catch(function(err) {}) - }, - - getNextPage() { - if (this.loadingState) { - this.loadingState = false - var that = this; + if(type==7&&that.preferData) + {//鐚滀綘鍠滄 + console.log(that.preferData); + this.$u.api.gussessLikeGoods({ + platefrom:that.preferData.p_platefrom, + cids:that.preferData.p_cids, + pageId:1, + pageSize:10 + }).then(e=>{ + console.log(e); + var res = e.data.list; + if (res.length < 10) { + that.loadingState = false + that.loadstatus = 'normal' + } else { + that.currentPage++ + that.loadstatus = 'loading' + that.loadingState = true + } + that.bottomGoodsList = res + }) + } + else + { this.$u.api.getGoodThing({ - deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < - 10 ? 'IMEI' : 'OAID') : 'IDFA', + deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < 10 ? + 'IMEI' : 'OAID') : 'IDFA', deviceValue: getApp().globalData.equipmentNumber, - pageId: this.currentPage, + pageId: 1, pageSize: 10, - type: this.bottomType + type: type }).then(e => { if (e.code != 0) return that.$alert(e.msg) var res = e.data.list; @@ -786,8 +863,60 @@ that.loadstatus = 'loading' that.loadingState = true } - that.bottomGoodsList = that.bottomGoodsList.concat(res) + that.bottomGoodsList = res }).catch(function(err) {}) + } + }, + + getNextPage() { + if (this.loadingState) { + this.loadingState = false + var that = this; + + if(that.bottomType==7&&that.preferData) + {//鐚滀綘鍠滄 + this.$u.api.gussessLikeGoods({ + platefrom:that.preferData.p_platefrom, + cids:that.preferData.p_cids, + pageId:this.currentPage, + pageSize:10 + }).then(e=>{ + console.log(e); + if (e.code != 0) return that.$alert(e.msg) + var res = e.data.list; + if (res.length < 10) { + that.loadingState = false + that.loadstatus = 'normal' + } else { + that.currentPage++ + that.loadstatus = 'loading' + that.loadingState = true + } + that.bottomGoodsList = that.bottomGoodsList.concat(res); + }) + } + else{ + this.$u.api.getGoodThing({ + deviceType: getApp().globalData.platform == 'android' ? (getApp().globalData.systemLevel < + 10 ? 'IMEI' : 'OAID') : 'IDFA', + deviceValue: getApp().globalData.equipmentNumber, + pageId: this.currentPage, + pageSize: 10, + type: this.bottomType + }).then(e => { + if (e.code != 0) return that.$alert(e.msg) + var res = e.data.list; + if (res.length < 10) { + that.loadingState = false + that.loadstatus = 'normal' + } else { + that.currentPage++ + that.loadstatus = 'loading' + that.loadingState = true + } + that.bottomGoodsList = that.bottomGoodsList.concat(res) + }).catch(function(err) {}) + } } }, @@ -818,7 +947,7 @@ } }) }, - + goUrl(info) { utils.goUrl(info, this) }, -- Gitblit v1.9.3