| | |
| | | } else { //APP在线,收到消息不会包含type属性,这时的payload是JSON字符串,需要转为JSON对象 |
| | | payload = JSON.parse(msg.payload); |
| | | } |
| | | console.log(payload); |
| | | |
| | | if (payload != null || payload != undefined) { |
| | | // var messageType = payload.messageType; |
| | | // onLaunch 生命周期里,页面跳转有问题,跳不过去 |
| | | // 应该是页面还没加载,加上定时后,就可以了; |
| | | console.log(payload); |
| | | setTimeout(() => { |
| | | uni.navigateTo({ |
| | | url: payload |
| | |
| | | } |
| | | } else { // Android |
| | | var payload = msg.payload; |
| | | console.log(payload); |
| | | if (payload != null || payload != undefined) { |
| | | // onLaunch 生命周期里,页面跳转有问题,跳不过去 |
| | | // 应该是页面还没加载,加上定时后,就可以了; |
| | |
| | | }); |
| | | } |
| | | } else { // Android |
| | | var payload = JSON.parse(msg.content); |
| | | console.log(msg.content); |
| | | plus.push.createMessage(msg.content, msg.payload, { |
| | | title: messageTitle |
| | | //icon:'/static/images/app/pushlogo.png' |
| | | }); |
| | | /* var payload = JSON.parse(msg.content); |
| | | |
| | | var messageTitle = payload.title; |
| | | var messageContent = payload.content; |
| | | plus.push.createMessage(messageContent, payload, { |
| | | title: messageTitle |
| | | }) |
| | | }) */ |
| | | } |
| | | }, false); |
| | | //消息推送结束 |
| | |
| | | ...mapMutations(['login']), |
| | | bcInit: function() { |
| | | var that = this; |
| | | if (uni.getSystemInfoSync().platform == 'ios') { |
| | | //uni.getSystemInfoSync().platform == 'ios' |
| | | if (true) { |
| | | const plug = uni.requireNativePlugin('xiguazhu-baichuan'); |
| | | plug.init({}, result => { |
| | | //console.log('1111111111111111111'); |
| | |
| | | }, |
| | | targetArgument(args){ |
| | | var toarg = args.replace('dafanguan://', ''); |
| | | var argObj = JSON.parse(decodeURIComponent(toarg)); |
| | | uni.navigateTo({ |
| | | url: toarg |
| | | }); |
| | | /* var argObj = JSON.parse(decodeURIComponent(toarg)); |
| | | switch (argObj.totype) { |
| | | case "0": //内链 |
| | | if(argObj.url) |
| | | { |
| | | if (argObj.url) { |
| | | uni.navigateTo({ |
| | | url: argObj.url |
| | | }); |
| | |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } */ |
| | | }, |
| | | getArgument(isload=false) { |
| | | if(this.globalData.argumentStr&&this.globalData.argumentStr.length>0) |
| | | { |
| | | if (this.globalData.argumentStr && this.globalData.argumentStr.length > 0) { |
| | | return; |
| | | } |
| | | try { |
| | | var args = plus.runtime.arguments; |
| | | console.log(args); |
| | | if (args) { |
| | | if(isload) |
| | | { |
| | | if (isload) { |
| | | this.globalData.argumentStr = args; |
| | | return; |
| | | } |
| | |
| | | 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, |
| | |
| | | "name" : "大返官", |
| | | "appid" : "__UNI__FC8858A", |
| | | "description" : "大返官app", |
| | | "versionName" : "1.2.7", |
| | | "versionCode" : 127, |
| | | "versionName" : "1.1.6", |
| | | "versionCode" : 116, |
| | | "transformPx" : false, |
| | | /* 5+App特有相关 */ |
| | | "app-plus" : { |
| | |
| | | this.inviteCodeShow = true |
| | | } else { |
| | | console.log(this.pageType) |
| | | console.log(this.user.tb_account) |
| | | if (this.pageType == 'tb' || this.pageType == 'tmshop' || this.pageType == 'tm') { |
| | | if (this.user.tb_account) { |
| | | this.getTbsrc() |
| | |
| | | goodsId: this.optionsInfo.goodsId, |
| | | type: 0 |
| | | }).then(e => { |
| | | |
| | | if (e.code != 0) return that.$alert(e.msg) |
| | | if(that.frompage=='freebuy') |
| | | {//0元购的记录商品id |
| | |
| | | pname: 'com.taobao.taobao', |
| | | action: 'taobao://' |
| | | })) { |
| | | |
| | | const plug = uni.requireNativePlugin('xiguazhu-baichuan') |
| | | console.log(tburl); |
| | | plug.detailPage({ |
| | | url: tburl, |
| | | "openType": 0 |
| | | }, result => { |
| | | // console.log(result); |
| | | console.log(result); |
| | | }); |
| | | } else { |
| | | uni.navigateTo({ |
| | |
| | | </view> |
| | | |
| | | <view class="bottom-fixed colCen"> |
| | | <!-- <view class="verification-Code" @click="changeWay()"> |
| | | <view v-if="issh" 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> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | issh:false, |
| | | ifPasslogin: false, |
| | | pass: '', |
| | | phone: '', |
| | |
| | | }; |
| | | }, |
| | | onLoad() { |
| | | |
| | | this.shShow(); |
| | | }, |
| | | methods: { |
| | | ...mapMutations(['login']), |
| | |
| | | changeread(e){ |
| | | this.isread = e.target.value |
| | | }, |
| | | shShow() |
| | | { |
| | | var that=this; |
| | | this.$u.api.comminInt({}).then(e => { |
| | | console.log(e) |
| | | that.hasshow=true; |
| | | // #ifdef APP-PLUS |
| | | if (plus.os.name == 'iOS') { |
| | | if (e.data.basic.iosExamine && plus.runtime.version == e.data.basic.IosExamineV) { |
| | | console.log('1') |
| | | that.issh=true; |
| | | } else { |
| | | console.log(0) |
| | | that.issh=false; |
| | | } |
| | | } |
| | | // #endif |
| | | }).catch(function(err) { |
| | | console.log(err); |
| | | }) |
| | | }, |
| | | dologin() { |
| | | var that = this; |
| | | let clientInfo = uni.getStorageSync('clientInfo'); |
| | |
| | | } catch (e) { |
| | | TOKEN = '' |
| | | } |
| | | //TOKEN='fba93d1f-9bbe-49e7-9df7-074ddaba8790'; |
| | | var startTime = new Date(); |
| | | return new Promise((succ, error) => { |
| | | uni.request({ |