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
dea5d617
Commit
dea5d617
authored
Jul 10, 2024
by
彭佳妮(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定位
parent
0842e17a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
105 additions
and
60 deletions
+105
-60
index.html
index.html
+14
-16
package.json
package.json
+1
-0
main.ts
src/main.ts
+12
-10
manifest.json
src/manifest.json
+7
-0
index.vue
src/pages/publish/components/AtlasInfo/index.vue
+18
-5
index.vue
src/pages/publish/components/AtlasUpload/index.vue
+41
-29
yarn.lock
yarn.lock
+12
-0
No files found.
index.html
View file @
dea5d617
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
/>
<script>
var
coverSupport
=
'CSS'
in
window
&&
typeof
CSS
.
supports
===
'function'
&&
(
CSS
.
supports
(
'top: env(a)'
)
||
CSS
.
supports
(
'top: constant(a)'
))
document
.
write
(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0'
+
(
coverSupport
?
', viewport-fit=cover'
:
''
)
+
'" />'
)
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<head>
<meta
charset=
"UTF-8"
>
<link
rel=
"icon"
href=
"/favicon.ico"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"
/>
<title>
甲秀图库
</title>
</head>
<body>
<div
id=
"app"
>
<!--app-html-->
</div>
<script
type=
"module"
src=
"/src/main.ts"
></script>
</body>
</html>
</body>
</html>
\ No newline at end of file
package.json
View file @
dea5d617
...
...
@@ -27,6 +27,7 @@
"
axios
"
:
"^1.7.2"
,
"
dayjs
"
:
"^1.11.11"
,
"
pinia
"
:
"2.0.36"
,
"
pinia-plugin-persist
"
:
"^1.0.0"
,
"
vant
"
:
"^4.9.1"
,
"
vconsole
"
:
"^3.15.1"
,
"
vue
"
:
"^3.3.11"
,
...
...
src/main.ts
View file @
dea5d617
import
{
createSSRApp
}
from
"vue"
;
import
App
from
"./App.vue"
;
import
store
from
"./store"
;
import
{
createPinia
}
from
'pinia'
import
piniaPersist
from
'pinia-plugin-persist'
import
router
from
"./router"
;
import
Vconsole
from
"vconsole"
;
import
'vant/es/toast/style'
import
'vant/es/dialog/style'
import
'vant/es/notify/style'
import
'vant/es/image-preview/style'
// import '@/utils/interceptor.js'
export
function
createApp
()
{
const
app
=
createSSRApp
(
App
);
app
.
use
(
store
);
app
.
use
(
router
);
let
vConsole
=
new
Vconsole
();
app
.
use
(
vConsole
);
return
{
app
,
};
const
app
=
createSSRApp
(
App
);
const
pinia
=
createPinia
()
pinia
.
use
(
piniaPersist
)
app
.
use
(
pinia
)
app
.
use
(
router
);
let
vConsole
=
new
Vconsole
();
app
.
use
(
vConsole
);
return
{
app
,
};
}
src/manifest.json
View file @
dea5d617
...
...
@@ -74,6 +74,13 @@
"base"
:
"./"
,
"mode"
:
"hash"
},
"sdkConfigs"
:
{
"maps"
:
{
"qqmap"
:
{
"key"
:
"H2OBZ-4BRCV-HFTPF-5WH3N-TOXK5-NSBYX"
}
}
},
"optimization"
:
{
"treeShaking"
:
{
"enable"
:
true
...
...
src/pages/publish/components/AtlasInfo/index.vue
View file @
dea5d617
...
...
@@ -8,10 +8,12 @@
</div>
<div
class=
"form"
>
<van-field
v-model=
"formData.area"
is-link
readonly
label=
"拍摄地区"
placeholder=
"请选择拍摄地区"
<
!--
<
van-field
v-model=
"formData.area"
is-link
readonly
label=
"拍摄地区"
placeholder=
"请选择拍摄地区"
@
click=
"showArea = true"
:rules=
"[
{ required: true, message: '请选择拍摄地区' }]" />
<van-field
v-model=
"formData.address"
label=
"详细地址"
placeholder=
"请填写拍摄详细地址"
:rules=
"[
{ required: true, message: '请填写拍摄详细地址' }]" />
:rules=
"[
{ required: true, message: '请填写拍摄详细地址' }]" /> -->
<van-field
v-model=
"formData.shootLocation"
is-link
readonly
label=
"拍摄地区"
placeholder=
"请选择拍摄地区"
@
click=
"handleRegionPicker"
:rules=
"[
{ required: true, message: '请选择拍摄地区' }]" />
<van-field
v-model=
"formData.shoottime"
is-link
readonly
label=
"拍摄时间"
placeholder=
"请选择拍摄时间"
@
click=
" showShoottimeCalendar = true"
:rules=
"[
{ required: true, message: '请选择拍摄时间' }]" />
<van-field
v-model=
"formData.materialtime"
is-link
readonly
label=
"入库时间"
placeholder=
"请选择入库时间"
...
...
@@ -33,9 +35,9 @@
</div>
</van-form>
</div>
<van-popup
v-model:show=
"showArea"
position=
"bottom"
>
<
!--
<
van-popup
v-model:show=
"showArea"
position=
"bottom"
>
<van-area
:area-list=
"areaList"
@
confirm=
"areaConfirm"
@
cancel=
"showArea = false"
/>
</van-popup>
</van-popup>
-->
<van-calendar
v-model:show=
"showShoottimeCalendar"
:min-date=
"minDate"
@
confirm=
"shoottimeCalendarConfirm"
/>
<van-calendar
v-model:show=
"showMaterialtimeCalendar"
:min-date=
"minDate"
@
confirm=
"materialtimeCalendarConfirm"
/>
</
template
>
...
...
@@ -55,7 +57,7 @@ const handlePre = () => {
}
const
handleSubmit
=
()
=>
{
formData
.
value
.
shootLocation
=
formData
.
value
.
area
+
formData
.
value
.
address
//
formData.value.shootLocation = formData.value.area + formData.value.address
emits
(
'confirm'
,
{
code
:
'submit'
,
catalog
:
formData
.
value
})
}
...
...
@@ -73,6 +75,17 @@ const materialtimeCalendarConfirm = (data) => {
showMaterialtimeCalendar
.
value
=
false
formData
.
value
.
materialtime
=
dayjs
(
data
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
const
handleRegionPicker
=
()
=>
{
xma
.
chooseLocation
({
success
:
function
(
res
)
{
formData
.
value
.
shootLocation
=
res
.
address
},
fail
:
function
(
err
)
{
console
.
log
(
err
)
}
});
}
</
script
>
<
style
lang=
"scss"
scoped
>
.container
{
...
...
src/pages/publish/components/AtlasUpload/index.vue
View file @
dea5d617
...
...
@@ -4,7 +4,7 @@
<div
class=
"header"
>
<span
class=
"title"
>
图组上传
</span>
<span
class=
"btn"
@
click=
"handleUpload"
><van-icon
name=
"plus"
size=
"14"
/>
新增图片
</span>
<
input
type=
"file"
hidden
ref=
"inputRef"
accept=
"image/*"
@
change=
"changeFile"
:multiple=
"true"
>
<
!--
<input
type=
"file"
hidden
ref=
"inputRef"
accept=
"image/*"
@
change=
"changeFile"
:multiple=
"true"
>
--
>
</div>
<div
class=
"list"
>
<div
class=
"item"
v-for=
"(item, index) in fileList"
:key=
"index"
>
...
...
@@ -53,35 +53,41 @@ const footerRef = ref()
const
inputRef
=
ref
()
const
fileList
=
ref
([])
const
fileSize
=
ref
(
0
)
const
handleUpload
=
()
=>
{
console
.
log
(
inputRef
)
inputRef
.
value
.
click
()
}
const
handleDelete
=
(
index
)
=>
{
fileList
.
value
.
splice
(
index
,
1
)
}
const
changeFile
=
(
e
)
=>
{
const
files
=
e
.
target
.
f
iles
for
(
let
i
=
0
;
i
<
files
.
length
;
i
++
)
{
const
item
=
files
[
i
]
const
index
=
fileList
.
value
.
push
(
item
)
-
1
let
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
item
)
reader
.
onload
=
async
(
e
)
=>
{
item
.
src
=
e
.
target
.
result
fileList
.
value
.
splice
(
index
,
1
,
{
...
item
})
item
.
uploadResult
=
await
uploadFile
(
item
,
(
e
)
=>
{
item
.
progress
=
Math
.
floor
(
(
e
.
loaded
/
e
.
total
)
*
100
,
)
fileList
.
value
.
splice
(
index
,
1
,
{
...
item
})
})
fileSize
.
value
+=
parseInt
(
item
.
uploadResult
.
data
.
compressNameAndPath
[
0
].
size
)
fileList
.
value
.
splice
(
index
,
1
,
{
...
item
})
}
// inputRef.value.click(
)
xma
.
chooseImage
({
count
:
20
,
//默认9
sizeType
:
[
'original'
,
'compressed'
],
//可以指定是原图还是压缩图,默认二者都有
sourceType
:
[
'album'
],
//从相册选择
success
:
function
(
res
)
{
console
.
log
(
res
.
tempFiles
);
const
files
=
res
.
tempF
iles
for
(
let
i
=
0
;
i
<
files
.
length
;
i
++
)
{
const
item
=
files
[
i
]
const
index
=
fileList
.
value
.
push
(
item
)
-
1
let
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
item
)
reader
.
onload
=
async
(
e
)
=>
{
item
.
src
=
e
.
target
.
result
fileList
.
value
.
splice
(
index
,
1
,
{
...
item
})
item
.
uploadResult
=
await
uploadFile
(
item
,
(
e
)
=>
{
item
.
progress
=
Math
.
floor
(
(
e
.
loaded
/
e
.
total
)
*
100
,
)
fileList
.
value
.
splice
(
index
,
1
,
{
...
item
})
})
fileSize
.
value
+=
parseInt
(
item
.
uploadResult
.
data
.
compressNameAndPath
[
0
].
size
)
fileList
.
value
.
splice
(
index
,
1
,
{
...
item
})
}
}
}
},
});
}
const
handleDelete
=
(
index
)
=>
{
fileList
.
value
.
splice
(
index
,
1
)
}
const
emits
=
defineEmits
([
"confirm"
])
...
...
@@ -149,12 +155,14 @@ const handleNext = () => {
gap
:
10px
;
.logo
{
flex
:
0
0
35%
;
// flex: 0 0 35%;
width
:
120px
;
height
:
90px
;
position
:
relative
;
img
{
width
:
100%
;
height
:
100
px
;
height
:
100
%
;
object-fit
:
cover
;
border-radius
:
5px
;
}
...
...
@@ -176,6 +184,7 @@ const handleNext = () => {
display
:
flex
;
flex-direction
:
column
;
gap
:
10px
;
box-sizing
:
border-box
;
.title
{
color
:
#545454
;
...
...
@@ -188,6 +197,9 @@ const handleNext = () => {
border-radius
:
5px
;
font-size
:
14px
;
padding
:
10px
;
width
:
100%
;
box-sizing
:
border-box
;
resize
:
none
;
}
}
}
...
...
yarn.lock
View file @
dea5d617
...
...
@@ -3848,6 +3848,13 @@ pify@^2.3.0:
resolved "https://registry.npmmirror.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==
pinia-plugin-persist@^1.0.0:
version "1.0.0"
resolved "https://registry.npmmirror.com/pinia-plugin-persist/-/pinia-plugin-persist-1.0.0.tgz#fc696f225527f30bd5955109fafadd43c725e888"
integrity sha512-M4hBBd8fz/GgNmUPaaUsC29y1M09lqbXrMAHcusVoU8xlQi1TqgkWnnhvMikZwr7Le/hVyMx8KUcumGGrR6GVw==
dependencies:
vue-demi "^0.12.1"
pinia@2.0.36:
version "2.0.36"
resolved "https://registry.npmmirror.com/pinia/-/pinia-2.0.36.tgz#65130f3b94cc7fe25156308634010fab893dff24"
...
...
@@ -4627,6 +4634,11 @@ vue-demi@*:
resolved "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.8.tgz#00335e9317b45e4a68d3528aaf58e0cec3d5640a"
integrity sha512-Uuqnk9YE9SsWeReYqK2alDI5YzciATE0r2SkA6iMAtuXvNTMNACJLJEXNXaEy94ECuBe4Sk6RzRU80kjdbIo1Q==
vue-demi@^0.12.1:
version "0.12.5"
resolved "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.12.5.tgz#8eeed566a7d86eb090209a11723f887d28aeb2d1"
integrity sha512-BREuTgTYlUr0zw0EZn3hnhC3I6gPWv+Kwh4MCih6QcAeaTlaIX0DwOVN0wHej7hSvDPecz4jygy/idsgKfW58Q==
vue-i18n@^9.1.9:
version "9.13.1"
resolved "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.13.1.tgz#a292c8021b7be604ebfca5609ae1f8fafe5c36d7"
...
...
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