From 55803b1a7b478aade9b6e59ca6675777375e2a92 Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期五, 07 七月 2023 15:48:24 +0800 Subject: [PATCH] no message --- uniapp/pages/goods/goodsDetail.vue | 16 +++++--- uniapp/pages/login/login.vue | 27 ++++++++----- uniapp/pages/login/bindingPhone.vue | 11 ++++- uniapp/App.vue | 3 + uniapp/utils/http.api.js | 5 +- uniapp/pages/login/wxlogin.vue | 10 ++++ uniapp/pages/mine/mt.vue | 1 uniapp/uniCloud-aliyun/cloudfunctions/getPhoneNumber/index.js | 10 ++++- uniapp/utils/getClipboard.js | 1 uniapp/pages/index/index.vue | 17 ++++++++ uniapp/static/images/app/pushlogo.png | 0 11 files changed, 74 insertions(+), 27 deletions(-) diff --git a/uniapp/App.vue b/uniapp/App.vue index 50492ce..5cb1d20 100644 --- a/uniapp/App.vue +++ b/uniapp/App.vue @@ -65,7 +65,8 @@ if (msg.type == "receive") { //鍒涘缓鏈湴娑堟伅,鍙戦�佺殑鏈湴娑堟伅涔熶細琚玶eceive鏂规硶鎺ユ敹鍒帮紝浣嗘病鏈塼ype灞炴�э紝涓攁ps鏄痭ull plus.push.createMessage(msg.content, JSON.stringify(msg), { - title: messageTitle + title: messageTitle, + //icon:'/static/images/app/pushlogo.png' }); } } else { // Android diff --git a/uniapp/pages/goods/goodsDetail.vue b/uniapp/pages/goods/goodsDetail.vue index 2d1c6e3..7e2ed89 100644 --- a/uniapp/pages/goods/goodsDetail.vue +++ b/uniapp/pages/goods/goodsDetail.vue @@ -281,7 +281,7 @@ <uni-popup ref="popup_pddtip" type="center"> <view class="pdd_pop_contant"> <view class="pdd_pop_title">姣斾环璁㈠崟</view> - <view class="pdd_pop_text">鏈鑷喘娑夊強姣斾环琛屼负锛岃嚜璐敹鐩婁负0锛屽缓璁厛鏀惰棌璇ュ晢鍝侊紝2灏忔椂鍊欓�氳繃澶ц繑瀹榓pp璐拱锛屽彲姝e父鑾峰彇瀵瑰簲鏀剁泭銆�</view> + <view class="pdd_pop_text">鏈鑷喘娑夊強姣斾环琛屼负锛岃嚜璐敹鐩婁负0锛屽缓璁厛鏀惰棌璇ュ晢鍝侊紝2灏忔椂鍚庨�氳繃澶ц繑瀹榓pp璐拱锛屽彲姝e父鑾峰彇瀵瑰簲鏀剁泭銆�</view> </view> </uni-popup> </view> @@ -383,7 +383,6 @@ this.optionsInfo = JSON.parse(options.info); this.pageInfo = JSON.parse(options.info); } - this.pageType = this.optionsInfo.sourceType; if (!this.optionsInfo.faction) { if (this.pageType == 'tb' || this.pageType == 'tm' || this.pageType == 'tmshop') this.faction = 't'; @@ -391,10 +390,7 @@ if (this.pageType == 'pdd') { this.faction = 'p'; - if(options.proform&&options.proform=="clipboard") - {//鏉ヨ嚜鍓创鏉� - this.isshowpdd=true; - } + } if (this.pageType == 'wph') this.faction = 'w'; if (this.pageType == 'dy') this.faction = 'd'; @@ -423,6 +419,10 @@ this.pageInfo.showImgs.push(a) this.getrecommend() } else if (this.pageType == 'pdd') { + if(this.optionsInfo.predictPromotionRate==0) + {//姣斾环璁㈠崟 + this.remindModel=true; + } } else if (this.pageType == 'jd') { @@ -439,6 +439,10 @@ this.empowerModel = false this.pddempowerModel = false }, + closeremind() + { + this.remindModel=false; + }, getPageInfo(e) { var that = this; if (this.faction == 'j') { diff --git a/uniapp/pages/index/index.vue b/uniapp/pages/index/index.vue index 8b90c02..41c8d5a 100644 --- a/uniapp/pages/index/index.vue +++ b/uniapp/pages/index/index.vue @@ -132,9 +132,9 @@ } }, onLoad() { - this.getCategoryList(); this.getPopBannerInfo(); + this.updateCid(); }, onShow() { if(!this.hasshow) @@ -155,6 +155,21 @@ }, 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; diff --git a/uniapp/pages/login/bindingPhone.vue b/uniapp/pages/login/bindingPhone.vue index 481813d..a9f421f 100644 --- a/uniapp/pages/login/bindingPhone.vue +++ b/uniapp/pages/login/bindingPhone.vue @@ -214,14 +214,19 @@ }, bindMobile(){ var that = this; - console.log(this.hasLogin) - console.log(this.wxUser) + let clientInfo = uni.getStorageSync('clientInfo'); + var pushCid=""; + if(clientInfo&&clientInfo.clientid) + { + pushCid=clientInfo.clientid; + } if(this.wxUser != ""){ this.$u.api.bindMobileLogin({ wxUser : encodeURIComponent(JSON.stringify(that.wxUser)), mobile:this.phone, captcha:this.code, - isyj:this.isyj + isyj:this.isyj, + pushCid:pushCid }).then(e => { console.log(e) if (e.code != 0) return that.$alert(e.msg) diff --git a/uniapp/pages/login/login.vue b/uniapp/pages/login/login.vue index 081fffd..2f2704e 100644 --- a/uniapp/pages/login/login.vue +++ b/uniapp/pages/login/login.vue @@ -40,9 +40,9 @@ </view> <view class="bottom-fixed colCen"> - <view class="verification-Code" @click="changeWay()"> + <!-- <view class="verification-Code" @click="changeWay()"> {{ifPasslogin?'楠岃瘉鐮�':'瀵嗙爜'}}鐧诲綍 - </view> + </view> --> <view class="explain-text rowCen"> <switch type="checkbox" @change="changeread" :checked='isread' style="transform:scale(0.6)"/> 鐧婚檰浠h〃宸茶缁嗛槄璇诲苟鍚屾剰<text @click="goPage('agreement')">銆婄敤鎴峰崗璁��</text>鍜�<text @click="goPage('policy')">銆婇殣绉佹斂绛栥��</text> @@ -77,8 +77,7 @@ showPass: true, second: 60, canGetCode: true, - prevent: true, - clientid:"" + prevent: true }; }, onLoad() { @@ -96,12 +95,12 @@ }, dologin() { var that = this; - // #ifdef APP-PLUS - plus.push.getClientInfoAsync((info) => { - that.clientid = info["clientid"]; - }); - // #endif - + let clientInfo = uni.getStorageSync('clientInfo'); + var pushCid=""; + if(clientInfo&&clientInfo.clientid) + { + pushCid=clientInfo.clientid; + } if(this.isread){ if (this.ifPasslogin) { //瀵嗙爜鐧诲綍 @@ -123,11 +122,17 @@ }).catch(function (err) { }) } else { + let strsr={ + mobile: this.phone, + captcha: this.code, + pushCid:pushCid + }; + console.log(strsr) //楠岃瘉鐮佺櫥褰� this.$u.api.mobileLogin({ mobile: this.phone, captcha: this.code, - push_cid:this.clientid + pushCid:pushCid }).then(e => { that.login(e.data.userinfo); if(e.code != 0) return that.$alert(e.msg) diff --git a/uniapp/pages/login/wxlogin.vue b/uniapp/pages/login/wxlogin.vue index 5a53652..984e038 100644 --- a/uniapp/pages/login/wxlogin.vue +++ b/uniapp/pages/login/wxlogin.vue @@ -113,12 +113,20 @@ }, doMobileLogin(mobRes) { + //浠庣紦瀛樿幏鍙朿id + let clientInfo = uni.getStorageSync('clientInfo'); + let pushCid=''; + if(clientInfo&&clientInfo.clientid) + { + pushCid=clientInfo.clientid + } var that=this; uniCloud.callFunction({ name: 'getPhoneNumber', // 浣犵殑浜戝嚱鏁板悕绉� data: { 'access_token': mobRes.access_token, // 瀹㈡埛绔竴閿櫥褰曟帴鍙h繑鍥炵殑access_token - 'openid': mobRes.openid // 瀹㈡埛绔竴閿櫥褰曟帴鍙h繑鍥炵殑openid + 'openid': mobRes.openid, // 瀹㈡埛绔竴閿櫥褰曟帴鍙h繑鍥炵殑openid + 'pushCid':pushCid//app鎺ㄩ�乧id } }).then(res => { console.log(res) diff --git a/uniapp/pages/mine/mt.vue b/uniapp/pages/mine/mt.vue index d37744d..dc06dd6 100644 --- a/uniapp/pages/mine/mt.vue +++ b/uniapp/pages/mine/mt.vue @@ -129,6 +129,7 @@ this.$u.api.meituanAct({type:this.optionsCurrent}).then(e => { if(e.code != 0)return that.$alert(e.msg) uni.stopPullDownRefresh() + console.log(e) that.mtInfo = e.data.info; that.wxQrcodeUrl = that.mtInfo.we_app_info.miniCode; }).catch(function (err) { diff --git a/uniapp/static/images/app/pushlogo.png b/uniapp/static/images/app/pushlogo.png new file mode 100644 index 0000000..169c53f --- /dev/null +++ b/uniapp/static/images/app/pushlogo.png Binary files differ diff --git a/uniapp/uniCloud-aliyun/cloudfunctions/getPhoneNumber/index.js b/uniapp/uniCloud-aliyun/cloudfunctions/getPhoneNumber/index.js index 7750205..f5d4f2a 100644 --- a/uniapp/uniCloud-aliyun/cloudfunctions/getPhoneNumber/index.js +++ b/uniapp/uniCloud-aliyun/cloudfunctions/getPhoneNumber/index.js @@ -25,13 +25,19 @@ } else {//鎵嬫満鍙蜂竴閿櫥褰� + let pushCid=''; + if(event.pushCid) + { + pushCid=event.pushCid; + } var apiUrl='http://dfgapp.ushopvip.com/api/user/mobilelogin'; const apiRes = await uniCloud.httpclient.request(apiUrl, { method: 'POST', data: { - mobile: res.phoneNumber, + mobile: res.phoneNumber, captcha:'000', - ismobouth:true + ismobouth:true, + pushCid:pushCid }, contentType: 'json', // 鎸囧畾浠pplication/json鍙戦�乨ata鍐呯殑鏁版嵁 dataType: 'json' // 鎸囧畾杩斿洖鍊间负json鏍煎紡锛岃嚜鍔ㄨ繘琛宲arse diff --git a/uniapp/utils/getClipboard.js b/uniapp/utils/getClipboard.js index db4aa89..6746089 100644 --- a/uniapp/utils/getClipboard.js +++ b/uniapp/utils/getClipboard.js @@ -11,6 +11,7 @@ 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) diff --git a/uniapp/utils/http.api.js b/uniapp/utils/http.api.js index 6680331..138e050 100644 --- a/uniapp/utils/http.api.js +++ b/uniapp/utils/http.api.js @@ -100,6 +100,7 @@ let changeCodeUrl="/api/user/changecode"; let getRecomInviterUrl="/api/user/getRecomInviter"; let updateFirstFreeBrowseUrl="/api/user/update_first_free_browse"; +let updateCidUrl="/api/user/UpdateClientId"; // 姝ゅ绗簩涓弬鏁皏m锛屽氨鏄垜浠湪椤甸潰浣跨敤鐨則his锛屼綘鍙互閫氳繃vm鑾峰彇vuex绛夋搷浣滐紝鏇村鍐呭璇﹁uView瀵规嫤鎴櫒鐨勪粙缁嶉儴鍒嗭細 // https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F @@ -206,10 +207,10 @@ let changeCode=(params = {}) => vm.$u.post(changeCodeUrl, params); //淇敼閭�璇风爜 let getRecomInviter=(params = {}) => vm.$u.post(getRecomInviterUrl, params); //鑾峰彇鎺ㄨ崘閭�璇蜂汉 let updateFirstFreeBrowse=(params = {}) => vm.$u.post(updateFirstFreeBrowseUrl, params); //璁板綍0鍏冭喘 - + let updateCid=(params={})=>vm.$u.post(updateCidUrl,params);//鏇存柊pushcid // 灏嗗悇涓畾涔夌殑鎺ュ彛鍚嶇О锛岀粺涓�鏀捐繘瀵硅薄鎸傝浇鍒皏m.$u.api(鍥犱负vm灏辨槸this锛屼篃鍗硉his.$u.api)涓� - vm.$u.api = {updateFirstFreeBrowse,getRecomInviter,changeCode,getHdkCategoryList,eleStoreList,getPrivilegeShareLink,getDyGoodsDetail,bindMobileLogin,getTopMessId,changePwd,comminInt,wxapplogin,getTopCalss,getBanner,getHomeMenu,getSuperClass,getMQD,getGoodThing,login,sendSms,mobileLogin,setPwd,getUserInfo,getTalentInfo,getMessageList,getGoodsDetail,getPrivilegeLink,getSimilerGoods,getJdsDetail,getPddDetail,getM,getWphGoodsDetail,addCollect,delCollect,hotKey,suggestion,goodsSearch,activityLink,unionAct,singlePageLink,checkPddAuth,getPddAuth,getPineGoods,jdGoodsList,optimusMaterial,pddGoodsList,brandList,brandInfo,wphGoodsList,meituanAct,eleAct,eleShangjin,userHomemenu,getAppVersion,userBrowse,delBrowse,activitySingle,userCollect,bdHomemenu,getCity,coordinate,cityCate,searchDeals,getCityId,seckillShowinfo,seckillList,identifyGoods,changeMobile,bindInvitation,getInviteInfo,getEstimateAmount,fansList,getFansCount,getHelpType,getHelpList,getHelpDetail,getWpanurl,getChainTurning,superDiscountGoods,getHistory,getTbGoodsList,cateRankList,getUpgradeInfo,getEquityCard,levelApply,orderList,userProfit,bindZfb,withdraw,getBalanceLog,getPublisher,getAlbum,likeAlbum,albumDetail,anchorFollow,myFollowAlbum,feedback,userCancel,profile,bindWechat,unboundWechat}; + vm.$u.api = {updateCid,updateFirstFreeBrowse,getRecomInviter,changeCode,getHdkCategoryList,eleStoreList,getPrivilegeShareLink,getDyGoodsDetail,bindMobileLogin,getTopMessId,changePwd,comminInt,wxapplogin,getTopCalss,getBanner,getHomeMenu,getSuperClass,getMQD,getGoodThing,login,sendSms,mobileLogin,setPwd,getUserInfo,getTalentInfo,getMessageList,getGoodsDetail,getPrivilegeLink,getSimilerGoods,getJdsDetail,getPddDetail,getM,getWphGoodsDetail,addCollect,delCollect,hotKey,suggestion,goodsSearch,activityLink,unionAct,singlePageLink,checkPddAuth,getPddAuth,getPineGoods,jdGoodsList,optimusMaterial,pddGoodsList,brandList,brandInfo,wphGoodsList,meituanAct,eleAct,eleShangjin,userHomemenu,getAppVersion,userBrowse,delBrowse,activitySingle,userCollect,bdHomemenu,getCity,coordinate,cityCate,searchDeals,getCityId,seckillShowinfo,seckillList,identifyGoods,changeMobile,bindInvitation,getInviteInfo,getEstimateAmount,fansList,getFansCount,getHelpType,getHelpList,getHelpDetail,getWpanurl,getChainTurning,superDiscountGoods,getHistory,getTbGoodsList,cateRankList,getUpgradeInfo,getEquityCard,levelApply,orderList,userProfit,bindZfb,withdraw,getBalanceLog,getPublisher,getAlbum,likeAlbum,albumDetail,anchorFollow,myFollowAlbum,feedback,userCancel,profile,bindWechat,unboundWechat}; } export default { -- Gitblit v1.9.3