商户修复

This commit is contained in:
menxipeng
2025-10-19 13:41:14 +08:00
parent e6255148a4
commit 6cb2164dbe

View File

@@ -804,30 +804,32 @@ export default function MerchantsPage() {
placeholder="请输入联系电话" placeholder="请输入联系电话"
/> />
</div> </div>
<div className="space-y-2"> {userRole === "admin" && (
<Label htmlFor="totalMerchant"></Label> <div className="space-y-2">
<Select <Label htmlFor="totalMerchant"></Label>
value={newMerchant.totalMerchant} <Select
onValueChange={(value) => setNewMerchant({ ...newMerchant, totalMerchant: value })} value={newMerchant.totalMerchant}
disabled={loadingTotalMerchants} onValueChange={(value) => setNewMerchant({ ...newMerchant, totalMerchant: value })}
onOpenChange={(open) => { disabled={loadingTotalMerchants}
if (open && totalMerchants.length === 0 && !loadingTotalMerchants) { onOpenChange={(open) => {
fetchTotalMerchants() if (open && totalMerchants.length === 0 && !loadingTotalMerchants) {
} fetchTotalMerchants()
}} }
> }}
<SelectTrigger> >
<SelectValue placeholder={loadingTotalMerchants ? "加载中..." : "选择总商户(可选)"} /> <SelectTrigger>
</SelectTrigger> <SelectValue placeholder={loadingTotalMerchants ? "加载中..." : "选择总商户(可选)"} />
<SelectContent> </SelectTrigger>
{totalMerchants.map((merchant) => ( <SelectContent>
<SelectItem key={merchant.userId} value={merchant.userId}> {totalMerchants.map((merchant) => (
{merchant.nickName} <SelectItem key={merchant.userId} value={merchant.userId}>
</SelectItem> {merchant.nickName}
))} </SelectItem>
</SelectContent> ))}
</Select> </SelectContent>
</div> </Select>
</div>
)}
<div className="col-span-2 space-y-2"> <div className="col-span-2 space-y-2">
<Label htmlFor="detailedAddress"></Label> <Label htmlFor="detailedAddress"></Label>
<Textarea <Textarea
@@ -1033,30 +1035,32 @@ export default function MerchantsPage() {
placeholder="请输入联系电话" placeholder="请输入联系电话"
/> />
</div> </div>
<div className="space-y-2"> {userRole === "admin" && (
<Label htmlFor="edit-totalMerchant"></Label> <div className="space-y-2">
<Select <Label htmlFor="edit-totalMerchant"></Label>
value={editMerchant.totalMerchant} <Select
onValueChange={(value) => setEditMerchant({ ...editMerchant, totalMerchant: value })} value={editMerchant.totalMerchant}
disabled={loadingTotalMerchants} onValueChange={(value) => setEditMerchant({ ...editMerchant, totalMerchant: value })}
onOpenChange={(open) => { disabled={loadingTotalMerchants}
if (open && totalMerchants.length === 0 && !loadingTotalMerchants) { onOpenChange={(open) => {
fetchTotalMerchants() if (open && totalMerchants.length === 0 && !loadingTotalMerchants) {
} fetchTotalMerchants()
}} }
> }}
<SelectTrigger> >
<SelectValue placeholder={loadingTotalMerchants ? "加载中..." : "选择总商户(可选)"} /> <SelectTrigger>
</SelectTrigger> <SelectValue placeholder={loadingTotalMerchants ? "加载中..." : "选择总商户(可选)"} />
<SelectContent> </SelectTrigger>
{totalMerchants.map((merchant) => ( <SelectContent>
<SelectItem key={merchant.userId} value={merchant.userId}> {totalMerchants.map((merchant) => (
{merchant.nickName} <SelectItem key={merchant.userId} value={merchant.userId}>
</SelectItem> {merchant.nickName}
))} </SelectItem>
</SelectContent> ))}
</Select> </SelectContent>
</div> </Select>
</div>
)}
<div className="col-span-2 space-y-2"> <div className="col-span-2 space-y-2">
<Label htmlFor="edit-detailedAddress"></Label> <Label htmlFor="edit-detailedAddress"></Label>
<Textarea <Textarea