“yanghuaxuan” hace 3 años
padre
commit
088372c951
Se han modificado 4 ficheros con 27 adiciones y 12 borrados
  1. +14
    -9
      lib/models/base/base_tab_model.dart
  2. +3
    -0
      lib/util/global_config.dart
  3. +5
    -1
      lib/util/net_util.dart
  4. +5
    -2
      lib/util/taobao/taobao_auth.dart

+ 14
- 9
lib/models/base/base_tab_model.dart Ver fichero

@@ -9,16 +9,19 @@ class BaseTabModel extends SkipModel {
String cateTag;
String bgColor;
String fontColor;
//抖券判断是否是底部创建,默认不是
bool isBottomVideo = false;

BaseTabModel(
{this.name,
this.isShow,
this.icon,
this.chooseColor,
this.chooseIcon,
this.cateTag,
this.bgColor,
this.fontColor});
BaseTabModel({this.name,
this.isShow,
this.icon,
this.chooseColor,
this.chooseIcon,
this.cateTag,
this.bgColor,
this.fontColor,
this.isBottomVideo
});

BaseTabModel.fromJson(Map<String, dynamic> json) {
super.fromJson(json);
@@ -33,6 +36,7 @@ class BaseTabModel extends SkipModel {
requiredTaobaoAuth = json['required_taobao_auth'];
bgColor = json['bg_color'];
fontColor = json['font_color'];
isBottomVideo=json['is_bottom_video'];
}

Map<String, dynamic> toJson() {
@@ -45,6 +49,7 @@ class BaseTabModel extends SkipModel {
data['cate_tag'] = this.cateTag;
data['bg_color'] = this.bgColor;
data['font_color'] = this.fontColor;
data['is_bottom_video'] = this.isBottomVideo;
return data;
}
}

+ 3
- 0
lib/util/global_config.dart Ver fichero

@@ -50,4 +50,7 @@ class GlobalConfig {
///guide缓存表记
static final String GUIDE='sp_guide';

/// 用户协议显示 用户是否同意隐私协议
static String isShowPolicy = "is_show_policy";

}

+ 5
- 1
lib/util/net_util.dart Ver fichero

@@ -446,7 +446,11 @@ class NetUtil {
/// 获取Android imei
static Future<String> getImei() async {
try {
return await FlutterAlibc.getUdid();
// 用户同意隐私协议之后才能读取
String isShowPolicy = await SharedPreferencesUtil.getStringValue(GlobalConfig.isShowPolicy);
if (!EmptyUtil.isEmpty(isShowPolicy) && '1' == isShowPolicy) {
return await FlutterAlibc.getUdid();
}
} catch (e, s) {
Logger.error(e, s);
}


+ 5
- 2
lib/util/taobao/taobao_auth.dart Ver fichero

@@ -61,11 +61,14 @@ class TaobaoAuth {
}

if (!EmptyUtil.isEmpty(resultMsg["accessToken"])) {
Fluttertoast.showToast(msg: '授权成功~');
// Fluttertoast.showToast(msg: '授权成功~');
print("access 成功 $resultMsg");
Map<String, dynamic> params = {};
params['access_token'] = resultMsg["accessToken"]?.toString();
await NetUtil.post('/api/v1/tbredirect', params: params, method: NetMethod.POST);
var result = await NetUtil.post('/api/v1/tbredirect', params: params, method: NetMethod.POST);
if (NetUtil.isSuccess(result)) {
Fluttertoast.showToast(msg: '授权成功~');
}
} else {
print("access 失败 $resultMsg");
Fluttertoast.showToast(msg: "access 失败 $resultMsg");


Cargando…
Cancelar
Guardar