Authored by huangyi

Merge branch 'feature/code-style' of http://git.yoho.cn/fe/yoho-luck into feature/code-style

1 -import objectAssign from './vendors/object-assign';  
2 -import {WeToast} from './vendors/toast/wetoast';  
3 -import { API_HOST, MINI_APP_TYPE} from './libs/config';  
4 -import {GET} from './libs/request';  
5 import md5 from './vendors/md5'; 1 import md5 from './vendors/md5';
6 -var mta = require('./vendors/mta_analysis.js');  
7 -import regeneratorRuntime from '/login/libs/regenerator-runtime/index.js';  
8 -import { isStringEmpty, getYHStorageSync} from './utils/util';  
9 -import { Event } from '/login/utils/index.js';  
10 -import { wxLogin } from '/login/utils/login/login.js';  
11 -import { appReport } from './libs/appReport.js'; 2 +import {GET} from './libs/request';
  3 +import {WeToast} from './vendors/toast/wetoast';
  4 +import objectAssign from './vendors/object-assign';
  5 +import {API_HOST, MINI_APP_TYPE} from './libs/config';
  6 +import mta from './vendors/mta_analysis';
  7 +import {Event} from '/login/utils/index.js';
  8 +import {wxLogin} from '/login/utils/login/login';
  9 +import {appReport} from './libs/appReport.js';
  10 +import {isStringEmpty, getYHStorageSync} from './utils/util';
  11 +import regeneratorRuntime from '/login/libs/regenerator-runtime/index';
  12 +
  13 +import {
  14 + yasReport,
  15 + YB_LAUNCH_APP,
  16 + YB_ENTER_FOREGROUND,
  17 + YB_ENTER_BACKGROUND,
  18 + YB_AWAKE_MP
  19 +} from './libs/yas';
  20 +import router from './pages/zeroSell/router/router';
12 21
13 const event = new Event(); 22 const event = new Event();
14 global.event = event; 23 global.event = event;
15 -  
16 -import { logEvent,  
17 - YB_LAUNCH_APP,  
18 - YB_ENTER_FOREGROUND,  
19 - YB_ENTER_BACKGROUND,  
20 - YB_AWAKE_MP  
21 - } from './libs/analytics.js';  
22 -import router from './pages/zeroSell/router/router';  
23 -  
24 24
25 App({ 25 App({
26 async onLaunch(options) { 26 async onLaunch(options) {
@@ -36,8 +36,8 @@ App({ @@ -36,8 +36,8 @@ App({
36 this.globalData.systemInfo = res; 36 this.globalData.systemInfo = res;
37 this.checkUDID(); 37 this.checkUDID();
38 38
39 - that.getSimplePise()  
40 - this.checkNetworkType() 39 + that.getSimplePise();
  40 + this.checkNetworkType();
41 41
42 if (options && options.scene){ 42 if (options && options.scene){
43 this.globalData.ch = options.scene 43 this.globalData.ch = options.scene
@@ -49,49 +49,42 @@ App({ @@ -49,49 +49,42 @@ App({
49 49
50 wx.checkSession({ 50 wx.checkSession({
51 success: function () { 51 success: function () {
52 - //登录态未过期  
53 that.getWechatThirdSession(); 52 that.getWechatThirdSession();
54 that.getUserInfo(); 53 that.getUserInfo();
55 that.getUnionID(); 54 that.getUnionID();
56 that.getUser_union_type(); 55 that.getUser_union_type();
57 }, 56 },
58 fail: function () { 57 fail: function () {
59 - //登录态过期  
60 wx.setStorage({ 58 wx.setStorage({
61 - key: "WXThird_session", 59 + key: 'WXThird_session',
62 data: '' 60 data: ''
63 }); 61 });
64 wx.setStorage({ 62 wx.setStorage({
65 - key: "userInfo", 63 + key: 'userInfo',
66 data: {} 64 data: {}
67 }); 65 });
68 66
69 wx.setStorage({ 67 wx.setStorage({
70 - key: "unionID",  
71 - data: "" 68 + key: 'unionID',
  69 + data: ''
72 }); 70 });
73 71
74 wx.setStorage({ 72 wx.setStorage({
75 - key: "user_union_type",  
76 - data: "" 73 + key: 'user_union_type',
  74 + data: ''
77 }); 75 });
78 } 76 }
79 - }) 77 + });
80 this.getSessionkey(); 78 this.getSessionkey();
81 - let timestamp = new Date().getTime() + '' 79 + let timestamp = new Date().getTime() + '';
82 this.globalData.sid = md5(timestamp); 80 this.globalData.sid = md5(timestamp);
83 81
84 if (options){ 82 if (options){
85 let channel = options.query.channel; 83 let channel = options.query.channel;
86 let channelType = options.query.type; 84 let channelType = options.query.type;
87 let params = { 'CHANNEL': channel, 'TYPE': channelType }; 85 let params = { 'CHANNEL': channel, 'TYPE': channelType };
88 - logEvent(YB_LAUNCH_APP, params, this); 86 + yasReport(YB_LAUNCH_APP, params, this);
89 } 87 }
90 - setTimeout(function () {  
91 - // wechatLoginAction(function (response) {  
92 - // that.getShareInfo();  
93 - // });  
94 - }, 1000);  
95 this.mtainit(options); 88 this.mtainit(options);
96 await wxLogin(); 89 await wxLogin();
97 event.on('wechat-login-error', () => { 90 event.on('wechat-login-error', () => {
@@ -122,7 +115,7 @@ App({ @@ -122,7 +115,7 @@ App({
122 onShow(options) { 115 onShow(options) {
123 let that = this 116 let that = this
124 let params = {}; 117 let params = {};
125 - logEvent(YB_ENTER_FOREGROUND, params, that) 118 + yasReport(YB_ENTER_FOREGROUND, params, that)
126 if (that.globalData.hasReportAwakeAction==='false'){ 119 if (that.globalData.hasReportAwakeAction==='false'){
127 let pathParam = "" 120 let pathParam = ""
128 if(options && options.query) { 121 if(options && options.query) {
@@ -144,7 +137,7 @@ App({ @@ -144,7 +137,7 @@ App({
144 params = { 137 params = {
145 PAGE_PATH: path 138 PAGE_PATH: path
146 }; 139 };
147 - logEvent(YB_AWAKE_MP, params, this); 140 + yasReport(YB_AWAKE_MP, params, this);
148 that.globalData.hasReportAwakeAction = 'true' 141 that.globalData.hasReportAwakeAction = 'true'
149 } 142 }
150 143
@@ -163,7 +156,7 @@ App({ @@ -163,7 +156,7 @@ App({
163 //当应用程序进入后台状态时触发 156 //当应用程序进入后台状态时触发
164 onHide () { 157 onHide () {
165 let params = {}; 158 let params = {};
166 - logEvent(YB_ENTER_BACKGROUND,params) 159 + yasReport(YB_ENTER_BACKGROUND,params);
167 appReport('start', "LIFECYCLE", "STOP", {},this) 160 appReport('start', "LIFECYCLE", "STOP", {},this)
168 }, 161 },
169 162
@@ -376,7 +369,6 @@ App({ @@ -376,7 +369,6 @@ App({
376 }, 369 },
377 fail: function (err) { 370 fail: function (err) {
378 371
379 - // console.log("err:",err)  
380 } 372 }
381 }); 373 });
382 }, 374 },
@@ -401,13 +393,9 @@ App({ @@ -401,13 +393,9 @@ App({
401 } 393 }
402 }) 394 })
403 .catch(error => { 395 .catch(error => {
404 - // console.log(error)  
405 }); 396 });
406 }, 397 },
407 398
408 - /*  
409 - 获取分享信息  
410 - */  
411 getShareInfo: function () { 399 getShareInfo: function () {
412 // console.log('getShareInfo'); 400 // console.log('getShareInfo');
413 let param = { 401 let param = {
@@ -416,13 +404,11 @@ App({ @@ -416,13 +404,11 @@ App({
416 let that = this; 404 let that = this;
417 GET(API_HOST + '/operations/api/v5/webshare/getShare', param) 405 GET(API_HOST + '/operations/api/v5/webshare/getShare', param)
418 .then(data => { 406 .then(data => {
419 - // console.log(data)  
420 if (data && data.code == 200) { 407 if (data && data.code == 200) {
421 that.globalData.shareInfo = data.data; 408 that.globalData.shareInfo = data.data;
422 } 409 }
423 }) 410 })
424 .catch(error => { 411 .catch(error => {
425 - // console.log(error)  
426 }); 412 });
427 }, 413 },
428 414
@@ -433,19 +419,7 @@ App({ @@ -433,19 +419,7 @@ App({
433 }; 419 };
434 GET(API_HOST, param) 420 GET(API_HOST, param)
435 .then(json => { 421 .then(json => {
436 - // if (!json || !json.code || json.code != 200 || !json.data) return;  
437 - // if (!json.data || !json.data.sk) return;  
438 -  
439 - // let p2SecretKey = json.data.sk;  
440 - // if (!p2SecretKey) return;  
441 - // that.globalData.p2SecretKey = p2SecretKey;  
442 -  
443 - // wx.setStorage({  
444 - // key: "p2SecretKey",  
445 - // data: p2SecretKey  
446 - // });  
447 }) 422 })
448 -  
449 .catch(error => { 423 .catch(error => {
450 }); 424 });
451 }, 425 },
@@ -506,32 +480,13 @@ App({ @@ -506,32 +480,13 @@ App({
506 }, 480 },
507 481
508 loginCallBack: function (response) { 482 loginCallBack: function (response) {
509 - // console.log(response)  
510 - // if (response.code === 10001) {  
511 - // this.showRelaunchModal();  
512 - // }  
513 - },  
514 483
515 - showRelaunchModal: function () {  
516 - wx.showModal({  
517 - title: '提示',  
518 - content: '使用微信小程序需要微信授权,您已经拒绝了该请求,请删除小程序重新进入。',  
519 - showCancel: false,  
520 - success: function (res) {  
521 - if (res.confirm) {  
522 - wx.navigateBack({  
523 - delta: 1  
524 - })  
525 - }  
526 - }  
527 - })  
528 }, 484 },
529 485
530 getSessionkey: function () { 486 getSessionkey: function () {
531 if (this.isLogin) { 487 if (this.isLogin) {
532 - var value = getYHStorageSync('sessionkey','app') 488 + var value = getYHStorageSync('sessionkey','app');
533 if (value) { 489 if (value) {
534 - // console.log(value)  
535 this.globalData.sessionkey = value; 490 this.globalData.sessionkey = value;
536 } 491 }
537 } 492 }
@@ -554,15 +509,16 @@ App({ @@ -554,15 +509,16 @@ App({
554 }); 509 });
555 } 510 }
556 }, 511 },
557 -  
558 - mtainit(e) { 512 + getPvid() {
  513 + return md5(`${new Date().getTime()}${this.globalData.udid}`);
  514 + },
  515 + mtainit() {
559 mta.App.init({ 516 mta.App.init({
560 "appID": "500570715", 517 "appID": "500570715",
561 "eventID": "500570797", 518 "eventID": "500570797",
562 }); 519 });
563 - // console.log("init mta");  
564 }, 520 },
565 WeToast 521 WeToast
566 -}) 522 +});
567 523
568 524
@@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
2 "pages": [ 2 "pages": [
3 "pages/zeroSell/index", 3 "pages/zeroSell/index",
4 "pages/zeroSell/detail", 4 "pages/zeroSell/detail",
5 - "pages/zeroSell/myList",  
6 "pages/zeroSell/snapshootShare", 5 "pages/zeroSell/snapshootShare",
7 "pages/zeroSell/h5Page", 6 "pages/zeroSell/h5Page",
8 "pages/bindPhoneNumber/bindPhoneNumber", 7 "pages/bindPhoneNumber/bindPhoneNumber",
@@ -2,9 +2,9 @@ import { jumpByUrl } from '../../libs/urlRoute'; @@ -2,9 +2,9 @@ import { jumpByUrl } from '../../libs/urlRoute';
2 import { postFormId } from '../../libs/formIdCollectRequest.js'; 2 import { postFormId } from '../../libs/formIdCollectRequest.js';
3 3
4 import { 4 import {
5 - logEvent, 5 + yasReport,
6 YB_MAIN_POP_UP_C, 6 YB_MAIN_POP_UP_C,
7 -} from '../../libs/analytics.js' 7 +} from '../../libs/yas.js'
8 8
9 Component({ 9 Component({
10 options: { 10 options: {
@@ -46,7 +46,7 @@ Component({ @@ -46,7 +46,7 @@ Component({
46 let params = { 46 let params = {
47 TO_PATH: that.properties.url 47 TO_PATH: that.properties.url
48 }; 48 };
49 - logEvent(YB_MAIN_POP_UP_C, params); 49 + yasReport(YB_MAIN_POP_UP_C, params);
50 50
51 jumpByUrl(that.properties.url,'home'); 51 jumpByUrl(that.properties.url,'home');
52 that.hideDialog(); 52 that.hideDialog();
1 -import {LOG_EVENT_HOST} from '../libs/config';  
2 -import {UPLOAD_LOG} from '../libs/request';  
3 -import {getYHStorageSync} from '../utils/util';  
4 -  
5 -const YB_ENTER_FOREGROUND = 'YB_ENTER_FOREGROUND';  
6 -const YB_ENTER_BACKGROUND = 'YB_ENTER_BACKGROUND';  
7 -const YB_LAUNCH_APP = 'YB_LAUNCH_APP';  
8 -const YB_EXIT_APP = 'YB_EXIT_APP';  
9 -const YB_PAGE_OPEN_L = 'YB_PAGE_OPEN_L';  
10 -const YB_MAIN_TAB_C = 'YB_MAIN_TAB_C';  
11 -  
12 -const YB_MY_LOGIN = 'YB_MY_LOGIN';  
13 -const YB_REGISTER_SUCCESS = 'YB_REGISTER_SUCCESS';  
14 -const YB_AWAKE_MP = 'YB_AWAKE_MP';  
15 -const YB_GRP_BUY_DT_TOG_C = 'YB_GRP_BUY_DT_TOG_C';  
16 -const YB_MAIN_POP_UP_C = 'YB_MAIN_POP_UP_C';  
17 -  
18 -let logEvent = function (eventId, data, appData) {  
19 - let app = appData ? appData : getApp();  
20 - let ln;//语言  
21 - let os;//系统类型  
22 - let dm;//设备型号  
23 - let re;//屏幕大小  
24 - let osv;//系统版本  
25 - let ak = 'yoholuck_mp';//  
26 - let net = '0';  
27 - let ts = new Date().getTime() + '';  
28 - //用户id  
29 - let uid = app && app.globalData && app.globalData.userInfo && app.globalData.userInfo.uid ? app.globalData.userInfo.uid : '';  
30 - //设备id  
31 - let udid = app && app.globalData && app.globalData.udid ? app.globalData.udid : '';  
32 - //会话id  
33 - let sid = app && app.globalData && app.globalData.sid ? app.globalData.sid : '';  
34 - let cid = app && app.globalData && app.globalData.cid ? app.globalData.cid : '';  
35 -  
36 - let open_id = app && app.globalData && app.globalData.openID ? app.globalData.openID : getYHStorageSync('openID', 'analytics');  
37 - let union_id = app && app.globalData && app.globalData.WXUnion_ID ? app.globalData.WXUnion_ID : getYHStorageSync('unionID', 'analytics');  
38 - let ch = app && app.globalData && app.globalData.ch ? app.globalData.ch : '';  
39 -  
40 - wx.getSystemInfo({  
41 - success: function (res) {  
42 - //返回设备信息  
43 - dm = res.model;  
44 - ln = res.language;  
45 - os = res.platform;  
46 - osv = res.system;  
47 - re = res.screenWidth + '*' + res.screenHeight;  
48 - },  
49 - complete: function () {  
50 - wx.getNetworkType({  
51 - success: function (res) {  
52 - var networkType = res.networkType  
53 - if (networkType === 'wifi') {  
54 - net = '1';  
55 - } else if (networkType === '2g') {  
56 - net = '2';  
57 - } else if (networkType === '3g') {  
58 - net = '3';  
59 - } else if (networkType === '4g') {  
60 - net = '4';  
61 - } else {  
62 - net = '0';  
63 - }  
64 - },  
65 - complete: function () {  
66 - let union_type = app.getUnion_type();  
67 -  
68 - let statusParam = {'net': net, 'ln': ln};  
69 - let deviceParam = {  
70 - 'res': re,  
71 - 'osv': osv,  
72 - 'os': os,  
73 - 'ak': ak,  
74 - 'dm': dm,  
75 - 'udid': udid,  
76 - 'ch': union_type !== '' ? union_type + "" : ch + ""  
77 - };  
78 - let userParam = data;  
79 - userParam.C_ID = cid;  
80 - userParam.UNION_ID = union_id;  
81 - let eventParam = [{'param': userParam, 'ts': ts, 'op': eventId, 'uid': uid, 'sid': sid}]  
82 - let parameters = {'status': statusParam, 'device': deviceParam, 'events': eventParam}  
83 -  
84 - UPLOAD_LOG(LOG_EVENT_HOST, parameters)  
85 - .then(function (data) {  
86 - })  
87 - .catch(function (error) {  
88 - });  
89 - }  
90 - })  
91 - }  
92 - })  
93 -};  
94 -  
95 -export {  
96 - logEvent,  
97 - YB_ENTER_FOREGROUND,  
98 - YB_ENTER_BACKGROUND,  
99 - YB_LAUNCH_APP,  
100 - YB_EXIT_APP,  
101 - YB_PAGE_OPEN_L,  
102 - YB_MAIN_TAB_C,  
103 - YB_MY_LOGIN,  
104 - YB_REGISTER_SUCCESS,  
105 - YB_AWAKE_MP,  
106 - YB_GRP_BUY_DT_TOG_C,  
107 - YB_MAIN_POP_UP_C  
108 -};  
  1 +import {LOG_EVENT_HOST} from '../libs/config';
  2 +import {UPLOAD_LOG} from '../libs/request';
  3 +import {getYHStorageSync} from '../utils/util';
  4 +import path2Name from '../router/path-to-name';
  5 +import {stringify} from '../vendors/query-string'
  6 +
  7 +const YB_ENTER_FOREGROUND = 'YB_ENTER_FOREGROUND'; // 系统-程序切换置前台
  8 +const YB_ENTER_BACKGROUND = 'YB_ENTER_BACKGROUND'; // 系统-程序切换置后台
  9 +const YB_LAUNCH_APP = 'YB_LAUNCH_APP'; // 系统-启动小程序
  10 +const YB_AWAKE_MP = 'YB_AWAKE_MP'; // 唤起事件,每次启动时,上报原始的页面路径,以对推广渠道数据进行监测
  11 +const YB_MAIN_TAB_C = 'YB_MAIN_TAB_C'; // 点击页面的tab时,点击时才上报,默认载入时不上报
  12 +const YB_PAGE_OPEN_L = 'YB_PAGE_OPEN_L'; // 小程序(所有)页面加载时
  13 +const YB_MY_LOGIN = 'YB_MY_LOGIN'; // 当用户使用该登录方式登录成功时
  14 +const YB_REGISTER_SUCCESS = 'YB_REGISTER_SUCCESS'; // 用户注册成功
  15 +const YB_LUCK_DT_GDS_C = 'YB_LUCK_DT_GDS_C'; // 点击抽奖详情页底部的商品时
  16 +const YB_LUCK_DT_JOIN_C = 'YB_LUCK_DT_JOIN_C'; // 点击抽奖详情页底部的"0元参加抽奖"成功时
  17 +
  18 +const pageOpen = data => {
  19 + const _pageName = function(options, path) {
  20 + let hasConf = path2Name[path];
  21 +
  22 + // 多入口页面依据参数设定上报页面名称
  23 + if (hasConf && hasConf.multiEntry) {
  24 + let pathName = '';
  25 +
  26 + Object.keys((hasConf.multiName || {})).forEach(key => {
  27 + if (options[key]) {
  28 + pathName = hasConf.multiName[key];
  29 + return false;
  30 + }
  31 + });
  32 + return pathName;
  33 + }
  34 + return hasConf ? hasConf.pathName : '';
  35 + };
  36 +
  37 + const _pageParam = function(options = {}, fromPath) {
  38 + if (!options) return '';
  39 +
  40 + let hasConf = path2Name[fromPath];
  41 + if (hasConf && hasConf.multiEntry) {
  42 + let param = '';
  43 +
  44 + Object.keys((hasConf.multiName || {})).forEach(key => {
  45 + if (options[key]) {
  46 + param = options[key] || '';
  47 + return false;
  48 + }
  49 + });
  50 + return param;
  51 + }
  52 +
  53 + if (path2Name[fromPath] && path2Name[fromPath].paramKey) {
  54 + return `${decodeURIComponent(options[path2Name[fromPath].paramKey])}` || '';
  55 + }
  56 + return stringify(options, '');
  57 + };
  58 +
  59 + let pages = getCurrentPages();
  60 + let currentPage = pages[pages.length - 1];
  61 + let path = `${currentPage.route}`,
  62 + options = currentPage.options || {}; // 拷贝options对象,用于获取当前页面参数
  63 +
  64 + // from page relevant
  65 + let fromPage, fromPath, fromOptions;
  66 + if (pages.length > 1) {
  67 + fromPage = pages[pages.length - 2];
  68 + fromPath = `${fromPage.route}`;
  69 + fromOptions = fromPage.options || {};
  70 + }
  71 +
  72 + return Object.assign(data, {
  73 + PAGE_PATH: path,
  74 + PAGE_PARAM: _pageParam(options, path),
  75 + PAGE_NAME: _pageName(options, path),
  76 + FROM_PAGE_NAME: _pageName(options, fromPath),
  77 + FROM_PAGE_PARAM: _pageParam(fromOptions, fromPath)
  78 + });
  79 +};
  80 +
  81 +const yasReport = function (eventId, data = {}, app) {
  82 + if (eventId === YB_PAGE_OPEN_L) {
  83 + data = pageOpen(data);
  84 + }
  85 +
  86 + app = app || getApp();
  87 +
  88 + let ln; // 语言
  89 + let os; // 系统类型
  90 + let dm; // 设备型号
  91 + let re; // 屏幕大小
  92 + let osv;//系统版本
  93 + let ak = 'yoholuck_mp';//
  94 + let net = '0';
  95 + let ts = new Date().getTime() + '';
  96 + let uid = app && app.globalData && app.globalData.userInfo && app.globalData.userInfo.uid ? app.globalData.userInfo.uid : '';
  97 + let udid = app && app.globalData && app.globalData.udid ? app.globalData.udid : '';
  98 + let sid = app && app.globalData && app.globalData.sid ? app.globalData.sid : '';
  99 + let cid = app && app.globalData && app.globalData.cid ? app.globalData.cid : '';
  100 +
  101 + let open_id = app && app.globalData && app.globalData.openID ? app.globalData.openID : getYHStorageSync('openID', 'analytics');
  102 + let union_id = app && app.globalData && app.globalData.WXUnion_ID ? app.globalData.WXUnion_ID : getYHStorageSync('union_id', 'analytics');
  103 + let ch = app && app.globalData && app.globalData.ch ? app.globalData.ch : '';
  104 +
  105 + wx.getSystemInfo({
  106 + success: function (res) {
  107 + //返回设备信息
  108 + dm = res.model;
  109 + ln = res.language;
  110 + os = res.platform;
  111 + osv = res.system;
  112 + re = res.screenWidth + '*' + res.screenHeight;
  113 + },
  114 + complete: function () {
  115 + wx.getNetworkType({
  116 + success: function (res) {
  117 + var networkType = res.networkType
  118 + if (networkType === 'wifi') {
  119 + net = '1';
  120 + } else if (networkType === '2g') {
  121 + net = '2';
  122 + } else if (networkType === '3g') {
  123 + net = '3';
  124 + } else if (networkType === '4g') {
  125 + net = '4';
  126 + } else {
  127 + net = '0';
  128 + }
  129 + },
  130 + complete: function () {
  131 + let union_type = app.getUnion_type();
  132 +
  133 + let statusParam = {'net': net, 'ln': ln};
  134 + let deviceParam = {
  135 + 'res': re,
  136 + 'osv': osv,
  137 + 'os': os,
  138 + 'ak': ak,
  139 + 'dm': dm,
  140 + 'udid': udid,
  141 + 'ch': union_type !== '' ? union_type + "" : ch + ""
  142 + };
  143 + let userParam = data;
  144 + userParam.C_ID = cid;
  145 + userParam.UNION_ID = union_id;
  146 + userParam.PV_ID = app.getPvid();
  147 + let eventParam = [{'param': userParam, 'ts': ts, 'op': eventId, 'uid': uid, 'sid': sid}]
  148 + let parameters = {'status': statusParam, 'device': deviceParam, 'events': eventParam}
  149 +
  150 + UPLOAD_LOG(LOG_EVENT_HOST, parameters)
  151 + .then(function (data) {
  152 + })
  153 + .catch(function (error) {
  154 +
  155 + });
  156 + }
  157 + })
  158 + }
  159 + })
  160 +};
  161 +
  162 +export {
  163 + yasReport,
  164 + YB_ENTER_FOREGROUND,
  165 + YB_ENTER_BACKGROUND,
  166 + YB_LAUNCH_APP,
  167 + YB_PAGE_OPEN_L,
  168 + YB_MAIN_TAB_C,
  169 + YB_MY_LOGIN,
  170 + YB_REGISTER_SUCCESS,
  171 + YB_AWAKE_MP,
  172 + YB_LUCK_DT_GDS_C,
  173 + YB_LUCK_DT_JOIN_C
  174 +};
1 // pages/login-page/login-page.js 1 // pages/login-page/login-page.js
2 import regeneratorRuntime from '../libs/regenerator-runtime/index.js'; 2 import regeneratorRuntime from '../libs/regenerator-runtime/index.js';
3 import { getSettingPromise } from '../utils/index.js' 3 import { getSettingPromise } from '../utils/index.js'
  4 +import {
  5 + yasReport,
  6 + YB_PAGE_OPEN_L
  7 +} from '../../libs/yas';
  8 +
4 const event = global.event; 9 const event = global.event;
5 Page({ 10 Page({
6 11
@@ -20,6 +25,7 @@ Page({ @@ -20,6 +25,7 @@ Page({
20 event.on('wechat-login-callback', this.loginCallback); 25 event.on('wechat-login-callback', this.loginCallback);
21 event.on('wechat-login-change-status', this.loginChangeStatus); 26 event.on('wechat-login-change-status', this.loginChangeStatus);
22 event.on('wechat-login-error', this.loginError); 27 event.on('wechat-login-error', this.loginError);
  28 + yasReport(YB_PAGE_OPEN_L);
23 }, 29 },
24 30
25 async checkUnionId() { 31 async checkUnionId() {
1 -// pages/choosecountry/choosecountry.js  
2 -'use strict';  
3 -import { API_HOST, SERVICE_HOST } from '../../libs/config';  
4 -import { GET, POST } from '../../libs/request'; 1 +import { API_HOST } from '../../libs/config';
  2 +import { GET } from '../../libs/request';
5 import { getVerifyKey, bindAction, decodePhoneNumber, getUnionID, decodeUnionId, openAuthorizeSettings} from '../../utils/login'; 3 import { getVerifyKey, bindAction, decodePhoneNumber, getUnionID, decodeUnionId, openAuthorizeSettings} from '../../utils/login';
6 4
  5 +import {
  6 + yasReport,
  7 + YB_PAGE_OPEN_L
  8 +} from '../../libs/yas';
7 9
8 let CHOOSED_COUNTRY_ID = 'CHOOSED_COUNTRY_ID' 10 let CHOOSED_COUNTRY_ID = 'CHOOSED_COUNTRY_ID'
9 let CHOOSED_COUNTRY_NAME = 'CHOOSED_COUNTRY_NAME' 11 let CHOOSED_COUNTRY_NAME = 'CHOOSED_COUNTRY_NAME'
@@ -58,6 +60,7 @@ Page(extend({},Toast,{ @@ -58,6 +60,7 @@ Page(extend({},Toast,{
58 new app.WeToast(); 60 new app.WeToast();
59 61
60 this.fetchImageCheck_SwitchOn(); 62 this.fetchImageCheck_SwitchOn();
  63 + yasReport(YB_PAGE_OPEN_L);
61 }, 64 },
62 65
63 onShow: function () { 66 onShow: function () {
1 -// pages/choosecountry/choosecountry.js  
2 import { API_HOST, SERVICE_HOST } from '../../libs/config'; 1 import { API_HOST, SERVICE_HOST } from '../../libs/config';
3 import { GET, POST } from '../../libs/request'; 2 import { GET, POST } from '../../libs/request';
4 import { getYHStorageSync } from '../../utils/util'; 3 import { getYHStorageSync } from '../../utils/util';
  4 +import {
  5 + yasReport,
  6 + YB_PAGE_OPEN_L
  7 +} from '../../libs/yas';
5 8
6 let CACH_KEY = 'country_cach'; 9 let CACH_KEY = 'country_cach';
7 let CHOOSED_COUNTRY_ID = 'CHOOSED_COUNTRY_ID' 10 let CHOOSED_COUNTRY_ID = 'CHOOSED_COUNTRY_ID'
@@ -73,6 +76,7 @@ Page({ @@ -73,6 +76,7 @@ Page({
73 */ 76 */
74 onLoad: function (options) { 77 onLoad: function (options) {
75 this.getArea(); 78 this.getArea();
  79 + yasReport(YB_PAGE_OPEN_L);
76 }, 80 },
77 81
78 /** 82 /**
@@ -16,10 +16,6 @@ @@ -16,10 +16,6 @@
16 </block> 16 </block>
17 17
18 <block wx:elif="{{status === 3}}"> 18 <block wx:elif="{{status === 3}}">
19 - <!-- <view class="action-item confirm" bindtap="goMyList">  
20 - 我的抽奖码({{num}})  
21 - </view> -->  
22 -  
23 <view class="action-item ok" bindtap="goShare"> 19 <view class="action-item ok" bindtap="goShare">
24 分享得更多抽奖码,增加中奖率 20 分享得更多抽奖码,增加中奖率
25 </view> 21 </view>
@@ -19,6 +19,10 @@ import router from './router/router' @@ -19,6 +19,10 @@ import router from './router/router'
19 import {wrapperName} from './helper' 19 import {wrapperName} from './helper'
20 import {formatImageUrl} from '../../utils/util' 20 import {formatImageUrl} from '../../utils/util'
21 import {jumpByUrl} from '../../libs/urlRoute'; 21 import {jumpByUrl} from '../../libs/urlRoute';
  22 +import {
  23 + yasReport,
  24 + YB_PAGE_OPEN_L
  25 +} from '../../libs/yas';
22 26
23 const ACTIVITY = { 27 const ACTIVITY = {
24 UNKNOWN: 0, 28 UNKNOWN: 0,
@@ -131,7 +135,8 @@ Page(Object.assign({ @@ -131,7 +135,8 @@ Page(Object.assign({
131 135
132 new app.WeToast(); 136 new app.WeToast();
133 137
134 - this._getDetailBanner() 138 + this._getDetailBanner();
  139 + yasReport(YB_PAGE_OPEN_L);
135 }, 140 },
136 141
137 /** 142 /**
  1 +import {
  2 + yasReport,
  3 + YB_PAGE_OPEN_L
  4 +} from '../../libs/yas';
  5 +
1 Page({ 6 Page({
2 data: { 7 data: {
3 url: '', 8 url: '',
@@ -7,6 +12,7 @@ Page({ @@ -7,6 +12,7 @@ Page({
7 let url = decodeURIComponent(options.url); 12 let url = decodeURIComponent(options.url);
8 let title = decodeURIComponent(options.title); 13 let title = decodeURIComponent(options.title);
9 14
  15 + yasReport(YB_PAGE_OPEN_L);
10 this.setData({ 16 this.setData({
11 url, 17 url,
12 }); 18 });
1 -  
2 -  
3 -  
4 export function wrapperName(name) { 1 export function wrapperName(name) {
5 if (!name) { 2 if (!name) {
6 return '' 3 return ''
1 -  
2 -  
3 import ZeroSellService from './service/zero-sell' 1 import ZeroSellService from './service/zero-sell'
4 import CommonService from './service/common' 2 import CommonService from './service/common'
5 -import { getSettingPromise } from '../../login/utils/index.js'  
6 -import regeneratorRuntime from '../../login/libs/regenerator-runtime/index.js';  
7 -  
8 -const event = global.event;  
9 - 3 +import {getSettingPromise} from '../../login/utils/index'
  4 +import regeneratorRuntime from '../../login/libs/regenerator-runtime/index';
  5 +import {formatImageUrl} from '../../utils/util'
  6 +import {jumpByUrl} from '../../libs/urlRoute';
  7 +import router from './router/router';
10 import { 8 import {
11 decodePhoneNumber, 9 decodePhoneNumber,
12 getUnionID, 10 getUnionID,
13 decodeUnionId, 11 decodeUnionId,
14 - openAuthorizeSettings, 12 + openAuthorizeSettings
15 } from '../../utils/login'; 13 } from '../../utils/login';
16 -  
17 -import {formatImageUrl} from '../../utils/util'  
18 -  
19 import { 14 import {
20 Toast, Actionsheet 15 Toast, Actionsheet
21 } from '../../vendors/zanui/index'; 16 } from '../../vendors/zanui/index';
22 -import router from './router/router';  
23 -import { jumpByUrl } from '../../libs/urlRoute'; 17 +import {
  18 + yasReport,
  19 + YB_PAGE_OPEN_L,
  20 + YB_MAIN_TAB_C
  21 +} from '../../libs/yas';
24 22
25 -let app = getApp() 23 +const event = global.event;
  24 +let app = getApp();
26 25
27 Page(Object.assign({ 26 Page(Object.assign({
28 data: { 27 data: {
@@ -112,7 +111,8 @@ Page(Object.assign({ @@ -112,7 +111,8 @@ Page(Object.assign({
112 console.log('执行了'); 111 console.log('执行了');
113 this._getResouceCode() 112 this._getResouceCode()
114 } 113 }
115 - this._getBottomBanner() 114 + this._getBottomBanner();
  115 + yasReport(YB_PAGE_OPEN_L);
116 }, 116 },
117 117
118 onShow() { 118 onShow() {
@@ -346,6 +346,7 @@ Page(Object.assign({ @@ -346,6 +346,7 @@ Page(Object.assign({
346 tabIndex: detail, 346 tabIndex: detail,
347 [`list[${detail}].page`]: 1 347 [`list[${detail}].page`]: 1
348 }); 348 });
  349 + yasReport(YB_MAIN_TAB_C, {TAB_ID: detail + 1});
349 350
350 if (detail === 3 && !this.data.isLogin) { 351 if (detail === 3 && !this.data.isLogin) {
351 return; 352 return;
1 -// page/subPackage/pages/zeroSell/myList.js  
2 -  
3 -import ZeroSellService from './service/zero-sell'  
4 -import { Actionsheet} from '../../vendors/zanui/index';  
5 -import router from './router/router';  
6 -import {wrapperName} from './helper'  
7 -  
8 -let app = null;  
9 -  
10 -Page(Object.assign({  
11 -  
12 - /**  
13 - * 页面的初始数据  
14 - */  
15 - data: {  
16 - shareProduct: {},  
17 - recommends: [],  
18 - list: [{  
19 - page: 1,  
20 - data: []  
21 - }, {  
22 - page: 1,  
23 - data: []  
24 - }],  
25 - tabIndex: 0,  
26 - footText: '',  
27 -  
28 - actionsheet: {  
29 - componentId: 'shareActionSheet',  
30 - show: false,  
31 - closeOnClickOverlay: true,  
32 - cancelText: '取消',  
33 - isNewShareStyle:true,  
34 - unionUserImageUrl:'http://img12.static.yhbimg.com/sns/2018/08/02/15/029b6acc4f8bc0620ecd7ec2133fcf900c.png',  
35 - actions: [{  
36 - name: '分享给好友',  
37 - className: 'action-class',  
38 - loading: false,  
39 - openType: 'share',  
40 - image_src: '../../images/share_wechat@2x.png',  
41 - },  
42 - {  
43 - name: '生成海报分享',  
44 - className: 'action-class',  
45 - loading: false,  
46 - image_src: '../../images/share_wxpeng@2x.png'  
47 - }]  
48 - },  
49 - },  
50 -  
51 - /**  
52 - * 生命周期函数--监听页面加载  
53 - */  
54 - onLoad: function (options) {  
55 - this.service = new ZeroSellService()  
56 - app = getApp();  
57 - },  
58 -  
59 - /**  
60 - * 生命周期函数--监听页面初次渲染完成  
61 - */  
62 - onReady: function () {  
63 -  
64 - },  
65 -  
66 - /**  
67 - * 生命周期函数--监听页面显示  
68 - */  
69 - onShow: function () {  
70 - this.setData({  
71 - [`list[${this.data.tabIndex}].page`]: 1  
72 - });  
73 -  
74 - this._init();  
75 - this._getRecommend();  
76 - },  
77 -  
78 - /**  
79 - * 生命周期函数--监听页面隐藏  
80 - */  
81 - onHide: function () {  
82 -  
83 - },  
84 -  
85 - /**  
86 - * 生命周期函数--监听页面卸载  
87 - */  
88 - onUnload: function () {  
89 -  
90 - },  
91 -  
92 - /**  
93 - * 页面相关事件处理函数--监听用户下拉动作  
94 - */  
95 - onPullDownRefresh: function () {  
96 - let key = `list[${this.data.tabIndex}].page`;  
97 -  
98 - this.setData({  
99 - [key]: 1  
100 - });  
101 -  
102 - this._init().then(() => {  
103 - wx.stopPullDownRefresh();  
104 - });  
105 - },  
106 -  
107 - /**  
108 - * 页面上拉触底事件的处理函数  
109 - */  
110 - onReachBottom: function () {  
111 - let type = this.data.tabIndex;  
112 - let list = this.data.list;  
113 - let page = list[type].page;  
114 - let oldData = list[type].data;  
115 - let key = `list[${type}].data`;  
116 - let keyPage = `list[${type}].page`;  
117 -  
118 - return this._getPage(type, page).then(data => {  
119 - this.setData({  
120 - [key]: oldData.concat(data),  
121 - [keyPage]: ++page  
122 - });  
123 - });  
124 - },  
125 -  
126 - onTabChange({detail}) {  
127 - this.setData({  
128 - tabIndex: detail,  
129 - [`list[${detail}].page`]: 1  
130 - });  
131 -  
132 - this._init();  
133 - },  
134 -  
135 - _init(){  
136 - let type = this.data.tabIndex;  
137 - let list = this.data.list;  
138 - let page = list[type].page  
139 - let key = `list[${type}].data`  
140 - let keyPage = `list[${type}].page`  
141 -  
142 - return this._getPage(type, page).then(data => {  
143 - this.setData({  
144 - [key]: data,  
145 - [keyPage]: ++page  
146 - });  
147 - });  
148 - },  
149 -  
150 - _getPage(type, page) {  
151 - this.setData({  
152 - footText: '内容加载中...'  
153 - });  
154 - return this.service.getMyList({type, page}).then(result => {  
155 -  
156 - if(result.code !== 200 || result.data.length === 0) {  
157 - if(type == 0) {  
158 - this.setData({  
159 - footText: '您还没有参与的抽奖,赶紧去参加吧'  
160 - });  
161 - } else {  
162 - this.setData({  
163 - footText: '暂无已公布活动,请继续参加活动'  
164 - });  
165 - }  
166 - } else {  
167 - this.setData({  
168 - footText: ''  
169 - });  
170 - }  
171 -  
172 -  
173 - if (result.code !== 200) {  
174 - return [];  
175 - }  
176 -  
177 - return result.data;  
178 - });  
179 - },  
180 -  
181 - _getRecommend() {  
182 - this.service.getRecommend({  
183 - actPrizeId: 0  
184 - })  
185 - .then(response => {  
186 - if (response && response.code === 200 && response.data){  
187 - this.setData({  
188 - recommends: response.data,  
189 - })  
190 - }  
191 - })  
192 - .catch(error => {  
193 - console.log(error)  
194 - })  
195 - },  
196 -  
197 - share({detail}){  
198 - this.setData({  
199 - 'actionsheet.show': true,  
200 - 'shareProduct': detail  
201 - })  
202 - },  
203 -  
204 - handleZanActionsheetCancel({ componentId }) {  
205 - this.setData({  
206 - 'actionsheet.show': false  
207 - })  
208 - },  
209 -  
210 - handleZanActionsheetClick({ componentId, index }) {  
211 - this.setData({  
212 - 'actionsheet.show': false  
213 - });  
214 -  
215 - let qrcode = this.service.getQrCode({  
216 - shareUid: app.getUid(),  
217 - actPrizeId: this.data.shareProduct.act_prize_id  
218 - });  
219 -  
220 - if (index === 1) {  
221 - if (this.data.shareProduct.name) {  
222 - router.go('snapShare', {  
223 - product_name: this.data.shareProduct.name,  
224 - default_image: this.data.shareProduct.cover_img,  
225 - product_price: this.data.shareProduct.price,  
226 - product_qrCode: qrcode  
227 - });  
228 - }  
229 - };  
230 - },  
231 - onShareAppMessage(res) {  
232 - let params = {  
233 - TITLE: `【0元抽奖】点一下,免费拿走${this.data.shareProduct.name}`,  
234 - DESC: '我在YO!LUCK发现一个不错的商品赶快来看看吧!'  
235 - };  
236 -  
237 - if (res.from === 'menu') {  
238 - // 用户点击右上角分享  
239 - return {  
240 - title: params.TITLE, // 分享标题  
241 - desc: params.DESC, // 分享描述  
242 - path: `pages/zeroSell/detail?actPrizeId=${this.data.shareProduct.act_prize_id}`,  
243 - imageUrl: this.data.shareProduct.cover_img,  
244 - success: function() {  
245 - },  
246 - fail: function() {  
247 - }  
248 - };  
249 - } else if (res.from === 'button') {  
250 - // 用户点击分享按钮  
251 -  
252 - return {  
253 - title: params.TITLE, // 分享标题  
254 - desc: params.DESC, // 分享描述  
255 - path: `/pages/zeroSell/detail?actPrizeId=${this.data.shareProduct.act_prize_id}&shareUid=${app.getUid()}`,  
256 - imageUrl: this.data.shareProduct.cover_img,  
257 - success: function() {  
258 - },  
259 - fail: function() {  
260 - }  
261 - };  
262 - }  
263 - }  
264 -}, Actionsheet))  
1 -{  
2 - "navigationBarTitleText": "YO!LUCK",  
3 - "enablePullDownRefresh": true,  
4 - "backgroundColor": "#ebebeb",  
5 - "backgroundTextStyle": "light",  
6 - "usingComponents": {  
7 - "tabs": "./components/tabs",  
8 - "tabs-pane": "./components/tabs-pane",  
9 - "prize-item": "./components/prize-item",  
10 - "fellow-bar": "./components/fellow-bar",  
11 - "quickNavigation": "/pages/quickNavigation/quickNavigation",  
12 - "more": "./components/more",  
13 - "product-item": "./components/product-item",  
14 - "product-header": "./components/product-detail-header"  
15 - }  
16 -}  
1 -<!--page/subPackage/pages/zeroSell/myList.wxml-->  
2 -<import src="../../vendors/zanui/actionsheet/index.wxml" />  
3 -  
4 -<tabs current-key="{{tabIndex}}" bindchange="onTabChange">  
5 - <view class="fellow-bar">  
6 - <fellow-bar></fellow-bar>  
7 - </view>  
8 -  
9 - <view class="list-head-blank"></view>  
10 -  
11 - <tabs-pane name="进行中">  
12 - <block wx:for="{{list[0].data}}" wx:key="{{index}}">  
13 - <prize-item item="{{item}}" bindshare="share"></prize-item>  
14 - </block>  
15 - </tabs-pane>  
16 -  
17 - <tabs-pane name="已公布">  
18 - <block wx:for="{{list[1].data}}" wx:key="{{index}}">  
19 - <prize-item item="{{item}}"></prize-item>  
20 - </block>  
21 - </tabs-pane>  
22 -  
23 - <view class="list-foot-blank" wx:if="{{footText && footText.length > 0}}">{{footText}}</view>  
24 -</tabs>  
25 -<view style="height: 20rpx;background-color:#F0F0F0"></view>  
26 -<more wx:if="{{recommends.length > 0}}">  
27 - <block wx:for="{{recommends}}" wx:key="{{index}}">  
28 - <view class="product-item" >  
29 - <product-item product="{{item}}"></product-item>  
30 - </view>  
31 - </block>  
32 -</more>  
33 -  
34 -<template is="zan-actionsheet" data="{{...actionsheet}}" />  
1 -/* page/subPackage/pages/zeroSell/myList.wxss */  
2 -  
3 -@import '../../vendors/zanui/actionsheet/index.wxss';  
4 -  
5 -.list-foot-blank  
6 -{  
7 - width: 100%;  
8 - height: 88rpx;  
9 - text-align: center;  
10 - line-height: 88rpx;  
11 - font-size: 30rpx;  
12 - color: #ccc;  
13 -}  
14 -  
15 -.list-head-blank {  
16 - width: 100%;  
17 - height: 156rpx;  
18 -}  
19 -  
20 -.fellow-bar {  
21 - position: fixed;  
22 - top: 90rpx;  
23 - left: 0;  
24 - width: 100%;  
25 - z-index: 2;  
26 -}  
@@ -11,8 +11,10 @@ const scale = windowWidth / 375; @@ -11,8 +11,10 @@ const scale = windowWidth / 375;
11 screenHeight = windowWidth / (canvasWidth / canvasHeight); 11 screenHeight = windowWidth / (canvasWidth / canvasHeight);
12 12
13 import {wrapperName} from './helper' 13 import {wrapperName} from './helper'
14 -// const scale = 0.5;  
15 - 14 +import {
  15 + yasReport,
  16 + YB_PAGE_OPEN_L
  17 +} from '../../libs/yas';
16 18
17 var Point = function(x, y) { 19 var Point = function(x, y) {
18 return { 20 return {
@@ -56,6 +58,7 @@ Page({ @@ -56,6 +58,7 @@ Page({
56 58
57 this.creatSnapshoot(); 59 this.creatSnapshoot();
58 this.getAuth(); 60 this.getAuth();
  61 + yasReport(YB_PAGE_OPEN_L);
59 }, 62 },
60 63
61 creatSnapshoot() { 64 creatSnapshoot() {
1 export default { 1 export default {
2 ['pages/zeroSell/index']: { 2 ['pages/zeroSell/index']: {
3 - pageName: 'index' 3 + pathName: 'index'
4 }, 4 },
5 ['pages/zeroSell/detail']: { 5 ['pages/zeroSell/detail']: {
6 - pageName: 'detail'  
7 - },  
8 - ['pages/zeroSell/myList']: {  
9 - pageName: 'myList' 6 + pathName: 'detail',
  7 + paramKey: 'actPrizeId'
10 }, 8 },
11 ['pages/zeroSell/snapshootShare']: { 9 ['pages/zeroSell/snapshootShare']: {
12 - pageName: 'snapshootShare' 10 + pathName: 'snapshootShare',
  11 + paramKey: 'product_qrCode'
13 }, 12 },
14 ['pages/zeroSell/h5Page']: { 13 ['pages/zeroSell/h5Page']: {
15 - pageName: 'H5Page' 14 + pathName: 'H5Page',
  15 + paramKey: 'url'
16 }, 16 },
17 ['pages/bindPhoneNumber/bindPhoneNumber']: { 17 ['pages/bindPhoneNumber/bindPhoneNumber']: {
18 - pageName: 'bindPhoneNumber' 18 + pathName: 'bindPhoneNumber'
19 }, 19 },
20 ['pages/choosecountry/choosecountry']: { 20 ['pages/choosecountry/choosecountry']: {
21 - pageName: 'choosecountry' 21 + pathName: 'choosecountry'
22 }, 22 },
23 ['login/login-page/login-page']: { 23 ['login/login-page/login-page']: {
24 - pageName: 'loginPage' 24 + pathName: 'loginPage'
25 } 25 }
26 } 26 }
@@ -3,11 +3,11 @@ import {GET, POST} from '../libs/request'; @@ -3,11 +3,11 @@ import {GET, POST} from '../libs/request';
3 import {API_HOST, SERVICE_HOST} from '../libs/config'; 3 import {API_HOST, SERVICE_HOST} from '../libs/config';
4 import {Encrypt} from '../libs/aes' 4 import {Encrypt} from '../libs/aes'
5 import {isStringEmpty} from './util' 5 import {isStringEmpty} from './util'
6 -import { logEvent, 6 +import { yasReport,
7 YB_MY_LOGIN, 7 YB_MY_LOGIN,
8 YB_PAGE_OPEN_L, 8 YB_PAGE_OPEN_L,
9 YB_REGISTER_SUCCESS, 9 YB_REGISTER_SUCCESS,
10 - } from '../libs/analytics.js' 10 + } from '../libs/yas.js'
11 11
12 //获取应用实例 12 //获取应用实例
13 var app = getApp() 13 var app = getApp()
@@ -54,7 +54,7 @@ function wechatLoginAction(callbackFunc) { @@ -54,7 +54,7 @@ function wechatLoginAction(callbackFunc) {
54 //如果unionID不存在(未使用过任何有货微信产品的全新用户),调用getUnionID函数,再次获取unionID 54 //如果unionID不存在(未使用过任何有货微信产品的全新用户),调用getUnionID函数,再次获取unionID
55 //对于已经授权过的用户,拿到unionid之后获取一次userinfo更新个人信息. 55 //对于已经授权过的用户,拿到unionid之后获取一次userinfo更新个人信息.
56 let params = { LOGIN_TYPE: 4, PV_ID: PV_ID, }; 56 let params = { LOGIN_TYPE: 4, PV_ID: PV_ID, };
57 - logEvent(YB_MY_LOGIN, params); 57 + yasReport(YB_MY_LOGIN, params);
58 58
59 //当unionId为空或者头像为空时,调用微信接口获取用户信息 59 //当unionId为空或者头像为空时,调用微信接口获取用户信息
60 if (!isStringEmpty(responseData.unionid)) { 60 if (!isStringEmpty(responseData.unionid)) {
@@ -361,7 +361,7 @@ function checkVerifyCode(phoneNumb, verifyCode, areaCode, inviteCode, callbackFu @@ -361,7 +361,7 @@ function checkVerifyCode(phoneNumb, verifyCode, areaCode, inviteCode, callbackFu
361 let logParams = { 361 let logParams = {
362 YB_REGISTER_SUCCESS: 5, 362 YB_REGISTER_SUCCESS: 5,
363 }; 363 };
364 - logEvent(YB_REGISTER_SUCCESS, logParams); 364 + yasReport(YB_REGISTER_SUCCESS, logParams);
365 callbackFunc({ 365 callbackFunc({
366 succeed: true, 366 succeed: true,
367 message: "登录成功", 367 message: "登录成功",
@@ -462,7 +462,7 @@ function autoSignin(mobile, verifyCode, areaCode, inviteCode, callbackFunc) { @@ -462,7 +462,7 @@ function autoSignin(mobile, verifyCode, areaCode, inviteCode, callbackFunc) {
462 let logParams = { 462 let logParams = {
463 YB_REGISTER_SUCCESS: 5, 463 YB_REGISTER_SUCCESS: 5,
464 }; 464 };
465 - logEvent(YB_REGISTER_SUCCESS, logParams); 465 + yasReport(YB_REGISTER_SUCCESS, logParams);
466 } 466 }
467 callbackFunc({ 467 callbackFunc({
468 succeed: true, 468 succeed: true,
@@ -558,7 +558,7 @@ function BindMiniAppByAuto(mobile, countryCode, inviteCode, callbackFunc){ @@ -558,7 +558,7 @@ function BindMiniAppByAuto(mobile, countryCode, inviteCode, callbackFunc){
558 let logParams = { 558 let logParams = {
559 YB_REGISTER_SUCCESS: 5, 559 YB_REGISTER_SUCCESS: 5,
560 }; 560 };
561 - logEvent(YB_REGISTER_SUCCESS, logParams); 561 + yasReport(YB_REGISTER_SUCCESS, logParams);
562 callbackFunc({ 562 callbackFunc({
563 succeed: true, 563 succeed: true,
564 message: "登录成功", 564 message: "登录成功",