feat(管理员赠送): 赠送确定按钮增加颜色状态
This commit is contained in:
parent
3f956fc3dd
commit
51a92031dc
@ -132,11 +132,11 @@
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
background-color: #bb92ff;
|
|
||||||
color: white;
|
color: white;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 590;
|
font-weight: 590;
|
||||||
"
|
"
|
||||||
|
:style="{ backgroundColor: confirmClick ? '#bb92ff' : '#00000080' }"
|
||||||
@click="sendGoods"
|
@click="sendGoods"
|
||||||
>
|
>
|
||||||
Confirm
|
Confirm
|
||||||
@ -181,6 +181,8 @@ const activeIndex = ref(0)
|
|||||||
const currentTab = ref('Frames') //选中名字
|
const currentTab = ref('Frames') //选中名字
|
||||||
const tabItems = ref([]) // 存储标签DOM引用
|
const tabItems = ref([]) // 存储标签DOM引用
|
||||||
|
|
||||||
|
const confirmClick = ref(true)
|
||||||
|
|
||||||
// 选择标签
|
// 选择标签
|
||||||
const setActiveTab = (index) => {
|
const setActiveTab = (index) => {
|
||||||
if (activeIndex.value != index) {
|
if (activeIndex.value != index) {
|
||||||
@ -212,28 +214,37 @@ const underlineStyle = computed(() => {
|
|||||||
const targetUserId = ref('')
|
const targetUserId = ref('')
|
||||||
|
|
||||||
const sendGoods = async () => {
|
const sendGoods = async () => {
|
||||||
console.log('赠送用户id:', targetUserId.value)
|
if (confirmClick.value) {
|
||||||
console.log('赠送商品:', selectedGoods.value)
|
confirmClick.value = false
|
||||||
|
|
||||||
try {
|
console.log('赠送用户id:', targetUserId.value)
|
||||||
const targetUserInfo = await searchUser(targetUserId.value)
|
console.log('赠送商品:', selectedGoods.value)
|
||||||
console.log('targetUserInfo:', targetUserInfo)
|
|
||||||
if (targetUserInfo.status && targetUserInfo.body) {
|
try {
|
||||||
const data = {
|
const targetUserInfo = await searchUser(targetUserId.value)
|
||||||
propsId: selectedGoods.value.id,
|
console.log('targetUserInfo:', targetUserInfo)
|
||||||
acceptUserId: targetUserInfo.body.id,
|
if (targetUserInfo.status && targetUserInfo.body) {
|
||||||
}
|
const data = {
|
||||||
const res = await giveProps(data)
|
propsId: selectedGoods.value.id,
|
||||||
if (res.errorCode == 0 && res.status) {
|
acceptUserId: targetUserInfo.body.id,
|
||||||
closedPopup()
|
}
|
||||||
showSuccess('Gift delivery successful')
|
const res = await giveProps(data)
|
||||||
|
if (res.errorCode == 0 && res.status) {
|
||||||
|
closedPopup()
|
||||||
|
showSuccess('Gift delivery successful')
|
||||||
|
} else {
|
||||||
|
confirmClick.value = true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
confirmClick.value = true
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log('error:', error)
|
||||||
|
// 信息提示id有误
|
||||||
|
showWarning(error.response.errorMsg)
|
||||||
|
confirmClick.value = true
|
||||||
|
throw error
|
||||||
}
|
}
|
||||||
} catch (error) {
|
|
||||||
console.log('error:', error)
|
|
||||||
// 信息提示id有误
|
|
||||||
showWarning(error.response.errorMsg)
|
|
||||||
throw error
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,6 +300,7 @@ const showSendDialog = (product) => {
|
|||||||
|
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
const closedPopup = () => {
|
const closedPopup = () => {
|
||||||
|
confirmClick.value = true
|
||||||
selectedGoods.value = {}
|
selectedGoods.value = {}
|
||||||
targetUserId.value = ''
|
targetUserId.value = ''
|
||||||
dialogshow.value = false
|
dialogshow.value = false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user