人人商城

create.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. {template '_header'}
  2. <style type='text/css'>
  3. .feed-element .title {
  4. font-size: 14px;
  5. font-weight: bold;
  6. height: 32px;
  7. margin-top: 10px;
  8. }
  9. .feed-activity-list .feed-element {
  10. border: none;
  11. border-right: 1px solid #f2f2f2;
  12. }
  13. .feed-element img.img-circle,
  14. .dropdown-messages-box img.img-circle {
  15. width: 60px;
  16. height: 60px;
  17. border-radius: 10px;
  18. }
  19. .page-content{width:1000px;}
  20. </style>
  21. <link href="{php echo EWEI_SHOPV2_LOCAL}static/css/plugingrant.css" rel="stylesheet">
  22. <div class="page-heading">
  23. <span class='pull-right'>
  24. <a class='btn btn-default btn-sm' href="{php echo webUrl('plugingrant')}">返回授权应用</a>
  25. </span>
  26. <h2>选择支付方式</h2>
  27. </div>
  28. <div class='panel panel-default' style='border:none;'>
  29. <div class="grant-detail-container">
  30. <div class="cashier-info">
  31. <div class="user-info global-clearfix" style="padding:10px 0 20px;">
  32. <span class="product-type-title" style="float:left;padding-top:2px;">应用名称:</span>
  33. <span class="ca-form-option">
  34. {$title}
  35. </span>
  36. </div>
  37. <div class="wallet-dialog" style="display: block;">
  38. <div class="content global-clearfix">
  39. <div class="wallet-content">
  40. <div class="product-info" id="_disk_id_5">
  41. <div class="info-vip">
  42. <span class="product-type-title" style="padding-top:14px;display: block;float:left;">开通时长:</span>
  43. <div class="info-box-time">
  44. <div class="info-time" id="info-svip-time"></div>
  45. </div>
  46. <div class="info-box-time">
  47. <div class="info-time" id="info-vip-time"></div>
  48. <div class="info-product info-product-vip">
  49. <ul class="product-list global-clearfix vip-ul no-view">
  50. {if $item['data']}
  51. {loop $item['data'] $index $row}
  52. <li data-pid="3" class="item item-first {if $index==0}item-link-active{/if}" data-price="{$row['price']}" data-month="{$row['date']}">
  53. <a class="item-link global-clearfix" href="javascript:void(0);">
  54. <label class="">
  55. <span>{if $row['date']==0}永久{else}{$row['date']}个月{/if}</span></label>
  56. <span class="detail">
  57. <span class="detail-row">
  58. <span>&yen;</span>{$row['price']}</span>
  59. </span>
  60. </a>
  61. <em class="discount-icon discount-s-1"></em>
  62. <em class="active-icon"></em>
  63. </li>
  64. {/loop}
  65. {else if $package['data']}
  66. {loop $package['data'] $index $row}
  67. <li data-pid="3" class="item item-first {if $index==0}item-link-active{/if}" data-price="{$row['price']}" data-month="{$row['date']}">
  68. <a class="item-link global-clearfix" href="javascript:void(0);">
  69. <label class="">
  70. <span>{if $row['date']==0}永久{else}{$row['date']}个月{/if}</span></label>
  71. <span class="detail">
  72. <span class="detail-row">
  73. <span>&yen;</span>{$row['price']}</span>
  74. </span>
  75. </a>
  76. <em class="discount-icon discount-s-1"></em>
  77. <em class="active-icon"></em>
  78. </li>
  79. {/loop}
  80. {/if}
  81. <div style="clear:both;"></div>
  82. </ul>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. <div class="ca-tabs-panel" id="alipay-panel" style="display: block;">
  89. <div class="ca-form-group clearfix">
  90. <span class="product-type-title" style="float:left;padding-top:10px;">支付方式:</span>
  91. <div class="ca-form-group clearfix">
  92. <ul class="ca-form-option choose-list-icon channel-list">
  93. <li class="selected option-selected">
  94. {if $setting['alipay']>0}
  95. <label class="option-icon" data-pay="alipay"><img src="{php echo EWEI_SHOPV2_LOCAL}static/images/plugingrant/alipay.png" alt=""><em class="active-icon"></em></label>
  96. {/if}
  97. {if $setting['weixin']>0}
  98. <label class="option-icon" data-pay="weixin"><img src="{php echo EWEI_SHOPV2_LOCAL}static/images/plugingrant/weixin.png" alt=""><em class="active-icon"></em></label>
  99. {/if}
  100. </li>
  101. </ul>
  102. </div>
  103. <div class="qrcode-wrapper">
  104. <div class="qrcode-err hidden">
  105. <span class="qrcode-err-desc"></span>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="ca-form-group clearfix" style="padding:10px 0;">
  110. <span class="product-type-title" style="float:left;padding-top:5px;">应付金额:</span>
  111. <span class="ca-form-option">
  112. <span class="ca-spec-num ca-pay-amount">--</span>
  113. <span class="ca-unit">元</span>
  114. </span>
  115. </div>
  116. <div class="option-qrcode" id="option-qrcode" style="padding:10px 0 10px 80px;display: none;"><span class="ca-btn-loading">正在生成支付二维码</span></div>
  117. <div class="ca-group ca-group-submit">
  118. <a href="javascript:void(0);" id="pay-btn-a" class="fn-submit-btn sbtn-primary " style="display: none;">立即支付</a>
  119. <span class="ca-btn-loading"></span>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. <script type="text/javascript" src="../addons/ewei_shopv2/static/js/dist/jquery/jquery-1.11.1.min.js"></script>
  128. <script type="text/javascript" src="../addons/ewei_shopv2/static/js/dist/jquery/jquery.qrcode.min.js"></script>
  129. <script>
  130. $(function () {
  131. var paytype = $(".option-selected .option-icon.active").attr("data-pay");
  132. var price = $(".product-list .item.item-link-active").attr("data-price");
  133. var month = $(".product-list .item.item-link-active").attr("data-month");
  134. $(".ca-pay-amount").html(price);
  135. $(".option-selected .option-icon").off("click").on("click",function () {
  136. $(".option-selected .option-icon").removeClass("active");
  137. $(this).addClass("active");
  138. paytype = $(this).attr("data-pay");
  139. payurl(paytype,price,month);
  140. });
  141. $(".product-list .item").off("click").on("click",function () {
  142. $(".product-list .item").removeClass("item-link-active");
  143. $(this).addClass("item-link-active");
  144. price = $(this).attr("data-price");
  145. month = $(this).attr("data-month");
  146. $(".ca-pay-amount").html(price);
  147. payurl(paytype,price,month);
  148. })
  149. });
  150. function payurl(paytype,price,month) {
  151. /*paytype = $(".option-selected .option-icon.active").attr("data-pay");
  152. price = $(".product-list .item.item-link-active").attr("data-price");
  153. month = $(".product-list .item.item-link-active").attr("data-month");*/
  154. /*console.log(paytype,price,month,code);
  155. return false;*/
  156. if(paytype=="weixin"){
  157. $.ajax({
  158. url:"{php echo webUrl('plugingrant/payon')}",
  159. type:'POST', //GET
  160. async:true, //或false,是否异步
  161. data:{
  162. id:{$id},cate:"{$cate}",paytype:"wechat",price:price,month:month
  163. },
  164. timeout:5000, //超时时间
  165. dataType:'json', //返回的数据格式:json/xml/html/script/jsonp/text
  166. success:function(data){
  167. var result = data.result;
  168. if(data.status==1){
  169. var url = result.code_url;
  170. $("#option-qrcode").empty().qrcode({
  171. typeNumber: 0, //计算模式
  172. correctLevel: 0,//纠错等级
  173. text:url
  174. });
  175. var url = "{php echo webUrl('plugingrant/paystatus')}";
  176. var data = {logno: result.logno};
  177. var url_return = "{php echo webUrl('plugingrant')}";
  178. var settime = setInterval(function () {
  179. $.getJSON(url, data, function (ret) {
  180. if (ret.status >=1) {
  181. clearInterval(settime);
  182. location.href = url_return;
  183. }else{
  184. //FoxUI.toast.show(JSON.stringify(ret));
  185. }
  186. })
  187. }, 3000);
  188. }
  189. }
  190. })
  191. $("#option-qrcode").show();
  192. $("#pay-btn-a").hide();
  193. }else{
  194. $(".option-qrcode").hide();
  195. if(paytype && price){
  196. $("#pay-btn-a").show();
  197. }
  198. $.ajax({
  199. url:"{php echo webUrl('plugingrant/payon')}",
  200. type:'POST', //GET
  201. async:true, //或false,是否异步
  202. data:{
  203. id:{$id},cate:"{$cate}",paytype:"alipay",price:price,month:month
  204. },
  205. timeout:5000, //超时时间
  206. dataType:'json', //返回的数据格式:json/xml/html/script/jsonp/text
  207. success:function(data){
  208. $("#pay-btn-a").attr("href",data.result.url);
  209. }
  210. })
  211. }
  212. }
  213. </script>
  214. {template '_footer'}