| | |
| | | if (msg.type == "receive") { |
| | | //创建本地消息,发送的本地消息也会被receive方法接收到,但没有type属性,且aps是null |
| | | plus.push.createMessage(msg.content, JSON.stringify(msg), { |
| | | title: messageTitle |
| | | title: messageTitle, |
| | | //icon:'/static/images/app/pushlogo.png' |
| | | }); |
| | | } |
| | | } else { // Android |
| | |
| | | <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小时候通过大返官app购买,可正常获取对应收益。</view> |
| | | <view class="pdd_pop_text">本次自购涉及比价行为,自购收益为0,建议先收藏该商品,2小时后通过大返官app购买,可正常获取对应收益。</view> |
| | | </view> |
| | | </uni-popup> |
| | | </view> |
| | |
| | | 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'; |
| | |
| | | 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'; |
| | |
| | | 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') { |
| | | |
| | |
| | | this.empowerModel = false |
| | | this.pddempowerModel = false |
| | | }, |
| | | closeremind() |
| | | { |
| | | this.remindModel=false; |
| | | }, |
| | | getPageInfo(e) { |
| | | var that = this; |
| | | if (this.faction == 'j') { |
| | |
| | | } |
| | | }, |
| | | onLoad() { |
| | | |
| | | this.getCategoryList(); |
| | | this.getPopBannerInfo(); |
| | | this.updateCid(); |
| | | }, |
| | | onShow() { |
| | | if(!this.hasshow) |
| | |
| | | }, |
| | | watch: {}, |
| | | methods: { |
| | | updateCid() |
| | | { |
| | | //从缓存获取cid |
| | | 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; |
| | |
| | | }, |
| | | 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) |
| | |
| | | </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)"/> |
| | | 登陆代表已详细阅读并同意<text @click="goPage('agreement')">《用户协议》</text>和<text @click="goPage('policy')">《隐私政策》</text> |
| | |
| | | showPass: true, |
| | | second: 60, |
| | | canGetCode: true, |
| | | prevent: true, |
| | | clientid:"" |
| | | prevent: true |
| | | }; |
| | | }, |
| | | onLoad() { |
| | |
| | | }, |
| | | 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) { |
| | | //密码登录 |
| | |
| | | }).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) |
| | |
| | | }, |
| | | doMobileLogin(mobRes) |
| | | { |
| | | //从缓存获取cid |
| | | 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, // 客户端一键登录接口返回的access_token |
| | | 'openid': mobRes.openid // 客户端一键登录接口返回的openid |
| | | 'openid': mobRes.openid, // 客户端一键登录接口返回的openid |
| | | 'pushCid':pushCid//app推送cid |
| | | } |
| | | }).then(res => { |
| | | console.log(res) |
| | |
| | | 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) { |
| | |
| | | } |
| | | 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', // 指定以application/json发送data内的数据 |
| | | dataType: 'json' // 指定返回值为json格式,自动进行parse |
| | |
| | | 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) |
| | |
| | | let changeCodeUrl="/api/user/changecode"; |
| | | let getRecomInviterUrl="/api/user/getRecomInviter"; |
| | | let updateFirstFreeBrowseUrl="/api/user/update_first_free_browse"; |
| | | let updateCidUrl="/api/user/UpdateClientId"; |
| | | |
| | | // 此处第二个参数vm,就是我们在页面使用的this,你可以通过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 |
| | |
| | | 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 |
| | | |
| | | // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$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 { |