mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-01 17:56:39 +08:00
Payment flow refine
This commit is contained in:
parent
9b4f71074a
commit
8ff86279a0
@ -82,7 +82,6 @@ export const isexistCart = (id, pet, address) => {
|
||||
* 删除购物车
|
||||
*/
|
||||
export const deleteCart = ( productCode) => {
|
||||
debugger;
|
||||
var data = {
|
||||
productCode
|
||||
}
|
||||
|
@ -4,9 +4,11 @@ body {
|
||||
line-height: 1.5;
|
||||
color: #666;
|
||||
}
|
||||
.ts-crumbs {
|
||||
|
||||
/deep/.el-button--primary {
|
||||
background-color: #e1001a;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
.rc-menu--xs .rc-screen-reader{
|
||||
left:28%;
|
||||
}
|
||||
|
@ -459,11 +459,11 @@ export default {
|
||||
font-size: 16px;
|
||||
margin-left: 2px;
|
||||
width:100%;
|
||||
padding-bottom:.25rem;
|
||||
padding-bottom:.5rem;
|
||||
background:url("../assets/image/ico-location.png") no-repeat 98% center;
|
||||
background-size:16px;
|
||||
position:relative;
|
||||
top:.5rem;
|
||||
top:.45rem;
|
||||
padding-left:.875rem;
|
||||
}
|
||||
.ts-area-picker-mobile{
|
||||
|
@ -14,6 +14,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapMutations } from "vuex";
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
@ -39,6 +40,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
...mapMutations(["checkIsLogin"]),
|
||||
lianxi(item,index){
|
||||
if(item.title=='在线客服'){
|
||||
var option = {
|
||||
@ -85,10 +87,14 @@ export default {
|
||||
this.gotop = false
|
||||
}
|
||||
}
|
||||
},
|
||||
created(){
|
||||
|
||||
},
|
||||
mounted(){
|
||||
//Check login
|
||||
let usernot=JSON.parse(localStorage.getItem("userInfo"));
|
||||
this.checkIsLogin();
|
||||
let usernot = this.$store.state.userInfo;
|
||||
//console.log(usernot);
|
||||
if(usernot==null ||usernot==undefined){
|
||||
this.loginornot=true
|
||||
|
@ -24,7 +24,9 @@ export default {
|
||||
'/usersearch/search':'产品搜索',
|
||||
'/personal/mypersonal':'个人中心',
|
||||
'/personal/usermember/':'会员权益',
|
||||
'/personal/integral/':'积分明细'
|
||||
'/personal/integral/':'积分明细',
|
||||
'/personal/settlement/':'订单确认',
|
||||
'/myorder/userrecord/':'购物车'
|
||||
},
|
||||
};
|
||||
},
|
||||
@ -43,26 +45,29 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapMutations(["changemessage",'selectMenu']),
|
||||
//...mapMutations(["changemessage",'selectMenu']),
|
||||
build() {
|
||||
let _self = this;
|
||||
this.displayData=[];
|
||||
this.crumbs.forEach(function(ele,index){
|
||||
let displayObj= {path:'',title:''};
|
||||
if(ele.path) {
|
||||
displayObj.path = ele.path;
|
||||
for(let path in _self.nameMapping) {
|
||||
if(ele.path.indexOf(path)>-1) {
|
||||
displayObj.path = path;
|
||||
displayObj.title = _self.nameMapping[path];
|
||||
if(this.crumbs && this.crumbs.length>0)
|
||||
{
|
||||
this.crumbs.forEach(function(ele,index){
|
||||
let displayObj= {path:'',title:''};
|
||||
if(ele.path) {
|
||||
displayObj.path = ele.path;
|
||||
for(let path in _self.nameMapping) {
|
||||
if(ele.path.indexOf(path)>-1) {
|
||||
displayObj.path = path;
|
||||
displayObj.title = _self.nameMapping[path];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(ele.title) {
|
||||
displayObj.title = ele.title;
|
||||
}
|
||||
_self.displayData.push(displayObj);
|
||||
});
|
||||
if(ele.title) {
|
||||
displayObj.title = ele.title;
|
||||
}
|
||||
_self.displayData.push(displayObj);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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",
|
||||
|
@ -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>
|
Loading…
Reference in New Issue
Block a user