123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta content="yes" name="apple-mobile-web-app-capable">
- <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no">
- <title>邀请记录</title>
- <style type="text/css">
- body,html{
- font-size: 0.16rem;
- }
- body, div, button, h3, h6, span, ul, li, p, a, input{
- font-family: -apple-system,SF UI Text,Helvetica Neue,Helvetica,Arial,sans-serif;
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
- padding: 0;
- margin: 0;
- box-sizing: inherit;
- font-weight: normal;
- }
- button{
- outline: none;
- }
- a, a:visited{
- text-decoration: none;
- }
- body{
- width: 100%;
- }
- .recordEmpty{
- padding-top: 1.13rem;
- display: none;
- }
- .recordEmpty img{
- width: 1.3rem;
- height: 1.14rem;
- display: block;
- margin: auto;
- }
- .recordEmpty p{
- color: #999999;
- font-size: 0.12rem;
- line-height: 0.17rem;
- margin-top: 0.41rem;
- text-align: center;
- }
- .header,.friend{
- width: 3.39rem;
- margin: auto;
- font-size: 0.14rem;
- color: #333333;
- white-space: nowrap;
- }
- .header{
- border-bottom: 0.01rem solid #D8D8D8;
- }
- .header div,.friend div{
- width: 33.3%;
- text-align: center;
- display: inline-block;
- }
- .header div{
- line-height: 0.5rem;
- font-weight: bold;
- }
- .friend{
- margin-top:0.28rem;
- }
- .friend:nth-of-type(1){
- margin-top: 0.24rem;
- }
- .friend div:nth-of-type(3){
- color: #FFC600;
- font-size: 0.2rem;
- }
- </style>
- </head>
- <body>
- <div class="recordEmpty">
- <img src="../H5/noFriend.png" />
- <p>您还没有邀请记录,赶紧邀请小伙伴一起记账吧~</p>
- </div>
- <div class="recordYes"></div>
- </body>
- </html>
- <script type="text/javascript" src="../jquery-2.1.0.js"></script>
- <script type="text/javascript">
- document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
- window.onresize = function(){
- document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
- }
- var arr = [];
- var userId = null;
- var activity_id = null;
- userId = JSON.parse(localStorage.getItem('userId'));
- activity_id = JSON.parse(localStorage.getItem('activity_id'));
-
-
-
- //页面加载,显示数据
- window.onload = function () {
- getInviteList()
- }
-
- function invitation () {
- var html = `<div class="header">
- <div>好友</div>
- <div>注册时间</div>
- <div>奖励</div>
- </div>`;
- //有邀请记录
- for( var i = 0 ; i < arr.length ; i++){
- html+=`<div class="friend">
- <div>${arr[i].mobile}</div>
- <div>${arr[i].created_at}</div>
- <div>+${arr[i].score}</div>
- </div>`;
- };
- $('.recordYes').html(html);
- }
- function getInviteList () {
- $.ajax({
- type:"post",
- url:"/api/V1/getInviteList",
- data:{
- activity_id:activity_id,
- user_id:userId
- },
- success: function (res) {
- if(JSON.parse(res).res == null){
- $(".recordEmpty").css('display','block');
- $(".recordYes").css("display","none");
- }else{
- $(".recordEmpty").css('display','none');
- $(".recordYes").css("display","block");
- arr = JSON.parse(res).res;
- invitation();
- }
- }
- });
- }
- </script>
|