index.js
1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import resource from '../../common/resource';
import Yas from '../../common/yas';
import config from '../../common/config';
import { stringify } from '../../vendors/query-stringify';
let app = getApp();
let yas;
Page({
data: {
resource
},
onLoad: function() {
yas = new Yas(app);
yas.pageOpenReport();
},
onShareAppMessage: function(res) {
let pages = getCurrentPages();
let path = pages[pages.length - 1].route || '/pages/index/index';
let pageParams = stringify(pages[pages.length - 1].options) || '';
let params = {
FROM: res.from,
SHARE_RESULT: 1,
TITLE: '美国东西海岸流行趋势、欧洲新锐设计师品牌,日韩最新潮品,尽在YOHO!STORE一手掌握!',
DESC: '',
PATH: path,
PAGE_PARAM: pageParams
};
return {
title: params.TITLE, // 分享标题
desc: params.DESC, // 分享描述
success: function() {
yas.report('YB_SHARE_RESULT_L', params); // 首页分享上报
},
fail: function() {
params.SHARE_RESULT = 2;
yas.report('YB_SHARE_RESULT_L', params); // 首页分享上报
}
};
},
toSearch: function() {
global.router.goUrl(`${config.MINI_APP_DOMAIN}/pages/brand/search`);
}
});