优化功能

This commit is contained in:
wangxiaowei
2026-02-02 02:37:04 +08:00
parent a923ca9d9c
commit d9840014a2
8 changed files with 48 additions and 79 deletions

View File

@ -149,7 +149,7 @@
return return
} }
await getVerificationCode({ scene: SMS_ENUM.BGSJHM, mobile: String(model.mobile)}) await getVerificationCode({ scene: SMS_ENUM.BANK, mobile: String(model.mobile)})
startCountDown.value = true startCountDown.value = true
setTimeout(() => { setTimeout(() => {

View File

@ -122,7 +122,7 @@
return return
} }
await getVerificationCode({ scene: SMS_ENUM.ZHDLMM, mobile: String(model.mobile)}) await getVerificationCode({ scene: SMS_ENUM.BANK, mobile: String(model.mobile)})
startCountDown.value = true startCountDown.value = true
setTimeout(() => { setTimeout(() => {

View File

@ -144,7 +144,7 @@
import { getUserInfo, updateUserInfo } from '@/api/user' import { getUserInfo, updateUserInfo } from '@/api/user'
import type { IUserResult } from '@/api/types/user' import type { IUserResult } from '@/api/types/user'
import { router } from '@/utils/tools' import { router } from '@/utils/tools'
import { useUserStore } from '@/store' import { useUserStore, useStoreStore } from '@/store'
const OSS = inject('OSS') const OSS = inject('OSS')
const showLogoutPopup = ref<boolean>(false) // 是否显示退出登录弹出框 const showLogoutPopup = ref<boolean>(false) // 是否显示退出登录弹出框
@ -246,8 +246,12 @@
* 退出 * 退出
*/ */
handleLogout: async () => { handleLogout: async () => {
const store = useStoreStore()
await store.clearTeaStore()
const userStore = useUserStore() const userStore = useUserStore()
await userStore.logout() await userStore.logout()
if (!userStore.isLoggedIn) { if (!userStore.isLoggedIn) {
toast.info('退出成功') toast.info('退出成功')
router.reLaunch('/pages/my/my') router.reLaunch('/pages/my/my')

View File

@ -25,7 +25,7 @@
<view class="flex items-center ml-84rpx mt-20rpx"> <view class="flex items-center ml-84rpx mt-20rpx">
<view class="font-400 text-28rpx text-[#303133] leading-40rpx">用户购买</view> <view class="font-400 text-28rpx text-[#303133] leading-40rpx">用户购买</view>
<view class="mx-28rpx"> <view class="mx-28rpx">
<wd-input-number v-model="exprireDay" @change="Add.handleChangeExpirseDay" :min="1"/> <wd-input-number v-model="exprireDay" :min="1"/>
</view> </view>
<view class="">天内有效</view> <view class="">天内有效</view>
</view> </view>
@ -176,8 +176,7 @@
最多可上传9张图片 最多可上传9张图片
</view> </view>
</view> </view>
<wd-upload :header="{'token': token}" :file-list="fileList" :limit="9" image-mode="scaleToFill" multiple accept="image" :action="action" <wd-upload :header="{'token': token}" v-model:file-list="fileList" :limit="9" image-mode="scaleToFill" multiple accept="image" :action="action">
@change="Add.handleUploadFile">
<view <view
class="border-2rpx border-dashed border-[#E5E5E5] w-184rpx h-184rpx flex flex-col items-center justify-center rounded-16rpx"> class="border-2rpx border-dashed border-[#E5E5E5] w-184rpx h-184rpx flex flex-col items-center justify-center rounded-16rpx">
<view class=""> <view class="">
@ -363,7 +362,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { router } from '@/utils/tools' import { router, removeImageUrlPrefix } from '@/utils/tools'
import { getAllRoomList } from '@/api/store' import { getAllRoomList } from '@/api/store'
import { addTeaSpecialistOrderPackage, getTeaSpecialistOrderPackageDetail, editTeaSpecialistOrderPackage } from '@/api/order' import { addTeaSpecialistOrderPackage, getTeaSpecialistOrderPackageDetail, editTeaSpecialistOrderPackage } from '@/api/order'
import { useStoreStore } from '@/store' import { useStoreStore } from '@/store'
@ -477,7 +476,6 @@
name: item, name: item,
url: item url: item
})) }))
Add.fileList = fileList.value
if (Number(res.room_id) == 0) { if (Number(res.room_id) == 0) {
room.value = '全部适用' room.value = '全部适用'
@ -499,37 +497,6 @@
tab.value = e.name tab.value = e.name
}, },
/**
* 图片选择/删除
*/
handleUploadFile: ({ fileList: files }) => {
let url = ''
let name = ''
let response = null
const res = files.map(item => {
if (item.response) {
response = JSON.parse(item.response)
url = response.data.url
name = response.data.name
}
return {
name: name || item.name,
url: url || item.url
}
})
fileList.value = files
Add.fileList = res
},
/**
* 有效期天数
*/
handleChangeExpirseDay: () => {
},
/** /**
* 选择范围指定日期 * 选择范围指定日期
*/ */
@ -591,7 +558,7 @@
} }
// 团购图片 // 团购图片
if (Add.fileList.length == 0) { if (fileList.value.length == 0) {
toast.info('请上传团购图片') toast.info('请上传团购图片')
return return
} }
@ -650,13 +617,7 @@
return return
} }
// 将图片URL中的 https://76458.com/ 替换为空 formData.img = removeImageUrlPrefix(fileList.value).join(',')
formData.img = Add.fileList.map(item => {
if (typeof item.url === 'string') {
return item.url.replace(import.meta.env.VITE_UPLOAD_IMAGE_URL, '')
}
return item.url
}).join(',')
if (roomId.value.includes(0)) { if (roomId.value.includes(0)) {
formData.room_id = '0' formData.room_id = '0'

View File

@ -71,7 +71,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { toast } from '@/utils/toast' import { toast } from '@/utils/toast'
import { router } from '@/utils/tools' import { router } from '@/utils/tools'
import { useUserStore } from '@/store' import { useUserStore, useStoreStore } from '@/store'
const OSS = inject('OSS') const OSS = inject('OSS')
const storeName = ref<string>('') const storeName = ref<string>('')
@ -93,6 +93,9 @@
* 退出 * 退出
*/ */
handleLogout: async () => { handleLogout: async () => {
const store = useStoreStore()
await store.clearTeaStore()
const userStore = useUserStore() const userStore = useUserStore()
await userStore.logout() await userStore.logout()
if (!userStore.isLoggedIn) { if (!userStore.isLoggedIn) {

View File

@ -167,6 +167,8 @@
<!-- 操作按钮 --> <!-- 操作按钮 -->
<template v-if="order.order_status === AdminOrderStatus.ToUse || order.order_status === AdminOrderStatus.Consuming"> <template v-if="order.order_status === AdminOrderStatus.ToUse || order.order_status === AdminOrderStatus.Consuming">
<view class="text-center flex items-center text-28rpx mt-28rpx justify-end"> <view class="text-center flex items-center text-28rpx mt-28rpx justify-end">
<!-- <view v-if="order.order_status === AdminOrderStatus.Consuming" class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133] mr-28rpx flex items-center justify-center"
@click="ComboCard.handleReleaseOrder(order.id)">释放包间</view> -->
<view v-if="order.order_status === AdminOrderStatus.Consuming" class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133] mr-28rpx flex items-center justify-center" <view v-if="order.order_status === AdminOrderStatus.Consuming" class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133] mr-28rpx flex items-center justify-center"
@click="ComboCard.handleReleaseOrder(order.id)">释放时间</view> @click="ComboCard.handleReleaseOrder(order.id)">释放时间</view>
<view class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#4C9F44] text-[#4C9F44] flex items-center justify-center" <view class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#4C9F44] text-[#4C9F44] flex items-center justify-center"
@ -315,29 +317,29 @@
/** /**
* 删除套餐 * 删除套餐
*/ */
// handleDelteSetmealOrder: () => { handleDelteSetmealOrder: () => {
// message.confirm({ message.confirm({
// title: '确定删除该套餐?', title: '确定删除该套餐?',
// msg: '删除后该套餐将无法恢复,是否确认删除?', msg: '删除后该套餐将无法恢复,是否确认删除?',
// confirmButtonText: '确定', confirmButtonText: '确定',
// cancelButtonText: '取消', cancelButtonText: '取消',
// cancelButtonProps: { cancelButtonProps: {
// customClass: '!bg-[#F6F7F8] !text-[#303133] !text-32rpx !leading-44rpx !rounded-8rpx', customClass: '!bg-[#F6F7F8] !text-[#303133] !text-32rpx !leading-44rpx !rounded-8rpx',
// }, },
// confirmButtonProps: { confirmButtonProps: {
// customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx', customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
// } }
// }).then(async (res) => { }).then(async (res) => {
// if (res.action == 'confirm') { if (res.action == 'confirm') {
// await deleteTeaSpecialistOrderPackage(props.order.id) await deleteTeaSpecialistOrderPackage(props.order.id)
// emit('refresh') emit('refresh')
// toast.info('删除成功') toast.info('删除成功')
// } }
// // 点击确认按钮回调事件 // 点击确认按钮回调事件
// }).catch(() => { }).catch(() => {
// // 点击取消按钮回调事件 // 点击取消按钮回调事件
// }) })
// }, },
/** /**
* 编辑商品 * 编辑商品

View File

@ -175,13 +175,6 @@
Index.handleInit() Index.handleInit()
}) })
onLoad(async() => {
// uni.setTabBarItem({
// index: 2,
// visible: false
// })
})
const Index = { const Index = {
handleInit: async() => { handleInit: async() => {
await Index.handleGetStoreList() await Index.handleGetStoreList()

View File

@ -37,11 +37,17 @@ export const useStoreStore = defineStore(
defaultStore.value = store defaultStore.value = store
} }
const clearTeaStore = () => {
defaultStore.value = {...defaultStoreState}
storeList.value = []
}
return { return {
setStoreList, setStoreList,
storeList, storeList,
defaultStore, defaultStore,
setDefaultStore setDefaultStore,
clearTeaStore
} }
}, },
{ {