feat(recall): 添加用户召回功能相关接口和查询页面
新增召回旧用户相关API接口,包括登录、搜索历史活动、海报配置等 修改ID查询页面,增加姓名和手机号输入字段及验证
Showing
2 changed files
with
107 additions
and
6 deletions
src/api/recall_users.js
0 → 100644
| 1 | +/* | ||
| 2 | + * @Date: 2025-12-19 10:43:09 | ||
| 3 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | + * @LastEditTime: 2025-12-24 16:01:49 | ||
| 5 | + * @FilePath: /mlaj/src/api/recall_users.js | ||
| 6 | + * @Description: 引入外部接口, 召回旧用户相关接口 | ||
| 7 | + */ | ||
| 8 | +import { fn, fetch } from './fn'; | ||
| 9 | + | ||
| 10 | +const Api = { | ||
| 11 | + USER_LOGIN: '/srv/?a=user_login', | ||
| 12 | + USER_SEARCH_OLD_ACTIVITY: '/srv/?a=desk_calendar&t=search_old_activity', | ||
| 13 | + USER_GET_POSTER: '/srv/?a=desk_calendar&t=get_poster', | ||
| 14 | + USER_EDIT_POSTER: '/srv/?a=desk_calendar&t=edit_poster', | ||
| 15 | +} | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * @description: 用户登录 | ||
| 19 | + * @param: mobile 手机号 | ||
| 20 | + * @param: password 用户密码 | ||
| 21 | + * @return: data: { user_info 用户信息 } | ||
| 22 | + */ | ||
| 23 | +export const loginAPI = (params) => fn(fetch.post(Api.USER_LOGIN, params)); | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * @description: 搜索历史活动 | ||
| 27 | + * @param: name 姓名 | ||
| 28 | + * @param: mobile 手机号 | ||
| 29 | + * @param: idcard 身份证号 | ||
| 30 | + * @return: data: { payment_qty 报名学员的次数, volunteers_qty 报名义工的次数, record_date 注册时间, last_activity_date 最后登录时间, | ||
| 31 | + * campaign_info 活动列表 [{ stu_uid 学员ID, campaign_id 活动ID, campaign_name 活动名称, beg_day 活动开始时间, end_day 活动结束时间, | ||
| 32 | + * address 活动地址, campaign_type 活动类型, campaign_year 活动年份, customer_base 活动要求, fee_level 收费类型, fee_stu 学员费用, | ||
| 33 | + * fee_desc 收费描述, create_time 创建时间 }] | ||
| 34 | + * } | ||
| 35 | + */ | ||
| 36 | +export const searchOldActivityAPI = (params) => fn(fetch.get(Api.USER_SEARCH_OLD_ACTIVITY, params)); | ||
| 37 | + | ||
| 38 | +/** | ||
| 39 | + * @description: 查询海报配置 | ||
| 40 | + * @param: stu_uid 学员ID | ||
| 41 | + * @param: campaign_id 活动ID | ||
| 42 | + * @return: data: { background_image 海报背景图URL, qrcode 二维码 } | ||
| 43 | + */ | ||
| 44 | +export const getPosterAPI = (params) => fn(fetch.get(Api.USER_GET_POSTER, params)); | ||
| 45 | + | ||
| 46 | +/** | ||
| 47 | + * @description: 编辑海报配置 | ||
| 48 | + * @param: campaign_id 活动ID | ||
| 49 | + * @param: background_image 海报背景图URL | ||
| 50 | + */ | ||
| 51 | +export const editPosterAPI = (params) => fn(fetch.post(Api.USER_EDIT_POSTER, params)); |
| ... | @@ -3,19 +3,23 @@ | ... | @@ -3,19 +3,23 @@ |
| 3 | <!-- Starry Background --> | 3 | <!-- Starry Background --> |
| 4 | <StarryBackground :bg-image="bgImg" /> | 4 | <StarryBackground :bg-image="bgImg" /> |
| 5 | 5 | ||
| 6 | + <!-- <div class="mt-5 flex flex-col items-center z-10 w-full px-8 text-center"> | ||
| 7 | + <h1 class="text-white text-3xl font-bold tracking-wider mb-3 drop-shadow-lg">查询信息</h1> | ||
| 8 | + <p class="text-white/80 text-sm tracking-wide font-medium">请确认和补全您的个人信息</p> | ||
| 9 | + </div> --> | ||
| 10 | + | ||
| 6 | <!-- Main Content Card --> | 11 | <!-- Main Content Card --> |
| 7 | - <div class="w-full px-6 mt-10 z-10"> | 12 | + <div class="w-full px-6 mt-5 z-10"> |
| 8 | <FrostedGlass class="p-6 !rounded-2xl !border-white/20 !shadow-none" :bg-opacity="10" blur-level="md"> | 13 | <FrostedGlass class="p-6 !rounded-2xl !border-white/20 !shadow-none" :bg-opacity="10" blur-level="md"> |
| 9 | <!-- Illustration --> | 14 | <!-- Illustration --> |
| 10 | - <div class="flex justify-center mb-2"> | 15 | + <!-- <div class="flex justify-center mb-2"> |
| 11 | - <!-- Placeholder for the illustration --> | ||
| 12 | <img :src="emptyStateImg" class="w-32 h-32 object-contain" alt="No Data" /> | 16 | <img :src="emptyStateImg" class="w-32 h-32 object-contain" alt="No Data" /> |
| 13 | - </div> | 17 | + </div> --> |
| 14 | 18 | ||
| 15 | <!-- Description Text --> | 19 | <!-- Description Text --> |
| 16 | <p class="text-[#FFDD01] text-center text-sm mb-6 leading-relaxed tracking-wide"> | 20 | <p class="text-[#FFDD01] text-center text-sm mb-6 leading-relaxed tracking-wide"> |
| 17 | 时光机没有找到您的历史活动信息,<br /> | 21 | 时光机没有找到您的历史活动信息,<br /> |
| 18 | - 试试输入活动报名时登记的身份证号吧~ | 22 | + 试试输入活动报名时登记的身份信息吧~ |
| 19 | </p> | 23 | </p> |
| 20 | 24 | ||
| 21 | <!-- Dashed Separator --> | 25 | <!-- Dashed Separator --> |
| ... | @@ -23,7 +27,35 @@ | ... | @@ -23,7 +27,35 @@ |
| 23 | 27 | ||
| 24 | <!-- ID Card Input Section --> | 28 | <!-- ID Card Input Section --> |
| 25 | <div class="space-y-4"> | 29 | <div class="space-y-4"> |
| 26 | - <label class="block text-white font-bold text-lg tracking-wide">身份证号</label> | 30 | + <!-- Name Input --> |
| 31 | + <div> | ||
| 32 | + <label class="block text-white font-bold text-lg tracking-wide mb-2">姓名</label> | ||
| 33 | + <van-field | ||
| 34 | + v-model="name" | ||
| 35 | + placeholder="请输入您的姓名" | ||
| 36 | + class="custom-input rounded-lg !bg-white/10 !text-white !border-[1px] !border-solid !border-[rgba(255,255,255,0.57)] !p-3" | ||
| 37 | + :border="false" | ||
| 38 | + clearable | ||
| 39 | + /> | ||
| 40 | + </div> | ||
| 41 | + | ||
| 42 | + <!-- Phone Input --> | ||
| 43 | + <div> | ||
| 44 | + <label class="block text-white font-bold text-lg tracking-wide mb-2">手机号</label> | ||
| 45 | + <van-field | ||
| 46 | + v-model="phone" | ||
| 47 | + type="tel" | ||
| 48 | + maxlength="11" | ||
| 49 | + placeholder="请输入您的手机号" | ||
| 50 | + class="custom-input rounded-lg !bg-white/10 !text-white !border-[1px] !border-solid !border-[rgba(255,255,255,0.57)] !p-3" | ||
| 51 | + :border="false" | ||
| 52 | + clearable | ||
| 53 | + /> | ||
| 54 | + </div> | ||
| 55 | + | ||
| 56 | + <!-- ID Card Input --> | ||
| 57 | + <div> | ||
| 58 | + <label class="block text-white font-bold text-lg tracking-wide mb-2">身份证号</label> | ||
| 27 | <van-field | 59 | <van-field |
| 28 | v-model="idCard" | 60 | v-model="idCard" |
| 29 | placeholder="请输入您的身份证号" | 61 | placeholder="请输入您的身份证号" |
| ... | @@ -31,6 +63,7 @@ | ... | @@ -31,6 +63,7 @@ |
| 31 | :border="false" | 63 | :border="false" |
| 32 | clearable | 64 | clearable |
| 33 | /> | 65 | /> |
| 66 | + </div> | ||
| 34 | 67 | ||
| 35 | <!-- Notes --> | 68 | <!-- Notes --> |
| 36 | <div class="space-y-4" style="margin-top: 2rem;"> | 69 | <div class="space-y-4" style="margin-top: 2rem;"> |
| ... | @@ -79,6 +112,8 @@ const route = useRoute() | ... | @@ -79,6 +112,8 @@ const route = useRoute() |
| 79 | const router = useRouter() | 112 | const router = useRouter() |
| 80 | useTitle('身份证号查询') | 113 | useTitle('身份证号查询') |
| 81 | 114 | ||
| 115 | +const name = ref('') | ||
| 116 | +const phone = ref('') | ||
| 82 | const idCard = ref('44030619900101001X') | 117 | const idCard = ref('44030619900101001X') |
| 83 | 118 | ||
| 84 | // ID Card Validation | 119 | // ID Card Validation |
| ... | @@ -89,6 +124,21 @@ const validateIdCard = (id) => { | ... | @@ -89,6 +124,21 @@ const validateIdCard = (id) => { |
| 89 | } | 124 | } |
| 90 | 125 | ||
| 91 | const handleConfirm = () => { | 126 | const handleConfirm = () => { |
| 127 | + if (!name.value) { | ||
| 128 | + showToast('请输入姓名') | ||
| 129 | + return | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + if (!phone.value) { | ||
| 133 | + showToast('请输入手机号') | ||
| 134 | + return | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + if (!/^1[3-9]\d{9}$/.test(phone.value)) { | ||
| 138 | + showToast('请输入正确的手机号') | ||
| 139 | + return | ||
| 140 | + } | ||
| 141 | + | ||
| 92 | if (!idCard.value) { | 142 | if (!idCard.value) { |
| 93 | showToast('请输入身份证号') | 143 | showToast('请输入身份证号') |
| 94 | return | 144 | return | ... | ... |
-
Please register or login to post a comment