index.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  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. .inpt-section{
  180. margin-bottom: 0.10rem;
  181. width: 100%;
  182. height: 0.50rem;
  183. padding: 0 0.15rem;
  184. line-height: 0;
  185. border-bottom: 1px solid #F1F1F1;
  186. }
  187. .inpt-section .moneyInpt{
  188. font-size: 0.14rem;
  189. color:#333;
  190. /* width: 100%; */
  191. flex:1;
  192. background:transparent;
  193. }
  194. .money-tips{
  195. color:#999999;
  196. font-size: 0.13rem;
  197. }
  198. @media(max-width: 500px) {
  199. .content{
  200. width: 100%;
  201. }
  202. .phone-wrap{
  203. width: 100%;
  204. }
  205. .recharge-wrap{
  206. width: 100%;
  207. }
  208. .mode-wrap{
  209. width: 100%;
  210. }
  211. .mode-item{
  212. width: 100%;
  213. }
  214. form{width:100%} .mode-tips .mode-txt { margin-left: 0.05rem;color: #999999;font-size: 0.12rem;max-width: 3.4rem;line-height: 0.16rem;}
  215. }
  216. .warning{
  217. color:#E6A23C !important;
  218. }
  219. </style>
  220. <script>
  221. !(function(win, doc) {
  222. function setFontSize() {
  223. var docEl = doc.documentElement;
  224. var winWidth = docEl.clientWidth;
  225. doc.documentElement.style.fontSize = (winWidth / 1920) * 100 + "px";
  226. }
  227. var userAgent = navigator.userAgent;
  228. win.addEventListener("resize", function() {
  229. if (navigator.userAgent !== userAgent) {
  230. location.reload();
  231. }
  232. });
  233. setFontSize();
  234. })(window, document);
  235. </script>
  236. </head>
  237. <body>
  238. <div class="page">
  239. <div class="content">
  240. <form method="post" action="/index/recharge/recharge_pc">
  241. <div class="phone-wrap row">
  242. <div class="phone-item row">
  243. <input type="text" name="mobile" placeholder="请输入注册手机号" class="phoneInpt" oninput="onInpt()" autofocus="true"/>
  244. <span class="phone-nick" ></span>
  245. </div>
  246. </div>
  247. <div class="recharge-wrap">
  248. <div class="recharge-title">充值金额</div>
  249. <div class="exchange-section">
  250. <!-- current为激活状态 @click="clickBox(index)"-->
  251. {volist name='conf_list' id='vo'}
  252. <div class="exchange-box column <?php if($i==1){echo 'current';}?>" data-id="{$vo.id}">
  253. <div class="exchange-top">
  254. <img class="exchange-pic" src="/assets/frontend/recharge/images/b-b.png"></img>
  255. <div class="diamonds-num" >{$vo.gold}</div>
  256. <div class="diamonds-name">金币</div>
  257. </div>
  258. <div class="exchange-price">¥{$vo.money}</div>
  259. </div>
  260. {/volist}
  261. </div>
  262. </div>
  263. <div class="inpt-section row">
  264. <input type="number" name="money" placeholder="请输入1-1000任意整数金额" class="moneyInpt" oninput="onMoneyInpt()" />
  265. <span class="money-tips" ></span>
  266. </div>
  267. <div class="mode-wrap" >
  268. <div class="mode-title">充值方式</div>
  269. <div class="mode-item row" data-type="wechat">
  270. <div class="mode-left row">
  271. <div class="zicon zicon-weixin"></div>
  272. <div>微信充值</div>
  273. </div>
  274. <div class="zicon pay-ic zicon-xuanze1"></div>
  275. </div>
  276. <div class="mode-item row" data-type="alipay">
  277. <div class="mode-left row">
  278. <div class="zicon zicon-alipay"></div>
  279. <div>支付宝充值</div>
  280. </div>
  281. <!-- <div class="zicon" :class="choosed ? 'zicon-xuanze' : 'zicon-xuanze1'" @click="changeIcon"></div> -->
  282. <div class="zicon pay-ic zicon-xuanze"></div>
  283. </div>
  284. <div class="mode-tips row">
  285. <div class="zicon zicon-tishi"></div>
  286. <div class="mode-txt">说明:充值前请确认您已满18周岁,金币充值成功后无法退款,不可提现。</div>
  287. </div>
  288. </div>
  289. <input type="submit" class="recharge-btn center active" value="立即充值" />
  290. <input type="hidden" name="pay_type" value="alipay" class="payType">
  291. <input type="hidden" name="rc_id" value="1" class="rcId">
  292. <!--<div class="recharge-btn center active">立即充值</div>-->
  293. </form>
  294. </div>
  295. </div>
  296. </body>
  297. </html>
  298. <script src="/assets/frontend/recharge/jquery.min.js"></script>
  299. <script>
  300. $(".mode-item").click(function (e) {
  301. $(this).find(".pay-ic").removeClass("zicon-xuanze1").addClass("zicon-xuanze");
  302. $(this).siblings().find(".pay-ic").removeClass("zicon-xuanze").addClass("zicon-xuanze1");
  303. var type = $(this).data("type");
  304. $(".payType").val(type);
  305. console.log($(".payType").val());
  306. });
  307. $(".exchange-box").click(function (e) {
  308. $(this).addClass("current").siblings().removeClass("current")
  309. var id = $(this).data("id");
  310. $(".rcId").val(id);
  311. console.log($(".rcId").val());
  312. $(".moneyInpt").val('');
  313. $(".money-tips").html('').removeClass("warning");
  314. });
  315. </script>
  316. <script>
  317. !(function(win, doc) {
  318. function $_getDevice() {
  319. var docEl = doc.documentElement;
  320. const winWidth = docEl.clientWidth;
  321. if(winWidth - 1 < 750){
  322. return 'mobile'
  323. }else if(winWidth - 1 < 1400){
  324. return 'book'
  325. }else {
  326. return 'pc'
  327. }
  328. }
  329. function setFontSize() {
  330. var docEl = doc.documentElement;
  331. var winWidth = docEl.clientWidth;
  332. var device = $_getDevice();
  333. var designSize =  device == 'mobile' ? 750 : (device == 'book' ? 1400 : 1920);
  334. var scaleV = 100;
  335. if(device == 'mobile'){
  336. scaleV = 200
  337. }
  338. doc.documentElement.style.fontSize = (winWidth / designSize) * scaleV + "px";
  339. }
  340. var userAgent = navigator.userAgent;
  341. win.addEventListener("resize", function() {
  342. if (navigator.userAgent !== userAgent) {
  343. location.reload();
  344. }
  345. });
  346. setFontSize();
  347. })(window, document);
  348. </script>
  349. <script>
  350. var timer;
  351. function onInpt(){
  352. var phone = $(".phoneInpt").val();
  353. if(!phone){
  354. return;
  355. }
  356. if(timer){
  357. // console.log('正清空中---')
  358. clearTimeout(timer);
  359. timer=null;
  360. }
  361. timer=setTimeout(function(){
  362. $.post("http://mita.lanmaonet.com/api/recharge/check_user", {mobile:phone},
  363. function (data, textStatus, jqXHR) {
  364. console.log(data, textStatus)
  365. if(textStatus === "success"){
  366. // $.messager.alert("系统提示","添加成功",data.message);
  367. if(data.code === 1){
  368. $(".phone-nick").html('昵称: '+data.data.nickname).removeClass("warning");
  369. }else{
  370. $(".phone-nick").html('未搜到该用户').addClass("warning");
  371. }
  372. }else{
  373. alert("系统提示","失败");
  374. }
  375. }
  376. );
  377. },1400);
  378. }
  379. var timer2
  380. function onMoneyInpt(){
  381. if(timer2){
  382. // console.log('正清空中---')
  383. clearTimeout(timer2);
  384. timer2=null;
  385. }
  386. timer2=setTimeout(function(){
  387. var money = $(".moneyInpt").val();
  388. if(! /^([1-9]\d+)$|^[1-9]$/.test(money)){
  389. $(".money-tips").html('金额应大于0正整数').addClass("warning");
  390. }else{
  391. $(".money-tips").html('').removeClass("warning");
  392. $('.exchange-box').removeClass("current");
  393. $(".rcId").val('');
  394. }
  395. },1000)
  396. }
  397. </script>