From ee681133b8f22824192fe8fff406e029681f308f Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Thu, 18 Dec 2025 15:28:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/store.ts | 38 ++ src/api/user.ts | 15 + src/bundle/parten/pages/bank-card/add.vue | 15 - src/bundle/parten/pages/withdraw/progress.vue | 48 +- src/bundle/parten/pages/withdraw/withdraw.vue | 8 +- src/bundle/profile/change-mobile.vue | 81 +-- src/bundle/profile/change-password.vue | 99 ++-- src/bundle/profile/set-password.vue | 172 +++--- src/bundle/setmeal/add.vue | 2 + src/bundle/store/edit-store.vue | 5 + src/bundle/wallet/wallet.vue | 12 +- src/enum/sms.ts | 2 + src/pages/store/device.vue | 144 +++-- src/pages/store/room-detail.vue | 521 +++++++++--------- src/pages/store/room-manage.vue | 138 +++-- 15 files changed, 715 insertions(+), 585 deletions(-) diff --git a/src/api/store.ts b/src/api/store.ts index 7f386d9..34f2570 100644 --- a/src/api/store.ts +++ b/src/api/store.ts @@ -62,3 +62,41 @@ export interface IGetRoomListParams { export function getRoomList(data: IGetRoomListParams) { return http.Post('/storeapi/store/roomList', data) } + +/** + * 修改房间信息 + */ +export interface IEditRoomParams { + id: number + status?: number + img?: string + label_id?: string + title?: string + price?: number + hours?: number + other_describe?: string +} +export function editRoom(data: IEditRoomParams) { + return http.Post('/storeapi/store/editRoom', data) +} + +/** + * 获取设备列表 + */ +export function getDeviceList(store_id: number) { + return http.Post('/storeapi/device/deviceList', {store_id}) +} + +/** + * 门锁控制 + */ +export function openLock(data: {type: number, lock_no: string, room_id: number, store_id: number}) { + return http.Post('/storeapi/device/lockOff_On', data) +} + +/** + * 空开控制 + */ +export function openPower(data: {device_id: string, state: number, room_id: number}) { + return http.Post('/storeapi/device/deviceOff_On', data) +} \ No newline at end of file diff --git a/src/api/user.ts b/src/api/user.ts index cb98041..b6b6ef4 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -21,6 +21,7 @@ export interface IUpdateUserInfoParams { mobile?: number band_mobile?: string password?: string + code?: string } export function updateUserInfo(data: IUpdateUserInfoParams) { @@ -57,4 +58,18 @@ export interface IGetStoreVerificationCodeParams { export function getVerificationCode(data: IGetStoreVerificationCodeParams) { return http.Post('/storeapi/sms/sendCode', data) +} + +/** + * 重置密码 + */ +export interface IResetPasswordParams { + mobile: string + code: string + password: string + password_confirm: string +} + +export function resetPassword(data: IResetPasswordParams) { + return http.Post('/storeapi/storeLogin/resetPassword', data) } \ No newline at end of file diff --git a/src/bundle/parten/pages/bank-card/add.vue b/src/bundle/parten/pages/bank-card/add.vue index 769b7b7..aef8283 100644 --- a/src/bundle/parten/pages/bank-card/add.vue +++ b/src/bundle/parten/pages/bank-card/add.vue @@ -113,21 +113,6 @@ import { getVerificationCode } from '@/api/user' import { SMS_ENUM } from '@/enum/sms' - - const OSS = inject('OSS') - - // 选择银行卡 - const showBankCardPopup = ref(false) - const selectedBankCardIndex = ref(0) - const bankList = ref>([ - { id: 1, bankName: '招商银行', bankCard: '3265' }, - { id: 2, bankName: '建设银行', bankCard: '1234' }, - { id: 3, bankName: '农业银行', bankCard: '5678' }, - ]) - - // 提现金额 - const withdrawMoney = ref(0) - // 验证码倒计时 const countDownTime = ref(1 * 60 * 1000) // 60s倒计时 const startCountDown = ref(false) // 是否开始倒计时 diff --git a/src/bundle/parten/pages/withdraw/progress.vue b/src/bundle/parten/pages/withdraw/progress.vue index e50da8d..cc90686 100644 --- a/src/bundle/parten/pages/withdraw/progress.vue +++ b/src/bundle/parten/pages/withdraw/progress.vue @@ -12,7 +12,7 @@ - + @@ -20,11 +20,11 @@ 发起提现申请 - 2025-04-08 21:25:25 + {{ billDetails.order.dtime }} 平台审核中 - 2025-04-08 21:25:25 + {{ billDetails.order.dtime }} 到账成功 @@ -33,7 +33,7 @@ - + @@ -61,15 +61,15 @@ 提现金额 - ¥5000.00 + ¥{{ billDetails.order.amount }} 到账银行卡 - 招商银行(3265) + {{ billDetails.order.bank_name }}({{ Progress.handleFormatBankCardNumber(billDetails.order.bank_card) }}) - + 完成 @@ -78,6 +78,7 @@ diff --git a/src/bundle/parten/pages/withdraw/withdraw.vue b/src/bundle/parten/pages/withdraw/withdraw.vue index a19ff65..f0f5ca1 100644 --- a/src/bundle/parten/pages/withdraw/withdraw.vue +++ b/src/bundle/parten/pages/withdraw/withdraw.vue @@ -210,7 +210,9 @@ uni.hideLoading toast.success('提现申请提交成功') - router.redirectTo('/bundle/wallet/wallet', 500) + + uni.$emit('refreshWalletPage') + router.navigateBack(1, 500) } catch (error) { uni.hideLoading toast.info('获取可提现金额失败,请稍后重试') @@ -218,7 +220,9 @@ } }, - // 添加银行卡 + /** + * 添加新银行卡 + */ handleAddNewBankCard: () => { showBankCardPopup.value = false uni.navigateTo({ diff --git a/src/bundle/profile/change-mobile.vue b/src/bundle/profile/change-mobile.vue index f67b9f1..6101359 100644 --- a/src/bundle/profile/change-mobile.vue +++ b/src/bundle/profile/change-mobile.vue @@ -27,7 +27,7 @@ no-border custom-class="!bg-[#F6F7F8] !border !border-solid !border-[#EAECF0] !rounded-16rpx" custom-input-class="!px-32rpx !h-104rpx" - @input="mobile.handleInputMobile" + @input="ChangeMobile.handleInputMobile" /> @@ -43,9 +43,9 @@ - 发送验证码 + 发送验证码 - + S后重发 @@ -57,7 +57,7 @@ - 登录 + 确定 @@ -69,7 +69,7 @@ 手机号修改成功 {{ page.desc }} - 好的 + 好的 @@ -80,23 +80,25 @@ import {mobile as testMobile} from '@/utils/test' import { useToast } from 'wot-design-uni' import { router } from '@/utils/tools' + import { SMS_ENUM } from '@/enum/sms' + import { getVerificationCode, updateUserInfo } from '@/api/user' const OSS = inject('OSS') const toast = useToast() const disabled = ref(true) - /** 页面 **/ + // 页面 const pageType = ref('') // 页面类型 login:登录 edit:修改手机号 const page = ref<{title: string, desc: string}>({title: '其他手机号登录', desc: '请输入你要登录的手机号'}) const showEditSuccessPopup = ref(false) // 显示手机号修改成功弹窗 const userId = ref(0) // 用户ID,修改手机号时需要传 - /** 验证码倒计时 **/ + // 验证码倒计时 const countDownTime = ref(1 * 60 * 1000) // 60s倒计时 const startCountDown = ref(false) // 是否开始倒计时 const countDown = ref(null) // 倒计时组件 - /** 表单相关 **/ + // 表单相关 const model = reactive<{ mobile: string code: string @@ -104,7 +106,6 @@ mobile: '', code: '' }) - /** 结束 **/ onLoad((args) => { @@ -121,15 +122,20 @@ } }) - const mobile = { - // 验证手机号 + const ChangeMobile = { + /** + * 验证手机号 + * @param e + */ handleInputMobile: (e: {value: string}) => { model.mobile = e.value disabled.value = !testMobile(model.mobile) }, - // 发送验证码 - handleCountDown: () => { + /** + * 发送验证码 + */ + handleCountDown: async () => { if (disabled.value) { toast.show({ iconClass: 'info-circle', @@ -139,6 +145,8 @@ return } + await getVerificationCode({ scene: SMS_ENUM.BGSJHM, mobile: String(model.mobile)}) + startCountDown.value = true nextTick(() => { countDown.value?.start() @@ -152,19 +160,10 @@ startCountDown.value = false }, - // 登录 - handleToLogin: () => { - // TODO 如果是edit的话就是修改手机号 - - if (pageType === 'login' && !agree.value) { - toast.show({ - iconClass: 'info-circle', - msg: '请同意服务协议和隐私政策', - direction: 'vertical' - }) - return - } - + /** + * 修改 + */ + handleConfirm: async() => { if (!testMobile(model.mobile)) { toast.show({ iconClass: 'info-circle', @@ -174,16 +173,30 @@ return } - if (!model.code) { - toast.show({ - iconClass: 'info-circle', - msg: '验证码错误', - direction: 'vertical' + if (pageType.value == 'edit') { + // TODO 如果是edit的话就是修改手机号 + if (!model.code) { + toast.show({ + iconClass: 'info-circle', + msg: '验证码错误', + direction: 'vertical' + }) + return + } + + await updateUserInfo({ + mobile: Number(model.mobile), + code: model.code }) - return + + showEditSuccessPopup.value = true + } else if (pageType.value == 'change') { + await updateUserInfo({ + band_mobile: model.mobile, + }) + toast.success('绑定手机号修改成功') + router.switchTab('/pages/my/my', 500) } - - router.navigateTo('/bundle/profile/set-password') }, // 获取手机号 diff --git a/src/bundle/profile/change-password.vue b/src/bundle/profile/change-password.vue index 4ee3542..c947c25 100644 --- a/src/bundle/profile/change-password.vue +++ b/src/bundle/profile/change-password.vue @@ -27,7 +27,7 @@ no-border custom-class="!bg-[#F6F7F8] !border !border-solid !border-[#EAECF0] !rounded-16rpx" custom-input-class="!px-32rpx !h-104rpx" - @input="mobile.handleInputMobile" + @input="Mobile.handleInputMobile" /> @@ -43,9 +43,9 @@ - 发送验证码 + 发送验证码 - + S后重发 @@ -57,38 +57,25 @@ - 下一步 - - - - - - - - - - 手机号修改成功 - {{ page.desc }} - 好的 - - + 下一步 diff --git a/src/bundle/profile/set-password.vue b/src/bundle/profile/set-password.vue index 10229f0..b5ab774 100644 --- a/src/bundle/profile/set-password.vue +++ b/src/bundle/profile/set-password.vue @@ -20,37 +20,35 @@ 密码 - + 再次确认 - 确定 + 确定 @@ -62,7 +60,7 @@ 密码修改成功 请记住你的登录密码 - 好的 + 好的 @@ -71,134 +69,92 @@ diff --git a/src/bundle/setmeal/add.vue b/src/bundle/setmeal/add.vue index 36dc587..df0b1dd 100644 --- a/src/bundle/setmeal/add.vue +++ b/src/bundle/setmeal/add.vue @@ -272,6 +272,7 @@ + 适用包间 @@ -334,6 +335,7 @@ diff --git a/src/pages/store/room-detail.vue b/src/pages/store/room-detail.vue index 8120bc1..3b6d57a 100644 --- a/src/pages/store/room-detail.vue +++ b/src/pages/store/room-detail.vue @@ -5,261 +5,6 @@ } } - - + + + +