Explorar el Código

1、淘宝弹窗授权方法更改

tags/0.0.15+4
PH2 hace 3 años
padre
commit
30319dcb03
Se han modificado 3 ficheros con 18 adiciones y 9 borrados
  1. +10
    -0
      lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_goods_dialog.dart
  2. +8
    -5
      lib/widgets/goods_details/evaluate/goods_details_evaluate_widget.dart
  3. +0
    -4
      lib/widgets/home/home_auth/home_auth.dart

+ 10
- 0
lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_goods_dialog.dart Ver fichero

@@ -362,6 +362,7 @@ class _IntellectSearchGoodsDialogState
void openUrl() async {
///跳转购买
UserInfoModel userInfo = UserInfoNotifier.staitcUserInfo;
/// 登录
if (userInfo?.token == null || userInfo.token == '') {
print('need login...');
RouterUtil.goLogin(context);
@@ -378,6 +379,15 @@ class _IntellectSearchGoodsDialogState
if (Navigator.canPop(context)) {
Navigator.pop(context);
}

String tempProvider = widget?.model?.provider ?? 'taobao';

/// 判断淘宝渠道是否授权
if(tempProvider == GlobalConfig.PROVIDER_TB || tempProvider == GlobalConfig.PROVIDER_TM ) {
bool isAuth = await TaobaoAuth.auth(context);
if (!isAuth) return;
}

/// 改成统一跳转
await TurnChainUtil.jumpNative(
context,


+ 8
- 5
lib/widgets/goods_details/evaluate/goods_details_evaluate_widget.dart Ver fichero

@@ -34,11 +34,14 @@ class GoodsDetailsEvaluateWidget extends StatelessWidget {
return;
}

// bool isAuth = await TaobaoAuth.isAuth();
if (!_user.isTBAuth) {
TaobaoAuth.auth(context);
return;
}
// if (!_user.isTBAuth) {
// TaobaoAuth.auth(context);
// return;
// }
bool isAuth = await TaobaoAuth.auth(context);
if(!isAuth) return;


TradeResult result;
if (!EmptyUtil.isEmpty(_model?.comment_url)) {
if (Platform.isAndroid) {


+ 0
- 4
lib/widgets/home/home_auth/home_auth.dart Ver fichero

@@ -27,10 +27,6 @@ class _HomeAuthState extends State<HomeAuth> {

@override
void initState() {
// TaobaoAuth.isAuth().then((isAuth) {
// setState(() => this._isAuth = isAuth);
// });

super.initState();
}



Cargando…
Cancelar
Guardar