Commit 23086fb6 authored by youjie's avatar youjie

行程首页优化

parent 33c8fc1e
......@@ -6,6 +6,14 @@ class scheduledTripService {
static async GetB2BTravelInfoV1(param:any):Promise<HttpResponse>{
return request('b2b_get_GetB2BTravelInfoV1',param)
}
// 获取线路
static async GetB2BGroupSearchItem(param:any):Promise<HttpResponse>{
return request('b2b_get_GetGroupSearchItem',param)
}
// 获取出发城市
static async GetB2BSite(param:any):Promise<HttpResponse>{
return request('b2b_get_site',param)
}
// 获取分页数据
static async GetB2BTravelPageList(param:any):Promise<HttpResponse>{
return request('b2b_get_GetB2BTravelPageList',param)
......
<template>
<div class="rounded-borders bg-white" :class="{'q-col-gutter-sm':$q.platform.is.desktop}">
<div class="row items-center q-pa-md" :class="{'q-col-gutter-sm':$q.platform.is.desktop}">
<div class="text-subtitle2 q-mr-md">
<div class="row items-center no-wrap justify-between q-pa-md" :class="{'q-col-gutter-sm':$q.platform.is.desktop}">
<div class="col row items-center no-wrap">
<div class="q-mr-md" style="flex-shrink: 0;">
<div class="text-subtitle2">
<span class="text-weight-bold text-primary q-mr-sm">{{
TotalCount
}}</span>
<span>{{$t('v103.scheduledTrip.experiencetrip')}}</span>
</div>
</div>
<div class="col row wrap">
<template v-for="(x, i) in chosenAddress">
<!-- <q-chip
v-if="i==0"
size="13px"
:key="i"
outline
color="grey"
:label="x.Name"
/> -->
<q-chip
v-for="(x, i) in chosenAddress"
v-if="i!=0"
size="13px"
:key="i"
removable
......@@ -17,6 +31,12 @@
:label="x.Name"
@remove="removeChosen(x,i)"
/>
</template>
</div>
</div>
<div class="q-ml-md">
<q-btn style="width: 60px;" color="primary" unelevated size="sm" :label="$t('query')" @click="setSearchHandler"/>
</div>
</div>
<div
class="row items-center"
......@@ -24,9 +44,25 @@
style="border-top: 1px solid #eee"
>
<span class="f12" v-if="$q.platform.is.desktop">{{$t('v103.scheduledTrip.sort')}}:</span>
<q-chip
<span class="row items-center cursor-pointer rounded-borders q-px-sm q-py-xs q-mr-sm"
:class="{
'bg-grey-3': orderindex != x.value,
'bg-primary': orderindex == x.value,
'text-dark':orderindex != x.value,'text-white':orderindex == x.value
}"
v-for="(x, i) in sortArray"
:key="i"
@click="chosenSortHandler(x.value)">
<q-icon class="q-mr-sm" v-if="i==0" :class="x.icon" size="xs" v-close-popup/>
<span>{{x.label}}</span>
<q-icon v-if="i!=0"
:name="ordertype && orderindex == x.value ? 'keyboard_arrow_up' : 'keyboard_arrow_down'" class="q-ml-sm"
size="20px"
/>
</span>
<!-- <q-chip
square
:icon="x.icon"
class="cursor-pointer"
clickable
:text-color="sortNum != x.value ? 'dark' : 'white'"
......@@ -37,8 +73,9 @@
v-for="(x, i) in sortArray"
:key="i"
@click="chosenSortHandler(x)"
>{{ x.label }}</q-chip
>
{{ x.label }}
</q-chip> -->
</div>
</div>
<div class="q-mt-lg">
......@@ -162,10 +199,8 @@
const qNameProxy = ref(null) as any
const { locale, t } = useI18n()
const data = reactive({
searchAdd: {
name: "",
value: 0,
},
ordertype: 0,
orderindex:0,
areaList: [],
chosenAddress: [],
goodsType: [],
......@@ -178,21 +213,46 @@
dataList: [],
sortNum: 1,
sortArray: [
// {
// label: t('v103.scheduledTrip.recommend'),
// value: 1,
// icon: "iconfont icongood",
// },
// {
// label: t('v103.scheduledTrip.ascendingorder'),
// value: 2,
// icon: "iconfont iconmeiyuan",
// },
// {
// label: t('v103.scheduledTrip.descendingorder'),
// value: 3,
// icon: "iconfont iconmeiyuan",
// },
{
label: t('v103.scheduledTrip.recommend'),
value: 1,
value: 0,
icon: "iconfont icongood",
},
{
label: t('v103.scheduledTrip.ascendingorder'),
label: '团期',
value: 1,
icon: "iconfont iconon",
},
{
label: '价格',
value: 2,
icon: "iconfont iconmeiyuan",
},
{
label: t('v103.scheduledTrip.descendingorder'),
label: '销量',
value: 3,
icon: "iconfont iconmeiyuan",
icon: "iconfont icongood",
},
// {
// label: '评论数',
// value: 4,
// icon: "iconfont icongood",
// },
],
TotalCount: 0,
PageCount: 0,
......@@ -203,28 +263,67 @@
data.dateRange = { from: data.msg.startDate, to: data.msg.endDate };
watch(data.msg, (n, o) => {
data.msg.pageIndex = 1
methods.goSearchHandler()
methods.setSearchHandler()
},{deep: true})
watch(search, (n, o) => {
data.chosenAddress = JSON.parse(JSON.stringify(n.chosenAddress))
data.qMsg = JSON.parse(JSON.stringify(n.msg))
data.msg = JSON.parse(JSON.stringify(n.msg))
// methods.goSearchHandler();
},{deep:true})
const methods = {
changeOrderType(i){
if(data.orderindex==i){
data.ordertype=this.ordertype==0?1:0
}else{
data.orderindex=i
data.ordertype=0
}
search.msg.orderByDate = data.orderindex==1?(data.ordertype==0?2:1):0
search.msg.orderByPrice = data.orderindex==2?(data.ordertype==0?2:1):0
search.msg.orderBySales = data.orderindex==3?(data.ordertype==0?2:1):0
// this.loadTeamDataInit()
},
// 删除目的地
removeChosen(x,i) {
search.deleteChosen = JSON.parse(JSON.stringify(x))
data.chosenAddress.splice(i,1)
search.chosenAddress = JSON.parse(JSON.stringify(data.chosenAddress))
if(x.type==1){
search.msg.lineId=0
search.msg.lineTeamId=0
}else if(x.type==2){
search.msg.lineTeamId=0
}else if(x.type==3){
search.msg.startCityId=0
}else if(x.type==4){
search.DayId = 0
search.msg.minTripDay = ""
search.msg.maxTripDay = ""
}else if(x.type==5){
search.datesId = 0
search.msg.startDate = ""
}else if(x.type==6){
search.msg.startDate = ""
search.msg.endDate = ""
}
},
// 排序方式
chosenSortHandler(x) {
data.sortNum = x.value;
data.msg.orderByDate = data.sortNum == 4 ? 1 : data.sortNum == 5 ? 2 : 0;
data.msg.orderByPrice = data.sortNum == 2 ? 1 : data.sortNum == 3 ? 2 : 0;
data.msg.orderByDay = data.sortNum == 6 ? 1 : data.sortNum == 7 ? 2 : 0;
chosenSortHandler(i) {
console.log(i,'----')
if(data.orderindex==i){
data.ordertype=data.ordertype==0?1:0
}else{
data.orderindex=i
data.ordertype=0
}
search.msg.orderByDate = data.orderindex==1?(data.ordertype==0?2:1):0
search.msg.orderByPrice = data.orderindex==2?(data.ordertype==0?2:1):0
search.msg.orderBySales = data.orderindex==3?(data.ordertype==0?2:1):0
methods.setSearchHandler()
// data.sortNum = x.value;
// data.msg.orderByDate = data.sortNum == 4 ? 1 : data.sortNum == 5 ? 2 : 0;
// data.msg.orderByPrice = data.sortNum == 2 ? 1 : data.sortNum == 3 ? 2 : 0;
// data.msg.orderByDay = data.sortNum == 6 ? 1 : data.sortNum == 7 ? 2 : 0;
},
goSearchHandler() {
$q.loading.show();
......@@ -286,6 +385,10 @@
message.errorMsg(e.message)
})
},
setSearchHandler(){
data.msg.pageIndex = 1
methods.goSearchHandler()
},
GotoDetails(item) {
$router.push({
path:`/scheduledTrip/details/${encodeURIComponent(item.id)}/${item.tcid}`
......
<template>
<div v-if="$q.platform.is.mobile" class="rounded-borders bg-white row items-center q-ma-sm q-py-md q-mb-md q-px-md">
<q-input v-model="searchAdd.name" class="SearchMain-height" dense reverse-fill-mask ftype="text" standout :label="$t('v103.scheduledTrip.searchinput')" @update:model-value="changeAddrSearchHandler"/>
<q-input v-model="searchClone.searchKey" class="SearchMain-height" dense reverse-fill-mask ftype="text" standout :label="$t('v103.scheduledTrip.searchinput')" @update:model-value="changeAddrSearchHandler"/>
<div class="col"></div>
<q-btn unelevated class="bg-grey-3 hover q-mr-md" :title="$t('morequery')">
<q-badge rounded class="din bg-red-2 text-red-14 text-weight-bold" floating :label="searchCnt"
......@@ -46,8 +46,8 @@
<q-icon
@click="changeExplesdHandler(x)"
v-if="
searchAdd.name.length == 0 ||
(searchAdd.name.length > 0 && x.isShowChild)
searchClone.searchKey.length == 0 ||
(searchClone.searchKey.length > 0 && x.isShowChild)
"
:name="!x.explsed ? 'keyboard_arrow_down' : 'keyboard_arrow_up'"
size="20px"
......@@ -57,7 +57,7 @@
class="q-mx-md"
v-if="
x.explsed ||
(x.SubList && x.isShowChild && searchAdd.name.length > 0)
(x.SubList && x.isShowChild && searchClone.searchKey.length > 0)
"
>
<template v-for="(y, yi) in x.SubList">
......@@ -82,10 +82,10 @@
</q-popup-proxy>
</div>
<div class="rounded-borders q-my-md q-px-xs q-py-xs bg-grey-3">
<div v-if="msg.teamType.length==0" class="q-px-sm q-py-xs">{{$t('v103.scheduledTrip.allcommoditytype')}}</div>
<div v-if="searchClone.teamType.length==0" class="q-px-sm q-py-xs">{{$t('v103.scheduledTrip.allcommoditytype')}}</div>
<template v-else>
<q-chip
v-for="(x, i) in msg.teamType"
v-for="(x, i) in searchClone.teamType"
size="12px"
:key="i"
removable
......@@ -146,10 +146,10 @@
<div class="q-my-md">
<div class="text-subtitle1 text-weight-bold">{{$t('v103.scheduledTrip.screeningprice')}}(CNY)</div>
<div class="q-mt-md text-grey-6 text-subtitle1">
{{ msg.priceRange.min }} - {{ msg.priceRange.max }}
{{ searchClone.priceRange.min }} - {{ searchClone.priceRange.max }}
</div>
<q-range
v-model="msg.priceRange"
v-model="searchClone.priceRange"
:min="1"
:max="100000"
:step="1"
......@@ -203,36 +203,62 @@
</div>
<template v-if="$q.platform.is.desktop">
<q-card flat class="rounded-borders q-py-md">
<div class="text-subtitle1 text-weight-bold q-mx-md">{{$t('v103.scheduledTrip.screeningtitle')}}</div>
<div class="row justify-between q-mx-md">
<span class="text-subtitle1 text-weight-bold ">{{$t('v103.scheduledTrip.screeningtitle')}}</span>
</div>
<q-input
v-model="searchAdd.name"
v-model="searchClone.searchKey"
type="text"
standout
:placeholder="$t('v103.scheduledTrip.searchinput')"
class="q-ma-md"
@update:model-value="changeAddrSearchHandler"
/>
<div v-for="(x, i) in areaList" :key="i">
<div v-for="(x, i) in sites" :key="i">
<div class="addr">
<div
class="addr-list q-px-md q-py-sm cursor-pointer row items-center"
v-if="x.isShow"
>
<q-checkbox
indeterminate-value="half"
@update:model-value="changeCheckHandler(x)"
v-model="x.checked"
size="xs"
/>
<span class="col" @click="changeExplesdHandler(x)">{{
x.Name
}}</span>
<span class="col" @click="changeExplesdHandler(x)">公司所在地</span>
<div>
<span v-if="chosenAddress.length>0" class="q-mr-md text-primary">{{chosenAddress[0].Name}}</span>
<q-icon
@click="changeExplesdHandler(x)"
:name="!x.explsed ? 'keyboard_arrow_down' : 'keyboard_arrow_up'"
size="20px"
/>
</div>
</div>
<div
class="q-mx-md"
v-if="
searchAdd.name.length == 0 ||
(searchAdd.name.length > 0 && x.isShowChild)
x.explsed ||
(x.SubList && x.isShowChild && searchClone.searchKey.length > 0)
"
>
<template v-for="(y, yi) in x.SubList">
<q-radio
class="addr-list q-px-md q-py-sm row items-center"
:key="yi"
v-if="y.isShow" v-model="searchClone.cityId" checked-icon="task_alt" unchecked-icon="panorama_fish_eye" :val="y.cityId" :label="y.siteName" size="sm" @update:model-value="changeCheckHandler(y, x,0)"/>
<!-- <span class="col">{{ y.siteName }}</span> -->
</template>
</div>
</div>
</div>
<template v-if="xilies.length==0||!searchClone.lineId">
<div v-for="(x, i) in lines" :key="i">
<div class="addr">
<div
class="addr-list q-px-md q-py-sm cursor-pointer row items-center"
v-if="x.isShow"
>
<span class="col" @click="changeExplesdHandler(x)">线路</span>
<q-icon
@click="changeExplesdHandler(x)"
:name="!x.explsed ? 'keyboard_arrow_down' : 'keyboard_arrow_up'"
size="20px"
/>
......@@ -241,63 +267,118 @@
class="q-mx-md"
v-if="
x.explsed ||
(x.SubList && x.isShowChild && searchAdd.name.length > 0)
(x.SubList && x.isShowChild && searchClone.searchKey.length > 0)
"
>
<template v-for="(y, yi) in x.SubList">
<div
<q-radio
class="addr-list q-px-md q-py-sm row items-center"
:key="yi"
v-if="y.isShow"
>
v-if="y.isShow" v-model="searchClone.lineId" checked-icon="task_alt" unchecked-icon="panorama_fish_eye" :val="y.id" :label="y.name" size="sm" @update:model-value="changeCheckHandler(y, x,1)"/>
<q-checkbox
@update:model-value="changeCheckHandler(y, x)"
v-model="y.checked"
size="xs"
</template>
</div>
</div>
</div>
</template>
<template v-if="searchClone.startCityId==0"></template>
<div v-for="(x, i) in startCitys" :key="i">
<div class="addr">
<div
class="addr-list q-px-md q-py-sm cursor-pointer row items-center"
v-if="x.isShow"
>
<span class="col" @click="changeExplesdHandler(x)">出发城市</span>
<q-icon
@click="changeExplesdHandler(x)"
:name="!x.explsed ? 'keyboard_arrow_down' : 'keyboard_arrow_up'"
size="20px"
/>
<span class="col">{{ y.Name }}</span>
</div>
<div
class="q-mx-md"
v-if="
x.explsed ||
(x.SubList && x.isShowChild && searchClone.searchKey.length > 0)
"
>
<template v-for="(y, yi) in x.SubList">
<q-radio class="addr-list q-px-md q-py-sm row items-center"
:key="yi"
v-if="y.isShow" v-model="searchClone.startCityId" checked-icon="task_alt" unchecked-icon="panorama_fish_eye" :val="y.id" :label="y.startCityName" size="sm" @update:model-value="changeCheckHandler(y, x,3)"/>
</template>
</div>
</div>
</div>
</q-card>
<q-card flat class="rounded-borders q-py-md q-mt-lg">
<q-card flat class="rounded-borders q-py-md q-mt-lg" v-if="searchClone.lineId>0&&searchClone.lineTeamId==0">
<div class="text-subtitle1 text-weight-bold q-mx-md">{{$t('v103.scheduledTrip.allcommoditytype')}}</div>
<div class="add q-mt-md" v-for="(x, i) in goodsType" :key="i">
<div class="add q-mt-md" v-for="(x, i) in xilies" :key="i">
<div class="addr">
<div
class="addr-list q-px-md q-py-sm cursor-pointer row items-center"
v-if="x.isShow"
>
<span class="col" @click="changeExplesdHandler(x)">{{
x.Name
}}</span>
<span class="col" @click="changeExplesdHandler(x)">系列</span>
<q-icon
@click="changeExplesdHandler(x)"
:name="!x.explsed ? 'keyboard_arrow_down' : 'keyboard_arrow_up'"
size="20px"
/>
</div>
<div class="q-mx-md" v-if="x.explsed">
<div
class="addr-list q-px-md q-py-sm row items-center"
v-for="(y, yi) in x.SubList"
:key="yi"
class="q-mx-md"
v-if="
x.explsed ||
(x.SubList && x.isShowChild && searchClone.searchKey.length > 0)
"
>
<q-checkbox
v-model="y.checked"
size="xs"
@update:model-value="changeGoodTypeHandler(y)"
/>
<span class="col">{{ y.Name }}</span>
<template v-for="(y, yi) in x.SubList">
<q-radio class="addr-list q-px-md q-py-sm row items-center"
:key="yi"
v-if="y.isShow" v-model="searchClone.lineTeamId" checked-icon="task_alt" unchecked-icon="panorama_fish_eye" :val="y.id" :label="y.name" size="sm" @update:model-value="changeCheckHandler(y, x,2)"/>
</template>
</div>
</div>
</div>
</q-card>
<q-card flat class="rounded-borders q-mt-lg row no-padding">
<q-card flat class="rounded-borders q-mt-lg column no-padding">
<template v-if="!searchClone.startDate&&!searchClone.endDate">
<div v-for="(x, i) in dates" :key="i">
<div class="addr">
<div
class="q-px-md q-py-sm"
class="addr-list q-px-md q-py-md cursor-pointer row items-center"
v-if="x.isShow"
>
<span class="col" @click="changeExplesdHandler(x)">出发日期</span>
<q-icon
@click="changeExplesdHandler(x)"
:name="!x.explsed ? 'keyboard_arrow_down' : 'keyboard_arrow_up'"
size="20px"
/>
</div>
<div
class="q-mx-md"
v-if="
x.explsed ||
(x.SubList && x.isShowChild && searchClone.searchKey.length > 0)
"
>
<template v-for="(y, yi) in x.SubList">
<q-radio class="addr-list q-px-md q-py-sm row items-center"
:key="yi"
v-if="y.isShow" v-model="datesId" checked-icon="task_alt" unchecked-icon="panorama_fish_eye" :val="y.id" :label="y.Name" size="sm" @update:model-value="changeCheckHandler(y, x,5)"/>
</template>
</div>
</div>
</div>
</template>
<div class="row bg-grey-3" v-if="!searchClone.startDate">
<div
class="q-px-md q-py-md"
style="border-right: 1px solid #eee; border-radius: 0 !important"
>
<q-icon name="event" size="24px" />
......@@ -320,15 +401,16 @@
</div>
</q-popup-proxy>
</div>
</div>
</q-card>
<q-card flat class="rounded-borders q-pa-md q-mt-lg">
<div class="text-subtitle1 text-weight-bold">{{$t('v103.scheduledTrip.screeningprice')}}(CNY)</div>
<div class="q-mt-md text-grey-6 text-subtitle1">
{{ msg.priceRange.min }} - {{ msg.priceRange.max }}
{{ searchClone.priceRange.min }} - {{ searchClone.priceRange.max }}
</div>
<q-range
v-model="msg.priceRange"
v-model="searchClone.priceRange"
:min="1"
:max="100000"
:step="1"
......@@ -343,20 +425,9 @@
:label="$t('v103.scheduledTrip.journeytime')"
class="text-subtitle1 text-weight-bold rounded-borders"
>
<div
class="addr-list q-px-md q-py-sm row items-center"
<q-radio class="addr-list q-px-md q-py-sm row items-center"
v-for="(y, yi) in dayArray"
:key="yi"
>
<q-checkbox
v-model="y.checked"
size="xs"
@update:model-value="changeTripDayHandler"
/>
<span class="col text-grey-8" style="font-weight: 400">{{
y.text
}}</span>
</div>
:key="yi" v-model="DayId" checked-icon="task_alt" unchecked-icon="panorama_fish_eye" :val="y.id" :label="y.text" size="sm" @update:model-value="changeCheckHandler(y,dayArray,4)"/>
</q-expansion-item>
</q-card>
</template>
......@@ -377,23 +448,30 @@
// import { dateDiffer } from '../../utils/tools'
import { DirtionmaryHelper } from '../../config/dictionary'
import scheduledTripService from 'src/api/scheduledTrip'
import { getStoreGetter } from '../../store/utils'
import { UserGetter } from '../../store/modules/user/getters'
export default defineComponent({
components: { svgIcon, NCascader, NSelect },
setup() {
setup(props, context) {
const $q = useQuasar()
const qDateProxy = ref(null) as any
const qNameProxy = ref(null) as any
const { locale, t } = useI18n()
const data = reactive({
searchAdd: {
name: "",
value: 0,
},
datesId: 0,//日期
DayId:0,//旅程天数
xilies: [],//系列
lines: [],//线路
startCitys: [],//出发城市表
searchItem: [],
sites: [],//公司所在城市
city: 0,//公司城市
dates: [],//开始日期
areaList: [],
chosenAddress: [],
chosenAddress: [],//已选项
goodsType: [],
dateRange: null,
msg: null,
dateRange: null,//起止时间
searchClone: null,
dayArray: [
{
id: 1,
......@@ -451,17 +529,28 @@
},
],
sortNum: 1,
userInfo: {} as any,
})
const search = inject(DirtionmaryHelper.TICKET_QUERY_PARAM)
data.chosenAddress = JSON.parse(JSON.stringify(search.chosenAddress))
data.msg = JSON.parse(JSON.stringify(search.msg))
data.searchClone = JSON.parse(JSON.stringify(search.msg))
data.DayId = search.DayId
data.datesId = search.datesId
data.dayArray.forEach((x) => {
x.checked = false;
});
data.dateRange = { from: data.msg.startDate, to: data.msg.endDate };
data.dateRange = { from: data.searchClone.startDate, to: data.searchClone.endDate };
data.userInfo = getStoreGetter<UserGetter>('user', 'getUser')
const methods = {
// 出发城市变更
changeSite(e: number, option: any, pathValues: Array<any>) {
if (pathValues) {
if (pathValues.length > 0) {
data.searchClone.cityId = pathValues[0].companyId
methods.loadRecoItems()
}
}
},
// 删除目的地、商品类别、旅游时间
removeChosen(x,i,type) {
if(type==1){
......@@ -471,7 +560,7 @@
search.deleteChosen = JSON.parse(JSON.stringify(x))
}
data.chosenAddress.splice(i,1)
search.chosenAddress = JSON.parse(JSON.stringify(data.chosenAddress))
// search.chosenAddress = JSON.parse(JSON.stringify(data.chosenAddress))
data.chosenAddress.length==0&&data.areaList.forEach(y=>{
y.checked = false
......@@ -487,14 +576,38 @@
}
})
})
data.msg.teamType.splice(i,1)
search.msg = JSON.parse(JSON.stringify(data.msg))
data.searchClone.teamType.splice(i,1)
// search.msg = JSON.parse(JSON.stringify(data.searchClone))
}else if(type==3){
data.dayArray[i].checked = false
}
},
// 初始化目的地
initAreaList() {
// 初始化出发城市
initCityList() {
methods.GetB2BSite()
let d=new Date().getMonth()
for(let i=0;i<3;i++){
d++
d=d>12?d-12:d
let obj = {
Name: `${d}月`,
id: 1+i,
MM: d
}
data.dates.push(obj)
}
let arrList = function(arr){
arr.forEach(item=>{
item.isShow = true
item.explsed = false
})
}
arrList(data.dates)
let list = []
list.push({SubList: [],explsed: false,isShow:true})
list[0].SubList = data.dates
data.dates = list;
return
let jObj = JSON.parse(localStorage.getItem("baseifo"));
jObj.AreaList.forEach((x) => {
x.SubList.forEach((y) => {
......@@ -511,6 +624,105 @@
});
data.areaList.push(...x.SubList);
});
},
// 获取当前城市
GetB2BSite(){
let state=false;
scheduledTripService.GetB2BSite({}).then(r => {
if (r.data.resultCode == ApiResult.SUCCESS) {
let arrList = function(arr){
arr.forEach(item=>{
item.isShow = true
item.explsed = false
})
}
arrList(r.data.data)
let list = []
list.push({SubList: [],explsed: false,isShow:true})
list[0].SubList = r.data.data
data.sites = list;
if(data.userInfo){
let rB_Branch_id = data.userInfo.salesBaseInfo
.rB_Branch_id;
data.sites[0].SubList.forEach(item=>{
if(item.companyId==rB_Branch_id){
state = true;
data.city = item.companyId;
data.searchClone.cityId = item.cityId
search.msg.companyId = data.city
// localStorage.setItem('site', data.city)
// localStorage.setItem('cityId', item.cityId)
methods.changeChosenHandler(item,x)
}
})
if(!state) {
state = true;
data.city = data.sites[0].SubList[0].companyId;
data.searchClone.cityId = data.sites[0].SubList[0].cityId
search.msg.companyId = data.city
// localStorage.setItem('site', data.city)
// localStorage.setItem('cityId', data.searchClone.cityId)
methods.changeChosenHandler(data.sites[0].SubList[0],data.sites[0])
}
search.msg.cityId = data.searchClone.cityId
methods.loadRecoItems()
}else{
message.errorMsg(r.data.message)
}
}
}).catch(e => {
message.errorMsg(e.message)
})
},
// 系列
loadRecoItems(){
let param = {
companyId: data.city,
cityId: data.searchClone.cityId,
}
scheduledTripService.GetB2BGroupSearchItem(param).then(r => {
if (r.data.resultCode == ApiResult.SUCCESS) {
let arrList = function(arr){
arr.forEach(item=>{
item.isShow = true
item.explsed = false
})
}
arrList(r.data.data.line)
arrList(r.data.data.startCity)
let list = []
let obj = {
SubList: [],explsed: false,isShow:true
}
list.push(JSON.parse(JSON.stringify(obj)))
list[0].SubList = r.data.data.line
data.lines=JSON.parse(JSON.stringify(list))
let list2 = []
list2.push(JSON.parse(JSON.stringify(obj)))
list2[0].SubList = r.data.data.startCity
data.startCitys = list2
data.startCitys.forEach(x=>{
x.SubList.forEach(y=>{
data.chosenAddress.forEach((z,index)=>{
if(y.id!=z.id){
if(z.type==1){
search.chosenAddress.splice(index,1);
}
if(z.type==2){
search.chosenAddress.splice(index,1);
}
if(z.type==3){
search.chosenAddress.splice(index,1);
}
}
})
})
})
}
}).catch(e => {
message.errorMsg(e.message)
})
},
// 旅游时间
changeExplesdHandler(x) {
......@@ -520,66 +732,174 @@
},
// 商品类型
changeGoodTypeHandler(x) {
if (x.checked && data.msg.teamType.indexOf(x.Id) == -1) {
data.msg.teamType.push(x.Id);
} else if (!x.checked && data.msg.teamType.indexOf(x.Id) != -1) {
let i = data.msg.teamType.findIndex((item) => item == x.Id);
data.msg.teamType.splice(i, 1);
if (x.checked && data.searchClone.teamType.indexOf(x.Id) == -1) {
data.searchClone.teamType.push(x.Id);
} else if (!x.checked && data.searchClone.teamType.indexOf(x.Id) != -1) {
let i = data.searchClone.teamType.findIndex((item) => item == x.Id);
data.searchClone.teamType.splice(i, 1);
}
},
// 目的地
changeCheckHandler(x, p = null) {
if(x.checked=='half'){
x.checked = true
}else if(x.checked){
x.checked = false
}else if(!x.checked){
x.checked = true
}
if (p) {
let t = p.SubList.filter((x) => x.checked);
p.checked = t.length == p.SubList.length ? true : t.length == 0 ? false : "half";
methods.changeChosenHandler(x,p.Id);
} else {
x.SubList.forEach((item) => {
item.checked = x.checked;
methods.changeChosenHandler(item,x.Id);
});
// 出发地
changeCheckHandler(x, p = null,type) {
if(!type){
data.city = x.companyId;
search.msg.cityId = data.searchClone.cityId
methods.loadRecoItems()
}else if(type==1){
let arrList = function(arr){
arr.forEach(item=>{
item.isShow = true
item.explsed = false
})
}
arrList(x.lineTeam)
let list = []
list.push({SubList: [],explsed: false,isShow:true})
list[0].SubList = x.lineTeam
data.xilies = list
}
setTimeout(()=>{
methods.changeChosenHandler(x,p,type);
},200)
},
changeChosenHandler(x,Pid) {
let i = search.chosenAddress.findIndex((item) => item.Id == x.Id) ?? -1;
if (!x.checked) {
if (i > -1) {
search.chosenAddress.splice(i, 1);
changeChosenHandler(x,p,type) {
let obj= {}
if(!type){
obj= {
Name: x.siteName,
Id: x.cityId,
checked: x.checked,
cityId : x.cityId,
companyId: x.companyId,
companyName: x.companyName,
explsed: x.explsed,
isShow: x.isShow,
province: x.province,
siteName: x.siteName,
type: type
}
search.chosenAddress.splice(0,1);
setTimeout(()=>{
search.chosenAddress.unshift(obj);
},200)
}else if(type==1||type==2){
obj= {
Name: x.name,
Id: x.id,
type: type
}
p.SubList.forEach(y=>{
search.chosenAddress.forEach((z,index)=>{
if(y.id==z.id&&type==z.type){
search.chosenAddress.splice(index,1);
}
} else {
if (i == -1) {
x.Pid = Pid
search.chosenAddress.push(x);
})
})
if(type==1){
search.msg.lineId = data.searchClone.lineId
}if(type==2){
search.msg.lineTeamId = data.searchClone.lineTeamId
}
setTimeout(()=>{
search.chosenAddress.push(obj);
},200)
}else if(type==3){
obj= {
Name: x.startCityName,
Id: x.id,
type: type
}
p.SubList.forEach(y=>{
search.chosenAddress.forEach((z,index)=>{
if(y.id==z.Id&&type==z.type){
search.chosenAddress.splice(index,1);
}
})
})
search.msg.startCityId = data.searchClone.startCityId
setTimeout(()=>{
search.chosenAddress.push(obj);
},200)
}else if(type==4){
obj= {
Name: x.text,
Id: x.id,
min: x.min,
max: x.max,
type: type
}
p.forEach(y=>{
search.chosenAddress.forEach((z,index)=>{
if(y.id==z.Id&&type==z.type){
search.chosenAddress.splice(index,1);
}
})
})
search.DayId = data.DayId
search.msg.maxTripDay = x.min
search.msg.maxTripDay = x.max
setTimeout(()=>{
search.chosenAddress.push(obj);
methods.changeTripDayHandler()
},200)
}else if(type==5){
obj= {
Name: x.Name,
Id: x.id,
type: type,
d: new Date().getFullYear()+'/'+x.MM+'/01'
}
p.SubList.forEach(y=>{
search.chosenAddress.forEach((z,index)=>{
if(y.id==z.Id&&type==z.type){
search.chosenAddress.splice(index,1);
}
})
})
setTimeout(()=>{
search.datesId = x.id
search.msg.startDate = obj.d
search.chosenAddress.push(obj);
},200)
}else if(type==6){
obj= {
Name: x.startDate+'-'+x.endDate,
startDate: x.startDate,
type: type,
}
search.chosenAddress.forEach((z,index)=>{
if(type==z.type){
search.chosenAddress.splice(index,1);
}
})
setTimeout(()=>{
search.chosenAddress.push(obj);
},200)
}
if(p){
p.explsed = false;
}
},
// 价格区间
changeTripDayHandler() {
data.msg.minTripDay = "0";
data.msg.maxTripDay = "0";
data.searchClone.minTripDay = "0";
data.searchClone.maxTripDay = "0";
data.dayArray.forEach((x) => {
if (x.checked) {
data.msg.minPrice =
data.msg.minPrice > x.min ? x.min : data.msg.minPrice;
data.msg.maxPrice =
data.msg.maxPrice < x.max ? x.max : data.msg.maxPrice;
if (x.id==data.DayId) {
data.searchClone.minPrice =
data.searchClone.minPrice > x.min ? x.min : data.searchClone.minPrice;
data.searchClone.maxPrice =
data.searchClone.maxPrice < x.max ? x.max : data.searchClone.maxPrice;
}
});
data.msg.minTripDay =
data.msg.minTripDay == "0" ? "" : data.msg.minTripDay;
data.msg.maxTripDay =
data.msg.maxTripDay == "0" ? "" : data.msg.maxTripDay;
data.searchClone.minTripDay =
data.searchClone.minTripDay == "0" ? "" : data.searchClone.minTripDay;
data.searchClone.maxTripDay =
data.searchClone.maxTripDay == "0" ? "" : data.searchClone.maxTripDay;
},
testHandler(e) {
data.msg.minPrice = e.min;
data.msg.maxPrice = e.max;
search.msg.minPrice = data.searchClone.minPrice = e.min;
search.msg.maxPrice = data.searchClone.maxPrice = e.max;
},
// 选择时间区间
optionsFn(cd) {
......@@ -589,9 +909,16 @@
);
},
dateRangeHandler(e) {
data.msg.startDate = `${e.from.year}/${e.from.month}/${e.from.day}`;
data.msg.endDate = `${e.to.year}/${e.to.month}/${e.to.day} `;
data.searchClone.startDate = `${e.from.year}/${e.from.month}/${e.from.day}`;
data.searchClone.endDate = `${e.to.year}/${e.to.month}/${e.to.day} `;
if (qDateProxy.value) qDateProxy.value.hide()
let obj= {
startDate: data.searchClone.startDate,
endDate: data.searchClone.endDate,
}
search.msg.startDate = data.searchClone.startDate
search.msg.endDate = data.searchClone.endDate
methods.changeChosenHandler(obj,null,6)
},
// 商品类型
initGoods() {
......@@ -629,11 +956,22 @@
});
},
}
watch(data.msg, (n, o) => {
search.msg = JSON.parse(JSON.stringify(n))
watch(data.searchClone, (n, o) => {
// search.searchClone = JSON.parse(JSON.stringify(n))
},{deep: true})
watch(search, (n, o) => {
data.searchClone = JSON.parse(JSON.stringify(n.msg))
data.chosenAddress = JSON.parse(JSON.stringify(n.chosenAddress))
if(n.DayId==0){
data.DayId = n.DayId
}
if(n.datesId==0){
data.datesId = n.datesId
data.searchClone.startDate = ""
}
if(!n.msg.startDate&&!n.msg.endDate){
data.dateRange = { from: n.msg.startDate, to: n.msg.endDate };
}
if(n.deleteChosen){
data.areaList.forEach(x=>{
x.SubList.forEach(y=>{
......@@ -657,7 +995,7 @@
return setCnt
})
methods.initAreaList();
methods.initCityList();
methods.initGoods();
return {
...toRefs(data),
......
......@@ -67,7 +67,7 @@
}"
>
{{
x.price ? moneyFormat(x.price.originalB2CPrice, 0) : "&nbsp;"
x.price ? x.price.originalB2CPrice : "&nbsp;"
}}
</div>
</div>
......
......@@ -334,7 +334,9 @@ export default defineComponent({
currentImage:'',
showImagePriview: false,
d: props.days,
TitleT: []
})
data.TitleT = [t('v103.details.calendarhtml.d2'), t('v103.details.calendarhtml.d3'), t('v103.details.calendarhtml.d4')]
watch(() => props.days,(n,o) => {
data.d = n;
},{deep: true}
......@@ -356,9 +358,8 @@ export default defineComponent({
y.title = methods.formatTraffice(y.childItem.subTraffic);
y.icon = "iconfont iconjiaotong";
} else if (y.type == 4) {
let t = [t('v103.details.calendarhtml.d2'), t('v103.details.calendarhtml.d3'), t('v103.details.calendarhtml.d4')];
y.childItem.dinnerTypeName =
t[parseInt(y.childItem.useDinnerType) - 1];
y.childItem.dinnerTypeName = data.TitleT[parseInt(y.childItem.useDinnerType) - 1];
}
});
});
......
......@@ -1106,8 +1106,8 @@ export default {
v103: {
scheduledTrip:{
pageTitle: '行程檢索',
screeningtitle: '篩選目的地',
searchinput: '搜尋目的地',
screeningtitle: '篩選關鍵詞',
searchinput: '搜尋關鍵詞',
allcommoditytype: '所有商品類別',
screeningdate: '篩選出發日期',
screeningprice: '價錢篩選',
......
......@@ -6,7 +6,7 @@
:style="{ transform: stickyHeight }">
<div style="max-width: 1200px; margin-left: auto; margin-right: auto" :class="{ 'q-px-md': $q.screen.width < 1220 }" class="q-py-sm row items-center">
<span class="col product-price text-subtitle1 text-weight-bold" style="text-align: left">
<span>CNY {{ moneyFormat(dataList.priceList[0].originalB2CPrice, 0) }}</span>
<span>CNY {{ dataList.priceList[0].originalB2CPrice }}</span>
<span class="q-ml-sm f12 text-grey-7">{{$t('v103.details.since')}}</span>
</span>
<q-btn color="primary" unelevated class="q-px-xl" :label="$t('v103.details.selectionscheme')" @click="goScrollHandler(priceListHeight)" />
......@@ -109,8 +109,7 @@
class="product-price text-h6"
v-if="dataList.priceList.length > 0"
>
<!-- CNY:{{ dataList. }} -->
CNY:{{ moneyFormat(dataList.priceList[0].originalB2CPrice, 0) }}
CNY:{{ dataList.priceList[0].originalB2CPrice }}
<span class="f12 text-grey-6">{{$t('v103.details.since')}}</span>
</div>
<div v-else class="text-subtitle1 text-grey-6">{{$t('v103.details.nooffer')}}</div>
......@@ -169,7 +168,7 @@
</div>
<div class="" v-if="$q.platform.is.desktop">
<div class="row items-center">
<span class="product-price text-h6 q-mr-md">CNY {{ moneyFormat(dataList.priceList[0].originalB2CPrice, 0) }}</span>
<span class="product-price text-h6 q-mr-md">CNY {{ dataList.priceList[0].originalB2CPrice }}</span>
<q-btn color="primary" outline :label="showOrderPreview ? $t('v103.details.deselect') : $t('v103.details.choose')" @click="showOrderPreview = !showOrderPreview" class="q-px-lg" />
</div>
<div class="text-info q-mt-md text-right">{{$t('v103.details.earliest')}}:{{ dataList.priceList[0].startDate }}</div>
......@@ -524,6 +523,7 @@ export default defineComponent({
})
}
}
console.log(data.dataList,'----')
data.dataList.imgCover = JSON.parse(data.dataList.imgCover)
data.dayList = data.dataList.dayList
data.isShow = true
......@@ -582,10 +582,10 @@ export default defineComponent({
})
}, 1000)
})
}
} else {
message.errorMsg(r.data.message)
}
}
})
.catch(e => {
$q.loading.hide()
......
......@@ -677,6 +677,7 @@
}
.desktop-page{
max-width:1200px;
min-width: 900px;
margin:0 auto;
}
</style>
......@@ -716,10 +717,12 @@ export default defineComponent({
})
const search = reactive({
datesId: 0,
DayId: 0,
chosenAddress: [] as Array<any>,//右边目的地
deleteChosen: null as any,//右侧删除目的地
msg:{
cityId: 0,
cityId: 0,//当前城市id
companyId: 0,
startDate: "", //开始日期
endDate: "", //结束日期
......@@ -727,19 +730,19 @@ export default defineComponent({
lineTeamId: 0, //系列编号
minPrice: "0", //最低价格
maxPrice: "100000", //最高价格
minTripDay: "", //最低行程
minTripDay: "", //最低行程
maxTripDay: "", //最高行程天数
orderByDate: 0,
orderByPrice: 0,
orderBySales: 0,
priceOrderByField: 4,
searchKey: "",
startCityId: 0,
priceOrderByField: 2,//1同业会员价 2同业价格 3直客会员价 4直客价格
searchKey: "",//关键词搜索
startCityId: 0,//出发城市id
teamType: [],
priceRange:{
min: 1,
max: 100000,
}
},
}
})
provide(DirtionmaryHelper.TICKET_QUERY_PARAM, search)
......@@ -773,6 +776,6 @@ export default defineComponent({
letter-spacing: 1px;
}
.addr-list:hover {
background: #f1416c1a;
background: #E1F5FE;
}
</style>
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