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,) => { export const userindent = (phoneNumber,orderNumber,) => {
var data = { var data = {
phoneNumber:'18112621098', phoneNumber:phoneNumber,
orderNumber:orderNumber, orderNumber:orderNumber,
} }
return fetch('orderMaster/?type=query', data, 'POST' ) return fetch('orderMaster/?type=query', data, 'POST' )

View File

@ -3,6 +3,7 @@
@media screen and (max-width:768px){ @media screen and (max-width:768px){
.active { .active {
font-size: 14px; font-size: 14px;
color: #e2001a; color: #e2001a;
@ -13,19 +14,64 @@
color: #444444; color: #444444;
cursor: pointer; cursor: pointer;
} }
.usercontshow{ .usercontshow{
padding: 0 1.5rem; padding: 0 1.5rem;
.rc-usermaina{
width: 100%;
height: 100%;
.online{ .online{
margin: 0; margin: 0;
margin-top: 1.5rem;
&.bold{ &.bold{
height: 0.5rem; height: 0.5rem;
} }
} }
.rc-usermaina{ .rc-price{
width: 100%; display: flex;
height: 100%; 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 { .rc-headera {
display: flex; display: flex;
@ -39,7 +85,6 @@
.rc-center { .rc-center {
width: 100%; width: 100%;
height: 245px;
margin-top: 8px; margin-top: 8px;
.rc-usermain { .rc-usermain {
.pc-bottom{ .pc-bottom{
@ -60,7 +105,6 @@
} }
.rc-right { .rc-right {
.rc-userbottomm{ .rc-userbottomm{
display: none; display: none;
} }
@ -110,8 +154,8 @@
.rc-bottom { .rc-bottom {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: flex-end;
margin-top: 24px; margin-top: 26px;
span { span {
display: block; display: block;
width: 130px; width: 130px;

View File

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