提交更改

This commit is contained in:
952108534@qq.com 2022-01-23 17:17:22 +08:00
parent 7455d73e63
commit e0d50bf974
7 changed files with 436 additions and 124 deletions

View File

@ -466,6 +466,12 @@ export const goodsmessage = (productCode) => {
}]
return fetch('generateOrderWX', list, 'POST' )
}
//再次支付
export const repayOrde = (ordernumber) => {
console.log(ordernumber);
return fetch('repayOrderWX?orderNo='+ordernumber,'', 'POST' )
}
//用户所有的优惠券
export const allConfig = (memberId,channelSecurity,mobile) => {
var data = {

View File

@ -114,11 +114,13 @@
width: 72px;
display: flex;
height: 25px;
background: #E2001A;
border-radius: 100px;
height: 25px;
background: #E2001A;
border-radius: 100px;
align-items: center;
font-size: 12px;
float: right;
margin-right: 27px;
justify-content: center;
margin-top: 8px;

View File

@ -7,23 +7,19 @@
<em>{{item.status=='0'?'待付款':item.status=='1'?'待收货':item.status=='2'?'已完成':item.status=='3'?'已取消':'异常订单'}}</em>
<span>{{orderstatus}}</span>
</div>
<div class="rc-border"></div>
<div v-if="isshow">
<div class="delivery" v-for="(userdata,index) in delivery" :key="index" >
<div class="delivery" v-if="isshow" >
<div class="to-delivery">
<span>{{ userdata.state }}</span>
<i>{{ userdata.time }}</i>
<span>{{ trackingstates}}</span>
</div>
<div class="bo-delivery">
<span>{{ userdata.address }}</span>
<span>{{ logisticsCompany }}</span>
</div>
<div class="viewdetails">
<span>查看详情</span>
<img :src="leftico" alt="" />
</div>
</div>
</div>
<div
class="mypersonal"
v-for="(datddress, index) in useraddress"
@ -37,11 +33,14 @@
<span>{{ datddress.provinceName }}{{datddress.cityName}}{{datddress.districtName}}{{datddress.detailAddress}}</span>
</div>
</div>
<div >
<div class="rc-center">
<div class="rc-usermain" v-for="(userlist,index) in item.orderDetailList" :key="index">
<div class="rc-image">
<img :src="item.catimage" alt="" />
<img src="../../static/images/default.jpg" alt="" />
</div>
<div class="rc-right">
<div class="rc-usercenter">
@ -52,7 +51,7 @@
</div>
<div class="rc-userbottom">
<span>数量:{{ item.pcs }}</span>
<i>{{ item.ecPrice }}</i>
<i>{{ 10 }}</i>
<div class="rc-bottom">
<span @click="userpay()">{{customer}}</span>
</div>
@ -126,7 +125,7 @@
<em>{{usersalesAmount}}</em>
</div>
<div style="padding-bottom:40px">
<span @click="onceagain">再次购买</span>
<span @click="onceagain()">再次购买</span>
</div>
</div>
@ -134,7 +133,7 @@
</div>
</div>
<div class="rc-full-width rc-margin-y--md">
<i class="ts-standard-btn ts-standard-btn--two center" @click="onceagain">
<i class="ts-standard-btn ts-standard-btn--two center" @click="onceagain()">
{{payorsucess}}
</i>
@ -155,12 +154,14 @@ export default {
return {
goldmedal:[],
userproductId:'',
logisticsDate:'',
userphone:'',
logisticsNumber:'',
customer:'',//
payorsucess:'', //
addressstype: null,
addressUserName:'',
logisticsCompany:'',//
orderstatus: '',
goldastates:'',
userisdelivery:'待收货',
@ -172,6 +173,7 @@ export default {
userdata:"",
usermessage:null,
userid: null,
trackingstates:'',//
useralllist:[],
delivery: [
@ -240,6 +242,7 @@ userpay(){
if(this.payorsucess=='立即支付'){
console.log('----')
this.getwei();
}else{
this.$router.push({
path: "/productdetails/producted",
@ -259,13 +262,27 @@ userpay(){
if(data){
this.goldmedal=data;
for(let i=0;i<this.goldmedal.length;i++){
// this.goldmedal[i].status=0
this.goldastates=this.goldmedal[i].status;
this.userproductId=this.goldmedal[i].orderDetailList[0].productId;
this.logisticsNumber=this.goldmedal[i].orderDetailList[0].logisticsNumber;
this.logisticsNumber=this.goldmedal[i].orderDetailList[0].logisticsNumber; //
this.trackingstates=this.goldmedal[i].orderDetailList[0].status//
if( this.trackingstates==0){
this.trackingstates='运输中'
}else if(this.trackingstates==1){
this.trackingstates='已签收'
}
else if(this.trackingstates==2){
this.trackingstates='未发货'
}
console.log(this.goldmedal[i].orderDate);
this.logisticsDate=new Date(this.goldmedal[i].orderDate.toLocaleString())//
console.log(this.logisticsDate);
this.logisticsCompany=this.goldmedal[i].orderDetailList[0].logisticsCompany; //
this.orderNumber=this.goldmedal[i].orderNumber
this.usersalesAmount=this.goldmedal[i].salesAmount;
this.addressUserName=this.goldmedal[i].addressUserName;
}
console.log(this.goldmedal,this.userproductId,this.usersalesAmount);
}
@ -274,39 +291,30 @@ if(data){
},
//
async getwei(user) {
let postData = [];
let oneProduct = {
productName: item.productName,
buyCount: item.buyCount,
productId: item.productCode,
payAmount: item.productPrice,
memberId: item.memberId,
phoneNumber: item.mobile,
orderAddress: {
addressPhoneNumber: orderAddress[0].recipientPhone,
addressUserName: orderAddress[0].recipient,
addressProvinceName: orderAddress[0].provinceName,
addressCityName: orderAddress[0].cityName,
addressCountyName: orderAddress[0].districtName,
addressDetailInfo: orderAddress[0].detailAddress,
},
};
let res = await generateOrderWX(postData);
let userPayData = {
orderId: res.data,
userprice: this.usersalesAmount, //
userinformation:
this.addressUserName+ //
console.log(user);
let userPayData = {
userprice: this.usersalesAmount,
userinformation:this.
addressUserName +
" " +
this.userphone, //
this.orderNumber,
wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
};
this.$router.push({
this.$router.push({
path: "/personal/userpay",
query: {
userPayData:JSON.stringify(userPayData),
userData:this.orderNumber,
stype:1,
userPayData: JSON.stringify(userPayData),
},
});
// this.$router.push({
// path: "/personal/userpay",
// query: {
// },
// });
},
async editaddress(user) {
// user.data.id=844350;
@ -337,6 +345,7 @@ console.log(this.userdata);
this.userphone=this.usermessage.data.mobile;
this.editaddress(this.userid);
this.addressstype = this.$route.query.stype;
this.orderNumber=this.$route.query.orderNumber;
this.orderquantity(this.orderNumber)
if(this.addressstype==2){

View File

@ -1,12 +1,9 @@
<template>
<div class="allmain">
<Myheader></Myheader>
<!-- <tabs></tabs> -->
<div class="rc-top"></div>
<div>
<Myheader></Myheader>
<div class="rc-main">
<div class="rc-usermain">
<div class="rc rc-column">
<div class="rc-header">
<span
v-for="(item, index) in discountlist"
:key="index"
@ -17,8 +14,6 @@
</span>
<!-- <span @click="tanchu()">弹出</span> -->
</div>
<div class="online bold"></div>
<div class="rs-dis">
<div
class="rc-discount"
@ -27,24 +22,23 @@
>
<img :src="userimage" alt="" />
<div class="rc-contair">
<div class="rc-left" ref="userleft" id="userleft" :style='usercolor'>
<div class="rc-left" ref="userleft" id="userleft">
<div>
<i></i><span>{{item.couponTypeId=='4'?parseInt(((item.discount) *10))+ '折':item.couponAmount}}</span>
<i></i><span>{{ item.couponAmount }}</span>
</div>
<strong>{{ item.couponName }}</strong>
</div>
<div class="rc-right">
<i :style='usercolor'>
{{ item.couponName }}
<i>
{{ item.couponDesc }}
</i>
<div class="rc-userfont">
<strong>有效期</strong>
<span>{{item.validFrom}}</span>
<em>{{item.validTo}}</em>
<div class="rc-main" id="rc-main">
<span>有效期{{item.validFrom}}</span>
<em>{{ item.validTo }}</em>
</div>
<nuxt-link :to="`/productdetails/productlist`">
<div v-if="userload" class="ts-stand">
<nuxt-link :to="`/`">
<div class="rc-footer" v-if="userload">
<span @click="usertiao()">立即使用</span>
</div>
</nuxt-link>
</div>
@ -54,23 +48,19 @@
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import {allConfig,getdraw} from "../../ajax/getData";
// import tabs from "@/components/tabs.vue";
export default {
// middleware: 'metaTitle',
// // middleware: 'metaTitle',
// meta: {title: ''},
data() {
return {
userload: true,
pastdue: false,
unused: false,
usercolor:{color:'#e1001a'},
usermessage:[],
userstates:0,
userimage: require("../../assets/image/unused.png"),
@ -83,6 +73,71 @@ export default {
starttime: "2021.11.29-2022.01.28",
catimage: require("../../assets/image/unused.png"),
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
catimage: require("../../assets/image/unused.png"),
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
catimage: require("../../assets/image/unused.png"),
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
{
price: "30",
pricestype: "新客优惠券",
special: "全场每满299-30",
period: "有效期",
starttime: "2021.11.29-2022.01.28",
},
],
discountlist: [
{
@ -131,10 +186,6 @@ export default {
if(data){
console.log(data);
this.newlist=data.data;
this.newlist.forEach(element=>{
element.validFrom=element.validFrom.slice(0,10)
element.validTo=element.validTo.slice(0,10)
})
console.log(this.newlist);
}
@ -146,17 +197,13 @@ export default {
this.pastdue = true;
this.userimage = require("../../assets/image/hasused.png");
this.userstates=1
console.log(this.$refs.userleft);
this.usercolor={color:'white'}
this.userdraw(this.usermessage.data.mobile,1)
}
if (this.activeIndex == 0) {
this.userload = true;
this.pastdue = false;
this.userdraw(this.usermessage.data.mobile,0)
this.usercolor={color:'#e1001a'}
this.userstates=0
this.userimage = require("../../assets/image/unused.png");
}
@ -165,16 +212,18 @@ export default {
this.pastdue = true;
this.userdraw(this.usermessage.data.mobile,2)
this.userstates=2
this.usercolor={color:'white'}
this.userimage = require("../../assets/image/expired.png");
}
console.log(index);
},
usertiao(){
this.$router.push({ name: "productdetails-productlist",
})
this.$router.push({
path: "/",
query: {
stype: 1,
},
});
},
@ -186,18 +235,6 @@ export default {
// }
// dis_livchat(option);
// }
},
directives: {
'color': {
bind: function(el, binding){
el.style.color = binding.value
},
inserted: function(el){
}
},
},
mounted() {
if(this.usermessage!=='' ||this.usermessage.data!==undefined){
@ -216,6 +253,260 @@ import Myheader from "~/components/header.vue";
<style lang="less" scoped>
//
@import url("../../assets/css/global.less");
@import url("../../assets/css/discount.less");
@media screen and(min-width: 320px) and(max-width:768px) {
.active {
font-size: 14px;
color: #e2001a;
}
.unactive {
font-size: 14px;
color: #444444;
}
.rc-header {
height: 64px;
display: flex;
align-items: center;
margin-left: 23px;
span {
display: block;
margin-left: 32px;
}
span:first-child {
margin-left: 0;
}
}
.rc-discount {
margin-left: 23px;
display: flex;
margin-top: 16px;
width: 335px;
background: #ffffff;
position: relative;
height: 120px;
img {
display: block;
width: 100%;
height: 100%;
}
.rc-contair {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.rc-left {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #e1001a;
padding-right: 21px;
width: 30%;
float: left;
height: 100%;
i {
font-style: normal;
font-size: 12px;
}
span {
font-size: 26px;
}
strong {
font-style: normal;
font-size: 12px;
display: block;
margin-top: 8px;
}
}
.rc-right {
display: flex;
flex-direction: column;
margin-left: 36px;
justify-content: center;
height: 100%;
i {
font-style: normal;
font-size: 14px;
color: #e1001a;
}
.rc-main {
color: #999999;
font-size: 12px;
}
span {
display: block;
margin-top: 8px;
}
em {
font-style: normal;
}
}
.rc-footer {
display: flex;
justify-content: flex-end;
span {
width: 72px;
height: 25px;
background: #e2001a;
text-align: center;
line-height: 25px;
font-size: 12px;
color: #ffffff;
margin-bottom: 8px;
border-radius: 100px;
margin-right: 30px;
}
}
}
}
// // /* 768px1920 *pc/
@media screen and (min-width: 768px) and (max-width: 1920px) {
.rc-main {
width: 100%;
.rc-usermain {
width: 92%;
margin: 0 auto;
}
}
.active {
font-size: 16px;
color: #e2001a;
cursor: pointer;
}
.unactive {
font-size: 16px;
color: #444444;
cursor: pointer;
}
.rc-header {
height: 64px;
display: flex;
align-items: center;
margin-left: 23px;
justify-content: center;
span {
display: block;
margin-left: 32px;
}
span:first-child {
margin-left: 0;
}
}
.rs-dis {
margin-top: 70px;
}
.rc-discount {
margin-left: 50px;
display: flex;
margin-top: 40px;
width: 335px;
background: #ffffff;
position: relative;
height: 120px;
float: left;
img {
display: block;
width: 100%;
height: 100%;
}
.rc-contair {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.rc-left {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #e1001a;
padding-right: 21px;
width: 30%;
float: left;
height: 100%;
i {
font-style: normal;
font-size: 12px;
}
span {
font-size: 26px;
}
strong {
font-style: normal;
font-size: 12px;
display: block;
margin-top: 8px;
}
}
.rc-right {
display: flex;
flex-direction: column;
margin-left: 36px;
justify-content: center;
height: 100%;
i {
font-style: normal;
font-size: 16px;
color: #e1001a;
}
.rc-main {
color: #999999;
font-size: 12px;
}
span {
display: block;
margin-top: 8px;
}
em {
font-style: normal;
}
}
.rc-footer {
display: flex;
justify-content: flex-end;
margin-right: 10px;
span {
width: 72px;
height: 25px;
background: #e2001a;
text-align: center;
line-height: 25px;
font-size: 12px;
color: #ffffff;
margin-bottom: 8px;
border-radius: 100px;
margin-right: 30px;
}
}
.rc-userright {
display: flex;
align-items: center;
width: 78px;
justify-content: center;
height: 78px;
border: 2px solid #999999;
border-radius: 50%;
span {
width: 60px;
height: 60px;
border: 1px solid #999999;
border-radius: 50%;
display: flex;
align-items: center;
text-align: center;
justify-content: center;
}
}
}
}
</style>

View File

@ -43,7 +43,7 @@
</div>
<div class="rc-usermain" >
<div class="rc-image">
<img :src="item.catimage" alt="" />
<img src="../../static/images/default.jpg" alt="" />
</div>
<div class="rc-right" @click="usertiaozhuan(item)">
<div class="rc-usercenter">
@ -306,7 +306,6 @@ export default {
this.pending.push(this.goldmedal[i].orderDetailList[0]);
}
}
for (var i = 0; i < this.useralllist.length; i++) {
this.useralllist[i].orderNumber = this.goldmedal[i].orderNumber;
this.useralllist[i].status = this.goldmedal[i].status;
@ -333,38 +332,21 @@ export default {
//
async getwei(item) {
console.log(item);
let postData = [];
// let oneProduct = {
// productName: item.productName,
// buyCount: item.buyCount,
// productId: item.productCode,
// payAmount: item.productPrice,
// memberId: item.memberId,
// phoneNumber: item.mobile,
// orderAddress: {
// addressPhoneNumber: orderAddress[0].recipientPhone,
// addressUserName: orderAddress[0].recipient,
// addressProvinceName: orderAddress[0].provinceName,
// addressCityName: orderAddress[0].cityName,
// addressCountyName: orderAddress[0].districtName,
// addressDetailInfo: orderAddress[0].detailAddress,
// },
// };
// postData.push(oneProduct);
let res = await generateOrderWX(postData);
let userPayData = {
orderId: res.data,
userprice: item.salesAmount, //
userinformation:
item.addressUserName+ //
let userPayData = {
userprice: item.salesAmount,
userinformation:item.addressUserName +
" " +
item.phoneNumber, //
this.orderNumber,
wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
};
this.$router.push({
path: "/personal/userpay",
query: {
userPayData:JSON.stringify(userPayData),
userData:item.orderNumber,
stype:1,
userPayData: JSON.stringify(userPayData),
},
});
},

View File

@ -87,7 +87,7 @@ import Myheader from "~/components/header.vue";
import tabs from "@/components/tabs.vue";
import vueQr from 'vue-qr'
import { generateOrderAlipay, updateOrderWX } from "../../ajax/getData";
import { generateOrderAlipay, updateOrderWX,repayOrde } from "../../ajax/getData";
export default {
data() {
return {
@ -108,12 +108,26 @@ export default {
dialogFail: false,
userPayData: {},
qrtext:'',
userData:'',
};
},
computed: {},
mounted() {
this.userPayData = JSON.parse(this.$route.query.userPayData);
let stype=this.$route.query.stype;
console.log(stype)
if(stype==1){
this.userData = this.$route.query.userData;
this.repayOrde(this.userData);
this.userPayData = JSON.parse(this.$route.query.userPayData);
console.log(this.userPayData);
this.qrtext=this.userPayData.wxPay
}else{
this.userPayData = JSON.parse(this.$route.query.userPayData);
}
this.qrtext=this.userPayData.wxPay
console.log(this.userData);
},
methods: {
closeDialogSuccess() {
@ -129,6 +143,14 @@ export default {
// });
},
async repayOrde(ordernumber) {
let res = await repayOrde(ordernumber);
console.log(ordernumber);
if (res) {
this.qrtext=res.data
}
},
async selectGoods(item, index) {
this.activeIndex = index;
this.paytype = item.paytype;

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB