This commit is contained in:
李志鹏
2026-04-09 11:40:17 +08:00
parent 2b4e77f4e1
commit b50c471e97
11 changed files with 490 additions and 117 deletions

View File

@@ -5,13 +5,7 @@
<div class="title">Brand Information</div>
<div class="tip">Share a few details to set up your seller profile</div>
<div class="form">
<a-form
:model="formData"
:rules="formRules"
layout="vertical"
class="my-form"
ref="formRef"
>
<a-form :model="formData" :rules="formRules" layout="vertical" ref="formRef">
<a-form-item label="Store Name" name="storeName">
<a-input
v-model:value="formData.storeName"
@@ -154,6 +148,7 @@
}
</script>
<style scoped lang="less">
@import "@/assets/style/ant-from-style.less";
.seller-apply {
width: 100%;
height: 100%;
@@ -257,97 +252,4 @@
}
}
}
:deep(.my-form) {
.form-group {
display: flex;
gap: 1.6rem;
.ant-form-item {
flex: 1;
}
}
.ant-form-item {
margin-bottom: 1.6rem;
position: relative;
.tip-length {
user-select: none;
pointer-events: none;
position: absolute;
bottom: 1rem;
right: 1.6rem;
font-family: pingfang_regular;
font-size: 1rem;
color: #df2c2c;
}
.ant-form-item-explain,
.ant-form-item-explain-connected {
min-height: 0;
}
.ant-form-item-explain-error {
font-size: 1.2rem;
}
}
.ant-form-item-label {
display: flex;
padding: 0 0 0.6rem 0;
> label {
font-family: pingfang_medium;
font-size: 1.4rem;
line-height: 150%;
&.ant-form-item-required:not(.ant-form-item-required-mark-optional) {
&::before {
content: "";
}
&:after {
display: inline-block;
color: #df2c2c;
font-size: 1.4rem;
content: "*";
}
}
}
}
.ant-form-item-control-input {
.ant-input-affix-wrapper,
textarea,
input {
border-radius: 1.2rem;
border: 0.16rem solid #d1d1d1;
font-family: pingfang_regular;
font-size: 1.4rem;
color: #000;
padding: 1.6rem;
&::placeholder {
color: #999;
}
}
.ant-input-affix-wrapper {
margin-bottom: 0.6rem;
&:last-child {
margin-bottom: 0;
}
.ant-input-prefix {
width: 5.2rem;
font-size: 1.4rem;
line-height: 150%;
color: #000;
justify-content: center;
text-align: center;
}
input {
border: none;
height: 100%;
padding: 0 1.6rem;
border-radius: 0;
}
}
input {
height: 5rem;
}
textarea {
height: 11rem;
resize: none;
}
}
}
</style>

View File

@@ -0,0 +1,154 @@
<template>
<div class="brand-info">
<a-form :model="formData" :rules="formRules" layout="vertical" ref="formRef">
<a-form-item label="Store Name" name="storeName">
<a-input
v-model:value="formData.storeName"
placeholder="Enter the store name"
:maxlength="80"
/>
<span class="tip-length">{{ formData.storeName.length }}/80</span>
</a-form-item>
<a-form-item label="Owners Full Name" name="fullName">
<a-input
v-model:value="formData.fullName"
placeholder="Enter store owner's full name"
/>
</a-form-item>
<div class="form-group">
<a-form-item label="Email" name="email">
<a-input
type="email"
v-model:value="formData.email"
placeholder="Enter email"
/>
</a-form-item>
<a-form-item label="Phone Number" name="phoneNumber">
<a-input
type="tel"
v-model:value="formData.phoneNumber"
placeholder="Enter phone number"
/>
</a-form-item>
</div>
<a-form-item label="Store Description" name="description">
<a-textarea
v-model:value="formData.description"
placeholder="Briefly describe your design style and store features..."
:maxlength="500"
/>
<span class="tip-length">{{ formData.description.length }}/500</span>
</a-form-item>
<a-form-item label="Portfoilo/Social Media Links">
<a-input
placeholder="https://"
v-for="(v, i) in formData.links"
:key="i"
v-model:value="formData.links[i]"
>
<template #prefix>Link {{ i + 1 }}</template>
</a-input>
<a-input
placeholder="https://"
v-model:value="newLink"
@keyup.enter.prevent="addLink"
>
<template #prefix>
<span @click="addLink" style="cursor: pointer">
<svg-icon name="seller-add" size="20" />
</span>
</template>
</a-input>
</a-form-item>
</a-form>
<div class="btns">
<button class="cancel" @click="onCancel">Cancel</button>
<button class="submit" :disabled="!isAgreement" @click="onSubmit">
Submit Application
</button>
</div>
</div>
</template>
<script setup>
import { ref, reactive } from "vue"
import { useRoute, useRouter } from "vue-router"
const route = useRoute()
const router = useRouter()
const emit = defineEmits(["submit"])
const formRules = {
storeName: [{ required: true, message: "Enter the store name" }],
fullName: [{ required: true, message: "Enter store owner's full name" }],
email: [{ required: true, message: "Enter email" }],
phoneNumber: [{ required: true, message: "Enter phone number" }],
description: [{ required: true, message: "Enter store description" }]
}
const formRef = ref(null)
const formData = reactive({
storeName: "",
fullName: "",
email: "",
phoneNumber: "",
description: "",
links: ["", ""]
})
const isAgreement = ref(false)
const newLink = ref("")
const addLink = () => {
formData.links.push(newLink.value)
newLink.value = ""
}
const onCancel = () => {
router.back()
}
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
console.log(formData)
emit("submit")
})
.catch(() => {
console.log("validate failed")
})
}
</script>
<style scoped lang="less">
@import "@/assets/style/ant-from-style.less";
.brand-info {
// width: 100%;
// height: 100%;
// overflow: hidden;
// padding: 0 10rem;
> .btns {
margin-top: 3.9rem;
display: flex;
justify-content: flex-end;
gap: 1.6rem;
> button {
height: 6rem;
border-radius: 6rem;
padding: 0 4rem;
background-color: #000;
color: #fff;
font-size: 1.6rem;
border: none;
cursor: pointer;
&:active:not(:disabled) {
opacity: 0.8;
}
&:disabled {
opacity: 0.5;
cursor: not-allowed;
}
}
> .cancel {
background-color: #fff;
color: #000;
border: 0.15rem solid #000;
}
}
}
</style>

