shish 11 месяцев назад
Родитель
Сommit
04beb5e410

+ 4 - 0
hdPad/src/api/custom/index.js

@@ -35,4 +35,8 @@ export const debtChangeList = data => {
 
 export const getBalanceChangeList = data => {
 	return https.get('/balance-change/list', data)
+}
+
+export const modifyBirthday = data => {
+	return https.get('/custom/modify-birthday', data)
 }

+ 14 - 26
hdPad/src/pages/home/components/birthdayEdit.vue

@@ -69,13 +69,14 @@
         
         <!-- 操作按钮 -->
         <div class="birthday-actions">
-            <button class="birthday-action-btn save-btn" @click="saveBirthday">保存</button>
             <button class="birthday-action-btn cancel-btn" @click="cancelBirthday">取消</button>
+            <button class="birthday-action-btn save-btn" @click="saveBirthday">保存</button>
         </div>
     </div>
 </template>
 
 <script>
+import { modifyBirthday } from "@/api/custom"
 export default {
     name: "birthdayEdit",
     props: {
@@ -109,6 +110,9 @@ export default {
         this.updateDateArray()
     },
     methods: {
+        showBirth(info){
+            console.log(info)
+        },
         // 获取客户生日信息
         getCustomBirthday() {
             if (!this.customId) {
@@ -152,31 +156,15 @@ export default {
             if (!this.customId) return
             
             const params = {
-                id: this.customId,
+                customId: this.customId,
                 birthdayType: this.birthdayType,
                 birthdayMonth: this.birthdayMonth,
                 birthdayDate: this.birthdayDate
             }
-            
-            // 调用API保存生日信息
-            this.$api.member.updateCustomBirthday(params).then(res => {
-                if (res.code === 0) {
-                    uni.showToast({
-                        title: '生日修改成功',
-                        icon: 'success'
-                    })
-                    this.$emit('save-success')
-                } else {
-                    uni.showToast({
-                        title: res.msg || '保存失败',
-                        icon: 'none'
-                    })
+            modifyBirthday(params).then(res=>{
+                if(res.code == 1){
+                    this.$msg('修改成功')
                 }
-            }).catch(err => {
-                uni.showToast({
-                    title: '保存失败',
-                    icon: 'none'
-                })
             })
         },
         // 取消修改
@@ -223,7 +211,7 @@ export default {
 .type-buttons {
     display: flex;
     gap: 8px;
-    
+    justify-content: space-around;
     .birthday-type-btn {
         min-width: 50px;
         height: 30px;
@@ -232,9 +220,9 @@ export default {
         border: 1px solid #dddddd;
         background-color: #F5F5F5;
         color: #333;
-        text-align: center;
-        line-height: 1;
-        padding: 10px;
+        display: flex;
+        align-items: center;
+        justify-content: center;
         margin: 0;
         
         &.active {
@@ -363,7 +351,7 @@ export default {
 
 .birthday-actions {
     display: flex;
-    justify-content: center;
+    justify-content: space-around;
     gap: 8px;
     margin-top: 10px;
     

+ 1 - 1
hdPad/src/pages/home/components/customInfo.vue

@@ -136,7 +136,7 @@ export default {
 	},
   methods:{
     changeBirthday() {
-      this.$emit('changeBirthday')
+      this.$emit('changeBirthday',this.customInfo)
     },
     getCustomDetail(id){
       getDetail({userId:id}).then(res=>{

+ 7 - 27
hdPad/src/pages/home/custom.vue

@@ -15,15 +15,9 @@
             <view class="custom-asset" v-if="showIndex == 1">
                 <balanceChange ref="balanceChangeRef" :customId="selectCustomId"></balanceChange>
             </view>
-
             <view class="custom-asset" v-if="showIndex == 2">
-                <birthdayEdit 
-                    :customId="selectCustomId" 
-                    @save-success="handleBirthdaySaveSuccess" 
-                    @cancel="handleBirthdayCancel">
-                </birthdayEdit>
+                <birthdayEdit ref="birthRef" :customId="selectCustomId"></birthdayEdit>
             </view>
-
         </view>
     </view>
 </view>
@@ -54,22 +48,16 @@ export default {
     watch: {
     },
     methods: {
-        changeBirthday(){
+        changeBirthday(info){
             this.showIndex = 2
-        },
-        // 处理生日保存成功
-        handleBirthdaySaveSuccess() {
-            this.showIndex = 0
-            // 刷新客户信息
-            this.$refs.customInforRef.getCustomDetail(this.selectCustomId)
-        },
-        // 处理生日取消修改
-        handleBirthdayCancel() {
-            this.showIndex = 0
+            this.$nextTick(() => {
+                if (this.$refs.birthRef) {
+                    this.$refs.birthRef.showBirth(info)
+                }
+            })
         },
         goBalance(){
             this.showIndex = 1
-            // 确保组件已经渲染后再调用refresh方法
             this.$nextTick(() => {
                 if (this.$refs.balanceChangeRef) {
                     this.$refs.balanceChangeRef.refresh()
@@ -89,8 +77,6 @@ export default {
                 })
                 return
             }
-            // 处理充值操作
-            console.log('充值操作', this.selectCustomId)
         },
         handleReduceBalance() {
             if (!this.selectCustomId) {
@@ -100,8 +86,6 @@ export default {
                 })
                 return
             }
-            // 处理减余额操作
-            console.log('减余额操作', this.selectCustomId)
         },
         handleUpgradeDowngrade() {
             if (!this.selectCustomId) {
@@ -111,8 +95,6 @@ export default {
                 })
                 return
             }
-            // 处理升降级操作
-            console.log('升降级操作', this.selectCustomId)
         },
         handleCreateOrder() {
             if (!this.selectCustomId) {
@@ -122,8 +104,6 @@ export default {
                 })
                 return
             }
-            // 处理开单操作
-            console.log('开单操作', this.selectCustomId)
         }
     }
 };