<style>
.dsc-table-style tbody tr.item_disabled td{background: none repeat scroll 0 0 #F9F9F9;height: 30px;padding: 10px 0;text-align: center;}
</style>
<div class="dsc-receipt-info">
  <div class="dsc-receipt-info-title">
    <h3>商品清单</h3>
    <?php if(!empty($ifcart)){?>
    <a href="{:url('/home/cart/index')}">返回购物车</a>
    <?php }?>
  </div>
  <table class="dsc-table-style">
    <thead>
      <tr>
        <th class="w20"></th>
        <th></th>
        <th>商品</th>
        <th class="w120">单价(元)</th>
        <th class="w120">数量</th>
        <th class="w120">小计(元)</th>
      </tr>
    </thead>
    <?php foreach($store_cart_list as $store_id => $cart_list) {?>
    <tbody>
      <tr>
        <th colspan="20"><strong>店铺：<a href="{:url('/home/Store/index',['store_id'=>$store_id])}"><?php echo $cart_list[0]['store_name']; ?></a></strong> <span member_id="#"></span>
          <div class="store-sale">
            <?php if (!empty($cancel_calc_sid_list[$store_id])) {?>
            <em><i class="icon-gift"></i>店铺活动-免运费</em><?php echo $cancel_calc_sid_list[$store_id]['desc'];?>
            <?php } ?>
            <?php if (!empty($store_mansong_rule_list[$store_id])) {?>
            <em><i class="icon-gift"></i>店铺活动-满即送</em><?php echo $store_mansong_rule_list[$store_id]['desc'];?>
            <?php if (is_array($store_premiums_list[$store_id])) {?>
            <?php foreach ($store_premiums_list[$store_id] as $goods_info) { ?>
            <a href="{:url('/home/Goods/index',['goods_id'=>$goods_info.goods_id])}" target="_blank" class="dsc-store-gift" title="<?php echo $goods_info['goods_name']; ?>"><img src="<?php echo thumb($goods_info,60);?>" alt="<?php echo $goods_info['goods_name']; ?>" /></a>
            <?php } ?>
            <?php  } ?>
            <?php } ?>
          </div></th>
      </tr>
      <?php foreach($cart_list as $cart_info) {?>
      <tr id="cart_item_<?php echo $cart_info['cart_id'];?>" class="shop-list <?php echo ($cart_info['state'] && $cart_info['storage_state']) ? '' : 'item_disabled';?>">
        <td><?php if ($cart_info['state'] && $cart_info['storage_state']) {?>
          <input type="hidden" value="<?php echo $cart_info['cart_id'].'|'.$cart_info['goods_num'];?>" name="cart_id[]">
          <?php } ?></td>
        <?php if ($cart_info['bl_id'] == '0') {?>
        <td class="w60"><a href="{:url('/home/Goods/index',['goods_id'=>$cart_info.goods_id])}" target="_blank" class="dsc-goods-thumb"><img src="<?php echo thumb($cart_info,60);?>" alt="<?php echo $cart_info['goods_name']; ?>" /></a></td>
        <?php } ?>
        <td class="tl" <?php if ($cart_info['bl_id'] != '0') {?>colspan="2"<?php }?>><dl class="dsc-goods-info">
            <dt><a href="{:url('/home/Goods/index',['goods_id'=>$cart_info.goods_id])}" target="_blank"><?php echo $cart_info['goods_name']; ?></a></dt>
            <?php if (!empty($cart_info['xianshi_info'])) {?>
            <dd> <span class="xianshi">满<strong><?php echo $cart_info['xianshi_info']['lower_limit'];?></strong>件，单价直降<em>￥<?php echo $cart_info['xianshi_info']['down_price']; ?></em></span> </dd>
            <?php }?>
            <?php if (isset($cart_info['ifgroupbuy'])) {?>
            <dd> <span class="groupbuy">抢购</span></dd>
            <?php }?>
            <?php if ($cart_info['bl_id'] != '0') {?>
            <dd> <span class="buldling">优惠套装，单套直降<em>￥<?php echo $cart_info['down_price']; ?></em></span></dd>
            <?php }?>
            <?php if (!empty($cart_info['gift_list'])) { ?>
            <dd><span class="dsc-goods-gift">赠</span>
              <ul class="dsc-goods-gift-list">
                <?php foreach ($cart_info['gift_list'] as $goods_info) { ?>
                <li nc_group="<?php echo $cart_info['cart_id'];?>"><a href="{:url('/home/Goods/index',['goods_id'=>$goods_info.gift_goodsid])}" target="_blank" class="thumb" title="赠品：<?php echo $goods_info['gift_goodsname']; ?> * <?php echo $goods_info['gift_amount'] * $cart_info['goods_num']; ?>"><img src="<?php echo cthumb($goods_info['gift_goodsimage'],60,$store_id);?>" alt="<?php echo $goods_info['gift_goodsname']; ?>"/></a> </li>
                <?php } ?>
              </ul>
            </dd>
            <?php  } ?>
          </dl></td>
        <td class="w120"><em><?php echo $cart_info['goods_price']; ?></em></td>
        <td class="w60"><?php echo $cart_info['state'] ? $cart_info['goods_num'] : ''; ?></td>
        <td class="w120"><?php if ($cart_info['state'] && $cart_info['storage_state']) {?>
          <em id="item<?php echo $cart_info['cart_id']; ?>_subtotal" nc_type="eachGoodsTotal"><?php echo $cart_info['goods_total']; ?></em>
          <?php } elseif (!$cart_info['storage_state']) {?>
          <span style="color: #F00;">库存不足</span>
          <?php }elseif (!$cart_info['state']) {?>
          <span style="color: #F00;">已下架</span>
          <?php }?></td>
        <td></td>
      </tr>

      <!-- S bundling goods list -->
      <?php if (isset($cart_info['bl_goods_list'])) {?>
      <?php foreach ($cart_info['bl_goods_list'] as $goods_info) { ?>
      <tr class="shop-list <?php echo $cart_info['state'] && $cart_info['storage_state'] ? '' : 'item_disabled';?>">
        <td></td>
        <td class="w60"><a href="{:url('/home/Goods/index',['goods_id'=>$goods_info.goods_id])}" target="_blank" class="dsc-goods-thumb"><img src="<?php echo thumb($goods_info,60);?>" alt="<?php echo $goods_info['goods_name']; ?>" /></a></td>
        <td class="tl"><dl class="dsc-goods-info">
            <dt><a href="{:url('/home/Goods/index',['goods_id'=>$goods_info.goods_id])}" target="_blank"><?php echo $goods_info['goods_name']; ?></a> </dt>
          </dl></td>
        <td><em><?php echo $goods_info['bl_goods_price'];?></em></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
      <?php } ?>
      <?php  } ?>
      <!-- E bundling goods list -->

      <?php } ?>
      <tr>
        <td class="w10"></td>
        <td class="tl" colspan="2">买家留言：
          <textarea  name="pay_message[<?php echo $store_id;?>]" class="dsc-msg-textarea" placeholder="选填：对本次交易的说明（建议填写已经和商家达成一致的说明）" title="选填：对本次交易的说明（建议填写已经和商家达成一致的说明）"  maxlength="150"></textarea></td>
        <td class="tl" colspan="10"><div class="dsc-form-default"> </div></td>
      </tr>
      <tr>
        <td class="tr" colspan="20"><div class="dsc-store-account">
            <dl class="freight">
              <dt>运费：</dt>
              <dd><em id="eachStoreFreight_<?php echo $store_id;?>">0.00</em>元</dd>
            </dl>
            <dl>
              <dt>商品金额：</dt>
              <dd><em id="eachStoreGoodsTotal_<?php echo $store_id;?>"><?php echo $store_goods_total[$store_id];?></em>元</dd>
            </dl>
            <?php if (!empty($store_mansong_rule_list[$store_id]['discount'])) {?>
            <dl class="mansong">
              <dt>满即送-<?php echo $store_mansong_rule_list[$store_id]['desc'];?>：</dt>
              <dd><em id="eachStoreManSong_<?php echo $store_id;?>">-<?php echo $store_mansong_rule_list[$store_id]['discount'];?></em>元</dd>
            </dl>
            <?php } ?>

            <!-- S voucher list -->

            <?php if (!empty($store_voucher_list[$store_id]) && is_array($store_voucher_list[$store_id])) {?>
            <dl class="voucher">
              <dt>
                <select nctype="voucher" name="voucher[<?php echo $store_id;?>]">
                  <option value="<?php echo $voucher['voucher_t_id'];?>|<?php echo $store_id;?>|0.00">选择代金券</option>
                  <?php foreach ($store_voucher_list[$store_id] as $voucher) {?>
                  <option value="<?php echo $voucher['voucher_t_id'];?>|<?php echo $store_id;?>|<?php echo $voucher['voucher_price'];?>"><?php echo $voucher['desc'];?></option>
                  <?php } ?>
                </select>：
              </dt>
              <dd><em id="eachStoreVoucher_<?php echo $store_id;?>">-0.00</em>元</dd>
            </dl>
            <?php } ?>

            <!-- E voucher list -->

            <dl class="total">
              <dt>本店合计：</dt>
              <dd><em store_id="<?php echo $store_id;?>" nc_type="eachStoreTotal"></em>元</dd>
            </dl>
          </div></td>
      </tr>
      <?php }?>

      <!-- S 预存款 & 充值卡 -->
      <?php if (!empty($available_pd_amount) || !empty($available_rcb_amount)) { ?>
      <tr id="pd_panel">
        <td class="pd-account" colspan="20"><div class="dsc-pd-account">
        <?php if (!empty($available_rcb_amount)) { ?>
            <div class="mt5 mb5">
              <label>
                <input type="checkbox" class="vm mr5" value="1" name="rcb_pay">
                使用充值卡（可用金额：<em><?php echo $available_rcb_amount;?></em>元）</label>
            </div>
       <?php } ?>
       <?php if (!empty($available_pd_amount)) { ?>
            <div class="mt5 mb5">
              <label>
                <input type="checkbox" class="vm mr5" value="1" name="pd_pay">
                使用预存款（可用金额：<em><?php echo $available_pd_amount;?></em>元）</label>
            </div>
      <?php } ?>
      <?php if (!empty($available_pd_amount) && !empty($available_rcb_amount)) { ?>
      <div class="mt5 mb5">如果二者同时使用，系统优先使用充值卡&nbsp;&nbsp;</div>
      <?php } ?>
            <div id="pd_password" style="display: none">支付密码：
              <input type="password" class="text w120" value="" name="password" id="pay-password" maxlength="35" autocomplete="off">
              <input type="hidden" value="" name="password_callback" id="password_callback">
              <a class="dsc-btn-mini dsc-btn-orange" id="pd_pay_submit" href="javascript:void(0)">使用</a>
              <?php if (!$member_paypwd) {?>
              还未设置支付密码，<a href="{:url('/Home/Membersecurity/auth',['type'=>'modify_paypwd'])}" target="_blank">马上设置</a>
              <?php } ?>
            </div>
          </div></td>
      </tr>
      <?php } ?>
      <!-- E 预存款 -->


    </tbody>
    <tfoot>
      <tr>
        <td colspan="20"><div class="dsc-all-account">订单总金额：<em id="orderTotal"></em>元</div></td>
      </tr>
    </tfoot>
  </table>
</div>
