Browse Source

好友列表-有好友

dujingxian 4 years ago
parent
commit
35aefb1f02
1 changed files with 65 additions and 27 deletions
  1. 65 27
      src/views/user/inviter.vue

+ 65 - 27
src/views/user/inviter.vue

@@ -51,7 +51,7 @@
                         <li  v-for="item in data.list">
                             <p class="ni">{{item.nickname}}</p>
                             <p class="yao">邀请时间: {{item.time}}</p>
-                            <span class="span-right"> {{item.status}} </span>
+                            <span class="span-right" :style="{color:item.status == '已消费' ? '#D92B2B' : '#1AB475'}"> {{item.status}} </span>
                         </li>
                     </ul>
                     <!-- <img class="no-info" src="../../assets/image/no-info_03.png" alt="" v-show="data.imgShow"> -->
@@ -71,14 +71,24 @@
                         <img class="ziti-1" src="../../assets/image/invitation_14@2x.png" alt="">
                     </div>
                      <div class="haoyou">
-                         <ul class="list" >
+                         <!-- <ul class="list" >
                              <li v-for="item in data.yaolist">
                                  <p class="ni">{{item.nickname}}</p>
                                  <p class="yao">缴费{{item.count}}次</p>
                                  <span class="span-right">{{item.price}}元</span>
                              </li>
-                         </ul>
-                         <img class="no-info" src="../../assets/image/no-info_03@2x.png" alt="" v-show="data.imgSho">
+                         </ul> -->
+                        <ul class="list" >
+                            <li v-for="item in data.couponList">
+                                <p class="ni">{{item.type}}{{item.price}}元</p>
+                                <p class="yao">获取时间: {{item.time}}</p>
+                                <span v-if="item.status == 0" class="span-right" :style="{color:item.status == 0 ? '#1AB475' : '#D92B2B'}">未使用</span>
+                                <span v-if="item.status == 1" class="span-right" :style="{color:item.status == 0 ? '#1AB475' : '#D92B2B'}">已使用</span>
+                                <span v-if="item.status == 2" class="span-right" :style="{color:item.status == 0 ? '#1AB475' : '#D92B2B'}">已过期</span>
+                                <span v-if="item.status == 3" class="span-right" :style="{color:item.status == 0 ? '#1AB475' : '#D92B2B'}">已锁定</span>
+                            </li>
+                        </ul>
+                        <img class="no-info" src="../../assets/image/no-info_03@2x.png" alt="" v-show="data.cueShow">
                      </div>
 
              </div>
@@ -101,7 +111,10 @@
             isChildUpdate2:true,
             imgShow:true,
             imgShows:true,
-            imgSho:true
+            imgSho:true,
+            // 优惠券
+            couponList:[],
+            cueShow:false,
         };
           async created(){
               console.log('2222222222')
@@ -138,21 +151,36 @@
                   });
               });
 
-              let rres = await Http.getInstance().getInvitationawardList();
-              console.log(rres)
-              if(rres.data.length == 0){
-                  this.data.imgSho = true
+            //   let rres = await Http.getInstance().getInvitationawardList();
+            //   console.log(rres)
+            //   if(rres.data.length == 0){
+            //       this.data.imgSho = true
 
-              }else {
-                  this.data.imgSho = false
-              }
-              rres.data.forEach((item: any) => {
-                  this.data.yaolist.push({
-                      count: item.count,
-                      nickname: item.realname,
-                      price: item.sum
-                  });
-              });
+            //   }else {
+            //       this.data.imgSho = false
+            //   }
+            //   rres.data.forEach((item: any) => {
+            //       this.data.yaolist.push({
+            //           count: item.count,
+            //           nickname: item.realname,
+            //           price: item.sum
+            //       });
+            //   });
+
+            // 优惠券列表
+            let couponRes = await Http.getInstance().getDisCounts();
+            console.log('优惠券', couponRes)
+            couponRes.data.forEach((item: any) => {
+                this.data.couponList.push({
+                    time: item.created_at,
+                    type: item.type,
+                    price: item.money,
+                    status: item.status,
+                });
+            });
+            if(couponRes.data.length == 0){
+                this.data.cueShow = true
+            }
 
 
           }
@@ -226,7 +254,7 @@
     .table-div{
         background: white;
         // margin: 5rem 1.5rem;
-        margin: 0rem 2.5rem;
+        margin: 0rem 2rem;
         // border-radius: 5px;
         // padding-bottom: 8rem;
         padding: 2rem 0;
@@ -266,28 +294,38 @@
         .list{
             list-style: none;
             font-size: 1.3rem;
-            margin-left: -1.5rem;
+            // margin-left: -1.5rem;
             margin-top: 2rem;
+            padding: 0 2rem;
             li{
                 position: relative;
-                padding-top: 1rem;
+                // padding-top: 1rem;
+                padding-top: 2rem;
                 margin-right: 1rem;
-                border-bottom: 1px dashed #8fe9af;
+                // border-bottom: 1px dashed #8fe9af;
+                border-bottom: 1px solid #ccc;
                 .ni{
                     line-height: 1rem;
                 }
                 .yao{
-                    color: #999999;
+                    // color: #999999;
                     line-height: 2.2rem;
+                    color: #666;
+                    font-size: 1.2rem;
                 }
                 .span-right{
                     position: absolute;
-                    right: 1rem;
-                    top: 1rem;
-                    color: #04b954;
+                    // right: 1rem;
+                    right: 0;
+                    // top: 1rem;
+                    top: 2.5rem;
+                    font-size: 1.2rem;
                 }
             }
         }
+        .list li:last-child {
+            border-bottom: 0;
+        }
 
     }
  .no-info{