View File

@@ -1,13 +1,112 @@
<template>
<div class="brand-profile-index">brand-profile-index</div>
<div class="brand-profile-index">
<div class="header">
<div class="bg">
<img v-if="banner" :src="banner" />
<div v-else class="null">
<span class="icon"><svg-icon name="seller-picture" size="60" /></span>
<span class="tip">Your brand banner has not been set up yet.</span>
</div>
<button>Change Brand Banner</button>
</div>
<!-- 头像 -->
<div class="avatar">
<img v-if="avatar" :src="avatar" />
<div v-else class="null">
<svg-icon name="seller-user" size="48" />
</div>
<span class="icon">
<svg-icon name="seller-camera" size="24" />
</span>
</div>
</div>
<brand-info />
</div>
</template>
<script lang="ts" setup>
<script setup>
import { ref } from "vue"
import BrandInfo from "./brand-info.vue"
const banner = ref("http://118.31.39.42:3000/falls/5bd8065cbb396eb5a8ef0a142605139358734e57.png")
const avatar = ref("http://118.31.39.42:3000/falls/20251024140128_10355_1.jpg")
</script>
<style scoped lang="less">
.seller-dashboard-index {
width: 100%;
height: 100%;
overflow: hidden;
.brand-profile-index {
flex: 1;
overflow-y: auto;
padding: 0 8rem;
margin: 0 7rem;
> .header {
position: relative;
margin-bottom: 6rem;
> .bg {
position: relative;
> img {
width: 100%;
height: auto;
border-radius: 1.2rem;
}
> .null {
width: 100%;
height: 23rem;
border-radius: 1.2rem;
border: 1px dashed #b0b0b0;
background: #f9f9f9;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
> .tip {
margin-top: 1.2rem;
font-family: pingfang_medium;
font-size: 1.6rem;
color: rgba(153, 153, 153, 0.6);
}
}
> button {
position: absolute;
bottom: 1.6rem;
right: 1.6rem;
padding: 0 2.7rem;
border-radius: 4rem;
height: 4.5rem;
border: none;
background-color: #fff;
box-shadow: 0.2rem 0.2rem 1.2rem 0 rgba(0, 0, 0, 0.1);
font-family: pingfang_medium;
font-size: 1.6rem;
cursor: pointer;
color: #000;
&:active {
opacity: 0.8;
}
}
}
> .avatar {
position: absolute;
left: 6rem;
bottom: -4rem;
> img,
> .null {
width: 12rem;
height: 12rem;
border-radius: 1.2rem;
border: 0.15rem solid #919191;
}
> .null {
background-color: #f2f1f1;
}
> .icon {
position: absolute;
width: 5rem;
height: 5rem;
border-radius: 50%;
background: rgba(146, 146, 146, 0.96);
right: -1.6rem;
bottom: -1.6rem;
cursor: pointer;
}
}
}
}
</style>

View File

@@ -12,17 +12,15 @@
</div>
</div>
<div class="view">
<router-view></router-view>
</div>
<toolTipBox v-model:visible="visible" @close="()=>{}"></toolTipBox>
<router-view></router-view>
<toolTipBox v-model:visible="visible" @close="() => {}"></toolTipBox>
</div>
</template>
<script setup>
import { ref, computed } from "vue"
import { useRoute, useRouter } from "vue-router"
import toolTipBox from './toolTipBox.vue'
import toolTipBox from "./toolTipBox.vue"
const route = useRoute()
const router = useRouter()
const visible = ref(false)
@@ -58,7 +56,6 @@
.seller-dashboard-index {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
display: flex;
flex-direction: column;
@@ -67,6 +64,7 @@
display: flex;
align-items: center;
gap: 3.6rem;
margin-bottom: 4rem;
> div {
width: 18rem;
height: 6rem;
@@ -100,9 +98,5 @@
}
}
}
> .view {
margin-top: 4rem;
flex: 1;
}
}
</style>

View File

@@ -51,7 +51,7 @@
<style scoped lang="less">
.seller-header {
width: 100%;
height: 6rem;
min-height: 6rem;
display: flex;
align-items: center;
gap: 2.4rem;