对接银行卡接口
This commit is contained in:
@ -8,7 +8,6 @@ export function addBankCard(data: IAddBankCardParams) {
|
|||||||
return http.Post('/storeapi/user/addBank', data)
|
return http.Post('/storeapi/user/addBank', data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除银行卡
|
* 删除银行卡
|
||||||
*/
|
*/
|
||||||
@ -22,3 +21,10 @@ export function deleteBankCard(id: number) {
|
|||||||
export function getBankCardList() {
|
export function getBankCardList() {
|
||||||
return http.Post<any>('/storeapi/user/checkBank')
|
return http.Post<any>('/storeapi/user/checkBank')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提现申请
|
||||||
|
*/
|
||||||
|
export function withdrawApply(amount: number, bank_id: number) {
|
||||||
|
return http.Post('/storeapi/user/submitReflect', { amount, bank_id })
|
||||||
|
}
|
||||||
@ -49,3 +49,16 @@ export interface IEditStoreInfoParams {
|
|||||||
export function editStoreInfo(data: IEditStoreInfoParams) {
|
export function editStoreInfo(data: IEditStoreInfoParams) {
|
||||||
return http.Post('/storeapi/store/editStore', data)
|
return http.Post('/storeapi/store/editStore', data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取房间列表
|
||||||
|
*/
|
||||||
|
export interface IGetRoomListParams {
|
||||||
|
page: number
|
||||||
|
size: number
|
||||||
|
store_id: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRoomList(data: IGetRoomListParams) {
|
||||||
|
return http.Post<any>('/storeapi/store/roomList', data)
|
||||||
|
}
|
||||||
|
|||||||
@ -9,12 +9,12 @@
|
|||||||
</route>
|
</route>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view class="pb-48rpx">
|
||||||
<!-- 删除确认框 -->
|
<!-- 删除确认框 -->
|
||||||
<wd-message-box selector="wd-message-box-slot"></wd-message-box>
|
<wd-message-box selector="wd-message-box-slot"></wd-message-box>
|
||||||
|
|
||||||
<view class="flex items-center mx-58rpx mb-28rpx">
|
<view class="flex items-center mx-58rpx mb-28rpx">
|
||||||
<view class="font-bold text-28rpx leading-40rpx text-#303133">我的银行卡(9张)</view>
|
<view class="font-bold text-28rpx leading-40rpx text-#303133">我的银行卡({{ bankList.length }}张)</view>
|
||||||
<view class="flex items-center">
|
<view class="flex items-center">
|
||||||
<view class="flex items-center mr-12rpx">
|
<view class="flex items-center mr-12rpx">
|
||||||
<wd-img :src="`${OSS}icon/icon_safe.png`" width="32rpx" height="32rpx"></wd-img>
|
<wd-img :src="`${OSS}icon/icon_safe.png`" width="32rpx" height="32rpx"></wd-img>
|
||||||
@ -29,9 +29,9 @@
|
|||||||
<view class="flex items-center mr-22rpx">
|
<view class="flex items-center mr-22rpx">
|
||||||
<wd-img :src="`${OSS}icon/icon_bank_card4.png`" width="48rpx" height="48rpx"></wd-img>
|
<wd-img :src="`${OSS}icon/icon_bank_card4.png`" width="48rpx" height="48rpx"></wd-img>
|
||||||
</view>
|
</view>
|
||||||
<view class="font-400 text-30rpx leading-42rpx text-#303133">招商银行 储蓄卡(3265)</view>
|
<view class="font-400 text-30rpx leading-42rpx text-#303133">{{ item.bank_name }} 储蓄卡({{ List.handleFormatBankCardNumber(item.bank_card) }})</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="List.handleDeleteBankCard(index)">
|
<view @click="List.handleDeleteBankCard(index, item.id)">
|
||||||
<wd-icon name="delete-thin" size="42rpx" color="#BFC2CC"></wd-icon>
|
<wd-icon name="delete-thin" size="42rpx" color="#BFC2CC"></wd-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -46,25 +46,36 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useMessage } from 'wot-design-uni'
|
import { useMessage } from 'wot-design-uni'
|
||||||
import {toast} from '@/utils/toast'
|
import {toast} from '@/utils/toast'
|
||||||
|
import { getBankCardList, deleteBankCard } from '@/api/bank'
|
||||||
|
|
||||||
const OSS = inject('OSS')
|
const OSS = inject('OSS')
|
||||||
const message = useMessage('wd-message-box-slot')
|
const message = useMessage('wd-message-box-slot')
|
||||||
|
|
||||||
// 选择银行卡
|
// 选择银行卡
|
||||||
const showBankCardPopup = ref<boolean>(false)
|
const bankList = ref<Array<{ id: number, bank_name: string, bank_card: string }>>([])
|
||||||
const selectedBankCardIndex = ref<number>(0)
|
|
||||||
const bankList = ref<Array<{ id: number, bankName: string, bankCard: string }>>([
|
onShow(() => {
|
||||||
{ id: 1, bankName: '招商银行', bankCard: '3265' },
|
List.getBankCardList()
|
||||||
{ id: 2, bankName: '建设银行', bankCard: '1234' },
|
})
|
||||||
{ id: 3, bankName: '农业银行', bankCard: '5678' },
|
|
||||||
])
|
|
||||||
|
|
||||||
const List = {
|
const List = {
|
||||||
handleDeleteBankCard: (index: number) => {
|
/**
|
||||||
|
* 获取银行卡列表
|
||||||
|
*/
|
||||||
|
getBankCardList: async () => {
|
||||||
|
const res = await getBankCardList()
|
||||||
|
bankList.value = res.list
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除银行卡
|
||||||
|
* @param index
|
||||||
|
*/
|
||||||
|
handleDeleteBankCard: async (index: number, id: number) => {
|
||||||
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',
|
||||||
@ -72,16 +83,43 @@
|
|||||||
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((res) => {
|
}).then(async (res) => {
|
||||||
|
if (res.action === 'confirm') {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '操作中...',
|
||||||
|
mask: false
|
||||||
|
})
|
||||||
|
|
||||||
|
try {
|
||||||
|
await deleteBankCard(id)
|
||||||
|
uni.hideLoading()
|
||||||
|
toast.success('删除成功')
|
||||||
bankList.value.splice(index, 1)
|
bankList.value.splice(index, 1)
|
||||||
toast.info('删除成功')
|
} catch (error) {
|
||||||
// 点击确认按钮回调事件
|
uni.hideLoading()
|
||||||
|
toast.info('删除失败')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// 点击取消按钮回调事件
|
// 点击取消按钮回调事件
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 跳转到添加银行卡页面
|
/**
|
||||||
|
* 格式化银行卡号
|
||||||
|
* @ param bankCardNumber 银行卡号
|
||||||
|
*/
|
||||||
|
handleFormatBankCardNumber: (bankCardNumber: string) => {
|
||||||
|
if (!bankCardNumber) return ''
|
||||||
|
const noSpace = bankCardNumber.replace(/\s/g, '')
|
||||||
|
if (noSpace.length <= 4) return noSpace
|
||||||
|
return noSpace.slice(-4)
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跳转到添加银行卡页面
|
||||||
|
*/
|
||||||
handleAddBankCard: () => {
|
handleAddBankCard: () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/bundle/parten/pages/bank-card/add'
|
url: '/bundle/parten/pages/bank-card/add'
|
||||||
|
|||||||
@ -92,12 +92,12 @@
|
|||||||
/**
|
/**
|
||||||
* 退出
|
* 退出
|
||||||
*/
|
*/
|
||||||
handleLogout: () => {
|
handleLogout: async () => {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
userStore.logout()
|
await userStore.logout()
|
||||||
if (!userStore.isLoggedIn) {
|
if (!userStore.isLoggedIn) {
|
||||||
toast.info('退出成功')
|
toast.info('退出成功')
|
||||||
router.reLaunch('/pages/my/my')
|
router.redirectTo('/pages/login/login')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,59 @@
|
|||||||
}
|
}
|
||||||
}</route>
|
}</route>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- 导航栏 -->
|
||||||
|
<view>
|
||||||
|
<navbar title="包间管理" custom-class="!bg-white" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 房间列表 -->
|
||||||
|
<view class="px-30rpx pb-40rpx pt-30rpx">
|
||||||
|
<view class="grid grid-cols-2 gap-24rpx">
|
||||||
|
<view v-for="room in roomList" :key="room.id"
|
||||||
|
class="flex flex-col overflow-hidden rounded-16rpx bg-white"
|
||||||
|
@click="RoomManage.handleClickRoom(room)">
|
||||||
|
<!-- 房间图片 -->
|
||||||
|
<view class="relative aspect-[4/3] w-full">
|
||||||
|
<wd-img width="100%" height="100%" :src="room.image" mode="aspectFill" />
|
||||||
|
<!-- 编辑图标覆盖层 -->
|
||||||
|
<view
|
||||||
|
class="absolute right-16rpx top-16rpx h-48rpx w-48rpx flex items-center justify-center rounded-24rpx bg-black bg-opacity-40"
|
||||||
|
@click.stop="RoomManage.handleEditImage(room, $event)">
|
||||||
|
<wd-icon name="edit" size="16px" color="#fff" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 房间信息 -->
|
||||||
|
<view class="flex flex-col p-24rpx">
|
||||||
|
<!-- 房间名称 -->
|
||||||
|
<view class="mb-0rpx text-center text-28rpx text-[#303133] leading-40rpx">
|
||||||
|
{{ room.name }} ({{ room.type }})
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 状态指示器 -->
|
||||||
|
<view class="flex items-baseline justify-center align-middle">
|
||||||
|
<!-- 状态点 -->
|
||||||
|
<view class="mr-8rpx h-12rpx w-12rpx flex-shrink-0 rounded-full"
|
||||||
|
:style="{ backgroundColor: getStatusConfig(room.status).color }" />
|
||||||
|
<!-- 状态文字 -->
|
||||||
|
<view class="text-24rpx text-[#303133] leading-34rpx"
|
||||||
|
:style="{ color: getStatusConfig(room.status).color }">
|
||||||
|
{{ getStatusConfig(room.status).text }}
|
||||||
|
</view>
|
||||||
|
<!-- 右箭头 -->
|
||||||
|
<view class="ml-8rpx">
|
||||||
|
<wd-icon name="arrow-right" size="12px" :color="getStatusConfig(room.status).color" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { router } from '@/utils/tools'
|
import { router } from '@/utils/tools'
|
||||||
|
|
||||||
@ -121,59 +174,6 @@ function getStatusConfig(status: RoomStatus) {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
|
||||||
<view>
|
|
||||||
<!-- 导航栏 -->
|
|
||||||
<view>
|
|
||||||
<navbar title="包间管理" custom-class="!bg-white" />
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 房间列表 -->
|
|
||||||
<view class="px-30rpx pb-40rpx pt-30rpx">
|
|
||||||
<view class="grid grid-cols-2 gap-24rpx">
|
|
||||||
<view v-for="room in roomList" :key="room.id"
|
|
||||||
class="flex flex-col overflow-hidden rounded-16rpx bg-white"
|
|
||||||
@click="RoomManage.handleClickRoom(room)">
|
|
||||||
<!-- 房间图片 -->
|
|
||||||
<view class="relative aspect-[4/3] w-full">
|
|
||||||
<wd-img width="100%" height="100%" :src="room.image" mode="aspectFill" />
|
|
||||||
<!-- 编辑图标覆盖层 -->
|
|
||||||
<view
|
|
||||||
class="absolute right-16rpx top-16rpx h-48rpx w-48rpx flex items-center justify-center rounded-24rpx bg-black bg-opacity-40"
|
|
||||||
@click.stop="RoomManage.handleEditImage(room, $event)">
|
|
||||||
<wd-icon name="edit" size="16px" color="#fff" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 房间信息 -->
|
|
||||||
<view class="flex flex-col p-24rpx">
|
|
||||||
<!-- 房间名称 -->
|
|
||||||
<view class="mb-0rpx text-center text-28rpx text-[#303133] leading-40rpx">
|
|
||||||
{{ room.name }} ({{ room.type }})
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 状态指示器 -->
|
|
||||||
<view class="flex items-baseline justify-center align-middle">
|
|
||||||
<!-- 状态点 -->
|
|
||||||
<view class="mr-8rpx h-12rpx w-12rpx flex-shrink-0 rounded-full"
|
|
||||||
:style="{ backgroundColor: getStatusConfig(room.status).color }" />
|
|
||||||
<!-- 状态文字 -->
|
|
||||||
<view class="text-24rpx text-[#303133] leading-34rpx"
|
|
||||||
:style="{ color: getStatusConfig(room.status).color }">
|
|
||||||
{{ getStatusConfig(room.status).text }}
|
|
||||||
</view>
|
|
||||||
<!-- 右箭头 -->
|
|
||||||
<view class="ml-8rpx">
|
|
||||||
<wd-icon name="arrow-right" size="12px" :color="getStatusConfig(room.status).color" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background: #f6f7f8;
|
background: #f6f7f8;
|
||||||
|
|||||||
Reference in New Issue
Block a user