Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
pptist
Commits
57869847
Commit
57869847
authored
Nov 20, 2023
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增接口
parent
29468978
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
168 additions
and
50 deletions
+168
-50
ConfigService.ts
src/services/ConfigService.ts
+24
-0
Index.vue
src/views/Market/Index.vue
+144
-50
No files found.
src/services/ConfigService.ts
0 → 100644
View file @
57869847
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
src/views/Market/Index.vue
View file @
57869847
...
...
@@ -17,17 +17,34 @@
<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.
l
ineId == 0"
@
change=
"onLineChangeHandler(0)"
<el-check-tag
:checked=
"queryObj.
L
ineId == 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>
...
...
@@ -35,56 +52,133 @@
</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
queryObj
=
reactive
({
lineId
:
0
,
Title
:
''
,
CountryName
:
''
})
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
queryObj
=
reactive
({
pageIndex
:
1
,
pageSize
:
10
,
LineId
:
0
,
Title
:
''
,
CountryName
:
''
,
SeasonName
:
''
,
ColorName
:
''
})
/***
* 获取模板市场分页列表
*/
const
queryTemplateBySearchHandler
=
()
=>
{
try
{
let
pageRes
=
ConfigService
.
GetTemplagePageAsync
(
queryObj
);
console
.
log
(
"queryTemplateBySearchHandler"
,
pageRes
);
}
catch
(
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
)
}
}
catch
(
error
)
{
}
}
getLinesHandler
()
}
//线路切换
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
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
);
}
}
getLinesHandler
();
getTemplateQuery
();
</
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment