QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2262|回复: 2

积分交易页面有js bug

[复制链接]
发表于 2011-7-13 17:41:01 | 显示全部楼层 |阅读模式
在积分交易页面,firefox5与ie6下测试,均存在select框无值的bug
如下函数:

  1. function calcredit() {
  2.                 with($('creditsform')) {
  3.                         fromcredit = fromcredits[fromcredits.selectedIndex];
  4.                         tocredit = tocredits[tocredits.selectedIndex];
  5.                         var ratio;
  6.                         if(tocredit.value.indexOf('|') == -1) {
  7.                                 ratio = Math.round(((fromcredit.getAttribute('ratio') / tocredit.getAttribute('ratio')) * 100)) / 100;
  8.                         } else if(outexchangeallow[tocredit.value + '|' + fromcredit.value]) {
  9.                                 ratio = Math.round(((fromcredit.getAttribute('outratio') / tocredit.getAttribute('ratio_' + fromcredit.value)) * 100)) / 100;
  10.                         } else {
  11.                                 ratio = 0;
  12.                         }
  13.                         $('orgcreditunit').innerHTML = fromcredit.getAttribute('unit');
  14.                         $('orgcredittitle').innerHTML = fromcredit.getAttribute('title');
  15.                         $('descreditunit').innerHTML = tocredit.getAttribute('unit');
  16.                         $('descredittitle').innerHTML = tocredit.getAttribute('title');
  17.                         $('descreditamount').innerHTML = ratio;
  18.                         $('amount').value = $('amount').value.toInt();
  19.                         $('creditssubmit').disabled = false;
  20.                         if(fromcredit.getAttribute('title') != tocredit.getAttribute('title') && $('amount').value != 0) {
  21.                                 if(tocredit.value.indexOf('|') == -1) {
  22.                                         $('desamount').value = Math.floor(fromcredit.getAttribute('ratio') / tocredit.getAttribute('ratio') * $('amount').value * (1 - 0.2));
  23.                                         if($('desamount').value == 0) {
  24.                                                 $('desamount').value = '禁止兑换';
  25.                                                 $('creditssubmit').disabled = true;
  26.                                         }
  27.                                 } else {
  28.                                         if(outexchangeallow[tocredit.value + '|' + fromcredit.value]) {
  29.                                                 $('desamount').value = Math.floor(fromcredit.getAttribute('outratio') / tocredit.getAttribute('ratio_' + fromcredit.value) * $('amount').value);
  30.                                         } else {
  31.                                                 $('desamount').value = '禁止兑换';
  32.                                                 $('creditssubmit').disabled = true;
  33.                                         }
  34.                                 }
  35.                         } else {
  36.                                 $('desamount').value = $('amount').value;
  37.                         }
  38.                 }
  39.         }
复制代码
其中 fromcredits 这个下拉框,因为没有值,所以会报错误
 楼主| 发表于 2011-7-13 18:00:59 | 显示全部楼层
国际惯例,沙发
回复

使用道具 举报

发表于 2011-11-3 09:48:07 | 显示全部楼层
这是正常的,因为现在只有一种交易积分,所以不存在积分兑换这个功能,以后会考虑设置。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-19 20:18 , Processed in 0.053728 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表