| | |
| | | |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <meta name="viewport" |
| | | content="width=device-width, viewport-fit=cover, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/> |
| | | <meta name="viewport" content="width=device-width, viewport-fit=cover, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> |
| | | <title>积分中心</title> |
| | | <script> |
| | | window.onresize = function () { |
| | |
| | | <link rel="stylesheet" type="text/css" href="../layui/css/layui.css"/> |
| | | <style> |
| | | body { |
| | | background-color: #FFFFFF; |
| | | background-color: #F5F6FA; |
| | | font-family: Arial, sans-serif; |
| | | font-size: 0.3rem; /* 修改字体大小为原来的30% */ |
| | | font-size: 0.3rem; |
| | | /* 修改字体大小为原来的30% */ |
| | | } |
| | | |
| | | .header { |
| | |
| | | } |
| | | |
| | | .balance { |
| | | font-size: 0.6rem; /* 修改字体大小为原来的30% */ |
| | | color: #ff5722; |
| | | margin-bottom: 0.5rem; |
| | | font-family: MiSans, MiSans; |
| | | font-weight: 500; |
| | | font-size: 0.30rem; |
| | | color: #FF0547; |
| | | line-height: 0.40rem; |
| | | text-align: left; |
| | | font-style: normal; |
| | | text-transform: none; |
| | | } |
| | | |
| | | .estimated-amount { |
| | | font-size: 0.21rem; /* 修改字体大小为原来的30% */ |
| | | color: #666; |
| | | margin-top: -0.5rem; |
| | | font-weight: 500; |
| | | font-size: 0.26rem; |
| | | color: #FFFFFF; |
| | | line-height: 0.34rem; |
| | | text-align: left; |
| | | font-style: normal; |
| | | text-transform: none; |
| | | margin-top: 0.15rem; |
| | | } |
| | | |
| | | .exchange-container { |
| | | text-align: left; |
| | | margin: 1rem 0; |
| | | padding: 1rem; |
| | | background-color: #fff; |
| | | border-radius: 0.2rem; |
| | | margin: 0.3rem 0; |
| | | padding: 0.3rem; |
| | | width: 6.9rem; |
| | | } |
| | | |
| | | .exchange-title { |
| | | font-size: 0.6rem; /* 修改字体大小为原来的30% */ |
| | | font-size: 0.6rem; |
| | | /* 修改字体大小为原来的30% */ |
| | | color: #333; |
| | | margin-top: 0.8rem; |
| | | margin-bottom: 1rem; |
| | |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | margin-bottom: 1rem; |
| | | margin-top: 0.3rem; |
| | | } |
| | | |
| | | .exchange-input input { |
| | | width: 60%; |
| | | padding: 0.2rem; |
| | | border: 1px solid #ddd; |
| | | border-radius: 0.2rem; |
| | | font-size: 0.3rem; /* 修改字体大小为原来的30% */ |
| | | text-align: center; |
| | | width: 6.30rem; |
| | | height: 0.80rem; |
| | | line-height: 0.8rem; |
| | | background: #F5F6FA; |
| | | border-radius: 0.10rem; |
| | | padding: 0rem 0.2rem; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .btn { |
| | | background-color: #ff5722; |
| | | color: #fff; |
| | | width: 6.30rem; |
| | | height: 0.80rem; |
| | | background: linear-gradient( 90deg, #FF0447 0%, #FF7454 100%); |
| | | border-radius: 0.42rem; |
| | | border: none; |
| | | padding: 0.2rem 0.3rem; |
| | | border-radius: 0.2rem; |
| | | font-size: 0.3rem; |
| | | margin-left: 0.3rem; |
| | | cursor: pointer; |
| | | color: white; |
| | | font-size: 0.32rem; |
| | | margin-top: 0.3rem; |
| | | } |
| | | |
| | | .btn:hover { |
| | | background-color: #e64a19; |
| | | } |
| | | |
| | | .links-container { |
| | | text-align: center; |
| | | margin-top: 1rem; |
| | | } |
| | | |
| | | .links-container a { |
| | | display: block; |
| | | color: #ff5722; |
| | | text-decoration: none; |
| | | margin: 0.2rem 0; |
| | | font-size: 0.3rem; /* 修改字体大小为原来的30% */ |
| | | } |
| | | |
| | | .links-container a:hover { |
| | | text-decoration: underline; |
| | | } |
| | | [v-cloak]{ |
| | | display: none; |
| | | } |
| | | </style> |
| | | |
| | | .big-item { |
| | | width: 3.35rem; |
| | | height: 0.80rem; |
| | | line-height: 0.8rem; |
| | | background: #FFFFFF; |
| | | border-radius: 0.2rem; |
| | | padding-left: 0.2rem; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .record-item { |
| | | width: 6.90rem; |
| | | height: 1.00rem; |
| | | line-height: 1.00rem; |
| | | background: #FFFFFF; |
| | | border-radius: 0.15rem; |
| | | box-sizing: border-box; |
| | | padding-left: 0.2rem; |
| | | padding-right: 0.3rem; |
| | | font-size: 0.30rem; |
| | | color: #FF0A48; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-top: 0.2rem; |
| | | margin-bottom: 0.1rem; |
| | | } |
| | | |
| | | .record-item .icon { |
| | | width: 0.61rem; |
| | | height: 0.61rem; |
| | | margin-right: 0.2rem; |
| | | } |
| | | |
| | | .record-item .input { |
| | | width: 0.15rem; |
| | | height: 0.3rem; |
| | | } |
| | | |
| | | .record-item div { |
| | | display: flex; |
| | | line-height: 1.00rem; |
| | | align-items: center; |
| | | } |
| | | </style> |
| | | |
| | | <style> |
| | | /* 新增样式:底部菜单 */ |
| | | |
| | | .footer-menu { |
| | | position: fixed; |
| | | bottom: 0; |
| | |
| | | } |
| | | |
| | | .menu-item.active { |
| | | color: #000; |
| | | color: #FF3949; |
| | | } |
| | | |
| | | .menu-icon { |
| | |
| | | |
| | | <body> |
| | | <div id="app"> |
| | | <div class="exchange-container"> |
| | | <div class="balance" v-cloak><span style=" color:black;">当前积分余额: </span>{{ creditBalance }}</div> |
| | | <img style="position: absolute; z-index: 0;top: 0; width: 7.5rem;height: 6rem;" src="../img/credit_top.png" /> |
| | | <div class="exchange-container" style="position: absolute;top: 0;"> |
| | | <div style="display: flex;justify-content: space-between;"> |
| | | <div class="balance big-item" v-cloak><span>当前积分余额: </span>{{ creditBalance }}</div> |
| | | <div class="balance big-item" v-cloak><span>兑换中的积分: </span>{{ exchangingCredits }}</div> |
| | | </div> |
| | | |
| | | <div class="estimated-amount" v-cloak>预计可兑换红包金额: {{ estimatedRedPacketAmount }}元</div> |
| | | <div class="balance" v-cloak><span style=" color:black;">兑换中的积分: </span>{{ exchangingCredits }}</div> |
| | | <div class="exchange-title">积分红包兑换</div> |
| | | |
| | | <div style="margin-top: 0.3rem; background: white;border-radius: 0.2rem; display: flex;align-items: center;flex-direction: column;padding: 0.4rem 0.3rem;"> |
| | | |
| | | <img src="../img/credit_exchange_title.png" style="width: 3.13rem;height: 0.41rem;" /> |
| | | <div class="exchange-input"> |
| | | <input type="number" v-model="exchangePoints" placeholder="请输入兑换积分"/> |
| | | <button class="btn" @click="exchangePointsToRedPacket">兑换</button> |
| | | |
| | | </div> |
| | | |
| | | <button class="btn" @click="exchangePointsToRedPacket">兑换</button> |
| | | |
| | | </div> |
| | | |
| | | <div class="links-container"> |
| | | <a href="alipay_account_setting.html">绑定支付宝</a> |
| | | <a href="credit_records.html">查看积分记录</a> |
| | | <a href="exchange_records.html">查看兑换记录</a> |
| | | <div class="record-item" @click="jump_to('alipay_account_setting.html')"> |
| | | <div> |
| | | <img class="icon" src="../img/icon_credit_record_alipay.png" /> |
| | | <span>绑定支付宝</span> |
| | | </div> |
| | | <img class="input" src="../img/icon_credit_record_input.png" /> |
| | | </div> |
| | | |
| | | <div class="record-item" @click="jump_to('credit_records.html')"> |
| | | <div> |
| | | <img class="icon" src="../img/icon_credit_record_credit.png" /> |
| | | <span>查看积分记录</span> |
| | | </div> |
| | | <img class="input" src="../img/icon_credit_record_input.png" /> |
| | | </div> |
| | | |
| | | <div class="record-item" @click="jump_to('exchange_records.html')"> |
| | | <div> |
| | | <img class="icon" src="../img/icon_credit_record_exchange.png" /> |
| | | <span>查看兑换记录</span> |
| | | </div> |
| | | <img class="input" src="../img/icon_credit_record_input.png" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <span>口令</span> |
| | | </a> |
| | | <a href="/credit/index.html" class="menu-item active"> |
| | | <img src="../img/credit_fill.png" alt="积分" class="menu-icon"> |
| | | <img src="../img/icon_credit_highlight.png" alt="积分" class="menu-icon"> |
| | | <span>积分</span> |
| | | </a> |
| | | </div> |
| | | |
| | | |
| | | <script src="../js/jquery.min.js"></script> |
| | | <script src="../js/vue.min.js"></script> |
| | |
| | | layer.close(index); |
| | | layer.msg("网络请求失败"); |
| | | }); |
| | | |
| | | |
| | | }, |
| | | exchangePointsToRedPacket() { |
| | | // 校验输入的积分值是否为正整数 |
| | |
| | | } |
| | | let index = layer.load(); |
| | | // 调用API进行积分兑换 |
| | | http.post('/credit/api/exchange', {"credits":points}, function(response){ |
| | | http.post('/credit/api/exchange', { |
| | | "credits": points |
| | | }, function(response) { |
| | | layer.close(index); |
| | | if(response.code===0){ |
| | | layer.msg("提交成功,等待审核"); |
| | |
| | | }else{ |
| | | layer.msg(response.msg); |
| | | } |
| | | |
| | | },function (){ |
| | | layer.close(index); |
| | | layer.msg("网络请求失败"); |
| | | }); |
| | | }, |
| | | jump_to:function(url){ |
| | | window.location.href = url; |
| | | |
| | | } |
| | | } |
| | | }); |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |