pay.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="referrer" content="origin">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  7. <meta content="telephone=no" name="format-detection" />
  8. <title>我的账号</title>
  9. <style>
  10. *{
  11. margin:0;
  12. padding:0;
  13. font:16px/1.5 Arial, '\5FAE\8F6F\96C5\9ED1';
  14. color:#000;
  15. }
  16. img{
  17. border:none;
  18. vertical-align:middle;
  19. }
  20. a{
  21. text-decoration:none;
  22. }
  23. a:hover{
  24. text-decoration:none;
  25. }
  26. body{
  27. background:#fff;
  28. }
  29. ul,li{list-style:none;}
  30. .header{
  31. padding:10px 5px 10px 15px;
  32. font-weight:bold;
  33. }
  34. .header img{
  35. width: 40px;
  36. height: 40px;
  37. border-radius: 50%;
  38. }
  39. .header .coin{
  40. font-weight:bold;
  41. }
  42. .header .user-id{
  43. float:right;
  44. line-height:40px;
  45. margin-right:15px;
  46. }
  47. .line{
  48. background:#eee;
  49. height:10px;
  50. }
  51. .content{
  52. }
  53. .list{
  54. }
  55. .list li{
  56. padding:10px 15px;
  57. border-bottom:1px solid #eee;
  58. }
  59. .list li.on{
  60. border:1px solid #FED25C;
  61. }
  62. .list li:after{
  63. content:".";
  64. display:block;
  65. height:0;
  66. clear:both;
  67. visibility:hidden;
  68. overflow:hidden;
  69. }
  70. .list li .li-left{
  71. float:left;
  72. line-height:30px;
  73. font-size:16px;
  74. }
  75. .list li .li-left img{
  76. width:20px;
  77. height:20px;
  78. margin-right:5px;
  79. }
  80. .list li .li-left span{
  81. font-size:14px;
  82. }
  83. .list li .li-right{
  84. float:right;
  85. }
  86. .list li .li-right a{
  87. display:block;
  88. background:#FED25C;
  89. border-radius:4px;
  90. padding:5px 10px;
  91. text-align:center;
  92. font-weight:bold;
  93. width:70px;
  94. }
  95. .footer{
  96. text-align:center;
  97. }
  98. .footer a{
  99. color:#3e97f8;
  100. line-height:50px;
  101. margin-left:3px;
  102. margin-right:3px;
  103. }
  104. </style>
  105. </head>
  106. <body >
  107. <div class="header">
  108. 充值账号:<img src="{$userinfo['avatar_thumb']}"> <span class="coin">{$userinfo['user_nickname']}</span> <span class="user-id">ID:{$userinfo['id']}</span>
  109. </div>
  110. <div class="header">
  111. 余额: <span class="coin">{$userinfo['coin']|default=0}</span>
  112. </div>
  113. <div class="line"></div>
  114. <div class="line"></div>
  115. <div class="content">
  116. <ul class="list">
  117. <volist name="chargelist" id="v">
  118. <li data-price="{$v['money']}" data-id="{$v['id']}">
  119. <div class="li-left">
  120. <img src="__STATIC__/wxshare/share/images/coin.png"> {$v['coin']} <if condition="$v['give'] gt 0"><span>赠送{$v['give']}</span></if>
  121. </div>
  122. <div class="li-right">
  123. <a href="javascript:void(0);" data-price="{$v['money']}">
  124. ¥{$v['money']}
  125. </a>
  126. </div>
  127. </li>
  128. </volist>
  129. </ul>
  130. </div>
  131. <div class="footer">
  132. </div>
  133. <script src="__STATIC__/js/jquery.js"></script>
  134. <script>
  135. $(function(){
  136. $(".content .list li").on("click",function(){
  137. var money=$(this).attr("data-price");
  138. var chargeid=$(this).attr("data-id");
  139. $.ajax({
  140. url:'/wxshare/Share/getOrderId',
  141. data:{ chargeid: chargeid },
  142. dataType:'json',
  143. success:function(data){
  144. console.log(data);
  145. if(data.code == 0) {
  146. location.href='/wxpay/jsapi-wx.php?uid='+data.data.uid+'&money='+data.data.money+'&orderid='+data.data.orderid;
  147. return !1;
  148. } else {
  149. alert(data.msg);
  150. }
  151. },
  152. error:function(e){
  153. console.log(e);
  154. }
  155. })
  156. })
  157. })
  158. </script>
  159. </body>
  160. </html>