Skip to content

Commit

Permalink
修复商品分享页直接登陆时无法显示二维码的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kathy1003 committed May 28, 2024
1 parent bb6b85e commit 1d6044a
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions lib/page/sell_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package:maixs_utils/widget/views.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:sufenbao/util/tao_util.dart';

import '../me/model/userinfo.dart';
import '../service.dart';
import '../share/ShareDialog.dart';
import '../util/colors.dart';
Expand Down Expand Up @@ -51,7 +52,33 @@ class _SellPageState extends State<SellPage> {
var pic = '';
Map<String, String> shareMap = {};
String shareUrl = '';
bool loading = true;

@override
void initState() {
initData();
super.initState();
}

Future initData() async {
if(Global.userinfo == null) {
Map<String, dynamic> json = await BService.userinfo(baseInfo: true);
if (json.isEmpty) {
return;
}
Global.userinfo = Userinfo.fromJson(json);
}
loading = false;
setState(() {

});
data = widget.data['res'];
detailDm.addObject(data);
String platType = widget.data['platType'];
iconPath = getIconPath(platType);
getPlatTypeDetail(platType);
initShareInfo();
}
@override
Widget build(BuildContext context) {
return ScaffoldWidget(
Expand Down Expand Up @@ -133,7 +160,7 @@ class _SellPageState extends State<SellPage> {
PWidget.textNormal(
'— $APP_NAME 购物拆红包 —', [Colors.black, 14, true]),
PWidget.boxh(10),
if(Global.login)
if(!loading)
PWidget.textNormal(
'邀请口令:${Global.userinfo!.code}', [Colors.black, 12, true]),
], '200'),
Expand Down Expand Up @@ -207,17 +234,6 @@ class _SellPageState extends State<SellPage> {
));
}

@override
void initState() {
super.initState();
data = widget.data['res'];
detailDm.addObject(data);
String platType = widget.data['platType'];
iconPath = getIconPath(platType);
getPlatTypeDetail(platType);
initShareInfo();
}

Future initShareInfo() async {
Map data = getHbData(fee, widget.data['platType']);
String min = data['min'];
Expand Down

0 comments on commit 1d6044a

Please sign in to comment.