修复渠道代码
This commit is contained in:
parent
481bfba4bc
commit
5bdc301972
|
@ -19,19 +19,19 @@ export function getWechatConfig() {
|
||||||
* 获取微信sdk配置
|
* 获取微信sdk配置
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export function wechatAuth(code, spread,) {
|
export function wechatAuth(code, spread,channelId) {
|
||||||
var reg=/^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 ,判断正整数用/^[1-9]+[0-9]*]*$/
|
var reg=/^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 ,判断正整数用/^[1-9]+[0-9]*]*$/
|
||||||
spread = reg.test(spread) ? spread : 0;
|
spread = reg.test(spread) ? spread : 0;
|
||||||
|
channelId = reg.test(channelId) ? channelId : 0;
|
||||||
return request.get(
|
return request.get(
|
||||||
"wechat/authorize/login?code=" + code + "&spread_spid=" + spread , {},
|
"wechat/authorize/login?code=" + code + "&spread_spid=" + spread+"&channelId="+channelId, {},
|
||||||
{ noAuth: true }
|
{ noAuth: true }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取登录授权login
|
* 获取登录授权login
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export function getLogo()
|
export function getLogo()
|
||||||
{
|
{
|
||||||
|
@ -109,4 +109,4 @@ export function appleLogin(data) {
|
||||||
*/
|
*/
|
||||||
export function iosBinding(data) {
|
export function iosBinding(data) {
|
||||||
return request.post("ios/binding/phone", data, { noAuth : true });
|
return request.post("ios/binding/phone", data, { noAuth : true });
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,12 +26,13 @@ module.exports = {
|
||||||
|
|
||||||
TIPS_KEY: 'TIPS_KEY',
|
TIPS_KEY: 'TIPS_KEY',
|
||||||
|
|
||||||
|
|
||||||
SPREAD: 'SPREAD',
|
SPREAD: 'SPREAD',
|
||||||
|
CHANNELID: 'CHANNELID',
|
||||||
//缓存经度
|
//缓存经度
|
||||||
CACHE_LONGITUDE: 'LONGITUDE',
|
CACHE_LONGITUDE: 'LONGITUDE',
|
||||||
//缓存纬度
|
//缓存纬度
|
||||||
CACHE_LATITUDE: 'LATITUDE',
|
CACHE_LATITUDE: 'LATITUDE',
|
||||||
//app手机信息
|
//app手机信息
|
||||||
PLATFORM: 'systemPlatform'
|
PLATFORM: 'systemPlatform'
|
||||||
}
|
}
|
||||||
|
|
12
main.js
12
main.js
|
@ -29,13 +29,13 @@ import {
|
||||||
} from "./utils";
|
} from "./utils";
|
||||||
import Auth from './libs/wechat';
|
import Auth from './libs/wechat';
|
||||||
import {
|
import {
|
||||||
SPREAD
|
SPREAD,CHANNELID
|
||||||
} from './config/cache';
|
} from './config/cache';
|
||||||
Vue.prototype.$wechat = Auth;
|
Vue.prototype.$wechat = Auth;
|
||||||
let cookieName = "VCONSOLE",
|
let cookieName = "VCONSOLE",
|
||||||
query = parseQuery(),
|
query = parseQuery(),
|
||||||
urlSpread = query["spread"],
|
urlSpread = query["spread"],
|
||||||
|
urlChannelId = query["channelId"],
|
||||||
vconsole = query[cookieName.toLowerCase()],
|
vconsole = query[cookieName.toLowerCase()],
|
||||||
md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式
|
md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式
|
||||||
md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式
|
md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式
|
||||||
|
@ -46,7 +46,13 @@ let cookieName = "VCONSOLE",
|
||||||
value: urlSpread,
|
value: urlSpread,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (urlChannelId) {
|
||||||
|
urlChannelId = parseInt(urlChannelId);
|
||||||
|
Cache.setItem({
|
||||||
|
name: 'channelId',
|
||||||
|
value: urlChannelId,
|
||||||
|
})
|
||||||
|
}
|
||||||
if (vconsole !== undefined) {
|
if (vconsole !== undefined) {
|
||||||
if (vconsole === md5UnCrmeb && Cache.has(cookieName))
|
if (vconsole === md5UnCrmeb && Cache.has(cookieName))
|
||||||
Cache.clear(cookieName);
|
Cache.clear(cookieName);
|
||||||
|
|
|
@ -252,7 +252,7 @@
|
||||||
@getImg="showImg" @installments="installments">
|
@getImg="showImg" @installments="installments">
|
||||||
</productWindow>
|
</productWindow>
|
||||||
<couponListWindow :coupon='coupon' :typeNum="couponDeaultType[0].useType"
|
<couponListWindow :coupon='coupon' :typeNum="couponDeaultType[0].useType"
|
||||||
@ChangCouponsClone="ChangCouponsClone" @ChangCoupons="ChangCoupons"
|
@ChangCouponsClone="ChangCouponsClone" @ChangCoupons="ChangCoupons"
|
||||||
@ChangCouponsUseState="ChangCouponsUseState" @tabCouponType="tabCouponType"></couponListWindow>
|
@ChangCouponsUseState="ChangCouponsUseState" @tabCouponType="tabCouponType"></couponListWindow>
|
||||||
<!-- 分享按钮 -->
|
<!-- 分享按钮 -->
|
||||||
<view class="generate-posters" :class="posters ? 'on' : ''">
|
<view class="generate-posters" :class="posters ? 'on' : ''">
|
||||||
|
@ -368,8 +368,8 @@
|
||||||
import shareRedPackets from '@/components/shareRedPackets';
|
import shareRedPackets from '@/components/shareRedPackets';
|
||||||
import cusPreviewImg from '@/components/cus-previewImg/cus-previewImg.vue'
|
import cusPreviewImg from '@/components/cus-previewImg/cus-previewImg.vue'
|
||||||
import {
|
import {
|
||||||
silenceBindingSpread,
|
silenceBindingSpread,silenceBindingChannelId
|
||||||
|
|
||||||
} from "@/utils";
|
} from "@/utils";
|
||||||
import parser from "@/components/jyf-parser/jyf-parser";
|
import parser from "@/components/jyf-parser/jyf-parser";
|
||||||
import {
|
import {
|
||||||
|
@ -551,6 +551,8 @@
|
||||||
this.getTokenIsExist();
|
this.getTokenIsExist();
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
// console.log(JSON.stringify(options),"options.spread")
|
||||||
|
alert("options.spread"+JSON.stringify(options))
|
||||||
//用户从分享卡片进入的场景下获取主题色配置
|
//用户从分享卡片进入的场景下获取主题色配置
|
||||||
this.$set(this, 'theme', this.$Cache.get('theme'));
|
this.$set(this, 'theme', this.$Cache.get('theme'));
|
||||||
|
|
||||||
|
@ -608,7 +610,7 @@
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
if (options.spread) app.globalData.spread = options.spread;
|
if (options.spread) app.globalData.spread = options.spread;
|
||||||
|
if (options.channelId) app.globalData.channelId = options.channelId;
|
||||||
|
|
||||||
this.getGoodsDetails(); //商品详情
|
this.getGoodsDetails(); //商品详情
|
||||||
this.getCouponType(); //获取默认的 优惠券类型
|
this.getCouponType(); //获取默认的 优惠券类型
|
||||||
|
@ -648,7 +650,7 @@
|
||||||
imageUrl: that.productInfo.image || '',
|
imageUrl: that.productInfo.image || '',
|
||||||
path: '/pages/goods_details/index?id=' + that.id + '&spread=' + that.uid,
|
path: '/pages/goods_details/index?id=' + that.id + '&spread=' + that.uid,
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
|
@ -661,11 +663,11 @@
|
||||||
uni.$emit('scroll');
|
uni.$emit('scroll');
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 请求分期列表
|
// 请求分期列表
|
||||||
// getfqList: function() {
|
// getfqList: function() {
|
||||||
// let data = {
|
// let data = {
|
||||||
|
@ -675,7 +677,7 @@
|
||||||
// }
|
// }
|
||||||
// getfenqilist(data).then(res => {
|
// getfenqilist(data).then(res => {
|
||||||
// this.fenqlist = res.data.list
|
// this.fenqlist = res.data.list
|
||||||
|
|
||||||
// // localStorage.setItem('fqlist',JSON.stringify(this.fenqlist))
|
// // localStorage.setItem('fqlist',JSON.stringify(this.fenqlist))
|
||||||
// })
|
// })
|
||||||
// },
|
// },
|
||||||
|
@ -687,7 +689,7 @@
|
||||||
this.getCartCount(true); //购物车数量
|
this.getCartCount(true); //购物车数量
|
||||||
//绑定关系
|
//绑定关系
|
||||||
if (parseInt(app.globalData.spread) > 0) silenceBindingSpread();
|
if (parseInt(app.globalData.spread) > 0) silenceBindingSpread();
|
||||||
|
if (parseInt(app.globalData.channelId) > 0) silenceBindingChannelId();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -701,8 +703,8 @@
|
||||||
scene: scene,
|
scene: scene,
|
||||||
type: 0,
|
type: 0,
|
||||||
href: `${HTTP_H5_URL}${curRoute}&spread=${that.uid}`,
|
href: `${HTTP_H5_URL}${curRoute}&spread=${that.uid}`,
|
||||||
|
|
||||||
|
|
||||||
title: that.productInfo.storeName,
|
title: that.productInfo.storeName,
|
||||||
summary: app.globalData.companyName,
|
summary: app.globalData.companyName,
|
||||||
imageUrl: that.productInfo.image,
|
imageUrl: that.productInfo.image,
|
||||||
|
@ -754,7 +756,7 @@
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 购物车手动填写
|
* 购物车手动填写
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
iptCartNum: function(e) {
|
iptCartNum: function(e) {
|
||||||
this.$set(this.attr.productSelect, 'cart_num', e ? e : 1);
|
this.$set(this.attr.productSelect, 'cart_num', e ? e : 1);
|
||||||
|
@ -796,7 +798,7 @@
|
||||||
that.$set(that.sharePacket, 'touchstart', true); //滑动屏幕时让分享气泡缩回
|
that.$set(that.sharePacket, 'touchstart', true); //滑动屏幕时让分享气泡缩回
|
||||||
},
|
},
|
||||||
/*
|
/*
|
||||||
*去商品详情页
|
*去商品详情页
|
||||||
*/
|
*/
|
||||||
goDetail(item) {
|
goDetail(item) {
|
||||||
if (!item.activityH5) {
|
if (!item.activityH5) {
|
||||||
|
@ -839,7 +841,7 @@
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 购物车数量加和数量减
|
* 购物车数量加和数量减
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
ChangeCartNum: function(changeValue) {
|
ChangeCartNum: function(changeValue) {
|
||||||
//changeValue:是否 加|减
|
//changeValue:是否 加|减
|
||||||
|
@ -871,7 +873,7 @@
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 属性变动赋值
|
* 属性变动赋值
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
ChangeAttr: function(res) {
|
ChangeAttr: function(res) {
|
||||||
let productSelect = this.productValue[res];
|
let productSelect = this.productValue[res];
|
||||||
|
@ -920,7 +922,7 @@
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 优品推荐
|
* 优品推荐
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
getGoods() {
|
getGoods() {
|
||||||
getProductGood().then(res => {
|
getProductGood().then(res => {
|
||||||
|
@ -955,7 +957,7 @@
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 获取产品详情
|
* 获取产品详情
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
getGoodsDetails: function() {
|
getGoodsDetails: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
@ -1075,7 +1077,7 @@
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 默认选中属性
|
* 默认选中属性
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
DefaultSelect: function() {
|
DefaultSelect: function() {
|
||||||
let productAttr = this.attr.productAttr;
|
let productAttr = this.attr.productAttr;
|
||||||
|
@ -1128,7 +1130,7 @@
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 获取优惠券
|
* 获取优惠券
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
getCouponList(type) {
|
getCouponList(type) {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
@ -1183,9 +1185,9 @@
|
||||||
that.$set(that.coupon, 'list', that.coupon.list);
|
that.$set(that.coupon, 'list', that.coupon.list);
|
||||||
that.$set(that.coupon, 'coupon', false);
|
that.$set(that.coupon, 'coupon', false);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* 收藏商品
|
* 收藏商品
|
||||||
*/
|
*/
|
||||||
setCollect: function() {
|
setCollect: function() {
|
||||||
|
@ -1232,7 +1234,7 @@
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 打开属性加入购物车
|
* 打开属性加入购物车
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
joinCart: function(e) {
|
joinCart: function(e) {
|
||||||
//是否登录
|
//是否登录
|
||||||
|
@ -1319,7 +1321,7 @@
|
||||||
/**
|
/**
|
||||||
* 立即购买
|
* 立即购买
|
||||||
*/
|
*/
|
||||||
goBuy: Debounce(function(e) {
|
goBuy: Debounce(function(e) {
|
||||||
if (this.isLogin === false) {
|
if (this.isLogin === false) {
|
||||||
toLogin();
|
toLogin();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1344,7 +1346,7 @@
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 分享打开
|
* 分享打开
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
listenerActionSheet: function() {
|
listenerActionSheet: function() {
|
||||||
if (this.isLogin === false) {
|
if (this.isLogin === false) {
|
||||||
|
@ -1431,7 +1433,7 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getImageBase64: function(images) {
|
getImageBase64: function(images) {
|
||||||
let that = this;
|
let that = this;
|
||||||
imageBase64({
|
imageBase64({
|
||||||
|
@ -1585,7 +1587,7 @@
|
||||||
let href = location.href;
|
let href = location.href;
|
||||||
if (this.$wechat.isWeixin()) {
|
if (this.$wechat.isWeixin()) {
|
||||||
href = href.indexOf("?") === -1 ? href + "?spread=" + this.uid: href + "&spread=" + this.uid;
|
href = href.indexOf("?") === -1 ? href + "?spread=" + this.uid: href + "&spread=" + this.uid;
|
||||||
|
|
||||||
let configAppMessage = {
|
let configAppMessage = {
|
||||||
desc: app.globalData.companyName,
|
desc: app.globalData.companyName,
|
||||||
title: data.storeName,
|
title: data.storeName,
|
||||||
|
@ -2538,7 +2540,7 @@
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -180,7 +180,7 @@
|
||||||
logoip
|
logoip
|
||||||
} from '@/api/api.js';
|
} from '@/api/api.js';
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
import {
|
import {
|
||||||
follow
|
follow
|
||||||
} from '@/api/public.js';
|
} from '@/api/public.js';
|
||||||
|
@ -211,7 +211,7 @@
|
||||||
getGroomList
|
getGroomList
|
||||||
} from '@/api/store.js';
|
} from '@/api/store.js';
|
||||||
import {
|
import {
|
||||||
silenceBindingSpread,
|
silenceBindingSpread,silenceBindingChannelId,
|
||||||
getCityList
|
getCityList
|
||||||
} from '@/utils';
|
} from '@/utils';
|
||||||
import animationType from '@/utils/animationType.js'
|
import animationType from '@/utils/animationType.js'
|
||||||
|
@ -419,11 +419,11 @@
|
||||||
let qrCodeValue = this.$util.getUrlParams(decodeURIComponent(options.scene));
|
let qrCodeValue = this.$util.getUrlParams(decodeURIComponent(options.scene));
|
||||||
let mapeMpQrCodeValue = this.$util.formatMpQrCodeData(qrCodeValue);
|
let mapeMpQrCodeValue = this.$util.formatMpQrCodeData(qrCodeValue);
|
||||||
app.globalData.spread = mapeMpQrCodeValue.spread;
|
app.globalData.spread = mapeMpQrCodeValue.spread;
|
||||||
|
app.globalData.channelId = mapeMpQrCodeValue.channelId;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (options.spread) app.globalData.spread = options.spread; //非小程序扫码进入情况下,直接获取url中的分销员id保存在globalDta中
|
if (options.spread) app.globalData.spread = options.spread; //非小程序扫码进入情况下,直接获取url中的分销员id保存在globalDta中
|
||||||
|
if (options.channelId) app.globalData.channelId = options.channelId; //非小程序扫码进入情况下,直接获取url中的分销员id保存在globalDta中
|
||||||
// #endif
|
// #endif
|
||||||
// #ifndef MP || APP-PLUS
|
// #ifndef MP || APP-PLUS
|
||||||
this.navH = 0;
|
this.navH = 0;
|
||||||
|
@ -435,8 +435,13 @@
|
||||||
if (this.isLogin && parseInt(app.globalData.spread) > 0) {
|
if (this.isLogin && parseInt(app.globalData.spread) > 0) {
|
||||||
silenceBindingSpread()
|
silenceBindingSpread()
|
||||||
}
|
}
|
||||||
|
if (this.isLogin && parseInt(app.globalData.channelId) > 0) {
|
||||||
|
silenceBindingChannelId()
|
||||||
|
}
|
||||||
|
if (this.isLogin && parseInt(options.channelId) > 0) {
|
||||||
|
silenceBindingChannelId()
|
||||||
|
}
|
||||||
|
|
||||||
// 调用记录ip
|
// 调用记录ip
|
||||||
this.getip()
|
this.getip()
|
||||||
},
|
},
|
||||||
|
@ -453,7 +458,7 @@
|
||||||
}, 1000)
|
}, 1000)
|
||||||
// #endif
|
// #endif
|
||||||
uni.showTabBar();
|
uni.showTabBar();
|
||||||
|
|
||||||
// 调用记录ip
|
// 调用记录ip
|
||||||
// this.getip()
|
// this.getip()
|
||||||
},
|
},
|
||||||
|
@ -464,7 +469,7 @@
|
||||||
console.log(res,'记录ip')
|
console.log(res,'记录ip')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
menusTap(url) {
|
menusTap(url) {
|
||||||
goPage().then(res => {
|
goPage().then(res => {
|
||||||
if (url == '/pages/goods_cate/goods_cate') {
|
if (url == '/pages/goods_cate/goods_cate') {
|
||||||
|
@ -639,7 +644,7 @@
|
||||||
appVersionConfig(){
|
appVersionConfig(){
|
||||||
var that = this;
|
var that = this;
|
||||||
//app升级
|
//app升级
|
||||||
// 获取本地应用资源版本号
|
// 获取本地应用资源版本号
|
||||||
getAppVersion().then(res => {
|
getAppVersion().then(res => {
|
||||||
that.$set(that.appUpdate, 'androidAddress', res.data.androidAddress);
|
that.$set(that.appUpdate, 'androidAddress', res.data.androidAddress);
|
||||||
that.$set(that.appUpdate, 'appVersion', res.data.appVersion);
|
that.$set(that.appUpdate, 'appVersion', res.data.appVersion);
|
||||||
|
@ -1303,4 +1308,4 @@
|
||||||
height: 344rpx;
|
height: 344rpx;
|
||||||
@include index-gradient(theme);
|
@include index-gradient(theme);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
class='iconfont icon-weixin2'></text>一键绑定手机号</button>
|
class='iconfont icon-weixin2'></text>一键绑定手机号</button>
|
||||||
<button v-if="routinePhoneVerification == 2 || routinePhoneVerification.length===3" hover-class="none"
|
<button v-if="routinePhoneVerification == 2 || routinePhoneVerification.length===3" hover-class="none"
|
||||||
@click="onUserPhone('isPhone')" class="btn2">手动绑定手机号</button>
|
@click="onUserPhone('isPhone')" class="btn2">手动绑定手机号</button>
|
||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isUp: false, // 绑定手机号手动输入弹窗
|
isUp: false, // 绑定手机号手动输入弹窗
|
||||||
phone: '',
|
phone: '',
|
||||||
statusBarHeight: statusBarHeight,
|
statusBarHeight: statusBarHeight,
|
||||||
isHome: false,
|
isHome: false,
|
||||||
isPhoneBox: false, //授权手机号弹窗
|
isPhoneBox: false, //授权手机号弹窗
|
||||||
|
@ -144,9 +144,9 @@
|
||||||
//if(!code) location.replace(decodeURIComponent(decodeURIComponent(option.query.back_url)));
|
//if(!code) location.replace(decodeURIComponent(decodeURIComponent(option.query.back_url)));
|
||||||
if (code && this.options.scope !== 'snsapi_base') {
|
if (code && this.options.scope !== 'snsapi_base') {
|
||||||
let spread = app.globalData.spread ? app.globalData.spread : 0;
|
let spread = app.globalData.spread ? app.globalData.spread : 0;
|
||||||
|
let channelId = app.globalData.channelId ? app.globalData.channelId : 0;
|
||||||
//公众号授权登录回调 wechatAuth(code, Cache.get("spread"), loginType)
|
//公众号授权登录回调 wechatAuth(code, Cache.get("spread"), loginType)
|
||||||
wechat.auth(code, spread).then(res => {
|
wechat.auth(code, spread,channelId).then(res => {
|
||||||
if (res.type === 'register') {
|
if (res.type === 'register') {
|
||||||
this.authKey = res.key;
|
this.authKey = res.key;
|
||||||
this.isUp = true
|
this.isUp = true
|
||||||
|
@ -251,6 +251,7 @@
|
||||||
let userInfo = {};
|
let userInfo = {};
|
||||||
userInfo.code = code;
|
userInfo.code = code;
|
||||||
userInfo.spread_spid = app.globalData.spread; //获取推广人ID
|
userInfo.spread_spid = app.globalData.spread; //获取推广人ID
|
||||||
|
userInfo.channelId = app.globalData.channelId; //渠道ID
|
||||||
userInfo.avatar = '';
|
userInfo.avatar = '';
|
||||||
userInfo.nickName = '微信用户';
|
userInfo.nickName = '微信用户';
|
||||||
userInfo.type = 'routine'
|
userInfo.type = 'routine'
|
||||||
|
@ -266,6 +267,7 @@
|
||||||
let userInfo = res.userInfo;
|
let userInfo = res.userInfo;
|
||||||
userInfo.code = code;
|
userInfo.code = code;
|
||||||
userInfo.spread_spid = app.globalData.spread; //获取推广人ID
|
userInfo.spread_spid = app.globalData.spread; //获取推广人ID
|
||||||
|
userInfo.channelId = app.globalData.channelId; //渠道ID
|
||||||
userInfo.avatar = userInfo.userInfo.avatarUrl;
|
userInfo.avatar = userInfo.userInfo.avatarUrl;
|
||||||
userInfo.city = userInfo.userInfo.city;
|
userInfo.city = userInfo.userInfo.city;
|
||||||
userInfo.country = userInfo.userInfo.country;
|
userInfo.country = userInfo.userInfo.country;
|
||||||
|
@ -305,6 +307,9 @@
|
||||||
if (app.globalData.spread) {
|
if (app.globalData.spread) {
|
||||||
spread(app.globalData.spread).then(res => {}) //登录成功后读取spread绑定分销关系
|
spread(app.globalData.spread).then(res => {}) //登录成功后读取spread绑定分销关系
|
||||||
}
|
}
|
||||||
|
if (app.globalData.channelId) {
|
||||||
|
channelId(app.globalData.channelId).then(res => {}) //登录成功后读取渠道绑定关系
|
||||||
|
}
|
||||||
self.$util.Tips({
|
self.$util.Tips({
|
||||||
title: res,
|
title: res,
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
|
@ -457,4 +462,4 @@
|
||||||
height: 50rpx;
|
height: 50rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user