Commit 6303967c by 柳士祥

小程序日志添加

parent 0db371a5
......@@ -569,8 +569,11 @@ export default {
.tabStyle1 {
.van-tabs__line {
height: 30px;
bottom: 6px;
height: auto;
bottom: 4px;
top:4px;
left: 8px;
right: 8px;
border-radius: 38px;
}
}
......@@ -611,8 +614,8 @@ export default {
content: "";
position:absolute;
bottom: 4px;
left: 0;
right: 0;
left: 8px;
right: 8px;
top: 4px;
border-radius: 34px;
background: var(--default-tab-background-bolor);
......@@ -632,8 +635,8 @@ export default {
content: "";
position:absolute;
bottom: 4px;
left: 0;
right: 0;
left: 8px;
right: 8px;
height: 4px;
background: var(--default-tab-underline-color);
z-index: -1;
......
......@@ -11,6 +11,7 @@ import cartApi from './api/cart'
import classificationApi from "./api/classification";
import spokesmanApi from './api/spokesman'
import { DFSImg, concatUrl } from "@/utils/index";
var log = require('./utils/log')
import fenxiaoModel from "@/utils/fenxiaoModel";
import {
$themeAddToCard,
......@@ -133,7 +134,7 @@ mpApp.spokesmanApi = spokesmanApi
mpApp.getThemePage = getThemePage
mpApp.themeColor = {}
mpApp.log = log
function getThemePage({mixid,shopid}) {
shop
......
......@@ -11,6 +11,8 @@ import shop from "@/api/shop.js";
import indexApi from "@/api/index.js";
import { serialize, getQueryVariable, DFSImg } from "@/utils/index";
import login from "@/api/login";
const app = getApp();
const { log } = app;
export default {
data() {
return {
......@@ -69,14 +71,14 @@ export default {
pageUrl(n,o) {
//埋点未登录时进入文章
// this.params+='&articleId=111'
console.log(wx.getStorageSync("sessionid"),3333333,this.pageUrl)
log.info(wx.getStorageSync("sessionid"),3333333,this.pageUrl)
if(!wx.getStorageSync("sessionid")&&this.pageUrl.indexOf('articleId')!=-1) {
// wx.setStorageSync('articleId',true)
var vars = this.pageUrl.split("&");
console.log(vars,2222)
log.info(vars,2222)
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
console.log(pair,1111)
log.info(pair,1111)
if (pair[0] == 'articleId') {
wx.setStorageSync(this.$store.state.mixid+'articleId',pair[1])
}
......@@ -84,7 +86,7 @@ export default {
}
// 小程序登录绑定手机号后回调页面记录客流渠道记录数据。
if (wx.getStorageSync('sessionid') && wx.getStorageSync('attractingCustomerChannelId') && this.pageUrl.indexOf('open_id') != -1) {
console.log('绑定手机号后登陆回调页')
log.info('绑定手机号后登陆回调页')
let openId = this.pageUrl.split('open_id=')[1].split('&')[0]
let unionId = null
if (this.pageUrl.split('unionId=')[1]) {
......@@ -115,7 +117,7 @@ export default {
wx.setStorageSync(this.$store.state.mixid+'sellerId','')
}
this.options = options;
console.log(this.options,'----------------index-----options')
log.info(this.options,'----------------index-----options')
Object.assign(this.$data, this.$options.data());
if(wx.getStorageSync("workBox")){
......@@ -130,7 +132,7 @@ export default {
wx.login({
success: res => {
this.code = res.code;
console.log(this.code,'-----------------------------110---code')
log.info(this.code,'-----------------------------110---code')
login.get_open_id_by_code({ code: this.code}).then(res1 => {
if (res1.data.code == 200) {
wx.setStorage({
......@@ -174,14 +176,14 @@ export default {
this.params = "";
} else if (options.from && options.from == "h5login") {
let params = JSON.parse(options.params);
console.log(params.sessionid,'--------------h5login--params')
log.info(params.sessionid,'--------------h5login--params')
//来自h5登录
wx.setStorage({
key: "sessionid",
data: params.sessionid
});
this.page = decodeURIComponent(options.backpath);
console.log(this.page,'----------------------h5login--page')
log.info(this.page,'----------------------h5login--page')
options.params && (this.params += "&" + serialize(params));
} else if (options.from && (options.from == "home" || options.from == "livedToIndex")) {
//来自直播详情
......@@ -213,7 +215,7 @@ export default {
} else if (options.from && options.from == "address") {
// 来自小程序地址页面
this.link = decodeURIComponent(options.backpath);
console.log("adress", options.backpath, this.link);
log.info("adress", options.backpath, this.link);
this.page = "";
this.params = "";
} else if (options.from == "wxPay") {
......@@ -221,8 +223,8 @@ export default {
this.page = options.backpath;
this.params += "&" + serialize(options.params);
} else if (options.scene) {
console.log(options)
console.log(222222)
log.info(options)
log.info(222222)
if(options.scene.indexOf('_') == -1){
this.withoutScene = false;
//新二维码扫码进入
......@@ -235,7 +237,7 @@ export default {
wx.setStorageSync('attractingCustomerChannelId',paramsObj.attractingCustomerChannelId);
wx.setStorageSync(this.$store.state.mixid+'storeId',paramsObj.storeId);
wx.setStorageSync(this.$store.state.mixid+'sellerId',paramsObj.sellerId);
console.log(res.data.data)
log.info(res.data.data)
wx.login({
success: res => {
login.get_open_id_by_code({ code: res.code}).then(res1 => {
......@@ -244,9 +246,9 @@ export default {
key: "openid",
data: res1.data.data
});
console.log('判断是否登录过=登陆过直接调用..未登录过需要授权头像昵称信息。')
log.info('判断是否登录过=登陆过直接调用..未登录过需要授权头像昵称信息。')
if (wx.getStorageSync('sessionid')) {
console.log('已登陆了')
log.info('已登陆了')
indexApi.addRecord(
{
attractingCustomersChannelId: paramsObj.attractingCustomerChannelId,
......@@ -261,13 +263,13 @@ export default {
}
})
} else {
console.log('未登录过需要授权头像昵称信息。')
log.info('未登录过需要授权头像昵称信息。')
const url = `/pages/login/main?back=${encodeURIComponent(this.page)}&param=${
encodeURIComponent(JSON.stringify(paramsObj))
}`;
console.log(url)
log.info(url)
wx.navigateTo({url});
}
}
......@@ -370,9 +372,9 @@ export default {
this.params += this.paramsHander(querys,3)
}
}
console.log(querys, "scene");
console.log(this.page)
console.log(this.params)
log.info(querys, "scene");
log.info(this.page)
log.info(this.params)
}
......@@ -388,7 +390,7 @@ export default {
shop.getWxMiniSubscribeMessageConfig().then(res => {
if (res.data.code == 200) {
const data = res.data.data;
console.log("wx mini subscribe message data: ", data);
log.info("wx mini subscribe message data: ", data);
if (data != null) {
const subscribeMessageObj = {};
for (var key in data) {
......@@ -406,7 +408,7 @@ export default {
let getOpenid = wx.getStorageSync("openid");
let getSessionid = wx.getStorageSync("sessionid");
console.log('244',getOpenid,getSessionid);
log.info('244',getOpenid,getSessionid);
if (getOpenid == "" || getSessionid == "") {
// this.params += "&logOut=true";
}
......@@ -419,10 +421,10 @@ export default {
var longitude = res.longitude;
var speed = res.speed;
var accuracy = res.accuracy;
console.log("~~~~~~~~~1~~~~~~~", res);
log.info("~~~~~~~~~1~~~~~~~", res);
},
fail: res => {
console.log("++++++++++2++++++", res);
log.info("++++++++++2++++++", res);
}
});
},
......@@ -443,7 +445,7 @@ export default {
}else{
this.newHref="";
}
console.log(this.newHref, "this.newHrefthis.newHrefthis.newHref");
log.info(this.newHref, "this.newHrefthis.newHrefthis.newHref");
}
});
},
......@@ -458,7 +460,7 @@ export default {
//右上角分享时触发
getMessage(res) {
let len = res.target.data.length - 1;
console.log(res, "h5消息", res.target.data[len]);
log.info(res, "h5消息", res.target.data[len]);
this.shareShopName = res.target.data[len].shareShopName || "";
this.shareLogoUrl = DFSImg(res.target.data[len].shareLogoUrl, 500, 400);
......@@ -466,14 +468,14 @@ export default {
this.shareOrderSn = res.target.data[len].orderSn;
this.shareTid = res.target.data[len].shareTid;
this.newWindowHref = res.target.data[len].shareImgUrl + '&verifyShare=1';// + '&fromVisitorOpenId=' + wx.getStorageSync("openid")
console.log("分享信息:", this.shareLogoUrl, this.shareShopName,1111111,this.newWindowHref);
log.info("分享信息:", this.shareLogoUrl, this.shareShopName,1111111,this.newWindowHref);
//文章详情分享埋点
if(this.newWindowHref.indexOf('articleId')!=-1) {
var articleId = ''
var vars = this.newWindowHref.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
console.log(pair,2222)
log.info(pair,2222)
if (pair[0] == 'articleId') {
articleId = pair[1];
}
......@@ -485,7 +487,7 @@ export default {
},
//加载成功
handleLoad(){
console.log('网页加载成功');
log.info('网页加载成功');
},
handleError(data){
wx.showLoading({
......@@ -548,12 +550,12 @@ export default {
},
},
onUnload() {
console.log("卸载----------------", this.options);
log.info("卸载----------------", this.options);
},
async onShareAppMessage(res) {
await this.getSpokesman();
let url = ''
console.log(this.newWindowHref + 'this.newWindowHref')
log.info(this.newWindowHref + 'this.newWindowHref')
//分享路径
if(this.newWindowHref){
url = this.newWindowHref;
......@@ -573,7 +575,7 @@ export default {
}`;
}
console.log('shareUrl---------------' + url)
log.info('shareUrl---------------' + url)
//增加分销员信息
if(this.hasInvitationStatus == 1 && url.indexOf('spokesmanGroupId')==-1){
this.shareUrl = url+ this.newHref
......@@ -582,8 +584,8 @@ export default {
}
console.log(this.shareUrl, "index12");
console.log(`/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, '测试直播分享相关')
log.info(this.shareUrl, "index12");
log.info(`/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, '测试直播分享相关')
return {
title: this.shareShopName, // 默认是小程序的名称
path: `/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, // 默认是当前页面
......@@ -591,14 +593,14 @@ export default {
success: function(res) {
// 转发成功之后的回调
if (res.errMsg == "shareAppMessage:ok") {
console.log(res, "分享成功");
log.info(res, "分享成功");
}
},
fail: function() {
// 转发失败之后的回调
if (res.errMsg == "shareAppMessage:fail cancel") {
// 用户取消转发
console.log(res, "分享失败");
log.info(res, "分享失败");
} else if (res.errMsg == "shareAppMessage:fail") {
// 转发失败,其中 detail message 为详细失败信息
}
......
......@@ -46,6 +46,7 @@ import shop from "@/api/shop";
import indexApi from "@/api/index.js";
import { createdUserJWTApi } from "@/api/daoke";
const app = getApp();
const { log } = app;
export default {
data() {
return {
......@@ -116,7 +117,7 @@ export default {
})
},
onLoad(options) {
console.log(options,'----------------------login-options')
log.info(options,'----------------------login-options')
login.getShopUserProtocol().then(res => {
if(res.data.code == '200') {
this.content = res.data.data;
......@@ -196,9 +197,9 @@ export default {
});
},
addRecord(flag) {
console.log(wx.getStorageSync('attractingCustomerChannelId'))
console.log(this.openid)
console.log(99999)
log.info(wx.getStorageSync('attractingCustomerChannelId'))
log.info(this.openid)
log.info(99999)
//埋点引客渠道
if(wx.getStorageSync('attractingCustomerChannelId')) {
indexApi.addRecord(
......@@ -241,9 +242,9 @@ export default {
try {
wx.setStorageSync('openid', res.data.data.openid)
} catch (e) {
console.log('存入openid失败',e)
log.info('存入openid失败',e)
}
console.log(this.$store.state.mixid,'mixid------230')
log.info(this.$store.state.mixid,'mixid------230')
//冬奥会测试赛(mixid=CL)定制一键登录直接返回不用手机号
let isCertified = false;
// this.mpApp.globalData.shopInfo.outCode正式环境提审测试赛项目 这个值后台改为1 审核通过改为空
......@@ -295,7 +296,7 @@ export default {
this.checkLogin(e);
})
.catch(err => {
console.log("err", err);
log.info("err", err);
wx.hideLoading();
wx.showToast({ title: err, icon: "none" });
});
......@@ -361,7 +362,7 @@ export default {
// 是否跳转h5或小程序
pushPageType(){
//绑定上下级关系
console.log(this.scene,'this.scene====',this.backPath)
log.info(this.scene,'this.scene====',this.backPath)
app.fenxiaoModel.becomeRelation(wx.getStorageSync("becomeInfo")?JSON.parse(wx.getStorageSync("becomeInfo")):'').then(res=>{
if(res) {
wx.removeStorage({
......@@ -371,7 +372,7 @@ export default {
})
let parseLink=decodeURIComponent(this.backPath);
console.log(this.backPath,parseLink,'---------------------------325')
log.info(this.backPath,parseLink,'---------------------------325')
if(parseLink.includes('/pages/')){
wx.reLaunch({
url: parseLink
......@@ -384,14 +385,14 @@ export default {
// 动态表单
createdUserJWTApi().then(res => {
this.backParams += `&token=${res}`;
console.log(this.backParams,`${this.backPath}${this.backParams}`,"-------------------------355")
log.info(this.backParams,`${this.backPath}${this.backParams}`,"-------------------------355")
wx.reLaunch({
url: `../wxArticle/main?link=${this.backPath+this.backParams}`
});
})
}else if (this.scene=='sso' || this.backPath.includes('scene=sso') || this.ossLink.indexOf('scene=sso')>-1) {
let backPath = this.backPath;
console.log(decodeURIComponent(backPath),600000)
log.info(decodeURIComponent(backPath),600000)
if(this.ossLink) {
backPath += '?'+this.ossLink
}
......@@ -434,7 +435,7 @@ export default {
e.mp.detail.encryptedData,
e.mp.detail.iv + ""
).phoneNumber;
console.log("生命周期一直", this.phoneNumber);
log.info("生命周期一直", this.phoneNumber);
this.bindUser();
}
},
......@@ -468,7 +469,7 @@ export default {
query.spokesmanShopId = this.$store.state.spokesmanShopId;
}
console.log(query, "query");
log.info(query, "query");
login
.bindUser(query)
.then(res => {
......@@ -493,7 +494,7 @@ export default {
}
})
.catch(err => {
console.log(err, "bindusererr");
log.info(err, "bindusererr");
});
},
backMainHandle() {
......@@ -512,7 +513,7 @@ export default {
});
},
handbindHandle() {
console.log(this.queryOptions,'---------------options')
log.info(this.queryOptions,'---------------options')
const query = {
openId: this.openid,
unionId: this.unionId,
......@@ -525,8 +526,8 @@ export default {
param: this.queryOptions.param,
back: this.queryOptions.back,
};
console.log(query,'-------------------519')
console.log( serialize(query),'------------------- serialize(query)')
log.info(query,'-------------------519')
log.info( serialize(query),'------------------- serialize(query)')
if(wx.getStorageSync(this.$store.state.mixid+'storeId')) {
query.storeId = wx.getStorageSync(this.$store.state.mixid+'storeId')
}
......
var log = wx.getRealtimeLogManager ? wx.getRealtimeLogManager() : null
module.exports = {
debug() {
if (!log) return
log.debug.apply(log, arguments)
},
info() {
console.log('日志log级别');
if (!log) return
log.info.apply(log, arguments)
},
warn() {
if (!log) return
log.warn.apply(log, arguments)
},
error() {
if (!log) return
log.error.apply(log, arguments)
},
setFilterMsg(msg) { // 从基础库2.7.3开始支持
if (!log || !log.setFilterMsg) return
if (typeof msg !== 'string') return
log.setFilterMsg(msg)
},
addFilterMsg(msg) { // 从基础库2.8.1开始支持
if (!log || !log.addFilterMsg) return
if (typeof msg !== 'string') return
log.addFilterMsg(msg)
}
}
\ No newline at end of file
const app = getApp();
const { goodsApi, DFSImg, $themeToLink, $themeAddToCard } = app;
const { goodsApi, DFSImg, $themeToLink, $themeAddToCard,log } = app;
const componentOptions = {
// 组件选项
options: {
......@@ -26,7 +27,17 @@ const componentOptions = {
observers: {},
// 组件方法
methods: {
init() {},
init() {
let datas = this.data.datas
if(datas.componentData.angleSignImg && datas.componentData.angleSignImg.lenght != 0){
datas.componentData.angleSignImg = DFSImg(datas.componentData.angleSignImg,150,150,1)
}
this.setData({
datas
})
log.info('datas');
},
getSaleTime(val) {
return new Date(val.replace(/-/g, "/")).getTime() - new Date().getTime();
},
......
......@@ -68,7 +68,7 @@ const componentOptions = {
angleSignImg,
titleIcon
} = this.data.datas.componentData;
angleSignImg = DFSImg(angleSignImg);
angleSignImg = DFSImg(angleSignImg,150,150,1);
if (titleIcon) {
titleIcon = DFSImg(titleIcon);
}
......
......@@ -59,7 +59,7 @@ function trackStyle(data) {
function lineStyle(data) {
return style({
width: utils.addUnit(data.lineWidth),
width: utils.addUnit(data.lineWidth - 16),
transform: 'translateX(' + data.lineOffsetLeft + 'px)',
'-webkit-transform': 'translateX(' + data.lineOffsetLeft + 'px)',
'background-color': data.color,
......@@ -80,3 +80,5 @@ module.exports = {
lineStyle: lineStyle,
navStyle: navStyle,
};
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