feat: 商家详情增加特约商家开关(可更换打手)

This commit is contained in:
XingQue
2026-07-27 09:16:33 +08:00
parent 1924333567
commit dcd72b03a0

View File

@@ -26,6 +26,7 @@
{{ merchant.zhuangtai === 1 ? '正常' : '已封禁' }}
</el-tag>
<el-tag v-if="merchant.is_youzhi_shangjia" type="warning" size="large" class="youzhi-tag">优质商家</el-tag>
<el-tag v-if="merchant.is_teyue_shangjia" type="success" size="large" class="youzhi-tag">特约商家</el-tag>
</div>
<div class="youzhi-row">
<span>金牌商家</span>
@@ -35,6 +36,14 @@
@change="handleYouzhiChange"
/>
</div>
<div class="youzhi-row">
<span>特约商家可更换打手</span>
<el-switch
v-model="merchant.is_teyue_shangjia"
:loading="teyueSaving"
@change="handleTeyueChange"
/>
</div>
<div class="contact-info">
<div v-if="merchant.dianhua"><el-icon><Phone /></el-icon> 电话{{ merchant.dianhua }}</div>
<div v-if="merchant.wechat"><el-icon><ChatDotRound /></el-icon> 微信{{ merchant.wechat }}</div>
@@ -163,6 +172,7 @@ const merchant = ref(null)
const loading = ref(false)
const submitting = ref(false)
const youzhiSaving = ref(false)
const teyueSaving = ref(false)
// 余额弹窗
const balanceDialogVisible = ref(false)
@@ -316,6 +326,31 @@ const handleYouzhiChange = async (val) => {
}
}
const handleTeyueChange = async (val) => {
teyueSaving.value = true
try {
const username = localStorage.getItem('username')
const res = await request.post('/houtai/xgsjxx', {
username,
yonghuid: merchantId,
action: 'set_teyue',
is_teyue_shangjia: val,
})
if (res.code === 0) {
ElMessage.success(res.msg || '设置成功')
merchant.value.is_teyue_shangjia = val
} else {
merchant.value.is_teyue_shangjia = !val
ElMessage.error(res.msg || '设置失败')
}
} catch (error) {
merchant.value.is_teyue_shangjia = !val
ElMessage.error('网络错误')
} finally {
teyueSaving.value = false
}
}
const handleBan = async () => {
try {
await ElMessageBox.confirm('确定封禁该商家?封禁后无法派单和登录。', '封禁确认', {