Commit e73c342c authored by zhengke's avatar zhengke

no message

parents 2a0a78d4 115d88c7
......@@ -65,7 +65,7 @@ const getErrorCode2text = (response: AxiosResponse): string => {
* service.get<{data: string; code: number}>('/test').then(({data}) => { console.log(data.code) })
*/
const service = Axios.create({
baseURL: 'http://192.168.10.214/api/common/post',//'http://192.168.10.160/api/common/post',
baseURL: 'http://192.168.10.214/api/common/post',
timeout: 20000,
headers: {
'User-Type': 'bus',
......
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,74 +17,193 @@
<div class="q-mt-lg bg-white q-pa-lg rounded">
<div class="row text-small items-center">
<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>
<el-check-tag :checked="queryObj.lineId == x.LineID" @change="onLineChangeHandler(x.LineID)" class="text-small q-mr-md"
v-for="x in lines" :key="x.LineID">{{x.LineName}}</el-check-tag>
<el-check-tag :checked="queryObj.LineId == x.LineID" @change="onLineChangeHandler(x.LineID)"
class="text-small q-mr-md" v-for="x in lines" :key="x.LineID">{{x.LineName}}</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.CountryName == ''" @change="onCountryNameChangeHandler('')" class="text-small q-mr-md">通用</el-check-tag>
<el-check-tag :checked="queryObj.CountryName == x" @change="onCountryNameChangeHandler(x)" class="text-small q-mr-md"
v-for="(x,i) in countries" :key="i">{{x}}</el-check-tag>
<el-check-tag :checked="queryObj.CountryName == ''" @change="onCountryNameChangeHandler('')"
class="text-small q-mr-md">通用</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 class="q-mt-lg bg-white q-pa-lg rounded" style="height:200px;">
<template v-for="(item,index) in dataList">
<div style="width:200px;height:200px;" @click="goToTemplate(item)">
<img :src="item.CoverImg" style="width:100px;height:80px" />
<br />
<span>{{item.Title}}</span>
</div>
</template>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { reactive, ref } from "vue";
import LineService from '@/services/LineService'
import { userStore } from "@/store/user";
import { storeToRefs } from "pinia";
import {
reactive,
ref
} 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 lines = ref([] as Array < any > ) //线路
const countries = ref(['日本', '韩国', '老挝', '法国', '意大利'] as Array < any > ) //国家
const colorArr = ref([] as Array < any > ); //颜色
const seasonArr = ref([] as Array < any > ); //季节
const dataList = ref([] as Array < any > ); //模板数据列表
const queryObj = reactive({
pageIndex: 1,
pageSize: 10,
LineId: 0, //线路Id
Title: '', //模板名称
CountryName: '', //国家名称
SeasonName: '', //季节名称
ColorName: '', //颜色名称
totalCount: 0, //总调试
pageCount: 0, //总页数
})
const {userInfo} = storeToRefs(userStore())
const lines = ref([] as Array<any>)
const countries = ref(['日本','韩国','老挝','法国','意大利'] as Array<any>)
const queryObj = reactive({
lineId: 0,
Title: '',
CountryName:''
})
/**
* 页面跳转
*/
const goToTemplate = (item: any) => {
console.log("item", item);
}
/***
* 获取模板市场分页列表
*/
const queryTemplateBySearchHandler = async () => {
try {
let pageRes = await ConfigService.GetTemplagePageAsync(queryObj);
console.log("queryTemplateBySearchHandler", pageRes);
if (pageRes.data.resultCode == 1) {
dataList.value = pageRes.data.data.pageData;
queryObj.totalCount = pageRes.data.data.count;
queryObj.pageCount = pageRes.data.data.pageCount;
}
} catch (error) {
console.log("queryTemplateBySearchHandler", 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 onColorNameChangeHandler = (ColorName: string) => {
queryObj.ColorName = ColorName;
queryTemplateBySearchHandler();
}
/**
* 获取线路列表
*/
const getLinesHandler = async () => {
try {
let response = await LineService.GetLineListAsync()
if (response.data.resultCode == 1) {
lines.value = response.data.data;
}
} catch (error) {
console.log("getLinesHandler", error);
}
}
const queryTemplateBySearchHandler = () => { }
const onLineChangeHandler = (lineId: number) => {
queryObj.lineId = lineId
}
const onCountryNameChangeHandler = (CountryName: string) => {
queryObj.CountryName = CountryName
}
const getLinesHandler = async ()=>{
try {
let response = await LineService.GetLineListAsync()
if(response.data.resultCode==1){
lines.value= response.data.data
console.log(lines.value)
/**
* 获取模板市场查询条件
*/
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;
}
//季节
if (tempData && tempData.SeasonList) {
seasonArr.value = tempData.SeasonList;
}
}
} catch (error) {
console.log("getTemplateQuery", error);
}
} catch (error) { }
}
getLinesHandler()
}
getLinesHandler();
getTemplateQuery();
queryTemplateBySearchHandler();
</script>
<style>
@import url('../../assets/styles/common.css');
@import url('../../assets/styles/common.css');
@font-face {
font-family: "alifont";
font-weight: 400;
src: url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/285OveHVCHM7.woff2") format("woff2"),
url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/pz3etdXOpfWP.woff") format("woff");
font-display: swap;
}
@font-face {
font-family: "alifont";
font-weight: 400;
src: url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/285OveHVCHM7.woff2") format("woff2"),
url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/pz3etdXOpfWP.woff") format("woff");
font-display: swap;
}
.alifont {
font-family: alifont;
}
.alifont {
font-family: alifont;
}
.el-check-tag {
background: #FFF;
font-weight: 500 !important;
font-size: 12px !important;
}</style>
.el-check-tag {
background: #FFF;
font-weight: 500 !important;
font-size: 12px !important;
}
</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