chore : upgrade version
fix : some ui bug
This commit is contained in:
@@ -39,6 +39,7 @@ class SalesInProvinceLogic extends GetxController {
|
||||
Rxn<GuildModel> selectedGuildModel = Rxn<GuildModel>();
|
||||
Rxn<GuildProfile> guildProfile = Rxn<GuildProfile>();
|
||||
RxInt saleType = 1.obs;
|
||||
RxInt priceType = 1.obs;
|
||||
RxInt weight = 0.obs;
|
||||
RxInt pricePerKilo = 0.obs;
|
||||
RxInt totalCost = 0.obs;
|
||||
@@ -70,7 +71,7 @@ class SalesInProvinceLogic extends GetxController {
|
||||
});
|
||||
|
||||
debounce(weight, time: Duration(milliseconds: 110), (callback) {
|
||||
iLog('weight: $callback, pricePerKilo: ${pricePerKilo.value}');
|
||||
|
||||
totalCost.value = callback * pricePerKilo.value;
|
||||
});
|
||||
|
||||
@@ -273,7 +274,7 @@ class SalesInProvinceLogic extends GetxController {
|
||||
|
||||
void setSubmitData() {
|
||||
tmpStewardAllocation = SubmitStewardAllocation(
|
||||
approvedPriceStatus: false,
|
||||
approvedPriceStatus: broadcastPrice.value?.active ?? false,
|
||||
allocationType:
|
||||
'${guildProfile.value?.steward == true ? "steward" : "guild"}_${selectedGuildModel.value?.steward == true ? "steward" : "guild"}',
|
||||
sellerType: guildProfile.value?.steward == true ? "Steward" : "Guild",
|
||||
|
||||
@@ -417,13 +417,8 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
controller.selectedGuildModel.refresh();
|
||||
},
|
||||
),
|
||||
ObxValue((data) {
|
||||
return Text(
|
||||
(data.value?.active == true) ? 'قیمت مصوب' : 'فروش اختصاصی',
|
||||
style: AppFonts.yekan14,
|
||||
);
|
||||
}, controller.broadcastPrice),
|
||||
SizedBox(width: 12),
|
||||
Text('فروش اختصاصی', style: AppFonts.yekan14),
|
||||
SizedBox(width: 30.w),
|
||||
Radio(
|
||||
value: 2,
|
||||
groupValue: controller.saleType.value,
|
||||
@@ -506,24 +501,46 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
),
|
||||
|
||||
Obx(() {
|
||||
return RTextField(
|
||||
variant: RTextFieldVariant.noBorder,
|
||||
controller: controller.pricePerKiloController,
|
||||
borderColor: AppColor.darkGreyLight,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
SeparatorInputFormatter(),
|
||||
],
|
||||
filledColor: AppColor.bgLight,
|
||||
filled: true,
|
||||
enabled:
|
||||
(controller.broadcastPrice.value?.active == false ||
|
||||
controller.saleType.value == 2),
|
||||
onChanged: (p0) {
|
||||
controller.pricePerKilo.value = int.tryParse(p0.clearComma) ?? 0;
|
||||
return RadioGroup(
|
||||
groupValue: controller.priceType.value,
|
||||
onChanged: (value) {
|
||||
controller.priceType.value = value!;
|
||||
},
|
||||
keyboardType: TextInputType.number,
|
||||
label: 'قیمت هر کیلو (ريال)',
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Radio(value: 1),
|
||||
Text('قیمت مصوب', style: AppFonts.yekan14),
|
||||
|
||||
SizedBox(width: 30.w),
|
||||
|
||||
Radio(value: 2),
|
||||
Text('قیمت آزاد', style: AppFonts.yekan14),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
||||
Obx(() {
|
||||
return Visibility(
|
||||
visible: controller.broadcastPrice.value?.active == true,
|
||||
child: RTextField(
|
||||
variant: RTextFieldVariant.noBorder,
|
||||
controller: controller.pricePerKiloController,
|
||||
borderColor: AppColor.darkGreyLight,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
SeparatorInputFormatter(),
|
||||
],
|
||||
filledColor: AppColor.bgLight,
|
||||
filled: true,
|
||||
enabled: (controller.priceType.value == 2),
|
||||
onChanged: (p0) {
|
||||
controller.pricePerKilo.value = int.tryParse(p0.clearComma) ?? 0;
|
||||
},
|
||||
keyboardType: TextInputType.number,
|
||||
label: 'قیمت هر کیلو (ريال)',
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user