Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jiaxiu-miniapp
Project
Project
Details
Activity
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
蔡亮华(贵阳日报)
jiaxiu-miniapp
Commits
03dbbbe3
Commit
03dbbbe3
authored
Aug 22, 2024
by
彭佳妮(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
内容更新
parent
9f07bda1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
332 additions
and
38 deletions
+332
-38
.env.development
.env.development
+8
-4
.env.production
.env.production
+2
-2
classify.js
src/api/classify.js
+31
-0
pages.json
src/pages.json
+7
-0
index.vue
src/pages/classify/index.vue
+70
-26
list.vue
src/pages/classify/list.vue
+202
-0
index.vue
src/pages/mine/components/Publish/index.vue
+6
-5
defaultPic.png
src/static/image/defaultPic.png
+0
-0
vite.config.ts
vite.config.ts
+6
-1
No files found.
.env.development
View file @
03dbbbe3
...
...
@@ -5,22 +5,25 @@ VITE_APP_ENV = 'development'
VITE_APP_BASE_URL = '/practice-jiaxiu-mobile/'
# API地址
VITE_APP_BASE_API = 'https://info.gyntv.com.cn/back/ty-visit/ty-visit'
# VITE_APP_BASE_API = 'https://info.gyntv.com.cn/back/ty-visit/ty-visit'
VITE_APP_BASE_API = '/dev-api'
#组织标识
VITE_APP_VISITOR_CODE = 'practice-mediaCatalog'
#文件路径
VITE_APP_FILE_URL = '/download'
# VITE_APP_FILE_URL = '/download'
VITE_APP_FILE_URL = 'https://jiaxiu.gyntv.com.cn//download'
#kkfile地址
VITE_APP_PREVIEW_URL = 'http://jiaxiu.gyntv.com.cn:8012/onlinePreview?url='
VITE_APP_PREVIEW_URL = 'http
s
://jiaxiu.gyntv.com.cn:8012/onlinePreview?url='
#打包文件名称
VITE_APP_OUTDIR_FILENAME = 'practice-jiaxiu-mobile-html'
#systemCode
VITE_APP_SYSTEM_CODE = 'ty-centre'
# VITE_APP_SYSTEM_CODE = 'ty-centre'
VITE_APP_SYSTEM_CODE = 'jiaxiu-centre'
#爽贵阳appid
VITE_APP_SGY_APPID = '685669b8b471aef47e2968a581ca03cd'
\ No newline at end of file
.env.production
View file @
03dbbbe3
...
...
@@ -11,10 +11,10 @@ VITE_APP_BASE_API = 'https://info.gyntv.com.cn/back/ty-visit/ty-visit'
VITE_APP_VISITOR_CODE = 'practice-mediaCatalog'
#文件路径
VITE_APP_FILE_URL = 'https://
info
.gyntv.com.cn//download'
VITE_APP_FILE_URL = 'https://
jiaxiu
.gyntv.com.cn//download'
#kkfile地址
VITE_APP_PREVIEW_URL = 'http://jiaxiu.gyntv.com.cn:8012/onlinePreview?url='
VITE_APP_PREVIEW_URL = 'http
s
://jiaxiu.gyntv.com.cn:8012/onlinePreview?url='
#打包文件名称
VITE_APP_OUTDIR_FILENAME = 'practice-jiaxiu-mobile-html'
...
...
src/api/classify.js
0 → 100644
View file @
03dbbbe3
import
request
from
'@/utils/request'
/**
* @description 分类类型列表查询
* @param {Any} page 分页对象
* @param {Any} data 图组对象
* @returns
*/
export
const
selectClassifyTypeList
=
(
page
,
data
)
=>
{
return
request
({
url
:
`/app/appMediaSelect/getAppClassifyPageInfo/
${
page
.
pageNum
}
/
${
page
.
pageSize
}
`
,
method
:
'post'
,
data
:
data
})
}
/**
* @description 分类列表查询
* @param {Any} page 分页对象
* @param {Any} data 图组对象
* @returns
*/
export
const
selectClassifyList
=
(
page
,
data
)
=>
{
return
request
({
url
:
`/app/appMediaSelect/selectAppMediaByTypeClassifyPage/
${
page
.
pageNum
}
/
${
page
.
pageSize
}
`
,
method
:
'post'
,
data
:
data
})
}
\ No newline at end of file
src/pages.json
View file @
03dbbbe3
...
...
@@ -101,6 +101,13 @@
"meta"
:
{
"requireAuth"
:
true
}
},
{
"path"
:
"pages/classify/list"
,
"name"
:
"classify-list"
,
"style"
:
{
"navigationBarTitleText"
:
"分类列表"
}
}
],
"globalStyle"
:
{
...
...
src/pages/classify/index.vue
View file @
03dbbbe3
...
...
@@ -6,43 +6,87 @@
<div
class=
"search"
>
<div
class=
"s-box"
>
<van-icon
name=
"search"
color=
"#303030"
/>
<input
class=
"placeholder"
placeholder=
"请输入关键词"
v-model=
"
value"
/>
<input
class=
"placeholder"
placeholder=
"请输入关键词"
v-model=
"
queryParams.classifyType"
@
confirm=
"handleRefresh"
/>
</div>
<van-icon
v-if=
"
value"
name=
"clear"
color=
"#969696
"
/>
<van-icon
v-if=
"
queryParams.classifyType"
name=
"clear"
color=
"#969696"
@
tap=
"clear
"
/>
</div>
</div>
</van-sticky>
<div
class=
"content"
>
<div
class=
"list"
>
<div
class=
"item"
v-for=
"(item, index) in 20"
:key=
"index"
>
<img
src=
"/static/image/cover-1.png"
>
<div
class=
"blurbox"
>
<div
class=
"bg"
></div>
<div
class=
"title"
>
XXX专题
</div>
<van-pull-refresh
v-model=
"refreshing"
@
refresh=
"handleRefresh"
>
<van-list
v-model:loading=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
:offset=
"50"
@
load=
"getList"
v-if=
"dataList.length"
>
<div
class=
"list"
>
<div
class=
"item"
v-for=
"(item, index) in dataList"
:key=
"index"
@
click=
"router.push(
{ name: 'classify-list', params: { typeClassify: item.classifyType } })">
<img
src=
"/static/image/defaultPic.png"
>
<div
class=
"blurbox"
>
<div
class=
"bg"
></div>
<div
class=
"title"
>
{{
item
.
classifyType
}}
</div>
</div>
</div>
</div>
</div>
<div
class=
"item"
>
<img
src=
"/static/image/cover-2.png"
>
<div
class=
"blurbox"
>
<div
class=
"bg"
></div>
<div
class=
"title"
>
XXX专题
</div>
</div>
</div>
<div
class=
"item"
>
<img
src=
"/static/image/cover-3.png"
>
<div
class=
"blurbox"
>
<div
class=
"bg"
></div>
<div
class=
"title"
>
XXX专题
</div>
</div>
</div>
</div>
</van-list>
</van-pull-refresh>
</div>
</div>
</
template
>
<
script
setup
>
const
value
=
ref
(
''
)
import
{
selectClassifyTypeList
}
from
'@/api/classify'
;
const
router
=
useRouter
()
const
refreshing
=
ref
(
false
)
const
loading
=
ref
(
false
)
const
finished
=
ref
(
true
)
const
fileDomain
=
import
.
meta
.
env
.
VITE_APP_FILE_URL
import
{
useInitScroll
}
from
'@/hooks/useScroll'
useInitScroll
()
onLoad
(()
=>
{
getList
()
})
const
page
=
reactive
({
pageNum
:
0
,
pageSize
:
12
})
const
queryParams
=
reactive
({
materialType
:
3
,
classifyType
:
''
,
})
const
dataList
=
ref
([])
const
getList
=
async
()
=>
{
page
.
pageNum
++
loading
.
value
=
true
const
res
=
await
selectClassifyTypeList
(
page
,
queryParams
)
setDataList
(
res
)
}
const
setDataList
=
(
res
)
=>
{
if
(
refreshing
.
value
)
{
dataList
.
value
=
res
.
data
.
list
}
else
{
dataList
.
value
.
push
(...
res
.
data
.
list
)
}
loading
.
value
=
false
finished
.
value
=
dataList
.
value
.
length
>=
res
.
data
.
total
refreshing
.
value
=
false
}
const
handleRefresh
=
()
=>
{
refreshing
.
value
=
true
page
.
pageNum
=
0
getList
()
}
const
clear
=
()
=>
{
queryParams
.
classifyType
=
''
handleRefresh
()
}
</
script
>
<
style
scoped
lang=
"scss"
>
...
...
@@ -96,7 +140,7 @@ const value = ref('')
.list
{
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
space-between
;
gap
:
12rpx
;
.item
{
break-inside
:
avoid
;
...
...
src/pages/classify/list.vue
0 → 100644
View file @
03dbbbe3
<
template
>
<van-sticky>
<div
class=
"header"
>
<div
class=
"tools"
>
<van-search
v-model=
"queryParams.materialTitle"
shape=
"round"
placeholder=
"请输入搜索关键词"
@
search=
"handleRefresh"
@
clear=
"handleRefresh"
/>
</div>
</div>
</van-sticky>
<div
class=
"content"
>
<van-pull-refresh
v-model=
"refreshing"
@
refresh=
"handleRefresh"
>
<van-list
v-model:loading=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
:offset=
"50"
@
load=
"getList"
v-if=
"dataList.length"
>
<div
class=
"list"
>
<div
class=
"item"
v-for=
"(item, index) in dataList"
:key=
"index"
@
click=
"router.push(
{ name: 'home-content', params: { id: item.materialId } })">
<img
:src=
"fileDomain + item.coverpicture"
>
<div
class=
"desc"
>
<span
class=
"title"
>
<van-text-ellipsis
:content=
"item.materialTitle"
/>
</span>
<div
class=
"tag"
>
<span
v-for=
"(tagName, index) in item.tagName.split(',')"
:key=
"index"
>
{{
tagName
}}
</span>
</div>
<div
class=
"info"
>
<div
class=
"user"
>
<img
src=
"../../static/image/avatar.png"
>
<span>
{{
item
.
author
}}
</span>
</div>
<div
class=
"collect"
>
<van-icon
name=
"star-o"
color=
"#9F9F9F"
v-if=
"index
<
5
"
/>
<van-icon
name=
"star"
color=
"#F1C13E"
v-else
/>
<span>
收藏
</span>
</div>
</div>
</div>
</div>
</div>
</van-list>
<van-empty
description=
"暂无数据"
v-else
/>
</van-pull-refresh>
</div>
</
template
>
<
script
setup
>
import
{
selectClassifyList
}
from
'@/api/classify'
;
const
router
=
useRouter
()
const
refreshing
=
ref
(
false
)
const
loading
=
ref
(
false
)
const
finished
=
ref
(
true
)
const
fileDomain
=
import
.
meta
.
env
.
VITE_APP_FILE_URL
onLoad
((
options
)
=>
{
console
.
log
(
options
)
queryParams
.
typeClassify
=
options
.
typeClassify
getList
()
})
const
page
=
reactive
({
pageNum
:
0
,
pageSize
:
10
})
const
queryParams
=
reactive
({
materialTitle
:
''
,
materialType
:
3
,
typeClassify
:
null
,
})
const
dataList
=
ref
([])
const
getList
=
async
()
=>
{
page
.
pageNum
++
loading
.
value
=
true
const
res
=
await
selectClassifyList
(
page
,
queryParams
)
setDataList
(
res
)
}
const
setDataList
=
(
res
)
=>
{
if
(
refreshing
.
value
)
{
dataList
.
value
=
res
.
data
.
list
}
else
{
dataList
.
value
.
push
(...
res
.
data
.
list
)
}
loading
.
value
=
false
finished
.
value
=
dataList
.
value
.
length
>=
res
.
data
.
total
refreshing
.
value
=
false
}
</
script
>
<
style
scoped
lang=
"scss"
>
.header
{
padding
:
10px
;
background-color
:
#ffffff
;
box-shadow
:
0px
3px
5px
rgba
(
0
,
0
,
0
,
0
.1
);
.tools
{
:deep
(
.van-search
)
{
flex
:
1
;
padding
:
0
;
}
}
}
.header-placeholder
{
height
:
117px
;
}
.content
{
background-color
:
#f3f3f3
;
padding
:
10px
10px
0
10px
;
min-height
:
100vh
;
.list
{
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
space-between
;
.item
{
break-inside
:
avoid
;
background-color
:
#ffffff
;
border-radius
:
5px
;
margin-bottom
:
10px
;
width
:
49%
;
img
{
width
:
100%
;
height
:
150px
;
object-fit
:
cover
;
}
.desc
{
padding
:
5px
10px
;
display
:
flex
;
flex-direction
:
column
;
gap
:
5px
;
.title
{
font-size
:
16px
;
}
.tag
{
display
:
flex
;
flex-wrap
:
wrap
;
gap
:
3px
;
span
{
font-size
:
14px
;
padding
:
0
5px
;
background-color
:
#F3F8FF
;
color
:
#4C70AC
;
font-size
:
12
PX
;
border-radius
:
3px
;
}
}
.info
{
display
:
flex
;
justify-content
:
space-between
;
padding
:
5px
0
;
.user
{
display
:
flex
;
gap
:
7px
;
align-items
:
center
;
img
{
width
:
23px
;
height
:
23px
;
border-radius
:
50%
;
}
span
{
color
:
#9F9F9F
;
font-size
:
12px
;
}
}
}
.collect
{
display
:
flex
;
align-items
:
center
;
gap
:
3px
;
span
{
color
:
#9F9F9F
;
font-size
:
12px
;
}
}
}
}
}
}
.active
{
background-color
:
#0e7ce3
!
important
;
color
:
#ffffff
!
important
;
}
</
style
>
\ No newline at end of file
src/pages/mine/components/Publish/index.vue
View file @
03dbbbe3
...
...
@@ -54,11 +54,7 @@ const fieldNames = {
};
const
buildTree
=
(
items
)
=>
{
const
tree
=
[{
id
:
'0'
,
organName
:
'无组织'
,
children
:
[]
}]
const
tree
=
[]
const
lookup
=
{}
// 初始化lookup对象,方便后续快速查找
...
...
@@ -80,6 +76,11 @@ const buildTree = (items) => {
lookup
[
item
.
superiorId
].
children
.
push
(
lookup
[
item
.
id
]);
}
});
tree
.
push
({
id
:
'0'
,
organName
:
'无组织'
,
children
:
[]
})
return
removeEmptyChildren
(
tree
)
}
...
...
src/static/image/defaultPic.png
0 → 100644
View file @
03dbbbe3
39.3 KB
vite.config.ts
View file @
03dbbbe3
...
...
@@ -44,7 +44,7 @@ export default defineConfig(({ mode }) => {
host
:
'0.0.0.0'
,
proxy
:
{
'/dev-api'
:
{
target
:
'https://
info.gyntv.com.cn/back/ty-visit/ty
-visit'
,
target
:
'https://
jiaxiu.gyntv.com.cn/back/jiaxiu-visit/jiaxiu
-visit'
,
changeOrigin
:
true
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
dev-api/
,
""
),
bypass
:
(
req
,
res
,
options
)
=>
res
.
setHeader
(
"x-req-proxyUr1"
,
options
.
target
+
req
.
url
.
replace
(
'/dev-api'
,
''
))
...
...
@@ -54,6 +54,11 @@ export default defineConfig(({ mode }) => {
changeOrigin
:
true
,
bypass
:
(
req
,
res
,
options
)
=>
res
.
setHeader
(
"x-req-proxyUr1"
,
options
.
target
+
req
.
url
)
},
'/back/jiaxiu-visit/jiaxiu-visit'
:
{
target
:
'https://jiaxiu.gyntv.com.cn'
,
changeOrigin
:
true
,
bypass
:
(
req
,
res
,
options
)
=>
res
.
setHeader
(
"x-req-proxyUr1"
,
options
.
target
+
req
.
url
)
},
'/download'
:
{
target
:
VITE_APP_ENV
===
'production'
?
'https://info.gyntv.com.cn/'
:
'https://info.gyntv.com.cn/'
,
changeOrigin
:
true
,
...
...
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