Commit 9bf70ab9 authored by 罗超's avatar 罗超

优化线路行程的库存判断

parent b7388037
......@@ -65,7 +65,7 @@
<view class="select-style" v-if="line == end[0] && index == end[1]">最晚</view> -->
<view style="font-size:12px;padding-bottom: 3px;" v-if="priceStauts.length > 0">
<view v-if="priceStauts[line][index]>0">{{ priceStauts[line][index] }}</view>
<view v-if="priceStauts[line][index] <0">无房</view>
<view v-if="priceStauts[line][index] <0">售罄</view>
</view>
</view>
</view>
......@@ -258,7 +258,11 @@
let d=(j+1)>9?(j+1):"0"+(j+1)
if(x.startDate==`${year}-${m}-${d}`){
isexsit=true
if(x.remainNum>0){
days.push(this.$utils.getretailer()? x.b2BPrice:x.b2CPrice)
}else{
days.push(-1)
}
}
})
if(!isexsit){
......@@ -364,6 +368,11 @@
title: '抱歉,此日期没有行程哦',
icon: 'none'
});
}else if(this.priceStauts[line][index]==-1){
uni.showToast({
title: '改团期已售罄',
icon: 'none'
});
}else{
this.start=[line,index]
}
......
......@@ -65,7 +65,7 @@
<view class="select-style" v-if="line == end[0] && index == end[1]">最晚</view>
<view style="font-size:12px;padding-bottom: 3px;" v-if="priceStauts.length > 0">
<view v-if="priceStauts[line][index]>0">{{ priceStauts[line][index] }}</view>
<view v-if="priceStauts[line][index] <0">无房</view>
<view v-if="priceStauts[line][index]<0">售罄</view>
</view>
</view>
</view>
......
......@@ -77,11 +77,14 @@
<template v-for="(item,pindex) in dataList.priceList">
<view class="jz_StartList" v-if="pindex<3" :class="{'active':delMsg.tcid==item.tcid}" @click="getDayInfo(item)" :key="pindex">
<view class="jz_StartTop">{{getMonth(item.startDate)}} </view>
<view class="jz_StartHoubu">
<view class="jz_StartHoubu" v-if="item.remainNum>0">
<text></text>
<text style="font-size: 28rpx;font-weight: 600;">{{item.remainNum}}</text>
</view>
<view style="color:#FF3166;font-size:26rpx;">{{$utils.getretailer()==true? item.b2BPrice:item.b2CPrice}}</view>
<view v-if="item.remainNum>0" style="color:#FF3166;font-size:26rpx;">{{$utils.getretailer()==true? item.b2BPrice:item.b2CPrice}}</view>
<view v-if="item.remainNum==0" style="padding: 20rpx 0;">
<text style="font-size: 32rpx;font-weight: 600;">已售罄</text>
</view>
</view>
</template>
<view class="jz_StartList" v-if="dataList.priceList.length>3" :class="{'active':delMsg.tcid==customerDate.tcid}" @click="openDate">
......@@ -311,7 +314,7 @@
<img style="width:36rpx;height:38rpx;" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/kefu.png" alt="" />
<view style="color:#111111;font-size: 22rpx;">客服</view>
</button>
<view class="jz_OrderNow" @click="showOrderPreviwe=true">立即预定</view>
<view class="jz_OrderNow" @click="openOrderPreview" :class="{'disable':finishFirstLoad&&!canCreateOrder}">{{(finishFirstLoad&&!canCreateOrder)?'已售罄':'立即预定'}}</view>
</view>
</view>
</view>
......@@ -327,17 +330,17 @@
<view class="line-flex" style="padding:30rpx;background: #FFF;">
<text style="font-size: 28rpx;color:#111;font-weight: 500;">成人</text>
<text style="font-size:22rpx;color:#999;margin-left: 30rpx;flex:1;">18周岁以上</text>
<u-number-box size="28" :min="1" :max="currentPrice.totalSeat-etCount-etbCount" @change="crChange" v-model="crCount"></u-number-box>
<u-number-box size="28" :min="1" :max="currentPrice.remainNum-etCount-etbCount" @change="crChange" v-model="crCount"></u-number-box>
</view>
<view class="line-flex" style="padding:30rpx;background: #FFF;">
<text style="font-size: 28rpx;color:#111;font-weight: 500;">儿童(占床)</text>
<text style="font-size:22rpx;color:#999;margin-left: 30rpx;flex:1;">2-18周岁(不含)</text>
<u-number-box size="28" :min="0" :max="currentPrice.totalSeat-crCount-etbCount" @change="etChange" v-model="etCount"></u-number-box>
<u-number-box size="28" :min="0" :max="currentPrice.remainNum-crCount-etbCount" @change="etChange" v-model="etCount"></u-number-box>
</view>
<view class="line-flex" style="padding:30rpx;background: #FFF;">
<text style="font-size: 28rpx;color:#111;font-weight: 500;">儿童(不占床)</text>
<text style="font-size:22rpx;color:#999;margin-left: 30rpx;flex:1;">2-18周岁(不含)</text>
<u-number-box size="28" :min="0" :max="currentPrice.totalSeat-crCount-etCount" @change="etbChange" v-model="etbCount"></u-number-box>
<u-number-box size="28" :min="0" :max="currentPrice.remainNum-crCount-etCount" @change="etbChange" v-model="etbCount"></u-number-box>
</view>
<view class="line-flex" style="padding:30rpx;background: #FFF;">
<text style="font-size: 28rpx;color:#111;font-weight: 500;">婴儿</text>
......@@ -347,7 +350,7 @@
</view>
<view class="jz_OrderDiv" style="box-shadow: none;width: 100%;padding:20rpx;">
<view>
<text style="font-size:24rpx;color:#111;font-weight: 500;">{{currentPrice.startDate}} 出发 余位:{{currentPrice.totalSeat}}</text>
<text style="font-size:24rpx;color:#111;font-weight: 500;">{{currentPrice.startDate}} 出发 余位:{{currentPrice.remainNum}}</text>
</view>
<view style="display:flex;align-items: center;">
<button open-type="contact" class="jz_ConButton">
......@@ -397,7 +400,9 @@
mainColor: "",
detailContent: "",
customerDate:{},
currentPrice:{}
currentPrice:{},
canCreateOrder:false,
finishFirstLoad:false
};
},
created() {
......@@ -424,17 +429,24 @@
},
methods: {
openOrderPreview(){
if(this.canCreateOrder&&this.finishFirstLoad){
this.showOrderPreviwe=true
}
},
chosenDateResult(result){
let price=this.dataList.priceList[result.priceObj]
this.currentPrice=price
if(this.crCount+this.etCount+this.etbCount>=this.currentPrice.totalSeat){
if(this.crCount+this.etCount+this.etbCount>=this.currentPrice.remainNum){
this.crCount=1
this.etCount=0
this.etbCount=0
}
this.delMsg.tcid=price.tcid
this.delMsg.configId = price.configID;
this.getDetails();
if(!showOrderPreviwe){
this.getDetails()
}
if(result.priceObj>2){
this.customerDate=price
}
......@@ -476,8 +488,11 @@
this.delMsg,
res => {
console.log(res, '详情');
if (res.resultCode == 1) {
res.data.tempImgCover=JSON.parse(res.data.imgCover)
// let tempPrice= res.data.priceList.filter(x=>x.remainNum>0)
// res.data.priceList=tempPrice
this.dataList = res.data;
this.scenicNum = 0;
this.dataList.dayList.forEach(x => {
......@@ -497,11 +512,21 @@
})
})
this.currentPrice=this.dataList.currentPriceInfo
if(this.currentPrice.remainNum==0){
let temp=this.dataList.priceList.find(x=>x.remainNum>0)
if(temp){
this.getDayInfo(temp)
}
}
this.dataList.priceList.forEach(x=>{
if(x.tcid==this.delMsg.tcid){
this.delMsg.tcnum=x.tcnum
}
if(x.remainNum>0){
this.canCreateOrder=true
}
})
this.finishFirstLoad=true
} else {
}
......@@ -538,7 +563,8 @@
},
//点击切换
getDayInfo(item){
if(this.crCount+this.etCount+this.etbCount>=this.currentPrice.totalSeat){
if(item.remainNum>0){
if(this.crCount+this.etCount+this.etbCount>=this.currentPrice.remainNum){
this.crCount=1
this.etCount=0
this.etbCount=0
......@@ -547,6 +573,12 @@
this.delMsg.configId = item.configID;
this.currentPrice=item
this.getDetails();
}else{
uni.showToast({
title:"该团期已售罄",
icon:"none"
})
}
},
openDate(){
if(this.customerDate.tcid){
......@@ -1108,6 +1140,10 @@
font-size:28rpx;
border-radius: 16rpx;
}
.jz_OrderNow.disable{
background-color: #ecf1f4;
color:#111
}
.jz_ConButton{
background-color: #fff;
height:40px;
......
......@@ -2,10 +2,10 @@ export default {
install(Vue, options) {
Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
Vue.prototype.host2 = "http://192.168.20.24:8400"
// Vue.prototype.host2 = "https://erpmallapi.oytour.com"
Vue.prototype.host3 = "http://192.168.20.24"
//Vue.prototype.host3 = "https://reborn.oytour.com"
//Vue.prototype.host2 = "http://192.168.20.24:8400"
Vue.prototype.host2 = "https://erpmallapi.oytour.com"
//Vue.prototype.host3 = "http://192.168.20.24"
Vue.prototype.host3 = "https://reborn.oytour.com"
Vue.prototype.request = function(param, success, failed) {
//网络请求
......
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