|
@@ -11,6 +11,7 @@ import 'package:flutter/cupertino.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:plugin_basic/basic_export.dart';
|
|
|
import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
|
|
|
+import 'package:plugin_platform/engine/permission/permission_engine.dart';
|
|
|
import 'package:plugin_platform/engine/toast/toast_engine.dart';
|
|
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
|
import 'package:router/ext/auto_router_extensions.dart';
|
|
@@ -172,18 +173,20 @@ class ServiceCleanDetailVm extends _$ServiceCleanDetailVm {
|
|
|
|
|
|
// 点击了底部的点赞按钮
|
|
|
Future<bool?> handlerClickLikedBtn(BuildContext? context, int id, bool isLiked) async{
|
|
|
- // var vm;
|
|
|
- // if(_cleanServiceType == "forSale"){
|
|
|
- // // vm = ref.read(forsaleVmProvider.notifier);
|
|
|
- // }else if(_cleanServiceType == "forRent"){
|
|
|
- // vm = ref.read(forrentVmProvider.notifier);
|
|
|
- // }
|
|
|
- // try {
|
|
|
- // final isSuccess = await vm.handlerClickCollection(id, isCollection);
|
|
|
- // return isSuccess;
|
|
|
- // }catch(e){
|
|
|
- //
|
|
|
- // }
|
|
|
+ try {
|
|
|
+ Map<String, dynamic> params = {
|
|
|
+ "id": id,
|
|
|
+ "type": 'paid', // 类型(paid=付费服务,inquiry=询价服务)
|
|
|
+ };
|
|
|
+ final result = await serviceRespositoryInstance.fetchServiceLiked(params);
|
|
|
+ if(result.isSuccess){
|
|
|
+ return true;
|
|
|
+ }else{
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }catch(e){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 判断是whatsapp 还是 mobile (通过 contact: whatsapp:+8617671757687)
|
|
@@ -240,17 +243,19 @@ class ServiceCleanDetailVm extends _$ServiceCleanDetailVm {
|
|
|
|
|
|
// 拨打电话
|
|
|
Future<void> makePhoneCall(String phoneNumber) async {
|
|
|
- final Uri launchUri = Uri(
|
|
|
- scheme: 'tel',
|
|
|
- path: phoneNumber,
|
|
|
- );
|
|
|
-
|
|
|
- if (await canLaunchUrl(launchUri)) {
|
|
|
- await launchUrl(launchUri);
|
|
|
- } else {
|
|
|
- ToastEngine.show("Could not launch $launchUri");
|
|
|
- throw 'Could not launch $launchUri';
|
|
|
- }
|
|
|
+ PermissionEngine().requestCallPhonePermission(() async {
|
|
|
+ final Uri launchUri = Uri(
|
|
|
+ scheme: 'tel',
|
|
|
+ path: phoneNumber,
|
|
|
+ );
|
|
|
+
|
|
|
+ if (await canLaunchUrl(launchUri)) {
|
|
|
+ await launchUrl(launchUri);
|
|
|
+ } else {
|
|
|
+ ToastEngine.show("Could not launch $launchUri");
|
|
|
+ throw 'Could not launch $launchUri';
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
// 点击了 Book Now 按钮
|
|
@@ -285,6 +290,7 @@ class ServiceCleanDetailVm extends _$ServiceCleanDetailVm {
|
|
|
DialogEngine.show(
|
|
|
tag: "chooseHouseClean",
|
|
|
position: DialogPosition.bottom,
|
|
|
+ clickMaskDismiss:false,
|
|
|
widget: DialogContentWrap(
|
|
|
key: _chooseHouseCleanDialogGlobalKey,
|
|
|
loadingState: dialogState,
|
|
@@ -300,6 +306,7 @@ class ServiceCleanDetailVm extends _$ServiceCleanDetailVm {
|
|
|
// bottomBtnSectionPadding: EdgeInsets.only(left: 20, right: 20, bottom: 20,top: 20),
|
|
|
yesBtnBg: context.appColors.redDefault,
|
|
|
noBtnBg: context.appColors.grayBgE9,
|
|
|
+ closeIconColor: context.appColors.textPrimary,
|
|
|
confirmTxt: "Confirm Selection",
|
|
|
cancelTxt: "Cancel",
|
|
|
// yesBtnTextStyle: TextStyle(
|
|
@@ -312,6 +319,7 @@ class ServiceCleanDetailVm extends _$ServiceCleanDetailVm {
|
|
|
// fontSize: 17,
|
|
|
// fontWeight: FontWeight.w400
|
|
|
// ),
|
|
|
+ closeAction: (){},
|
|
|
confirmAction: chooseHouseCleanConfirmFn,
|
|
|
cancelAction: chooseHouseCleanCancelFn,
|
|
|
titleBuilder: (context) {
|
|
@@ -335,6 +343,7 @@ class ServiceCleanDetailVm extends _$ServiceCleanDetailVm {
|
|
|
DialogEngine.show(
|
|
|
tag: "chooseAirConditionClean",
|
|
|
position: DialogPosition.bottom,
|
|
|
+ clickMaskDismiss:false ,
|
|
|
widget: DialogContentWrap(
|
|
|
key: _chooseAirCleanDialogGlobalKey,
|
|
|
loadingState: dialogState,
|
|
@@ -348,6 +357,7 @@ class ServiceCleanDetailVm extends _$ServiceCleanDetailVm {
|
|
|
topLeftRadius: 20.0,
|
|
|
topRightRadius: 20.0,
|
|
|
// bottomBtnSectionPadding: EdgeInsets.only(left: 20, right: 20, bottom: 20,top: 20),
|
|
|
+ closeIconColor: context.appColors.textPrimary,
|
|
|
yesBtnBg: context.appColors.redDefault,
|
|
|
noBtnBg: context.appColors.grayBgE9,
|
|
|
confirmTxt: "Confirm Selection",
|
|
@@ -363,6 +373,7 @@ class ServiceCleanDetailVm extends _$ServiceCleanDetailVm {
|
|
|
// fontWeight: FontWeight.w400
|
|
|
// ),
|
|
|
isConfirmAutoClose: false,
|
|
|
+ closeAction: () {},
|
|
|
confirmAction: chooseAirConditionConfirmFn,
|
|
|
cancelAction: chooseAirConditionCancelFn,
|
|
|
titleBuilder: (context) {
|