增加发布协议确认配置
This commit is contained in:
@@ -47,6 +47,9 @@ type CreateRequest struct {
|
|||||||
ScreenshotURLS []string `json:"screenshot_urls"`
|
ScreenshotURLS []string `json:"screenshot_urls"`
|
||||||
Price float64 `json:"price"`
|
Price float64 `json:"price"`
|
||||||
DepositAmount float64 `json:"deposit_amount"`
|
DepositAmount float64 `json:"deposit_amount"`
|
||||||
|
|
||||||
|
AgreedVirtualAssetSale bool `json:"agreed_virtual_asset_sale"`
|
||||||
|
AgreedSellerAgreement bool `json:"agreed_seller_agreement"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateRequest = CreateRequest
|
type UpdateRequest = CreateRequest
|
||||||
|
|||||||
@@ -577,6 +577,8 @@ func writeListingError(c *gin.Context, err error) {
|
|||||||
response.BadRequest(c, "哈夫币数量不正确")
|
response.BadRequest(c, "哈夫币数量不正确")
|
||||||
case errors.Is(err, ErrMissingScreenshot):
|
case errors.Is(err, ErrMissingScreenshot):
|
||||||
response.BadRequest(c, "请至少上传一张账号截图")
|
response.BadRequest(c, "请至少上传一张账号截图")
|
||||||
|
case errors.Is(err, ErrAgreementRequired):
|
||||||
|
response.BadRequest(c, "请先阅读并同意发布协议")
|
||||||
case errors.Is(err, ErrMissingUploaderName):
|
case errors.Is(err, ErrMissingUploaderName):
|
||||||
response.BadRequest(c, "上传人名称不能为空")
|
response.BadRequest(c, "上传人名称不能为空")
|
||||||
case errors.Is(err, ErrMissingUploadData):
|
case errors.Is(err, ErrMissingUploadData):
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ var (
|
|||||||
ErrDepositTooLow = errors.New("listing deposit too low")
|
ErrDepositTooLow = errors.New("listing deposit too low")
|
||||||
ErrInvalidHafCoin = errors.New("invalid haf coin amount")
|
ErrInvalidHafCoin = errors.New("invalid haf coin amount")
|
||||||
ErrMissingScreenshot = errors.New("missing screenshot")
|
ErrMissingScreenshot = errors.New("missing screenshot")
|
||||||
|
ErrAgreementRequired = errors.New("listing publish agreement required")
|
||||||
ErrMissingUploaderName = errors.New("missing uploader name")
|
ErrMissingUploaderName = errors.New("missing uploader name")
|
||||||
ErrMissingUploadData = errors.New("missing upload data")
|
ErrMissingUploadData = errors.New("missing upload data")
|
||||||
ErrUploaderNotFound = errors.New("uploader not found")
|
ErrUploaderNotFound = errors.New("uploader not found")
|
||||||
@@ -80,6 +81,9 @@ func (s *Service) Create(ownerID uint64, req CreateRequest) (*ListingDTO, error)
|
|||||||
if s.repo == nil {
|
if s.repo == nil {
|
||||||
return nil, ErrDependencyUnavailable
|
return nil, ErrDependencyUnavailable
|
||||||
}
|
}
|
||||||
|
if !req.AgreedVirtualAssetSale || !req.AgreedSellerAgreement {
|
||||||
|
return nil, ErrAgreementRequired
|
||||||
|
}
|
||||||
rules, err := s.publishRules()
|
rules, err := s.publishRules()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@@ -58,6 +58,15 @@ func TestValidateRequestRequiresDepositAboveConsumables(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestCreateRequiresPublishAgreements(t *testing.T) {
|
||||||
|
service := NewService(&Repository{}, nil)
|
||||||
|
|
||||||
|
_, err := service.Create(1, CreateRequest{})
|
||||||
|
if err != ErrAgreementRequired {
|
||||||
|
t.Fatalf("expected ErrAgreementRequired, got %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestApplySellerListingPriceUsesSellerTotalPrice(t *testing.T) {
|
func TestApplySellerListingPriceUsesSellerTotalPrice(t *testing.T) {
|
||||||
item := &ListingDTO{
|
item := &ListingDTO{
|
||||||
Price: 238,
|
Price: 238,
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ type OrderAgreementsDTO struct {
|
|||||||
RenterAgreement AgreementContentDTO `json:"renter_agreement"`
|
RenterAgreement AgreementContentDTO `json:"renter_agreement"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ListingPublishAgreementsDTO struct {
|
||||||
|
VirtualAssetSale AgreementContentDTO `json:"virtual_asset_sale"`
|
||||||
|
SellerAgreement AgreementContentDTO `json:"seller_agreement"`
|
||||||
|
}
|
||||||
|
|
||||||
type PostRentalNoticeDTO struct {
|
type PostRentalNoticeDTO struct {
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
|
|||||||
@@ -54,6 +54,15 @@ func (h *Handler) OrderAgreements(c *gin.Context) {
|
|||||||
response.OK(c, agreements)
|
response.OK(c, agreements)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *Handler) ListingPublishAgreements(c *gin.Context) {
|
||||||
|
agreements, err := h.service.ListingPublishAgreements()
|
||||||
|
if err != nil {
|
||||||
|
writeConfigError(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OK(c, agreements)
|
||||||
|
}
|
||||||
|
|
||||||
func (h *Handler) PostRentalNotice(c *gin.Context) {
|
func (h *Handler) PostRentalNotice(c *gin.Context) {
|
||||||
notice, err := h.service.PostRentalNotice()
|
notice, err := h.service.PostRentalNotice()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package systemconfig
|
||||||
|
|
||||||
|
import "encoding/json"
|
||||||
|
|
||||||
|
const listingPublishAgreementsConfigKey = "listing.publish_agreements"
|
||||||
|
|
||||||
|
func defaultListingPublishAgreementsConfigValue() string {
|
||||||
|
raw, err := json.Marshal(DefaultListingPublishAgreements())
|
||||||
|
if err != nil {
|
||||||
|
return "{}"
|
||||||
|
}
|
||||||
|
return string(raw)
|
||||||
|
}
|
||||||
|
|
||||||
|
func DefaultListingPublishAgreements() ListingPublishAgreementsDTO {
|
||||||
|
return ListingPublishAgreementsDTO{
|
||||||
|
VirtualAssetSale: AgreementContentDTO{
|
||||||
|
Title: "虚拟资产出售协议",
|
||||||
|
Content: `请您在发布账号前仔细阅读并确认以下内容:
|
||||||
|
|
||||||
|
一、发布性质
|
||||||
|
1. 您发布的账号、哈夫币、皮肤、装备、消耗品等均属于游戏内虚拟资产或使用权益展示。
|
||||||
|
2. 虚拟资产受游戏厂商规则、版本更新、风控策略和账号状态影响,平台不承诺其具备现实货币价值或永久可用性。
|
||||||
|
3. 您应确保发布信息真实、完整、可交接,且与截图材料和账号实际资产一致。
|
||||||
|
|
||||||
|
二、风险告知
|
||||||
|
1. 发布账号后,买家下单前后可能因游戏环境变化、资产变动、封禁记录、登录限制等产生交易风险。
|
||||||
|
2. 若您隐瞒账号异常、资产缺失、封禁记录、不可用物资或其他影响交易的信息,平台可依据证据处理赔付、退款或下架。
|
||||||
|
3. 请勿绕过平台私下收款、私下交接或诱导用户脱离平台沟通,否则平台可能限制账号发布权限。
|
||||||
|
|
||||||
|
三、费用与结算
|
||||||
|
1. 发布价格、押金、额外消耗品价值以平台发布页和订单页面展示为准。
|
||||||
|
2. 订单完成后,平台将按订单记录、结账结果和相关规则进行结算。
|
||||||
|
3. 若发生争议,平台将依据订单记录、资产快照、聊天记录、截图证据和双方说明进行处理。`,
|
||||||
|
},
|
||||||
|
SellerAgreement: AgreementContentDTO{
|
||||||
|
Title: "号主协议",
|
||||||
|
Content: `请您作为号主在发布账号前确认并遵守以下约定:
|
||||||
|
|
||||||
|
一、账号发布义务
|
||||||
|
1. 您应如实填写区服、段位、哈夫币数量、保险、体力、负重、登录方式、封禁记录、常用地区和备注信息。
|
||||||
|
2. 您应上传真实、清晰、可核验的账号截图材料,不得使用伪造、过期或与账号不一致的截图。
|
||||||
|
3. 您不得发布盗号、黑号、纠纷账号、已被限制使用账号或无法完成正常交接的账号。
|
||||||
|
|
||||||
|
二、交接与协作
|
||||||
|
1. 买家下单后,您应在平台要求时间内完成交接,及时响应扫码、人脸冻结、登录验证等流程。
|
||||||
|
2. 您应在租用期间保持可联系状态,不得无故拒绝交接、恶意拖延或私下更改交易条件。
|
||||||
|
3. 租用结束后,请按平台流程确认归还和结账,配合核验资产状态。
|
||||||
|
|
||||||
|
三、责任承担
|
||||||
|
1. 因您发布信息不实、交接不及时、账号异常隐瞒或私下交易造成的损失,平台可依据规则处理退款、赔付、下架或限制发布。
|
||||||
|
2. 因租客违规使用造成的损失,您应通过平台流程提交证据并配合争议处理。
|
||||||
|
3. 您同意平台依据订单记录、资产快照、聊天记录、截图证据和相关规则处理结算、赔付及争议。`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,6 +31,7 @@ var defaultConfigs = []defaultConfig{
|
|||||||
{Key: "order.pending_payment_timeout_minutes", Value: "15", Description: "订单待支付超时取消分钟数"},
|
{Key: "order.pending_payment_timeout_minutes", Value: "15", Description: "订单待支付超时取消分钟数"},
|
||||||
{Key: "order.return_overdue_grace_minutes", Value: "10", Description: "预计截止后结账宽限分钟数"},
|
{Key: "order.return_overdue_grace_minutes", Value: "10", Description: "预计截止后结账宽限分钟数"},
|
||||||
{Key: "listing.review_required", Value: "false", Description: "发布账号是否需要后台人工审核"},
|
{Key: "listing.review_required", Value: "false", Description: "发布账号是否需要后台人工审核"},
|
||||||
|
{Key: listingPublishAgreementsConfigKey, Value: defaultListingPublishAgreementsConfigValue(), Description: "发布账号前协议配置 JSON"},
|
||||||
{Key: orderAgreementsConfigKey, Value: defaultOrderAgreementsConfigValue(), Description: "下单前协议配置 JSON"},
|
{Key: orderAgreementsConfigKey, Value: defaultOrderAgreementsConfigValue(), Description: "下单前协议配置 JSON"},
|
||||||
{Key: postRentalNoticeConfigKey, Value: defaultPostRentalNoticeConfigValue(), Description: "租后须知配置 JSON"},
|
{Key: postRentalNoticeConfigKey, Value: defaultPostRentalNoticeConfigValue(), Description: "租后须知配置 JSON"},
|
||||||
{Key: "chat.default_support_admin_id", Value: "1", Description: "订单群聊回退客服 ID(仅当无可用客服时使用)"},
|
{Key: "chat.default_support_admin_id", Value: "1", Description: "订单群聊回退客服 ID(仅当无可用客服时使用)"},
|
||||||
@@ -47,6 +48,7 @@ var adminVisibleConfigKeys = []string{
|
|||||||
"handoff.owner_return_confirm_timeout_minutes",
|
"handoff.owner_return_confirm_timeout_minutes",
|
||||||
"handoff.owner_submit_timeout_minutes",
|
"handoff.owner_submit_timeout_minutes",
|
||||||
"handoff.renter_confirm_timeout_minutes",
|
"handoff.renter_confirm_timeout_minutes",
|
||||||
|
"listing.publish_agreements",
|
||||||
"listing.publish_options",
|
"listing.publish_options",
|
||||||
"listing.review_required",
|
"listing.review_required",
|
||||||
"listing.sale_price_config",
|
"listing.sale_price_config",
|
||||||
|
|||||||
@@ -59,6 +59,17 @@ func (s *Service) OrderAgreements() (*OrderAgreementsDTO, error) {
|
|||||||
return &agreements, nil
|
return &agreements, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Service) ListingPublishAgreements() (*ListingPublishAgreementsDTO, error) {
|
||||||
|
if s.repo == nil {
|
||||||
|
return nil, ErrDependencyUnavailable
|
||||||
|
}
|
||||||
|
agreements, err := s.listingPublishAgreements()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &agreements, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Service) PostRentalNotice() (*PostRentalNoticeDTO, error) {
|
func (s *Service) PostRentalNotice() (*PostRentalNoticeDTO, error) {
|
||||||
if s.repo == nil {
|
if s.repo == nil {
|
||||||
return nil, ErrDependencyUnavailable
|
return nil, ErrDependencyUnavailable
|
||||||
@@ -109,6 +120,19 @@ func (s *Service) orderAgreements() (OrderAgreementsDTO, error) {
|
|||||||
return agreements, nil
|
return agreements, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Service) listingPublishAgreements() (ListingPublishAgreementsDTO, error) {
|
||||||
|
value, err := s.repo.FindValue(listingPublishAgreementsConfigKey)
|
||||||
|
if err != nil {
|
||||||
|
return ListingPublishAgreementsDTO{}, err
|
||||||
|
}
|
||||||
|
agreements := DefaultListingPublishAgreements()
|
||||||
|
if err := json.Unmarshal([]byte(value), &agreements); err != nil {
|
||||||
|
agreements = DefaultListingPublishAgreements()
|
||||||
|
}
|
||||||
|
normalizeListingPublishAgreements(&agreements)
|
||||||
|
return agreements, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Service) postRentalNotice() (PostRentalNoticeDTO, error) {
|
func (s *Service) postRentalNotice() (PostRentalNoticeDTO, error) {
|
||||||
value, err := s.repo.FindValue(postRentalNoticeConfigKey)
|
value, err := s.repo.FindValue(postRentalNoticeConfigKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -247,6 +271,26 @@ func normalizeOrderAgreements(agreements *OrderAgreementsDTO) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func normalizeListingPublishAgreements(agreements *ListingPublishAgreementsDTO) {
|
||||||
|
defaults := DefaultListingPublishAgreements()
|
||||||
|
agreements.VirtualAssetSale.Title = strings.TrimSpace(agreements.VirtualAssetSale.Title)
|
||||||
|
agreements.VirtualAssetSale.Content = strings.TrimSpace(agreements.VirtualAssetSale.Content)
|
||||||
|
agreements.SellerAgreement.Title = strings.TrimSpace(agreements.SellerAgreement.Title)
|
||||||
|
agreements.SellerAgreement.Content = strings.TrimSpace(agreements.SellerAgreement.Content)
|
||||||
|
if agreements.VirtualAssetSale.Title == "" {
|
||||||
|
agreements.VirtualAssetSale.Title = defaults.VirtualAssetSale.Title
|
||||||
|
}
|
||||||
|
if agreements.VirtualAssetSale.Content == "" {
|
||||||
|
agreements.VirtualAssetSale.Content = defaults.VirtualAssetSale.Content
|
||||||
|
}
|
||||||
|
if agreements.SellerAgreement.Title == "" {
|
||||||
|
agreements.SellerAgreement.Title = defaults.SellerAgreement.Title
|
||||||
|
}
|
||||||
|
if agreements.SellerAgreement.Content == "" {
|
||||||
|
agreements.SellerAgreement.Content = defaults.SellerAgreement.Content
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func normalizePostRentalNotice(notice *PostRentalNoticeDTO) {
|
func normalizePostRentalNotice(notice *PostRentalNoticeDTO) {
|
||||||
defaults := DefaultPostRentalNotice()
|
defaults := DefaultPostRentalNotice()
|
||||||
notice.Title = strings.TrimSpace(notice.Title)
|
notice.Title = strings.TrimSpace(notice.Title)
|
||||||
|
|||||||
@@ -240,6 +240,7 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
|
|||||||
{
|
{
|
||||||
api.GET("/health", health.Check)
|
api.GET("/health", health.Check)
|
||||||
api.GET("/listing-publish-options", systemConfigHandler.PublishOptions)
|
api.GET("/listing-publish-options", systemConfigHandler.PublishOptions)
|
||||||
|
api.GET("/listing-publish-agreements", systemConfigHandler.ListingPublishAgreements)
|
||||||
api.GET("/listing-sale-price-config", systemConfigHandler.SalePriceConfig)
|
api.GET("/listing-sale-price-config", systemConfigHandler.SalePriceConfig)
|
||||||
api.GET("/order-agreements", systemConfigHandler.OrderAgreements)
|
api.GET("/order-agreements", systemConfigHandler.OrderAgreements)
|
||||||
api.GET("/post-rental-notice", systemConfigHandler.PostRentalNotice)
|
api.GET("/post-rental-notice", systemConfigHandler.PostRentalNotice)
|
||||||
|
|||||||
@@ -0,0 +1,236 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { ref, watch } from 'vue'
|
||||||
|
|
||||||
|
import { updateSystemConfig, type SystemConfig } from '@/features/admin/api/systemConfigs'
|
||||||
|
import type { ListingPublishAgreements } from '@/features/listings/api/listingOptions'
|
||||||
|
import { safeParseJSON } from '@/utils/json'
|
||||||
|
|
||||||
|
const defaultListingPublishAgreements: ListingPublishAgreements = {
|
||||||
|
virtual_asset_sale: {
|
||||||
|
title: '虚拟资产出售协议',
|
||||||
|
content: `请您在发布账号前仔细阅读并确认以下内容:
|
||||||
|
|
||||||
|
一、发布性质
|
||||||
|
1. 您发布的账号、哈夫币、皮肤、装备、消耗品等均属于游戏内虚拟资产或使用权益展示。
|
||||||
|
2. 虚拟资产受游戏厂商规则、版本更新、风控策略和账号状态影响,平台不承诺其具备现实货币价值或永久可用性。
|
||||||
|
3. 您应确保发布信息真实、完整、可交接,且与截图材料和账号实际资产一致。
|
||||||
|
|
||||||
|
二、风险告知
|
||||||
|
1. 发布账号后,买家下单前后可能因游戏环境变化、资产变动、封禁记录、登录限制等产生交易风险。
|
||||||
|
2. 若您隐瞒账号异常、资产缺失、封禁记录、不可用物资或其他影响交易的信息,平台可依据证据处理赔付、退款或下架。
|
||||||
|
3. 请勿绕过平台私下收款、私下交接或诱导用户脱离平台沟通,否则平台可能限制账号发布权限。
|
||||||
|
|
||||||
|
三、费用与结算
|
||||||
|
1. 发布价格、押金、额外消耗品价值以平台发布页和订单页面展示为准。
|
||||||
|
2. 订单完成后,平台将按订单记录、结账结果和相关规则进行结算。
|
||||||
|
3. 若发生争议,平台将依据订单记录、资产快照、聊天记录、截图证据和双方说明进行处理。`,
|
||||||
|
},
|
||||||
|
seller_agreement: {
|
||||||
|
title: '号主协议',
|
||||||
|
content: `请您作为号主在发布账号前确认并遵守以下约定:
|
||||||
|
|
||||||
|
一、账号发布义务
|
||||||
|
1. 您应如实填写区服、段位、哈夫币数量、保险、体力、负重、登录方式、封禁记录、常用地区和备注信息。
|
||||||
|
2. 您应上传真实、清晰、可核验的账号截图材料,不得使用伪造、过期或与账号不一致的截图。
|
||||||
|
3. 您不得发布盗号、黑号、纠纷账号、已被限制使用账号或无法完成正常交接的账号。
|
||||||
|
|
||||||
|
二、交接与协作
|
||||||
|
1. 买家下单后,您应在平台要求时间内完成交接,及时响应扫码、人脸冻结、登录验证等流程。
|
||||||
|
2. 您应在租用期间保持可联系状态,不得无故拒绝交接、恶意拖延或私下更改交易条件。
|
||||||
|
3. 租用结束后,请按平台流程确认归还和结账,配合核验资产状态。
|
||||||
|
|
||||||
|
三、责任承担
|
||||||
|
1. 因您发布信息不实、交接不及时、账号异常隐瞒或私下交易造成的损失,平台可依据规则处理退款、赔付、下架或限制发布。
|
||||||
|
2. 因租客违规使用造成的损失,您应通过平台流程提交证据并配合争议处理。
|
||||||
|
3. 您同意平台依据订单记录、资产快照、聊天记录、截图证据和相关规则处理结算、赔付及争议。`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
modelValue: boolean
|
||||||
|
config: SystemConfig
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'update:modelValue', val: boolean): void
|
||||||
|
(e: 'saved'): void
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const submitting = ref(false)
|
||||||
|
const description = ref('')
|
||||||
|
const draft = ref<ListingPublishAgreements>(cloneAgreements(defaultListingPublishAgreements))
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
draft.value = parseListingPublishAgreements(props.config.value)
|
||||||
|
description.value = props.config.description || ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
|
)
|
||||||
|
|
||||||
|
function parseListingPublishAgreements(raw: string) {
|
||||||
|
const parsed = safeParseJSON(raw, defaultListingPublishAgreements)
|
||||||
|
return cloneAgreements({
|
||||||
|
virtual_asset_sale: {
|
||||||
|
title: readText(parsed?.virtual_asset_sale?.title, defaultListingPublishAgreements.virtual_asset_sale.title),
|
||||||
|
content: readText(parsed?.virtual_asset_sale?.content, defaultListingPublishAgreements.virtual_asset_sale.content),
|
||||||
|
},
|
||||||
|
seller_agreement: {
|
||||||
|
title: readText(parsed?.seller_agreement?.title, defaultListingPublishAgreements.seller_agreement.title),
|
||||||
|
content: readText(parsed?.seller_agreement?.content, defaultListingPublishAgreements.seller_agreement.content),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function readText(value: unknown, fallback: string) {
|
||||||
|
return typeof value === 'string' && value.trim() ? value : fallback
|
||||||
|
}
|
||||||
|
|
||||||
|
function cloneAgreements(value: ListingPublishAgreements) {
|
||||||
|
return JSON.parse(JSON.stringify(value)) as ListingPublishAgreements
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetDefaults() {
|
||||||
|
draft.value = cloneAgreements(defaultListingPublishAgreements)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleSave() {
|
||||||
|
submitting.value = true
|
||||||
|
try {
|
||||||
|
await updateSystemConfig(props.config.key, {
|
||||||
|
value: JSON.stringify(draft.value, null, 2),
|
||||||
|
description: description.value,
|
||||||
|
})
|
||||||
|
ElMessage.success('发布协议配置已更新')
|
||||||
|
emit('saved')
|
||||||
|
emit('update:modelValue', false)
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error(readError(error, '保存失败'))
|
||||||
|
} finally {
|
||||||
|
submitting.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function readError(error: unknown, fallback: string) {
|
||||||
|
if (typeof error === 'object' && error && 'response' in error) {
|
||||||
|
const response = (error as { response?: { data?: { message?: string } } }).response
|
||||||
|
return response?.data?.message || fallback
|
||||||
|
}
|
||||||
|
return fallback
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:model-value="modelValue"
|
||||||
|
title="编辑发布协议"
|
||||||
|
width="860px"
|
||||||
|
@update:model-value="emit('update:modelValue', $event)"
|
||||||
|
>
|
||||||
|
<div class="dialog-body">
|
||||||
|
<div class="dialog-header">
|
||||||
|
<p class="config-key-label"><strong>{{ config.key }}</strong></p>
|
||||||
|
<el-button size="small" @click="resetDefaults">恢复默认文本</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="agreement-editor-grid">
|
||||||
|
<section class="agreement-editor-card">
|
||||||
|
<div class="agreement-card-title">虚拟资产出售协议</div>
|
||||||
|
<el-form-item label="协议标题" class="full-control">
|
||||||
|
<el-input v-model="draft.virtual_asset_sale.title" placeholder="请输入协议标题" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="协议正文" class="full-control">
|
||||||
|
<el-input
|
||||||
|
v-model="draft.virtual_asset_sale.content"
|
||||||
|
type="textarea"
|
||||||
|
:rows="14"
|
||||||
|
resize="vertical"
|
||||||
|
placeholder="请输入协议正文"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="agreement-editor-card">
|
||||||
|
<div class="agreement-card-title">号主协议</div>
|
||||||
|
<el-form-item label="协议标题" class="full-control">
|
||||||
|
<el-input v-model="draft.seller_agreement.title" placeholder="请输入协议标题" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="协议正文" class="full-control">
|
||||||
|
<el-input
|
||||||
|
v-model="draft.seller_agreement.content"
|
||||||
|
type="textarea"
|
||||||
|
:rows="14"
|
||||||
|
resize="vertical"
|
||||||
|
placeholder="请输入协议正文"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-form-item label="配置说明" class="desc-item">
|
||||||
|
<el-input v-model="description" type="textarea" :rows="3" placeholder="配置说明" />
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="emit('update:modelValue', false)">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="submitting" @click="handleSave">保存</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.dialog-body {
|
||||||
|
display: grid;
|
||||||
|
gap: 16px;
|
||||||
|
max-height: 68vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.config-key-label {
|
||||||
|
margin: 0;
|
||||||
|
color: #374151;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agreement-editor-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
gap: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agreement-editor-card {
|
||||||
|
display: grid;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 14px;
|
||||||
|
border: 1px solid #e5e7eb;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #f9fafb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agreement-card-title {
|
||||||
|
color: #111827;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.full-control,
|
||||||
|
.desc-item {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
.agreement-editor-grid {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
mergeListingSalePriceConfig,
|
mergeListingSalePriceConfig,
|
||||||
mergeListingPublishOptions,
|
mergeListingPublishOptions,
|
||||||
type ListingPublishOptions,
|
type ListingPublishOptions,
|
||||||
|
type ListingPublishAgreements,
|
||||||
type PublishSalePriceConfig,
|
type PublishSalePriceConfig,
|
||||||
} from '@/features/listings/api/listingOptions'
|
} from '@/features/listings/api/listingOptions'
|
||||||
import {
|
import {
|
||||||
@@ -26,6 +27,7 @@ import PublishOptionsDialog from '../components/PublishOptionsDialog.vue'
|
|||||||
import SalePriceDialog from '../components/SalePriceDialog.vue'
|
import SalePriceDialog from '../components/SalePriceDialog.vue'
|
||||||
import HomeAnnouncementsDialog from '../components/HomeAnnouncementsDialog.vue'
|
import HomeAnnouncementsDialog from '../components/HomeAnnouncementsDialog.vue'
|
||||||
import HomeBannersDialog from '../components/HomeBannersDialog.vue'
|
import HomeBannersDialog from '../components/HomeBannersDialog.vue'
|
||||||
|
import ListingPublishAgreementsDialog from '../components/ListingPublishAgreementsDialog.vue'
|
||||||
import OrderAgreementsDialog from '../components/OrderAgreementsDialog.vue'
|
import OrderAgreementsDialog from '../components/OrderAgreementsDialog.vue'
|
||||||
import PostRentalNoticeDialog from '../components/PostRentalNoticeDialog.vue'
|
import PostRentalNoticeDialog from '../components/PostRentalNoticeDialog.vue'
|
||||||
import GeneralConfigDialog from '../components/GeneralConfigDialog.vue'
|
import GeneralConfigDialog from '../components/GeneralConfigDialog.vue'
|
||||||
@@ -42,6 +44,17 @@ const defaultOrderAgreements: OrderAgreements = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const defaultListingPublishAgreements: ListingPublishAgreements = {
|
||||||
|
virtual_asset_sale: {
|
||||||
|
title: '虚拟资产出售协议',
|
||||||
|
content: '',
|
||||||
|
},
|
||||||
|
seller_agreement: {
|
||||||
|
title: '号主协议',
|
||||||
|
content: '',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const configs = ref<SystemConfig[]>([])
|
const configs = ref<SystemConfig[]>([])
|
||||||
const currentEditingConfig = ref<SystemConfig | null>(null)
|
const currentEditingConfig = ref<SystemConfig | null>(null)
|
||||||
@@ -51,6 +64,7 @@ const publishVisible = ref(false)
|
|||||||
const salePriceVisible = ref(false)
|
const salePriceVisible = ref(false)
|
||||||
const announcementsVisible = ref(false)
|
const announcementsVisible = ref(false)
|
||||||
const bannersVisible = ref(false)
|
const bannersVisible = ref(false)
|
||||||
|
const listingPublishAgreementsVisible = ref(false)
|
||||||
const agreementsVisible = ref(false)
|
const agreementsVisible = ref(false)
|
||||||
const postRentalNoticeVisible = ref(false)
|
const postRentalNoticeVisible = ref(false)
|
||||||
const generalVisible = ref(false)
|
const generalVisible = ref(false)
|
||||||
@@ -59,6 +73,7 @@ const publishConfig = computed(() => configs.value.find((item) => item.key === '
|
|||||||
const salePriceConfig = computed(() => configs.value.find((item) => item.key === 'listing.sale_price_config') || null)
|
const salePriceConfig = computed(() => configs.value.find((item) => item.key === 'listing.sale_price_config') || null)
|
||||||
const homeAnnouncementsConfig = computed(() => configs.value.find((item) => item.key === 'mobile.home_announcements') || null)
|
const homeAnnouncementsConfig = computed(() => configs.value.find((item) => item.key === 'mobile.home_announcements') || null)
|
||||||
const homeBannersConfig = computed(() => configs.value.find((item) => item.key === 'mobile.home_banners') || null)
|
const homeBannersConfig = computed(() => configs.value.find((item) => item.key === 'mobile.home_banners') || null)
|
||||||
|
const listingPublishAgreementsConfig = computed(() => configs.value.find((item) => item.key === 'listing.publish_agreements') || null)
|
||||||
const orderAgreementsConfig = computed(() => configs.value.find((item) => item.key === 'order.agreements') || null)
|
const orderAgreementsConfig = computed(() => configs.value.find((item) => item.key === 'order.agreements') || null)
|
||||||
const postRentalNoticeConfig = computed(() => configs.value.find((item) => item.key === 'profile.post_rental_notice') || null)
|
const postRentalNoticeConfig = computed(() => configs.value.find((item) => item.key === 'profile.post_rental_notice') || null)
|
||||||
|
|
||||||
@@ -69,6 +84,7 @@ const regularConfigs = computed(() =>
|
|||||||
item.key !== 'listing.sale_price_config' &&
|
item.key !== 'listing.sale_price_config' &&
|
||||||
item.key !== 'mobile.home_announcements' &&
|
item.key !== 'mobile.home_announcements' &&
|
||||||
item.key !== 'mobile.home_banners' &&
|
item.key !== 'mobile.home_banners' &&
|
||||||
|
item.key !== 'listing.publish_agreements' &&
|
||||||
item.key !== 'order.agreements' &&
|
item.key !== 'order.agreements' &&
|
||||||
item.key !== 'profile.post_rental_notice',
|
item.key !== 'profile.post_rental_notice',
|
||||||
),
|
),
|
||||||
@@ -117,6 +133,16 @@ const agreementStats = computed(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const listingPublishAgreementStats = computed(() => {
|
||||||
|
const agreements = parseListingPublishAgreements(listingPublishAgreementsConfig.value?.value || '')
|
||||||
|
return {
|
||||||
|
saleTitle: agreements.virtual_asset_sale.title || '出售协议',
|
||||||
|
sellerTitle: agreements.seller_agreement.title || '号主协议',
|
||||||
|
saleWords: countContentWords(agreements.virtual_asset_sale.content),
|
||||||
|
sellerWords: countContentWords(agreements.seller_agreement.content),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(loadConfigs)
|
onMounted(loadConfigs)
|
||||||
|
|
||||||
async function loadConfigs() {
|
async function loadConfigs() {
|
||||||
@@ -138,6 +164,8 @@ function openEdit(row: SystemConfig) {
|
|||||||
announcementsVisible.value = true
|
announcementsVisible.value = true
|
||||||
} else if (row.key === 'mobile.home_banners') {
|
} else if (row.key === 'mobile.home_banners') {
|
||||||
bannersVisible.value = true
|
bannersVisible.value = true
|
||||||
|
} else if (row.key === 'listing.publish_agreements') {
|
||||||
|
listingPublishAgreementsVisible.value = true
|
||||||
} else if (row.key === 'order.agreements') {
|
} else if (row.key === 'order.agreements') {
|
||||||
agreementsVisible.value = true
|
agreementsVisible.value = true
|
||||||
} else if (row.key === 'profile.post_rental_notice') {
|
} else if (row.key === 'profile.post_rental_notice') {
|
||||||
@@ -181,6 +209,20 @@ function parseOrderAgreements(raw: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseListingPublishAgreements(raw: string) {
|
||||||
|
const parsed = safeParseJSON(raw, defaultListingPublishAgreements)
|
||||||
|
return {
|
||||||
|
virtual_asset_sale: {
|
||||||
|
title: readText(parsed.virtual_asset_sale?.title, defaultListingPublishAgreements.virtual_asset_sale.title),
|
||||||
|
content: readText(parsed.virtual_asset_sale?.content, defaultListingPublishAgreements.virtual_asset_sale.content),
|
||||||
|
},
|
||||||
|
seller_agreement: {
|
||||||
|
title: readText(parsed.seller_agreement?.title, defaultListingPublishAgreements.seller_agreement.title),
|
||||||
|
content: readText(parsed.seller_agreement?.content, defaultListingPublishAgreements.seller_agreement.content),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function readText(value: unknown, fallback: string) {
|
function readText(value: unknown, fallback: string) {
|
||||||
return typeof value === 'string' && value.trim() ? value : fallback
|
return typeof value === 'string' && value.trim() ? value : fallback
|
||||||
}
|
}
|
||||||
@@ -329,6 +371,39 @@ function formatConfigValue(row: SystemConfig) {
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section v-if="listingPublishAgreementsConfig" class="publish-config-panel">
|
||||||
|
<div class="publish-config-main">
|
||||||
|
<div>
|
||||||
|
<p class="eyebrow">Publish Agreements</p>
|
||||||
|
<h2>发布协议配置</h2>
|
||||||
|
<span>管理发布账号前必须勾选确认的虚拟资产出售协议和号主协议。</span>
|
||||||
|
</div>
|
||||||
|
<el-button type="primary" @click="openEdit(listingPublishAgreementsConfig)">编辑发布协议</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="publish-stat-grid home-stat-grid">
|
||||||
|
<div class="publish-stat">
|
||||||
|
<strong>2</strong>
|
||||||
|
<span>协议数量</span>
|
||||||
|
</div>
|
||||||
|
<div class="publish-stat">
|
||||||
|
<strong>{{ listingPublishAgreementStats.saleWords }}</strong>
|
||||||
|
<span>{{ listingPublishAgreementStats.saleTitle }}字数</span>
|
||||||
|
</div>
|
||||||
|
<div class="publish-stat">
|
||||||
|
<strong>{{ listingPublishAgreementStats.sellerWords }}</strong>
|
||||||
|
<span>{{ listingPublishAgreementStats.sellerTitle }}字数</span>
|
||||||
|
</div>
|
||||||
|
<div class="publish-stat">
|
||||||
|
<strong>接口</strong>
|
||||||
|
<span>/api/listing-publish-agreements</span>
|
||||||
|
</div>
|
||||||
|
<div class="publish-stat">
|
||||||
|
<strong>更新</strong>
|
||||||
|
<span>{{ formatHomeConfigStatus(listingPublishAgreementsConfig, '未初始化') }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section v-if="orderAgreementsConfig" class="publish-config-panel">
|
<section v-if="orderAgreementsConfig" class="publish-config-panel">
|
||||||
<div class="publish-config-main">
|
<div class="publish-config-main">
|
||||||
<div>
|
<div>
|
||||||
@@ -446,6 +521,13 @@ function formatConfigValue(row: SystemConfig) {
|
|||||||
@saved="loadConfigs"
|
@saved="loadConfigs"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<ListingPublishAgreementsDialog
|
||||||
|
v-if="listingPublishAgreementsConfig"
|
||||||
|
v-model="listingPublishAgreementsVisible"
|
||||||
|
:config="listingPublishAgreementsConfig"
|
||||||
|
@saved="loadConfigs"
|
||||||
|
/>
|
||||||
|
|
||||||
<OrderAgreementsDialog
|
<OrderAgreementsDialog
|
||||||
v-if="orderAgreementsConfig"
|
v-if="orderAgreementsConfig"
|
||||||
v-model="agreementsVisible"
|
v-model="agreementsVisible"
|
||||||
|
|||||||
@@ -87,6 +87,16 @@ export interface PublishSalePriceConfig {
|
|||||||
ratio_adjustment_rules: PublishSaleRatioAdjustmentRule[]
|
ratio_adjustment_rules: PublishSaleRatioAdjustmentRule[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface AgreementContent {
|
||||||
|
title: string
|
||||||
|
content: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ListingPublishAgreements {
|
||||||
|
virtual_asset_sale: AgreementContent
|
||||||
|
seller_agreement: AgreementContent
|
||||||
|
}
|
||||||
|
|
||||||
export interface ListingPublishOptions {
|
export interface ListingPublishOptions {
|
||||||
server_options: string[]
|
server_options: string[]
|
||||||
face_options: string[]
|
face_options: string[]
|
||||||
@@ -158,11 +168,27 @@ export const emptyListingSalePriceConfig: PublishSalePriceConfig = {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const emptyListingPublishAgreements: ListingPublishAgreements = {
|
||||||
|
virtual_asset_sale: {
|
||||||
|
title: '虚拟资产出售协议',
|
||||||
|
content: '',
|
||||||
|
},
|
||||||
|
seller_agreement: {
|
||||||
|
title: '号主协议',
|
||||||
|
content: '',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
export async function fetchListingPublishOptions() {
|
export async function fetchListingPublishOptions() {
|
||||||
const { data } = await apiClient.get<ApiResponse<ListingPublishOptions>>('/listing-publish-options')
|
const { data } = await apiClient.get<ApiResponse<ListingPublishOptions>>('/listing-publish-options')
|
||||||
return mergeListingPublishOptions(data.data)
|
return mergeListingPublishOptions(data.data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function fetchListingPublishAgreements() {
|
||||||
|
const { data } = await apiClient.get<ApiResponse<ListingPublishAgreements>>('/listing-publish-agreements')
|
||||||
|
return mergeListingPublishAgreements(data.data)
|
||||||
|
}
|
||||||
|
|
||||||
export async function fetchListingSalePriceConfig() {
|
export async function fetchListingSalePriceConfig() {
|
||||||
const { data } = await apiClient.get<ApiResponse<PublishSalePriceConfig>>('/listing-sale-price-config')
|
const { data } = await apiClient.get<ApiResponse<PublishSalePriceConfig>>('/listing-sale-price-config')
|
||||||
return mergeListingSalePriceConfig(data.data)
|
return mergeListingSalePriceConfig(data.data)
|
||||||
@@ -193,6 +219,20 @@ export function mergeListingSalePriceConfig(options?: Partial<PublishSalePriceCo
|
|||||||
return normalizeSalePriceConfig(options)
|
return normalizeSalePriceConfig(options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function mergeListingPublishAgreements(options?: Partial<ListingPublishAgreements>): ListingPublishAgreements {
|
||||||
|
return {
|
||||||
|
virtual_asset_sale: normalizeAgreementContent(options?.virtual_asset_sale, emptyListingPublishAgreements.virtual_asset_sale),
|
||||||
|
seller_agreement: normalizeAgreementContent(options?.seller_agreement, emptyListingPublishAgreements.seller_agreement),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeAgreementContent(value: unknown, fallback: AgreementContent): AgreementContent {
|
||||||
|
const row = isRecord(value) ? value : {}
|
||||||
|
const title = typeof row.title === 'string' && row.title.trim() ? row.title.trim() : fallback.title
|
||||||
|
const content = typeof row.content === 'string' && row.content.trim() ? row.content.trim() : fallback.content
|
||||||
|
return { title, content }
|
||||||
|
}
|
||||||
|
|
||||||
function normalizeStringList(values?: unknown[]) {
|
function normalizeStringList(values?: unknown[]) {
|
||||||
return Array.isArray(values)
|
return Array.isArray(values)
|
||||||
? values.map((item) => (typeof item === 'string' ? item.trim() : '')).filter(Boolean)
|
? values.map((item) => (typeof item === 'string' ? item.trim() : '')).filter(Boolean)
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ export interface ListingPayload {
|
|||||||
screenshot_urls: string[]
|
screenshot_urls: string[]
|
||||||
price: number
|
price: number
|
||||||
deposit_amount: number
|
deposit_amount: number
|
||||||
|
agreed_virtual_asset_sale: boolean
|
||||||
|
agreed_seller_agreement: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PublicListingQuery {
|
export interface PublicListingQuery {
|
||||||
|
|||||||
@@ -3,11 +3,14 @@ import { useRouter } from 'vue-router'
|
|||||||
|
|
||||||
import { fetchFileBlobByURL, uploadFile } from '@/shared/api/files'
|
import { fetchFileBlobByURL, uploadFile } from '@/shared/api/files'
|
||||||
import {
|
import {
|
||||||
|
emptyListingPublishAgreements,
|
||||||
emptyListingPublishOptions,
|
emptyListingPublishOptions,
|
||||||
emptyListingSalePriceConfig,
|
emptyListingSalePriceConfig,
|
||||||
|
fetchListingPublishAgreements,
|
||||||
fetchListingPublishOptions,
|
fetchListingPublishOptions,
|
||||||
fetchListingSalePriceConfig,
|
fetchListingSalePriceConfig,
|
||||||
type ChargeMode,
|
type ChargeMode,
|
||||||
|
type ListingPublishAgreements,
|
||||||
type ListingPublishOptions,
|
type ListingPublishOptions,
|
||||||
type PublishSalePriceConfig,
|
type PublishSalePriceConfig,
|
||||||
type ScreenshotKey,
|
type ScreenshotKey,
|
||||||
@@ -45,6 +48,9 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
|||||||
const draftReady = ref(false)
|
const draftReady = ref(false)
|
||||||
const publishOptions = ref<ListingPublishOptions>(emptyListingPublishOptions)
|
const publishOptions = ref<ListingPublishOptions>(emptyListingPublishOptions)
|
||||||
const salePriceConfig = ref<PublishSalePriceConfig>(emptyListingSalePriceConfig)
|
const salePriceConfig = ref<PublishSalePriceConfig>(emptyListingSalePriceConfig)
|
||||||
|
const publishAgreements = ref<ListingPublishAgreements>(emptyListingPublishAgreements)
|
||||||
|
const virtualAssetSaleAgreementChecked = ref(false)
|
||||||
|
const sellerAgreementChecked = ref(false)
|
||||||
const fileInput = ref<HTMLInputElement | null>(null)
|
const fileInput = ref<HTMLInputElement | null>(null)
|
||||||
const activeUploadKey = ref<ScreenshotKey>('coin')
|
const activeUploadKey = ref<ScreenshotKey>('coin')
|
||||||
const form = reactive<PublishForm>(defaultPublishForm())
|
const form = reactive<PublishForm>(defaultPublishForm())
|
||||||
@@ -66,6 +72,9 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
|||||||
})
|
})
|
||||||
const uploadedScreenshotCount = computed(() => pricing.screenshotUrls.value.length)
|
const uploadedScreenshotCount = computed(() => pricing.screenshotUrls.value.length)
|
||||||
const requiredScreenshotCount = ref(0)
|
const requiredScreenshotCount = ref(0)
|
||||||
|
const canPublishAfterAgreements = computed(
|
||||||
|
() => virtualAssetSaleAgreementChecked.value && sellerAgreementChecked.value,
|
||||||
|
)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
restoreDraft()
|
restoreDraft()
|
||||||
@@ -114,12 +123,14 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
|||||||
|
|
||||||
async function loadPublishOptions() {
|
async function loadPublishOptions() {
|
||||||
try {
|
try {
|
||||||
const [nextPublishOptions, nextSalePriceConfig] = await Promise.all([
|
const [nextPublishOptions, nextSalePriceConfig, nextPublishAgreements] = await Promise.all([
|
||||||
fetchListingPublishOptions(),
|
fetchListingPublishOptions(),
|
||||||
fetchListingSalePriceConfig(),
|
fetchListingSalePriceConfig(),
|
||||||
|
fetchListingPublishAgreements(),
|
||||||
])
|
])
|
||||||
publishOptions.value = nextPublishOptions
|
publishOptions.value = nextPublishOptions
|
||||||
salePriceConfig.value = nextSalePriceConfig
|
salePriceConfig.value = nextSalePriceConfig
|
||||||
|
publishAgreements.value = nextPublishAgreements
|
||||||
|
|
||||||
// 默认数字都是0
|
// 默认数字都是0
|
||||||
for (const item of nextPublishOptions.quantity_items) {
|
for (const item of nextPublishOptions.quantity_items) {
|
||||||
@@ -130,6 +141,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
|||||||
} catch {
|
} catch {
|
||||||
publishOptions.value = emptyListingPublishOptions
|
publishOptions.value = emptyListingPublishOptions
|
||||||
salePriceConfig.value = emptyListingSalePriceConfig
|
salePriceConfig.value = emptyListingSalePriceConfig
|
||||||
|
publishAgreements.value = emptyListingPublishAgreements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,6 +217,8 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
|||||||
clearRecord(screenshotFiles)
|
clearRecord(screenshotFiles)
|
||||||
revokeAllScreenshotPreviews()
|
revokeAllScreenshotPreviews()
|
||||||
selectedSkins.value = []
|
selectedSkins.value = []
|
||||||
|
virtualAssetSaleAgreementChecked.value = false
|
||||||
|
sellerAgreementChecked.value = false
|
||||||
activeUploadKey.value = 'coin'
|
activeUploadKey.value = 'coin'
|
||||||
|
|
||||||
// Also re-initialize quantityValues to 0
|
// Also re-initialize quantityValues to 0
|
||||||
@@ -397,6 +411,8 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
|||||||
screenshot_urls: pricing.screenshotUrls.value,
|
screenshot_urls: pricing.screenshotUrls.value,
|
||||||
price: pricing.calculatedFinalPrice.value,
|
price: pricing.calculatedFinalPrice.value,
|
||||||
deposit_amount: Number(form.deposit_amount),
|
deposit_amount: Number(form.deposit_amount),
|
||||||
|
agreed_virtual_asset_sale: virtualAssetSaleAgreementChecked.value,
|
||||||
|
agreed_seller_agreement: sellerAgreementChecked.value,
|
||||||
})
|
})
|
||||||
removePublishDraft(options.draftKey)
|
removePublishDraft(options.draftKey)
|
||||||
suppressDraftSave.value = true
|
suppressDraftSave.value = true
|
||||||
@@ -445,6 +461,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
|||||||
}
|
}
|
||||||
if (!pricing.calculatedFinalPrice.value) return '请完善币数、保险、体力和负重后再发布'
|
if (!pricing.calculatedFinalPrice.value) return '请完善币数、保险、体力和负重后再发布'
|
||||||
if (!Number.isFinite(pricing.calculatedFinalPrice.value)) return '发布价格计算异常,请检查填写内容'
|
if (!Number.isFinite(pricing.calculatedFinalPrice.value)) return '发布价格计算异常,请检查填写内容'
|
||||||
|
if (!canPublishAfterAgreements.value) return '请先阅读并勾选两份发布协议'
|
||||||
for (const item of pricing.screenshotSlots.value) {
|
for (const item of pricing.screenshotSlots.value) {
|
||||||
if (isScreenshotRequired(item) && !screenshotFiles[item.key]) return `请上传${item.label}`
|
if (isScreenshotRequired(item) && !screenshotFiles[item.key]) return `请上传${item.label}`
|
||||||
}
|
}
|
||||||
@@ -530,6 +547,10 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
|||||||
router,
|
router,
|
||||||
loading,
|
loading,
|
||||||
uploading,
|
uploading,
|
||||||
|
publishAgreements,
|
||||||
|
virtualAssetSaleAgreementChecked,
|
||||||
|
sellerAgreementChecked,
|
||||||
|
canPublishAfterAgreements,
|
||||||
fileInput,
|
fileInput,
|
||||||
activeUploadKey,
|
activeUploadKey,
|
||||||
form,
|
form,
|
||||||
|
|||||||
@@ -644,6 +644,64 @@
|
|||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.publish-agreement-card {
|
||||||
|
display: grid;
|
||||||
|
gap: 10px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid #edf0f4;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agreement-check-label {
|
||||||
|
color: #30343a;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.45;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agreement-link {
|
||||||
|
padding: 0;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
color: #1477ff;
|
||||||
|
font: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.publish-agreement-popup {
|
||||||
|
max-height: 86vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agreement-popup-body {
|
||||||
|
display: grid;
|
||||||
|
gap: 12px;
|
||||||
|
max-height: 86vh;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
|
||||||
|
.agreement-popup-body h3 {
|
||||||
|
margin: 0;
|
||||||
|
color: #17233d;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 900;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agreement-popup-content {
|
||||||
|
max-height: 62vh;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid #e5e7eb;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #f8fafc;
|
||||||
|
color: #1f2937;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.7;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
.publish-actions {
|
.publish-actions {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 92px minmax(0, 1fr);
|
grid-template-columns: 92px minmax(0, 1fr);
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { showDialog, showToast } from 'vant'
|
import { showDialog, showToast } from 'vant'
|
||||||
|
import { computed, ref } from 'vue'
|
||||||
import MobileBottomNav from '@/components/MobileBottomNav.vue'
|
import MobileBottomNav from '@/components/MobileBottomNav.vue'
|
||||||
|
|
||||||
import { usePublishForm } from '@/features/seller/composables/usePublishForm'
|
import { usePublishForm } from '@/features/seller/composables/usePublishForm'
|
||||||
|
import type { AgreementContent } from '@/features/listings/api/listingOptions'
|
||||||
|
|
||||||
const {
|
const {
|
||||||
commonOnlineTimes,
|
commonOnlineTimes,
|
||||||
@@ -11,6 +13,10 @@ const {
|
|||||||
router,
|
router,
|
||||||
loading,
|
loading,
|
||||||
uploading,
|
uploading,
|
||||||
|
publishAgreements,
|
||||||
|
virtualAssetSaleAgreementChecked,
|
||||||
|
sellerAgreementChecked,
|
||||||
|
canPublishAfterAgreements,
|
||||||
fileInput,
|
fileInput,
|
||||||
activeUploadKey,
|
activeUploadKey,
|
||||||
form,
|
form,
|
||||||
@@ -78,7 +84,15 @@ const {
|
|||||||
notifyError: (message) => showToast({ message, icon: 'cross' }),
|
notifyError: (message) => showToast({ message, icon: 'cross' }),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const agreementPopupVisible = ref(false)
|
||||||
|
const activeAgreement = ref<AgreementContent | null>(null)
|
||||||
|
const activeAgreementTitle = computed(() => activeAgreement.value?.title || '协议内容')
|
||||||
|
const activeAgreementContent = computed(() => activeAgreement.value?.content || '')
|
||||||
|
|
||||||
|
function openPublishAgreement(agreement: AgreementContent) {
|
||||||
|
activeAgreement.value = agreement
|
||||||
|
agreementPopupVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
function selectRadio<T extends string>(value: T, setter: (value: T) => void) {
|
function selectRadio<T extends string>(value: T, setter: (value: T) => void) {
|
||||||
setter(value)
|
setter(value)
|
||||||
@@ -637,6 +651,33 @@ function selectOnlineEnd(value: string) {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="publish-agreement-card">
|
||||||
|
<van-checkbox v-model="virtualAssetSaleAgreementChecked" icon-size="18px">
|
||||||
|
<span class="agreement-check-label">
|
||||||
|
我已阅读并同意
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="agreement-link"
|
||||||
|
@click.stop.prevent="openPublishAgreement(publishAgreements.virtual_asset_sale)"
|
||||||
|
>
|
||||||
|
《{{ publishAgreements.virtual_asset_sale.title }}》
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
</van-checkbox>
|
||||||
|
<van-checkbox v-model="sellerAgreementChecked" icon-size="18px">
|
||||||
|
<span class="agreement-check-label">
|
||||||
|
我已阅读并同意
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="agreement-link"
|
||||||
|
@click.stop.prevent="openPublishAgreement(publishAgreements.seller_agreement)"
|
||||||
|
>
|
||||||
|
《{{ publishAgreements.seller_agreement.title }}》
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
</van-checkbox>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="publish-actions">
|
<div class="publish-actions">
|
||||||
<van-button
|
<van-button
|
||||||
round
|
round
|
||||||
@@ -651,6 +692,7 @@ function selectOnlineEnd(value: string) {
|
|||||||
round
|
round
|
||||||
class="submit-btn"
|
class="submit-btn"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
|
:disabled="!canPublishAfterAgreements"
|
||||||
loading-text="发布中..."
|
loading-text="发布中..."
|
||||||
@click="handleSubmit"
|
@click="handleSubmit"
|
||||||
>
|
>
|
||||||
@@ -659,6 +701,13 @@ function selectOnlineEnd(value: string) {
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<van-popup v-model:show="agreementPopupVisible" round closeable position="bottom" lock-scroll class="publish-agreement-popup">
|
||||||
|
<div class="agreement-popup-body">
|
||||||
|
<h3>{{ activeAgreementTitle }}</h3>
|
||||||
|
<div class="agreement-popup-content">{{ activeAgreementContent }}</div>
|
||||||
|
</div>
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
<MobileBottomNav />
|
<MobileBottomNav />
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -679,14 +679,11 @@
|
|||||||
position: sticky;
|
position: sticky;
|
||||||
top: var(--summary-sticky-top);
|
top: var(--summary-sticky-top);
|
||||||
align-self: start;
|
align-self: start;
|
||||||
max-height: calc(100vh - var(--summary-sticky-top) - 24px);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.summary-panel {
|
.summary-panel {
|
||||||
padding: 16px;
|
padding: 14px;
|
||||||
max-height: inherit;
|
overflow: visible;
|
||||||
overflow-y: auto;
|
|
||||||
overscroll-behavior: contain;
|
|
||||||
border: 1px solid #e6ebf2;
|
border: 1px solid #e6ebf2;
|
||||||
border-radius: var(--radius-8);
|
border-radius: var(--radius-8);
|
||||||
background: #fff;
|
background: #fff;
|
||||||
@@ -710,9 +707,9 @@
|
|||||||
|
|
||||||
.summary-breakdown {
|
.summary-breakdown {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 10px;
|
gap: 8px;
|
||||||
margin-top: 14px;
|
margin-top: 12px;
|
||||||
padding: 12px;
|
padding: 10px;
|
||||||
border: 1px solid #ffe1c7;
|
border: 1px solid #ffe1c7;
|
||||||
border-radius: var(--radius-8);
|
border-radius: var(--radius-8);
|
||||||
background: #fffaf6;
|
background: #fffaf6;
|
||||||
@@ -745,15 +742,15 @@
|
|||||||
|
|
||||||
.summary-list {
|
.summary-list {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 10px;
|
gap: 8px;
|
||||||
margin: 14px 0;
|
margin: 12px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.summary-list div {
|
.summary-list div {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 8px;
|
||||||
border-bottom: 1px solid #eef2f6;
|
border-bottom: 1px solid #eef2f6;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -764,6 +761,76 @@
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.publish-agreement-panel {
|
||||||
|
display: grid;
|
||||||
|
gap: 6px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
padding: 8px 10px;
|
||||||
|
border: 1px solid #eef2f6;
|
||||||
|
border-radius: var(--radius-8);
|
||||||
|
background: #f8fafc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.publish-agreement-panel :deep(.el-checkbox) {
|
||||||
|
align-items: center;
|
||||||
|
height: 24px;
|
||||||
|
margin-right: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.publish-agreement-panel :deep(.el-checkbox__label) {
|
||||||
|
min-width: 0;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agreement-check-label {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 2px;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
min-width: 0;
|
||||||
|
color: var(--color-text-main);
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 800;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agreement-link {
|
||||||
|
display: inline-block;
|
||||||
|
min-width: 0;
|
||||||
|
max-width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
color: #1477ff;
|
||||||
|
font: inherit;
|
||||||
|
text-align: left;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agreement-link:hover {
|
||||||
|
color: #0f5fd0;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agreement-dialog-content {
|
||||||
|
max-height: 62vh;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 14px;
|
||||||
|
border: 1px solid #d8dee9;
|
||||||
|
border-radius: var(--radius-8);
|
||||||
|
background: #f8fafc;
|
||||||
|
color: #1f2937;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.75;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
.summary-actions {
|
.summary-actions {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Delete, DocumentChecked, Picture, RefreshRight, UploadFilled } from '@element-plus/icons-vue'
|
import { Delete, DocumentChecked, Picture, RefreshRight, UploadFilled } from '@element-plus/icons-vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { computed, ref } from 'vue'
|
||||||
|
|
||||||
import { usePublishForm } from '@/features/seller/composables/usePublishForm'
|
import { usePublishForm } from '@/features/seller/composables/usePublishForm'
|
||||||
|
import type { AgreementContent } from '@/features/listings/api/listingOptions'
|
||||||
import OptionChips from './components/OptionChips.vue'
|
import OptionChips from './components/OptionChips.vue'
|
||||||
import PublishSection from './components/PublishSection.vue'
|
import PublishSection from './components/PublishSection.vue'
|
||||||
|
|
||||||
@@ -12,6 +14,10 @@ const {
|
|||||||
formatNumber,
|
formatNumber,
|
||||||
loading,
|
loading,
|
||||||
uploading,
|
uploading,
|
||||||
|
publishAgreements,
|
||||||
|
virtualAssetSaleAgreementChecked,
|
||||||
|
sellerAgreementChecked,
|
||||||
|
canPublishAfterAgreements,
|
||||||
fileInput,
|
fileInput,
|
||||||
activeUploadKey,
|
activeUploadKey,
|
||||||
form,
|
form,
|
||||||
@@ -83,10 +89,20 @@ const {
|
|||||||
notifyError: (message) => ElMessage.error(message),
|
notifyError: (message) => ElMessage.error(message),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const agreementDialogVisible = ref(false)
|
||||||
|
const activeAgreement = ref<AgreementContent | null>(null)
|
||||||
|
const activeAgreementTitle = computed(() => activeAgreement.value?.title || '协议内容')
|
||||||
|
const activeAgreementContent = computed(() => activeAgreement.value?.content || '')
|
||||||
|
|
||||||
function toggleSkinOption(value: string | number) {
|
function toggleSkinOption(value: string | number) {
|
||||||
toggleSkin(String(value))
|
toggleSkin(String(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openPublishAgreement(agreement: AgreementContent) {
|
||||||
|
activeAgreement.value = agreement
|
||||||
|
agreementDialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
function selectDailyLoss(value: string | number) {
|
function selectDailyLoss(value: string | number) {
|
||||||
form.daily_loss_m = Number(value)
|
form.daily_loss_m = Number(value)
|
||||||
}
|
}
|
||||||
@@ -510,14 +526,55 @@ function selectOnlineEnd(value: string | number) {
|
|||||||
<strong>{{ uploadedScreenshotCount }}/{{ requiredScreenshotCount }}</strong>
|
<strong>{{ uploadedScreenshotCount }}/{{ requiredScreenshotCount }}</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="publish-agreement-panel">
|
||||||
|
<el-checkbox v-model="virtualAssetSaleAgreementChecked">
|
||||||
|
<span class="agreement-check-label">
|
||||||
|
我已阅读并同意
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="agreement-link"
|
||||||
|
:title="publishAgreements.virtual_asset_sale.title"
|
||||||
|
@click.prevent.stop="openPublishAgreement(publishAgreements.virtual_asset_sale)"
|
||||||
|
>
|
||||||
|
《{{ publishAgreements.virtual_asset_sale.title }}》
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
</el-checkbox>
|
||||||
|
<el-checkbox v-model="sellerAgreementChecked">
|
||||||
|
<span class="agreement-check-label">
|
||||||
|
我已阅读并同意
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="agreement-link"
|
||||||
|
:title="publishAgreements.seller_agreement.title"
|
||||||
|
@click.prevent.stop="openPublishAgreement(publishAgreements.seller_agreement)"
|
||||||
|
>
|
||||||
|
《{{ publishAgreements.seller_agreement.title }}》
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
</el-checkbox>
|
||||||
|
</div>
|
||||||
<div class="summary-actions">
|
<div class="summary-actions">
|
||||||
<el-button :icon="UploadFilled" class="btn-publish" type="primary" :loading="loading" @click="handleSubmit">立即发布</el-button>
|
<el-button
|
||||||
|
:icon="UploadFilled"
|
||||||
|
class="btn-publish"
|
||||||
|
type="primary"
|
||||||
|
:loading="loading"
|
||||||
|
:disabled="!canPublishAfterAgreements"
|
||||||
|
@click="handleSubmit"
|
||||||
|
>
|
||||||
|
立即发布
|
||||||
|
</el-button>
|
||||||
<el-button :icon="DocumentChecked" :disabled="loading" @click="handleSaveDraft">保存草稿</el-button>
|
<el-button :icon="DocumentChecked" :disabled="loading" @click="handleSaveDraft">保存草稿</el-button>
|
||||||
<el-button :icon="RefreshRight" :disabled="loading" @click="handleResetDraft">重置草稿</el-button>
|
<el-button :icon="RefreshRight" :disabled="loading" @click="handleResetDraft">重置草稿</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<el-dialog v-model="agreementDialogVisible" :title="activeAgreementTitle" width="720px" class="publish-agreement-dialog">
|
||||||
|
<div class="agreement-dialog-content">{{ activeAgreementContent }}</div>
|
||||||
|
</el-dialog>
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user