From 70f5b82bc3fceafac2faf470280876b0eca6fac8 Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期四, 13 七月 2023 09:40:23 +0800 Subject: [PATCH] no message --- uniapp/manifest.json | 13 +++ uniapp/pages/goods/goodsDetail.vue | 15 +++ uniapp/pages/index/launchPage.vue | 3 uniapp/pages/login/login.vue | 2 uniapp/App.vue | 44 +++++++++- uniapp/components/pddremind.vue | 7 + uniapp/components/indexPage.vue | 62 ++++++++++++++- uniapp/pages/login/wxlogin.vue | 2 uniapp/utils/getClipboard.js | 1 uniapp/pages/index/index.vue | 33 ++----- 10 files changed, 139 insertions(+), 43 deletions(-) diff --git a/uniapp/App.vue b/uniapp/App.vue index 5cb1d20..4077376 100644 --- a/uniapp/App.vue +++ b/uniapp/App.vue @@ -13,10 +13,11 @@ onLaunch: function() { // #ifdef APP-PLUS //鎺ㄩ�佸紑濮� - var info = plus.push.getClientInfo() + /* var info = plus.push.getClientInfo() console.log(info); // 鑾峰彇褰撳墠璁惧鐨勫鎴风id,浼犵粰鍚庡彴,瀹炵幇鎸囧畾鐢ㄦ埛 - info && uni.setStorageSync('clientInfo', info) + info && uni.setStorageSync('clientInfo', info) */ + this.getPushCid(); // 浣跨敤5+App鐨勬柟寮忚繘琛岀洃鍚秷鎭帹閫� //娑堟伅鐐瑰嚮浜嬩欢 //銆怉PP鍦ㄧ嚎銆戯紝鏀跺埌閫忎紶娑堟伅閫氳繃锛屼笉浼氭彁閱掕嚦閫氱煡鏍忕洰锛岄渶瑕佸彂閫佹湰鍦版秷鎭紝鍐嶈繘琛岀偣鍑昏Е鍙戠殑鐐瑰嚮浜嬩欢銆� @@ -57,6 +58,7 @@ //鏀跺埌閫忎紶娑堟伅 //鍙湁APP鍦ㄧ嚎鏃讹紝鎵嶄細瑙﹀彂receive浜嬩欢锛岄�忎紶娑堟伅涓嶄細瑙﹀彂绯荤粺娑堟伅,闇�瑕佸垱寤烘湰鍦版秷鎭� plus.push.addEventListener("receive", function(msg) { + console.log('receive', JSON.stringify(msg)) //涓氬姟浠g爜 // IOS if (uni.getSystemInfoSync().platform == 'ios') { @@ -154,7 +156,6 @@ content: '妫�娴嬪埌缃戠粶鏉冮檺鍙兘璁剧疆涓哄叧闂紝鎮ㄥ彲浠ュ湪鈥滆缃�濅腑妫�鏌ユ棤绾挎暟鎹強铚傜獫绉诲姩缃戠粶' }) }else{ - console.log("鏄惁璇锋眰杩囷細"+that.globalData.hasinit) if(!that.globalData.hasinit) { that.getAppInfo(); @@ -189,11 +190,9 @@ bcInit:function() { var that = this; - console.log(uni.getSystemInfoSync().platform); if (uni.getSystemInfoSync().platform == 'ios') { const plug = uni.requireNativePlugin('xiguazhu-baichuan'); - console.log(plug) plug.init({}, result => { //console.log('1111111111111111111'); console.log(result); // code绛変簬0灏辨槸鍒濆鍖栨垚鍔� @@ -206,6 +205,40 @@ else{ that.globalData.hasbcinit=true; } + }, + getPushCid:function() + { + // #ifdef APP-PLUS + var info = plus.push.getClientInfo() + if(info&&info.clientid!='null') + {// 鑾峰彇褰撳墠璁惧鐨勫鎴风id,浼犵粰鍚庡彴,瀹炵幇鎸囧畾鐢ㄦ埛 + uni.setStorageSync('clientInfo', info); + this.updatePushCid(); + } + else{ + console.log('娌℃湁鑾峰彇鍒�'); + setTimeout(() => { + this.getPushCid(); + }, 1000) + } + // #endif + }, + updatePushCid:function() + { + let clientInfo = uni.getStorageSync('clientInfo'); + if(clientInfo&&clientInfo!='null'&&clientInfo.clientid) + { + console.log('寮�濮嬫洿鏂�'); + this.$u.api.updateCid({ + pushcid:clientInfo.clientid + }).then(e => { + }).catch(function (err) { + }) + } + else{ + this.getPushCid(); + } + }, getAppInfo: function() { var that = this; @@ -238,7 +271,6 @@ if (plus.runtime.isApplicationExist({pname:'com.tencent.mm', action: 'weixin://' })) { - console.log("瀹夊崜绔凡瀹夎寰俊") that.globalData.ifwt = 1 //鏄惁瀹夎寰俊 1浠h〃瀹夎 } else { console.log("瀹夊崜绔湭瀹夎寰俊") diff --git a/uniapp/components/indexPage.vue b/uniapp/components/indexPage.vue index 02c7e68..bc0f62c 100644 --- a/uniapp/components/indexPage.vue +++ b/uniapp/components/indexPage.vue @@ -392,6 +392,7 @@ v-if="bottomGoodsList.length>0"> <block v-for="(items,index) in bottomGoodsList" :key="index"> <view class="goods-items" @click="goDetails(items)"> + <!-- <colGoodsImg v-if="index==0&&itembannerList&&itembannerList.length>0" :popBannerSList="itembannerList"></colGoodsImg> --> <colGoods :items="items"></colGoods> </view> </block> @@ -411,6 +412,7 @@ import slideTop from './slideTop.vue' import colGoods from './colGoods.vue' import empowerModel from './empowerModel.vue' + import colGoodsImg from '@/components/colGoodsImg.vue' export default { props: { recomendType: { @@ -432,10 +434,12 @@ components: { slideTop, colGoods, - empowerModel + empowerModel, + colGoodsImg }, data() { return { + popBannerSList:[], fallingList: [], pageHeight: '', headerColor: '', @@ -491,9 +495,14 @@ swpidx: 0, canrefresh: true, fastenter:[], - popBannerSList:[], + itembannerList:[], enterTop:[], - enterDown:[] + enterDown:[], + tbbanner:[], + jdbanner:[], + dybanner:[], + pddbanner:[], + wphbanner:[], } }, watch: { @@ -529,6 +538,7 @@ this.getbottomGoodsList(this.bottomType); this.getGOODSfalling(); this.getRQList(); + //this.getPageImg(); }, mounted() { this.$emit('scrolltoTop') @@ -595,7 +605,6 @@ }, onRestore() { this.swpidx = 0 - console.log('涓嬫媺琚粓姝�'); }, pagescroll(e) { this.$emit('scrollNum', e.detail.scrollTop) @@ -688,7 +697,49 @@ that.dyList = e.data.dygoods; }).catch(function(err) {}) }, - + getPageImg() + { + var that=this; + this.$u.api.getBanner({ + type: '11,16,17,18,19,20' + }).then(e => { + if (e.code == 1) return that.$alert(e.msg); + var res = e.data.info; + that.tbbanner=res.tmImg; + that.jdbanner=res.jdImg; + that.dybanner=res.dyImg; + that.pddbanner=res.pddImg; + that.wphbanner=res.wphImg; + that.changeBanner(that.bottomCurrent); + }).catch(function(err) { + console.log(err) + }) + }, + changeBanner(type) + { + switch(type) + { + case 2://浜笢 + this.itembannerList=this.jdbanner; + break; + case 6://鎶栭煶 + this.itembannerList=this.dybanner; + break; + case 3://鎷煎澶� + this.itembannerList=this.pddbanner; + break; + case 4://鍞搧浼� + this.itembannerList=this.wphbanner; + break; + default: + this.itembannerList=[]; + break; + } + if(this.itembannerList&&this.itembannerList>0) + { + that.bottomGoodsList.unshift(this.itembannerList[0]); + } + }, getbottomGoodsList(type) { var that = this; this.$u.api.getGoodThing({ @@ -744,6 +795,7 @@ if (this.bottomCurrent != idx) { this.currentPage = 1; this.bottomType = info.type; + this.changeBanner(info.type); this.getbottomGoodsList(this.bottomType); this.$nextTick(() => { this.$emit('scrolltoview') diff --git a/uniapp/components/pddremind.vue b/uniapp/components/pddremind.vue index 3cb6cbc..4a58b34 100644 --- a/uniapp/components/pddremind.vue +++ b/uniapp/components/pddremind.vue @@ -8,7 +8,7 @@ </view> <view class="tips-container colCen"> <view class="grey-txt"> - 璇ュ晢鍝佸彲鑳芥秹鍙婃瘮浠凤紝鑷喘鍙兘浼氭棤浣i噾 + 璇ュ晢鍝佸彲鑳芥秹鍙婃瘮浠凤紝鑷喘鍙兘浼氭棤浣i噾锛屽缓璁偍鍏堟敹钘忚鍟嗗搧锛�2涓皬鏃跺�欏啀杩涘ぇ杩斿畼app璐拱 </view> <view class="pink-txt"> 姣斾环瀹氫箟锛氭偍鍦ㄦ嫾澶氬APP/缃戠珯璁块棶浜嗚鍟嗗搧鐨勮鎯咃紝鍐嶉�氳繃鏈珹PP杩涜杞摼鑷喘鐨勮涓� @@ -40,10 +40,10 @@ <style lang="scss"> .pddremind-container { width: 600rpx; - height: 630rpx; + height: 690rpx; background: #FFFFFF; border-radius: 10rpx; - padding: 0 45rpx; + padding: 0 25rpx; position: relative; .topbac { @@ -87,6 +87,7 @@ .pink-txt { color: #FD002F; + margin-top: 20rpx; } } diff --git a/uniapp/manifest.json b/uniapp/manifest.json index d399843..a97b06a 100644 --- a/uniapp/manifest.json +++ b/uniapp/manifest.json @@ -115,7 +115,18 @@ } }, "push" : { - "unipush" : {} + "unipush" : { + "icons" : { + "small" : { + // 宸︿笂瑙掑皬鍥炬爣 + "ldpi" : "unpackage/res/drawable-ldpi/push_small.png", + "mdpi" : "unpackage/res/drawable-mdpi/push_small.png", + "hdpi" : "unpackage/res/drawable-hdpi/push_small.png", + "xhdpi" : "unpackage/res/drawable-xhdpi/push_small.png", + "xxhdpi" : "unpackage/res/drawable-xxhdpi/push_small.png" + } + } + } }, "geolocation" : { "amap" : { diff --git a/uniapp/pages/goods/goodsDetail.vue b/uniapp/pages/goods/goodsDetail.vue index 7e2ed89..bc5f29f 100644 --- a/uniapp/pages/goods/goodsDetail.vue +++ b/uniapp/pages/goods/goodsDetail.vue @@ -698,7 +698,20 @@ }, getJDsrc() { - var that = this; + var that = this; + console.log(this.frompage); + console.log(that.optionsInfo.goodsId); + if(this.frompage=='freebuy') + {//0鍏冭喘鐨勮褰曞晢鍝乮d + this.$u.api.updateFirstFreeBrowse({ + goodsid:that.optionsInfo.goodsId, + new_goodsId:that.optionsInfo.goodsId, + plateform:'jd' + }).then(e=>{ + + }); + } + this.$u.api.getPrivilegeLink({ goodsId: this.optionsInfo.goodsId, type: 1 diff --git a/uniapp/pages/index/index.vue b/uniapp/pages/index/index.vue index 41c8d5a..843231d 100644 --- a/uniapp/pages/index/index.vue +++ b/uniapp/pages/index/index.vue @@ -128,13 +128,13 @@ nowcurrentid:'', recomendType:1, isshowtype:false, - hasshow:false, + hasshow:false } }, onLoad() { this.getCategoryList(); this.getPopBannerInfo(); - this.updateCid(); + }, onShow() { if(!this.hasshow) @@ -150,26 +150,11 @@ this.recomendType = open_like_recommend == "" ? 1 : open_like_recommend; }, onReady() { - console.log("鑾峰彇楂樹綆") - this.getTopheight() + this.getTopheight(); }, watch: {}, methods: { - updateCid() - { - //浠庣紦瀛樿幏鍙朿id - let clientInfo = uni.getStorageSync('clientInfo'); - console.log(clientInfo); - if(clientInfo&&clientInfo.clientid) - { - this.$u.api.updateCid({ - pushcid:clientInfo.clientid - }).then(e => { - console.log(e); - }).catch(function (err) { - }) - } - }, + shShow() { var that=this; @@ -188,9 +173,12 @@ if(istoLogin) { if(!that.hasLogin){ - uni.reLaunch({ - url:"/pages/login/wxlogin" - }) + setTimeout(() => { + uni.reLaunch({ + url:"/pages/login/wxlogin" + }) + }, 1000) + } /* var user= uni.getStorageSync('userInfo'); if(!user.invitation_code) @@ -356,7 +344,6 @@ getTopheight() { // 鑾峰彇椤堕儴楂樺害 uni.createSelectorQuery().in(this).select('.fixed-container').boundingClientRect(data => { - console.log(data.height+":----------------"); this.Topheight = data.height }).exec(); }, diff --git a/uniapp/pages/index/launchPage.vue b/uniapp/pages/index/launchPage.vue index 546a7e6..5458bb5 100644 --- a/uniapp/pages/index/launchPage.vue +++ b/uniapp/pages/index/launchPage.vue @@ -29,8 +29,6 @@ this.$u.api.getBanner({ type: '1,15' }).then(e => { - - console.log(e) if (e.code == 1) {//杩斿洖澶辫触锛岀洿鎺ヨ烦棣栭〉 this.t_index(); @@ -42,7 +40,6 @@ that.list=res.launchpic; } else{ - console.log("璺宠浆") this.t_index(); } }).catch(function(err) { diff --git a/uniapp/pages/login/login.vue b/uniapp/pages/login/login.vue index 2f2704e..c3e3ee0 100644 --- a/uniapp/pages/login/login.vue +++ b/uniapp/pages/login/login.vue @@ -221,6 +221,8 @@ url: './setPass' }) } */else { + //鏇存柊pushcid + getApp().updatePushCid(); uni.switchTab({ url: '../index/index' }) diff --git a/uniapp/pages/login/wxlogin.vue b/uniapp/pages/login/wxlogin.vue index 984e038..092e5d0 100644 --- a/uniapp/pages/login/wxlogin.vue +++ b/uniapp/pages/login/wxlogin.vue @@ -215,6 +215,8 @@ url: './setPass' }) } */ else { + //鏇存柊pushcid + getApp().updatePushCid(); uni.switchTab({ url: '../index/index' }) diff --git a/uniapp/utils/getClipboard.js b/uniapp/utils/getClipboard.js index 6746089..db4aa89 100644 --- a/uniapp/utils/getClipboard.js +++ b/uniapp/utils/getClipboard.js @@ -11,7 +11,6 @@ var nowClipData = res.data if (nowClipData.length > 6 && nowClipData!=uni.getStorageSync('clipboard')) { getApp().globalData.hasMode = true - console.log(nowClipData); Vue.prototype.$u.api.identifyGoods({goods_url: nowClipData}).then(e => { console.log(e) if(e.code != 0) return Vue.prototype.$alert(e.msg) -- Gitblit v1.9.3