|
@@ -378,33 +378,38 @@
|
|
|
}
|
|
|
canpay = false;
|
|
|
var param = {
|
|
|
- packId: (getNowSelect().level === 1 ? 'normal' : 'senior') + '_' +getNowSelect().total
|
|
|
- };
|
|
|
- param.id ={{.T._id}}
|
|
|
+ product: '数据流量包',
|
|
|
+ productId: pId,
|
|
|
+ data: {
|
|
|
+ packId: (getNowSelect().level === 1 ? 'normal' : 'senior') + '_' +getNowSelect().total,
|
|
|
+ id: {{.T._id}},
|
|
|
+ order_phone: OrderPhoneCheck.phone
|
|
|
+ }
|
|
|
+ }
|
|
|
// 优惠券
|
|
|
var couponParam = getCouponParams.getValue()
|
|
|
if (couponParam) {
|
|
|
- param.lotteryId = couponParam.lotteryId
|
|
|
- param.userLotteryId = couponParam.userLotteryId
|
|
|
+ param.data.lotteryId = couponParam.lotteryId
|
|
|
+ param.data.userLotteryId = couponParam.userLotteryId
|
|
|
}
|
|
|
-
|
|
|
- param.order_phone = OrderPhoneCheck.phone
|
|
|
-
|
|
|
+ // console.log(param)
|
|
|
$.ajax({
|
|
|
- url: "/subscribepay/dataExportPack/createOrder",
|
|
|
- data: param,
|
|
|
+ url: "/jypay/common/createorder",
|
|
|
+ dataType: "json",
|
|
|
+ contentType: "application/json;charset=utf-8",
|
|
|
+ data: JSON.stringify(param),
|
|
|
type: 'POST',
|
|
|
success: function (res) {
|
|
|
- if (res.error_msg === "") {
|
|
|
- history.replaceState({}, '', '/front/dataPack/packDetail?order_code=' + res.data.orderCode);
|
|
|
+ if (res.data && res.data.needPay) {
|
|
|
+ history.replaceState({}, '', '/front/dataPack/packDetail?order_code=' + res.data.order_code);
|
|
|
var nowSelect = getNowSelect()
|
|
|
var allTotal = Number(nowSelect.total) + Number(nowSelect.level === 1 ? nowSelect.normal_num : nowSelect.senior_num)
|
|
|
- window.location.href = "/front/datapackage/orderPay/" + res.data.orderCode + "?total=" + allTotal;
|
|
|
+ window.location.href = "/front/datapackage/orderPay/" + res.data.order_code + "?total=" + allTotal;
|
|
|
} else {
|
|
|
canpay = true;
|
|
|
$.confirm({
|
|
|
title: '提示',
|
|
|
- content: '生成订单出错,请稍后尝试!',
|
|
|
+ content: res.error_msg || '生成订单出错',
|
|
|
buttons: {
|
|
|
ok: {
|
|
|
text: '确认',
|