谢立 пре 4 година
родитељ
комит
86f1060e74

+ 3 - 4
src/apps/mobile/api/expert/index.js

@@ -179,16 +179,15 @@ export function sendRedEnvelopes(redEncelopId, userId) {
     });
 }
 
-// 批量发红包
-export function batchSendRedEnvelopes(data) {
+// 批量发红包 type: 1.红包 2.卡券
+export function batchSendRedEnvelopes(data, type) {
     return request({
         method: 'post',
-        url: `/api/userInfos/batchSendRedEnvelope`,
+        url: type == 1 ? `/api/userInfos/batchSendRedEnvelope` : `/api/userInfos/batchSendEnvelope`,
         data
     });
 }
 
-
 // 惩罚
 export function punishment(money, userId) {
     return request({

+ 7 - 3
src/apps/mobile/views/operation-bank/user/components/redEnvelopes.vue

@@ -47,16 +47,20 @@ export default {
                         redElvelopId: this.ruleForm.redElvelopId,
                         userList: this.ids,
                     };
-                    batchSendRedEnvelopes(data)
+                    let type = this.labelText == '红包' ? 1 : 2
+                    batchSendRedEnvelopes(data, type)
                         .then((res) => {
                             if(res.statusCode == 0){
-                                this.completeOperation(res.message);
+                                this.$message.error(res.message);
+                                this.submitBtndisabled = false;
                             }else if(res.statusCode == 1){
                                 let message = '发放成功';
                                 this.completeOperation(message);
                             }
                         })
-                        .catch();
+                        .catch(()=>{
+                            this.submitBtndisabled = false;
+                        });
                 } else {
                     return false;
                 }