feat(分发积分)
This commit is contained in:
parent
5f257aaa63
commit
fcf65c7352
|
@ -111,33 +111,36 @@ function inputUserFunc() {
|
|||
}
|
||||
|
||||
async function confirmShare() {
|
||||
if (!state.value.pointParams.memberId) {
|
||||
peach.$helper.toast('请选择要赠送的用户')
|
||||
return
|
||||
}
|
||||
if (!state.value.pointParams.point) {
|
||||
let user = state.value.userList.find((item) => item.point)
|
||||
|
||||
if (!user) {
|
||||
peach.$helper.toast('请输入要赠送的积分')
|
||||
return
|
||||
}
|
||||
|
||||
state.value.pointParams.memberId = user.id
|
||||
state.value.pointParams.point = user.point
|
||||
|
||||
await PointApi.sendPoint(state.value.pointParams)
|
||||
|
||||
uni.showToast({
|
||||
title: '赠送成功',
|
||||
icon: 'none',
|
||||
success: () => {
|
||||
state.value.inputData = ''
|
||||
getUserList()
|
||||
},
|
||||
})
|
||||
state.value.inputData = ''
|
||||
state.value.userList = []
|
||||
state.value.pointParams = {
|
||||
memberId: '',
|
||||
point: '',
|
||||
}
|
||||
}
|
||||
|
||||
function inputPointFunc(data) {
|
||||
state.value.userList.forEach((item) => {
|
||||
if (data.id !== item.id) item.point = ''
|
||||
console.log(data.id !== item.id)
|
||||
if (data.id !== item.id) {
|
||||
item.point = ''
|
||||
}
|
||||
})
|
||||
|
||||
state.value.pointParams.memberId = data.id
|
||||
state.value.pointParams.point = data.point
|
||||
// state.value.pointParams.memberId = data.id
|
||||
// state.value.pointParams.point = data.point
|
||||
}
|
||||
|
||||
async function getUserList() {
|
||||
|
@ -162,8 +165,6 @@ async function getUserList() {
|
|||
})
|
||||
state.value.userList = data.list
|
||||
}
|
||||
|
||||
function onProtocol(title) {}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -13,6 +13,10 @@ const PointApi = {
|
|||
url: '/particulars/point/send-member',
|
||||
method: 'post',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
successMsg: '赠送成功',
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue