Commit 4a08ee85 authored by zhengke's avatar zhengke

修改

parent b1a97027
......@@ -65,9 +65,6 @@
}
.jz_Zailai {
position: absolute;
right: 40rpx;
bottom: 20rpx;
background-color: #111111;
border-radius: 16px;
width: 150rpx;
......@@ -81,6 +78,13 @@
.isShowAll {
height: auto;
}
.jz_BtnContent{
margin-top:15px;
right:40rpx;
bottom:20rpx;
display:flex;
justify-content: flex-end;
}
</style>
<template>
<view class="jz_MyOrder">
......@@ -99,7 +103,7 @@
<u-icon name="arrow-up" @click="getShow(item)" v-else color="#2979ff" size="28"></u-icon>
</view>
<view class="jz-Oright">
{{item.orderStateName}}
{{item.orderStateName=='占位'?'待付款':item.orderStateName}}
</view>
</view>
<view style="display:flex;">
......@@ -111,8 +115,12 @@
<view style="margin-top:22rpx;">付款总额:¥{{item.preferPrice}}</view>
</view>
</view>
<view class="jz_Zailai" style="right:90px;" @click="gojz_List">再来一单</view>
<view class="jz_Zailai" style="width:60px;" @click="goCancel(item)">取消</view>
<view v-if="item.isApplyForCancel==1" style="color:red;font-size:24rpx;margin-left:122rpx;">订单取消,正在确认中!</view>
<view class="jz_BtnContent">
<view class="jz_Zailai" style="margin-right:10rpx;" @click="gojz_List">再来一单</view>
<view v-if="item.orderState==2" class="jz_Zailai" style="width:110rpx;margin-right:10rpx;" @click="goZhifu(item)">付款</view>
<view v-if="item.isApplyForCancel!=1" class="jz_Zailai" style="width:110rpx;" @click="goCancel(item)">取消</view>
</view>
</view>
</scroll-view>
</view>
......@@ -141,8 +149,11 @@
name: '待付款',
Id:2
}, {
name: '已付款',
name: '已完成',
Id:1
},{
name: '已取消',
Id:4
}],
current: 0,
dataList: [],
......@@ -153,6 +164,7 @@
nomore: "没有更多了",
},
status: "加载中",
price:0
};
},
created() {
......@@ -201,6 +213,10 @@
this.getOrderInfo(1);
},
getOrderInfo(type) {
uni.showLoading({
title:'加载中',
icon:'none'
})
if(type==1){
this.dataList=[];
}
......@@ -208,6 +224,7 @@
this.msg.MiniAppUserId = this.userInfo.UserId
this.apipost("sellorder_post_GetMiniAppTravelOrderList", this.msg,
res => {
uni.hideLoading();
if (res.resultCode == 1) {
console.log(res, '数据');
if(type==1){
......@@ -258,7 +275,6 @@
this.apipost("sellorder_post_AppletUserCancelOrder", msg ,
res => {
if (res.resultCode == 1) {
console.log(res, '数据');
uni.showToast({
title: '操作成功',
icon: 'success',
......@@ -272,6 +288,55 @@
null
);
}
},
//付款
goZhifu(item){
console.log(item,'item');
let url='/api/WeChatPay/GetTravlePayInfo'
let GoodsName = item.title;
GoodsName = GoodsName.slice(0, 10);
this.price = item.preferPrice;
this.request2({
url: url,
data: {
OrderId:item.orderId,
GoodsName:GoodsName,
OrderPayType:1,
OpenId:uni.getStorageSync('mall_UserInfo').OpenId,
}
},
res => {
let orderInfo = JSON.parse(res.data);
this.goPay(orderInfo)
}
);
},
goPay(orderInfo){
let that=this;
uni.requestPayment({
provider: 'wxpay',
timeStamp: orderInfo.timeStamp,
nonceStr: orderInfo.nonceStr,
package: orderInfo.package,
signType: orderInfo.signType,
paySign: orderInfo.sign,
success: function(res) {
console.log('success', res);
uni.showToast({
title: "支付成功"
})
//todo
uni.redirectTo({
url: '/pages/jiuzhai/paysuccess?PreferPrice='+that.price+'&isFrom=1'
});
},
fail: function(err) {
console.log('fail:', err);
uni.showToast({
title: "支付失败"
})
}
});
}
}
......
......@@ -199,13 +199,18 @@
title: "支付成功"
})
//todo
uni.redirectTo({
url: '/pages/jiuzhai/paysuccess?PreferPrice='+that.orderData.PreferPrice+'&isFrom=1'
});
},
fail: function(err) {
console.log('fail:', err);
uni.showToast({
title: "支付失败"
})
uni.redirectTo({
url: '/pages/jiuzhai/jz_MyOrder'
});
}
});
}
......
......@@ -38,6 +38,7 @@
showCoupons: false,
couponMessage: '',
PreferPrice:'',
isLineOrder:false
};
},
onLoad(option) {
......@@ -50,14 +51,22 @@
this.mainColor = this.$uiConfig.mainColor;
this.themCustomStyle.color = this.mainColor;
this.themCustomStyle.borderColor = this.mainColor;
if(option.isFrom==1){
this.isLineOrder=true
}
},
methods: {
redictToOrders() {
uni.redirectTo({
url: '/pages/jiuzhai/allorderList'
});
if(!this.isLineOrder){
uni.redirectTo({
url: '/pages/jiuzhai/allorderList'
});
}else{
uni.redirectTo({
url: '/pages/jiuzhai/jz_MyOrder'
});
}
},
goHome() {
uni.reLaunch({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment