定位

parent 0842e17a
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<meta charset="UTF-8" /> <head>
<script> <meta charset="UTF-8">
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || <link rel="icon" href="/favicon.ico">
CSS.supports('top: constant(a)')) <meta name="viewport"
document.write( content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + <title>甲秀图库</title>
(coverSupport ? ', viewport-fit=cover' : '') + '" />') </head>
</script>
<title></title> <body>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div> <div id="app"><!--app-html--></div>
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
"axios": "^1.7.2", "axios": "^1.7.2",
"dayjs": "^1.11.11", "dayjs": "^1.11.11",
"pinia": "2.0.36", "pinia": "2.0.36",
"pinia-plugin-persist": "^1.0.0",
"vant": "^4.9.1", "vant": "^4.9.1",
"vconsole": "^3.15.1", "vconsole": "^3.15.1",
"vue": "^3.3.11", "vue": "^3.3.11",
......
import { createSSRApp } from "vue"; import { createSSRApp } from "vue";
import App from "./App.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 router from "./router";
import Vconsole from "vconsole"; import Vconsole from "vconsole";
import 'vant/es/toast/style' import 'vant/es/toast/style'
import 'vant/es/dialog/style' import 'vant/es/dialog/style'
import 'vant/es/notify/style' import 'vant/es/notify/style'
import 'vant/es/image-preview/style' import 'vant/es/image-preview/style'
// import '@/utils/interceptor.js'
export function createApp() { export function createApp() {
const app = createSSRApp(App); const app = createSSRApp(App);
app.use(store); const pinia = createPinia()
pinia.use(piniaPersist)
app.use(pinia)
app.use(router); app.use(router);
let vConsole = new Vconsole(); let vConsole = new Vconsole();
app.use(vConsole); app.use(vConsole);
......
...@@ -74,6 +74,13 @@ ...@@ -74,6 +74,13 @@
"base" : "./", "base" : "./",
"mode" : "hash" "mode" : "hash"
}, },
"sdkConfigs" : {
"maps" : {
"qqmap" : {
"key" : "H2OBZ-4BRCV-HFTPF-5WH3N-TOXK5-NSBYX"
}
}
},
"optimization" : { "optimization" : {
"treeShaking" : { "treeShaking" : {
"enable" : true "enable" : true
......
...@@ -8,10 +8,12 @@ ...@@ -8,10 +8,12 @@
</div> </div>
<div class="form"> <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: '请选择拍摄地区' }]" /> @click="showArea = true" :rules="[{ required: true, message: '请选择拍摄地区' }]" />
<van-field v-model="formData.address" label="详细地址" placeholder="请填写拍摄详细地址" <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="请选择拍摄时间" <van-field v-model="formData.shoottime" is-link readonly label="拍摄时间" placeholder="请选择拍摄时间"
@click=" showShoottimeCalendar = true" :rules="[{ required: true, message: '请选择拍摄时间' }]" /> @click=" showShoottimeCalendar = true" :rules="[{ required: true, message: '请选择拍摄时间' }]" />
<van-field v-model="formData.materialtime" is-link readonly label="入库时间" placeholder="请选择入库时间" <van-field v-model="formData.materialtime" is-link readonly label="入库时间" placeholder="请选择入库时间"
...@@ -33,9 +35,9 @@ ...@@ -33,9 +35,9 @@
</div> </div>
</van-form> </van-form>
</div> </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-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="showShoottimeCalendar" :min-date="minDate" @confirm="shoottimeCalendarConfirm" />
<van-calendar v-model:show="showMaterialtimeCalendar" :min-date="minDate" @confirm="materialtimeCalendarConfirm" /> <van-calendar v-model:show="showMaterialtimeCalendar" :min-date="minDate" @confirm="materialtimeCalendarConfirm" />
</template> </template>
...@@ -55,7 +57,7 @@ const handlePre = () => { ...@@ -55,7 +57,7 @@ const handlePre = () => {
} }
const handleSubmit = () => { 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 }) emits('confirm', { code: 'submit', catalog: formData.value })
} }
...@@ -73,6 +75,17 @@ const materialtimeCalendarConfirm = (data) => { ...@@ -73,6 +75,17 @@ const materialtimeCalendarConfirm = (data) => {
showMaterialtimeCalendar.value = false showMaterialtimeCalendar.value = false
formData.value.materialtime = dayjs(data).format('YYYY-MM-DD HH:mm:ss') 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="header"> <div class="header">
<span class="title">图组上传</span> <span class="title">图组上传</span>
<span class="btn" @click="handleUpload"><van-icon name="plus" size="14" />新增图片</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>
<div class="list"> <div class="list">
<div class="item" v-for="(item, index) in fileList" :key="index"> <div class="item" v-for="(item, index) in fileList" :key="index">
...@@ -53,15 +53,16 @@ const footerRef = ref() ...@@ -53,15 +53,16 @@ const footerRef = ref()
const inputRef = ref() const inputRef = ref()
const fileList = ref([]) const fileList = ref([])
const fileSize = ref(0) const fileSize = ref(0)
const handleUpload = () => { const handleUpload = () => {
console.log(inputRef) // inputRef.value.click()
inputRef.value.click() xma.chooseImage({
} count: 20, //默认9
const handleDelete=(index)=>{ sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
fileList.value.splice(index,1) sourceType: ['album'], //从相册选择
} success: function (res) {
const changeFile = (e) => { console.log(res.tempFiles);
const files = e.target.files const files = res.tempFiles
for (let i = 0; i < files.length; i++) { for (let i = 0; i < files.length; i++) {
const item = files[i] const item = files[i]
const index = fileList.value.push(item) - 1 const index = fileList.value.push(item) - 1
...@@ -81,7 +82,12 @@ const changeFile = (e) => { ...@@ -81,7 +82,12 @@ const changeFile = (e) => {
} }
} }
},
});
}
const handleDelete = (index) => {
fileList.value.splice(index, 1)
} }
const emits = defineEmits(["confirm"]) const emits = defineEmits(["confirm"])
...@@ -149,12 +155,14 @@ const handleNext = () => { ...@@ -149,12 +155,14 @@ const handleNext = () => {
gap: 10px; gap: 10px;
.logo { .logo {
flex: 0 0 35%; // flex: 0 0 35%;
width: 120px;
height: 90px;
position: relative; position: relative;
img { img {
width: 100%; width: 100%;
height: 100px; height: 100%;
object-fit: cover; object-fit: cover;
border-radius: 5px; border-radius: 5px;
} }
...@@ -176,6 +184,7 @@ const handleNext = () => { ...@@ -176,6 +184,7 @@ const handleNext = () => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 10px; gap: 10px;
box-sizing: border-box;
.title { .title {
color: #545454; color: #545454;
...@@ -188,6 +197,9 @@ const handleNext = () => { ...@@ -188,6 +197,9 @@ const handleNext = () => {
border-radius: 5px; border-radius: 5px;
font-size: 14px; font-size: 14px;
padding: 10px; padding: 10px;
width: 100%;
box-sizing: border-box;
resize: none;
} }
} }
} }
......
...@@ -3848,6 +3848,13 @@ pify@^2.3.0: ...@@ -3848,6 +3848,13 @@ pify@^2.3.0:
resolved "https://registry.npmmirror.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" resolved "https://registry.npmmirror.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== 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: pinia@2.0.36:
version "2.0.36" version "2.0.36"
resolved "https://registry.npmmirror.com/pinia/-/pinia-2.0.36.tgz#65130f3b94cc7fe25156308634010fab893dff24" resolved "https://registry.npmmirror.com/pinia/-/pinia-2.0.36.tgz#65130f3b94cc7fe25156308634010fab893dff24"
...@@ -4627,6 +4634,11 @@ vue-demi@*: ...@@ -4627,6 +4634,11 @@ vue-demi@*:
resolved "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.8.tgz#00335e9317b45e4a68d3528aaf58e0cec3d5640a" resolved "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.8.tgz#00335e9317b45e4a68d3528aaf58e0cec3d5640a"
integrity sha512-Uuqnk9YE9SsWeReYqK2alDI5YzciATE0r2SkA6iMAtuXvNTMNACJLJEXNXaEy94ECuBe4Sk6RzRU80kjdbIo1Q== 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: vue-i18n@^9.1.9:
version "9.13.1" version "9.13.1"
resolved "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.13.1.tgz#a292c8021b7be604ebfca5609ae1f8fafe5c36d7" resolved "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.13.1.tgz#a292c8021b7be604ebfca5609ae1f8fafe5c36d7"
......
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