Commit c8fec33a authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/zk123/jz_travel into master

parents 7f558cc1 96eabf6f
......@@ -599,8 +599,14 @@
"path":"jz_LineDetail" //九寨-线路详情
},{
"path":"jz_Reserve" //线路-预定
},{
"path":"jz_MyOrder" //线路-我的订单
},{
"path":"jz_SureOrder" //线路-确认订单
},{
"path":"allorderList"//统一订单
},{
"path":"allorderdetails"//统一订单详情
}]
},
//相亲分包
......
......@@ -296,6 +296,16 @@
this.amapPlugin = new amap.AMapWX({
key: this.key
});
if(options && options.obj){
let carMsg = JSON.parse(decodeURIComponent(options.obj))
this.carMsg.StartCityId = carMsg.StartCityId
this.carMsg.StartCityType = carMsg.StartCityType
this.carMsg.ArriveCityId = carMsg.ArriveCityId
this.carMsg.ArriveCityType = carMsg.ArriveCityType
this.carMsg.StartCityName = carMsg.StartCityName
this.carMsg.ArriveCityName = carMsg.ArriveCityName
this.active = 1
}
},
methods: {
godingche(){//跳入订车页面
......
......@@ -61,7 +61,7 @@
}
.zailaiyidan{
width: 75px;
padding: 0 10px;
height: 30px;
background: #111111;
border-radius: 8px;
......@@ -70,7 +70,19 @@
justify-content: center;
font-size: 12px;
color: #FFF;
margin-left: 10px;
}
.zailaiyidan2{
padding: 0 10px;
height: 30px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
color: #111;
margin-left: 10px;
border: 1px solid #111111;
}
}
</style>
......@@ -81,9 +93,9 @@
<view style="height: calc(100vh - 50px); background: #fff;" v-if="g.length == 0">
<u-empty text="暂无相关订单" mode="order"></u-empty>
</view>
<view v-if="g.length > 0" style="height: calc(100vh - 50px);width: calc(100vw);overflow: hidden;padding-bottom: 20px;">
<view v-if="g.length > 0" style="height: calc(100vh - 50px);width: calc(100vw);overflow: hidden;">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" :style="{ height: '100%' }">
<view class="orderList" v-for="(item, index) in g" :key="index">
<view class="orderList" v-for="(item, index) in g" :key="index" @click="godetails(item)">
<view class="orderList-top">
<span style='font-size: 16px;font-weight: 800;'>{{item.OrderTypeName}} <span style='font-size: 12px;font-weight: normal;'>({{item.OrderNo}})</span></span>
<span style='font-size: 12px;'>{{item.OrderStatusName}}</span>
......@@ -92,7 +104,7 @@
<view class="order_center" v-if="item.OrderType == 1">
<view v-for="(x,y) in item.HotelList" :key='y' >
<view class="hotelbox">
<image :src="x.HotelImage" style="width: 50px;height: 50px;border-radius: 8px;margin-right: 10px;"></image>
<image :src="getIconLink(x.HotelImage)" style="width: 50px;height: 50px;border-radius: 8px;margin-right: 10px;"></image>
<view class="hotelbox-r">
<view class="text-t">{{x.HotelName}}</view>
<view>数量:{{x.RoomNumber}}</view>
......@@ -102,6 +114,32 @@
<view class="order_xu"></view>
</view>
</view>
<view class="order_center" v-if="item.OrderType == 2">
<view v-for="(x,y) in item.DiningList" :key='y' >
<view class="hotelbox">
<image :src="getIconLink(x.DiningImg)" style="width: 50px;height: 50px;border-radius: 8px;margin-right: 10px;"></image>
<view class="hotelbox-r">
<view class="text-t">{{x.MealName}}</view>
<view>数量:{{x.PeopleNumber}}</view>
<view>单价:¥{{x.Unit_Price}}</view>
</view>
</view>
<view class="order_xu"></view>
</view>
</view>
<view class="order_center" v-if="item.OrderType == 3">
<view v-for="(x,y) in item.TicketList" :key='y' >
<view class="hotelbox">
<image :src="getIconLink(x.TicketImg)" style="width: 50px;height: 50px;border-radius: 8px;margin-right: 10px;"></image>
<view class="hotelbox-r">
<view class="text-t">{{x.TicketName}}</view>
<view>人数:{{x.PeopleNumber}}</view>
<view>单价:¥{{x.Unit_Price}}</view>
</view>
</view>
<view class="order_xu"></view>
</view>
</view>
<view class="order_center" v-if="item.OrderType == 4">
<view v-for="(x,y) in item.CarList" :key='y' >
<view class="car-o" >
......@@ -130,25 +168,63 @@
应付:¥{{item.PreferPrice}}
</view>
<view style="display: flex;justify-content: flex-end;margin-top: 5px;">
<view class="zailaiyidan">
<view class="zailaiyidan" v-if="item.OrderStatus == 3 || item.OrderStatus == 4 || item.OrderStatus == 5" @click.stop="onemoreorder(item)">
再来一单
</view>
<view class="zailaiyidan2" @click.stop="getCancel(item,index)"
v-if='item.IsApplyForCancel!=1 && (item.OrderStatus==1||item.OrderStatus==2 ||item.OrderStatus==3 ) && getquxiao(item)'>
取消
</view>
<view class="zailaiyidan" v-if="item.OrderStatus == 1" @click.stop="queren(item,index)">
未付款
</view>
</view>
</view>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20" bg-color="#ECF1F4" />
</scroll-view>
</view>
<u-popup v-model="showModal" mode="center" length="80%">
<view style='display: flex;flex-direction: column;align-items: center;background: #fff;'>
<view style="display: flex;align-items: center;justify-content: center;height:70px ;">
<Text>是否取消订单?</Text>
</view>
<view style="display: flex;flex-direction: column;height:80px ;margin-left: 15px;width: 100%;" v-if='item.OrderStatus!=1'>
<Text style='margin-left: 10px;margin-top: 5px;'>备注</Text>
<input class="uni-input inputM" style='margin-left: 10px;margin-top: 5px;' v-model="Cancelmsg.Remark" placeholder="输入备注" />
</view>
<view style="display: flex;flex-direction: row;align-items: center;height: 50px;border-top: 1px solid #F5F5F5;width: 100%;">
<view style="width: 50%;display: flex;align-items: center;justify-content: center" @click="showModal=false">
<Text>取消</Text>
</view>
<view style="width: 50%;color: #2979ff;display: flex;align-items: center;justify-content: center" @click="confirm">
<Text>确定</Text>
</view>
</view>
</view>
</u-popup>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth='goback'></auth>
</view>
</template>
<script>
import auth from "@/components/auth/index.vue";
export default{
components: {
auth,
},
data(){
return{
pageTitle: "我的订单",
showAuth:false,
mainColor: '',
statusList:[],
current:0,
showModal:false,
u:{},
msg:{
pageIndex:1,
pageSize:20,
......@@ -159,6 +235,11 @@
OrderType:0,
OrderStatus:0,
},
Cancelmsg:{
OrderId:0,
Type:0,
Remark:'',
},
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
......@@ -167,6 +248,9 @@
page_count: 1,
status: "loadmore",
g: [],
index:0,
item:{},
payindex:0,//支付的索引
}
},
onLoad(options){
......@@ -185,7 +269,18 @@
this.mainColor = this.$uiConfig.mainColor;
},
created() {
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else {
this.getOrderStatusList()
}
},
methods:{
getOrderStatusList(){//获取订单状态枚举列表
......@@ -198,7 +293,10 @@
this.statusList = res.data
this.statusList.unshift({Name:'全部',Id:0})
}
this.init();
this.init()
},
err => {
}
......@@ -243,6 +341,210 @@
this.status = "nomore";
}
},
getIconLink(url){//https的处理
let str= ''
if (url && url != '') {
if (url.indexOf('https') != -1) {
str = url
} else {
str = url.replace(/^http:\/\//i,'https://');
}
return str;
}
},
getCancel(e,index){//取消订单
this.showModal = true;
this.Cancelmsg.Remark = '',
this.index = index;
this.item = e;
this.Cancelmsg.OrderId = e.OrderId;
this.Cancelmsg.Type = e.OrderStatus;
},
confirm(){//确认取消
let that = this
if (that.Cancelmsg.Type != 1 && that.Cancelmsg.Remark == '') {
uni.showToast({
title: '备注不能为空',
icon: 'none'
})
return
}
uni.requestSubscribeMessage({
tmplIds: [],
complete(res) {
that.request2({
url: '/api/AppletOrder/CancelAppletMyOrder',
data: that.Cancelmsg
},
(res) => {
that.showModal = false;
if(that.msg.OrderStatus==0){//判断在全部列表的时候 改变他的状态
if(that.Cancelmsg.Type==1){
uni.showToast({
title: res.message,
icon: 'none'
})
that.g[index].OrderStatus = 4;
that.g[index].IsApplyForCancel = 1;
}else{
uni.showToast({
title: "取消成功,请等待审核",
position: "bottom",
icon: "none",
duration: 2000,
});
that.g[index].OrderStatus = 5;
that.g[index].IsApplyForCancel = 1;
}
}else{//在待付款的页面时候的操作处理
if (that.Cancelmsg.Type == 1) {
uni.showToast({
title: res.message,
icon: 'none'
})
that.g.splice(that.index, 1);
} else {
uni.showToast({
title: "取消成功,请等待审核",
position: "bottom",
icon: "none",
duration: 2000,
});
// that.msg.pageIndex = 1;
// that.g = [];
// that.init();
this.change(5)
}
}
}
);
}
})
},
getquxiao(item){//判断是否显示取消
let show = true
if(item.OrderType==1){//酒店
show = this.getquxiaoshow(item.HotelList)
}else if(item.OrderType==2){//餐食
show = this.getquxiaoshow(item.DiningList)
}else if(item.OrderType==3){//景点
show = this.getquxiaoshow(item.TicketList)
}else if(item.OrderType==4){//专车
show = this.getquxiaoshow(item.CarList)
}
return show
},
getquxiaoshow(list){
let show = true;
list.map(x=>{
if(new Date() >= new Date(x.Date)){
show = false;
return
}
})
return show
},
godetails(item){//进入详情
uni.navigateTo({
url: '/pages/jiuzhai/allorderdetails?OrderId='+item.OrderId
})
},
queren(data,index){
this.payindex = index
console.log(data,222,index)
let url='/api/WeChatPay/GetDmcPayInfo'
let GoodsName = ''
if(data.OrderType==1){
GoodsName = data.HotelList[0].HotelName
}else if(data.OrderType==2){
GoodsName = data.DiningList[0].MealName
}else if(data.OrderType==3){
GoodsName = data.TicketList[0].TicketName
}else if(data.OrderType==4){
GoodsName = data.CarList[0].DepartAddress+'-'+data.CarList[0].ArriveCityName
}
GoodsName = GoodsName.slice(0, 10)
this.request2({
url: url,
data: {
OrderId:data.OrderId,
GoodsName:GoodsName,
OrderPayType:1,
OpenId:uni.getStorageSync('mall_UserInfo').OpenId,
}
},
res => {
let orderInfo = JSON.parse(res.data);
console.log(orderInfo)
this.Pay(orderInfo)
}
);
},
Pay(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: "支付成功"
})
if(that.msg.OrderStatus==0){
that.g[that.payindex].OrderStatus = 2
}else{
this.change(2)
}
},
fail: function(err) {
console.log('fail:', err);
uni.showToast({
title: "支付失败"
})
}
});
},
onemoreorder(data){//再来一单的处理
if(data.OrderType==1){//酒店
}else if(data.OrderType==2){//餐厅
}else if(data.OrderType==3){//门票
}else if(data.OrderType==4){//车
let obj = {
StartCityId:data.CarList[0].StartCityId,
StartCityType:data.CarList[0].StartCityType,
ArriveCityId:data.CarList[0].ArriveCityId,
ArriveCityType:data.CarList[0].ArriveCityType,
StartCityName:data.CarList[0].StartCityName,
ArriveCityName:data.CarList[0].ArriveCityName,
}
console.log(obj)
uni.navigateTo({
url: '/pages/guidecar/index?obj='+encodeURIComponent(JSON.stringify(obj)),
})
}
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
this.getOrderStatusList();
},
goback() {
uni.navigateBack()
},
}
}
</script>
......
<style lang="scss" scoped>
.allorderdetails{
width: 100%;
height: 100vh;
background: #FFFFFF;
.box-top{
width: 100%;
height: 65px;
background: #FFFFFF;
box-shadow: 0px 1px 8px 0px rgba(76, 76, 76, 0.13);
border-radius: 0px 0px 30px 30px;
padding: 0 20px;
display: flex;
align-items: center;
font-size: 20px;
font-weight: 800;
color: #111111;
image{
width: 27px;height: 27px;margin-right: 10px;
}
}
.box-top2{
width: 100%;
padding:0 20px;
margin-top: 20px;
.box-top2-text{
font-size: 16px;
font-weight: 800;
color: #111111;
line-height: 22px;
}
}
.order_xu{
width: 100%;
height: 14px;
border-bottom: 1px dashed #E6E6E6;
}
.box-center{
width: 100%;
padding: 0 20px;
.hotelbox{
display: flex;
margin-top: 15px;
.hotelbox-r{
width: calc(100vw - 50px - 80px);
font-size: 12px;
.text-t{
width: 100%;
}
}
}
.box-top-car{
width: 100%;
display: flex;
align-items: center;
padding: 0 10px;
justify-content: space-between;
font-size: 16px;
font-weight: 800;
color: #111111;
margin-top: 15px;
.onetext{
// overflow: hidden;white-space: nowrap;text-overflow: ellipsis;
width: calc((100vw - 40px - 40px)/2);
text-align: center;
}
.box-top-c{
width: 113px;
display: flex;
flex-direction: column;
align-items: center;
.box-top-ct{
width: 30px;
height: 21px;
border-radius: 2px;
background: rgba(223, 190, 110, 0.1);
font-size: 12px;
font-family: PingFang SC;
font-weight: 500;
color: #DFBE6E;
text-align: center;
line-height: 21px;
margin-bottom: 4px;
}
}
}
}
.box-c-car{
width: 100%;
border-radius: 8px;
box-shadow: 0px 1px 8px 0px rgba(76, 76, 76, 0.13);
padding: 0 15px;
margin-top: 15px;
.box-c-caritem{
width: 100%;
min-height:40px;
display: flex;
align-items: center;
justify-content: space-between;
.box-c-caritem-l{
font-size: 12px;
color: rgba(8, 9, 14, 0.6);
width: 130rpx;
}
.box-c-caritem-r{
font-size: 14px;
color: #08090E;
font-weight: bold;
width: 1;
flex:1;
text-align: right;
}
.box-c-caritem-r2{
font-size: 14px;
color: #08090E;
font-weight: bold;
}
}
}
.xian{
width: 100%;
height: 1px;
background: rgba(0, 0, 0, 0.1);
}
.btn-box {
display: flex;
flex-direction: row-reverse;
height: 45px;
padding: 5px 20px;
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 2;
border-top: 1px solid #f5f5f5;
background: #fff;
}
}
</style>
<template>
<view class="allorderdetails">
<view class="box-top">
<image v-if="OrderInfo.OrderStatus==1 || OrderInfo.OrderStatus==2" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/orderdfk.png" ></image>
<image v-if="OrderInfo.OrderStatus==4 || OrderInfo.OrderStatus==5" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/orderquxiao.png" ></image>
<image v-if="OrderInfo.OrderStatus==3" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/orderwancheng.png" ></image>
<span>{{OrderInfo.OrderStatusName}}</span>
</view>
<view class="box-top2">
<view style="display: flex;align-items: center;justify-content: space-between;">
<span class='box-top2-text'>{{OrderInfo.OrderTypeName}}</span>
<span class='box-top2-text' style='font-size: 12px;font-weight: normal;'>{{OrderInfo.OrderNo}}</span>
</view>
<view class="order_xu"></view>
</view>
<!-- 酒店 -->
<view class="box-center" v-if="OrderInfo.OrderType == 1">
<view v-for="(x,y) in OrderInfo.HotelList" :key ='y'>
<view class="hotelbox">
<image :src="getIconLink(x.HotelImage)" style="width: 80px;height: 80px;border-radius: 8px;margin-right: 10px;"></image>
<view class="hotelbox-r">
<view class="text-t">{{x.HotelName}}</view>
<view>数量:{{x.RoomNumber}}</view>
<view>单价:¥{{x.Unit_Price}}</view>
</view>
</view>
<view class="box-c-car">
<view class="box-c-caritem" >
<view class="box-c-caritem-l">入店时间</view>
<view class="box-c-caritem-r">{{x.StartDate}}</view>
</view>
<view class="box-c-caritem" >
<view class="box-c-caritem-l">离店时间</view>
<view class="box-c-caritem-r">{{x.EndDate}}</view>
</view>
<view class="box-c-caritem" >
<view class="box-c-caritem-l">到店时间</view>
<view class="box-c-caritem-r">{{x.ArrivalTime}}</view>
</view>
</view>
</view>
</view>
<!-- 餐厅 -->
<view class="box-center" v-if="OrderInfo.OrderType == 2">
<view v-for="(x,y) in OrderInfo.DiningList" :key ='y'>
<view class="hotelbox">
<image :src="getIconLink(x.DiningImg)" style="width: 80px;height: 80px;border-radius: 8px;margin-right: 10px;"></image>
<view class="hotelbox-r">
<view class="text-t">{{x.MealName}}</view>
<view>数量:{{x.PeopleNumber}}</view>
<view>单价:¥{{x.Unit_Price}}</view>
<view>就餐时间:{{x.Date}}</view>
</view>
</view>
</view>
</view>
<!-- 门票 -->
<view class="box-center" v-if="OrderInfo.OrderType == 3">
<view v-for="(x,y) in OrderInfo.TicketList" :key ='y'>
<view class="hotelbox">
<image :src="getIconLink(x.TicketImg)" style="width: 80px;height: 80px;border-radius: 8px;margin-right: 10px;"></image>
<view class="hotelbox-r">
<view class="text-t">{{x.TicketName}}</view>
<view>数量:{{x.PeopleNumber}}</view>
<view>单价:¥{{x.Unit_Price}}</view>
<view>入园时间:{{x.Date}}</view>
</view>
</view>
<view v-if="x.GuestList.length>0" class="box-c-caritem-r" style="text-align: left;font-weight: bold;">携带以下全部证件 直接进园</view>
<view class="box-c-car" v-if="x.GuestList.length>0">
<view class="box-c-caritem" v-for="(n,m) in x.GuestList" :key='m' :style="{'justify-content': 'space-between','border-bottom':x.GuestList.length-1 !=m? '1px solid #E2E2E2':''}">
<view class="box-c-caritem-r2" >{{n.Name}}</view>
<view class="box-c-caritem-r2" >{{n.IdCard.substring(0,5)}}***{{n.IdCard.substring(n.IdCard.length-4,n.IdCard.length)}}</view>
<view class="box-c-caritem-r2" >{{n.Mobile}}</view>
</view>
</view>
</view>
</view>
<!-- 专车 -->
<view class="box-center" v-if="OrderInfo.OrderType == 4">
<view v-for="(x,y) in OrderInfo.CarList" :key ='y'>
<view class="box-top-car">
<div class='onetext'>{{x.StartCityName}}</div>
<view class="box-top-c">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1622098352000_930.png" mode="widthFix" style="width: 30px;height: auto;"></image>
</view>
<div class='onetext'>{{x.ArriveCityName}}</div>
</view>
<view class="box-c-car">
<view class="box-c-caritem">
<view class="box-c-caritem-l">上车地点</view>
<view class="box-c-caritem-r" @click="goopenlocation(x.DepartLonlat)">{{x.DepartAddress}}</view>
</view>
<view class="box-c-caritem">
<view class="box-c-caritem-l">下车地点</view>
<view class="box-c-caritem-r" @click="goopenlocation(x.ArriveLonlat)">{{x.ArriveAddress}}</view>
</view>
<view class="xian"></view>
<view class="box-c-caritem">
<view class="box-c-caritem-l">出行时间</view>
<view class="box-c-caritem-r">{{x.Date}}</view>
</view>
<view class="box-c-caritem" v-if="x.PeopleNumber>0">
<view class="box-c-caritem-l">成人</view>
<view class="box-c-caritem-r">{{x.PeopleNumber}}</view>
</view>
<view class="box-c-caritem" v-if="x.ChildNumber>0">
<view class="box-c-caritem-l">儿童</view>
<view class="box-c-caritem-r">{{x.ChildNumber}}</view>
</view>
<view class="box-c-caritem" >
<view class="box-c-caritem-l">单价</view>
<view class="box-c-caritem-r">{{x.Unit_Price}}</view>
</view>
</view>
</view>
</view>
<view class="box-center">
<view class="box-c-car">
<view class="box-c-caritem" >
<view class="box-c-caritem-l">联系人</view>
<view class="box-c-caritem-r">{{OrderInfo.Consignee}}</view>
</view>
<view class="box-c-caritem" >
<view class="box-c-caritem-l">联系电话</view>
<view class="box-c-caritem-r">{{OrderInfo.Mobile}}</view>
</view>
<view class="box-c-caritem" v-if="OrderInfo.BuyerMessage && OrderInfo.BuyerMessage!=''">
<view class="box-c-caritem-l">留言</view>
<view class="box-c-caritem-r">{{OrderInfo.BuyerMessage}}</view>
</view>
<view class="box-c-caritem" >
<view class="box-c-caritem-l">创建时间</view>
<view class="box-c-caritem-r">{{OrderInfo.CreateDate}}</view>
</view>
<view class="box-c-caritem" >
<view class="box-c-caritem-l">付款方式</view>
<view class="box-c-caritem-r">{{OrderInfo.PaymentWayName}}</view>
</view>
<view class="box-c-caritem" >
<view class="box-c-caritem-l">应收</view>
<view class="box-c-caritem-r">{{OrderInfo.PreferPrice}}</view>
</view>
<view class="box-c-caritem" >
<view class="box-c-caritem-l">实收</view>
<view class="box-c-caritem-r"><span style='color:#F20707'>{{OrderInfo.Income}}</span></view>
</view>
</view>
</view>
<view style='width: 100%;height: 80px;'></view>
<view class="btn-box" >
<view class="item" v-if="OrderInfo.OrderStatus==1 ">
<u-button shape="circle" size="medium" @click.stop="queren(OrderInfo)" :custom-style="customStyle2" >待付款</u-button>
</view>
<view class="item" v-if="OrderInfo.OrderStatus==3|| OrderInfo.OrderStatus==4||OrderInfo.OrderStatus==5">
<u-button shape="circle" size="medium" @click.stop="onemoreorder(OrderInfo)" :custom-style="customStyle2" >再来一单</u-button>
</view>
<view @click.stop="getCancel(OrderInfo)" class="item" v-if="OrderInfo.IsApplyForCancel!=1 && (OrderInfo.OrderStatus==1||OrderInfo.OrderStatus==2 ||OrderInfo.OrderStatus==3)&& getquxiao(OrderInfo)">
<u-button shape="circle" size="medium" :custom-style="customStyle" @click="cancel">取消订单</u-button>
</view>
<view class="item" style="line-height: 34px;font-size: 16px;color: gray;font-weight: 600;" v-if="OrderInfo.OrderStatus == 4">
已取消
</view>
<view class="item" style="line-height: 34px;font-size: 16px;color: gray;font-weight: 600;" v-if="OrderInfo.OrderStatus == 5">
待处理
</view>
</view>
<u-popup v-model="showModal" mode="center" length="80%">
<view style='display: flex;flex-direction: column;align-items: center;background: #fff;'>
<view style="display: flex;align-items: center;justify-content: center;height:70px ;">
<Text>是否取消订单?</Text>
</view>
<view style="display: flex;flex-direction: column;height:80px ;margin-left: 15px;width: 100%;" v-if='OrderInfo.OrderStatus!=1'>
<Text style='margin-left: 10px;margin-top: 5px;'>备注</Text>
<input class="uni-input inputM" style='margin-left: 10px;margin-top: 5px;' v-model="Cancelmsg.Remark" placeholder="输入备注" />
</view>
<view style="display: flex;flex-direction: row;align-items: center;height: 50px;border-top: 1px solid #F5F5F5;width: 100%;">
<view style="width: 50%;display: flex;align-items: center;justify-content: center" @click="showModal=false">
<Text>取消</Text>
</view>
<view style="width: 50%;color: #2979ff;display: flex;align-items: center;justify-content: center" @click="confirm">
<Text>确定</Text>
</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default{
data(){
return{
pageTitle: "我的订单",
mainColor: '',
OrderId:0,
OrderInfo:{},//详情数据
customStyle: {
marginLeft: "20px",
padding: "0 30rpx",
},
customStyle2:{
marginLeft: "20px",
padding: "0 30rpx",
background: '#111111',
color:'#FFF'
},
Cancelmsg:{
OrderId:0,
Type:0,
Remark:'',
},
showModal:false,
}
},
onLoad(options) {
if(options && options.OrderId){
this.OrderId = options.OrderId;
this.getMyOrderInfo()
}
uni.setNavigationBarTitle({
title: this.pageTitle,
});
this.mainColor = this.$uiConfig.mainColor;
},
methods:{
getMyOrderInfo(){
this.request2({
url: '/api/AppletOrder/GetMyDmcOrderInfo',
data: {OrderId:this.OrderId}
},
res => {
if (res.resultCode == 1) {
this.OrderInfo = res.data
}
},
err => {
}
);
},
goopenlocation(x){
uni.openLocation({
latitude: Number(x.split(',')[1]) ,
longitude: Number(x.split(',')[0]),
success: function () {
console.log('success');
},
fail:function(err){
console.log(err)
}
});
},
getIconLink(url){//https的处理
let str= ''
if (url && url != '') {
if (url.indexOf('https') != -1) {
str = url
} else {
str = url.replace(/^http:\/\//i,'https://');
}
return str;
}
},
getquxiao(item){//判断是否显示取消
let show = true
if(item.OrderType==1){//酒店
show = this.getquxiaoshow(item.HotelList)
}else if(item.OrderType==2){//餐食
show = this.getquxiaoshow(item.DiningList)
}else if(item.OrderType==3){//景点
show = this.getquxiaoshow(item.TicketList)
}else if(item.OrderType==4){//专车
show = this.getquxiaoshow(item.CarList)
}
return show
},
getquxiaoshow(list){
let show = true;
list.map(x=>{
if(new Date() >= new Date(x.Date)){
show = false;
return
}
})
return show
},
getCancel(e){//取消订单
this.showModal = true;
this.Cancelmsg.Remark = '',
this.Cancelmsg.OrderId = e.OrderId;
this.Cancelmsg.Type = e.OrderStatus;
},
getCancel(e,index){//取消订单
this.showModal = true;
this.Cancelmsg.Remark = '',
this.index = index;
this.item = e;
this.Cancelmsg.OrderId = e.OrderId;
this.Cancelmsg.Type = e.OrderStatus;
},
queren(data){
let url='/api/WeChatPay/GetDmcPayInfo'
let GoodsName = ''
if(data.OrderType==1){
GoodsName = data.HotelList[0].HotelName
}else if(data.OrderType==2){
GoodsName = data.DiningList[0].MealName
}else if(data.OrderType==3){
GoodsName = data.TicketList[0].TicketName
}else if(data.OrderType==4){
GoodsName = data.CarList[0].DepartAddress+'-'+data.CarList[0].ArriveCityName
}
GoodsName = GoodsName.slice(0, 10)
this.request2({
url: url,
data: {
OrderId:data.OrderId,
GoodsName:GoodsName,
OrderPayType:1,
OpenId:uni.getStorageSync('mall_UserInfo').OpenId,
}
},
res => {
let orderInfo = JSON.parse(res.data);
console.log(orderInfo)
this.Pay(orderInfo)
}
);
},
Pay(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: "支付成功"
})
that.getMyOrderInfo()
},
fail: function(err) {
console.log('fail:', err);
uni.showToast({
title: "支付失败"
})
}
});
},
confirm(){//确认取消
let that = this
if (that.Cancelmsg.Type != 1 && that.Cancelmsg.Remark == '') {
uni.showToast({
title: '备注不能为空',
icon: 'none'
})
return
}
uni.requestSubscribeMessage({
tmplIds: [],
complete(res) {
that.request2({
url: '/api/AppletOrder/CancelAppletMyOrder',
data: that.Cancelmsg
},
(res) => {
that.showModal = false;
that.getMyOrderInfo()
}
);
}
})
},
onemoreorder(data){//再来一单的处理
if(data.OrderType==1){//酒店
}else if(data.OrderType==2){//餐厅
}else if(data.OrderType==3){//门票
}else if(data.OrderType==4){//车
let obj = {
StartCityId:data.CarList[0].StartCityId,
StartCityType:data.CarList[0].StartCityType,
ArriveCityId:data.CarList[0].ArriveCityId,
ArriveCityType:data.CarList[0].ArriveCityType,
StartCityName:data.CarList[0].StartCityName,
ArriveCityName:data.CarList[0].ArriveCityName,
}
console.log(obj)
uni.navigateTo({
url: '/pages/guidecar/index?obj='+encodeURIComponent(JSON.stringify(obj)),
})
}
}
}
}
</script>
......@@ -320,7 +320,7 @@
<div class="jz_LineDetail">
<view class="jz_TopImg">
<swiper indicator-dots :autoplay="false" :interval="1000" style="height:100%;">
<block v-for="(item,cindex) in getCoverImg(dataList.imgCover)" wx:key="cindex">
<block v-for="(item,cindex) in getCoverImg(dataList.imgCover)" :key="cindex">
<swiper-item>
<!--<video @click="startPlay(item)" style="width:100%;height:100%" id="myVideo" v-if="item.type==1" :src="item.pic_url"
:autoplay="false" loop muted show-play-btn :enable-progress-gesture="true"
......@@ -370,7 +370,7 @@
</span>
</view>
<view style="display:flex;overflow-x: auto;">
<view class="jz_StartList" v-for="item in dataList.priceList" @click="getDayInfo(item)">
<view class="jz_StartList" v-for="(item,pindex) in dataList.priceList" @click="getDayInfo(item)" :key="pindex">
<view class="jz_StartTop">{{getMonth(item.startDate)}}{{item.remainNum}}</view>
<view class="jz_StartHoubu">
{{item.isSubstitution==1?'可候补':'不可候补'}}
......@@ -419,20 +419,20 @@
</span>
<view class="jz_TripMain">
<view class="jz_TripLine"></view>
<view v-for="(item,index) in dataList.dayList" wx:key="index">
<view v-for="(item,index) in dataList.dayList" :key="index">
<view class="jz_TripTitle">
<view class="jz_TripLeft">第{{getDays(index+1)}}天</view>
<view class="jz_TripRight"></view>
</view>
<view class="jz_RightInner">
<view v-for="(subItem,SubIndex) in item.dayArray" v-if="subItem.type==7" wx:key="SubIndex">
<view v-for="(subItem,SubIndex) in item.dayArray" v-if="subItem.type==7" :key="SubIndex">
<view class="jz_Place">
<view class="jz_ComDian"></view>
<text>{{subItem.childItem.title}}</text>
</view>
</view>
<template v-for="(subItem,index2) in item.dayArray" v-if="subItem.type==2" wx:key="index2">
<view class="jz_ImgDiv">
<template v-for="(subItem,index2) in item.dayArray" v-if="subItem.type==2">
<view class="jz_ImgDiv" :key="index2">
<img mode="aspectFill" :src="subItem.childItem.imaArray[0].url" alt="">
</view>
<view class="jz_Place" style="align-items: center;">
......@@ -453,16 +453,16 @@
</template>
<view class="jz_Place">温馨提示</view>
<view class="jz_Rermark">
<template v-for="(subItem,sIndex) in item.dayArray" v-if="subItem.type==6" wx:key="sIndex">
{{subItem.childItem.descriptionText}}
<template v-for="(subItem,sIndex) in item.dayArray" v-if="subItem.type==6">
<text :key="sIndex">{{subItem.childItem.descriptionText}}</text>
</template>
</view>
<view class="jz_Place">
<view class="jz_ComDian"></view>
<text class="jz_Canyin">餐饮</text>
<text class="jz_CanInner">
<template v-for="(subItem,sIndex2) in item.dayArray" v-if="subItem.type==4" wx:key="sIndex2">
<text style="margin-right:20px;" v-if="subItem.childItem.useDinnerType=='1'">{{subItem.childItem.dinnerName}}</text>
<template v-for="(subItem,sIndex2) in item.dayArray" v-if="subItem.type==4">
<text style="margin-right:20px;" :key="sIndex2" v-if="subItem.childItem.useDinnerType=='1'">{{subItem.childItem.dinnerName}}</text>
<text style="margin-right:20px;" v-if="subItem.childItem.useDinnerType=='2'">{{subItem.childItem.dinnerName}}</text>
<text v-if="subItem.childItem.useDinnerType=='3'">{{subItem.childItem.dinnerName}}</text>
</template>
......@@ -472,8 +472,8 @@
<view class="jz_ComDian"></view>
<text class="jz_Canyin">酒店</text>
<text class="jz_CanInner">
<template v-for="(subItem,sIndex3) in item.dayArray" v-if="subItem.type==3" wx:key="sIndex3">
<text>{{subItem.childItem.hotelName}}<text v-if="index!=dataList.dayList.length-1" style="margin:0 5px;">/</text></text>
<template v-for="(subItem,sIndex3) in item.dayArray" v-if="subItem.type==3">
<text :key="sIndex3">{{subItem.childItem.hotelName}}<text v-if="index!=dataList.dayList.length-1" style="margin:0 5px;">/</text></text>
</template>
<text v-if="index!=dataList.dayList.length-1">或同级</text>
</text>
......@@ -597,8 +597,14 @@
goReserce(){
let myCurrentInfo = this.dataList.currentPriceInfo;
myCurrentInfo.startCityName = this.dataList.startCityName;
let imgCover = JSON.parse(this.dataList.imgCover);
if(imgCover.length>0){
myCurrentInfo.CoverImg = imgCover[0].Url;
}
let myCurr = JSON.stringify(myCurrentInfo);
console.log(myCurrentInfo,'myCurrentInfo');
uni.navigateTo({
url: "/pages/jiuzhai/jz_Reserve?currentPriceInfo="+JSON.stringify(myCurrentInfo)
url: "/pages/jiuzhai/jz_Reserve?currentPriceInfo="+encodeURIComponent(myCurr)
});
}
},
......
<style>
.jz_MyOrder {
height: 100vh;
background-color: #ECF1F4;
}
/* .jz_MyOrderMain{
background-color: #ECF1F4;
}
*/
.jz_OrderList {
width: 100%;
min-height: 334rpx;
background-color: #fff;
border-radius: 20px;
padding: 30px;
margin-bottom: 15px;
position: relative;
}
.jz_OrderList:first-child {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.jz_OrderTop {
display: flex;
align-items: center;
position: relative;
padding-bottom: 27rpx;
border-bottom: 1px solid #E6E6E6;
}
.jz_Oleft {
color: #111111;
font-size: 32rpx;
font-weight: bold;
width: 70%;
height: 25px;
overflow: hidden;
}
.jz-Oright {
color: #111111;
font-size: 24rpx;
position: absolute;
right: 0;
}
.jz_MyOrder_img {
width: 100rpx;
height: 100rpx;
margin-top: 20px;
border-radius: 20rpx;
overflow: hidden;
}
.jz_MyOrder_img img {
width: 100%;
height: 100%;
}
.jz_XiaDan {
margin-left: 25rpx;
color: #333333;
font-size: 24rpx;
margin-top: 20px;
}
.jz_Zailai {
position: absolute;
right: 40rpx;
bottom: 40rpx;
background-color: #111111;
border-radius: 16px;
width: 150rpx;
height: 60rpx;
text-align: center;
color: #fff;
line-height: 60rpx;
font-size: 24rpx;
}
.isShowAll {
height: auto;
}
</style>
<template>
<view class="jz_MyOrder">
<u-tabs :list="list" :is-scroll="false" :current="current" :active-color="mainColor" @change="change"></u-tabs>
<u-empty v-if="dataList.length==0" text="暂无数据" mode="data"></u-empty>
<template v-else>
<view class="jz_MyOrderMain" style="height: calc(100vh - 44px);overflow: hidden;">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" :style="{ height: '100%' }">
<view class="jz_OrderList" v-for="(item,index) in dataList" :key="index">
<view class="jz_OrderTop">
<view class="jz_Oleft" :class="{'isShowAll':!item.isShowHalf}">
{{item.title}}
</view>
<view style="margin-left:10px;">
<u-icon name="arrow-down" @click="getShow(item)" v-if="item.isShowHalf" color="#2979ff" size="28"></u-icon>
<u-icon name="arrow-up" @click="getShow(item)" v-else color="#2979ff" size="28"></u-icon>
</view>
<view class="jz-Oright">
{{item.orderStateName}}
</view>
</view>
<view style="display:flex;">
<view class="jz_MyOrder_img">
<img mode='aspectFill' :src="getFirstImg(item.imgCover)" alt="" />
</view>
<view class="jz_XiaDan">
<view>下单时间:{{item.createDate}}</view>
<view style="margin-top:22rpx;">付款总额:¥{{item.preferPrice}}</view>
</view>
</view>
<view class="jz_Zailai" @click="gojz_List">再来一单</view>
</view>
</scroll-view>
</view>
</template>
</view>
</template>
<script>
export default {
components: {
},
data() {
return {
pageTitle: '我的订单',
msg: {
pageIndex: 1,
pageSize: 15,
MiniAppUserId: 0
},
mainColor: "",
list: [{
name: '全部'
}, {
name: '待付款'
}, {
name: '未使用'
}],
current: 0,
dataList: [],
page_count: 0,
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
status: "加载中",
};
},
created() {
this.getOrderInfo();
},
onLoad(option) {
this.mainColor = this.$uiConfig.mainColor;
},
methods: {
change(val) {
},
//获取第一张图
getFirstImg(obj) {
if (obj) {
let objArr = JSON.parse(obj);
return objArr[0].Url;
}
},
getShow(item) {
item.isShowHalf = !item.isShowHalf;
this.$forceUpdate();
},
//跳转
gojz_List() {
uni.navigateTo({
url: "/pages/jiuzhai/jz_Line"
});
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.getOrderInfo();
} else {
this.status = "nomore";
}
},
getOrderInfo() {
this.userInfo = uni.getStorageSync('mall_UserInfo');
this.msg.MiniAppUserId = this.userInfo.UserId
this.apipost("sellorder_post_GetMiniAppTravelOrderList", this.msg,
res => {
if (res.resultCode == 1) {
console.log(res, '数据');
this.dataList = this.dataList.concat(res.data.pageData);
this.dataList.forEach(x => {
x.isShowHalf = true;
})
this.page_count = res.data.pageCount;
} else {
}
},
null
);
}
}
};
</script>
......@@ -68,8 +68,8 @@
z-index: 999;
}
.jz_OrderNow {
width: 190rpx;
.jz_OrderReNow {
width: 150rpx;
height: 80rpx;
background-color: #111111;
text-align: center;
......@@ -96,29 +96,29 @@
<view class="jz_ReseOrder">
<view class="jz_ReDix">
<view class="jz_RedixTitle">成人:</view>
<u-number-box v-model="orderMsg.crCount" :input-width="300" :input-height="60"></u-number-box>
<u-number-box v-model="orderMsg.ManNum" :input-width="300" :input-height="60" @change="changeMan()"></u-number-box>
</view>
<view class="jz_ReDix">
<view class="jz_RedixTitle">儿童不占床:</view>
<u-number-box v-model="orderMsg.etbzcCount" :input-width="300" :input-height="60"></u-number-box>
<u-number-box v-model="orderMsg.ChirdNoBedNum" :input-width="300" :input-height="60" @change="changeChirdNoBedNum()"></u-number-box>
</view>
<view class="jz_ReDix">
<view class="jz_RedixTitle">儿童占床:</view>
<u-number-box v-model="orderMsg.etzc" :input-width="300" :input-height="60"></u-number-box>
<u-number-box v-model="orderMsg.ChirdNeedBedNum" :input-width="300" :input-height="60" @change="changeChirdNeedBedNum()"></u-number-box>
</view>
<view class="jz_ReDix">
<view class="jz_RedixTitle">婴儿:</view>
<u-number-box v-model="orderMsg.yeCount" :input-width="300" :input-height="60"></u-number-box>
<u-number-box v-model="orderMsg.BabyNum" :input-width="300" :input-height="60" @change="changeBabyNum()"></u-number-box>
</view>
</view>
<view class="jz_OrderDiv">
<view style="color:#FF3166;font-weight:bold;">
<text style="font-size:22rpx;">¥</text>
<text style="font-size:40rpx;margin:0 20rpx 0 5rpx;">{{price}}</text>
<text style="color:#6E6E6E;font-size:24rpx;">共计2</text>
<text style="color:#6E6E6E;font-size:24rpx;">共计{{total}}</text>
</view>
<view style="display:flex;margin-top:-2px;">
<view class="jz_OrderNow" @click="goPay()">去支付</view>
<view class="jz_OrderReNow" @click="goPay()">下单</view>
</view>
</view>
</view>
......@@ -133,66 +133,138 @@
return {
pageTitle: '订单填写',
orderMsg: {
crCount: 0, //成人
etbzcCount: 0, //儿童不占床
etzc: 0, //儿童占床
yeCount: 0, //婴儿
etCount:0
ManNum: 0, //成人
ChirdNoBedNum: 0, //儿童不占床
ChirdNeedBedNum: 0, //儿童占床
BabyNum: 0, //婴儿
ChirdNum: 0, //儿童数量
},
currentPriceInfo: {}
price: 0,
currentPriceInfo: {},
total: 0,
YSeatNum:0,
ESeatNum: 0,
FSeatNum: 0,
sumSeat:0,
userInfo:{}
};
},
created() {
},
created() {},
onLoad(option) {
if (option.currentPriceInfo) {
this.currentPriceInfo = JSON.parse(option.currentPriceInfo)
this.currentPriceInfo = JSON.parse(decodeURIComponent(option.currentPriceInfo))
}
},
watch: {
orderMsg: {
handler(n, o) {
this.calcMoney()
methods: {
//改变成人
changeMan(e) {
this.orderMsg.ManNum = e.value;
this.calcMoney();
},
deep: true,
price:0
//改变儿童不占床
changeChirdNoBedNum(e) {
this.orderMsg.ChirdNoBedNum = e.value;
this.calcMoney();
},
//改变儿童占床
changeChirdNeedBedNum(e) {
this.orderMsg.ChirdNeedBedNum = e.value;
this.calcMoney();
},
methods: {
changeChenRen() {
//改变婴儿
changeBabyNum(e) {
this.orderMsg.BabyNum = e.value;
this.calcMoney();
},
//计算价格
calcMoney() {
console.log('进入');
this.orderMsg.etCount = this.orderMsg.etbzcCount + this.orderMsg.etzc;
console.log("orderMsg", this.orderMsg)
var price = this.currentPriceInfo.b2BMemberPrice;
this.orderMsg.ChirdNum = parseInt(this.orderMsg.ChirdNoBedNum) + parseInt(this.orderMsg.ChirdNeedBedNum);
//计算总人数
this.total = parseInt(this.orderMsg.ManNum) + parseInt(this.orderMsg.ChirdNum);
this.sumSeat = this.total;
let money = this.currentPriceInfo.b2BMemberPrice * this.orderMsg.crCount
money += this.currentPriceInfo.b2BMemberPrice * this.orderMsg.etCount
money += this.currentPriceInfo.babyChargePrice * this.orderMsg.etCount
money += this.currentPriceInfo.childNeedPrice * this.chosenObj.etzc
if (this.chosenObj.etbzcCount > 0)
money -= this.currentPriceInfo.childNoNeedPrice * this.chosenObj.etbzcCount
money += this.currentPriceInfo.babyPrice * this.chosenObj.yeCount
let sumCount = this.chosenObj.crCount + this.chosenObj.etCount
money += this.currentPriceInfo.visaPrice * sumCount
money += this.currentPriceInfo.otherPrice * sumCount
if (this.currentPriceInfo.discountPric && this.currentPriceInfo.discountPric > 0) {
this.zaoniao = this.currentPriceInfo.discountPrice * sumCount
let money = price * this.orderMsg.ManNum
money += price * this.orderMsg.ChirdNum
money += this.currentPriceInfo.babyChargePrice * this.orderMsg.ChirdNeedBedNum
money += this.currentPriceInfo.babyPrice * this.orderMsg.BabyNum
money += this.currentPriceInfo.childNeedPrice * this.orderMsg.ChirdNeedBedNum
if (this.orderMsg.ChirdNoBedNum > 0) {
money -= this.currentPriceInfo.childNoNeedPrice * this.orderMsg.ChirdNoBedNum
}
money -= this.zaoniao
this.price = money
},
//去支付
goPay() {
this.userInfo = uni.getStorageSync('mall_UserInfo');
let msg = {
OrderId: 0,
TCID: this.currentPriceInfo.tcid,
CustomerType: 1,
GroupType: 1,
ContactName: '陕西中旅南二环分公司',
ContactMobile: '18602977416',
CustomerId: '49',
DepartureCityId: 262,
IsIntermodal: 2,
Unit_Price: this.currentPriceInfo.b2BMemberPrice,
TC_Price: this.currentPriceInfo.b2BMemberPrice,
ManNum: this.orderMsg.ManNum,
ChirdNum: this.orderMsg.ChirdNum,
ChirdNeedBedNum: this.orderMsg.ChirdNeedBedNum,
BabyNum: this.orderMsg.BabyNum,
OldPeopleNum: 0,
SingleRoomNum: 0,
PreferPrice: this.price,
YSeatNum: this.total,
ESeatNum: 0,
FSeatNum: 0,
Commission: 0, //todo 提成
ClientSource: 2,
BrandId: 0,
TradeWay: 0,
PlatformOrder: '',
GuestNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum,
IsChildrenTour: this.currentPriceInfo.isSupportChildren,
IsBirdDiscount: this.zaoniao > 0 ? 1 : 2,
PredictRoomNum: 1,
BigRoomNum: 0,
TripleRoomNum: 0,
TradeDate: this.currentPriceInfo.startDate,
CostType: 0,
MinOrderPrice: 0,
Remarks: '',
VisaNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum,
SafeNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum,
AirticketNum: 0,
ReturnArriveCityId: 262,
IsReturnIntermodal: 2,
GoCityTime: '',
BackCityTime: '',
ScenicRefundArr: [],
CommissionSharePeople: 0,
CommissionShareMoney: 0,
OrderSource: 2,
MiniAppUserId:this.userInfo.UserId
}
this.apipost("sellorder_post_SetOrderInfoForB2B", msg,
res => {
if (res.resultCode == 1) {
let data = res.data;
data.CoverImg = this.currentPriceInfo.CoverImg;
let myData = JSON.stringify(data);
uni.navigateTo({
url: "/pages/jiuzhai/jz_SureOrder?orderData="+encodeURIComponent(myData)
});
} else {
}
},
null
);
}
}
};
......
<style>
.jz_SureOrder{
position: relative;
}
.jz_SureTop{
width: 100%;
box-shadow: 0px 2px 15px 0px rgba(76, 76, 76, 0.13);
background-color: #fff;
border-bottom-left-radius: 60rpx;
border-bottom-right-radius: 60rpx;
padding: 40rpx;
}
.jz_SureDfk{
color:#111111;
font-size:40rpx;
font-weight: bold;
margin-left:26rpx;
}
.jz_SureContent{
width:90%;
margin:auto;
min-height: 100px;
}
.jz_SureCommodity{
padding:30rpx 0;
display: flex;
border-bottom:1px solid #E6E6E6;
}
.jzSureMoney{
color:#333333;
font-weight: bold;
font-size:20rpx;
}
.jz_SuOrder_img{
width: 100rpx;
height: 100rpx;
border-radius: 20rpx;
overflow: hidden;
flex-shrink: 0;
}
.jz_SuOrder_img img{
width:100%;
height:100%;
}
.jz_OrderNum{
color:#8F8F90;
font-size:24rpx;
margin-right:50rpx;
}
.jz_GoodName{
color:#333333;
font-size:28rpx;
width:70%;
margin-left:15px;
font-weight:bold;
}
.jz_OrderBold{
color:#08090E;
font-weight:bold;
}
.jz_PayDiv{
position: absolute;
width:90%;
margin:auto;
bottom:30rpx;
display:flex;
justify-content: space-between;
}
.jz_CancleBtn{
width:310rpx;
height:80rpx;
border:1px solid #111111;
border-radius: 16rpx;
color:#111111;
font-weight: bold;
text-align: center;
line-height: 80rpx;
font-size: 28rpx;
}
</style>
<template>
<view class="jz_SureOrder" style="height:100vh;">
<view class="jz_SureTop">
<view style="display:flex;align-items: center;">
<img style="width:53rpx;height:53rpx;" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/dfk.png" alt="" />
<text class="jz_SureDfk">待付款</text>
</view>
</view>
<view class="jz_SureContent">
<view class="jz_SureCommodity">
<view class="jz_SuOrder_img">
<img mode="aspectFill" :src="orderData.CoverImg" alt="" />
</view>
<view style="display:flex;justify-content: space-between;">
<view class="jz_GoodName">
{{orderData.GoodsName}}
</view>
<view class="jzSureMoney">
<text style="font-size:20rpx;margin-right:10rpx;">¥</text>
<text style="font-size:28rpx;">{{orderData.PreferPrice}}</text>
</view>
</view>
</view>
<view class="jz_SureCommodity">
<view class="jz_OrderNum">订单编号</view>
<view class="jz_OrderBold">{{orderData.OrderNo}}</view>
</view>
<view class="jz_SureCommodity">
<view class="jz_OrderNum">下单时间</view>
<view class="jz_OrderBold">{{orderData.CreateDate}}</view>
</view>
<view class="jz_SureCommodity">
<view class="jz_OrderNum">支付方式</view>
<view class="jz_OrderBold"></view>
</view>
<view class="jz_SureCommodity" style="justify-content: space-between;">
<view class="jz_OrderNum">商品总额</view>
<view><text style="margin-right:10rpx;">¥</text>{{orderData.PreferPrice}}</view>
</view>
<view class="jz_SureCommodity" style="justify-content: flex-end;">
<view style="color:#08090E;font-size:28rpx;">实付款:</view>
<view style="color:#F20707;font-weight: bold;">
<text style="font-size:22rpx;margin-right:10rpx;">¥</text>
<text style="font-size:28rpx;">{{orderData.PreferPrice}}</text>
</view>
</view>
<view class="jz_PayDiv">
<view class="jz_CancleBtn">取消</view>
<view class="jz_CancleBtn" @click="goZhifu()" style="background-color: #111111;color:#fff;">去付款</view>
</view>
</view>
</view>
</template>
<script>
</script>
<script>
export default {
components: {
},
data() {
return {
pageTitle: '订单详情',
msg:{
pageIndex:1,
pageSize:15,
MiniAppUserId:0
},
orderData:{}
};
},
created() {
},
onLoad(option) {
if(option.orderData){
this.orderData= JSON.parse(decodeURIComponent(option.orderData))
}
console.log(this.orderData,'this.orderData');
},
methods: {
//支付
goZhifu(){
let url='/api/WeChatPay/GetTravlePayInfo'
let GoodsName = this.orderData.GoodsName;
GoodsName = GoodsName.slice(0, 10)
this.request2({
url: url,
data: {
OrderId:this.orderData.OrderId,
GoodsName:GoodsName,
OrderPayType:1,
OpenId:uni.getStorageSync('mall_UserInfo').OpenId,
}
},
res => {
let orderInfo = JSON.parse(res.data);
console.log(orderInfo)
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
},
fail: function(err) {
console.log('fail:', err);
uni.showToast({
title: "支付失败"
})
}
});
}
}
};
</script>
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