...
|
...
|
@@ -6,6 +6,7 @@ import dialog from 'js/plugin/dialog'; |
|
|
import fillInHbs from 'hbs/activity/have-gain/fill-in.hbs';
|
|
|
import yoho from 'js/yoho-app';
|
|
|
import parse from 'yoho-qs/parse';
|
|
|
import Clipboard from 'clipboard';
|
|
|
|
|
|
class HaveGainApplyPage extends Page {
|
|
|
constructor() {
|
...
|
...
|
@@ -26,6 +27,43 @@ class HaveGainApplyPage extends Page { |
|
|
}
|
|
|
|
|
|
init() {
|
|
|
let ua = navigator.userAgent.toLowerCase();
|
|
|
let isWeixin = ua.indexOf('micromessenger') !== -1;
|
|
|
let clipboard = new Clipboard('.added', {
|
|
|
text: function() {
|
|
|
return '有货有赚';
|
|
|
}
|
|
|
});
|
|
|
|
|
|
new Clipboard('.apply-btn', {
|
|
|
text: function() {
|
|
|
return '有货有赚';
|
|
|
}
|
|
|
});
|
|
|
|
|
|
clipboard.on('success', function(e) {
|
|
|
let hasFooter = {
|
|
|
leftBtnText: '取消',
|
|
|
rightBtnText: '去添加'
|
|
|
};
|
|
|
|
|
|
if (isWeixin) {
|
|
|
hasFooter = {
|
|
|
centerBtnText: '确认'
|
|
|
};
|
|
|
}
|
|
|
|
|
|
dialog.showDialog({
|
|
|
dialogText: '“有货有赚”服务号已经复制,请去微信搜索添加',
|
|
|
hasClass: 'dialog-text-apply',
|
|
|
hasFooter: hasFooter
|
|
|
}, function() {
|
|
|
window.location.href = 'weixin://';
|
|
|
});
|
|
|
|
|
|
e.clearSelection();
|
|
|
});
|
|
|
|
|
|
this.bindEvents();
|
|
|
}
|
|
|
|
...
|
...
|
@@ -146,28 +184,6 @@ class HaveGainApplyPage extends Page { |
|
|
});
|
|
|
}
|
|
|
|
|
|
tapAdded() {
|
|
|
let that = this;
|
|
|
|
|
|
if (window.yohoInterface) {
|
|
|
yoho.invokeMethod('go.copy', {text: '有货有赚'});
|
|
|
}
|
|
|
dialog.showDialog({
|
|
|
dialogText: '“有货有赚”服务号已经复制,请去微信搜索添加',
|
|
|
hasClass: 'dialog-text-apply',
|
|
|
hasFooter: {
|
|
|
leftBtnText: '取消',
|
|
|
rightBtnText: '去添加'
|
|
|
}
|
|
|
}, function() {
|
|
|
that.awakeWeixin();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
awakeWeixin() {
|
|
|
window.location.href = 'weixin://';
|
|
|
}
|
|
|
|
|
|
tapAgreement(event) {
|
|
|
let $event = $(event.target);
|
|
|
|
...
|
...
|
@@ -232,10 +248,6 @@ class HaveGainApplyPage extends Page { |
|
|
return tip.show(res.message || '请稍后再试');
|
|
|
}
|
|
|
|
|
|
if (window.yohoInterface) {
|
|
|
yoho.invokeMethod('go.copy', {text: '有货有赚'});
|
|
|
}
|
|
|
|
|
|
dialog.showDialog({
|
|
|
hasHeader: '申请成功',
|
|
|
hasClass: 'dialog-text-apply',
|
...
|
...
|
|