Browse Source

等级设置

shish 10 months ago
parent
commit
cb6df791f5
1 changed files with 24 additions and 49 deletions
  1. 24 49
      hdApp/src/admin/member/detail.vue

+ 24 - 49
hdApp/src/admin/member/detail.vue

@@ -319,28 +319,6 @@
       </template>
     </modal-module>
     
-    <modal-module :show="upgradeModal" @click="upgradeModalClick" :maskClosable="false" title="升级" padding="30rpx 30rpx" >
-      <template v-slot:content>
-        <div class="app-modal-input-wrap">
-          <div class="inp-list-line">
-            <div class="line-label">会员等级</div>
-            <div class="line-input">
-              <picker mode="selector" :value="upgradeForm.member" :range="levelData.list" range-key="level" @change="changeLevelFn" class="inp-select" >
-                <div v-if="upgradeForm.member">{{ levelSelData.level }}</div>
-                <div class="tui-placeholder" v-else>请选择</div>
-              </picker>
-            </div>
-          </div>
-          <div class="inp-list-line">
-            <div class="line-label">确认密码</div>
-            <div class="line-input">
-              <input type="text" v-model="upgradeForm.confirmPassword" class="inp-input" />
-            </div>
-          </div>
-        </div>
-      </template>
-    </modal-module>
-
     <modal-module :show="remarkModal" @click="remarkModalClick" :maskClosable="false" title="添加客户备注" padding="30rpx 30rpx" >
       <template v-slot:content>
         <div class="app-modal-input-wrap">
@@ -433,10 +411,10 @@
 		</modal-module>
 
     <uni-popup ref="memeberChangeRef" background-color="#fff" type="center" :animation="true" class="class-popup-style">
-		<view style="display:flex;width:100vw;padding:20upx 20upx 40upx 20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
-			<view style="width:100vw;margin-top:8upx;" v-for="(item,index) in weal" :key="index"><button @click="modifyMember(item)">{{ item.name }}</button></view>
-			<view style="width:100vw;margin-top:50upx;"><button @click="cancelModifyMember()">取消</button></view>
-		</view>
+      <view style="display:flex;width:100vw;padding:20upx 20upx 40upx 20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
+        <view style="width:100vw;margin-top:8upx;" v-for="(item,index) in memberLevelData" :key="index"><button @click="changeCustomLevel(item)">{{ item.name }}</button></view>
+        <view style="width:100vw;margin-top:50upx;"><button @click="cancelModifyMember()">取消</button></view>
+      </view>
 	  </uni-popup>
 
 		<!-- 减余额弹框 - 使用uni-popup替代 -->
@@ -506,7 +484,7 @@ import { getLevel } from "@/utils/config";
 import TuiListCell from "@/components/plugin/list-cell";
 import { getUserDet, remarkAdd, remarkDel, upgrade, resetPassword } from "@/api/member";
 import { changeName,changeMemberLevel,modifyBirthday } from "@/api/custom"
-import { getWeal } from "@/api/member"
+import { getWeal,getLevelInitData } from "@/api/member"
 import {toManRecharge} from "@/api/recharge"
 import {deductBalance} from "@/api/deduct"
 export default {
@@ -529,7 +507,6 @@ export default {
       rechargeModal: false,
       userTagModal:false,
       passwordModal: false,
-      upgradeModal: false,
       remarkModal: false,
       birthdayModal: false,
       lunar: 0, // 0公历 1农历
@@ -598,8 +575,9 @@ export default {
         rechargePayWay:0,
       },
       rechargeInputFocus: false,
-      showBalanceDetail: false, // 控制余额详情展开/隐藏
-
+      showBalanceDetail: false,
+      memberLevelSet:0,
+      memberLevelData:[]
     };
   },
   computed: {
@@ -612,6 +590,12 @@ export default {
         this.rechargeWeal = res.data.rechargeWeal ? res.data.rechargeWeal : 0
       }
     })
+    getLevelInitData().then(res=>{
+      if(res.code == 1){
+        this.memberLevelSet = res.data.memberLevelSet
+        this.memberLevelData = res.data.member?res.data.member:[]
+      }
+    })
   },
   onShow(){
     this.initInfo()
@@ -678,14 +662,16 @@ export default {
       })
     },
     beginModifyMember(){
-		this.$msg('开发中')
-		return false
-		this.$refs.memeberChangeRef.open('top')
+		  this.$refs.memeberChangeRef.open('top')
     },
     cancelModifyMember(){
       this.$refs.memeberChangeRef.close()
     },
-    modifyMember(item){
+    changeCustomLevel(item){
+      if(this.memberLevelSet == 0){
+        this.$msg('请先设置会员等级')
+        return false
+      }
       changeMemberLevel({customId:this.option.id,level:item.level}).then(res=>{
         if(res.code == 1){
           this.$msg(res.msg)
@@ -822,13 +808,10 @@ export default {
       });
     },
     _remarkAdd() {
-      remarkAdd({
-        userId: this.data.id,
-        ...this.remarkForm
-      }).then(res => {
-        this.$msg("添加成功!");
-        this.getCustomInfo();
-      });
+      remarkAdd({ userId: this.data.id, ...this.remarkForm }).then(res => {
+        this.$msg("添加成功!")
+        this.getCustomInfo()
+      })
     },
     _delRemark() {
       remarkDel({ id: this.remarkOperateData.id }).then(res => {
@@ -857,14 +840,6 @@ export default {
         this.promptRemarkModal = true;
       }
     },
-    upgradeModalClick(e) {
-      if (e.index === 0) {
-
-      } else {
-        this.promptModalText = "确认升级?";
-        this.promptRemarkModal = true;
-      }
-    },
     userTagModalClick(e){
       if (e.index === 0) {