添加资质信息

This commit is contained in:
wangxiaowei
2026-02-11 17:17:45 +08:00
parent a84d817bfc
commit 40f1307161
8 changed files with 493 additions and 94 deletions

View File

@ -1,6 +1,6 @@
<route lang="jsonc" type="page">{
"layout": "tabbar",
"needLogin": true,
"needLogin": true,
"style": {
"navigationStyle": "custom"
}
@ -12,7 +12,7 @@
:style="{ backgroundImage: `url('${OSS}images/store/my/image2.png')` }">
<wd-navbar safe-area-inset-top :bordered="false" custom-style="background-color: transparent !important;">
<template #left>
<view class="ml-16rpx flex items-center"/>
<view class="ml-16rpx flex items-center" />
</template>
<template #right>
<view class="right-slot mr-16rpx">
@ -29,7 +29,8 @@
<view class="user-info-bg relative z-10 ml-30rpx mr-30rpx flex items-center"
:style="{ backgroundImage: `url('${OSS}images/store/my/image2.png')` }">
<view class="relative z-10">
<wd-img width="120rpx" height="120rpx" :src="(isLogin && user.avatar) ? user.avatar : `${OSS}images/store/my/image1.png`"
<wd-img width="120rpx" height="120rpx"
:src="(isLogin && user.avatar) ? user.avatar : `${OSS}images/store/my/image1.png`"
mode="aspectFill" round />
</view>
<view class="relative z-10 ml-22rpx flex flex-1 items-center justify-between">
@ -53,86 +54,120 @@
¥{{ isLogin ? user.user_money : '0.00' }}
</view>
</view>
<view class="ml-0rpx mt-4rpx text-20rpx text-[#909399] leading-28rpx" @click="My.handleToWallet">
<view class="ml-0rpx mt-4rpx text-20rpx text-[#909399] leading-28rpx"
@click="My.handleToWallet">
钱包余额
</view>
</view>
</view>
</view>
</view>
<!-- <view class="tabs">
<wd-tabs v-model="tab" swipeable slidable="always" :lazy="false">
<wd-tab title="门店信息"></wd-tab>
<wd-tab title="门店服务"></wd-tab>
</wd-tabs>
</view> -->
<!-- 门店信息区域 -->
<view class="store-info-card mt-28rpx bg-white py-30rpx pl-30rpx">
<view class="mb-24rpx text-32rpx text-[#303133] font-bold leading-44rpx">
{{ storeInfo.name }}
</view>
<view class="mb-16rpx flex items-center text-24rpx text-[#606266] leading-40rpx">
<text class="w-140rpx">门店ID:</text>
<text class="flex-1 text-[#000]">{{ storeInfo.id > 0 ? storeInfo.id : '-'}}</text>
</view>
<view class="mb-16rpx flex items-center text-24rpx text-[#606266] leading-40rpx">
<text class="w-140rpx">门店地址:</text>
<text class="flex-1 text-[#000]">{{ storeInfo.address || '-' }}</text>
</view>
<view class="relative mb-16rpx flex items-center">
<view class="flex items-center text-24rpx text-[#606266] leading-40rpx">
<text class="w-140rpx">营业时间:</text>
<text class="flex-1 text-[#000]">{{ `${storeInfo.start_time }-${storeInfo.end_time }` || '-' }}</text>
</view>
<view class="modify-btn absolute right-0 flex items-center px-20rpx py-8rpx"
:style="{ backgroundImage: `url('${OSS}images/store/my/image3.png')` }"
@click="router.navigateTo('/bundle/store/edit-store')">
<wd-img width="24rpx" height="24rpx" :src="`${OSS}images/store/my/image4.png`" class="mr-8rpx" />
<text class="text-24rpx text-[#fff]">修改</text>
</view>
</view>
<view class="flex items-center text-24rpx text-[#606266] leading-40rpx" @click="My.handleCall(storeInfo.contact_phone)">
<text class="w-140rpx">联系电话:</text>
<text class="flex-1 text-[#000]">{{ storeInfo.contact_phone || '-' }}</text>
</view>
</view>
<!-- 门店视频/图片区域 -->
<view class="bg-white px-30rpx">
<view class="mb-24rpx text-32rpx text-[#303133] font-bold leading-44rpx">
<!-- 门店视频/图片 -->
门店图片
<view class="store-info-card mt-28rpx bg-white pt-10rpx pl-30rpx">
<view class="my-tabs">
<wd-tabs v-model="tab" swipeable slidable="always" :lazy="false">
<wd-tab title="门店信息"></wd-tab>
<wd-tab title="门店服务"></wd-tab>
</wd-tabs>
</view>
<view class="grid grid-cols-3 gap-16rpx">
<view v-for="(item, index) in storeMediaList" :key="index"
class="relative aspect-square w-full overflow-hidden rounded-8rpx"
@click="My.handlePreviewMedia(index)">
<wd-img width="100%" height="100%" :src="item" mode="aspectFill" />
<!-- 视频播放图标 -->
<!-- <view v-if="item.type === 'video'" class="absolute inset-0 flex items-center justify-center">
<wd-img width="60rpx" height="60rpx" :src="`${OSS}images/store/my/image5.png')`" />
</view> -->
<!-- 超出6张显示遮罩 -->
<view v-if="mediaCount > 6 && index === 5"
class="absolute inset-0 flex items-center justify-center bg-black bg-opacity-50">
<text class="text-32rpx text-[#fff] font-bold">+{{ Number(mediaCount - 6) }}</text>
<template v-if="tab == 0">
<view class="mt-34rpx">
<view class="mb-24rpx text-32rpx text-[#303133] font-bold leading-44rpx">
{{ storeInfo.name }}
</view>
<view class="mb-16rpx flex items-center text-24rpx text-[#606266] leading-40rpx">
<text class="w-140rpx">门店ID:</text>
<text class="flex-1 text-[#000]">{{ storeInfo.id > 0 ? storeInfo.id : '-' }}</text>
</view>
<view class="mb-16rpx flex items-center text-24rpx text-[#606266] leading-40rpx">
<text class="w-140rpx">门店地址:</text>
<text class="flex-1 text-[#000]">{{ storeInfo.address || '-' }}</text>
</view>
<view class="relative mb-16rpx flex items-center">
<view class="flex items-center text-24rpx text-[#606266] leading-40rpx">
<text class="w-140rpx">营业时间:</text>
<text class="flex-1 text-[#000]">{{ `${storeInfo.start_time}-${storeInfo.end_time}` ||
'-' }}</text>
</view>
<view class="modify-btn absolute right-0 flex items-center px-20rpx py-8rpx"
:style="{ backgroundImage: `url('${OSS}images/store/my/image3.png')` }"
@click="router.navigateTo('/bundle/store/edit-store')">
<wd-img width="24rpx" height="24rpx" :src="`${OSS}images/store/my/image4.png`"
class="mr-8rpx" />
<text class="text-24rpx text-[#fff]">修改</text>
</view>
</view>
<view class="flex items-center text-24rpx text-[#606266] leading-40rpx"
@click="My.handleCall(storeInfo.contact_phone)">
<text class="w-140rpx">联系电话:</text>
<text class="flex-1 text-[#000]">{{ storeInfo.contact_phone || '-' }}</text>
</view>
<!-- 门店视频/图片区域 -->
<view class="bg-white mt-40rpx">
<view class="mb-24rpx text-32rpx text-[#303133] font-bold leading-44rpx">
<!-- 门店视频/图片 -->
门店图片
</view>
<view class="grid grid-cols-3 gap-16rpx">
<view v-for="(item, index) in storeMediaList" :key="index"
class="relative aspect-square w-full overflow-hidden rounded-8rpx"
@click="My.handlePreviewMedia(index)">
<wd-img width="100%" height="100%" :src="item" mode="aspectFill" />
<!-- 视频播放图标 -->
<!-- <view v-if="item.type === 'video'" class="absolute inset-0 flex items-center justify-center">
<wd-img width="60rpx" height="60rpx" :src="`${OSS}images/store/my/image5.png')`" />
</view> -->
<!-- 超出6张显示遮罩 -->
<view v-if="mediaCount > 6 && index === 5"
class="absolute inset-0 flex items-center justify-center bg-black bg-opacity-50">
<text class="text-32rpx text-[#fff] font-bold">+{{ Number(mediaCount - 6)
}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<template v-if="tab == 1">
<view class="mt-34rpx">
<view class="flex flex-col items-center justify-center w-20%" @click="My.handleToLicense">
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_card3.png`" />
<view class="font-400 text-24rpx text-[#000]">资质信息</view>
</view>
</view>
</template>
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import type { IUserResult } from '@/api/types/user'
import { getUserInfo, getUserBalance } from '@/api/user'
import { useUserStore, useStoreStore } from '@/store'
import { router } from '@/utils/tools'
import { getStoreDetails } from '@/api/store'
import { getStoreDetails, getStoreQual } from '@/api/store'
const OSS = inject('OSS')
const navbarHeight = inject('navbarHeight')
const rightPadding = inject('capsuleOffset')
const useStore = useStoreStore()
// tab
const tab = ref<number>(0)
// 登录信息相关
const user = ref<IUserResult>({
id: 0,
@ -170,7 +205,6 @@ const storeInfo = ref({
const storeMediaList = ref([])
const mediaCount = ref<number>(0)
onShow(async () => {
const userStore = useUserStore()
isLogin.value = userStore.isLoggedIn
@ -181,7 +215,6 @@ onShow(async () => {
// 获取用户余额
const res2 = await getUserBalance(useStore.defaultStore.id)
console.log("🚀 ~ res2:", res2)
user.value.user_money = res2.store_msg.balance || '0.00'
userStore.setUserMoney(Number(user.value.user_money))
}
@ -204,7 +237,6 @@ onLoad(() => {
user.value[key] = ''
})
})
})
onUnload(() => {
@ -252,7 +284,7 @@ const My = {
// 预览媒体(视频/图片)
handlePreviewMedia: (index: number) => {
const urls = storeInfo.value.image_arr.map(item => item)
uni.previewImage({
current: index,
urls,
@ -302,49 +334,90 @@ const My = {
if (account.length <= 7)
return account
return `${account.substring(0, 3)}****${account.substring(account.length - 4)}`
},
/**
* 跳转到资质信息页面
*/
handleToLicense: async () => {
const res = await getStoreQual(storeInfo.value.id)
if (res.details) {
router.navigateTo('/bundle/store-license/license')
} else {
router.navigateTo('/bundle/store-license/add-guide')
}
}
}
</script>
<style lang="scss">
page {
background: #fff;
}
page {
background: #fff;
}
.home-bg {
background-size: 100% 100%;
background-repeat: no-repeat;
background-position: top center;
min-height: 450rpx;
}
.home-bg {
background-size: 100% 100%;
background-repeat: no-repeat;
background-position: top center;
min-height: 450rpx;
}
.user-info-bg {
background-size: 100% auto;
background-repeat: no-repeat;
background-position: top center;
padding-top: 20rpx;
padding-bottom: 20rpx;
min-height: 200rpx;
}
.user-info-bg {
background-size: 100% auto;
background-repeat: no-repeat;
background-position: top center;
padding-top: 20rpx;
padding-bottom: 20rpx;
min-height: 200rpx;
}
.store-info-card {
position: relative;
z-index: 10;
border-radius: 32rpx 32rpx 0 0;
}
.store-info-card {
position: relative;
z-index: 10;
border-radius: 32rpx 32rpx 0 0;
}
.modify-btn {
position: absolute;
background-size: 100% 100%;
background-repeat: no-repeat;
background-position: center;
min-width: 160rpx;
height: 90rpx;
justify-content: space-around;
}
.modify-btn {
position: absolute;
background-size: 100% 100%;
background-repeat: no-repeat;
background-position: center;
min-width: 160rpx;
height: 90rpx;
justify-content: space-around;
}
.right-slot {
padding-right: v-bind(rightPadding);
.right-slot {
padding-right: v-bind(rightPadding);
}
.my-tabs {
:deep() {
.wd-tabs,
.wd-tabs__nav {
background-color: transparent !important;
}
.wd-tabs__nav-item {
font-size: 30rpx !important;
color: #606266 !important;
line-height: 40rpx !important;
padding: 0 30rpx !important;
}
.wd-tabs__nav-item.is-active {
color: #303133 !important;
font-size: 30rpx !important;
line-height: 44rpx !important;
}
.wd-tabs__line {
background-color: #303133 !important;
width: 72rpx !important;
border-radius: 6rpx;
}
}
}
</style>