feat(api-collect-code): 新增离线二维码删除功能并优化相关页面
- 新增 offlineQrcodeDelete 函数用于删除离线二维码 - 在我的收藏码页面添加删除功能,支持单个二维码删除
This commit is contained in:
parent
69ad600f0d
commit
eb02645658
@ -14,12 +14,11 @@ export async function offlineQrcodeCreate(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export async function artworkDetail(data) {
|
||||
|
||||
return await request( {
|
||||
url:'/api/v1/m/artwork/detail',
|
||||
export async function offlineQrcodeDelete(data) {
|
||||
return await request ({
|
||||
url:'/api/v1/offlineQrcode/delete',
|
||||
method: 'POST',
|
||||
data,
|
||||
data
|
||||
})
|
||||
}
|
||||
export async function userArtworks(data) {
|
||||
|
@ -4,6 +4,7 @@ import XImage from "@/components/x-image/index.vue";
|
||||
import {useRuntimeConfig} from "#app";
|
||||
import QRCode from 'qrcode'
|
||||
import { showImagePreview } from 'vant';
|
||||
import {offlineQrcodeDelete} from "~/api-collect-code/goods/index.js";
|
||||
|
||||
const statusLabel=[
|
||||
{label:'已付款',value:2,color:'#18A058'}, {label:'未付款',value:1,color:'#CF3050'}, {label:'已部分付款',value:4,color:'#F09F1F'}
|
||||
@ -36,6 +37,7 @@ const openQrCode=async ()=>{
|
||||
const base64=await getQRBase64()
|
||||
showImagePreview([base64])
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -56,7 +58,7 @@ const openQrCode=async ()=>{
|
||||
<div class="flex flex-col justify-end ml-auto ">
|
||||
<div class="flex w-55px h-26px bg-#2B53AC rounded-4px justify-center items-center">
|
||||
<div @click="openQrCode" class="text-12px text-#fff line-height-none mt-0.5px mr-5px">查看</div>
|
||||
<div>
|
||||
<div >
|
||||
<img class="w-12px h-12px" src="@/static/images/icon-design-42@3x.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
|
@ -8,7 +8,7 @@ import XImage from '@/components/x-image/index.vue'
|
||||
import {useRouter} from "#vue-router";
|
||||
import {goodStore} from "~/stores-collect-code/goods/index.js";
|
||||
import {ref} from "vue";
|
||||
import {offlineQrcodeCreate, offlineQrcodeList} from "~/api-collect-code/goods/index.js";
|
||||
import {offlineQrcodeCreate, offlineQrcodeDelete, offlineQrcodeList} from "~/api-collect-code/goods/index.js";
|
||||
import codeCard from './components/codeCard/index.vue'
|
||||
import {message} from "~/components/x-message/useMessage.js";
|
||||
definePageMeta({
|
||||
@ -26,7 +26,7 @@ const localState = ref({
|
||||
const { userInfo, } = codeAuthStore()
|
||||
const {getOfflineQrcodeList,itemList, loading: storeLoading,pageRef}= goodStore()
|
||||
const initData = async () => {
|
||||
getOfflineQrcodeList()
|
||||
onRefresh()
|
||||
}
|
||||
const show=ref(false)
|
||||
const close=()=>{
|
||||
@ -83,6 +83,15 @@ const res=await offlineQrcodeList({
|
||||
}
|
||||
}
|
||||
}
|
||||
const deleteData=async (qrUid)=>{
|
||||
const res=await offlineQrcodeDelete({
|
||||
qrUid:qrUid
|
||||
})
|
||||
if (res.status===0){
|
||||
getOfflineQrcodeList()
|
||||
message.success('删除成功')
|
||||
}
|
||||
}
|
||||
initData()
|
||||
</script>
|
||||
|
||||
@ -118,14 +127,17 @@ initData()
|
||||
<van-swipe-cell class="mb-14px" >
|
||||
<codeCard :data="item"></codeCard>
|
||||
<template #right>
|
||||
<div class="w-65px h-full bg-#CF3050 flex items-center justify-center">
|
||||
<div class="w-65px h-full bg-#CF3050 flex items-center justify-center" @click="deleteData(item.qrUid)">
|
||||
<img class="w-22px h-24px" src="@/static/images/delete3@.png" alt="">
|
||||
</div>
|
||||
</template>
|
||||
</van-swipe-cell>
|
||||
</template>
|
||||
<template v-else>
|
||||
<codeCard :data="item"></codeCard>
|
||||
<div class="mb-14px">
|
||||
<codeCard :data="item"></codeCard>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
</template>
|
||||
|
@ -6,30 +6,39 @@ import { liveStore } from "@/stores/live/index.js";
|
||||
import xButton from '@/components/x-button/index.vue'
|
||||
import tangPopup from './tangPopup.vue'
|
||||
import {goodStore} from "@/stores/goods/index.js";
|
||||
|
||||
import {authStore} from "~/stores/auth/index.js";
|
||||
const { quoteStatus, changeStatus,show,auctionData ,getSocketData} = liveStore();
|
||||
const {pageRef} = goodStore();
|
||||
const {userInfo}= authStore()
|
||||
const showTang=ref(false)
|
||||
const openOne=()=>{
|
||||
showTang.value=true
|
||||
}
|
||||
|
||||
const paySide=computed(()=>{
|
||||
//当前是否已成交,以及成交人是当前登录用户
|
||||
if (auctionData.value.artwork.isSoled&&auctionData.value.artwork.buyInfo.userID===userInfo.value.ID){
|
||||
return true
|
||||
}else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
console.log('auctionData.value',auctionData.value)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="bg-white w-60px rounded-l-4px overflow-hidden">
|
||||
<!-- 拍品信息 -->
|
||||
<x-button @click="openOne">
|
||||
<div class="w-60px h-60px text-center border-b border-gray-300 flex flex-col justify-center items-center text-#7D7D7F text-12px">
|
||||
<van-button class="w-60px !h-60px" @click="openOne" style="border: none;border-radius: 0">
|
||||
<div class="text-center flex flex-col justify-center items-center text-#7D7D7F text-12px">
|
||||
<div>拍品</div>
|
||||
<div>({{auctionData?.artwork?.index}}/{{pageRef.itemCount??0}})</div>
|
||||
</div>
|
||||
</x-button>
|
||||
</van-button>
|
||||
<tangPopup v-model:show="showTang"></tangPopup>
|
||||
<!-- 出价开关 -->
|
||||
<x-button @click="changeStatus">
|
||||
<div class="w-60px h-60px text-center border-b border-gray-300 flex flex-col justify-center items-center">
|
||||
<div class="mb-1">
|
||||
<van-button class="w-60px !h-60px" @click="changeStatus" style="border-right: none;border-left: none;border-radius: 0;padding: 0">
|
||||
<div class="text-center flex flex-col justify-center items-center">
|
||||
<div class="mb-4px">
|
||||
<img
|
||||
:src="quoteStatus ? lockClosed : lockOpen"
|
||||
class="w-16px h-21px"
|
||||
@ -40,15 +49,15 @@ const openOne=()=>{
|
||||
{{ quoteStatus ? '关闭出价' : '开启出价' }}
|
||||
</div>
|
||||
</div>
|
||||
</x-button>
|
||||
</van-button>
|
||||
<!-- 支付 -->
|
||||
<x-button @click="show = true">
|
||||
<div class="w-60px h-60px text-center flex flex-col justify-center items-center text-yellow-600">
|
||||
<van-button class="w-60px !h-60px" style="border: none;border-radius: 0" @click="paySide = true">
|
||||
<div class="text-center flex flex-col justify-center items-center text-yellow-600">
|
||||
<div class="text-10px">RMB</div>
|
||||
<div class="text-12px">5,000</div>
|
||||
<div class="text-10px">去支付</div>
|
||||
</div>
|
||||
</x-button>
|
||||
</van-button>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
@ -113,7 +113,7 @@ watch(()=>props.show,(newValue)=>{
|
||||
loading="lazy"
|
||||
/>
|
||||
<div class="w-45px h-17px bg-#2B53AC text-12px line-height-none flex justify-center items-center absolute top-2px left-2px text-#fff">LOT{{item.index}}</div>
|
||||
<div v-if="auctionData.artwork.index===item?.index" class="w-80px h-20px bg-#B58047 flex line-height-none justify-center items-center text-#fff text-12px bottom-0 absolute blink">竞拍中</div>
|
||||
<div v-if="auctionData.artwork.index===item?.index" class="w-80px h-20px bg-#B58047 flex line-height-none justify-center items-center text-#fff text-12px bottom-0 absolute blink">投屏中</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="ellipsis line-height-20px text-16px font-600 min-h-40px">
|
||||
@ -125,7 +125,6 @@ watch(()=>props.show,(newValue)=>{
|
||||
</div>
|
||||
</van-list>
|
||||
</van-pull-refresh>
|
||||
|
||||
</div>
|
||||
</x-popup>
|
||||
<DetailPopup v-model:show="showDetail" :detail-info="showDetailInfo"></DetailPopup>
|
||||
|
Loading…
Reference in New Issue
Block a user