Compare commits
No commits in common. "5c89ba97c4e35862b7f0c4df744460b64285b363" and "2d502e6bb1137300fa9e1b7170381c6337325a92" have entirely different histories.
5c89ba97c4
...
2d502e6bb1
|
@ -17,7 +17,6 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vant/touch-emulator": "1.4.0",
|
"@vant/touch-emulator": "1.4.0",
|
||||||
"axios": "1.7.9",
|
"axios": "1.7.9",
|
||||||
"compressorjs": "1.2.1",
|
|
||||||
"dayjs": "1.11.13",
|
"dayjs": "1.11.13",
|
||||||
"js-cookie": "3.0.5",
|
"js-cookie": "3.0.5",
|
||||||
"lodash-es": "4.17.21",
|
"lodash-es": "4.17.21",
|
||||||
|
|
|
@ -14,9 +14,6 @@ importers:
|
||||||
axios:
|
axios:
|
||||||
specifier: 1.7.9
|
specifier: 1.7.9
|
||||||
version: 1.7.9
|
version: 1.7.9
|
||||||
compressorjs:
|
|
||||||
specifier: 1.2.1
|
|
||||||
version: 1.2.1
|
|
||||||
dayjs:
|
dayjs:
|
||||||
specifier: 1.11.13
|
specifier: 1.11.13
|
||||||
version: 1.11.13
|
version: 1.11.13
|
||||||
|
@ -1804,9 +1801,6 @@ packages:
|
||||||
birpc@0.2.19:
|
birpc@0.2.19:
|
||||||
resolution: {integrity: sha512-5WeXXAvTmitV1RqJFppT5QtUiz2p1mRSYU000Jkft5ZUCLJIk4uQriYNO50HknxKwM6jd8utNc66K1qGIwwWBQ==}
|
resolution: {integrity: sha512-5WeXXAvTmitV1RqJFppT5QtUiz2p1mRSYU000Jkft5ZUCLJIk4uQriYNO50HknxKwM6jd8utNc66K1qGIwwWBQ==}
|
||||||
|
|
||||||
blueimp-canvas-to-blob@3.29.0:
|
|
||||||
resolution: {integrity: sha512-0pcSSGxC0QxT+yVkivxIqW0Y4VlO2XSDPofBAqoJ1qJxgH9eiUDLv50Rixij2cDuEfx4M6DpD9UGZpRhT5Q8qg==}
|
|
||||||
|
|
||||||
boolbase@1.0.0:
|
boolbase@1.0.0:
|
||||||
resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==}
|
resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==}
|
||||||
|
|
||||||
|
@ -1935,9 +1929,6 @@ packages:
|
||||||
resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==}
|
resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==}
|
||||||
engines: {node: '>= 12.0.0'}
|
engines: {node: '>= 12.0.0'}
|
||||||
|
|
||||||
compressorjs@1.2.1:
|
|
||||||
resolution: {integrity: sha512-+geIjeRnPhQ+LLvvA7wxBQE5ddeLU7pJ3FsKFWirDw6veY3s9iLxAQEw7lXGHnhCJvBujEQWuNnGzZcvCvdkLQ==}
|
|
||||||
|
|
||||||
concat-map@0.0.1:
|
concat-map@0.0.1:
|
||||||
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
|
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
|
||||||
|
|
||||||
|
@ -2589,10 +2580,6 @@ packages:
|
||||||
resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
|
resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
|
|
||||||
is-blob@2.1.0:
|
|
||||||
resolution: {integrity: sha512-SZ/fTft5eUhQM6oF/ZaASFDEdbFVe89Imltn9uZr03wdKMcWNVYSMjQPFtg05QuNkt5l5c135ElvXEQG0rk4tw==}
|
|
||||||
engines: {node: '>=6'}
|
|
||||||
|
|
||||||
is-builtin-module@4.0.0:
|
is-builtin-module@4.0.0:
|
||||||
resolution: {integrity: sha512-rWP3AMAalQSesXO8gleROyL2iKU73SX5Er66losQn9rWOWL4Gef0a/xOEOVqjWGMuR2vHG3FJ8UUmT700O8oFg==}
|
resolution: {integrity: sha512-rWP3AMAalQSesXO8gleROyL2iKU73SX5Er66losQn9rWOWL4Gef0a/xOEOVqjWGMuR2vHG3FJ8UUmT700O8oFg==}
|
||||||
engines: {node: '>=18.20'}
|
engines: {node: '>=18.20'}
|
||||||
|
@ -5514,8 +5501,6 @@ snapshots:
|
||||||
|
|
||||||
birpc@0.2.19: {}
|
birpc@0.2.19: {}
|
||||||
|
|
||||||
blueimp-canvas-to-blob@3.29.0: {}
|
|
||||||
|
|
||||||
boolbase@1.0.0: {}
|
boolbase@1.0.0: {}
|
||||||
|
|
||||||
brace-expansion@1.1.11:
|
brace-expansion@1.1.11:
|
||||||
|
@ -5634,11 +5619,6 @@ snapshots:
|
||||||
|
|
||||||
comment-parser@1.4.1: {}
|
comment-parser@1.4.1: {}
|
||||||
|
|
||||||
compressorjs@1.2.1:
|
|
||||||
dependencies:
|
|
||||||
blueimp-canvas-to-blob: 3.29.0
|
|
||||||
is-blob: 2.1.0
|
|
||||||
|
|
||||||
concat-map@0.0.1: {}
|
concat-map@0.0.1: {}
|
||||||
|
|
||||||
confbox@0.1.8: {}
|
confbox@0.1.8: {}
|
||||||
|
@ -6420,8 +6400,6 @@ snapshots:
|
||||||
dependencies:
|
dependencies:
|
||||||
binary-extensions: 2.3.0
|
binary-extensions: 2.3.0
|
||||||
|
|
||||||
is-blob@2.1.0: {}
|
|
||||||
|
|
||||||
is-builtin-module@4.0.0:
|
is-builtin-module@4.0.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
builtin-modules: 4.0.0
|
builtin-modules: 4.0.0
|
||||||
|
|
|
@ -13,7 +13,6 @@ export interface HandleApprovalRequestData {
|
||||||
returnAmount: number
|
returnAmount: number
|
||||||
auditImages: string
|
auditImages: string
|
||||||
auditRemark: string
|
auditRemark: string
|
||||||
userid: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SearchApiReturnApprovalQuery {
|
export interface SearchApiReturnApprovalQuery {
|
||||||
|
@ -70,8 +69,6 @@ export interface ReturnApprovalEntity {
|
||||||
name: string
|
name: string
|
||||||
/** 是否内部用户(0否 1汇邦云用户 2企业微信用户) */
|
/** 是否内部用户(0否 1汇邦云用户 2企业微信用户) */
|
||||||
isInternal: number
|
isInternal: number
|
||||||
/** 审核人姓名 */
|
|
||||||
auditName: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SubmitApprovalResponseData = ApiResponseMsgData<{
|
export type SubmitApprovalResponseData = ApiResponseMsgData<{
|
||||||
|
|
|
@ -1,28 +1,25 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { showConfirmDialog, showSuccessToast, showFailToast, showToast, UploaderFileListItem, Popup, Picker } from 'vant'
|
import { showConfirmDialog, showSuccessToast, showFailToast, showToast, UploaderFileListItem, Popup, Picker } from 'vant'
|
||||||
|
|
||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
import { handleApprovalApi } from '@/common/apis/approval'
|
import { handleApprovalApi } from '@/common/apis/approval'
|
||||||
import { openCabinetApi } from '@/common/apis/shop'
|
import { openCabinetApi } from '@/common/apis/shop'
|
||||||
import type { HandleApprovalRequestData } from '@/common/apis/approval/type'
|
import type { HandleApprovalRequestData } from '@/common/apis/approval/type'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import { useApprovalStore } from '@/pinia/stores/approval'
|
import { useApprovalStore } from '@/pinia/stores/approval'
|
||||||
import { useWxStore } from '@/pinia/stores/wx';
|
|
||||||
import Compressor from 'compressorjs';
|
|
||||||
|
|
||||||
const { VITE_APP_BASE_API } = import.meta.env;
|
const { VITE_APP_BASE_API } = import.meta.env;
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const approvalStore = useApprovalStore();
|
const approvalStore = useApprovalStore()
|
||||||
const wxStore = useWxStore();
|
|
||||||
|
|
||||||
const formData = ref<HandleApprovalRequestData>({
|
const formData = ref<HandleApprovalRequestData>({
|
||||||
approvalId: approvalStore.currentApproval?.approvalId || 0,
|
approvalId: approvalStore.currentApproval?.approvalId || 0,
|
||||||
status: 2,
|
status: 2,
|
||||||
returnAmount: approvalStore.currentApproval?.goodsPrice || 0,
|
returnAmount: approvalStore.currentApproval?.goodsPrice || 0,
|
||||||
auditImages: '',
|
auditImages: '',
|
||||||
auditRemark: '',
|
auditRemark: ''
|
||||||
userid: wxStore.userid
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const submitting = ref(false)
|
const submitting = ref(false)
|
||||||
|
@ -78,30 +75,8 @@ const handleFileUpload = async (items: UploaderFileListItem | UploaderFileListIt
|
||||||
item.status = 'uploading'
|
item.status = 'uploading'
|
||||||
item.message = '上传中...'
|
item.message = '上传中...'
|
||||||
const file = item.file as File
|
const file = item.file as File
|
||||||
let compressedFile = file;
|
|
||||||
try {
|
|
||||||
compressedFile = await new Promise<File>((resolve, reject) => {
|
|
||||||
new Compressor(file, {
|
|
||||||
quality: 0.8,
|
|
||||||
maxWidth: 1280,
|
|
||||||
maxHeight: 1280,
|
|
||||||
success(result) {
|
|
||||||
resolve(new File([result], file.name, {
|
|
||||||
type: 'image/jpeg',
|
|
||||||
lastModified: Date.now()
|
|
||||||
}))
|
|
||||||
},
|
|
||||||
error(err) {
|
|
||||||
reject(err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
console.error('压缩失败:', error)
|
|
||||||
}
|
|
||||||
|
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append('file', compressedFile)
|
formData.append('file', file)
|
||||||
|
|
||||||
const { data } = await axios.post<{
|
const { data } = await axios.post<{
|
||||||
code: number
|
code: number
|
||||||
|
@ -211,7 +186,6 @@ const handleSubmit = async () => {
|
||||||
|
|
||||||
submitting.value = true
|
submitting.value = true
|
||||||
try {
|
try {
|
||||||
formData.value.userid = wxStore.userid;
|
|
||||||
const { code, msg } = await handleApprovalApi(formData.value)
|
const { code, msg } = await handleApprovalApi(formData.value)
|
||||||
|
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
|
@ -258,7 +232,6 @@ const handleSubmit = async () => {
|
||||||
<van-cell title="商品单价" :value="`¥${approvalStore.currentApproval?.goodsPrice}`" />
|
<van-cell title="商品单价" :value="`¥${approvalStore.currentApproval?.goodsPrice}`" />
|
||||||
<van-cell title="当前状态" :value="statusMap[approvalStore.currentApproval?.status || 1]" />
|
<van-cell title="当前状态" :value="statusMap[approvalStore.currentApproval?.status || 1]" />
|
||||||
<van-cell title="退还说明" :value="approvalStore.currentApproval?.returnRemark" />
|
<van-cell title="退还说明" :value="approvalStore.currentApproval?.returnRemark" />
|
||||||
<van-cell title="审批人" :value="approvalStore.currentApproval?.auditName" />
|
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
|
|
||||||
<van-cell-group class="image-section">
|
<van-cell-group class="image-section">
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import Compressor from 'compressorjs'
|
|
||||||
import { showConfirmDialog, showSuccessToast, showToast, UploaderFileListItem } from 'vant'
|
import { showConfirmDialog, showSuccessToast, showToast, UploaderFileListItem } from 'vant'
|
||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
import { submitApprovalApi } from '@/common/apis/approval'
|
import { submitApprovalApi } from '@/common/apis/approval'
|
||||||
|
@ -55,32 +54,10 @@ const handleFileUpload = async (items: UploaderFileListItem | UploaderFileListIt
|
||||||
try {
|
try {
|
||||||
const uploadPromises = files.map(async (item) => {
|
const uploadPromises = files.map(async (item) => {
|
||||||
item.status = 'uploading'
|
item.status = 'uploading'
|
||||||
item.message = '上传中...';
|
item.message = '上传中...'
|
||||||
const file = item.file as File;
|
const file = item.file as File
|
||||||
let compressedFile = file;
|
const formData = new FormData()
|
||||||
try {
|
formData.append('file', file)
|
||||||
compressedFile = await new Promise<File>((resolve, reject) => {
|
|
||||||
new Compressor(file, {
|
|
||||||
quality: 0.8,
|
|
||||||
maxWidth: 1280,
|
|
||||||
maxHeight: 1280,
|
|
||||||
success(result) {
|
|
||||||
resolve(new File([result], file.name, {
|
|
||||||
type: 'image/jpeg',
|
|
||||||
lastModified: Date.now()
|
|
||||||
}))
|
|
||||||
},
|
|
||||||
error(err) {
|
|
||||||
reject(err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
console.error('压缩失败:', error)
|
|
||||||
}
|
|
||||||
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('file', compressedFile);
|
|
||||||
|
|
||||||
const { data } = await axios.post<{
|
const { data } = await axios.post<{
|
||||||
code: number
|
code: number
|
||||||
|
|
|
@ -8,10 +8,7 @@ import VanPopup from "vant/es/popup"
|
||||||
import { computed, onBeforeUnmount, onMounted, ref } from "vue"
|
import { computed, onBeforeUnmount, onMounted, ref } from "vue"
|
||||||
import Cart from "./components/cart.vue"
|
import Cart from "./components/cart.vue"
|
||||||
import Detail from "./components/detail.vue"
|
import Detail from "./components/detail.vue"
|
||||||
import { useRoute } from 'vue-router'
|
|
||||||
|
|
||||||
const router = useRouter()
|
|
||||||
const route = useRoute()
|
|
||||||
// 状态管理
|
// 状态管理
|
||||||
const productStore = useProductStore()
|
const productStore = useProductStore()
|
||||||
const cartStore = useCartStore()
|
const cartStore = useCartStore()
|
||||||
|
@ -105,7 +102,6 @@ const currentProducts = computed(() => {
|
||||||
|
|
||||||
// 组件挂载时添加滚动监听
|
// 组件挂载时添加滚动监听
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
productStore.getGoods();
|
|
||||||
scrollListener.push(scrollContainer.value?.addEventListener("scroll", throttledScroll))
|
scrollListener.push(scrollContainer.value?.addEventListener("scroll", throttledScroll))
|
||||||
scrollListener.push(scrollContainer.value?.addEventListener("scroll", throttledUpdate))
|
scrollListener.push(scrollContainer.value?.addEventListener("scroll", throttledUpdate))
|
||||||
})
|
})
|
||||||
|
@ -117,17 +113,11 @@ onBeforeUnmount(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
// 结算方法
|
// 结算方法
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
function handleCheckout() {
|
function handleCheckout() {
|
||||||
router.push("/product/checkout")
|
router.push("/product/checkout")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 路由更新时刷新数据
|
|
||||||
watch(() => route.path, (newPath) => {
|
|
||||||
if (newPath === '/') {
|
|
||||||
productStore.getGoods()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
Loading…
Reference in New Issue