|
...
|
...
|
@@ -279,7 +279,7 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { |
|
|
|
///获取二维码
|
|
|
|
_getWechatQrcode({bool need = false}) async {
|
|
|
|
String sid = Provider.of<UserModel>(context, listen: false).user.sellerid;
|
|
|
|
String id = Provider.of<UserModel>(context, listen: false).user.openid;
|
|
|
|
// String id = Provider.of<UserModel>(context, listen: false).user.openid;
|
|
|
|
// https: //xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode/sellerid/商家ID/uid/当前账号ID
|
|
|
|
Response response = await DioUtil.getInstance().getDio().get(
|
|
|
|
"https://xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode?sellerid=$sid&uid=${data.id}");
|
|
...
|
...
|
@@ -312,6 +312,10 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { |
|
|
|
userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
|
|
|
|
personnelProvider = Provider.of<PersonnelProvider>(context, listen: true);
|
|
|
|
|
|
|
|
Color wechatColor = data?.openid == null || data?.openid == 'null'
|
|
|
|
? MyColours.color_438E93
|
|
|
|
: MyColours.color_8EBBBE;
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar(
|
|
...
|
...
|
@@ -424,62 +428,62 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { |
|
|
|
Positioned(
|
|
|
|
top: ScreenUtil().setWidth(13 * 2),
|
|
|
|
left: ScreenUtil().setWidth(35 * 2),
|
|
|
|
child:
|
|
|
|
data?.headimgurl != null && data?.headimgurl != 'null'
|
|
|
|
? ClipRRect(
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(80)),
|
|
|
|
child: CachedNetworkImage(
|
|
|
|
imageUrl: data?.headimgurl,
|
|
|
|
child: data?.headimgurl != null &&
|
|
|
|
data?.headimgurl != 'null' &&
|
|
|
|
data?.headimgurl != ''
|
|
|
|
? ClipRRect(
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(80)),
|
|
|
|
child: CachedNetworkImage(
|
|
|
|
imageUrl: data?.headimgurl,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil().setWidth(80 * 2),
|
|
|
|
height: ScreenUtil().setWidth(80 * 2),
|
|
|
|
))
|
|
|
|
: Stack(alignment: Alignment.center, children: [
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil().setWidth(80 * 2),
|
|
|
|
height: ScreenUtil().setWidth(80 * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(80)))),
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('personnal_no_image'),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil().setWidth(80 * 2),
|
|
|
|
height: ScreenUtil().setWidth(80 * 2),
|
|
|
|
))
|
|
|
|
: Stack(alignment: Alignment.center, children: [
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil().setWidth(80 * 2),
|
|
|
|
height: ScreenUtil().setWidth(80 * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(80)))),
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('personnal_no_image'),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil().setWidth(50 * 2),
|
|
|
|
height: ScreenUtil().setWidth(50 * 2)),
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
width: ScreenUtil().setWidth(50 * 2),
|
|
|
|
height: ScreenUtil().setWidth(50 * 2)),
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(114),
|
|
|
|
data?.openid == null || data?.openid == 'null'
|
|
|
|
? RoundButton(
|
|
|
|
text: '绑定微信',
|
|
|
|
gradientStart: MyColours.color_438E93,
|
|
|
|
gradientEnd: MyColours.color_438E93,
|
|
|
|
borderColor: MyColours.color_438E93,
|
|
|
|
width: ScreenUtil().setWidth(80 * 2),
|
|
|
|
height: ScreenUtil().setWidth(30 * 2),
|
|
|
|
fontSize: 32,
|
|
|
|
isBold: true,
|
|
|
|
textColor: MyColours.color_ffffff,
|
|
|
|
radius: ScreenUtil().setWidth(12),
|
|
|
|
onPressed: () {
|
|
|
|
if (dcAdduserCode != '' && dcAdduserCode != null) {
|
|
|
|
DialogUtil.openAlertDialogImage(
|
|
|
|
context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660);
|
|
|
|
} else {
|
|
|
|
_getWechatQrcode(need: true);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
: SizedBox(),
|
|
|
|
data?.openid == null || data?.openid == 'null'
|
|
|
|
? VEmptyView(48)
|
|
|
|
: SizedBox(),
|
|
|
|
|
|
|
|
RoundButton(
|
|
|
|
text: data?.openid == null || data?.openid == 'null'
|
|
|
|
? '绑定微信'
|
|
|
|
: '更换微信',
|
|
|
|
gradientStart: wechatColor,
|
|
|
|
gradientEnd: wechatColor,
|
|
|
|
borderColor: wechatColor,
|
|
|
|
width: ScreenUtil().setWidth(80 * 2),
|
|
|
|
height: ScreenUtil().setWidth(30 * 2),
|
|
|
|
fontSize: 32,
|
|
|
|
isBold: true,
|
|
|
|
textColor: MyColours.color_ffffff,
|
|
|
|
radius: ScreenUtil().setWidth(12),
|
|
|
|
onPressed: () {
|
|
|
|
if (dcAdduserCode != '' && dcAdduserCode != null) {
|
|
|
|
DialogUtil.openAlertDialogImage(
|
|
|
|
context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660);
|
|
|
|
} else {
|
|
|
|
_getWechatQrcode(need: true);
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
VEmptyView(48),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
NavigatorUtil.goPersonnelPasswordEditPage(context,
|
...
|
...
|
|