This commit is contained in:
952108534@qq.com
2022-01-22 19:22:17 +08:00
parent 38792ccbd6
commit 95614b9c66
4 changed files with 318 additions and 46 deletions

View File

@@ -41,11 +41,11 @@
}}</em>
</div>
</div>
<div class="rc-usermain" @click="userfind(item)">
<div class="rc-usermain" >
<div class="rc-image">
<img :src="item.catimage" alt="" />
</div>
<div class="rc-right">
<div class="rc-right" @click="usertiaozhuan(item)">
<div class="rc-usercenter">
<em>{{ item.usereat }}</em>
<div class="rc-userright">
@@ -64,8 +64,28 @@
</div>
<div class="pc-bottom">
<span @click="usertwo()">再次购买</span>
<span @click="userfind()">查看订单</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 class="online" style="display:none"></div>
@@ -111,17 +131,27 @@
</div>
</div>
<MyFooter></MyFooter>
</div>
</template>
<script>
import Myheader from "~/components/header.vue";
import { customerorders, userindent, canceldanhao } from "../../ajax/getData";
import MyFooter from '~/components/rc-footer.vue'
import { customerorders, userindent, canceldanhao,generateOrderWX } from "../../ajax/getData";
export default {
data() {
return {
activeIndex: 0,
userstype:'',
alllist:[],
obligation:[],//待付款
pending:[],//待发货
receiving :[],//待收货
allmessage:[],
useralllist: [],
usertitle:'',
useraliset:[],
userdata: [],
buttontitle: "再次购买",
discountlist: [
@@ -235,8 +265,9 @@ export default {
mounted() {
let user = JSON.parse(localStorage.getItem("userInfo"));
this.userdata = user.data.mobile;
console.log(this.userdata);
let stype = this.$route.query.stype;
this.userstype=this.$route.query.stype;
console.log(stype);
if (user == "" || user == null) {
this.$message({
type: "warning",
@@ -249,25 +280,98 @@ export default {
},
components: {
Myheader,
MyFooter
},
methods: {
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]);
this.alllist.push(this.goldmedal[i].orderDetailList[0])
this.allmessage.push(this.goldmedal[i].orderDetailList[0])
if(this.goldmedal[i].status==0){
console.log("+++++++++++++");
this.obligation.push(this.goldmedal[i].orderDetailList[0]);
}else if(this.goldmedal[i].status==1){
this.receiving.push(this.goldmedal[i].orderDetailList[0]);
}
else if(this.goldmedal[i].status==4){
this.pending.push(this.goldmedal[i].orderDetailList[0]);
}
}
for (var i = 0; i < this.useralllist.length; i++) {
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].addressUserName = this.goldmedal[i].addressUserName;
this.useralllist[i].phoneNumber = this.goldmedal[i].phoneNumber;
this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount;
this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length
}
console.log(this.useralllist);
console.log(this.obligation)
if(this.userstype==1){
this.useralllist=this.obligation
}else if(this.userstype==2){
this.useralllist=this.pending
}
else if(this.userstype==0){
this.useralllist=this.allmessage
}
else if(this.userstype==3){
this.useralllist=this.receiving
}
},
//订单立即支付
async getwei(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+ //姓名
" " +
item.phoneNumber, //电话
wxPay: "weixin://wxpay/bizpayurl?pr=4RJbokxzz",
};
this.$router.push({
path: "/personal/userpay",
query: {
userPayData:JSON.stringify(userPayData),
},
});
},
usertiaozhuan(item){
this.$router.push({
path: "/myorder/usertion",
query: {
stype: item.status,
orderNumber: item.orderNumber,
},
});
},
async canceldanhao(orderNumber) {
@@ -285,7 +389,6 @@ export default {
},
userpay(item, index) {
console.log(item)
if (item.status == 0) {
this.canceldanhao(item.orderNumber);
}
@@ -307,20 +410,48 @@ export default {
}
},
selectGoods(item, index) {
let list=[]
this.activeIndex = index;
if (index == 1) {
if(item.title=='待付款'){
list=this.obligation
}
if (index == 2) {
else if(item.title=='待收货'){
list=this.receiving
}else if(item.title=='待发货'){
this.useralllist=this.pending
list=this.pending
}
else if(item.title=='全部'){
list=this.alllist
}
console.log(this.useralllist);
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].addressUserName =this.goldmedal[i].addressUserName;
this.useralllist[i].phoneNumber = this.goldmedal[i].phoneNumber;
this.useralllist[i].salesAmount = this.goldmedal[i].salesAmount;
this.useralllist[i].lengthnum=this.goldmedal[i].orderDetailList.length
}
this.useralllist=list
},
userfind(item) {
this.$router.push({
if(item.status==0){
this.getwei(item);
}else{
this.$router.push({
path: "/myorder/usertion",
query: {
stype: item.status,
orderNumber: item.orderNumber,
},
});
}
},
usertwo() {
this.$router.push({