|
- from common import curl_interface
- from django.conf import settings
- from urllib import parse
-
-
- def get_make_order_params(request):
- params = {
- 'days': request.POST.get('days', '1'), # 经历的天数
- 'pro_cate_id': request.POST.get('pro_cate_id', ''), # 去的产品品类ID
- 'start_date': request.POST.get('start_date', ''), # 出发日期
- 'start_time': request.POST.get('start_time', '00:00:00'), # 去程出发时间
- 'run_id': request.POST.get('run_id', ''), # 去除班次ID
- # 巴士才有的参数
- 'prod_arr': request.POST.get('prod_arr', ''), # 去的产品列表
- 'contacts_name': request.POST.get('contacts_name', ''), # 联系人名称
- 'contacts_phone': request.POST.get('contacts_phone', ''), # 联系人手机
- 'contacts_ID': request.POST.get('contacts_ID', ''), # 联系人身份证
- 'is_buy_insurance': request.POST.get('is_buy_insurance', '0'), # 是否购买保险,0:不购买,1:购买
- 'insurance_list': request.POST.get('insurance_list', '[]'), # 保险受保人数组
- 'insurance_price': request.POST.get('insurance_price', 2), # 保险价格
- 'passanger_arr': request.POST.get('passanger_arr', '[]'), # 出行人数组
- 'system': request.POST.get('system', 2), # 系统ID
- }
- return params
-
-
- def make_order(params):
- """
- 调用下单接口
- :param params:
- :return:
- """
- curl = curl_interface.CurlInterface(params, 4)
- result = curl.exec(settings.WX_HOST + '/zzcx/order/order/make-order', 'POST')
- if result['flag'] is True:
- result['data']['pay_url'] = settings.FX_HOST + '/fx/?r=weChat/we-chat/q-code&qCode=' + parse.quote_plus(
- result['data']['pay_url'])
- return result
-
-
- def check_order(order_id):
- """
- 校验订单状态
- :param order_id:
- :return:
- """
- params = {
- 'order_id': order_id,
- 'money': 1
- }
- curl = curl_interface.CurlInterface(params, 4)
- result = curl.exec(settings.WX_HOST + '/zzcx/order/order/check-order-status', 'POST')
- return result
|