Commit 391066a7 authored by 黄奎's avatar 黄奎

酒店接口调整

parent 9c77d820
<style lang="scss" scoped> <style lang="scss" scoped>
@import url("@/asset/css/flex.css"); @import url("@/asset/css/flex.css");
.AggOrdBox{
.AggOrdBox {
height: 100vh; height: 100vh;
background: url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638772246864278108.jpg')no-repeat #F3F1EF; background: url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638772246864278108.jpg')no-repeat #F3F1EF;
background-size: 100% 240rpx; background-size: 100% 240rpx;
.AggOrdHeader{
.AggOrdHeader {
padding-bottom: 20rpx; padding-bottom: 20rpx;
// background: url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638772246864278108.jpg')no-repeat; // background: url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638772246864278108.jpg')no-repeat;
// background-size: 100% 100%; // background-size: 100% 100%;
} }
.AggOrdStatus{
.AggOrdStatus {
padding-top: 20rpx; padding-top: 20rpx;
.AggOrdT{
.AggOrdT {
width: 25%; width: 25%;
padding: 10rpx 20rpx; padding: 10rpx 20rpx;
font-size: 28rpx; font-size: 28rpx;
color: #080A09; color: #080A09;
position: relative; position: relative;
} }
.AggOrdT.active{
.AggOrdT.active {
color: #B99846; color: #B99846;
font-weight: bold; font-weight: bold;
} }
.AggOrdT text{
.AggOrdT text {
display: block; display: block;
text-align: center; text-align: center;
} }
.AggOrdT view{
.AggOrdT view {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
.AggOrdT view view{
.AggOrdT view view {
width: 60rpx; width: 60rpx;
height: 10rpx; height: 10rpx;
margin: auto; margin: auto;
...@@ -40,106 +48,103 @@ ...@@ -40,106 +48,103 @@
border-radius: 10rpx; border-radius: 10rpx;
} }
} }
} }
/deep/.showModalInfo .u-drawer-bottom{
background-color: rgba(23,23,23,0) !important; /deep/.showModalInfo .u-drawer-bottom {
background-color: rgba(23, 23, 23, 0) !important;
} }
</style> </style>
<template> <template>
<view class="AggOrdBox column"> <view class="AggOrdBox column">
<view class="AggOrdHeader" :style="[titleStyle]"> <view class="AggOrdHeader" :style="[titleStyle]">
<AggOrdHeader :title="pageTitle" <AggOrdHeader :title="pageTitle" @change="getOrderType" :params="msg"></AggOrdHeader>
@change="getOrderType"
:params="msg"></AggOrdHeader>
<view class="AggOrdStatus row items-center"> <view class="AggOrdStatus row items-center">
<template> <template>
<view class="AggOrdT" <view class="AggOrdT" v-for="(item,index) in statusList" :key="index"
v-for="(item,index) in statusList" :class="[msg.OrderStatus==item.ID?'active':'']" @click="getStatus(item.ID)">
:key="index"
:class="[msg.OrderStatus==item.ID?'active':'']"
@click="getStatus(item.ID)">
<text>{{ item.Name }}</text> <text>{{ item.Name }}</text>
</view> </view>
</template> </template>
</view> </view>
</view> </view>
<view class="col" style="height: 1px;flex: 1;overflow: hidden;padding-top: 10rpx;"> <view class="col" style="height: 1px;flex: 1;overflow: hidden;padding-top: 10rpx;">
<scroll-view :scroll-y="true" <scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower"
:enable-back-to-top="true" style="height: 100%;">
:enable-flex="true" <orders :orders="g" @research="research"></orders>
@scrolltolower="lower" style="height: 100%;"> <u-empty v-if="g.length==0" text="暂无数据" mode="data" padding-top="20"></u-empty>
<orders :orders="g" @research="research"></orders> <u-loadmore v-else :status="status" :load-text="loadText" :font-size="24" :margin-top="20"
<u-empty v-if="g.length==0" text="暂无数据" mode="data" padding-top="20"></u-empty> :margin-bottom="20" bg-color="#F3F1EF" />
<u-loadmore v-else :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20" bg-color="#F3F1EF" /> <view style="width: 100%;height: 20rpx;"></view>
<view style="width: 100%;height: 20rpx;"></view>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import {mappingListType,mappingListTypeTy} from "../../utils/producttypeenum"; import {
mappingListType,
mappingListTypeTy
} from "../../utils/producttypeenum";
import EnumHelper from '../../utils/enumhelper'; import EnumHelper from '../../utils/enumhelper';
import OrderStatusEnum from '../../utils/orderStautsEnum'; import OrderStatusEnum from '../../utils/orderStautsEnum';
import AggOrdHeader from "./components/header.vue"; import AggOrdHeader from "./components/header.vue";
import orders from "./components/orders.vue"; import orders from "./components/orders.vue";
export default{ export default {
components: { components: {
AggOrdHeader, AggOrdHeader,
orders, orders,
}, },
data(){ data() {
return{ return {
pageTitle: '所有订单', pageTitle: '所有订单',
msg:{ msg: {
pageSize:10, pageSize: 10,
pageIndex:1, pageIndex: 1,
OrderStatus: 0, OrderStatus: 0,
GoodsName: '', GoodsName: '',
OrderTypeStr: '' OrderTypeStr: ''
}, },
loadText: { loadText: {
loadmore: "轻轻上拉,加载更多", loadmore: "轻轻上拉,加载更多",
loading: "努力加载中", loading: "努力加载中",
nomore: "没有更多了", nomore: "没有更多了",
}, },
status: "loadmore", status: "loadmore",
showModal: false, showModal: false,
barshow:0, barshow: 0,
statusList: [], statusList: [],
g: [], g: [],
page_count: 1, page_count: 1,
index: 0, index: 0,
payindex: 0, payindex: 0,
showAuth: false, showAuth: false,
titleStyle:{}, titleStyle: {},
} }
}, },
onLoad(options){ onLoad(options) {
if(options.OrderTypeStr)this.msg.OrderTypeStr = options.OrderTypeStr if (options.OrderTypeStr) this.msg.OrderTypeStr = options.OrderTypeStr
if(options.OrderStatus)this.msg.OrderStatus = options.OrderStatus if (options.OrderStatus) this.msg.OrderStatus = options.OrderStatus
this.research() this.research()
}, },
created() { created() {
const that = this const that = this
uni.getSystemInfo({ uni.getSystemInfo({
success(res) { success(res) {
that.titleStyle = { that.titleStyle = {
paddingTop: `${res.statusBarHeight}px` paddingTop: `${res.statusBarHeight}px`
}; };
}, },
}); });
this.getOrderEnums() this.getOrderEnums()
},
}, methods: {
methods:{ getStatus(ID) {
getStatus(ID){ this.msg.OrderStatus = ID
this.msg.OrderStatus=ID
this.research() this.research()
}, },
research(status){ research(status) {
if(status)this.msg.OrderStatus = status; if (status) this.msg.OrderStatus = status;
this.msg.pageIndex = 1; this.msg.pageIndex = 1;
this.msg.pageSize = 10; this.msg.pageSize = 10;
this.status = "loadmore"; this.status = "loadmore";
...@@ -147,35 +152,36 @@ ...@@ -147,35 +152,36 @@
this.g = []; this.g = [];
this.init() this.init()
}, },
getOrderType(item){ getOrderType(item) {
this.msg.OrderTypeStr = item.Id this.msg.OrderTypeStr = item.Id
this.pageTitle = item.Name this.pageTitle = item.Name
this.research() this.research()
}, },
init(){ init() {
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}) })
// #ifdef MP-DI // #ifdef MP-DI
this.OrderPageZK(); this.OrderPageZK();
// #endif // #endif
// #ifdef MP-AG // #ifdef MP-AG
this.OrderPageTY(); this.OrderPageTY();
// #endif // #endif
}, },
OrderPageTY(){ OrderPageTY() {
this.apipost('b2b_get_GetB2BAllOrderPageList',this.msg, this.apipost('b2b_get_GetB2BAllOrderPageList', this.msg,
res => { res => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
uni.hideLoading() uni.hideLoading()
res.data.pageData.forEach(x=>{ res.data.pageData.forEach(x => {
// #ifdef MP-DI // #ifdef MP-DI
x.goodTypeEnum = mappingListType(x.goodsType) x.goodTypeEnum = mappingListType(x.goodsType)
// #endif // #endif
// #ifdef MP-AG // #ifdef MP-AG
x.goodTypeEnum = mappingListTypeTy(x.goodsType) x.goodTypeEnum = mappingListTypeTy(x.goodsType)
// #endif // #endif
x.orderStatusInfo = EnumHelper.ParseToEnum(OrderStatusEnum,x.orderStatus,'value') x.orderStatusInfo = EnumHelper.ParseToEnum(OrderStatusEnum, x.orderStatus,
'value')
}) })
this.g = this.g.concat(res.data.pageData); this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount; this.page_count = res.data.pageCount;
...@@ -189,14 +195,15 @@ ...@@ -189,14 +195,15 @@
} }
); );
}, },
OrderPageZK(){ OrderPageZK() {
this.apipost('GetMyDirectOrderPageList_post',this.msg, this.apipost('GetMyDirectOrderPageList_post', this.msg,
res => { res => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
uni.hideLoading() uni.hideLoading()
res.data.pageData.forEach(x=>{ res.data.pageData.forEach(x => {
x.goodTypeEnum = mappingListType(x.goodsType) x.goodTypeEnum = mappingListType(x.goodsType)
x.orderStatusInfo = EnumHelper.ParseToEnum(OrderStatusEnum,x.orderStatus,'value') x.orderStatusInfo = EnumHelper.ParseToEnum(OrderStatusEnum, x.orderStatus,
'value')
}) })
this.g = this.g.concat(res.data.pageData); this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount; this.page_count = res.data.pageCount;
...@@ -210,7 +217,7 @@ ...@@ -210,7 +217,7 @@
} }
); );
}, },
lower(e) { lower(e) {
if (this.msg.pageIndex < this.page_count) { if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++; this.msg.pageIndex++;
this.status = "loading"; this.status = "loading";
...@@ -219,25 +226,27 @@ ...@@ -219,25 +226,27 @@
this.status = "nomore"; this.status = "nomore";
} }
}, },
getOrderEnums() { getOrderEnums() {
this.apipost( this.apipost(
"GetDirectOrderStatusEnum_post", "GetDirectOrderStatusEnum_post", {},
{},
(res) => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
// #ifdef MP-DI // #ifdef MP-DI
this.statusList = res.data.filter(x=>x.ID!=4); this.statusList = res.data.filter(x => x.ID != 4);
// #endif // #endif
// #ifdef MP-AG // #ifdef MP-AG
this.statusList = res.data.filter(x=>x.ID!=5); this.statusList = res.data.filter(x => x.ID != 5);
// #endif // #endif
this.statusList.splice(0,0,{ID:0,Name:'全部'}) this.statusList.splice(0, 0, {
this.statusList.forEach(x=>{ ID: 0,
if(x.Name=='已付款') x.Name = '待出行' Name: '全部'
})
this.statusList.forEach(x => {
if (x.Name == '已付款') x.Name = '待出行'
}) })
} }
}, },
err=>{ err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: "none", icon: "none",
...@@ -245,7 +254,6 @@ ...@@ -245,7 +254,6 @@
} }
); );
}, },
}, },
} }
</script> </script>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
...@@ -300,10 +300,10 @@ ...@@ -300,10 +300,10 @@
} }
if (this.HotelInfo) { if (this.HotelInfo) {
if (this.HotelInfo.images && this.HotelInfo.images.length > 0) { if (this.HotelInfo.images && this.HotelInfo.images.length > 0) {
//pHotel.images = this.HotelInfo.images; pHotel.images.push(this.HotelInfo.images[0].url);
} }
if (this.HotelInfo.address) { if (this.HotelInfo.location&&this.HotelInfo.location.address) {
pHotel.address = this.HotelInfo.address; pHotel.address = this.HotelInfo.location.address;
} }
} }
console.log("hotelRoom", pHotel); console.log("hotelRoom", pHotel);
......
...@@ -350,15 +350,16 @@ ...@@ -350,15 +350,16 @@
}, },
onLoad(options) { onLoad(options) {
this.customer = uni.getStorageSync("b2b_user") this.customer = uni.getStorageSync("b2b_user")
console.log("hotel_order", options);
if (options.searchObj) { if (options.searchObj) {
this.searchObj = JSON.parse(options.searchObj) this.searchObj = JSON.parse(options.searchObj)
} }
if (options.HotelInfo) { if (options.HotelInfo) {
this.HotelInfo = JSON.parse(options.HotelInfo) this.HotelInfo = JSON.parse(options.HotelInfo)
console.log("hotel_order_hotelInfo", this.HotelInfo)
this.orderMsg.hotelId = this.HotelInfo.hotelid; this.orderMsg.hotelId = this.HotelInfo.hotelid;
this.orderMsg.HotelName = this.HotelInfo.name this.orderMsg.HotelName = this.HotelInfo.name;
if (this.HotelInfo.images && this.HotelInfo.images.length > 0) {
this.orderMsg.HotelPic = this.HotelInfo.images[0];
}
} }
if (options.RoomInfo) { if (options.RoomInfo) {
this.RoomInfo = JSON.parse(options.RoomInfo) this.RoomInfo = JSON.parse(options.RoomInfo)
...@@ -370,8 +371,6 @@ ...@@ -370,8 +371,6 @@
this.CreateBy = options.CreateBy this.CreateBy = options.CreateBy
} }
this.orderMsg.ProductId = this.RoomInfo.RoomTypeID; this.orderMsg.ProductId = this.RoomInfo.RoomTypeID;
console.log("hotel_order_this.searchObj", this.searchObj)
console.log("hotel_order_this.RoomInfo", this.RoomInfo)
this.orderMsg.RatePlanID = this.RoomInfo.RatePlanID this.orderMsg.RatePlanID = this.RoomInfo.RatePlanID
this.orderMsg.CheckInDate = this.dayObj.start; this.orderMsg.CheckInDate = this.dayObj.start;
this.orderMsg.CheckOutDate = this.dayObj.end; this.orderMsg.CheckOutDate = this.dayObj.end;
...@@ -428,7 +427,8 @@ ...@@ -428,7 +427,8 @@
Name: this.customer.name, Name: this.customer.name,
ContactNumber: this.orderMsg.guestPhoneNumber, ContactNumber: this.orderMsg.guestPhoneNumber,
Mailbox: this.orderMsg.guestEmail, Mailbox: this.orderMsg.guestEmail,
GoodsId: this.orderMsg.RatePlanID, //GoodsId: this.orderMsg.RatePlanID,
GoodsId: this.HotelInfo.hotelId,
GoodsName: this.HotelInfo.name, GoodsName: this.HotelInfo.name,
GoodsPic: "", GoodsPic: "",
GoodsType: 9, GoodsType: 9,
...@@ -480,7 +480,6 @@ ...@@ -480,7 +480,6 @@
signType: this.orderInfo.signType, signType: this.orderInfo.signType,
paySign: this.orderInfo.sign, paySign: this.orderInfo.sign,
success: function(res) { success: function(res) {
console.log("success", res);
that.submit = false; that.submit = false;
uni.showToast({ uni.showToast({
title: "支付成功", title: "支付成功",
...@@ -495,7 +494,6 @@ ...@@ -495,7 +494,6 @@
}, 100); }, 100);
}, },
fail: function(err) { fail: function(err) {
console.log("fail:", err);
that.submit = true; that.submit = true;
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
...@@ -667,9 +665,6 @@ ...@@ -667,9 +665,6 @@
}, },
changeDown(e) { changeDown(e) {
let i = [e] let i = [e]
// this.customer.count = this.countrys[i].ID
// this.optionsTitle[0] = this.countrys[i].Name
// this.customer.PhoneCountryStr = '+'+this.countrys[i].PhoneCode
}, },
editNum(type) { editNum(type) {
if (type == 1) { if (type == 1) {
...@@ -783,10 +778,9 @@ ...@@ -783,10 +778,9 @@
icon: 'none' icon: 'none'
}) })
uni.redirectTo({ uni.redirectTo({
url: `/pages/AggregateOrders/AggregateOrdersList?OrderTypeStr=3`, url: `/pages/AggregateOrders/AggregateOrdersList?OrderTypeStr=7`,
}); });
// #endif // #endif
console.log(res, '-------酒店erp下单成功')
} }
} }
); );
......
import EnumHelper from "./enumhelper.js" import EnumHelper from "./enumhelper.js"
import ListProductTypeEnum from "./listProductType.js" import ListProductTypeEnum from "./listProductType.js"
const ProductTypeEnum = [ const ProductTypeEnum = [{
{ value: 1,
value: 1, desc: '机票产品'
desc: '机票产品' },
}, /**
/** * 线路
* 线路 */
*/ {
{ value: 2,
value: 2, desc: '线路产品'
desc: '线路产品' },
},
/** /**
* 酒店 * 酒店
*/ */
{ {
value: 3, value: 3,
desc: '酒店产品' desc: '酒店产品'
}, },
/** /**
* 景点门票 * 景点门票
*/ */
{ {
value: 4, value: 4,
desc: '景点门票产品' desc: '景点门票产品'
}, },
/**
* 包车
*/
{
value: 5,
desc: '包车产品'
},
{
value: 6,
desc: '签证产品'
},
/**
* 包车
*/
{
value: 5,
desc: '包车产品'
},
{
value: 6,
desc: '签证产品'
},
{
value: 7,
desc: '酒店产品'
},
] ]
const mappingRules = [ const mappingRules = [
[-1], [-1],
[1, 2, 3], [1, 2, 3],
[4, 5, 6, 7], [4, 5, 6, 7],
[-1], [-1],
[12, 13, 14], [12, 13, 14],
[8, 9, 10, 11], [8, 9, 10, 11],
[15], [15],
[16] [16]
] ]
const mappingListType = (value) => { const mappingListType = (value) => {
let val = mappingRules.findIndex(x => { let val = mappingRules.findIndex(x => {
return x.indexOf(value) != -1 return x.indexOf(value) != -1
}) })
if (val && val > 0) { if (val && val > 0) {
return EnumHelper.ParseToEnum(ListProductTypeEnum, val, 'value') return EnumHelper.ParseToEnum(ListProductTypeEnum, val, 'value')
} }
return {} return {}
} }
const mappingListTypeTy = (type) => { const mappingListTypeTy = (type) => {
let val = ProductTypeEnum.findIndex(x => { let val = ProductTypeEnum.findIndex(x => {
return x.value==Number(type) return x.value == Number(type)
}) })
return ProductTypeEnum[val] return ProductTypeEnum[val]
} }
const transProductEnum = (value) => { const transProductEnum = (value) => {
return mappingRules[value] return mappingRules[value]
} }
export default ProductTypeEnum export default ProductTypeEnum
export { mappingListType, transProductEnum, mappingListTypeTy } export {
\ No newline at end of file mappingListType,
transProductEnum,
mappingListTypeTy
}
\ No newline at end of file
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