1
|
import 'activity/coupon-list.page.css';
|
1
|
import 'activity/coupon-list.page.css';
|
2
|
import $ from 'yoho-jquery';
|
2
|
import $ from 'yoho-jquery';
|
3
|
import Page from 'yoho-page';
|
3
|
import Page from 'yoho-page';
|
|
|
4
|
+import share from 'common/share';
|
|
|
5
|
+import yoho from 'yoho-app';
|
4
|
|
6
|
|
5
|
class CouponList extends Page {
|
7
|
class CouponList extends Page {
|
6
|
constructor() {
|
8
|
constructor() {
|
|
@@ -18,8 +20,28 @@ class CouponList extends Page { |
|
@@ -18,8 +20,28 @@ class CouponList extends Page { |
18
|
|
20
|
|
19
|
init() {
|
21
|
init() {
|
20
|
this.bindEvents();
|
22
|
this.bindEvents();
|
|
|
23
|
+ this.setShare();
|
21
|
}
|
24
|
}
|
22
|
|
25
|
|
|
|
26
|
+ setShare() {
|
|
|
27
|
+ let shareInfo = {
|
|
|
28
|
+ title: '假装这是一个很酷的主标题',
|
|
|
29
|
+ link: location.href,
|
|
|
30
|
+ desc: '假装这是一个很酷的副标题',
|
|
|
31
|
+ imgUrl: 'http://img11.static.yhbimg.com/taobaocms/2017/01/17/16/0108d724a0ef1f001d3ee6010aa79d960e.png'
|
|
|
32
|
+ };
|
|
|
33
|
+
|
|
|
34
|
+ if (yoho.isApp) {
|
|
|
35
|
+ yoho.ready(function() {
|
|
|
36
|
+ yoho.invokeMethod('get.pageType', {
|
|
|
37
|
+ pageType: 'questionnaire'
|
|
|
38
|
+ });
|
|
|
39
|
+ yoho.invokeMethod('set.shareInfo', shareInfo);
|
|
|
40
|
+ });
|
|
|
41
|
+ } else {
|
|
|
42
|
+ share(shareInfo);
|
|
|
43
|
+ }
|
|
|
44
|
+ }
|
23
|
|
45
|
|
24
|
bindEvents() {
|
46
|
bindEvents() {
|
25
|
this.selector.$receiveTarget.on('click', this.receive.bind(this));
|
47
|
this.selector.$receiveTarget.on('click', this.receive.bind(this));
|