拼团问题修复

This commit is contained in:
2025-12-18 20:46:02 +08:00
parent 6cacf434ab
commit 9ea8a2a7ab
7 changed files with 864 additions and 8 deletions

View File

@@ -0,0 +1,97 @@
<template>
<view>
<up-popup
:show="show"
mode="center"
:safeAreaInsetBottom="mode === 'bottom' ? true : false"
>
<view class="popup-content">
<view class="top u-flex u-row-between">
<text class="font-bold u-font-32 color-333">{{ title }}</text>
<up-icon size="18" name="close" @click="show = false"></up-icon>
</view>
<up-line></up-line>
<scroll-view style="max-height: 50vh" :scroll-y="true">
<slot></slot>
</scroll-view>
<template v-if="showBottom">
<up-line></up-line>
<view class="bottom">
<view class="btn cancel" @click="close">{{ cancelText }}</view>
<view class="btn success" @click="confirm">{{ confirmText }}</view>
</view>
</template>
</view>
</up-popup>
</view>
</template>
<script setup>
const props = defineProps({
mode: {
type: String,
default: "center",
},
title: {
type: String,
default: "标题",
},
confirmText: {
type: String,
default: "确认",
},
cancelText: {
type: String,
default: "取消",
},
showBottom: {
type: Boolean,
default: true,
},
});
const show = defineModel({
type: Boolean,
default: false,
});
const emits = defineEmits(["close", "confirm"]);
function close() {
show.value = false;
emits("close");
}
function confirm() {
emits("confirm");
}
</script>
<style lang="scss">
.popup-content {
background: #fff;
width: 640rpx;
border-radius: 18rpx;
}
.top {
padding: 40rpx 48rpx;
}
.bottom {
padding: 48rpx 52rpx;
display: flex;
justify-content: space-between;
gap: 50rpx;
.btn {
flex: 1;
text-align: center;
padding: 18rpx 60rpx;
border-radius: 100rpx;
font-size: 32rpx;
border: 2rpx solid transparent;
&.success {
background-color: $my-main-color;
color: #fff;
}
&.cancel {
border-color: $my-main-color;
color: $my-main-color;
}
}
}
</style>

View File

@@ -0,0 +1,66 @@
<template>
<text class="status " :class="returnClass">{{status}}</text>
</template>
<script setup>
import { computed } from 'vue'
const props=defineProps({
status:{
default:''
}
})
const list =ref( [{
name: '全部',
value: ''
},
{
name: '待成团',
value: '',
class:'success'
},
{
name: '待核销',
value: '',
class:'warning'
},
{
name: '已核销',
value: ''
},
{
name: '退款',
value: '',
class:'error'
},
])
const returnClass=computed(()=>{
const item=list.value.find(v=>props.status.includes(v.name))
return item?item.class:''
})
</script>
<style lang="scss">
.status {
padding: 8rpx 18rpx;
border-radius: 8rpx;
border: 2rpx solid #333;
&.success {
border-color: rgba(123, 209, 54, 1);
color: rgba(123, 209, 54, 1);
background: rgba(123, 209, 54, 0.12);
}
&.warning{
border-color: rgba(255, 141, 40, 1);
color: rgba(255, 141, 40, 1);
background: rgba(255, 141, 40, 0.12);
}
&.error {
border-color: #FF1C1C;
color: #FF1C1C;
background: rgba(255, 28, 28, 0.18);
}
}
</style>