Ver código fonte

1. mallApp - rechargeResult.vue 充值成功了,如果没有设置生日,需要有入口设置生日 2. hdApp - 开启了vip会员时,不是vip会员的不显示member图标(删除vip标签、新增开启会员按钮)

shizhongqi 3 meses atrás
pai
commit
3479a083cd

+ 20 - 22
hdApp/src/admin/home/member.vue

@@ -24,8 +24,16 @@
                 <view class="user-info">
                   <view class="user-main">
                     <view class="user-name">{{item.name}}</view>
-                    <view v-if="item.vip && Number(item.vip) == 1" class="vip-tag">VIP</view>
-                    <view class="right-info">
+                    <view v-if="useVip" class="right-info">
+                      <view v-if="item.vip && Number(item.vip) == 1 && !$util.isEmpty(item.memberName)" class="member-icon">
+                        <image v-if="item.member == 1" class="member-badge-icon" style="width:58upx;height:58upx;margin-top:17upx;" src="@/static/member-icons/member-1.svg" mode="aspectFit"></image>
+                        <image v-else-if="item.member == 2" class="member-badge-icon" style="width:56upx;height:56upx;margin-top:17upx;" src="@/static/member-icons/member-2.svg" mode="aspectFit"></image>
+                        <image v-else-if="item.member == 3" class="member-badge-icon" style="width:55upx;height:55upx;margin-top:17upx;" src="@/static/member-icons/member-3.svg" mode="aspectFit"></image>
+                        <image v-else-if="item.member == 4" class="member-badge-icon" style="width:64upx;height:64upx;margin-top:17upx;" src="@/static/member-icons/member-4.svg" mode="aspectFit"></image>
+                        <image v-else-if="item.member == 5" class="member-badge-icon" style="width:59upx;height:59upx;margin-top:17upx;" src="@/static/member-icons/member-5.svg" mode="aspectFit"></image>
+                      </view>
+                    </view>
+                    <view v-else class="right-info">
                       <view v-if="!$util.isEmpty(item.memberName)" class="member-icon">
                         <image v-if="item.member == 1" class="member-badge-icon" style="width:58upx;height:58upx;margin-top:17upx;" src="@/static/member-icons/member-1.svg" mode="aspectFit"></image>
                         <image v-else-if="item.member == 2" class="member-badge-icon" style="width:56upx;height:56upx;margin-top:17upx;" src="@/static/member-icons/member-2.svg" mode="aspectFit"></image>
@@ -131,6 +139,7 @@ export default {
       searchStyle:0,
       searchText:'',
       lastSearchText:'',
+      useVip: false, // 是否启用会员
     };
   },
   onPullDownRefresh() {
@@ -150,10 +159,11 @@ export default {
   },
   onShow() {
     const reachVip = uni.getStorageSync('reachVip')
-    console.log(reachVip)
-    if (this.tabs.length < 6 && reachVip != "-1.00") {
-      // tabs 第二位加上 {name: 'VIP', value: 1, type: 5}
-      this.tabs.splice(1, 0, {name: '会员', value: 0, type: 5})
+    
+    if (reachVip != "0.00") {
+      this.useVip = true
+    } else {
+      this.useVip = false
     }
   },
   methods: {
@@ -200,6 +210,10 @@ export default {
       return getList({page:this.list.page,type:this.customType,searchText:this.searchText,searchStyle:this.searchStyle }).then(res => {
         if(res.code == 1){
           this.completes(res)
+          const vipCount = Number(res.data.vip) || 0
+          if (vipCount > 0 && !this.tabs.some(item => item.type == 5)) {
+            this.tabs.splice(1, 0, {name: '会员', value: 1, type: 5})
+          }
           
           for(let i = 0; i < this.tabs.length; i++){
             if(this.tabs[i].type == 0){
@@ -328,22 +342,6 @@ export default {
     max-width: calc(100% - 60upx);
   }
 
-  .vip-tag {
-    flex-shrink: 0;
-    display: inline-flex;
-    align-items: center;
-    justify-content: center;
-    height: 40upx;
-    padding: 0 18upx;
-    background-color: rgba(58, 218, 9, 0.76);
-    color: #fff;
-    font-size: 24upx;
-    font-weight: bold;
-    border-radius: 20upx;
-    line-height: 1;
-    white-space: nowrap;
-  }
-
   .right-info {
     position: absolute;
     right: 50upx;

+ 15 - 31
hdApp/src/admin/member/detail.vue

@@ -10,11 +10,6 @@
             <view class="user-name-row" @click="changeNameFn()">
               <text class="user-name">{{ data.name }}</text> 
               <i class="iconfont iconbianji edit-icon"></i>
-              <view
-                v-if="Number(data.vip) == 1"
-                class="vip-tag vip-active"
-                @click.stop="openVipPopup"
-              >{{ Number(data.vip) == 1 ? 'VIP' : '非VIP' }}</view>
             </view>
             <view class="user-detail-info">
               <text class="user-real-name">{{ data.originName }}</text>
@@ -22,7 +17,7 @@
             </view>
           </view>
 
-          <view class="member-level-badge" v-if="Number(data.member)>0">
+          <view class="member-level-badge" v-if="((useVip == true && Number(data.vip) == 1) || (useVip == false)) && Number(data.member)>0">
             <view class="member-badge-row" @click.stop="openVipPopup">
               <image v-if="data.member == 1" class="member-badge-icon" style="width:76upx;height:76upx;" src="@/static/member-icons/member-1.svg" mode="aspectFit"></image>
               <image v-else-if="data.member == 2" class="member-badge-icon" style="width:74upx;height:74upx;" src="@/static/member-icons/member-2.svg" mode="aspectFit"></image>
@@ -32,6 +27,9 @@
               <text class="member-name">{{ data.memberName }}</text>
             </view>
           </view>
+          <view v-else-if="useVip == true && Number(data.vip) == 0">
+            <button class="admin-button-com middle" @click="openVipPopup">开启会员</button>
+          </view>
         </view>
       </view>
       <view class="user-bottom">
@@ -426,11 +424,11 @@
       </template>
     </modal-module>
 
-    <modal-module :show="vipModal" @click="vipModalClick" :maskClosable="false" title="VIP设置" padding="28rpx 28rpx" >
+    <modal-module :show="vipModal" @click="vipModalClick" :maskClosable="false" title="会员设置" padding="28rpx 28rpx" >
       <template v-slot:content>
         <view class="app-modal-input-wrap">
           <view class="vip-switch-row">
-            <text class="vip-switch-label">{{ vipForm.vip == 1 ? 'VIP' : '非VIP' }}</text>
+            <text class="vip-switch-label">{{ vipForm.vip == 1 ? '会员' : '非会员' }}</text>
             <switch
               style="transform:scale(0.7,0.7)"
               :checked="vipForm.vip == 1"
@@ -587,6 +585,7 @@ export default {
       showBalanceDetail: false,
       memberLevelSet:0,
       memberLevelData:[],
+      useVip: false, // 是否启用会员
       vipModal: false,
       vipForm: {
         vip: 0
@@ -606,6 +605,13 @@ export default {
   },
   onShow(){
     this.initInfo()
+
+    const reachVip = uni.getStorageSync('reachVip')
+    if (reachVip != "0.00") {
+      this.useVip = true
+    } else {
+      this.useVip = false
+    }
   },
   methods: {
     init(){},
@@ -1006,28 +1012,6 @@ export default {
             color: #999;
           }
 
-          .vip-tag {
-            position: relative;
-            right: 0;
-            top: 12upx;
-            flex-shrink: 0;
-            display: inline-flex;
-            align-items: center;
-            justify-content: center;
-            height: 40upx;
-            padding: 0 18upx;
-            color: #fff;
-            font-size: 24upx;
-            font-weight: bold;
-            border-radius: 20upx;
-            line-height: 1;
-            white-space: nowrap;
-            margin-left: auto;
-
-            &.vip-active {
-              background-color: rgba(58, 218, 9, 0.76);
-            }
-          }
         }
         
         .user-detail-info {
@@ -1333,7 +1317,7 @@ export default {
     display: flex;
     align-items: center;
     justify-content: center;
-    padding: 30upx 20upx;
+    padding: 25upx 20upx;
 
     .vip-switch-label {
       font-size: 32upx;

+ 52 - 1
mallApp/src/pages/member/rechargeResult.vue

@@ -19,12 +19,26 @@
             </view>
           </view>
 
+          <view v-if="birthdayTime == 0" class="birthday-edit-section">
+            <view class="section-label">填写生日,有机会领取生日礼品</view>
+            <view class="input-group">
+              <button class="edit-btn" @click="modifyBirthday">填写</button>
+            </view>
+          </view>
+
           <view class="confirm-btn-wrap">
             <button v-if="itemType == 'hb'" class="confirm-btn btn-primary" @click="myHb">我的红包</button>
             <button class="confirm-btn" @click="goBack">返回</button>
           </view>
         </view>
         <view class="pay-confirm-content" v-else>
+          <view v-if="birthdayTime == 0" class="birthday-edit-section">
+            <view class="section-label">填写生日,有机会领取生日礼品</view>
+            <view class="input-group">
+              <button class="edit-btn" @click="modifyBirthday">填写</button>
+            </view>
+          </view>
+
           <view class="confirm-btn-wrap">
             <button class="confirm-btn" @click="goBack" style="width:230upx;">返回</button>
           </view>
@@ -47,7 +61,8 @@ export default {
       form:{
         name:''
       },
-      userName:''
+      userName:'',
+      birthdayTime: 0
     }
   },
   onLoad(){
@@ -75,6 +90,7 @@ export default {
         if(res.code == 1){
           this.form.name = res.data.info && res.data.info.name ? res.data.info.name : ''
           this.userName = this.form.name
+          this.birthdayTime = res.data.info && res.data.info.birthdayTime ? res.data.info.birthdayTime : 0
         }
       })
     },
@@ -118,6 +134,9 @@ export default {
     },
     goBack(){
       uni.navigateBack()
+    },
+    modifyBirthday(){
+      this.pageTo({url:"/pages/user/edit"})
     }
   },
 };
@@ -235,6 +254,38 @@ export default {
       }
     }
   }
+
+  .birthday-edit-section {
+    margin-bottom:60upx;
+    background-color: #fafafa;
+    padding: 30upx;
+    border-radius: 12upx;
+    
+    .section-label {
+      font-size: 30upx;
+      color: #535353;
+      font-weight:bold;
+      margin-bottom: 20upx;
+      line-height: 1.5;
+    }
+
+    .edit-btn {
+        height: 60upx;
+        width: 120upx;
+        padding: 0 30upx;
+        background-color: #3385ff;
+        color: #ffffff;
+        border: none;
+        border-radius: 10upx;
+        font-size: 26upx;
+        font-weight: 600;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        white-space: nowrap;
+      }
+    
+  }
   
   .confirm-btn-wrap {
     display: flex;