Commit 57869847 authored by 黄奎's avatar 黄奎

新增接口

parent 29468978
import Api,{ HttpResponse, Result } from './../utils/request';
/**
* 配置相关方法
*/
class ConfigService{
/**
*
* @returns 获取模板查询条件
*/
static async GetTemplateQueryAsync():Promise<HttpResponse>{
return Api.Post("triptemplate_GetTemplateConfigData",{})
}
/**
* 获取模板市场分页列表
*/
static async GetTemplagePageAsync(params : any):Promise<HttpResponse>{
return Api.Post("triptemplate_GetTripTemplatePage",params);
}
}
export default ConfigService;
\ No newline at end of file
...@@ -17,17 +17,34 @@ ...@@ -17,17 +17,34 @@
<div class="q-mt-lg bg-white q-pa-lg rounded"> <div class="q-mt-lg bg-white q-pa-lg rounded">
<div class="row text-small items-center"> <div class="row text-small items-center">
<span style="margin-right: 50px;">适用线路:</span> <span style="margin-right: 50px;">适用线路:</span>
<el-check-tag :checked="queryObj.lineId == 0" @change="onLineChangeHandler(0)" <el-check-tag :checked="queryObj.LineId == 0" @change="onLineChangeHandler(0)"
class="text-small q-mr-md">全部</el-check-tag> class="text-small q-mr-md">全部</el-check-tag>
<el-check-tag :checked="queryObj.lineId == x.LineID" @change="onLineChangeHandler(x.LineID)" class="text-small q-mr-md" <el-check-tag :checked="queryObj.LineId == x.LineID" @change="onLineChangeHandler(x.LineID)"
v-for="x in lines" :key="x.LineID">{{x.LineName}}</el-check-tag> class="text-small q-mr-md" v-for="x in lines" :key="x.LineID">{{x.LineName}}</el-check-tag>
</div> </div>
<el-divider style="margin:12px 0;border-top-color:#f3f6fb;"></el-divider> <el-divider style="margin:12px 0;border-top-color:#f3f6fb;"></el-divider>
<div class="row text-small items-center"> <div class="row text-small items-center">
<span style="margin-right: 50px;">适用国家:</span> <span style="margin-right: 50px;">适用国家:</span>
<el-check-tag :checked="queryObj.CountryName == ''" @change="onCountryNameChangeHandler('')" class="text-small q-mr-md">通用</el-check-tag> <el-check-tag :checked="queryObj.CountryName == ''" @change="onCountryNameChangeHandler('')"
<el-check-tag :checked="queryObj.CountryName == x" @change="onCountryNameChangeHandler(x)" class="text-small q-mr-md" class="text-small q-mr-md">通用</el-check-tag>
v-for="(x,i) in countries" :key="i">{{x}}</el-check-tag> <el-check-tag :checked="queryObj.CountryName == x" @change="onCountryNameChangeHandler(x.CountryName)"
class="text-small q-mr-md" v-for="(x,i) in countries" :key="i">{{x.CountryName}}</el-check-tag>
</div>
<el-divider style="margin:12px 0;border-top-color:#f3f6fb;"></el-divider>
<div class="row text-small items-center">
<span style="margin-right: 50px;">季节:</span>
<el-check-tag :checked="queryObj.SeasonName == ''" @change="onSeasonNameChangeHandler('')"
class="text-small q-mr-md">通用</el-check-tag>
<el-check-tag :checked="queryObj.SeasonName == x" @change="onSeasonNameChangeHandler(x.SeasonName)"
class="text-small q-mr-md" v-for="(x,i) in seasonArr" :key="i">{{x.SeasonName}}</el-check-tag>
</div>
<el-divider style="margin:12px 0;border-top-color:#f3f6fb;"></el-divider>
<div class="row text-small items-center">
<span style="margin-right: 50px;">颜色:</span>
<el-check-tag :checked="queryObj.ColorName == ''" @change="onColorNameChangeHandler('')"
class="text-small q-mr-md">通用</el-check-tag>
<el-check-tag :checked="queryObj.ColorName == x" @change="onColorNameChangeHandler(x.ColorName)"
class="text-small q-mr-md" v-for="(x,i) in colorArr" :key="i">{{x.ColorName}}</el-check-tag>
</div> </div>
</div> </div>
</div> </div>
...@@ -35,56 +52,133 @@ ...@@ -35,56 +52,133 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref } from "vue"; import {
import LineService from '@/services/LineService' reactive,
import { userStore } from "@/store/user"; ref
import { storeToRefs } from "pinia"; } from "vue";
import LineService from '@/services/LineService'
import ConfigService from '@/services/ConfigService'
import {
userStore
} from "@/store/user";
import {
storeToRefs
} from "pinia";
const {userInfo} = storeToRefs(userStore()) const {
const lines = ref([] as Array<any>) userInfo
const countries = ref(['日本','韩国','老挝','法国','意大利'] as Array<any>) } = storeToRefs(userStore())
const queryObj = reactive({ const lines = ref([] as Array < any > ) //线路
lineId: 0, const countries = ref(['日本', '韩国', '老挝', '法国', '意大利'] as Array < any > ) //国家
const colorArr = ref([] as Array < any > ); //颜色
const seasonArr = ref([] as Array < any > ); //季节
const queryObj = reactive({
pageIndex: 1,
pageSize: 10,
LineId: 0,
Title: '', Title: '',
CountryName:'' CountryName: '',
}) SeasonName: '',
ColorName: ''
})
/***
* 获取模板市场分页列表
*/
const queryTemplateBySearchHandler = () => {
try {
let pageRes = ConfigService.GetTemplagePageAsync(queryObj);
console.log("queryTemplateBySearchHandler", pageRes);
} catch (error) {
}
}
//线路切换
const onLineChangeHandler = (lineId: number) => {
queryObj.lineId = lineId;
queryTemplateBySearchHandler();
}
//国家切换
const onCountryNameChangeHandler = (CountryName: string) => {
queryObj.CountryName = CountryName;
queryTemplateBySearchHandler();
}
//季节切换
const onSeasonNameChangeHandler = (SeasonName: string) => {
queryObj.SeasonName = SeasonName;
queryTemplateBySearchHandler();
}
const queryTemplateBySearchHandler = () => { } //颜色切换
const onLineChangeHandler = (lineId: number) => { const onColorNameChangeHandler = (ColorName: string) => {
queryObj.lineId = lineId queryObj.ColorName = ColorName;
} queryTemplateBySearchHandler();
const onCountryNameChangeHandler = (CountryName: string) => { }
queryObj.CountryName = CountryName
} /**
const getLinesHandler = async ()=>{ * 获取线路列表
*/
const getLinesHandler = async () => {
try { try {
let response = await LineService.GetLineListAsync() let response = await LineService.GetLineListAsync()
if(response.data.resultCode==1){ if (response.data.resultCode == 1) {
lines.value= response.data.data lines.value = response.data.data;
console.log(lines.value) }
} catch (error) {
console.log("getLinesHandler", error);
}
}
/**
* 获取模板市场查询条件
*/
const getTemplateQuery = async () => {
try {
let res = await ConfigService.GetTemplateQueryAsync();
if (res.data.resultCode == 1) {
var tempData = res.data.data;
//国家
if (tempData && tempData.CountryList) {
countries.value = tempData.CountryList;
}
//颜色
if (tempData && tempData.ColorList) {
colorArr.value = tempData.ColorList;
} }
} catch (error) { } //季节
} if (tempData && tempData.SeasonList) {
getLinesHandler() seasonArr.value = tempData.SeasonList;
}
}
} catch (error) {
console.log("getTemplateQuery", error);
}
}
getLinesHandler();
getTemplateQuery();
</script> </script>
<style> <style>
@import url('../../assets/styles/common.css'); @import url('../../assets/styles/common.css');
@font-face { @font-face {
font-family: "alifont"; font-family: "alifont";
font-weight: 400; font-weight: 400;
src: url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/285OveHVCHM7.woff2") format("woff2"), src: url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/285OveHVCHM7.woff2") format("woff2"),
url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/pz3etdXOpfWP.woff") format("woff"); url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/pz3etdXOpfWP.woff") format("woff");
font-display: swap; font-display: swap;
} }
.alifont { .alifont {
font-family: alifont; font-family: alifont;
} }
.el-check-tag { .el-check-tag {
background: #FFF; background: #FFF;
font-weight: 500 !important; font-weight: 500 !important;
font-size: 12px !important; font-size: 12px !important;
}</style> }
</style>
\ 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