Authored by 李靖

增加分享

... ... @@ -16,12 +16,12 @@
{{# coupons}}
<div class="list-item">
<div class="amount" data-couponid="{{couponId}}">{{couponAmount}}</div>
<div class="shop">
<div class="logo"></div>
<a href="//m.yohobuy.com/product/shop?shop_id={{shopsId}}">
<a href="//m.yohobuy.com/product/shop?shop_id={{shopsId}}">
<div class="shop">
<div class="logo"></div>
<div class="go">进入店铺</div>
</a>
</div>
</div>
</a>
</div>
{{/ coupons}}
</div>
... ...
import 'activity/coupon-list.page.css';
import $ from 'yoho-jquery';
import Page from 'yoho-page';
import share from 'common/share';
import yoho from 'yoho-app';
class CouponList extends Page {
constructor() {
... ... @@ -18,8 +20,28 @@ class CouponList extends Page {
init() {
this.bindEvents();
this.setShare();
}
setShare() {
let shareInfo = {
title: '假装这是一个很酷的主标题',
link: location.href,
desc: '假装这是一个很酷的副标题',
imgUrl: 'http://img11.static.yhbimg.com/taobaocms/2017/01/17/16/0108d724a0ef1f001d3ee6010aa79d960e.png'
};
if (yoho.isApp) {
yoho.ready(function() {
yoho.invokeMethod('get.pageType', {
pageType: 'questionnaire'
});
yoho.invokeMethod('set.shareInfo', shareInfo);
});
} else {
share(shareInfo);
}
}
bindEvents() {
this.selector.$receiveTarget.on('click', this.receive.bind(this));
... ...