You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

130 lines
5.3 KiB

7 years ago
  1. <!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"/>
  2. <title>收货地址管理</title><meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
  3. <link href="<?php echo env('APP_URL'); ?>/css/weixin/style.css" type="text/css" rel="stylesheet">
  4. <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/jquery.min.js"></script>
  5. <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/weixin/mobile.js"></script>
  6. <meta name="keywords" content="关键词"><meta name="description" content="描述"></head><body style="background-color:#f1f1f1;">
  7. <div class="classreturn loginsignup">
  8. <div class="ds-in-bl return"><a href="javascript:history.back(-1);"><img src="<?php echo env('APP_URL'); ?>/images/weixin/return.png" alt="返回"></a></div>
  9. <div class="ds-in-bl tit center"><span>收货地址管理</span></div>
  10. <div class="ds-in-bl nav_menu"><a href="javascript:void(0);"><img src="<?php echo env('APP_URL'); ?>/images/weixin/class1.png" alt="菜单"></a></div>
  11. </div>
  12. @include('weixin.common.headerNav')
  13. <style>
  14. .address_list .flow-have-adr{padding:15px;margin-bottom:10px;background-color:#fff;}
  15. .address_list .f-h-adr-title .ect-colory{color:#e23435;}
  16. .address_list .f-h-adr-title label{font-size:18px;color:#000;margin-right:5px;}
  17. .address_list .f-h-adr-con{color:#777;margin-top:5px;margin-bottom:5px;}
  18. .address_list .adr-edit-del{text-align:right;}
  19. .address_list .adr-edit-del a{color:#777;margin-right:8px;}
  20. .address_list .f-h-adr-title span.fr{background-color: #f23030;color: white;padding:0 5px;}
  21. .bottoma{display:block;font-size:18px;padding:10px;color:white;background-color: #f23030;text-align:center;}
  22. </style>
  23. <a style="margin:10px;" class="bottoma" href="<?php echo route('weixin_user_address_add'); ?>">新增地址</a>
  24. <div class="address_list">
  25. <?php if($list){foreach($list as $k=>$v){ ?>
  26. <div class="flow-have-adr">
  27. <p class="f-h-adr-title"><label><?php echo $v['name']; ?></label><span class="ect-colory"><?php echo $v['mobile']; ?></span><?php if($v['is_default']==1){ ?><span class="fr">默认</span><?php } ?></p>
  28. <p class="f-h-adr-con"><?php echo $v['province_name'].$v['city_name'].$v['district_name'].' '.$v['address']; ?></p>
  29. <div class="adr-edit-del"><a href="<?php echo route('weixin_user_address_update',array('id'=>$v['id'])); ?>"><i class="iconfont icon-bianji"></i>编辑</a><a href="javascript:del(<?php echo $v['id']; ?>);"><i class="iconfont icon-xiao10"></i>删除</a></div>
  30. </div>
  31. <?php }} ?>
  32. </div>
  33. <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/layer/mobile/layer.js"></script>
  34. <script>
  35. $(function(){
  36. var ajaxload = false;
  37. var maxpage = false;
  38. var startpage = 1;
  39. var totalpage = <?php echo $totalpage; ?>;
  40. var tmp_url = window.location.href;
  41. msg = tmp_url.split("#");
  42. tmp_url = msg[0];
  43. $(window).scroll(function ()
  44. {
  45. var listheight = $(".address_list").outerHeight();
  46. if ($(document).scrollTop() + $(window).height() >= listheight)
  47. {
  48. if(startpage >= totalpage)
  49. {
  50. //$("#submit_bt_one").html("已是最后一页,没有更多数据!");
  51. return false;
  52. }
  53. if(!ajaxload && !maxpage)
  54. {
  55. ajaxload = true;
  56. //$("#submit_bt_one").html("努力加载中...");
  57. var url = tmp_url;
  58. var nextpage = startpage+1;
  59. $.get(url,{page_ajax:1,page:nextpage},function(res)
  60. {
  61. if(res)
  62. {
  63. $(".address_list").append(res);
  64. startpage++;
  65. if(startpage >= totalpage)
  66. {
  67. maxpage = true;
  68. //$("#submit_bt_one").html("已是最后一页,没有更多数据!");
  69. }
  70. else
  71. {
  72. //$("#submit_bt_one").html("点击加载更多");
  73. }
  74. ajaxload = false;
  75. }
  76. else
  77. {
  78. //$("#submit_bt_one").html("请求失败,请稍候再试!");
  79. ajaxload = false;
  80. }
  81. },'json');
  82. }
  83. }
  84. });
  85. });
  86. function del(id)
  87. {
  88. //询问框
  89. layer.open({
  90. content: '确定要删除吗?'
  91. ,btn: ['确定', '取消']
  92. ,yes: function(){
  93. var url = '<?php echo env('APP_API_URL')."/user_address_delete"; ?>';
  94. $.post(url,{access_token:'<?php echo $_SESSION['weixin_user_info']['access_token']; ?>',id:id},function(res)
  95. {
  96. //提示
  97. layer.open({
  98. content: res.msg
  99. ,skin: 'msg'
  100. ,time: 2 //2秒后自动关闭
  101. });
  102. if(res.code==0)
  103. {
  104. location.reload();
  105. }
  106. else
  107. {
  108. }
  109. },'json');
  110. }
  111. });
  112. }
  113. </script>
  114. @include('weixin.common.footer')
  115. </body></html>