index.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="divport" content="width=device-width, initial-scale=1.0">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  8. <link rel="stylesheet" href="/assets/frontend/recharge/reset.css">
  9. <link rel="stylesheet" href="/assets/frontend/recharge/icon.css">
  10. <title>充值</title>
  11. <style>
  12. .page {
  13. height: 100vh;
  14. width: 100%;
  15. overflow: hidden;
  16. }
  17. .content{
  18. padding-top: 0.40rem;
  19. display: flex;
  20. flex-direction: column;
  21. align-items: center;
  22. height: 100%;
  23. margin:0 auto;
  24. width: 8.00rem;
  25. background-color: #f8f8f8;
  26. }
  27. .phone-wrap {
  28. width: 7.50rem;
  29. padding:0 0.15rem 0.15rem;
  30. }
  31. .phone-item {
  32. width: 100%;
  33. height: 0.35rem;
  34. border-bottom: 2px solid #eee;
  35. justify-content: space-between;
  36. }
  37. .phone-item input {
  38. flex:1;
  39. font-size: 0.16rem;
  40. background-color: #f8f8f8;
  41. }
  42. .phone-item .phone-nick{
  43. color:#999999;
  44. font-size: 0.13rem;
  45. }
  46. .recharge-wrap {
  47. width: 7.50rem;
  48. padding: 0.15rem;
  49. padding-top: 0rpx;
  50. padding-bottom: 0rpx;
  51. }
  52. .recharge-title {
  53. font-size: 0.16rem;
  54. font-weight: bold;
  55. }
  56. .exchange-section {
  57. margin-top: 0.10rem;
  58. display: flex;
  59. flex-wrap: wrap;
  60. /* justify-content: space-between; */
  61. }
  62. .exchange-box {
  63. width: 1.25rem;
  64. height: 0.71rem;
  65. border: 0.01rem solid #7D73DC;
  66. border-radius: 0.10rem;
  67. margin-bottom: 0.15rem;
  68. color: #999999;
  69. align-items: center;
  70. justify-content: center;
  71. cursor: pointer;
  72. margin-right: 0.40rem;
  73. }
  74. .exchange-box:nth-child(4n){
  75. margin-right: 0;
  76. }
  77. .exchange-top {
  78. display: flex;
  79. align-items: center;
  80. }
  81. .exchange-pic {
  82. height: auto;
  83. width: 0.18rem;
  84. margin-right: 0.07rem;
  85. }
  86. .diamonds-num {
  87. font-size: 0.16rem;
  88. color: #261A00;
  89. }
  90. /* .actvie {
  91. color: #FFFFFF;
  92. } */
  93. .diamonds-name {
  94. font-size: 0.12rem;
  95. margin-left: 0.04rem;
  96. }
  97. .exchange-price {
  98. font-size: 0.12rem;
  99. margin-top: 0.10rem;
  100. }
  101. .current {
  102. background: linear-gradient(90deg, #629CFF, #7870F1);
  103. box-shadow: 0px 3px 5px 0px rgba(126, 114, 220, 0.59);
  104. color: #FFFFFF !important;
  105. }
  106. .current .diamonds-num{
  107. color: #FFFFFF;
  108. }
  109. .mode-wrap{
  110. width: 7.50rem;
  111. height: 1.15rem;
  112. padding: 0.15rem;
  113. padding-top:0rpx;
  114. }
  115. .mode-wrap .mode-title{
  116. font-size: 0.16rem;
  117. font-weight: bold;
  118. }
  119. .mode-item{
  120. width: 7.50rem;
  121. height: 0.20rem;
  122. justify-content: space-between;
  123. margin-top: 0.10rem;
  124. cursor: pointer;
  125. }
  126. .mode-left{
  127. font-size: 0.14rem;
  128. }
  129. .mode-left .zicon-weixin{
  130. font-size: 0.27rem;
  131. color: #46BB36;
  132. margin-right: 0.07rem;
  133. }
  134. .mode-left .zicon-alipay{
  135. color:#02A9F1;
  136. font-size: 0.27rem;
  137. margin-right: 0.07rem;
  138. }
  139. .pay-ic{
  140. font-size: 0.20rem;
  141. }
  142. .zicon-xuanze{
  143. color: #46BB36;
  144. }
  145. .zicon-xuanze1{
  146. color: #999;
  147. }
  148. .mode-tips{
  149. width: 7.50rem;
  150. align-items: flex-start;
  151. margin-top: 0.20rem;
  152. }
  153. .mode-tips .zicon-tishi{
  154. font-size: 0.14rem;
  155. color: #FFCE00;
  156. margin-top: 8rpx;
  157. }
  158. .mode-tips .mode-txt{
  159. /* width: 2.25rem; */
  160. margin-left: 0.05rem;
  161. color: #999999;
  162. font-size: 0.12rem;
  163. }
  164. .recharge-btn{
  165. width: 2.90rem;
  166. height: 0.40rem;
  167. background: #EEEEEE;
  168. border-radius: 0.20rem;
  169. margin: 0.50rem auto 0.10rem;
  170. font-size: 0.15rem;
  171. font-family: PingFang SC;
  172. font-weight: 500;
  173. cursor: pointer;
  174. }
  175. .recharge-btn.active{
  176. background: linear-gradient(90deg, #629CFF, #7870F1);
  177. color: #FFFFFF;
  178. }
  179. @media(max-width: 500px) {
  180. .content{
  181. width: 100%;
  182. }
  183. .phone-wrap{
  184. width: 100%;
  185. }
  186. .recharge-wrap{
  187. width: 100%;
  188. }
  189. .mode-wrap{
  190. width: 100%;
  191. }
  192. .mode-item{
  193. width: 100%;
  194. }
  195. }
  196. .warning{
  197. color:#E6A23C !important;
  198. }
  199. </style>
  200. <script>
  201. !(function(win, doc) {
  202. function setFontSize() {
  203. var docEl = doc.documentElement;
  204. var winWidth = docEl.clientWidth;
  205. doc.documentElement.style.fontSize = (winWidth / 1920) * 100 + "px";
  206. }
  207. var userAgent = navigator.userAgent;
  208. win.addEventListener("resize", function() {
  209. if (navigator.userAgent !== userAgent) {
  210. location.reload();
  211. }
  212. });
  213. setFontSize();
  214. })(window, document);
  215. </script>
  216. </head>
  217. <body>
  218. <div class="page">
  219. <div class="content">
  220. <form method="post" action="/index/recharge/recharge_pc">
  221. <div class="phone-wrap row">
  222. <div class="phone-item row">
  223. <input type="text" name="mobile" placeholder="请输入注册手机号" class="phoneInpt" oninput="onInpt()" autofocus="true"/>
  224. <span class="phone-nick" ></span>
  225. </div>
  226. </div>
  227. <div class="recharge-wrap">
  228. <div class="recharge-title">充值金额</div>
  229. <div class="exchange-section">
  230. <!-- current为激活状态 @click="clickBox(index)"-->
  231. {volist name='conf_list' id='vo'}
  232. <div class="exchange-box column <?php if($i==1){echo 'current';}?>" data-id="{$vo.id}">
  233. <div class="exchange-top">
  234. <img class="exchange-pic" src="/assets/frontend/recharge/images/b-b.png"></img>
  235. <div class="diamonds-num" >{$vo.gold}</div>
  236. <div class="diamonds-name">金币</div>
  237. </div>
  238. <div class="exchange-price">¥{$vo.money}</div>
  239. </div>
  240. {/volist}
  241. </div>
  242. </div>
  243. <div class="mode-wrap" >
  244. <div class="mode-title">充值方式</div>
  245. <!--<div class="mode-item row" data-type="wechat">
  246. <div class="mode-left row">
  247. <div class="zicon zicon-weixin"></div>
  248. <div>微信充值</div>
  249. </div>
  250. <div class="zicon pay-ic zicon-xuanze1"></div>
  251. </div>-->
  252. <div class="mode-item row" data-type="alipay">
  253. <div class="mode-left row">
  254. <div class="zicon zicon-alipay"></div>
  255. <div>支付宝充值</div>
  256. </div>
  257. <!-- <div class="zicon" :class="choosed ? 'zicon-xuanze' : 'zicon-xuanze1'" @click="changeIcon"></div> -->
  258. <div class="zicon pay-ic zicon-xuanze"></div>
  259. </div>
  260. <div class="mode-tips row">
  261. <div class="zicon zicon-tishi"></div>
  262. <div class="mode-txt">说明:充值前请确认您已满18周岁,金币充值成功后无法退款,不可提现。</div>
  263. </div>
  264. </div>
  265. <input type="submit" class="recharge-btn center active" value="立即充值" />
  266. <input type="hidden" name="pay_type" value="alipay" class="payType">
  267. <input type="hidden" name="rc_id" value="1" class="rcId">
  268. <!--<div class="recharge-btn center active">立即充值</div>-->
  269. </form>
  270. </div>
  271. </div>
  272. </body>
  273. </html>
  274. <script src="/assets/frontend/recharge/jquery.min.js"></script>
  275. <script>
  276. $(".mode-item").click(function (e) {
  277. $(this).find(".pay-ic").removeClass("zicon-xuanze1").addClass("zicon-xuanze");
  278. $(this).siblings().find(".pay-ic").removeClass("zicon-xuanze").addClass("zicon-xuanze1");
  279. var type = $(this).data("type");
  280. $(".payType").val(type);
  281. console.log($(".payType").val());
  282. });
  283. $(".exchange-box").click(function (e) {
  284. $(this).addClass("current").siblings().removeClass("current")
  285. var id = $(this).data("id");
  286. $(".rcId").val(id);
  287. console.log($(".rcId").val());
  288. });
  289. </script>
  290. <script>
  291. !(function(win, doc) {
  292. function $_getDevice() {
  293. var docEl = doc.documentElement;
  294. const winWidth = docEl.clientWidth;
  295. if(winWidth - 1 < 750){
  296. return 'mobile'
  297. }else if(winWidth - 1 < 1400){
  298. return 'book'
  299. }else {
  300. return 'pc'
  301. }
  302. }
  303. function setFontSize() {
  304. var docEl = doc.documentElement;
  305. var winWidth = docEl.clientWidth;
  306. var device = $_getDevice();
  307. var designSize =  device == 'mobile' ? 750 : (device == 'book' ? 1400 : 1920);
  308. var scaleV = 100;
  309. if(device == 'mobile'){
  310. scaleV = 200
  311. }
  312. doc.documentElement.style.fontSize = (winWidth / designSize) * scaleV + "px";
  313. }
  314. var userAgent = navigator.userAgent;
  315. win.addEventListener("resize", function() {
  316. if (navigator.userAgent !== userAgent) {
  317. location.reload();
  318. }
  319. });
  320. setFontSize();
  321. })(window, document);
  322. </script>
  323. <script>
  324. var timer;
  325. function onInpt(){
  326. var phone = $(".phoneInpt").val();
  327. if(!phone){
  328. return;
  329. }
  330. if(timer){
  331. // console.log('正清空中---')
  332. clearTimeout(timer);
  333. timer=null;
  334. }
  335. timer=setTimeout(function(){
  336. $.post("http://mita.lanmaonet.com/api/recharge/check_user", {mobile:phone},
  337. function (data, textStatus, jqXHR) {
  338. console.log(data, textStatus)
  339. if(textStatus === "success"){
  340. // $.messager.alert("系统提示","添加成功",data.message);
  341. if(data.code === 1){
  342. $(".phone-nick").html('昵称: '+data.data.nickname).removeClass("warning");
  343. }else{
  344. $(".phone-nick").html('未搜到该用户').addClass("warning");
  345. }
  346. }else{
  347. alert("系统提示","失败");
  348. }
  349. }
  350. );
  351. },1400);
  352. }
  353. </script>