fix(price-trigger): SMS-only alerts in ghatreh user app
Match khaneghi_user price trigger SMS-only behavior and UI copy. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -11,10 +11,6 @@
|
|||||||
<span class="dptr-card__label">جهت قیمت:</span>
|
<span class="dptr-card__label">جهت قیمت:</span>
|
||||||
<span class="dptr-card__value">{{ returnPriceCondition(item.price_condition) }}</span>
|
<span class="dptr-card__value">{{ returnPriceCondition(item.price_condition) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="dptr-card__row">
|
|
||||||
<span class="dptr-card__label">نوع هشدار:</span>
|
|
||||||
<span class="dptr-card__value">{{ returnAction(item.action) }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="dptr-card__actions">
|
<div class="dptr-card__actions">
|
||||||
@@ -82,7 +78,6 @@
|
|||||||
<div class="flex flex-col gap-2 mt-2">
|
<div class="flex flex-col gap-2 mt-2">
|
||||||
<BasicInfoItem is-line title="محصول" :value="productTitle" />
|
<BasicInfoItem is-line title="محصول" :value="productTitle" />
|
||||||
<BasicInfoItem is-line title="جهت قیمت" :value="returnPriceCondition(item.price_condition)" />
|
<BasicInfoItem is-line title="جهت قیمت" :value="returnPriceCondition(item.price_condition)" />
|
||||||
<BasicInfoItem is-line title="نوع هشدار" :value="returnAction(item.action)" />
|
|
||||||
</div>
|
</div>
|
||||||
<a-divider class="!my-3" />
|
<a-divider class="!my-3" />
|
||||||
<div class="flex justify-between mt-1">
|
<div class="flex justify-between mt-1">
|
||||||
@@ -143,10 +138,10 @@ onMounted(() => {
|
|||||||
isActive.value = props.item.is_active
|
isActive.value = props.item.is_active
|
||||||
})
|
})
|
||||||
|
|
||||||
function changeActive(val: boolean) {
|
async function changeActive(val: boolean) {
|
||||||
try {
|
try {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
updatePriceTrigger(props?.item.id, { is_active: val })
|
await updatePriceTrigger(props?.item.id, { is_active: val })
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
isActive.value = !isActive.value
|
isActive.value = !isActive.value
|
||||||
@@ -178,15 +173,4 @@ async function deleteItem() {
|
|||||||
deleteLoading.value = false
|
deleteLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function returnAction(val: string) {
|
|
||||||
switch (val) {
|
|
||||||
case 'sms':
|
|
||||||
return 'پیامک'
|
|
||||||
case 'email':
|
|
||||||
return 'ایمیل'
|
|
||||||
case 'notify':
|
|
||||||
return 'نوتیفیکیشن'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -37,12 +37,7 @@
|
|||||||
type="price"
|
type="price"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :rules="[required()]" label="نوع هشدار را انتخاب کنید" name="action">
|
<p class="m-0 text-sm text-gray-500">پس از فعال شدن هشدار، پیامک به شماره موبایل شما ارسال میشود.</p>
|
||||||
<a-radio-group v-model:value="form.action">
|
|
||||||
<a-radio :style="radioStyle" value="sms">ارسال پیامک</a-radio>
|
|
||||||
<a-radio :style="radioStyle" value="email">ارسال ایمیل</a-radio>
|
|
||||||
</a-radio-group>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<BasicButton class="w-full" html-type="submit" type="primary">
|
<BasicButton class="w-full" html-type="submit" type="primary">
|
||||||
@@ -66,7 +61,6 @@ const {
|
|||||||
formRef,
|
formRef,
|
||||||
editId,
|
editId,
|
||||||
loading,
|
loading,
|
||||||
radioStyle,
|
|
||||||
typeItems,
|
typeItems,
|
||||||
products,
|
products,
|
||||||
ok,
|
ok,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ function emptyForm(): PriceTrigger {
|
|||||||
product_id: undefined,
|
product_id: undefined,
|
||||||
price_condition: '',
|
price_condition: '',
|
||||||
is_active: true,
|
is_active: true,
|
||||||
action: '',
|
action: 'sms',
|
||||||
target_price: '',
|
target_price: '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,6 +101,7 @@ export function usePriceTriggerPage() {
|
|||||||
await formRef.value?.validateFields().then(async () => {
|
await formRef.value?.validateFields().then(async () => {
|
||||||
try {
|
try {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
form.value.action = 'sms'
|
||||||
if (editId.value) {
|
if (editId.value) {
|
||||||
await updatePriceTrigger(editId.value, form.value)
|
await updatePriceTrigger(editId.value, form.value)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user