ajax订单支付,提示订单过期 (传递data为json格式)
来源:互联网 发布:爱奇艺视频for mac版 编辑:程序博客网 时间:2024/03/28 17:43
前台页面
<script>function ordering(shopid){var array=new Array();$("input[name='myid']").each(function(){if($(this).val()){array.push($(this).val());}})flag= 1;$.ajax({ type:'get', async : false,url: "{:U('checkcartAjax')}", dataType: "json",data:"id="+array,success: function(msg){ //alert(msg); //alert(msg.msgid);//alert(msg.html); if(msg.msgid=='1004'){ $("#jian2").html("促销商品:"+msg.html+' 已结束')$("#jian2").css("display",'block');function times(){$("#jian2").css("display",'none');clearInterval(timer); } timer=setInterval(times,3000); flag= 0; } //location.reload();}}); if(flag == 1){if(array.length >0){//window.location.href="index.php?s=/addon/WeiSite/WeiSite/orderlist/id/"+array;}else{alert('请选择商品');}} }function js_method(){javascript:void(0);return false;}</script> <div class="pull-right qjs_right"> <a href="javascript:ordering()" >去结算</a> </div>
后台
//ajax 购物车提交前进行判断是否 存在过期促销商品 public function checkcartAjax(){ //商品促销 '$orderid' 'ORDER94490270'$id = I('id');$orderid=explode(',',$id); $shop_list = array();//var_dump($orderid);foreach($orderid as $val){if($val){$shop_list[]=M('shopp_cart')->where('id='.$val)->find();}}//var_dump($shop_list);die();if($shop_list){foreach($shop_list as $key=>$val){$specialPrice=M('goodsshop')->where('id='.$val['shopid'])->getField('promotion_id');$goodsname = M('goodsshop')->where('id='.$val['shopid'])->getField('goods_name');//var_dump(M('goodsshop')->getLastSql());die();//var_dump($specialPrice);die();if($specialPrice!='0'){$promo_state = M('goodspromotion')->where('id='.$specialPrice)->getField('state');//var_dump($promo_state);die();if($promo_state =='2' ){echo json_encode(array('msgid'=>'1004','html'=>$goodsname));exit();}}}}//echo json_encode(array('msgid'=>'1004','html'=>'8888')); }
0 0
- ajax订单支付,提示订单过期 (传递data为json格式)
- ajax订单支付,提示订单过期 (传递data为普通格式)
- 查询每个订单中订单明细中只支付了部分或为支付的订单
- shell 脚本为php 执行订单过期接口
- shell 脚本为php 执行订单过期接口
- 实现淘宝订单(比如订单生成、未支付的订单等等)自定义view的实现
- SSH之订单支付
- 36.支付订单
- 订单支付交易
- 实现订单支付方法
- 订单
- 订单
- 订单
- 订单
- 订单
- 订单
- 订单
- 订单
- Maven学习 (二) Eclipse 上安装 Maven3插件
- Java框架介绍:Quartz从入门到进阶
- iOS tableView section 和cell 一同滚动的方法
- openwebrtc Dependencies and Licenses
- Android中采用XmlPullParser解析xml文件异常的问题
- ajax订单支付,提示订单过期 (传递data为json格式)
- Java Timer的使用
- Java环境变量设置
- windows下安装redis
- Gstreamer debug
- 软件开发技术名词
- Janusec安全内控与项目管理平台简介
- serialVersionUID作用
- android 获得一个应用程序的启动次数,运行时间等信息