This commit is contained in:
952108534@qq.com 2022-01-21 19:46:45 +08:00
parent 7f9a290662
commit e1e67e9ae2
3 changed files with 215 additions and 142 deletions

View File

@ -267,7 +267,7 @@ export const searchchanpin = (stype,usertype,curPage,curRow) => {
//查询订单
export const userindent = (phoneNumber,orderNumber,) => {
var data = {
phoneNumber:'18112621098',
phoneNumber:phoneNumber,
orderNumber:orderNumber,
}
return fetch('orderMaster/?type=query', data, 'POST' )

View File

@ -3,6 +3,7 @@
@media screen and (max-width:768px){
.active {
font-size: 14px;
color: #e2001a;
@ -13,19 +14,64 @@
color: #444444;
cursor: pointer;
}
.usercontshow{
padding: 0 1.5rem;
.online{
.rc-usermaina{
width: 100%;
height: 100%;
.online{
margin: 0;
margin-top: 1.5rem;
&.bold{
height: 0.5rem;
}
}
.rc-usermaina{
width: 100%;
height: 100%;
.rc-price{
display: flex;
justify-content: space-between;
i{
list-style: none;
font-style: normal;
font-weight: bold;
}
em{
list-style: none;
font-style: normal;
}
strong{
list-style: none;
font-style: normal;
}
.priceleft{
color: #666666;
font-size: 14px;
display: flex;
align-items: center;
margin-top: 19px;
em{
margin-left: 8px;
}
}
.priceright{
display: flex;
margin-top: 19px;
align-items: center;
strong{
color: #333333;
font-size: 14px;
}
i{
font-size: 18px;
color: #E1001A;
margin-left: 3px;
}
}
}
}
.rc-headera {
display: flex;
@ -39,7 +85,6 @@
.rc-center {
width: 100%;
height: 245px;
margin-top: 8px;
.rc-usermain {
.pc-bottom{
@ -60,7 +105,6 @@
}
.rc-right {
.rc-userbottomm{
display: none;
}
@ -110,8 +154,8 @@
.rc-bottom {
display: flex;
align-items: center;
justify-content: center;
margin-top: 24px;
justify-content: flex-end;
margin-top: 26px;
span {
display: block;
width: 130px;

View File

@ -1,86 +1,126 @@
<template>
<div>
<Myheader></Myheader>
<div class="rc-top"></div>
<div class="online bold"></div>
<div class="usercontshow rc-max-width--xl">
<div class="rc-headera">
<span
v-for="(item, index) in discountlist"
:key="index"
@click="selectGoods(item, index)"
:class="activeIndex == index ? 'active' : 'unactive'"
>
{{item.title}}
</span>
</div>
<div class="online bold"></div>
<div class="rc-userheader">
<span v-for="(item, index) in message" :key="index">
{{item.title}}
</span>
</div>
<div class="rc-center" v-for="(item, index) in goldmedal" :key="index">
<div class="rc-usermaina" >
<div class="rc-top"></div>
<div class="online bold"></div>
<div class="usercontshow rc-max-width--xl">
<div class="rc-headera">
<span
v-for="(item, index) in discountlist"
:key="index"
@click="selectGoods(item, index)"
:class="activeIndex == index ? 'active' : 'unactive'"
>
{{ item.title }}
</span>
</div>
<div class="online bold"></div>
<div class="rc-userheader">
<span v-for="(item, index) in message" :key="index">
{{ item.title }}
</span>
</div>
<div class="rc-center" v-for="(item, index) in useralllist" :key="index">
<div class="rc-usermaina">
<div class="rc-title">
<div>
<i>订单编号:</i><span>{{ item.orderNumber }}</span>
<div>
<i>订单编号:</i><span>{{ item.orderNumber }}</span>
</div>
<div class="rc-usertitle">
<strong>订单状态:</strong> <em>{{item.status=='0'?'待付款':item.status=='1'?'待收货':item.status=='2'?'已完成':item.status=='3'?'已取消':'异常订单'}}</em>
</div>
<strong>订单状态:</strong>
<em>{{
item.status == "0"
? "待付款"
: item.status == "1"
? "待收货"
: item.status == "2"
? "已完成"
: item.status == "3"
? "已取消"
: "异常订单"
}}</em>
</div>
</div>
<div class="rc-usermain" @click="userfind(item)">
<div class="rc-image">
<div class="rc-image">
<img :src="item.catimage" alt="" />
</div>
<div class="rc-right">
<div class="rc-usercenter">
<em>{{ item.usereat }}</em>
<div class="rc-userright">
<span>规格:{{ item.num }}</span>
</div>
<em>{{ item.usereat }}</em>
<div class="rc-userright">
<span>规格:{{ item.num }}</span>
</div>
</div>
<div class="rc-userbottom">
<span>数量:{{ item.pcs}}</span>
<i>{{ item.ecPrice }}</i>
<span>数量:{{ item.pcs }}</span>
<i>{{ item.salesAmount }}</i>
</div>
<div class="rc-userbottomm">
<i>{{ item.userprice }}</i>
<span>{{item.orderstype}}</span>
<div class="rc-userbottomm">
<i>{{ item.userprice }}</i>
<span>{{ item.orderstype }}</span>
<i>{{ item.userprice }}</i>
</div>
</div>
<div class="pc-bottom">
<span @click="usertwo()">再次购买</span>
<span @click="userfind()">查看订单</span>
</div>
<div class="pc-bottom">
<span @click="usertwo()">再次购买</span>
<span @click="userfind()">查看订单</span>
</div>
</div>
<div class="online"></div>
<div class="rc-usermain rc-price">
<div class="rc-price priceleft">
<span>数量:</span>
<em>共1件商品</em>
</div>
<div class="rc-price priceright">
<strong>总计:</strong>
<i>{{item.salesAmount}}</i>
</div>
</div>
<div class="rc-bottom">
<span @click="userpay(item,index)">{{item.status=='0'?'取消订单':item.status=='1'?'确认收货':item.status=='2'?'再次购买':item.status=='3'?'再次购买':'异常订单'}}</span>
<span @click="userfind(item)">{{item.status=='0'?'立即支付':item.status=='1'?'查看订单':item.status=='2'?'查看订单':item.status=='3'?'查看订单':'异常订单'}}</span>
<span @click="userpay(item, index)">{{
item.status == "0"
? "取消订单"
: item.status == "1"
? "确认收货"
: item.status == "2"
? "再次购买"
: item.status == "3"
? "再次购买"
: "异常订单"
}}</span>
<span @click="userfind(item)">{{
item.status == "0"
? "立即支付"
: item.status == "1"
? "查看订单"
: item.status == "2"
? "查看订单"
: item.status == "3"
? "查看订单"
: "异常订单"
}}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { List } from 'vant';
import Myheader from "~/components/header.vue";
import { customerorders,userindent,canceldanhao } from "../../ajax/getData";
import { customerorders, userindent, canceldanhao } from "../../ajax/getData";
export default {
data() {
return {
activeIndex: 0,
userdata:[],
buttontitle:'再次购买',
useralllist: [],
userdata: [],
buttontitle: "再次购买",
discountlist: [
{
title: "全部",
@ -96,7 +136,7 @@ export default {
},
],
message: [
message: [
{
title: "商品",
},
@ -122,10 +162,9 @@ export default {
ordernum: 0,
num: "5kg",
specification: "1",
buttontitle:'立即支付',
buttontitle: "立即支付",
userprice: "167.00",
catimage: require("../../assets/image/rc-win.png"),
},
{
@ -133,7 +172,7 @@ export default {
usereat: "每年4次免积分产品试吃",
ordernum: 0,
buttontitle:'再次购买',
buttontitle: "再次购买",
catimage: require("../../assets/image/usereat.png"),
orderstype: 2,
userprice: "167.00",
@ -142,7 +181,7 @@ export default {
ordernumber: "1111111111111111111",
usereat: "尊享订单免邮服务(指点商品)",
ordernum: 0,
buttontitle:'取消订单',
buttontitle: "取消订单",
catimage: require("../../assets/image/usercar.png"),
orderstype: 3,
userprice: "167.00",
@ -190,110 +229,100 @@ export default {
};
},
mounted() {
let user= JSON.parse(localStorage.getItem("userInfo"));
this.userdata=user;
let stype=this.$route.query.stype
if(user=='' ||user==null){
this.$message({
type: 'warning',
message: '请先去登录'
});
return
}else{
this.indet(user.data.mobile,stype);
}
},
mounted() {
let user = JSON.parse(localStorage.getItem("userInfo"));
this.userdata = user.data.mobile;
console.log(this.userdata);
let stype = this.$route.query.stype;
if (user == "" || user == null) {
this.$message({
type: "warning",
message: "请先去登录",
});
return;
} else {
this.indet(this.userdata, stype);
}
},
components: {
Myheader,
},
methods: {
async indet(mobile,stype){
let data=await userindent(mobile,);
this.activeIndex=stype;
this.goldmedal=data;
let list=[];
let fahuolist=[];
console.log(this.goldmedal);
for(let i=0;i<this.goldmedal.length;i++){
list.push(this.goldmedal[i].orderDetailList);
async indet(mobile, stype) {
let data = await userindent(mobile);
this.activeIndex = stype;
this.goldmedal = data;
// console.log(this.goldmedal);
let usermenulist = [];
let list = [];
for (let i = 0; i < this.goldmedal.length; i++) {
this.useralllist.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;
this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount;
}
console.log(this.useralllist);
},
async canceldanhao(orderNumber) {
let data = await canceldanhao(orderNumber);
if (data) {
this.$message({
type: "warning",
message: "取消订单成功",
});
this.indet(this.userdata.data.mobile);
}
},
async canceldanhao(orderNumber){
let data=await canceldanhao(orderNumber);
console.log(data);
if(data){
this.$message({
type: 'warning',
message: '取消订单成功'
});
this.indet(this.userdata.data.mobile);
}
},
userpay(item,index){
console.log(item);
if(item.status==0){
userpay(item, index) {
if (item.status == 0) {
this.canceldanhao(item.orderNumber);
}
console.log(item.buttontitle);
if(item.buttontitle=='立即支付'){
this.$router.push({
path: "/personal/userpay",
query: {
stype: 1,
},
});
}else if(item.buttontitle=='再次购买'){
this.$router.push({
path: "/myorder/userrecord",
query: {
stype: 1,
},
});
}
if (item.buttontitle == "立即支付") {
this.$router.push({
path: "/personal/userpay",
query: {
stype: 1,
},
});
} else if (item.buttontitle == "再次购买") {
this.$router.push({
path: "/myorder/userrecord",
query: {
stype: 1,
},
});
}
},
selectGoods(item, index) {
this.activeIndex = index;
if(index==1){
if (index == 1) {
}
if(index==2){
if (index == 2) {
}
},
userfind(item){
console.log('--');
console.log(item.orderNumber);
this.$router.push({
userfind(item) {
this.$router.push({
path: "/myorder/usertion",
query: {
stype: item.status,
orderNumber:item.orderNumber
orderNumber: item.orderNumber,
},
});
},
usertwo(){
this.$router.push({
usertwo() {
this.$router.push({
path: "/myorder/userrecord",
query: {
stype: 1,
},
});
},
},
};
</script>