12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361 |
- import 'dart:convert';
- import 'dart:math' as math;
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:liftmanager/internal/bbs/bbs_router.dart';
- import 'package:liftmanager/internal/bbs/model/expert_comment_model.dart'
- as comment;
- import 'package:liftmanager/internal/bbs/model/expert_model.dart';
- import 'package:liftmanager/internal/bbs/presenter/expert_comment_list_presenter.dart';
- import 'package:liftmanager/internal/search/presenter/base_list_provider.dart';
- import 'package:liftmanager/mvp/base_page_state.dart';
- import 'package:liftmanager/net/api_service.dart';
- import 'package:liftmanager/res/resources.dart';
- import 'package:liftmanager/routers/fluro_navigator.dart';
- import 'package:liftmanager/utils/theme_utils.dart';
- import 'package:liftmanager/utils/time_format.dart';
- import 'package:liftmanager/utils/toast.dart';
- import 'package:liftmanager/widgets/app_bar.dart';
- import 'package:liftmanager/widgets/clip_widgets.dart';
- import 'package:liftmanager/widgets/load_image.dart';
- import 'package:liftmanager/widgets/my_refresh_list.dart';
- import 'package:liftmanager/widgets/star_item.dart';
- import 'package:provider/provider.dart';
- import 'package:shared_preferences/shared_preferences.dart';
- import 'package:umeng_common_sdk/umeng_common_sdk.dart';
- class ExpertDetail extends StatefulWidget {
- ExpertDetail(this.id);
- final String id;
- @override
- ExpertDetailState createState() => ExpertDetailState();
- }
- class ExpertDetailState
- extends BasePageState<ExpertDetail, ExpertCommentListPresenter> {
- BaseListProvider<comment.Records> provider =
- BaseListProvider<comment.Records>();
- // ExpertListState({Key key}) : super(key: key);
- ScrollController _scrollController;
- int listLength = 0;
- List<String> labelList = ["特邀专家", "回复及时"];
- @override
- void initState() {
- super.initState();
- getExpertDetail();
- _onRefresh();
- }
- bool _hasData = false;
- bool kaiType = false;
- int _page = 1;
- Records detailObj;
- Future getExpertDetail() async {
- await NewApiService().getExpertDetail(widget.id, onSuccess: (res) {
- if (res != null) {
- _hasData = true;
- detailObj = res;
- print(123456);
- print(jsonEncode(res));
- setState(() {});
- }
- }, onError: (code, msg) {
- toasts(msg);
- });
- }
- @override
- Widget build(BuildContext context) {
- double width = MediaQuery.of(context).size.width;
- double height = MediaQuery.of(context).size.height;
- return ChangeNotifierProvider<BaseListProvider<comment.Records>>(
- create: (_) => provider,
- child: Scaffold(
- appBar: MyAppBar(
- centerTitle: '专家详情',
- // title: '专家详情',
- actions: <Widget>[
- // FlatButton(
- // child: Icon(
- // IconData(
- // 0xe6f4,
- // fontFamily:"Iconfont"
- // ),
- // size: 26.0,
- // color:Color.fromRGBO(255, 255, 255, 1),
- // ),
- // textColor: Colours.dark_text,
- // highlightColor: Colors.transparent,
- // onPressed: () {
- // },
- // )
- ],
- ),
- body: Container(
- child: _hasData
- ? Stack(
- children: <Widget>[
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- // provider.list.length<1?expertDetailWisget():Container(child: null,),
- expertDetailWisget(),
- listLength == 0
- ? Expanded(
- child: ListView(
- children: <Widget>[
- Column(children: <Widget>[
- Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(20),
- right:
- ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(10),
- bottom:
- ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(
- width: 0.5,
- color: Colours.line),
- ),
- ),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.start,
- children: <Widget>[
- Container(
- padding: EdgeInsets.only(
- right: 5),
- child: LoadAssetImage(
- // image: AssetImage(i['img']),
- "expert_three",
- width: ScreenUtil()
- .setWidth(32),
- height: ScreenUtil()
- .setWidth(32),
- // alignment: Alignment.centerLeft,
- ),
- ),
- Text(
- "专家简介",
- style: TextStyle(
- fontSize: ScreenUtil()
- .setSp(17)),
- textAlign: TextAlign.start,
- ),
- // Text(
- // "奥的斯",
- // style: TextStyle(
- // color:Color(0xff999999),
- // fontSize:18
- // ),
- // textAlign:TextAlign.start,
- // ),
- ]),
- ),
- !kaiType
- ? Container(
- width: width,
- padding: EdgeInsets.only(
- left: ScreenUtil()
- .setWidth(20),
- right: ScreenUtil()
- .setWidth(15),
- top: ScreenUtil()
- .setWidth(10)),
- child: Text(
- detailObj.introduction ??
- '暂无',
- style: TextStyle(
- color:
- Color(0xff999999),
- fontSize: ScreenUtil()
- .setSp(14)),
- textAlign: TextAlign.start,
- maxLines: 2,
- overflow:
- TextOverflow.ellipsis,
- ),
- )
- : Container(
- width: width,
- padding: EdgeInsets.only(
- left: ScreenUtil()
- .setWidth(20),
- right: ScreenUtil()
- .setWidth(15),
- top: ScreenUtil()
- .setWidth(10)),
- child: Text(
- detailObj.introduction ??
- '暂无',
- style: TextStyle(
- color:
- Color(0xff999999),
- fontSize: ScreenUtil()
- .setSp(14)),
- textAlign: TextAlign.start,
- ),
- ),
- // !kaiType?
- InkWell(
- onTap: () {
- setState(() {
- kaiType = !kaiType;
- });
- },
- child: Container(
- color: Color(0x195887FF),
- // this.bgcolor =const Color(0x195887FF),
- // this.textcolor= const Color(0xff5887FF),
- padding: EdgeInsets.only(
- right: 20, bottom: 10),
- width: width,
- child: Text(
- !kaiType ? "展开" : "收起",
- style: TextStyle(
- color: Color(0xff5887FF),
- fontSize:
- ScreenUtil().setSp(14)),
- textAlign: TextAlign.end,
- ),
- ),
- )
- // :Container(child: null,)
- ,
- Container(
- height: 5,
- color: ThemeUtils
- .getDialogTextFieldColor(
- context),
- child: null,
- ),
- Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(20),
- right:
- ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(10),
- bottom:
- ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(
- width: 0.5,
- color: Colours.line),
- ),
- ),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.start,
- children: <Widget>[
- Container(
- padding: EdgeInsets.only(
- right: 5),
- child: LoadAssetImage(
- // image: AssetImage(i['img']),
- "expert_two",
- width: ScreenUtil()
- .setWidth(32),
- height: ScreenUtil()
- .setWidth(32),
- // alignment: Alignment.centerLeft,
- ),
- ),
- Text(
- "执业经历",
- style: TextStyle(
- fontSize: ScreenUtil()
- .setSp(17)),
- textAlign: TextAlign.start,
- ),
- // Text(
- // "奥的斯",
- // style: TextStyle(
- // color:Color(0xff999999),
- // fontSize:18
- // ),
- // textAlign:TextAlign.start,
- // ),
- ]),
- ),
- Container(
- width: width,
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(20),
- right:
- ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(10),
- bottom:
- ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(
- width: 5,
- color: ThemeUtils
- .getDialogTextFieldColor(
- context)),
- ),
- ),
- child: Text(
- detailObj.experience ?? '暂无',
- style: TextStyle(
- color: Color(0xff999999),
- fontSize:
- ScreenUtil().setSp(14)),
- textAlign: TextAlign.start,
- ),
- ),
- Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(20),
- right:
- ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(10),
- bottom:
- ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(
- width: 0.5,
- color: Colours.line),
- ),
- ),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.start,
- children: <Widget>[
- Container(
- padding: EdgeInsets.only(
- right: 5),
- child: LoadAssetImage(
- // image: AssetImage(i['img']),
- "expert_one",
- width: ScreenUtil()
- .setWidth(32),
- height: ScreenUtil()
- .setWidth(32),
- // alignment: Alignment.centerLeft,
- ),
- ),
- Text(
- "用户评价",
- style: TextStyle(
- fontSize: ScreenUtil()
- .setSp(17)),
- textAlign: TextAlign.start,
- ),
- ]),
- ),
- Center(
- child: Container(
- padding: EdgeInsets.only(top: 10),
- child: Text(
- '无数据',
- style: TextStyle(
- color: Color(0xff999999),
- fontSize:
- ScreenUtil().setSp(14)),
- textAlign: TextAlign.start,
- ),
- )),
- ])
- ],
- ),
- )
- : Container(
- child: null,
- ),
- listLength != 0
- ? Expanded(
- flex: 1,
- child: Consumer<
- BaseListProvider<comment.Records>>(
- builder: (_, provider, __) {
- return MyListView(
- key: Key('expert_comment_list'),
- pageSize: 4,
- normal: false,
- itemCount: provider.list.length,
- stateType: provider.stateType,
- onRefresh: _onRefresh,
- loadMore: _loadMore,
- hasMore: provider.hasMore,
- itemBuilder: (_, index) {
- return Container(
- child: Column(
- children: <Widget>[
- index == 0
- ? Column(children: <Widget>[
- Container(
- padding: EdgeInsets.only(
- left: ScreenUtil()
- .setWidth(20),
- right:
- ScreenUtil()
- .setWidth(
- 15),
- top: ScreenUtil()
- .setWidth(10),
- bottom:
- ScreenUtil()
- .setWidth(
- 10)),
- decoration:
- BoxDecoration(
- border: Border(
- bottom: BorderSide(
- width: 0.5,
- color: Colours
- .line),
- ),
- ),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment
- .start,
- children: <
- Widget>[
- Container(
- padding: EdgeInsets
- .only(
- right:
- 5),
- child:
- LoadAssetImage(
- // image: AssetImage(i['img']),
- "expert_three",
- width: ScreenUtil()
- .setWidth(
- 32),
- height: ScreenUtil()
- .setWidth(
- 32),
- // alignment: Alignment.centerLeft,
- ),
- ),
- Text(
- "专家简介",
- style: TextStyle(
- fontSize:
- ScreenUtil()
- .setSp(17)),
- textAlign:
- TextAlign
- .start,
- ),
- // Text(
- // "奥的斯",
- // style: TextStyle(
- // color:Color(0xff999999),
- // fontSize:18
- // ),
- // textAlign:TextAlign.start,
- // ),
- ]),
- ),
- !kaiType
- ? Container(
- width: width,
- padding: EdgeInsets.only(
- left: ScreenUtil()
- .setWidth(
- 20),
- right: ScreenUtil()
- .setWidth(
- 15),
- top: ScreenUtil()
- .setWidth(
- 10)),
- child: Text(
- detailObj
- .introduction ??
- '暂无',
- style: TextStyle(
- color: Color(
- 0xff999999),
- fontSize:
- ScreenUtil()
- .setSp(14)),
- textAlign:
- TextAlign
- .start,
- maxLines: 2,
- overflow:
- TextOverflow
- .ellipsis,
- ),
- )
- : Container(
- width: width,
- padding: EdgeInsets.only(
- left: ScreenUtil()
- .setWidth(
- 20),
- right: ScreenUtil()
- .setWidth(
- 15),
- top: ScreenUtil()
- .setWidth(
- 10)),
- child: Text(
- detailObj
- .introduction ??
- '暂无',
- style: TextStyle(
- color: Color(
- 0xff999999),
- fontSize:
- ScreenUtil()
- .setSp(14)),
- textAlign:
- TextAlign
- .start,
- ),
- ),
- !kaiType
- ? InkWell(
- onTap: () {
- setState(() {
- kaiType =
- true;
- });
- },
- child: Row(
- children: [
- Expanded(
- child:
- Container()),
- Container(
- color: Color(
- 0x195887FF),
- padding: EdgeInsets.only(
- right:
- 5,
- left:
- 5,
- bottom:
- 3,
- top:
- 3),
- // width: width,
- child:
- Text(
- "展开",
- style: TextStyle(
- color:
- Color(0xff5887FF),
- fontSize: ScreenUtil().setSp(14)),
- textAlign:
- TextAlign.center,
- ),
- ),
- SizedBox(
- width: 5,
- )
- ],
- ))
- : Container(
- child: null,
- ),
- Container(
- padding: EdgeInsets.only(
- left: ScreenUtil()
- .setWidth(20),
- right:
- ScreenUtil()
- .setWidth(
- 15),
- top: ScreenUtil()
- .setWidth(10),
- bottom:
- ScreenUtil()
- .setWidth(
- 10)),
- decoration:
- BoxDecoration(
- border: Border(
- bottom: BorderSide(
- width: 0.5,
- color: Colours
- .line),
- ),
- ),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment
- .start,
- children: <
- Widget>[
- Container(
- padding: EdgeInsets
- .only(
- right:
- 5),
- child:
- LoadAssetImage(
- // image: AssetImage(i['img']),
- "expert_two",
- width: ScreenUtil()
- .setWidth(
- 32),
- height: ScreenUtil()
- .setWidth(
- 32),
- // alignment: Alignment.centerLeft,
- ),
- ),
- Text(
- "执业经历",
- style: TextStyle(
- fontSize:
- ScreenUtil()
- .setSp(17)),
- textAlign:
- TextAlign
- .start,
- ),
- // Text(
- // "奥的斯",
- // style: TextStyle(
- // color:Color(0xff999999),
- // fontSize:18
- // ),
- // textAlign:TextAlign.start,
- // ),
- ]),
- ),
- Container(
- width: width,
- padding: EdgeInsets.only(
- left: ScreenUtil()
- .setWidth(20),
- right:
- ScreenUtil()
- .setWidth(
- 15),
- top: ScreenUtil()
- .setWidth(10),
- bottom:
- ScreenUtil()
- .setWidth(
- 10)),
- decoration:
- BoxDecoration(
- border: Border(
- bottom: BorderSide(
- width: 5,
- color: ThemeUtils
- .getDialogTextFieldColor(
- context)),
- ),
- ),
- child: Text(
- detailObj
- .proficiency ??
- '',
- style: TextStyle(
- color: Color(
- 0xff999999),
- fontSize:
- ScreenUtil()
- .setSp(
- 14)),
- textAlign:
- TextAlign.start,
- ),
- ),
- Container(
- padding: EdgeInsets.only(
- left: ScreenUtil()
- .setWidth(20),
- right:
- ScreenUtil()
- .setWidth(
- 15),
- top: ScreenUtil()
- .setWidth(10),
- bottom:
- ScreenUtil()
- .setWidth(
- 10)),
- decoration:
- BoxDecoration(
- border: Border(
- bottom: BorderSide(
- width: 0.5,
- color: Colours
- .line),
- ),
- ),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment
- .start,
- children: <
- Widget>[
- Container(
- padding: EdgeInsets
- .only(
- right:
- 5),
- child:
- LoadAssetImage(
- // image: AssetImage(i['img']),
- "expert_one",
- width: ScreenUtil()
- .setWidth(
- 32),
- height: ScreenUtil()
- .setWidth(
- 32),
- // alignment: Alignment.centerLeft,
- ),
- ),
- Text(
- "用户评价",
- style: TextStyle(
- fontSize:
- ScreenUtil()
- .setSp(17)),
- textAlign:
- TextAlign
- .start,
- ),
- ]),
- ),
- ])
- : Container(child: null),
- Container(
- child: Container(
- padding: EdgeInsets.only(
- top: ScreenUtil()
- .setWidth(10),
- left: ScreenUtil()
- .setWidth(20),
- right: ScreenUtil()
- .setWidth(20),
- bottom: ScreenUtil()
- .setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(
- width: 0.5,
- color: Colours.line),
- ),
- ),
- child: Column(
- crossAxisAlignment:
- CrossAxisAlignment
- .start,
- children: <Widget>[
- Row(
- mainAxisAlignment:
- MainAxisAlignment
- .spaceBetween,
- children: <Widget>[
- Row(
- children: <
- Widget>[
- Text(
- provider.list[index].mobile !=
- null
- ? (provider.list[index].mobile).replaceRange(
- 3,
- 7,
- "****")
- : "",
- style: TextStyle(
- color: Color(
- 0xff666666),
- fontSize:
- ScreenUtil().setSp(16)),
- textAlign:
- TextAlign
- .start,
- ),
- Container(
- width: 6,
- child:
- null,
- ),
- // provider.list[index].comment!=""?
- // Text(
- // "采纳",
- // style: TextStyle(
- // color:Colors.red,
- // fontSize:ScreenUtil().setSp(14)
- // ),
- // textAlign:TextAlign.start,
- // )
- // :
- // Text(""),
- ]),
- Text(
- provider.list[index].createTime !=
- null
- ? DateUtils.instance.getFormartData(
- timeSamp: provider
- .list[
- index]
- .createTime,
- format:
- "yyyy-MM-dd")
- : '',
- style: TextStyle(
- color: Color(
- 0xff999999),
- fontSize: ScreenUtil()
- .setSp(
- 14)),
- textAlign:
- TextAlign
- .start,
- ),
- ]),
- Container(
- child: Text(
- provider.list[index]
- .comment ??
- '',
- style: TextStyle(
- color: Color(
- 0xff333333),
- fontSize:
- ScreenUtil()
- .setSp(
- 14)),
- textAlign:
- TextAlign.start,
- ),
- ),
- Container(
- height: ScreenUtil()
- .setWidth(10),
- decoration:
- BoxDecoration(
- color: Colors.red,
- ),
- child: Transform.rotate(
- origin: Offset(
- ScreenUtil()
- .setWidth(
- 25),
- ScreenUtil()
- .setWidth(
- 20)),
- angle:
- math.pi / 2,
- child: CustomPaint(
- painter: ChatBoxPainter(
- color: Color(
- 0xffF8F8F8),
- width: ScreenUtil().setWidth(
- 10),
- height:
- ScreenUtil().setWidth(20))))),
- Container(
- padding: EdgeInsets.only(
- top: ScreenUtil()
- .setWidth(10),
- bottom:
- ScreenUtil()
- .setWidth(
- 10),
- left: ScreenUtil()
- .setWidth(5),
- right:
- ScreenUtil()
- .setWidth(
- 5)),
- color:
- Color(0xffF8F8F8),
- child: Text(
- "问题描述:" +
- (provider
- .list[
- index]
- .expression !=
- null
- ? provider
- .list[
- index]
- .expression
- : ""),
- style: TextStyle(
- color: Color(
- 0xff999999),
- fontSize:
- ScreenUtil()
- .setSp(
- 14)),
- textAlign:
- TextAlign.start,
- ),
- ),
- ]),
- ))
- ],
- ),
- );
- },
- );
- }))
- : Container(
- child: null,
- ),
- Container(
- height: ScreenUtil().setWidth(80),
- ),
- ],
- ),
- Positioned(
- bottom: 0,
- left: 0,
- child: Container(
- width: width,
- padding: EdgeInsets.only(
- top: ScreenUtil().setWidth(15),
- bottom: ScreenUtil().setWidth(15),
- left: ScreenUtil().setWidth(25),
- right: ScreenUtil().setWidth(25)),
- color:
- ThemeUtils.getDialogTextFieldColor(context),
- child: Container(
- height: ScreenUtil().setWidth(44),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(
- ScreenUtil().setWidth(22)),
- // gradient: const LinearGradient(colors: [
- // Color(0xFF00D9FF),
- // Color(0xFF0287FF)
- // ]
- // ),
- color: Colours.blue_app_main),
- child: FlatButton(
- // padding: EdgeInsets.all(15.0),
- child: detailObj.serviceFee != null
- ? Text(
- "线上咨询(¥${detailObj.serviceFee}元/次)")
- : Text("线上咨询(¥0元/次)"),
- textColor: Colors.white,
- onPressed: () {
- UmengCommonSdk.onEvent(
- 'ym_wenzhen_onClickPay',
- {
- "formName": '专家:${detailObj.name}',
- },
- );
- setExpertName(detailObj.name ?? "");
- setExpertFee(detailObj.serviceFee ?? 0.0);
- NavigatorUtils.push(context,
- "${BbsRouter.buyService}?id=${widget.id}");
- },
- ),
- ),
- ))
- ],
- )
- : Center(
- child: Text("正在加载..."),
- ))),
- );
- }
- getLevel(level) {
- String img;
- if (level == 1) {
- img = "L1@2x";
- } else if (level == 2) {
- img = "L2@2x";
- } else if (level == 3) {
- img = "L3@2x";
- } else if (level == 4) {
- img = "L4@2x";
- } else if (level == 5) {
- img = "L5@2x";
- }
- return img;
- }
- Widget expertDetailWisget() {
- double width = MediaQuery.of(context).size.width;
- double height = MediaQuery.of(context).size.height;
- List<Widget> textWidgets = [Text('擅长品牌:')];
- detailObj.proficiencyBrandName.split(',').forEach((element) {
- if (element != '') {
- textWidgets.add(ClipText(title: element));
- }
- // textWidgets.add(ClipText(title: element));
- });
- return Column(
- children: <Widget>[
- Container(
- // height: ScreenUtil().setWidth(150),
- padding: EdgeInsets.only(bottom: 10),
- // decoration: BoxDecoration(
- // gradient: const LinearGradient(
- // colors: [Color(0xFF00D9FF), Color(0xFF0287FF)]),
- // ),
- child: Column(
- children: <Widget>[
- Container(
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Container(
- margin: EdgeInsets.only(
- left: ScreenUtil().setWidth(10),
- right: ScreenUtil().setWidth(10),
- top: ScreenUtil().setWidth(5)),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(
- ScreenUtil().setWidth(25)),
- ),
- child: Container(
- width: ScreenUtil().setWidth(50),
- height: ScreenUtil().setWidth(70),
- child: Stack(
- children: <Widget>[
- Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(3)),
- child: ClipRRect(
- borderRadius:
- BorderRadius.all(Radius.circular(50)),
- child: LoadNetworkImage(
- // image: AssetImage(i['img']),
- detailObj.avatarUrl,
- width: ScreenUtil().setWidth(44),
- height: ScreenUtil().setWidth(44),
- // alignment: Alignment.centerLeft,
- ),
- ),
- ),
- // Positioned(
- // top: ScreenUtil().setWidth(34),
- // left: 0,
- // child: LoadAssetImage(
- // // image: AssetImage(i['img']),
- // getLevel(detailObj.expertLevel),
- // width: ScreenUtil().setWidth(50),
- // height: ScreenUtil().setWidth(13),
- // // alignment: Alignment.centerLeft,
- // ),
- // )
- ],
- ),
- )),
- Expanded(
- child: Container(
- padding: EdgeInsets.only(
- right: ScreenUtil().setWidth(15)),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- children: <Widget>[
- Text(
- detailObj.name ?? "",
- style: TextStyle(
- color: Color(0xff333333),
- fontSize: ScreenUtil().setSp(18)),
- ),
- StarItemShow(
- starRating:
- detailObj.averageScore != null
- ? double.parse(detailObj
- .averageScore
- .toString())
- : 0.0,
- ),
- ],
- ),
- Container(
- alignment: Alignment.topLeft,
- child: Wrap(
- spacing: 2.0,
- runSpacing: 3.0,
- children: textWidgets),
- ),
- // detailObj.proficiencyBrandName.split(',');
- // Text(
- // "擅长品牌:" +
- // detailObj.proficiencyBrandName ??
- // '',
- // style: TextStyle(
- // color: Color(0xff666666),
- // fontSize: ScreenUtil().setSp(14)),
- // // textAlign:TextAlign.start,
- // ),
- detailObj.platformInvitedFlag == 0
- ? Container(
- padding: EdgeInsets.only(
- left: 5, right: 5),
- margin: EdgeInsets.only(
- right: 5, top: 5),
- // color:Colors.red,
- decoration: BoxDecoration(
- borderRadius:
- BorderRadius.circular(1.0),
- border: Border.all(
- width: 0.5,
- color: Color(0xffB0E2FF),
- ),
- ),
- child: Text(
- "特邀专家",
- style: TextStyle(
- color: Colours.blue_app_main,
- fontSize:
- ScreenUtil().setSp(12)),
- textAlign: TextAlign.center,
- ),
- )
- : Container(
- child: null,
- ),
- // Row(
- // children: <Widget>[
- // Expanded(
- // child: Container(
- // decoration: BoxDecoration(
- // color: Color(0x195887FF),
- // borderRadius:
- // new BorderRadius.circular(
- // (5.0))),
- // padding: EdgeInsets.all(5),
- // margin: EdgeInsets.only(
- // right: 5, top: 5),
- // // color:Colors.red,
- // // decoration: BoxDecoration(
- // // borderRadius: BorderRadius.circular(2.0),
- // // border: Border.all(
- // // width:0.5,
- // // color:Color(0xffB0E2FF),
- // // ),
- // // color:Colors.white30,
- // // ),
- // child: Row(
- // crossAxisAlignment:
- // CrossAxisAlignment.start,
- // children: <Widget>[
- // Icon(
- // const IconData(0xe64a,
- // fontFamily: "Iconfont"),
- // size: 17.0,
- // color: Color(0x195887FF),
- // ),
- // SizedBox(
- // width: 5,
- // ),
- // Expanded(
- // child: Container(
- // child: Text(
- // // "detailObj",
- // detailObj.address != null
- // ? detailObj.address
- // .split(",")[0]
- // : "",
- // style: TextStyle(
- // color: Colours
- // .blue_app_main,
- // fontSize: ScreenUtil()
- // .setSp(12)),
- // textAlign: TextAlign.left,
- // // overflow:TextOverflow.ellipsis,
- // ),
- // ))
- // ],
- // )),
- // )
- // ],
- // ),
- ],
- )))
- ]),
- ),
- Container(
- padding: EdgeInsets.only(top: ScreenUtil().setWidth(10)),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.spaceAround,
- children: <Widget>[
- Container(
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: <Widget>[
- Text(
- detailObj.workDate != null
- ? detailObj.workDate.toString()
- : "0",
- style: TextStyle(
- color: Color(0xff333333),
- fontSize: ScreenUtil().setSp(19),
- fontWeight: FontWeight.w500),
- textAlign: TextAlign.start,
- ),
- Text(
- " 从业年数",
- style: TextStyle(
- color: Color(0xff666666),
- fontSize: ScreenUtil().setSp(12),
- fontWeight: FontWeight.w400),
- textAlign: TextAlign.start,
- ),
- ])),
- Container(
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: <Widget>[
- Text(
- detailObj.serviceCounts != null
- ? detailObj.serviceCounts.toString()
- : "0",
- style: TextStyle(
- color: Color(0xff333333),
- fontSize: ScreenUtil().setSp(19),
- fontWeight: FontWeight.w500),
- textAlign: TextAlign.start,
- ),
- Text(
- " 服务次数",
- style: TextStyle(
- color: Color(0xff666666),
- fontSize: ScreenUtil().setSp(12),
- fontWeight: FontWeight.w400),
- textAlign: TextAlign.start,
- ),
- ])),
- // Container(
- // child:Column(
- // crossAxisAlignment: CrossAxisAlignment.center,
- // children:<Widget>[
- // Text(
- // "99.9",
- // style: TextStyle(
- // color:Colors.white,
- // fontSize:ScreenUtil().setSp(16)
- // ),
- // textAlign:TextAlign.start,
- // ),
- // Text(
- // "好评率(%)",
- // style: TextStyle(
- // color:Colors.white,
- // fontSize:ScreenUtil().setSp(14)
- // ),
- // textAlign:TextAlign.start,
- // ),
- // ]
- // )
- // ),
- Container(
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: <Widget>[
- Text(
- detailObj.adoptCounts != null
- ? detailObj.adoptCounts.toString()
- : "0",
- style: TextStyle(
- color: Color(0xff333333),
- fontSize: ScreenUtil().setSp(19),
- fontWeight: FontWeight.w500),
- textAlign: TextAlign.start,
- ),
- Text(
- " 采纳次数",
- style: TextStyle(
- color: Color(0xff666666),
- fontSize: ScreenUtil().setSp(12),
- fontWeight: FontWeight.w400),
- textAlign: TextAlign.start,
- ),
- ])),
- ])),
- ],
- )),
- ],
- );
- }
- @override
- void dispose() {
- super.dispose();
- }
- void setExpertName(String expertName) async {
- SharedPreferences prefs = await SharedPreferences.getInstance();
- prefs.setString("expertName", expertName);
- }
- void setExpertFee(double expertFee) async {
- SharedPreferences prefs = await SharedPreferences.getInstance();
- prefs.setDouble("expertFee", expertFee);
- }
- Future _onRefresh() async {
- _page = 1;
- await presenter.getExpertCommentList(_page, int.parse(widget.id),
- getLength: (length) {
- setState(() {
- listLength = length;
- });
- });
- }
- Future _loadMore() async {
- _page++;
- await presenter.getExpertCommentList(_page, int.parse(widget.id),
- getLength: (length) {});
- }
- @override
- ExpertCommentListPresenter createPresenter() {
- return ExpertCommentListPresenter();
- }
- }
- class ChatBoxPainter extends CustomPainter {
- ChatBoxPainter(
- {@required this.width, @required this.height, @required this.color});
- final double width;
- final double height;
- final Color color;
- @override
- void paint(Canvas canvas, Size size) {
- Path path = Path()
- ..moveTo(0, height / 2)
- ..lineTo(width, height)
- ..lineTo(width, 0)
- ..lineTo(0, height / 2);
- Paint paint = Paint()
- ..style = PaintingStyle.fill
- ..color = color;
- canvas.drawPath(path, paint);
- }
- @override
- bool shouldRepaint(ChatBoxPainter oldDelegate) => false;
- @override
- bool shouldRebuildSemantics(ChatBoxPainter oldDelegate) => false;
- }
|