网友无奇龙分享:
复制代码到F12执行
- var pro = null;
- KISSY.DOM.removeClass(‘.tb-btn-buy’, ‘tb-hidden’);
- if (KISSY.DOM.get(‘#J_ButtonWaitWrap’)) {
- KISSY.use(‘detail-model/product’,
- function (s, c) {
- cc = c.instance();
- cc.onChange([‘trade’, ‘itemPrice’, ‘itemDO’],
- function (i1, n, o) {
- if (i1.sellCountDown) {
- i1.sellCountDown = 5;
- i1.tradeEnable = true;
- cc.set(‘canBuyStatus’, 1);
- }
- });
- setInterval(function () {
- KISSY.DOM.removeClass(‘.tb-btn-buy’, ‘tb-hidden’);
- },
- 1000);
- KISSY.DOM.show(‘.tb-action’);
- KISSY.DOM.show(‘.tb-btn-basket’);
- var i = KISSY.DOM.get(‘.tb-btn-buy’);
- KISSY.Event.remove(‘.tb-btn-buy’, ‘click’);
- KISSY.Event.on(i, ‘click’,
- function (e) {
- var btn = {
- ‘type’: 1,
- ‘button’: i
- };
- cc._buyForm(btn, i);
- });
- });
- }
- KISSY.use(‘detail-model/product,malldetail/main/productDetail’,
- function (e, t, a) {
- pro = t.instance();
- pro.onChange([‘selectedSkuProp’],
- function (sesku) {
- pro.onLoad([‘currentPromotionList’, ‘itemPrice’],
- function (PromotionList, litemPrice) { });
- });
- if (pro.get(‘trade.sellCountDown’)) {
- var oldstartTime = new Date(pro.get(‘trade.startTime’));
- oldstartTime = oldstartTime.toLocaleDateString() + ‘ ‘ + oldstartTime.toLocaleTimeString();
- var ac = e.DOM.children(‘.tb-detail-hd’)[0];
- if (e.DOM.text(ac).indexOf(oldstartTime) < 0) e.DOM.text(ac, e.DOM.text(ac) + oldstartTime + ‘开始抢购’);
- if (pro.get(‘trade.sellCountDown’)) pro.set(‘trade.sellCountDown’, 0);
- window.external.setstartime(pro.get(‘trade.startTime’));
- } else e.DOM.show(‘.tb-action’);
- });
- var taojhs = KISSY.DOM.get(‘#J_juValid’);
- if (taojhs) {
- taojhs.innerHTML = "<div class= ‘tb-btn-buy’ > <a title=’点击此按钮,到下一步确认购买信息’ class=’J_LinkBuy’ href=’javascript:;’ shortcut-effect=’click’ shortcut-label=’立即购买’ shortcut-key=’b’ data-spm-click=’gostr=/tbdetail;locaid=d1′ data-addfastbuy=’true’ data-spm-anchor-id=’2013.1.20140002.d1′> 立即购买 </a></div > <div class=’tb-btn-add’> <a title=’加入购物车’ class=’J_LinkAdd’ href=’javascript:;’ shortcut-effect=’click’ shortcut-label=’加入购物车’ shortcut-key=’a’ data-spm-click=’gostr=/tbdetail;locaid=d2′ data-spm-anchor-id=’2013.1.20140002.d2′> <i class=’tb-iconfont’></i>加入购物车 </a></div>";
- }
复制代码