Authored by 陈轩

save

... ... @@ -9,7 +9,7 @@
<li class="chit chit30"></li>
<li class="chit chit60"></li>
</ul>
<button class="qiangjuan-foucs">立刻关注抢优惠券</button>
<button class="qiangjuan-foucs" data-toggle="ymodal" data-target="#chit-qcode">立刻关注抢优惠券</button>
</section>
{{! section: 玩转有货币 }}
... ... @@ -104,4 +104,13 @@
{{! footer }}
<footer class="vip-day-footer">
<a href="javascript:;" class="app-download"></a>
</footer>
\ No newline at end of file
</footer>
{{! 立刻关注抢优惠券 弹出二维码}}
<div class="ymodal" id="chit-qcode">
<div class="ymodal-dialog">
<div class="ymodal-content">
大厦法定分
</div>
</div>
</div>
... ...
/* eslint */
/**
* @author xuan.chen@yoho.cn
*/
'use strict';
require('plugin/modal');
var page = {
};
$(function() {
page.init();
});
... ...
/**
* Modal 组件: 仿BOOTSTRAP:MODAL
* @author xuan.chen@yoho.cn
*/
'use strict';
/* config */
var NAME = 'YModal';
var DATA_KEY = 'yoho.modal';
var Event = {
CLICK_DATA_API: 'click.yoho.modal.data-api'
};
var Selector = {
DATA_TOGGLE: '[data-toggle="ymodal"]'
};
var Modal = function(elem, config) {
};
/* ------------------------static attribute ------------------*/
Modal.DEFAULT = {};
/* ------------------------public method ------------------*/
Modal.prototype.show = function() {
};
Modal.prototype.hide = function() {
};
Modal.prototype.toggle = function() {
};
/* ------------------------private method ------------------*/
/* ------------------------static method ------------------*/
Modal._jqueryBridge = function(config, relatedTarget) {
return this.each(function() {
var data = this.data(DATA_KEY);
var configs = $.extend(
{},
Modal.DEFAULT,
toString.call(config) === '[object Object]' && config
);
if (!data) {
this.data(DATA_KEY, data = new Modal(this, configs));
}
if (typeof config === 'string') {
data[config](relatedTarget);
} else if (config.show) {
data.show(relatedTarget);
}
});
};
/* ----------------------- DATA-API ----------------------*/
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function(event) {
var selector = this.getAttribute('data-target');
var $target = $(selector);
if ($target[0].tagName.toUpperCase() === 'A') {
event.preventDefault();
}
Modal._jqueryBridge($target, {}, this);
});
$.fn[NAME] = Modal._jqueryBridge;
$.fn[NAME].constructor = Modal;
module.exports = Modal;
... ...
... ... @@ -42,7 +42,7 @@ module.exports = {
resolve: {
alias: {
common: path.join(__dirname, 'js/common'),
plugin: path.join(__dirname, 'js/plugins')
plugin: path.join(__dirname, 'js/plugin')
}
},
plugins: [
... ...