⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 auctionviewshowmsg.java~1~

📁 云网论坛CWBBS 源码,内容丰富,学习,参考,教学的好资料,具体见内说明,
💻 JAVA~1~
📖 第 1 页 / 共 2 页
字号:
                    curDate.setTime(System.currentTimeMillis());
                    // 价格明细
                    str += "<tr><td class=pd5>" + AuctionSkin.LoadString(request, "floor") + ":" + StrUtil.FormatPrice(aw.getPrice()) + "&nbsp;" + su.getDanWei() + "</td><td>" + LoadString("bid_begin_date") + DateUtil.format(ad.getBeginDate(), "yy-MM-dd") + "</td></tr>";
                    str += "<tr><td class=pd5>" + AuctionSkin.LoadString(request, "dlt") + ":" + StrUtil.FormatPrice(aw.getDlt()) + "&nbsp;" + su.getDanWei() + "</td><td>" + LoadString("bid_end_date") + DateUtil.format(ad.getEndDate(), "yy-MM-dd") + "</td></tr>";
                    str += "<tr><td class=pd5>" + AuctionSkin.LoadString(request, "referPrice") + ":" + StrUtil.FormatPrice(aw.getReferPrice()) + "&nbsp;" + su.getDanWei() + "</td><td>" + LoadString("bid_total_price") + StrUtil.FormatPrice(aw.getPrice()*ad.getCount()) + "</td></tr>";
                    // 如果已到期或者订单已生成
                    // logger.info("curDate=" + curDate + " endDate=" + endDate);
                    if (DateUtil.compare(curDate, endDate)==1 || ad.getOrderId()!=ad.NONE_ORDER) {
                        str += "<tr><td colspan=2 class=pd5>" +
                                LoadString("bid_state_end");
                        if (ad.getOrderId()==ad.NONE_ORDER) {
                            // 如果订单未成生,则生成订单
                            AuctionOrderDb ao = new AuctionOrderDb();
                            try {
                                if (ao.makeOrderForAuction(ad)) {
                                    String orderstr = LoadString("bid_order_link");
                                    orderstr = orderstr.replaceAll("\\$orderId", ao.getId()+"");
                                    str += orderstr;
                                }
                            }
                            catch (ErrMsgException e) {
                                str += e.getMessage();
                            }
                            catch (ResKeyException e) {
                                str += e.getMessage(request);
                            }
                        }
                        else {
                            // 显示订单号
                            Privilege privilege = new Privilege();
                            String user = privilege.getUser(request);
                            AuctionOrderDb ao = new AuctionOrderDb();
                            ao = ao.getAuctionOrderDb(ad.getOrderId());
                            // 如果是买家、卖家或管理员,则显示订单号
                            if (user.equals(ao.getSeller()) || user.equals(ao.getBuyer()) || privilege.isMasterLogin(request)) {
                                String orderstr = LoadString("bid_order_link");
                                orderstr = orderstr.replaceAll("\\$orderId",
                                        ad.getOrderId() + "");
                                str += orderstr;
                            }
                        }
                        str += "</td></tr>";
                    }
                    else {
                        str += "<tr><td colspan=2 class=pd5>" +
                                LoadString("bid_expire") + "</td></tr>";
                        str +=
                                "<tr><td colspan=2 class=pd5><input type=hidden name='msgRootId' value='" +
                                ad.getMsgRootId() +
                                "'><input name=bitPrice value='" +
                                StrUtil.FormatPrice(curPrice + aw.getDlt()) +
                                "' size=3>&nbsp;&nbsp;<img src='plugin/" +
                                AuctionSkin.code + "/" + skinPath + "/images/" +
                                SkinUtil.getLanguage(request) + "/bit.jpg' align=absmiddle onclick='auctionform1.submit()' style='cursor:hand'></td></tr>";
                    }
                    str += "</form></table>";

                    // 开始计时
                    String spareTime = "";

                    int[] r = DateUtil.dateDiffDHMS(endDate, curDate);
                    spareTime = r[0] + "|" + r[1] + "|" + r[2] + "|" + r[3];
                    str += "<script src='plugin/" + AuctionSkin.code + "/script.js'></script>\n";
                    str += "<script>\n";
                    str += "showSpareTime('" + spareTime + "');\n";
                    str += "</script>\n";

                    // 显示出价列表
                    AuctionBidDb abd = new AuctionBidDb();
                    Vector v = abd.list(ad.getMsgRootId());
                    Iterator ir = v.iterator();
                    str += "<BR><table class=watermark width=300><tr><td height=20 align=center colspan=3>" + AuctionSkin.LoadString(request, "bid_process")+ "</td></tr>";
                    str += "<tr><td align=center height=20>" + LoadString("bid_user") + "</td><td align=center>" + LoadString("bid_price") + "</td><td align=center>" + LoadString("bid_date") + "</td></tr>";
                    while (ir.hasNext()) {
                        abd = (AuctionBidDb) ir.next();
                        str += "<tr><td align=center height=20>" + abd.getName() + "</td><td align=center>" + StrUtil.FormatPrice(abd.getPrice()) + "</td><td align=center>" + DateUtil.format(abd.getBidDate(), "yy-MM-dd HH:mm:ss") + "</td></tr>";
                    }
                    str += "</table>";
                }
                else { // 如果是一口价
                    if (ad.getState()==ad.STATE_SELLOUT)
                        str += AuctionSkin.LoadString(request, "sell_type_sell") + "&nbsp;&nbsp;" + AuctionSkin.LoadString(request, "STATE_SELLOUT") + "<BR>";
                    else { // 销售中
                        str += AuctionSkin.LoadString(request, "sell_type_sell");
                        if (ad.isShow())
                            str += "&nbsp;&nbsp;" + AuctionSkin.LoadString(request, "LABEL_ONLY_FOR_SHOW");
                        str += "<BR>";
                        // 显示价格列表及购买按钮
                        str += "<table class=watermark width=280>";
                        AuctionWorthDb aw = new AuctionWorthDb();
                        long[] ids = aw.getWorthOfAuction(ad.getMsgRootId());
                        if (ids != null) {
                            int len = ids.length;
                            ScoreMgr sm = new ScoreMgr();
                            for (int i = 0; i < len; i++) {
                                aw = aw.getAuctionWorthDb((int) ids[i]);
                                // logger.info("ids[i]=" + ids[i] + " aw id=" + aw.getId());
                                ScoreUnit su = sm.getScoreUnit(aw.getMoneyCode());
                                str += "<tr><td height=20 class=pd5>" +
                                        su.getName() +
                                        "</td><td>" +
                                        StrUtil.FormatPrice(aw.getPrice()) +
                                        "</td><td>" + su.getDanWei() +
                                        "</td><form id='form" + i +
                                        "' name='form" +
                                        i + "' action='plugin/auction/buy.jsp' method=post><td>&nbsp;<input type=hidden name=worthId value='" +
                                        aw.getId() + "'>" + LoadString("count") +
                                        "&nbsp;<input name=count value='1' size=1>";
                                if (!ad.isShow())
                                    str += "&nbsp;<img src='plugin/" +
                                            AuctionSkin.code + "/" + skinPath +
                                            "/images/" +
                                            SkinUtil.getLanguage(request) +
                                            "/buy.gif' align=absmiddle onclick='if (confirm(\"" +
                                            LoadString("buy_confirm") +
                                            "\")) form" +
                                            i +
                                            ".submit()' style='cursor:hand'>";
                                str += "</td></form></tr>";
                            }
                        }
                        str += "<tr><td class=pd5 colspan=3></td></tr>";
                        str += "</table>";
                    }
                }
            }
            break;
        case UIShowMsg.POS_QUICK_REPLY_NOTE:
            str = getQucikReplyNote();
            break;
        case UIShowMsg.POS_QUICK_REPLY_ELEMENT:
            str = getQuickReplyFormElement();
            break;
        default:
        }
        return str;
    }

    public void setBoardCode(String boardCode) {
        this.boardCode = boardCode;
    }

    public void setMsgDb(MsgDb msgDb) {
        this.msgDb = msgDb;
    }

    public String getBoardCode() {
        return boardCode;
    }

    public MsgDb getMsgDb() {
        return msgDb;
    }

    public boolean IsPluginBoard() {
        AuctionBoardDb sb = new AuctionBoardDb();
        return sb.isPluginBoard(boardCode);
    }

    public String LoadString(String key) {
        return AuctionSkin.LoadString(request, key);
    }

    private String boardCode;
    private MsgDb msgDb;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -