refactor(live): 优化直播室功能和交互
- 修改艺术品状态更新逻辑,仅在未售出时允许改变状态 - 添加支付按钮点击后跳转到签名协议页面 - 优化侧边按钮组件,增加支付按钮的显示逻辑
This commit is contained in:
parent
eb02645658
commit
10cba595b0
@ -9,6 +9,7 @@ const props = defineProps({
|
|||||||
default: 0
|
default: 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const router = useRouter()
|
||||||
const emit = defineEmits(['update:show'])
|
const emit = defineEmits(['update:show'])
|
||||||
const payStatus=ref(0)
|
const payStatus=ref(0)
|
||||||
const changePayStatus=()=>{
|
const changePayStatus=()=>{
|
||||||
@ -18,6 +19,7 @@ const close=()=>{
|
|||||||
emit('update:show',false)
|
emit('update:show',false)
|
||||||
}
|
}
|
||||||
const confirm=()=>{
|
const confirm=()=>{
|
||||||
|
router.push('/signature/protocol')
|
||||||
emit('update:show',false)
|
emit('update:show',false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import xButton from '@/components/x-button/index.vue'
|
|||||||
import tangPopup from './tangPopup.vue'
|
import tangPopup from './tangPopup.vue'
|
||||||
import {goodStore} from "@/stores/goods/index.js";
|
import {goodStore} from "@/stores/goods/index.js";
|
||||||
import {authStore} from "~/stores/auth/index.js";
|
import {authStore} from "~/stores/auth/index.js";
|
||||||
|
|
||||||
const {quoteStatus, changeStatus, show, auctionData, getSocketData} = liveStore();
|
const {quoteStatus, changeStatus, show, auctionData, getSocketData} = liveStore();
|
||||||
const {pageRef} = goodStore();
|
const {pageRef} = goodStore();
|
||||||
const {userInfo} = authStore()
|
const {userInfo} = authStore()
|
||||||
@ -14,6 +15,7 @@ const showTang=ref(false)
|
|||||||
const openOne = () => {
|
const openOne = () => {
|
||||||
showTang.value = true
|
showTang.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const paySide = computed(() => {
|
const paySide = computed(() => {
|
||||||
//当前是否已成交,以及成交人是当前登录用户
|
//当前是否已成交,以及成交人是当前登录用户
|
||||||
if (auctionData.value.artwork.isSoled && auctionData.value.artwork.buyInfo.userID === userInfo.value.ID) {
|
if (auctionData.value.artwork.isSoled && auctionData.value.artwork.buyInfo.userID === userInfo.value.ID) {
|
||||||
@ -22,7 +24,9 @@ if (auctionData.value.artwork.isSoled&&auctionData.value.artwork.buyInfo.userID=
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log('auctionData.value',auctionData.value)
|
const goPay = () => {
|
||||||
|
show.value = true
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -36,7 +40,8 @@ console.log('auctionData.value',auctionData.value)
|
|||||||
</van-button>
|
</van-button>
|
||||||
<tangPopup v-model:show="showTang"></tangPopup>
|
<tangPopup v-model:show="showTang"></tangPopup>
|
||||||
<!-- 出价开关 -->
|
<!-- 出价开关 -->
|
||||||
<van-button class="w-60px !h-60px" @click="changeStatus" style="border-right: none;border-left: none;border-radius: 0;padding: 0">
|
<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="text-center flex flex-col justify-center items-center">
|
||||||
<div class="mb-4px">
|
<div class="mb-4px">
|
||||||
<img
|
<img
|
||||||
@ -51,7 +56,7 @@ console.log('auctionData.value',auctionData.value)
|
|||||||
</div>
|
</div>
|
||||||
</van-button>
|
</van-button>
|
||||||
<!-- 支付 -->
|
<!-- 支付 -->
|
||||||
<van-button class="w-60px !h-60px" style="border: none;border-radius: 0" @click="paySide = true">
|
<van-button v-if="paySide" class="w-60px !h-60px" style="border: none;border-radius: 0" @click="goPay">
|
||||||
<div class="text-center flex flex-col justify-center items-center text-yellow-600">
|
<div class="text-center flex flex-col justify-center items-center text-yellow-600">
|
||||||
<div class="text-10px">RMB</div>
|
<div class="text-10px">RMB</div>
|
||||||
<div class="text-12px">5,000</div>
|
<div class="text-12px">5,000</div>
|
||||||
|
@ -153,8 +153,8 @@ export const liveStore = createGlobalState(() => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
const changeStatus = () => {
|
const changeStatus = () => {
|
||||||
if (auctionData.value.artwork.isSelling){
|
if (auctionData.value.artwork.isSelling&&!auctionData.value.artwork.isSoled){
|
||||||
quoteStatus.value = !quoteStatus.value
|
quoteStatus.value = true
|
||||||
}else {
|
}else {
|
||||||
if (quoteStatus.value){
|
if (quoteStatus.value){
|
||||||
quoteStatus.value = false
|
quoteStatus.value = false
|
||||||
|
Loading…
Reference in New Issue
Block a user