商户修复
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user