h5配置以及微信公众号影藏
This commit is contained in:
parent
9274b50e93
commit
1f196a5a9c
10
App.vue
10
App.vue
|
@ -143,7 +143,10 @@
|
||||||
} else {
|
} else {
|
||||||
this.globalData.isIframe = false;
|
this.globalData.isIframe = false;
|
||||||
}
|
}
|
||||||
|
if(option.query.channelId){
|
||||||
|
uni.setStorageSync('channelId', option.query.channelId);
|
||||||
|
|
||||||
|
}
|
||||||
// wx公众号自动授权登录
|
// wx公众号自动授权登录
|
||||||
let snsapiBase = 'snsapi_base';
|
let snsapiBase = 'snsapi_base';
|
||||||
let urlData = location.pathname + location.search;
|
let urlData = location.pathname + location.search;
|
||||||
|
@ -155,10 +158,7 @@
|
||||||
scope
|
scope
|
||||||
} = option.query;
|
} = option.query;
|
||||||
console.log(option.query,'option.queryoption.queryoption.query');
|
console.log(option.query,'option.queryoption.queryoption.query');
|
||||||
if(option.query.channelId){
|
|
||||||
uni.setStorageSync('channelId', option.query.channelId);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (code && code != uni.getStorageSync('snsapiCode') && location.pathname.indexOf(
|
if (code && code != uni.getStorageSync('snsapiCode') && location.pathname.indexOf(
|
||||||
'/pages/users/wechat_login/index') === -1) {
|
'/pages/users/wechat_login/index') === -1) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<!-- <view class="mask" >
|
<!-- <view class="mask" >
|
||||||
|
|
||||||
</view> -->
|
</view> -->
|
||||||
<image src="@/static/img/wait.jpg" mode="" style="width: 750rpx;height: 100vh;z-index: 1000;"></image>
|
<image src="@/static/img/wait.jpg" mode="" style="width: 750rpx;height: 100vh;z-index: 1000;" v-if="showwait"></image>
|
||||||
<view class="page-index skeleton" :class="{'bgf':navIndex >0}"
|
<view class="page-index skeleton" :class="{'bgf':navIndex >0}"
|
||||||
:style="{visibility: showSkeleton ? 'hidden' : 'visible'}" v-if="showwait==false">
|
:style="{visibility: showSkeleton ? 'hidden' : 'visible'}" v-if="showwait==false">
|
||||||
<!-- #ifdef H5 -->
|
<!-- #ifdef H5 -->
|
||||||
|
@ -378,7 +378,7 @@
|
||||||
this.setTabList()
|
this.setTabList()
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
this.getipdz()
|
||||||
// const env = uni.getEnv();
|
// const env = uni.getEnv();
|
||||||
|
|
||||||
// 获取系统信息
|
// 获取系统信息
|
||||||
|
@ -473,7 +473,8 @@
|
||||||
if (this.isLogin && parseInt(options.channelId) > 0) {
|
if (this.isLogin && parseInt(options.channelId) > 0) {
|
||||||
silenceBindingChannelId()
|
silenceBindingChannelId()
|
||||||
}
|
}
|
||||||
this.getipdz()
|
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
var app_type = this.isWeiXin() ? 'weixinh5' : 'h5';
|
var app_type = this.isWeiXin() ? 'weixinh5' : 'h5';
|
||||||
var app_type_name = this.isWeiXin() ? '微信公众号' : 'H5';
|
var app_type_name = this.isWeiXin() ? '微信公众号' : 'H5';
|
||||||
|
@ -499,21 +500,14 @@
|
||||||
// #endif
|
// #endif
|
||||||
uni.showTabBar();
|
uni.showTabBar();
|
||||||
|
|
||||||
let currentUrl = window.location.href;
|
|
||||||
|
|
||||||
// 解析URL,提取参数
|
|
||||||
let urlParams = new URLSearchParams(currentUrl);
|
|
||||||
|
|
||||||
// 获取名为code的参数的值
|
|
||||||
// let codeValue = urlParams.get('code');
|
|
||||||
// console.log(codeValue,'codeValuecodeValuecodeValue');
|
|
||||||
// console.log('进入了首页');
|
// console.log('进入了首页');
|
||||||
// const id = uni.getStorageSync('openid');
|
// const id = uni.getStorageSync('openid');
|
||||||
|
|
||||||
// if(codeValue){
|
// if(codeValue){
|
||||||
// console.log('登陆成功',id);
|
// console.log('登陆成功',id);
|
||||||
// uni.setStorageSync('openid', codeValue);
|
// uni.setStorageSync('openid', codeValue);
|
||||||
// let stause= uni.getStorageSync('loginstause');
|
//
|
||||||
// if(stause){
|
// if(stause){
|
||||||
|
|
||||||
// console.log('进入判断1');
|
// console.log('进入判断1');
|
||||||
|
@ -541,7 +535,7 @@
|
||||||
uni.showTabBar();
|
uni.showTabBar();
|
||||||
|
|
||||||
// 调用记录ip
|
// 调用记录ip
|
||||||
// this.getip()
|
// this.getipdz()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isWeiXin() {
|
isWeiXin() {
|
||||||
|
@ -557,9 +551,39 @@
|
||||||
},
|
},
|
||||||
// 获取IP地址
|
// 获取IP地址
|
||||||
getipdz(){
|
getipdz(){
|
||||||
getip().then(res => {
|
let codeValue= uni.getStorageSync('channelId');
|
||||||
console.log(res,111)
|
if(uni.getStorageSync('channelcs')){
|
||||||
})
|
|
||||||
|
}else{
|
||||||
|
let cs=false
|
||||||
|
uni.setStorageSync('channelcs', cs);
|
||||||
|
}
|
||||||
|
let acc =uni.getStorageSync('channelcs');
|
||||||
|
console.log(acc,'&&acc&&acc');
|
||||||
|
if(this.isLogin){
|
||||||
|
getip().then(res => {
|
||||||
|
console.log(res,111)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if(codeValue&&acc==false){
|
||||||
|
console.log(codeValue,'codeValuecodeValuecodeValue');
|
||||||
|
|
||||||
|
uni.request({
|
||||||
|
url: 'https://yruibao.com/prod/api/front/channel/record?channelId='+codeValue,
|
||||||
|
// url: 'http://192.168.2.26:20411/api/front/channel/record?channelId='+codeValue, //仅为示例,并非真实接口地址。
|
||||||
|
// data: data,
|
||||||
|
method:'GET',
|
||||||
|
|
||||||
|
success: (res) => {
|
||||||
|
let add=true
|
||||||
|
uni.setStorageSync('channelcs', add);
|
||||||
|
},
|
||||||
|
fail:(err)=>{
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -312,10 +312,17 @@
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '登录中'
|
title: '登录中'
|
||||||
})
|
})
|
||||||
|
let channelId=0
|
||||||
|
let abb=uni.getStorageSync('channelId')
|
||||||
|
|
||||||
|
if(abb!=undefined){
|
||||||
|
channelId=parseInt(abb);
|
||||||
|
}
|
||||||
loginMobile({
|
loginMobile({
|
||||||
phone: that.account,
|
phone: that.account,
|
||||||
captcha: that.captcha,
|
captcha: that.captcha,
|
||||||
spread_spid: that.$Cache.get("spread"),
|
spread_spid: that.$Cache.get("spread"),
|
||||||
|
channelId:channelId,
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user