zhb 4 часов назад
Родитель
Сommit
eacdbdc6b7

+ 4 - 0
api/user.ts

@@ -51,4 +51,8 @@ export const userApi = {
     updateEmailPassword: (params = {}) => {
         return post('/custom/update/login/password', params)
     },
+    // 获取客户经理信息
+    getManagerInfo: () => {
+        return post('/chat/get/manager/info', {})
+    }
 }

+ 1 - 0
pages/activities/components/GiftApplicationPopup.vue

@@ -128,6 +128,7 @@ const cancel = () => {
 
 const handleGiftChange = (value) => {
   giftForm.giveCode = value;
+  giftForm.giveName = props.giftList.find(item => item.giveCode === value)?.giveName || '';
 };
 
 const submit = async () => {

+ 27 - 13
pages/activities/monthly-list.vue

@@ -79,13 +79,15 @@
                             </view>
                             <view class="data-card btn-card" v-show="shouldShowCard(item, item)">
                                 <!-- 取消按钮 - status为1时显示 -->
-                                <button v-if="item.status === 1" class="btn btn-dark btn-sm waves-effect waves-light btn-outline-dark1" @click="cancelTask(item.id)"
-                                    :loading="loadingStates[item.id] === 'cancel'">
+                                <button v-if="item.status === 1"
+                                    class="btn btn-dark btn-sm waves-effect waves-light btn-outline-dark1"
+                                    @click="cancelTask(item.id)" :loading="loadingStates[item.id] === 'cancel'">
                                     {{ t("Btn.Cancel") }}
                                 </button>
                                 <!-- 礼物申请按钮 - status为2且giveStatus为1时显示 -->
-                                <button class="btn btn-danger btn-sm waves-effect waves-light" v-if="item.status === 2 && item.giveStatus === 1 && lang1" @click="applyGift(item.id)"
-                                    :loading="loadingStates[item.id] === 'applyGift'">
+                                <button class="btn btn-danger btn-sm waves-effect waves-light"
+                                    v-if="item.status === 2 && item.giveStatus === 1 && lang1 && !isGiftApplyPastDeadline(item)"
+                                    @click="applyGift(item.id)" :loading="loadingStates[item.id] === 'applyGift'">
                                     {{ t("Btn.Application") }}
                                 </button>
                             </view>
@@ -235,7 +237,7 @@ const canPerformAction = (task: any) => {
 
 const shouldShowCard = (el: any) => {
     const hasCancelButton = el.status === 1
-    const hasGiftApplyButton = el.status === 2 && el.giveStatus === 1 && lang1.value
+    const hasGiftApplyButton = el.status === 2 && el.giveStatus === 1 && lang1.value && !isGiftApplyPastDeadline(el)
     return hasCancelButton || hasGiftApplyButton
 }
 
@@ -316,7 +318,18 @@ const cancelTask = async (id: number) => {
         if (error?.msg) uni.showToast({ title: error.msg, icon: "none" })
     }
 }
-
+// 活动结束时间超过15天后不再显示礼物申请(endTime / endDate 与接口字段对齐)
+const isGiftApplyPastDeadline = (item: any) => {
+    const raw = item.endTime || item.endDate;
+    if (!raw) return false;
+    const endMs =
+        typeof raw === "number"
+            ? raw
+            : new Date(String(raw).replace(/-/g, "/")).getTime();
+    if (Number.isNaN(endMs)) return false;
+    const deadlineMs = endMs + 15 * 24 * 60 * 60 * 1000;
+    return Date.now() > deadlineMs;
+}
 // 礼物申请 - 打开对话框并获取礼品列表
 const applyGift = async (id: number) => {
     // 重置表单
@@ -360,23 +373,22 @@ const submitGiftApply = async (form) => {
     // 实际使用时请配合 uni-forms 或自定义验证
     const valid = true // 占位,实际需调用 this.$refs.giftForm.validate()
     if (!valid) return
-
-    const resConfirm = await uni.showModal({
+    await confirm({
         title: t("Msg.SystemPrompt"),
         content: t("MonthlyActivities.item10"),
         confirmText: t("Btn.Confirm"),
         cancelText: t("Btn.Cancel"),
     })
-    if (!resConfirm.confirm) return
 
     giftSubmitting.value = true
     try {
         const res = await activityApi.ActivityMonthlyGiveApply({
             id: giftForm.value.id,
-            giveCode: form.giveCode,
-            giveName: form.giveName,
+            giveCode: form.giveCode.trim(),
+            giveName: form.giveName.trim(),
             giveAddress: form.giveAddress.trim(),
             givePhone: form.givePhone.trim(),
+            giveAcceptName: form.giveAcceptName.trim(),
         })
         if (res.code == Code.StatusOK) {
             // uni.showToast({ title: t("Msg.Success"), icon: "success" })
@@ -458,9 +470,11 @@ watch(
 
 <style lang="scss" scoped>
 @import "@/uni.scss";
-.tip-info{
-  line-height: px2rpx(18);
+
+.tip-info {
+    line-height: px2rpx(18);
 }
+
 #custom_history {
     width: 100%;
     height: 100%;

+ 10 - 0
utils/request.js

@@ -44,6 +44,16 @@ const requestInterceptor = (config) => {
   if (CLIENT.value) {
     config.header.CLIENT = `${CLIENT.value}`;
   }
+  // #ifdef APP-PLUS
+  if(config.url.includes('/custom/login')){
+    const { platform } = uni.getSystemInfoSync()
+    const DEVICE_TYPE = {
+      ios: 'PHONE_IOS',
+      android: 'PHONE_ANDROID'
+    }
+    config.header.source = DEVICE_TYPE[platform] || 'PHONE_APP'
+  }
+  // #endif
   const userStore = useUserStore();
   const cId = userStore.userInfo?.cId;