|
楼主 |
发表于 2014-4-24 18:38:27
|
显示全部楼层
本帖最后由 phickers 于 2014-4-26 09:59 编辑
kiahs 发表于 2014-4-24 17:34
不知道呢、。
现在取得了较大进展,跟踪到了以下JS代码:- BA.twoBarCode.getPhoto = function(size) {
- var checked = '',
- param = '',
- id = window.pageMess && window.pageMess.commodityId || '';
- size = parseInt(size) || 82;
- this.updateCommAttr(null, null);
- if (!$('#stockString').val()) {
- checked = 1;
- } else {
- checked = $('#commodityattr').val() ? '1': '0';
- }
- param = $.param({
- checked: checked,
- commlist: this.dom.commAttr.val() || ''
- });
- return 'http://bases.paipai.com/pay/qrcode?scene=item&id=' + id + '&size=' + size + '¶m=' + escape(param);
- };
- BA.twoBarCode.showDiscount = function(curPrice) {
- curPrice = String(curPrice || '').replace(/[^\d.\-]+/g, '');
- var _dom = this.dom,
- discount = this.discount / 10,
- priceArea = curPrice.split('-'),
- price = parseFloat(priceArea[0]) || 0.01,
- priceHigh = parseFloat(priceArea[1]) || 0,
- html = '方便快捷',
- amount = 0,
- haveDiscount = 0;
- if (1 == discount || _dom.discount.size() == 0) {
- console.log('不计算价格:', discount, _dom.discount.size());
- return;
- }
- haveDiscount = $arithmetic().subtract(1, discount);
- if (0 == priceHigh) {
- amount = $arithmetic().multiply(price, haveDiscount);
- amount = Math.floor(amount * 100) / 100;
- if (amount > 0) {
- html = '立即再减<i>' + amount + '元</i>';
- }
- } else {
- amount = $arithmetic().multiply(priceHigh, haveDiscount);
- amount = Math.floor(amount * 100) / 100;
- if (amount > 0) {
- html = '最多再减<i>' + amount + '元</i>';
- }
- }
- _dom.discount.html(',' + html);
- _dom.discountActive.html(',' + html).find('i').css({
- backgroundColor: '#D70000',
- color: '#fff',
- padding: '0 3px'
- });
- };
- })();
- if (!PP.c2ccommodity.buyareaV5.isInit) {
- PP.c2ccommodity.buyareaV5.init();
- }
复制代码 请帮忙分析一下! |
|