自动关闭虎牙支付成功弹窗
This commit is contained in:
@@ -588,6 +588,42 @@ class HuyaHttpClient:
|
||||
return self.call_rpc("shopMiddleUI", "getGoodsInfoV5", req,
|
||||
GoodsInfoRsp, uid, guid, cookie)
|
||||
|
||||
def query_user_order_list(self, uid, guid, cookie, offset=0, page_size=10,
|
||||
order_type=1, status=0, timeout=15.0):
|
||||
"""查询用户订单列表,用于支付二维码后的付款状态轮询。"""
|
||||
from .shop_structs import QueryUserOrderListReq, QueryUserOrderListRsp
|
||||
|
||||
req = QueryUserOrderListReq()
|
||||
req.userId = self._build_user(uid, guid, cookie)
|
||||
req.offset = int(offset or 0)
|
||||
req.orderType = int(order_type or 1)
|
||||
req.pageSize = int(page_size or 10)
|
||||
req.status = int(status or 0)
|
||||
|
||||
result = self.call_rpc(
|
||||
"shopMiddleUI",
|
||||
"queryUserOrderList",
|
||||
req,
|
||||
QueryUserOrderListRsp,
|
||||
uid,
|
||||
guid,
|
||||
cookie,
|
||||
timeout=timeout,
|
||||
)
|
||||
if result is not None and getattr(result, "orders", None):
|
||||
return result
|
||||
fallback = self.call_rpc(
|
||||
"revenueWebUI",
|
||||
"queryUserOrderList",
|
||||
req,
|
||||
QueryUserOrderListRsp,
|
||||
uid,
|
||||
guid,
|
||||
cookie,
|
||||
timeout=timeout,
|
||||
)
|
||||
return fallback if fallback is not None else result
|
||||
|
||||
def create_order(self, uid, guid, cookie, pid, spu_id, sku_id,
|
||||
item_count=1, source_id="yellowcarlist", game_id="", scene=7,
|
||||
order_type=None):
|
||||
|
||||
@@ -469,6 +469,11 @@ class OrderListShopInfo(TafStruct):
|
||||
def write_to(self, os: TafOutputStream):
|
||||
pass
|
||||
|
||||
def to_dict(self) -> dict:
|
||||
return {
|
||||
"shop_name": self.shopName,
|
||||
}
|
||||
|
||||
|
||||
class OrderListGoodsDetail(TafStruct):
|
||||
"""订单明细(queryUserOrderList 响应 tag16)"""
|
||||
@@ -494,6 +499,17 @@ class OrderListGoodsDetail(TafStruct):
|
||||
def write_to(self, os: TafOutputStream):
|
||||
pass
|
||||
|
||||
def to_dict(self) -> dict:
|
||||
return {
|
||||
"spu_id": self.spuId,
|
||||
"sku_id": self.skuId,
|
||||
"buyer_uid": self.buyerUid,
|
||||
"virtual_type": self.virtualType,
|
||||
"quantity": self.quantity,
|
||||
"shop_info": self.shopInfo.to_dict() if self.shopInfo else None,
|
||||
"points": self.points,
|
||||
}
|
||||
|
||||
|
||||
class OrderListItem(TafStruct):
|
||||
"""订单列表项(queryUserOrderList 响应 tag3 的 list 元素)"""
|
||||
@@ -531,6 +547,23 @@ class OrderListItem(TafStruct):
|
||||
def write_to(self, os: TafOutputStream):
|
||||
pass
|
||||
|
||||
def to_dict(self) -> dict:
|
||||
return {
|
||||
"biz_order_id": self.bizOrderId,
|
||||
"app_id": self.appId,
|
||||
"order_id": self.orderId,
|
||||
"pid": self.pid,
|
||||
"shop_name": self.shopName,
|
||||
"order_status": self.orderStatus,
|
||||
"item_name": self.itemName,
|
||||
"unit_price": self.unitPrice,
|
||||
"quantity": self.quantity,
|
||||
"total_price": self.totalPrice,
|
||||
"create_time": self.createTime,
|
||||
"pay_time": self.payTime,
|
||||
"goods_detail": self.goodsDetail.to_dict() if self.goodsDetail else None,
|
||||
}
|
||||
|
||||
|
||||
class QueryUserOrderListReq(TafStruct):
|
||||
"""查询购买历史订单 (revenueWebUI.queryUserOrderList)"""
|
||||
@@ -578,6 +611,14 @@ class QueryUserOrderListRsp(TafStruct):
|
||||
def write_to(self, os: TafOutputStream):
|
||||
pass
|
||||
|
||||
def to_dict(self) -> dict:
|
||||
return {
|
||||
"code": self.code,
|
||||
"message": self.message,
|
||||
"total_count": self.totalCount,
|
||||
"orders": [item.to_dict() for item in self.orders],
|
||||
}
|
||||
|
||||
|
||||
# ============================================================
|
||||
# 下单
|
||||
|
||||
Reference in New Issue
Block a user