Payment flow refine

This commit is contained in:
Vion
2022-01-23 16:50:49 +08:00
parent 9b4f71074a
commit 8ff86279a0
9 changed files with 83 additions and 53 deletions

View File

@@ -1,10 +1,10 @@
<template>
<div>
<div class="rc-header">
<Myheader></Myheader>
</div>
<div class="rc-main">
<tabs></tabs>
<Myheader></Myheader>
<div class="rc-top"></div>
<tabs :crumbs="crumbs"></tabs>
<div class="rc-main rc-max-width--xl">
<div class="cart-list">
<div class="header">
<div class="list-left">
@@ -114,12 +114,21 @@
import Myheader from "~/components/header.vue";
import MyFooter from '~/components/rc-footer.vue'
import tabs from "@/components/tabs.vue";
import { mapMutations } from "vuex";
import { isexistCart, generateOrderWX, deleteCart } from "../../ajax/getData";
export default {
middleware: "metaTitle",
meta: { title: "购物车" },
data() {
return {
crumbs:[
{
path:'/productdetails/productlist/',
},
{
path:'/myorder/userrecord/'
}
],
ordersum: 1,
usercheckbox: false,
shopnum: 0,
@@ -174,26 +183,26 @@ export default {
},
mounted() {
this.carmessage();
this.checkIsLogin();
},
components: {
Myheader,
tabs,
MyFooter,
MyFooter
},
methods: {
//请求猫
...mapMutations(["checkIsLogin"]),
async carmessage() {
let user = JSON.parse(localStorage.getItem("userInfo"));
let user = this.$store.state.userInfo;
this.userid = user.data.id;
let data = await isexistCart(user.data.id);
this.cartData = data;
// this.goldmedal = data;
},
async userjie(list) {
let user = JSON.parse(localStorage.getItem("userInfo"));
console.log(user);
let user = this.$store.state.userInfo;
this.userid = user.data.id;
let data = await generateOrderWX(list);
if (data) {
@@ -201,7 +210,6 @@ export default {
type: "warning",
message: data.msg,
});
console.log(data);
this.$router.push({
path: "/personal/settlement",
query: {
@@ -209,12 +217,11 @@ export default {
},
});
}
console.log(data);
},
//删除购物车
async deletsmessage(productCode) {
let user = JSON.parse(localStorage.getItem("userInfo"));
let user = this.$store.state.userInfo;
this.userid = user.data.id;
let data = await deleteCart( productCode);
if (data) {
@@ -287,7 +294,6 @@ export default {
if (this.ys1 == false) {
this.$nextTick(() => {
this.userdelete = "删除";
console.log(this.userdelete);
});
} else if (this.ys1 == true) {
this.$nextTick(() => {
@@ -504,10 +510,6 @@ export default {
}
}
.rc-main {
width: 92%;
margin: 0 auto;
padding-top: 60px;
max-width: 1400px;
.cart-list {
width: 100%;
border: 1px solid #d7d7d7;
@@ -775,8 +777,8 @@ export default {
width: 100%;
}
ul {
margin-top: -32px;
margin-left: 140px;
margin-top: -2rem;
margin-left: 9.75rem;
width: 50%;
.del {
display: none;
@@ -796,6 +798,7 @@ export default {
bottom: 0;
width: 100%;
z-index: 10;
margin-bottom:0;
.rc-shop {
display: none;
}

View File

@@ -10,7 +10,7 @@ ul li ol li em strong i {
.settlement {
padding-top: 60px;
}
@@ -465,7 +465,9 @@ ul li ol li em strong i {
display: none;
border: none;
padding: 0;
&.show {
display:block;
}
&.active {
display: block;
border: none;

View File

@@ -1,9 +1,7 @@
<template>
<div class="settlement">
<Myheader></Myheader>
<div class="rc-main">
<tabs></tabs>
</div>
<div class="rc-top"></div>
<div class="rc_contline"></div>
<div class="rc-main">
<div class="address-list">
@@ -28,7 +26,7 @@
<span>{{ item.address }}</span>
</div>
</div>
<div class="mypersonal add">
<div class="mypersonal add" :class="useraddress.length>0?'':'show'">
<div
class="my-delivery"
@click="addAddress"
@@ -67,10 +65,12 @@
<span>配送方式:</span>
<i>{{ shopprice.price }}</i>
</li>
<!--
<li>
<span> 活动促销:</span>
<i>{{ shopprice.distribution }}</i>
</li>
-->
<li>
<span>商品总价:</span>
<i class="red">{{ sumPrice }}</i>
@@ -162,6 +162,14 @@ export default {
meta: { title: "订单结算" },
data() {
return {
crumbs:[
{
path:'/productdetails/productlist/',
},
{
path:'/personal/settlement'
}
],
goldmedal: [],
dialogAddTitle: "",
addressstype: null,
@@ -276,7 +284,9 @@ export default {
let orderAddress = this.useraddress.filter((item) => item.isDefault);
let postData = [];
this.goldmedal.forEach((item) => {
let basePoint = (item.basePoint?item.basePoint:0);
let oneProduct = {
basePoint:basePoint,
productName: item.productName,
buyCount: item.buyCount,
productId: item.productCode,
@@ -354,7 +364,7 @@ export default {
postData[0].orderAddress.addressPhoneNumber,
// wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
// wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
wxPay: res.data,
wxPay: res.msg,
};
this.$router.push({
path: "/personal/userpay",

View File

@@ -1,8 +1,8 @@
<template>
<div class="page_modules">
<Myheader></Myheader>
<div class="rc-top rc-md-up"></div>
<div class="cont_modules">
<tabs></tabs>
<el-row class="order_info">
<el-col :span="6" class="ph_hidden">
<ul class="li_inline">
@@ -19,7 +19,7 @@
<el-col :span="6" class="ready_right">
<div class="inline_right">
<p>付款金额:</p>
<p class="price">{{ userPayData.userprice }}</p>
<p class="price">{{ userPayData.userprice }}</p>
</div>
<div class="inline_right">
<p>收货信息:</p>
@@ -93,16 +93,19 @@ export default {
return {
activeIndex: 0,
isSucess: false,
dialogSuccess: false,
paytype: "微信",
userpaystype: [
{
paytype: "微信",
payimage: require("../../assets/pay/wx.png"),
},
/*
{
paytype: "支付宝",
payimage: require("../../assets/pay/zfb.png"),
},
*/
],
dialogFail: false,
userPayData: {},
@@ -145,7 +148,7 @@ export default {
//支付监听
async payOrderWX() {
let res = await updateOrderWX();
let res = await updateOrderWX(this.userPayData.orderId);
if (res.success) {
this.qrtext = '成功加入群的二维码';
this.dialogSuccess = true;
@@ -294,7 +297,7 @@ export default {
}
}
.paycord {
display: none;
//display: none;
}
}
</style>