Commit 4a08ee85 authored by zhengke's avatar zhengke

修改

parent b1a97027
...@@ -65,9 +65,6 @@ ...@@ -65,9 +65,6 @@
} }
.jz_Zailai { .jz_Zailai {
position: absolute;
right: 40rpx;
bottom: 20rpx;
background-color: #111111; background-color: #111111;
border-radius: 16px; border-radius: 16px;
width: 150rpx; width: 150rpx;
...@@ -81,6 +78,13 @@ ...@@ -81,6 +78,13 @@
.isShowAll { .isShowAll {
height: auto; height: auto;
} }
.jz_BtnContent{
margin-top:15px;
right:40rpx;
bottom:20rpx;
display:flex;
justify-content: flex-end;
}
</style> </style>
<template> <template>
<view class="jz_MyOrder"> <view class="jz_MyOrder">
...@@ -99,7 +103,7 @@ ...@@ -99,7 +103,7 @@
<u-icon name="arrow-up" @click="getShow(item)" v-else color="#2979ff" size="28"></u-icon> <u-icon name="arrow-up" @click="getShow(item)" v-else color="#2979ff" size="28"></u-icon>
</view> </view>
<view class="jz-Oright"> <view class="jz-Oright">
{{item.orderStateName}} {{item.orderStateName=='占位'?'待付款':item.orderStateName}}
</view> </view>
</view> </view>
<view style="display:flex;"> <view style="display:flex;">
...@@ -111,8 +115,12 @@ ...@@ -111,8 +115,12 @@
<view style="margin-top:22rpx;">付款总额:¥{{item.preferPrice}}</view> <view style="margin-top:22rpx;">付款总额:¥{{item.preferPrice}}</view>
</view> </view>
</view> </view>
<view class="jz_Zailai" style="right:90px;" @click="gojz_List">再来一单</view> <view v-if="item.isApplyForCancel==1" style="color:red;font-size:24rpx;margin-left:122rpx;">订单取消,正在确认中!</view>
<view class="jz_Zailai" style="width:60px;" @click="goCancel(item)">取消</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> </view>
</scroll-view> </scroll-view>
</view> </view>
...@@ -141,8 +149,11 @@ ...@@ -141,8 +149,11 @@
name: '待付款', name: '待付款',
Id:2 Id:2
}, { }, {
name: '已付款', name: '已完成',
Id:1 Id:1
},{
name: '已取消',
Id:4
}], }],
current: 0, current: 0,
dataList: [], dataList: [],
...@@ -153,6 +164,7 @@ ...@@ -153,6 +164,7 @@
nomore: "没有更多了", nomore: "没有更多了",
}, },
status: "加载中", status: "加载中",
price:0
}; };
}, },
created() { created() {
...@@ -201,6 +213,10 @@ ...@@ -201,6 +213,10 @@
this.getOrderInfo(1); this.getOrderInfo(1);
}, },
getOrderInfo(type) { getOrderInfo(type) {
uni.showLoading({
title:'加载中',
icon:'none'
})
if(type==1){ if(type==1){
this.dataList=[]; this.dataList=[];
} }
...@@ -208,6 +224,7 @@ ...@@ -208,6 +224,7 @@
this.msg.MiniAppUserId = this.userInfo.UserId this.msg.MiniAppUserId = this.userInfo.UserId
this.apipost("sellorder_post_GetMiniAppTravelOrderList", this.msg, this.apipost("sellorder_post_GetMiniAppTravelOrderList", this.msg,
res => { res => {
uni.hideLoading();
if (res.resultCode == 1) { if (res.resultCode == 1) {
console.log(res, '数据'); console.log(res, '数据');
if(type==1){ if(type==1){
...@@ -258,7 +275,6 @@ ...@@ -258,7 +275,6 @@
this.apipost("sellorder_post_AppletUserCancelOrder", msg , this.apipost("sellorder_post_AppletUserCancelOrder", msg ,
res => { res => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
console.log(res, '数据');
uni.showToast({ uni.showToast({
title: '操作成功', title: '操作成功',
icon: 'success', icon: 'success',
...@@ -272,6 +288,55 @@ ...@@ -272,6 +288,55 @@
null 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 @@ ...@@ -199,13 +199,18 @@
title: "支付成功" title: "支付成功"
}) })
//todo //todo
uni.redirectTo({
url: '/pages/jiuzhai/paysuccess?PreferPrice='+that.orderData.PreferPrice+'&isFrom=1'
});
}, },
fail: function(err) { fail: function(err) {
console.log('fail:', err); console.log('fail:', err);
uni.showToast({ uni.showToast({
title: "支付失败" title: "支付失败"
}) })
uni.redirectTo({
url: '/pages/jiuzhai/jz_MyOrder'
});
} }
}); });
} }
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
showCoupons: false, showCoupons: false,
couponMessage: '', couponMessage: '',
PreferPrice:'', PreferPrice:'',
isLineOrder:false
}; };
}, },
onLoad(option) { onLoad(option) {
...@@ -50,14 +51,22 @@ ...@@ -50,14 +51,22 @@
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.themCustomStyle.color = this.mainColor; this.themCustomStyle.color = this.mainColor;
this.themCustomStyle.borderColor = this.mainColor; this.themCustomStyle.borderColor = this.mainColor;
if(option.isFrom==1){
this.isLineOrder=true
}
}, },
methods: { methods: {
redictToOrders() { redictToOrders() {
uni.redirectTo({ if(!this.isLineOrder){
url: '/pages/jiuzhai/allorderList' uni.redirectTo({
}); url: '/pages/jiuzhai/allorderList'
});
}else{
uni.redirectTo({
url: '/pages/jiuzhai/jz_MyOrder'
});
}
}, },
goHome() { goHome() {
uni.reLaunch({ 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