shish 11 месяцев назад
Родитель
Сommit
110aec627c
1 измененных файлов с 14 добавлено и 33 удалено
  1. 14 33
      hdApp/src/admin/member/detail.vue

+ 14 - 33
hdApp/src/admin/member/detail.vue

@@ -84,10 +84,10 @@
           <view class="contact-row">
             <text class="contact-label">生日</text>
             <text class="contact-value" v-if="Number(data.birthdayMonth)>0">
-              {{ data.lunar==1?"农历 ":"" }}{{ data.birthdayMonth }}月{{ data.birthdayDate }}日 <text @click="modifyBirthday()" style="color:#007aff;margin-left:10upx;">修改</text>
+              {{ data.lunar==1?"农历 ":"" }}{{ data.birthdayMonth }}月{{ data.birthdayDate }}日 <text @click="modifyBirthday()" style="color:#007aff;margin-left:20upx;">修改</text>
             </text>
             <text class="contact-value" v-else>
-              <text style="color:#007aff;" @click="modifyBirthday()">填写</text>
+              <text style="color:#007aff;" @click="modifyBirthday()">设置</text>
             </text>
           </view>
 
@@ -381,7 +381,7 @@
                <div class="section-title">月份</div>
                <div class="month-buttons">
                  <button 
-                   v-for="month in 12" 
+                   v-for="(month, index) in [1,2,3,4,5,6,7,8,9,10,11,12]" 
                    :key="'month-'+month" 
                    class="month-button" 
                    :class="{ active: birthdayMonth == month }"
@@ -503,7 +503,7 @@ import ModalModule from "@/components/plugin/modal";
 import { getLevel } from "@/utils/config";
 import TuiListCell from "@/components/plugin/list-cell";
 import { getUserDet, remarkAdd, remarkDel, upgrade, resetPassword } from "@/api/member";
-import { changeName,changeMemberLevel } from "@/api/custom"
+import { changeName,changeMemberLevel,modifyBirthday } from "@/api/custom"
 import { getWeal } from "@/api/member"
 import {toManRecharge} from "@/api/recharge"
 import {deductBalance} from "@/api/deduct"
@@ -533,8 +533,6 @@ export default {
       birthdayType: 0, // 0阳历 1农历
       birthdayMonth: '', // 选择的月份
       birthdayDate: '', // 选择的日期
-      monthArray: Array.from({length: 12}, (_, i) => i + 1), // 1-12的数组
-      monthIndex: 0, // 月份选择器的索引
       dateArray: Array.from({length: 31}, (_, i) => i + 1), // 1-31的数组
       dateIndex: 0, // 日期选择器的索引
       tabsData: [
@@ -878,20 +876,12 @@ export default {
       }
     },
     
-         modifyBirthday() {
+    modifyBirthday() {
       // 初始化生日数据
       this.birthdayType = this.data.lunar || 0;
       this.birthdayMonth = this.data.birthdayMonth || '';
       this.birthdayDate = this.data.birthdayDate || '';
       
-      // 设置月份选择器的索引
-      if (this.birthdayMonth) {
-        this.monthIndex = this.monthArray.findIndex(m => m == this.birthdayMonth);
-        if (this.monthIndex < 0) this.monthIndex = 0;
-      } else {
-        this.monthIndex = 0;
-      }
-      
       // 设置日期选择器的索引
       if (this.birthdayDate) {
         this.dateIndex = this.dateArray.findIndex(d => d == this.birthdayDate);
@@ -903,11 +893,6 @@ export default {
       this.birthdayModal = true;
     },
     
-    onMonthChange(e) {
-      this.monthIndex = e.detail.value;
-      this.birthdayMonth = this.monthArray[this.monthIndex];
-    },
-    
     onDateChange(e) {
       this.dateIndex = e.detail.value;
       this.birthdayDate = this.dateArray[this.dateIndex];
@@ -923,24 +908,20 @@ export default {
           this.$msg('请选择月份和日期');
           return;
         }
-        
         // 保存生日信息
         const params = {
-          id: this.data.id,
+          customId: this.data.id,
           lunar: this.birthdayType,
           birthdayMonth: this.birthdayMonth,
           birthdayDate: this.birthdayDate
-        };
-        
-        // 这里应该调用API保存生日信息
-        // 示例:saveBirthday(params).then(res => {...})
-        
-        // 模拟保存成功
-        this.data.lunar = this.birthdayType;
-        this.data.birthdayMonth = this.birthdayMonth;
-        this.data.birthdayDate = this.birthdayDate;
-        this.$msg('生日设置成功');
-        this.birthdayModal = false;
+        }
+        modifyBirthday(params).then(res=>{
+          if(res.code == 1){
+            this.$msg('修改成功')
+            this.birthdayModal = false
+            this.init()
+          }
+        })
       }
     }
   }