You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1040 lines
31 KiB
1040 lines
31 KiB
<template>
|
|
<div class="index wrapper_1200">
|
|
<div class="crumbs">
|
|
<el-breadcrumb separator="/">
|
|
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
|
<el-breadcrumb-item>购物车</el-breadcrumb-item>
|
|
</el-breadcrumb>
|
|
</div>
|
|
|
|
<div class="submit_order_Box">
|
|
<div class="select_address">
|
|
<el-radio-group v-model="defaultAddress">
|
|
<el-radio
|
|
class="select_address_list"
|
|
:label="item.id"
|
|
v-for="(item, index) in addressList"
|
|
:key="index"
|
|
>
|
|
<div class="select_address_txt">
|
|
<div style="color: #222">
|
|
<span>{{ item.name }}</span>
|
|
<span>{{ item.mobile }}</span>
|
|
</div>
|
|
<div style="color: #999">{{ item.full_address }}{{ item.address }}</div>
|
|
</div>
|
|
</el-radio>
|
|
</el-radio-group>
|
|
|
|
<div>
|
|
<el-button size="samll" @click="showAllAddressList" type="text"
|
|
>显示全部地址</el-button
|
|
>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="submit_order_table">
|
|
<div class="table_title">待确认订单信息</div>
|
|
|
|
<!-- 套餐 -->
|
|
<el-table
|
|
:data="tableData"
|
|
border
|
|
style="width: 100%"
|
|
ref="multipleTable"
|
|
:header-cell-style="{ background: '#fafafa' }"
|
|
v-if="isSetMeal"
|
|
>
|
|
<el-table-column prop="bl_name" label="套餐名称" width="300" align="center">
|
|
</el-table-column>
|
|
<el-table-column prop="commodityNum" label="数量" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.num }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="amount1" label="套餐价" align="center">
|
|
<template slot-scope="scope">
|
|
<span>¥{{ scope.row.bl_price }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="amount2" label="小计" align="center">
|
|
<template slot-scope="scope">
|
|
<span
|
|
>¥{{ Math.round(scope.row.num * scope.row.bl_price * 100) / 100 }}</span
|
|
>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
|
|
<!-- 秒杀 -->
|
|
<el-table
|
|
:data="tableData"
|
|
border
|
|
style="width: 100%"
|
|
ref="multipleTable"
|
|
:header-cell-style="{ background: '#fafafa' }"
|
|
v-else-if="isSeckill"
|
|
>
|
|
<el-table-column prop="sku_name" label="商品" width="300" align="center">
|
|
<template slot-scope="scope">
|
|
<div class="commodityBox">
|
|
<img :src="imgUrl + scope.row.sku_image" alt />
|
|
<div class="commoditytxt">
|
|
<p class="p1">{{ scope.row.sku_name }}</p>
|
|
<p class="p2">
|
|
<span class="commodityTagBg">秒杀</span>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="num" label="数量" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.num }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="seckill_price" label="秒杀价" align="center">
|
|
<template slot-scope="scope">
|
|
<span>¥{{ scope.row.seckill_price }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="amount2" label="小计" align="center">
|
|
<template slot-scope="scope">
|
|
<span
|
|
>¥{{
|
|
Math.round(scope.row.num * scope.row.seckill_price * 100) / 100
|
|
}}</span
|
|
>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
|
|
<!-- 拼团 -->
|
|
<el-table
|
|
:data="tableData"
|
|
border
|
|
style="width: 100%"
|
|
ref="multipleTable"
|
|
:header-cell-style="{ background: '#fafafa' }"
|
|
v-else-if="isCollage"
|
|
>
|
|
<el-table-column prop="pintuan_name" label="商品" width="300" align="center">
|
|
<template slot-scope="scope">
|
|
<div class="commodityBox">
|
|
<img :src="imgUrl + scope.row.sku_image" alt />
|
|
<div class="commoditytxt">
|
|
<p class="p1">{{ scope.row.pintuan_name }}</p>
|
|
<p class="p2">
|
|
<span class="commodityTagBg">拼团</span>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="num" label="数量" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.num }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="pintuan_price" label="拼团价" align="center">
|
|
<template slot-scope="scope">
|
|
<span>¥{{ scope.row.pintuan_price }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="amount2" label="小计" align="center">
|
|
<template slot-scope="scope">
|
|
<span
|
|
>¥{{
|
|
Math.round(scope.row.num * scope.row.pintuan_price * 100) / 100
|
|
}}</span
|
|
>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
|
|
<div class="select_coupon">
|
|
<el-form
|
|
ref="paymentForm"
|
|
label-position="left"
|
|
:model="paymentForm"
|
|
label-width="150px"
|
|
>
|
|
<el-form-item label="是否使用预存款支付">
|
|
<el-switch v-model="paymentForm.is_balance"></el-switch>
|
|
</el-form-item>
|
|
<el-form-item label="是否需要开发票">
|
|
<el-switch v-model="paymentForm.is_invoice"></el-switch>
|
|
</el-form-item>
|
|
<el-form-item label="给卖家留言" style="width: 50%">
|
|
<el-input type="textarea" v-model="paymentForm.buyer_message"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
|
|
<div class="couponCardList">
|
|
<div class="couponCardList_bottom">
|
|
<div class="couponCardList_bottom_Box" v-if="Pre_price">
|
|
<div class="couponCardList_bottom_r">配送方式</div>
|
|
<div class="couponCardList_bottom_l">快递</div>
|
|
</div>
|
|
|
|
<div class="couponCardList_bottom_Box" v-if="Fare_Price">
|
|
<div class="couponCardList_bottom_r">运费</div>
|
|
<div class="couponCardList_bottom_l">¥{{ Fare_Price }}</div>
|
|
</div>
|
|
<div class="couponCardList_bottom_Box" v-if="Paid_in">
|
|
<div class="couponCardList_bottom_r">需付款</div>
|
|
<div class="couponCardList_bottom_l" style="color: #ff2020">
|
|
¥{{ Paid_in }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="couponCardList_bottom_btn">
|
|
<el-button type="primary" size="small" @click="paymentType(paymentForm)"
|
|
>提交订单</el-button
|
|
>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 提交订单 -->
|
|
<el-dialog
|
|
title="选择支付方式"
|
|
:visible.sync="paymentDialog"
|
|
width="30%"
|
|
:show-close="false"
|
|
:close-on-click-modal="false"
|
|
:close-on-press-escape="false"
|
|
>
|
|
<div>
|
|
<el-radio-group
|
|
v-model="paymentDialogType"
|
|
class="paymentDialogRadio"
|
|
@change="paidChange"
|
|
>
|
|
<!-- <el-radio :label="false">待支付金额:¥{{ Paid_in }}</el-radio> -->
|
|
<el-radio :label="true"
|
|
>预存款支付(当前余额{{ userInfo.balance }},本次抵扣{{ Paid_in }})</el-radio
|
|
>
|
|
</el-radio-group>
|
|
|
|
<el-form
|
|
ref="form"
|
|
:model="paymentForm"
|
|
label-width="120px"
|
|
label-position="left"
|
|
>
|
|
<el-form-item label="还需支付">
|
|
<el-input v-model="needPaid_in" size="small" disabled></el-input>
|
|
</el-form-item>
|
|
<!-- <el-form-item label="余额支付密码" v-if="paymentForm.is_balance">
|
|
<el-input v-model="paymentForm.pay_password" size="small"></el-input>
|
|
</el-form-item> -->
|
|
|
|
<!-- <el-form-item label="请选择支付方式" v-if="!paymentForm.is_balance">
|
|
<el-radio-group
|
|
v-model="paymentForm.payment_type"
|
|
class="paymentTypeRadioList"
|
|
>
|
|
<el-radio
|
|
v-for="(payItem, payIndex) in payTypeList"
|
|
:label="payItem.payType"
|
|
:key="payIndex"
|
|
>
|
|
<div class="paymentTypeRadio">
|
|
<img style="width: 20px; height: 20px" :src="payItem.payImg" alt />
|
|
<div class="paymentTypeRadio_txt">
|
|
<div style="color: #222">
|
|
<b>{{ payItem.payName }}</b>
|
|
</div>
|
|
<div style="color: #999; font-size: 12px">
|
|
{{ payItem.payRemarks }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item> -->
|
|
</el-form>
|
|
</div>
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button size="small" @click="orderCancel()">取 消</el-button>
|
|
<el-button size="small" type="primary" @click="submitPay(paymentForm)"
|
|
>确定支付</el-button
|
|
>
|
|
</span>
|
|
</el-dialog>
|
|
|
|
<!-- 扫码支付 -->
|
|
<el-dialog
|
|
:title="scanningObj.Title"
|
|
:visible.sync="scanningCodeDialog"
|
|
width="30%"
|
|
:show-close="false"
|
|
:close-on-click-modal="false"
|
|
:close-on-press-escape="false"
|
|
>
|
|
<div
|
|
style="width: 186px; height: 186px; border: 1px solid #eee; margin: auto"
|
|
@click="paySuccess()"
|
|
>
|
|
<img src alt />
|
|
</div>
|
|
<p style="text-align: center; line-height: 40px; height: 40px">
|
|
{{ scanningObj.Remarks }}
|
|
</p>
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button size="small" @click="payback()">返回</el-button>
|
|
</span>
|
|
</el-dialog>
|
|
|
|
<!-- 扫码支付 -->
|
|
<el-dialog
|
|
:visible.sync="paySuccessDialog"
|
|
width="30%"
|
|
:show-close="false"
|
|
:close-on-click-modal="false"
|
|
:close-on-press-escape="false"
|
|
>
|
|
<div style="width: 111px; height: 111px; margin: auto">
|
|
<img src="~assets/images/paySuccess.png" alt />
|
|
</div>
|
|
<p style="text-align: center; line-height: 40px; height: 40px">
|
|
<b>支付成功</b>
|
|
</p>
|
|
<span slot="footer" class="dialog-footer">
|
|
<nuxt-link to="/">
|
|
<el-button size="small">返回首页</el-button>
|
|
</nuxt-link>
|
|
<el-button size="small" type="primary">查看订单</el-button>
|
|
</span>
|
|
</el-dialog>
|
|
|
|
<!-- 全部地址 -->
|
|
<el-dialog
|
|
width="25%"
|
|
title="全部地址"
|
|
:visible.sync="addressDialog"
|
|
:show-close="false"
|
|
:close-on-click-modal="false"
|
|
:close-on-press-escape="false"
|
|
class="addressDialog"
|
|
>
|
|
<el-radio-group v-model="defaultAddress">
|
|
<el-radio
|
|
class="select_address_list"
|
|
:label="item.id"
|
|
v-for="(item, index) in allAddressList"
|
|
:key="index"
|
|
>
|
|
<div class="select_address_txt">
|
|
<div style="color: #222">
|
|
<span>{{ item.name }}</span>
|
|
<span>{{ item.mobile }}</span>
|
|
</div>
|
|
<div style="color: #999">{{ item.full_address }}{{ item.address }}</div>
|
|
</div>
|
|
</el-radio>
|
|
</el-radio-group>
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button size="small" @click="changeAddress" type="primary">确认选择</el-button>
|
|
</span>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Setting from "~/setting";
|
|
import wxpay from "../../assets/images/wxpay.png";
|
|
import AlipayTag from "../../assets/images/AlipayTag.png";
|
|
export default {
|
|
auth: false,
|
|
data() {
|
|
return {
|
|
// 为true时判断来自那个活动模块
|
|
isSeckill: JSON.parse(this.$route.query.isSeckill),
|
|
isCollage: JSON.parse(this.$route.query.isCollage),
|
|
isSetMeal: JSON.parse(this.$route.query.isSetMeal),
|
|
detailData: {},
|
|
seckillData: {},
|
|
collageData: {},
|
|
// 获取账号基本信息
|
|
userInfo: JSON.parse(localStorage.getItem("userInfo")),
|
|
imgUrl: Setting.uplodBaseURL,
|
|
defaultAddress: false,
|
|
paymentDialogType: false,
|
|
|
|
addressList: [],
|
|
allAddressList: [],
|
|
addressDialog: false,
|
|
tableData: [],
|
|
|
|
paymentDialog: false,
|
|
setMealForm: {},
|
|
|
|
paymentForm: {
|
|
payment_money: "",
|
|
payment_type: "",
|
|
is_balance: false,
|
|
is_invoice: false,
|
|
buyer_message: "",
|
|
},
|
|
payTypeList: [
|
|
{
|
|
payType: 1,
|
|
payName: "微信",
|
|
payImg: wxpay,
|
|
payRemarks: "使用微信扫描二维码即可付款",
|
|
},
|
|
{
|
|
payType: 2,
|
|
payName: "支付宝",
|
|
payImg: AlipayTag,
|
|
payRemarks: "使用支付宝扫描二维码即可付款",
|
|
},
|
|
],
|
|
|
|
// 扫码
|
|
scanningCodeDialog: false,
|
|
scanningObj: {
|
|
Title: "",
|
|
Img: "",
|
|
Remarks: "",
|
|
},
|
|
// 扫码成功
|
|
paySuccessDialog: false,
|
|
// 优惠折扣
|
|
// is_ShowCoupon: false,
|
|
// availableNum: 0,
|
|
// isCoupon: false,
|
|
amount: "",
|
|
Paid_in: "",
|
|
needPaid_in: "", //仍需支付
|
|
Pre_price: "", //优惠价格
|
|
Fare_Price: "", //运费
|
|
Tobepaid: "",
|
|
|
|
cart_ids: {},
|
|
sku_id: [],
|
|
coupon: {
|
|
coupon_id: "",
|
|
},
|
|
radio2: "",
|
|
};
|
|
},
|
|
watch: {
|
|
"paymentForm.is_balance": {
|
|
handler(oldValue, newVal) {
|
|
// console.log(oldValue, newVal);
|
|
if (newVal == undefined || oldValue == false) {
|
|
this.paymentDialogType = false;
|
|
this.needPaid_in = this.Paid_in;
|
|
} else {
|
|
this.paymentDialogType = true;
|
|
if (this.Paid_in < this.userInfo.balance) {
|
|
this.needPaid_in = 0;
|
|
} else {
|
|
this.needPaid_in = "余额不足";
|
|
}
|
|
}
|
|
},
|
|
deep: true, // 深度监听
|
|
immediate: true, // 第一次改变就执行
|
|
},
|
|
data: "paidChange",
|
|
},
|
|
|
|
created() {
|
|
this.tableData = [];
|
|
this.cart_ids = [];
|
|
this.sku_id = [];
|
|
this.getData();
|
|
this.getAddressList({ isALL: false });
|
|
},
|
|
methods: {
|
|
// 获取活动商品详情
|
|
getData() {
|
|
// 套餐
|
|
if (this.isSetMeal) {
|
|
console.log(`isSetMeal`);
|
|
let obj = {
|
|
bl_id: JSON.parse(this.$route.query.id),
|
|
couponURL: true,
|
|
};
|
|
this.$axios
|
|
.post(`bundling/api/bundling/detail`, obj)
|
|
.then((res) => {
|
|
res.data.num = JSON.parse(this.$route.query.num);
|
|
this.tableData.push(res.data);
|
|
this.setMealForm = res.data;
|
|
this.sumAmout(); //计算商品合计
|
|
})
|
|
.catch((err) => {
|
|
this.$message.error(err);
|
|
});
|
|
}
|
|
//秒杀
|
|
else {
|
|
let obj = {
|
|
goods_id: this.$route.query.id,
|
|
province_name: "成都",
|
|
};
|
|
|
|
console.log(`isSeckill`);
|
|
this.$axios
|
|
.post(`/goodssku/detail`, obj)
|
|
.then((res) => {
|
|
this.detailData = res.data.goods_sku_detail;
|
|
// goods_type 1普通商品 2秒杀 3拼团
|
|
this.goods_type = res.data.goods_type;
|
|
if (res.data.goods_type == 2) {
|
|
res.data.seckill_info.num = JSON.parse(this.$route.query.num);
|
|
this.tableData.push(res.data.seckill_info);
|
|
this.seckillData = res.data.seckill_info;
|
|
} else if (res.data.goods_type == 3) {
|
|
res.data.pintuan_info.num = JSON.parse(this.$route.query.num);
|
|
res.data.pintuan_info.sku_image = res.data.goods_sku_detail.sku_image;
|
|
this.tableData.push(res.data.pintuan_info);
|
|
this.collageData = res.data.pintuan_info;
|
|
}
|
|
this.sumAmout(); //计算商品合计
|
|
console.log(res.data, `res`);
|
|
console.log(this.detailData, `detailData`);
|
|
console.log(this.seckillData, `seckillData`);
|
|
console.log(this.tableData, `tableData`);
|
|
})
|
|
.catch((err) => {
|
|
this.$message.error(err);
|
|
});
|
|
}
|
|
},
|
|
|
|
// 获取默认地址
|
|
getAddressList(OBJ) {
|
|
let obj = {
|
|
member_id: this.userInfo.member_id,
|
|
};
|
|
this.$axios
|
|
.post(`/memberaddress/page`, obj)
|
|
.then((res) => {
|
|
if (!OBJ.isALL) {
|
|
this.addressList = [];
|
|
res.data.list.forEach((item) => {
|
|
if (item.is_default) {
|
|
this.addressList.push(item);
|
|
}
|
|
});
|
|
} else {
|
|
this.allAddressList = [];
|
|
this.allAddressList = res.data.list;
|
|
}
|
|
})
|
|
.catch((err) => {
|
|
this.$message.error(err);
|
|
});
|
|
},
|
|
//
|
|
showAllAddressList() {
|
|
this.addressDialog = true;
|
|
this.getAddressList({ isALL: true });
|
|
},
|
|
changeAddress() {
|
|
this.$axios
|
|
.post("/memberaddress/setdefault", {
|
|
id: this.defaultAddress,
|
|
})
|
|
.then((res) => {
|
|
this.$message.success(res.message);
|
|
this.getAddressList({ isALL: false });
|
|
this.addressDialog = false;
|
|
});
|
|
},
|
|
|
|
// 是否直接支付还是余额抵扣
|
|
paidChange(val) {
|
|
// val true余额抵扣 false 直接支付
|
|
console.log(val);
|
|
if (!val) {
|
|
this.needPaid_in = this.Paid_in;
|
|
this.paymentForm.is_balance = false;
|
|
} else if (val) {
|
|
let num = Number(this.userInfo.balance) - Number(this.Paid_in);
|
|
this.paymentForm.is_balance = true;
|
|
if (num < Number(this.userInfo.balance)) {
|
|
this.needPaid_in = 0;
|
|
} else if (num > Number(this.userInfo.balance)) {
|
|
this.needPaid_in = num - Number(this.userInfo.balance);
|
|
}
|
|
}
|
|
},
|
|
sumAmout() {
|
|
let arr = [];
|
|
// isSeckill
|
|
// isCollage
|
|
// isSetMeal
|
|
// 套餐
|
|
if (this.isSetMeal) {
|
|
arr = this.tableData.map((item) => {
|
|
return Math.round(item.num * item.bl_price * 100) / 100;
|
|
});
|
|
}
|
|
// 秒杀
|
|
else if (this.isSeckill) {
|
|
arr = this.tableData.map((item) => {
|
|
return Math.round(item.num * item.seckill_price * 100) / 100;
|
|
});
|
|
}
|
|
// 拼团
|
|
else if (this.isCollage) {
|
|
arr = this.tableData.map((item) => {
|
|
return Math.round(item.num * item.pintuan_price * 100) / 100;
|
|
});
|
|
}
|
|
|
|
this.amount = this.sum(arr);
|
|
console.log(this.amount);
|
|
if (!this.isCoupon) {
|
|
this.Paid_in = this.amount;
|
|
}
|
|
},
|
|
// 商品合计
|
|
sum(args) {
|
|
// var args = arguments,//获取所有的参数
|
|
var d = 0, //定义小数位的初始长度,默认为整数,即小数位为0
|
|
sum = 0; //定义sum来接收所有数据的和
|
|
//循环所有的参数
|
|
for (var key in args) {
|
|
//遍历所有的参数
|
|
//把数字转为字符串
|
|
var str = "" + args[key];
|
|
if (str.indexOf(".") != -1) {
|
|
//判断数字是否为小数
|
|
//获取小数位的长度
|
|
var temp = str.split(".")[1].length;
|
|
//比较此数的小数位与原小数位的长度,取小数位较长的存储到d中
|
|
d = d < temp ? temp : d;
|
|
}
|
|
}
|
|
//计算需要乘的数值
|
|
var m = Math.pow(10, d);
|
|
//遍历所有参数并相加
|
|
for (var key in args) {
|
|
sum += args[key] * m;
|
|
}
|
|
//返回结果
|
|
return sum / m;
|
|
},
|
|
|
|
// 提交订单按钮 创建订单
|
|
paymentType(row) {
|
|
this.paymentDialog = true;
|
|
console.log(row);
|
|
},
|
|
// 提交订单弹出框取消按钮
|
|
orderCancel() {
|
|
this.paymentDialog = false;
|
|
// this.$router.push("/order");
|
|
},
|
|
// 支付方式确认支付按钮
|
|
submitPay(row) {
|
|
// isSeckill
|
|
// isCollage
|
|
// isSetMeal
|
|
// 套餐
|
|
if (this.isSetMeal) {
|
|
let { bl_id, num } = { ...this.setMealForm };
|
|
let { is_balance, is_invoice, buyer_message } = { ...row };
|
|
let obj = {
|
|
couponURL: true,
|
|
bl_id,
|
|
num,
|
|
is_balance,
|
|
is_invoice,
|
|
buyer_message,
|
|
};
|
|
// 不使用余额支付才会弹出扫码支付
|
|
if (!this.paymentForm.is_balance) {
|
|
// this.scanningCodeDialog = true;
|
|
// if (row.payment_type == 1) {
|
|
// this.scanningObj = {
|
|
// Title: "微信扫码付款",
|
|
// Remarks: "请使用微信“扫一扫”扫描二维码支付",
|
|
// };
|
|
// } else {
|
|
// this.scanningObj = {
|
|
// Title: "支付宝扫码付款",
|
|
// Remarks: "请使用支付宝“扫一扫”扫描二维码支付",
|
|
// };
|
|
// }
|
|
}
|
|
// 使用余额支付
|
|
else if (this.paymentForm.is_balance) {
|
|
this.$axios
|
|
.post(`bundling/api/ordercreate/create`, obj)
|
|
.then((res) => {
|
|
console.log(res);
|
|
this.$router.push("/order"); //支付成功跳转订单列表页面
|
|
})
|
|
.catch((err) => {
|
|
this.$message.error(err);
|
|
});
|
|
}
|
|
}
|
|
// 秒杀
|
|
else if (this.isSeckill) {
|
|
let { sku_id, num } = { ...this.seckillData };
|
|
let { is_balance, is_invoice, buyer_message } = { ...row };
|
|
let obj = {
|
|
sku_id,
|
|
num,
|
|
is_balance,
|
|
is_invoice,
|
|
buyer_message,
|
|
};
|
|
if (!this.paymentForm.is_balance) {
|
|
// this.scanningCodeDialog = true;
|
|
// if (row.payment_type == 1) {
|
|
// this.scanningObj = {
|
|
// Title: "微信扫码付款",
|
|
// Remarks: "请使用微信“扫一扫”扫描二维码支付",
|
|
// };
|
|
// } else {
|
|
// this.scanningObj = {
|
|
// Title: "支付宝扫码付款",
|
|
// Remarks: "请使用支付宝“扫一扫”扫描二维码支付",
|
|
// };
|
|
// }
|
|
}
|
|
// 使用余额支付
|
|
else if (this.paymentForm.is_balance) {
|
|
this.$axios
|
|
.post(`/ordercreate/create`, obj)
|
|
.then((res) => {
|
|
console.log(res);
|
|
this.$router.push("/order"); //支付成功跳转订单列表页面
|
|
})
|
|
.catch((err) => {
|
|
this.$message.error(err);
|
|
});
|
|
}
|
|
}
|
|
// 拼团
|
|
else if (this.isCollage) {
|
|
let { sku_id } = { ...this.detailData };
|
|
let { num } = { ...this.collageData };
|
|
let { is_balance, is_invoice, buyer_message } = { ...row };
|
|
let obj = {
|
|
sku_id,
|
|
num,
|
|
is_balance,
|
|
is_invoice,
|
|
buyer_message,
|
|
};
|
|
if (!this.paymentForm.is_balance) {
|
|
// this.scanningCodeDialog = true;
|
|
// if (row.payment_type == 1) {
|
|
// this.scanningObj = {
|
|
// Title: "微信扫码付款",
|
|
// Remarks: "请使用微信“扫一扫”扫描二维码支付",
|
|
// };
|
|
// } else {
|
|
// this.scanningObj = {
|
|
// Title: "支付宝扫码付款",
|
|
// Remarks: "请使用支付宝“扫一扫”扫描二维码支付",
|
|
// };
|
|
// }
|
|
}
|
|
// 使用余额支付
|
|
else if (this.paymentForm.is_balance) {
|
|
this.$axios
|
|
.post(`/ordercreate/create`, obj)
|
|
.then((res) => {
|
|
console.log(res);
|
|
this.$router.push("/order"); //支付成功跳转订单列表页面
|
|
})
|
|
.catch((err) => {
|
|
this.$message.error(err);
|
|
});
|
|
}
|
|
}
|
|
|
|
console.log(row);
|
|
this.paymentDialog = false;
|
|
},
|
|
// 扫码返回按钮
|
|
payback() {
|
|
this.paymentDialog = true;
|
|
this.scanningCodeDialog = false;
|
|
},
|
|
|
|
// 扫码成功
|
|
paySuccess() {
|
|
this.paySuccessDialog = true;
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.index {
|
|
.crumbs {
|
|
margin: 20px 0;
|
|
}
|
|
.submit_order_Box {
|
|
width: 1200px;
|
|
min-height: 520px;
|
|
background: #ffffff;
|
|
border-radius: 4px;
|
|
margin-bottom: 20px;
|
|
.select_address {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 30px;
|
|
/deep/.el-radio-group {
|
|
display: flex;
|
|
.select_address_list {
|
|
width: 280px;
|
|
height: 60px;
|
|
line-height: 60px;
|
|
margin-right: 50px;
|
|
display: flex;
|
|
.el-radio__input {
|
|
.el-radio__inner {
|
|
margin-top: 23px;
|
|
}
|
|
}
|
|
.select_address_txt {
|
|
width: 320px;
|
|
div {
|
|
line-height: 30px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.submit_order_table {
|
|
padding: 0 30px;
|
|
.table_title {
|
|
width: 150px;
|
|
height: 25px;
|
|
font-size: 18px;
|
|
font-family: PingFangSC-Medium, PingFang SC;
|
|
font-weight: 600;
|
|
color: #222222;
|
|
line-height: 25px;
|
|
margin: 20px 0;
|
|
}
|
|
.commodityBox {
|
|
display: flex;
|
|
img {
|
|
width: 60px;
|
|
height: 60px;
|
|
}
|
|
.commoditytxt {
|
|
p {
|
|
line-height: 30px;
|
|
text-align: left;
|
|
margin-left: 10px;
|
|
}
|
|
|
|
.p1 {
|
|
font-weight: 600;
|
|
}
|
|
.p2 {
|
|
font-size: 12px;
|
|
|
|
span {
|
|
background: #ff7d02;
|
|
border-radius: 2px;
|
|
width: 36px;
|
|
padding: 3px 4px;
|
|
color: #ffffff;
|
|
}
|
|
.commodityTagBg {
|
|
background: #ff1449;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.select_coupon {
|
|
padding: 0 30px;
|
|
.el-form {
|
|
margin-top: 20px;
|
|
.el-form-item {
|
|
margin-bottom: 0px;
|
|
}
|
|
}
|
|
|
|
.coupon_title {
|
|
width: 150px;
|
|
height: 25px;
|
|
font-size: 18px;
|
|
font-family: PingFangSC-Medium, PingFang SC;
|
|
font-weight: 600;
|
|
color: #222222;
|
|
line-height: 25px;
|
|
margin-top: 20px;
|
|
}
|
|
.couponCardList {
|
|
padding-bottom: 20px;
|
|
.couponCard {
|
|
display: flex;
|
|
/deep/.el-radio-group {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
.select_coupon_list {
|
|
width: 380px;
|
|
margin-right: 50px;
|
|
margin-top: 20px;
|
|
display: flex;
|
|
.select_couponCard {
|
|
width: 340px;
|
|
height: 90px;
|
|
background: linear-gradient(
|
|
146deg,
|
|
#ffe2bb 0%,
|
|
#ffeedc 35%,
|
|
#fcd8ab 100%
|
|
);
|
|
border: 1px solid rgba(255, 229, 195, 0.3);
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 20px;
|
|
margin-right: 60px;
|
|
border-radius: 10px;
|
|
color: rgba(240, 132, 51, 0.78);
|
|
.couponCard_l {
|
|
width: 90px;
|
|
padding-right: 15px;
|
|
border-right: 1px dashed rgba(230, 201, 165, 0.8);
|
|
position: relative;
|
|
.couponCard_leftBg {
|
|
position: absolute;
|
|
top: 16px;
|
|
left: -30px;
|
|
width: 16px;
|
|
height: 16px;
|
|
background: #fff;
|
|
border-radius: 50%;
|
|
}
|
|
}
|
|
.couponCard_r {
|
|
width: 250px;
|
|
margin-left: 15px;
|
|
position: relative;
|
|
.couponCard_rt {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
margin-bottom: 10px;
|
|
.couponCard_rt_btn {
|
|
background: linear-gradient(133deg, #fb6677 0%, #f33b50 100%);
|
|
border-radius: 14px;
|
|
color: #fff;
|
|
font-size: 12px;
|
|
line-height: 24px;
|
|
padding: 0px 20px;
|
|
}
|
|
}
|
|
.couponCard_rightBg {
|
|
position: absolute;
|
|
top: 16px;
|
|
right: -30px;
|
|
width: 16px;
|
|
height: 16px;
|
|
background: #fff;
|
|
border-radius: 50%;
|
|
}
|
|
}
|
|
}
|
|
.el-radio__input {
|
|
.el-radio__inner {
|
|
margin-top: 39px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.couponCardList_bottom {
|
|
margin-top: 20px;
|
|
position: relative;
|
|
.couponCardList_bottom_Box {
|
|
display: flex;
|
|
margin-top: 20px;
|
|
.couponCardList_bottom_r {
|
|
width: 150px;
|
|
height: 20px;
|
|
font-size: 14px;
|
|
font-family: PingFangSC-Medium, PingFang SC;
|
|
font-weight: 500;
|
|
color: #585858;
|
|
line-height: 20px;
|
|
}
|
|
.couponCardList_bottom_l {
|
|
width: 100px;
|
|
height: 20px;
|
|
font-size: 14px;
|
|
font-family: PingFangSC-Medium, PingFang SC;
|
|
font-weight: 600;
|
|
color: #222222;
|
|
line-height: 20px;
|
|
}
|
|
}
|
|
.couponCardList_bottom_btn {
|
|
position: absolute;
|
|
bottom: 0;
|
|
right: 20px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/deep/ .el-dialog__wrapper {
|
|
.el-dialog {
|
|
.el-dialog__body {
|
|
.paymentDialogRadio {
|
|
.el-radio {
|
|
margin-bottom: 15px;
|
|
}
|
|
}
|
|
.paymentTypeRadioList {
|
|
margin-top: 15px;
|
|
.el-radio {
|
|
display: flex;
|
|
.paymentTypeRadio {
|
|
display: flex;
|
|
.paymentTypeRadio_txt {
|
|
div {
|
|
margin-bottom: 15px;
|
|
padding-left: 15px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.addressDialog {
|
|
/deep/ .el-dialog {
|
|
.el-dialog__body {
|
|
.el-radio-group {
|
|
.select_address_list {
|
|
display: flex;
|
|
width: 280px;
|
|
height: 60px;
|
|
|
|
margin-right: 50px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
|