part of user_order_evaluate;


/// 订单评价
class UserOrderEvaluateController extends GetxController {
  OrderInfoModel orderInfoModel;
  String  orderNum;
  UserOrderEvaluateController(this.orderNum,this.orderInfoModel); // 已完成订单




  @override
  void onReady() {
    getOrderInfo();
    super.onReady();
  }

  /// 获取订单信息
  Future<void> getOrderInfo() async {
    orderInfoModel = await MineAPI.getOrderInfo(orderNum: orderNum);
    update();
  }

  /// 上传评价
  void UpOrderEvaluate(String evaluate) async {
    final result = await MineAPI.UpOrderEvaluate(evaluate: evaluate);
    if (result) {
      Toast.show('评价成功');
      update();
    }
  }


}
