volist循环中jQuery如何使用thinkphp模板循环变量$i作为js自增id?

浏览:270 发布日期:2019/03/27 分类:求助交流 关键字: tp3.2.3 volist js jQuery
<ul><volist name="increment_arr" id="vo">
                    <li>
                        <div id="increment-{$i}" class="bin">
                            <div class="duigou"></div>
                        </div>
                        <p>{$vo['name']}<br><span>{$vo['service_price']}元</span></p>
                    </li>
                    <script type="text/javascript">
                        if ($('#increment-{$i}').hasClass('Roman')) {
                            //如果选择了积分支付
                            if ($('#score').hasClass('Roman')) {
                                var pay = {$vo['service_price']}-{$my_points/$payment_rate|round=2};
                                $('#lun').html(pay+'元');//应付金额
                            } else {
                                $('#lun').html("16元");//应付金额
                            }
                            $('#lun1').html({$vo['service_price']}+"元");//订单金额
                        } else {
                            //如果选择了积分支付
                            if ($('#score').hasClass('Roman')) {
                                var pay = {$vo['service_price']}-{$my_points/$payment_rate|round=2};
                                $('#lun').html(pay+'元');//应付金额
                            } else {
                                $('#lun').html("28元");//应付金额
                            }
                            $('#lun1').html({$vo['service_price']}+"元");//订单金额
                        }
                    </script>
                </volist></ul>
最佳答案
评论( 相关
后面还有条评论,点击查看>>