diff --git a/components/BuyReportForm.vue b/components/BuyReportForm.vue index f30a8b9..6df3db2 100644 --- a/components/BuyReportForm.vue +++ b/components/BuyReportForm.vue @@ -28,6 +28,15 @@ const { form, onSubmit } = useReportForm({ name: props.product.name, targetCity: props.city.name }); + +const changePricePercent = (type: 'add' | 'reduce') => { + const percent = form.values.percent?.[0] ?? 100; + if (type === 'add') { + form.setFieldValue('percent', [percent + 1]); + } else { + form.setFieldValue('percent', [percent - 1]); + } +} - - 操作 @@ -127,12 +125,6 @@ const sortCitesByPercent = (filteredCities: CityInfo[], sourceCityName: string, /> - - - - - - diff --git a/components/CreateLog.vue b/components/CreateLog.vue index e1e05a3..24aef98 100644 --- a/components/CreateLog.vue +++ b/components/CreateLog.vue @@ -85,7 +85,7 @@ const changePricePercent = (type: 'add' | 'reduce') => {
商品 - + {{ sourceCityName }} 购买的 diff --git a/components/SellReportForm.vue b/components/SellReportForm.vue index 34a6210..7e6fffc 100644 --- a/components/SellReportForm.vue +++ b/components/SellReportForm.vue @@ -28,6 +28,15 @@ const { form, onSubmit } = useReportForm({ name: props.product.name, targetCity: props.target.name }); + +const changePricePercent = (type: 'add' | 'reduce') => { + const percent = form.values.percent?.[0] ?? 100; + if (type === 'add') { + form.setFieldValue('percent', [percent + 1]); + } else { + form.setFieldValue('percent', [percent - 1]); + } +}