shish 1 год назад
Родитель
Сommit
a55962c745

+ 1 - 0
hdApp/src/admin/home/member.vue

@@ -32,6 +32,7 @@
                       </span>
                     </span>
                     <text v-if="!$util.isEmpty(item.memberName)" style="color:#3385FF;font-weight:bold;margin-left:20upx;">{{ item.memberName }}</text>
+                    <text v-if="Number(item.balance)>0" style="color:#3385FF;font-weight:bold;margin-left:20upx;">¥{{ parseFloat(item.balance) }}</text>
                   </div>
                 </div>
               </div>

+ 48 - 5
hdApp/src/admin/member/detail.vue

@@ -258,13 +258,30 @@
 
     <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>
 	  </uni-popup>
 
+		<modal-module :show="reduceShow" @click="confirmDeduct" :maskClosable="true" title="请输入金额" padding="30rpx 30rpx" >
+      <template v-slot:content>
+        <div class="app-modal-input-wrap">
+        <div class="inp-list-line">
+          <div class="line-input">
+            <input type="digit" style="width:60%;text-align:center;" v-model="deductAmount" class="inp-input" />
+          </div>
+        </div>
+        <div class="inp-list-line">
+          <div class="line-input">
+          <input type="text" style="width:60%;text-align:center;" v-model="deductRemark" class="inp-input" />
+          </div>
+			  </div>
+
+        <view style="font-size:32upx;font-weight:bold;width:80%;margin:0 auto;">余额减少后,不会自动降等级,如需要请手动给客户降级</view>
+        </div>
+      </template>
+		</modal-module>
+
   </div>
 </template>
 
@@ -279,6 +296,7 @@ import { getUserDet, remarkAdd, remarkDel, upgrade, resetPassword } from "@/api/
 import { changeName,changeMemberLevel } from "@/api/custom"
 import { getWeal } from "@/api/member"
 import {toManRecharge} from "@/api/recharge"
+import {deductBalance} from "@/api/deduct"
 export default {
   name: "detail",
   components: {
@@ -317,10 +335,12 @@ export default {
           }
         },
         {
-          name: "老带新",
-          img: `${this.$constant.imgUrl}/retail/member/tab-icon-2.png`,
+          name: "减少余额",
+          img: `${this.$constant.imgUrl}/retail/member/tab-icon-6.png`,
           funtion: () => {
-            this.$msg("开发中");
+            this.deductAmount = ''
+            this.deductRemark = ''
+            this.reduceShow = true
           }
         },
         {
@@ -347,6 +367,8 @@ export default {
       promptRemarkModal: false,
       promptModalText: "是否要删除该备注?",
       customName:'',
+      deductAmount:'',
+      deductRemark:'',
       changeShow:false,
       changeFocus:false,
       weal:[],
@@ -356,6 +378,7 @@ export default {
         rechargeRemark:'',
         rechargePayWay:0,
       },
+      reduceShow:false
     };
   },
   computed: {
@@ -373,6 +396,26 @@ export default {
     this.init()
   },
   methods: {
+    confirmDeduct(val){
+			if (val.index == 0) {
+        this.deductAmount = ''
+        this.deductRemark = ''
+        this.reduceShow = false
+				return
+			}
+      if(Number(this.deductAmount)<0){
+        this.$msg('金额要大于0')
+        return false
+      }
+      deductBalance({amount:this.deductAmount,customId:this.data.id,remark:this.deductRemark}).then(res=>{
+        if(res.code == 1){
+          this.deductAmount = ''
+          this.deductRemark = ''
+          this.reduceShow = false
+          this.$msg(res.msg)
+        }
+      })
+    },
     beginModifyMember(){
 			this.$refs.memeberChangeRef.open('top')
     },

+ 5 - 0
hdApp/src/api/deduct/index.js

@@ -0,0 +1,5 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const deductBalance = data => {
+	return https.post('/deduct/deduct-amount', data)
+}