Commit 9af5a00a authored by 王炽's avatar 王炽

66666

parent 813a6ef6
...@@ -103,8 +103,12 @@ const emit = defineEmits(['points-click', 'coupon-click', 'upgrade']) ...@@ -103,8 +103,12 @@ const emit = defineEmits(['points-click', 'coupon-click', 'upgrade'])
const getBtnName = () => { const getBtnName = () => {
if(!hasBaby.value){ if(!hasBaby.value){
if(props.index < 2){
return '去升级';
}else{
return '去添加'; return '去添加';
} }
}
const btnName = ''; const btnName = '';
switch(status1.value){ switch(status1.value){
case 4000: case 4000:
......
<template>
<view class="popup-tip" >
<view class="tip-panel-modal"
:style="{
background: `url(${$baseUrl}integral/1021/addTipsPanalBg${bgIndex}.png) no-repeat center/contain`
}"
@click.stop>
<!-- 弹窗背景 -->
<!-- <image
class="modal-bg"
:src="`${$baseUrl}integral/1021/addTipsPanalBg${bgIndex}.png`"
mode="aspectFit"
/> -->
<!-- 弹窗内容 -->
<view class="modal-content">
<!-- 添加按钮 -->
<view
class="add-button"
:style="{
background: `url(${$baseUrl}integral/1021/shengriliBtnBg${bgIndex}.png) no-repeat center/contain`
}"
@click="handleAddClick"
>
<text class="button-text">去添加</text>
</view>
</view>
<image
class="close-button"
:src="`${$baseUrl}integral/1021/closeBtn.png`"
mode="aspectFit"
@click="handleOverlayClick"
/>
</view>
</view>
</template>
<script setup>
import { defineProps, defineEmits } from 'vue'
// 定义组件名称
defineOptions({
name: 'shengrili-tip-panel'
})
// 定义组件属性
const props = defineProps({
visible: {
type: Boolean,
default: false
},
bgIndex: {
type: Number,
default: 2,
validator: (value) => [2, 3, 4].includes(value)
}
})
// 定义组件事件
const emit = defineEmits(['close', 'add'])
// 处理遮罩层点击
const handleOverlayClick = () => {
console.log('handleOverlayClick')
emit('close')
}
// 处理添加按钮点击
const handleAddClick = () => {
emit('add')
emit('close')
}
</script>
<style lang="scss" scoped>
.popup-tip {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 999;
background: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
.tip-panel-modal {
position: relative;
width: 640rpx;
height: 368rpx;
display: flex;
justify-content: center;
align-items: center;
// background-color: #ebe7f1;
// border-radius: 25rpx;
// .modal-bg {
// position: absolute;
// top: 0;
// left: 0;
// width: 100%;
// height: 100%;
// z-index: 1;
// }
.modal-content {
position: relative;
z-index: 2;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
.add-button {
width: 442rpx;
height: 85rpx;
display: flex;
justify-content: center;
align-items: center;
margin-top: 200rpx;
.button-text {
font-size: 28rpx;
color: #ffffff;
font-weight: bold;
text-align: center;
}
}
}
.close-button {
z-index: 3;
position: absolute;
width: 50rpx;
height: 50rpx;
margin-top: 480rpx;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="tip-panel-overlay" v-if="visible" @click="handleOverlayClick">
<view class="tip-panel-modal" @click.stop>
<!-- 弹窗背景 -->
<image
class="modal-bg"
:src="`${$baseUrl}integral/1021/addTipsPanalBg${bgIndex}.png`"
mode="aspectFit"
/>
<!-- 弹窗内容 -->
<view class="modal-content">
<!-- 提示文字 -->
<text class="tip-text">当前没有宝宝信息,无法领取生日礼哦</text>
<!-- 添加按钮 -->
<view
class="add-button"
:style="{
background: `url(${$baseUrl}integral/1021/shengriliBtnBg${bgIndex}.png) no-repeat center/contain`
}"
@click="handleAddClick"
>
<text class="button-text">去添加</text>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { defineProps, defineEmits } from 'vue'
// 定义组件名称
defineOptions({
name: 'shengrili-tip-panel'
})
// 定义组件属性
const props = defineProps({
visible: {
type: Boolean,
default: false
},
bgIndex: {
type: Number,
default: 2,
validator: (value) => [2, 3, 4].includes(value)
}
})
// 定义组件事件
const emit = defineEmits(['close', 'add'])
// 处理遮罩层点击
const handleOverlayClick = () => {
emit('close')
}
// 处理添加按钮点击
const handleAddClick = () => {
emit('add')
}
</script>
<style lang="less" scoped>
.tip-panel-overlay {
position: fixed;
width: 100%;
height: 100%;
// top: 0;
// left: 0;
// right: 0;
// bottom: 0;
background-color: rgba(0, 0, 0, 0.6);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
.tip-panel-modal {
position: relative;
width: 600rpx;
height: 400rpx;
display: flex;
justify-content: center;
align-items: center;
}
.modal-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.modal-content {
position: relative;
z-index: 2;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
padding: 60rpx 40rpx;
box-sizing: border-box;
}
.tip-text {
font-size: 32rpx;
color: #503404;
text-align: center;
line-height: 1.5;
margin-bottom: 60rpx;
font-weight: 500;
}
.add-button {
width: 300rpx;
height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 40rpx;
cursor: pointer;
transition: transform 0.2s ease;
}
.add-button:active {
transform: scale(0.95);
}
.button-text {
font-size: 28rpx;
color: #ffffff;
font-weight: bold;
text-align: center;
}
</style>
...@@ -586,10 +586,16 @@ ...@@ -586,10 +586,16 @@
v-if="showPopupShengri" v-if="showPopupShengri"
@close="showPopupShengri = false" @close="showPopupShengri = false"
/> />
<ShengriliTipPanel
:bgIndex="itemIndex"
v-if="showShengriliTipPanel"
@close="showShengriliTipPanel = false"
@add="navigateTo('/pages/person/person?type=add')"
/>
</view> </view>
</template> </template>
<!-- showShengriliTipPanel -->
<script setup> <script setup>
// 轮播图数据可在此定义(当前使用静态路径) // 轮播图数据可在此定义(当前使用静态路径)
...@@ -617,6 +623,7 @@ ...@@ -617,6 +623,7 @@
import { getHealthField } from "@/api/common"; import { getHealthField } from "@/api/common";
import MonthGift from '../components/pointRightsCom/monthGift.vue'; import MonthGift from '../components/pointRightsCom/monthGift.vue';
import YearGift from '../components/pointRightsCom/yearGift.vue'; import YearGift from '../components/pointRightsCom/yearGift.vue';
import ShengriliTipPanel from '../components/quanyi/shengriliTipPanel.vue';
// 进度条图片加载错误处理 // 进度条图片加载错误处理
const onProgressBarError = (e) => { const onProgressBarError = (e) => {
...@@ -1472,6 +1479,7 @@ import YearGift from '../components/pointRightsCom/yearGift.vue'; ...@@ -1472,6 +1479,7 @@ import YearGift from '../components/pointRightsCom/yearGift.vue';
}); });
// const integralData = ref({}); // const integralData = ref({});
const showShengriliTipPanel = ref(false);
const quanyitiaozhuanInfo = ref({}); const quanyitiaozhuanInfo = ref({});
const selectIdx = ref(-1);//权益选中id const selectIdx = ref(-1);//权益选中id
const isshowShouqi = ref(false);//是否收起权益 const isshowShouqi = ref(false);//是否收起权益
...@@ -2346,8 +2354,12 @@ import YearGift from '../components/pointRightsCom/yearGift.vue'; ...@@ -2346,8 +2354,12 @@ import YearGift from '../components/pointRightsCom/yearGift.vue';
console.log('生日礼', data.index); console.log('生日礼', data.index);
if(!(userStore.babyInfo?.allBabyBaseInfo && userStore.babyInfo?.allBabyBaseInfo.length > 0) && islogin.value){ if(!(userStore.babyInfo?.allBabyBaseInfo && userStore.babyInfo?.allBabyBaseInfo.length > 0) && islogin.value){
//没有宝宝,跳转到添加宝宝页面 //没有宝宝,跳转到添加宝宝页面
if(itemIndex.value < 2){
navigateTo("/pages/person/person?type=add"); gotoGonglue();
}else{
showShengriliTipPanel.value = true;
}
return;
} }
switch(data.index){ switch(data.index){
......
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