Commit 963044f0 by 李嘉林

加log

parent d3783440
...@@ -71,14 +71,14 @@ export default { ...@@ -71,14 +71,14 @@ export default {
pageUrl(n,o) { pageUrl(n,o) {
//埋点未登录时进入文章 //埋点未登录时进入文章
// this.params+='&articleId=111' // this.params+='&articleId=111'
log.info(wx.getStorageSync("sessionid"),3333333,this.pageUrl) log.info('watch-pageUrl-sessionid',wx.getStorageSync("sessionid"))
log.info('watch-pageUrl-pageUrl',this.pageUrl)
if(!wx.getStorageSync("sessionid")&&this.pageUrl.indexOf('articleId')!=-1) { if(!wx.getStorageSync("sessionid")&&this.pageUrl.indexOf('articleId')!=-1) {
// wx.setStorageSync('articleId',true) // wx.setStorageSync('articleId',true)
var vars = this.pageUrl.split("&"); var vars = this.pageUrl.split("&");
log.info(vars,2222) log.info('watch-pageUrl.split("&")',vars)
for (var i = 0; i < vars.length; i++) { for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("="); var pair = vars[i].split("=");
log.info(pair,1111)
if (pair[0] == 'articleId') { if (pair[0] == 'articleId') {
wx.setStorageSync(this.$store.state.mixid+'articleId',pair[1]) wx.setStorageSync(this.$store.state.mixid+'articleId',pair[1])
} }
...@@ -92,15 +92,15 @@ export default { ...@@ -92,15 +92,15 @@ export default {
if (this.pageUrl.split('unionId=')[1]) { if (this.pageUrl.split('unionId=')[1]) {
unionId = this.pageUrl.split('unionId=')[1].split('&')[0] unionId = this.pageUrl.split('unionId=')[1].split('&')[0]
} }
indexApi.addRecord( let addRecordQuery = {
{
attractingCustomersChannelId: wx.getStorageSync('attractingCustomerChannelId'), attractingCustomersChannelId: wx.getStorageSync('attractingCustomerChannelId'),
miniOpenId: openId, miniOpenId: openId,
unionId: unionId, unionId: unionId,
registerFlag: 1, registerFlag: 1,
newRegisterFlag: 0, newRegisterFlag: 0,
} }
).then(ele=>{ indexApi.addRecord(addRecordQuery).then(ele=>{
log.info('watch-pageUrl-addRecord',addRecordQuery,ele)
if (ele.data.data) { if (ele.data.data) {
//清空引客渠道id //清空引客渠道id
wx.setStorageSync('attractingCustomerChannelId',''); wx.setStorageSync('attractingCustomerChannelId','');
...@@ -134,6 +134,7 @@ export default { ...@@ -134,6 +134,7 @@ export default {
this.code = res.code; this.code = res.code;
log.info(this.code,'-----------------------------110---code') log.info(this.code,'-----------------------------110---code')
login.get_open_id_by_code({ code: this.code}).then(res1 => { login.get_open_id_by_code({ code: this.code}).then(res1 => {
log.info('onLoad-api:get_open_id_by_code',this.code,res1)
if (res1.data.code == 200) { if (res1.data.code == 200) {
wx.setStorage({ wx.setStorage({
key: "openid", key: "openid",
...@@ -156,8 +157,10 @@ export default { ...@@ -156,8 +157,10 @@ export default {
this.checkLogin(); this.checkLogin();
this.options = options; this.options = options;
if (options.share) { if (options.share) {
log.info('options.share',options.share)
//来自分享 //来自分享
this.link = decodeURIComponent(options.share); this.link = decodeURIComponent(options.share);
log.info('options.share-link',this.link)
this.spokesmanGroupId = this.spokesmanGroupId =
getQueryVariable(this.link, "spokesmanGroupId") || ""; getQueryVariable(this.link, "spokesmanGroupId") || "";
this.spokesmanShopId = this.spokesmanShopId =
...@@ -166,11 +169,13 @@ export default { ...@@ -166,11 +169,13 @@ export default {
this.userId = getQueryVariable(this.link, "userId") || ""; this.userId = getQueryVariable(this.link, "userId") || "";
if (this.spokesmanGroupId != "") { if (this.spokesmanGroupId != "") {
//上级分销员信息 //上级分销员信息
this.$store.commit("setSpokesman", { let spokesmanInfo = {
spokesmanGroupId: this.spokesmanGroupId, spokesmanGroupId: this.spokesmanGroupId,
spokesmanShopId: this.spokesmanShopId, spokesmanShopId: this.spokesmanShopId,
spokesmanRelId: this.spokesmanRelId spokesmanRelId: this.spokesmanRelId
}); }
log.info('options.share-上级分销员信息',spokesmanInfo)
this.$store.commit("setSpokesman", spokesmanInfo);
} }
this.page = ""; this.page = "";
this.params = ""; this.params = "";
...@@ -193,6 +198,7 @@ export default { ...@@ -193,6 +198,7 @@ export default {
} }
options.params && (this.params += "&" + serialize(decodeURIComponent(options.params))); options.params && (this.params += "&" + serialize(decodeURIComponent(options.params)));
} else if (options.from && options.from == "themeLink") { } else if (options.from && options.from == "themeLink") {
log.info('options.from == "themeLink"')
// 多主题link // 多主题link
this.page = decodeURIComponent(options.backpath); this.page = decodeURIComponent(options.backpath);
this.params += "&" + decodeURIComponent(options.params); this.params += "&" + decodeURIComponent(options.params);
...@@ -201,10 +207,12 @@ export default { ...@@ -201,10 +207,12 @@ export default {
this.page = decodeURIComponent(options.backpath); this.page = decodeURIComponent(options.backpath);
this.params += "&" + serialize(options.params); this.params += "&" + serialize(options.params);
} else if (options.from && options.from == "login") { } else if (options.from && options.from == "login") {
log.info('options.from == "login"')
//来自小程序登录页面 //来自小程序登录页面
this.page = decodeURIComponent(options.backpath); this.page = decodeURIComponent(options.backpath);
this.params += "&" + decodeURIComponent(options.params); this.params += "&" + decodeURIComponent(options.params);
} else if (options.from && options.from == "logout") { } else if (options.from && options.from == "logout") {
log.info('options.from == "logout"')
//来自用户登出 //来自用户登出
wx.removeStorage({ wx.removeStorage({
key: "sessionid" key: "sessionid"
...@@ -213,34 +221,37 @@ export default { ...@@ -213,34 +221,37 @@ export default {
key: "openid" key: "openid"
}); });
} else if (options.from && options.from == "address") { } else if (options.from && options.from == "address") {
log.info('options.from == "address"')
// 来自小程序地址页面 // 来自小程序地址页面
this.link = decodeURIComponent(options.backpath); this.link = decodeURIComponent(options.backpath);
log.info("adress", options.backpath, this.link); log.info("adress", options.backpath, this.link);
this.page = ""; this.page = "";
this.params = ""; this.params = "";
} else if (options.from == "wxPay") { } else if (options.from == "wxPay") {
log.info('options.from == "wxPay"')
//来自支付页面 //来自支付页面
this.page = options.backpath; this.page = options.backpath;
this.params += "&" + serialize(options.params); this.params += "&" + serialize(options.params);
} else if (options.scene) { } else if (options.scene) {
log.info(options) log.info('options.scene',options)
log.info(222222)
if(options.scene.indexOf('_') == -1){ if(options.scene.indexOf('_') == -1){
log.info("新版本(scene参数)分享进入")
this.withoutScene = false; this.withoutScene = false;
//新二维码扫码进入 //新二维码扫码进入
wx.nextTick(() => { wx.nextTick(() => {
indexApi.getShareSceneRecord(options.scene).then(res=>{ indexApi.getShareSceneRecord(options.scene).then(res=>{
this.withoutScene = true; this.withoutScene = true;
log.info('getShareSceneRecord',res)
if(res.data.code == '200'){ if(res.data.code == '200'){
this.page = res.data.data.pageUri; this.page = res.data.data.pageUri;
let paramsObj = JSON.parse(res.data.data.scene); let paramsObj = JSON.parse(res.data.data.scene);
wx.setStorageSync('attractingCustomerChannelId',paramsObj.attractingCustomerChannelId); wx.setStorageSync('attractingCustomerChannelId',paramsObj.attractingCustomerChannelId);
wx.setStorageSync(this.$store.state.mixid+'storeId',paramsObj.storeId); wx.setStorageSync(this.$store.state.mixid+'storeId',paramsObj.storeId);
wx.setStorageSync(this.$store.state.mixid+'sellerId',paramsObj.sellerId); wx.setStorageSync(this.$store.state.mixid+'sellerId',paramsObj.sellerId);
log.info(res.data.data)
wx.login({ wx.login({
success: res => { success: res => {
login.get_open_id_by_code({ code: res.code}).then(res1 => { login.get_open_id_by_code({ code: res.code}).then(res1 => {
log.info('get_open_id_by_code',res1)
if (res1.data.code == 200) { if (res1.data.code == 200) {
wx.setStorageSync({ wx.setStorageSync({
key: "openid", key: "openid",
...@@ -249,14 +260,14 @@ export default { ...@@ -249,14 +260,14 @@ export default {
log.info('判断是否登录过=登陆过直接调用..未登录过需要授权头像昵称信息。') log.info('判断是否登录过=登陆过直接调用..未登录过需要授权头像昵称信息。')
if (wx.getStorageSync('sessionid')) { if (wx.getStorageSync('sessionid')) {
log.info('已登陆了') log.info('已登陆了')
indexApi.addRecord( let addRecordQuery = {
{
attractingCustomersChannelId: paramsObj.attractingCustomerChannelId, attractingCustomersChannelId: paramsObj.attractingCustomerChannelId,
miniOpenId: res1.data.data, miniOpenId: res1.data.data,
registerFlag: 1, registerFlag: 1,
newRegisterFlag: 0, newRegisterFlag: 0,
} };
).then(ele=>{ indexApi.addRecord(addRecordQuery).then(ele=>{
log.info('addRecord',addRecordQuery,ele)
if (ele.data.data) { if (ele.data.data) {
//清空引客渠道id //清空引客渠道id
wx.setStorageSync('attractingCustomerChannelId',''); wx.setStorageSync('attractingCustomerChannelId','');
...@@ -288,6 +299,7 @@ export default { ...@@ -288,6 +299,7 @@ export default {
}); });
}else { }else {
log.info('老版本分享(下划线拼接参数)')
//来自扫码 //来自扫码
// options 中的scene需要使用decodeURIComponent才能获取到生成二维码时传入的scene // options 中的scene需要使用decodeURIComponent才能获取到生成二维码时传入的scene
var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数 var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数
...@@ -408,7 +420,7 @@ export default { ...@@ -408,7 +420,7 @@ export default {
let getOpenid = wx.getStorageSync("openid"); let getOpenid = wx.getStorageSync("openid");
let getSessionid = wx.getStorageSync("sessionid"); let getSessionid = wx.getStorageSync("sessionid");
log.info('244',getOpenid,getSessionid); log.info('methods-checkLogin',getOpenid,getSessionid);
if (getOpenid == "" || getSessionid == "") { if (getOpenid == "" || getSessionid == "") {
// this.params += "&logOut=true"; // this.params += "&logOut=true";
} }
...@@ -430,6 +442,7 @@ export default { ...@@ -430,6 +442,7 @@ export default {
}, },
async getSpokesman() { async getSpokesman() {
await spokesman.getSpokesmanidByShare().then(res => { await spokesman.getSpokesmanidByShare().then(res => {
log.info('onShareAppMessage-getSpokesmanidByShare',res)
if (res.data.code == 200) { if (res.data.code == 200) {
if (res.data.data.hasInvitationStatus == 1) { if (res.data.data.hasInvitationStatus == 1) {
this.hasInvitationStatus = 1; this.hasInvitationStatus = 1;
...@@ -445,7 +458,7 @@ export default { ...@@ -445,7 +458,7 @@ export default {
}else{ }else{
this.newHref=""; this.newHref="";
} }
log.info(this.newHref, "this.newHrefthis.newHrefthis.newHref"); log.info('onShareAppMessage-getSpokesmanidByShare',this.newHref);
} }
}); });
}, },
...@@ -460,7 +473,7 @@ export default { ...@@ -460,7 +473,7 @@ export default {
//右上角分享时触发 //右上角分享时触发
getMessage(res) { getMessage(res) {
let len = res.target.data.length - 1; let len = res.target.data.length - 1;
log.info(res, "h5消息", res.target.data[len]); log.info('右上角分享触发',res, res.target.data[len]);
this.shareShopName = res.target.data[len].shareShopName || ""; this.shareShopName = res.target.data[len].shareShopName || "";
this.shareLogoUrl = DFSImg(res.target.data[len].shareLogoUrl, 500, 400); this.shareLogoUrl = DFSImg(res.target.data[len].shareLogoUrl, 500, 400);
...@@ -468,7 +481,7 @@ export default { ...@@ -468,7 +481,7 @@ export default {
this.shareOrderSn = res.target.data[len].orderSn; this.shareOrderSn = res.target.data[len].orderSn;
this.shareTid = res.target.data[len].shareTid; this.shareTid = res.target.data[len].shareTid;
this.newWindowHref = res.target.data[len].shareImgUrl + '&verifyShare=1';// + '&fromVisitorOpenId=' + wx.getStorageSync("openid") this.newWindowHref = res.target.data[len].shareImgUrl + '&verifyShare=1';// + '&fromVisitorOpenId=' + wx.getStorageSync("openid")
log.info("分享信息:", this.shareLogoUrl, this.shareShopName,1111111,this.newWindowHref); log.info("getMessage-分享信息:", this.shareLogoUrl, this.shareShopName,1111111,this.newWindowHref);
//文章详情分享埋点 //文章详情分享埋点
if(this.newWindowHref.indexOf('articleId')!=-1) { if(this.newWindowHref.indexOf('articleId')!=-1) {
var articleId = '' var articleId = ''
...@@ -490,6 +503,7 @@ export default { ...@@ -490,6 +503,7 @@ export default {
log.info('网页加载成功'); log.info('网页加载成功');
}, },
handleError(data){ handleError(data){
log.info('handleError',data)
wx.showLoading({ wx.showLoading({
title: "网页加载失败 请右上角刷新" title: "网页加载失败 请右上角刷新"
}); });
...@@ -553,6 +567,7 @@ export default { ...@@ -553,6 +567,7 @@ export default {
log.info("卸载----------------", this.options); log.info("卸载----------------", this.options);
}, },
async onShareAppMessage(res) { async onShareAppMessage(res) {
log.info('onShareAppMessage',res)
await this.getSpokesman(); await this.getSpokesman();
let url = '' let url = ''
log.info(this.newWindowHref + 'this.newWindowHref') log.info(this.newWindowHref + 'this.newWindowHref')
...@@ -584,7 +599,7 @@ export default { ...@@ -584,7 +599,7 @@ export default {
} }
log.info(this.shareUrl, "index12"); log.info('onShareAppMessage-shareUrl',this.shareUrl,);
log.info(`/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, '测试直播分享相关') log.info(`/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, '测试直播分享相关')
return { return {
title: this.shareShopName, // 默认是小程序的名称 title: this.shareShopName, // 默认是小程序的名称
......
...@@ -117,8 +117,9 @@ export default { ...@@ -117,8 +117,9 @@ export default {
}) })
}, },
onLoad(options) { onLoad(options) {
log.info(options,'----------------------login-options') log.info(options,'----------------------login-onload-options')
login.getShopUserProtocol().then(res => { login.getShopUserProtocol().then(res => {
log.info('获取用户协议',res)
if(res.data.code == '200') { if(res.data.code == '200') {
this.content = res.data.data; this.content = res.data.data;
} }
...@@ -157,6 +158,7 @@ export default { ...@@ -157,6 +158,7 @@ export default {
this.logoUrl = wx.getStorageSync("logoUrl"); this.logoUrl = wx.getStorageSync("logoUrl");
if (!(this.shopName && this.logoUrl)) { if (!(this.shopName && this.logoUrl)) {
shop.getShopInfo().then(res => { shop.getShopInfo().then(res => {
log.info('获取商城信息',res)
if (res.data.code == 200) { if (res.data.code == 200) {
this.shopName = res.data.data.shopName; this.shopName = res.data.data.shopName;
this.logoUrl = process.env.IMG_DOMAIN + res.data.data.logoUrl; this.logoUrl = process.env.IMG_DOMAIN + res.data.data.logoUrl;
...@@ -176,15 +178,18 @@ export default { ...@@ -176,15 +178,18 @@ export default {
init() { init() {
let _this = this; let _this = this;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
login let query = {
.miniLogin({ code: this.code, code: this.code,
spokesmanRelId : '', spokesmanRelId : '',
spokesmanGroupId : '', spokesmanGroupId : '',
spokesmanShopId : '', spokesmanShopId : '',
nickname: _this.wxUserInfo.nickName, nickname: _this.wxUserInfo.nickName,
headImgUrl: _this.wxUserInfo.avatarUrl headImgUrl: _this.wxUserInfo.avatarUrl
}) };
login
.miniLogin(query)
.then(res => { .then(res => {
log.info('/wx/mini_login',query,res)
if (res.data.code == 200) { if (res.data.code == 200) {
resolve(res); resolve(res);
} else { } else {
...@@ -197,9 +202,9 @@ export default { ...@@ -197,9 +202,9 @@ export default {
}); });
}, },
addRecord(flag) { addRecord(flag) {
log.info(wx.getStorageSync('attractingCustomerChannelId')) log.info('attractingCustomerChannelId',wx.getStorageSync('attractingCustomerChannelId'))
log.info(this.openid) log.info('openid',this.openid)
log.info(99999) log.info('addRecord',flag)
//埋点引客渠道 //埋点引客渠道
if(wx.getStorageSync('attractingCustomerChannelId')) { if(wx.getStorageSync('attractingCustomerChannelId')) {
indexApi.addRecord( indexApi.addRecord(
...@@ -211,6 +216,7 @@ export default { ...@@ -211,6 +216,7 @@ export default {
newRegisterFlag: flag?1:0,//1是新注册用户 newRegisterFlag: flag?1:0,//1是新注册用户
} }
).then(ele=>{ ).then(ele=>{
log.info('addRecord',res)
if (ele.data.data) { if (ele.data.data) {
wx.setStorageSync('attractingCustomerChannelId','') wx.setStorageSync('attractingCustomerChannelId','')
} }
...@@ -218,6 +224,7 @@ export default { ...@@ -218,6 +224,7 @@ export default {
} }
}, },
getUserProfile() { getUserProfile() {
log.info('点击了微信一键登录');
let _this = this; let _this = this;
if(this.content&&!this.checked) { if(this.content&&!this.checked) {
wx.showToast({ wx.showToast({
...@@ -236,6 +243,7 @@ export default { ...@@ -236,6 +243,7 @@ export default {
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (e) => { success: (e) => {
_this.wxUserInfo = e.userInfo; _this.wxUserInfo = e.userInfo;
log.info('获取wx.getUserProfile用户信息',_this.wxUserInfo);
this.init() this.init()
.then(res => { .then(res => {
//存入openid //存入openid
...@@ -302,6 +310,7 @@ export default { ...@@ -302,6 +310,7 @@ export default {
}); });
}, },
fail: (e) => { fail: (e) => {
log.info('wx.getUserProfile-fail',e)
wx.hideLoading() wx.hideLoading()
} }
}) })
...@@ -320,6 +329,7 @@ export default { ...@@ -320,6 +329,7 @@ export default {
login login
.checkUnionid({ unionId: this.unionId, openId: this.openid }) .checkUnionid({ unionId: this.unionId, openId: this.openid })
.then(res => { .then(res => {
log.info('checkUnionid',res)
wx.hideLoading(); wx.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
if (res.data.data.isHaveUnion == "true") { if (res.data.data.isHaveUnion == "true") {
...@@ -469,11 +479,11 @@ export default { ...@@ -469,11 +479,11 @@ export default {
query.spokesmanShopId = this.$store.state.spokesmanShopId; query.spokesmanShopId = this.$store.state.spokesmanShopId;
} }
log.info(query, "query");
login login
.bindUser(query) .bindUser(query)
.then(res => { .then(res => {
//绑定成功 //绑定成功
log.info('bindUser',query,res)
if (res.data.code == 200) { if (res.data.code == 200) {
wx.setStorageSync(this.$store.state.mixid+'articleId',false) wx.setStorageSync(this.$store.state.mixid+'articleId',false)
this.NEED_CERTIFIED = res.data.data.NEED_CERTIFIED; this.NEED_CERTIFIED = res.data.data.NEED_CERTIFIED;
...@@ -513,6 +523,7 @@ export default { ...@@ -513,6 +523,7 @@ export default {
}); });
}, },
handbindHandle() { handbindHandle() {
log.info('点击手动绑定手机号')
log.info(this.queryOptions,'---------------options') log.info(this.queryOptions,'---------------options')
const query = { const query = {
openId: this.openid, openId: this.openid,
...@@ -526,7 +537,7 @@ export default { ...@@ -526,7 +537,7 @@ export default {
param: this.queryOptions.param, param: this.queryOptions.param,
back: this.queryOptions.back, back: this.queryOptions.back,
}; };
log.info(query,'-------------------519') log.info(query,'handbindHandle-query')
log.info( serialize(query),'------------------- serialize(query)') log.info( serialize(query),'------------------- serialize(query)')
if(wx.getStorageSync(this.$store.state.mixid+'storeId')) { if(wx.getStorageSync(this.$store.state.mixid+'storeId')) {
query.storeId = wx.getStorageSync(this.$store.state.mixid+'storeId') query.storeId = wx.getStorageSync(this.$store.state.mixid+'storeId')
...@@ -546,6 +557,7 @@ export default { ...@@ -546,6 +557,7 @@ export default {
// wx.reLaunch({ // wx.reLaunch({
// url : '/pages/home/main' // url : '/pages/home/main'
// }) // })
log.info('点击暂不登录')
wx.navigateBack({ wx.navigateBack({
delta: 1 delta: 1
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment