Commit 28b1e657 authored by weishengfei's avatar weishengfei

refactor(components): 移除未使用的导入并添加注释

- 从 popup-tip.vue 中移除了未使用的 console 导入
- 在 My.vue 中添加了多个弹窗组件的注释,为将来可能添加的功能做准备
parent 761a9eea
<template>
<view class="popup-tip">
<view class="popup-tip-content">
<view class="content-title">
精选好券领取成功
</view>
<view :class="`content-box sty-${type}`">
<view v-if="isUnlock" class="box-1">
<image :src="`/static/jingxuan/${type}-1.png`" ></image>
</view>
<view class="box-2">
<image :src="`/static/jingxuan/${type}-2.png`" ></image>
</view>
<view class="box-3" @click="goUse">
<image :src="`/static/jingxuan/${type}-3.png`" ></image>
</view>
</view>
<view class="content-2" @click="closeBtn">
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
onMounted,
computed,
defineEmits,
onUnmounted
} from 'vue'
import { useUserStore } from "@/stores/user";
import { jump, JumpType } from '@/utils/index.js'
import md from '../../md';
// 接受父组件参数
const props = defineProps({
type: {
type: String,
default: '5', // 1 黄金、2 铂金、3 钻石、4 星光、5 星耀
},
isUnlock: {
type: Boolean,
default: true, // 是否解锁 商品兑换券
}
})
// 用户信息
const userStore = useUserStore();
// 回调函数
const emit = defineEmits(['statusChange', 'close'])
// 跳转小程序配置
const configuration ={
url: "subPackages/xmhMainProcess/member/index?entrySource=xmh_wechatmp_points_recgoodsbot",
type: 2,
extra: {
appId: "wx4205ec55b793245e",
envVersion: "release"
}
}
// 前往使用按钮
const goUse = () => {
console.log("🚀 ~ goUse:")
// md.sensorLogTake({
// xcxClick: "积分服务页-首屏页面点击",
// pageName: "积分服务页-首屏",
// buttonName: `${item.name}`,
// });
const {url, type, extra} = configuration
jump({
type: type,
url: url,
extra:extra
})
emit('close')
}
// 关闭按钮
const closeBtn = () => {
emit('close')
}
onMounted(() => {
console.log('onMounted')
wx.setPageStyle({
style: {
overflow: 'hidden'
}
})
})
onUnmounted(() => {
// 弹窗关闭时恢复背景滚动
wx.setPageStyle({
style: {
overflow: 'auto'
}
})
})
</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.5);
&-content {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
overflow: hidden;
.content-title{
width: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 50rpx;
font-weight: 700;
color: #fff8e8;
}
.content-box {
margin-top: 20rpx;
width: 640rpx;
padding: 55rpx 22rpx 40rpx 25rpx;
overflow: hidden;
background-size: 100%;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: 24rpx;
overflow: hidden;
.box-1{
width: 592rpx;
height: 206rpx;
margin-bottom: 30rpx;
image{
width: 100%;
height: 100%;
}
}
.box-2{
width: 591rpx;
height: 332rpx;
image{
width: 100%;
height: 100%;
}
}
.box-3{
margin-top: 50rpx;
width: 442rpx;
height: 85rpx;
image{
width: 100%;
height: 100%;
}
}
}
// 黄金
.sty-1 {
background-image: url('@/static/jingxuan/bg-1.png');
}
// 铂金
.sty-2 {
background-image: url('@/static/jingxuan/bg-2.png');
}
// 钻石
.sty-3 {
background-image: url('@/static/jingxuan/bg-3.png');
}
// 星光
.sty-4 {
background-image: url('@/static/jingxuan/bg-4.png');
}
// 星耀
.sty-5 {
background-image: url('@/static/jingxuan/bg-5.png');
}
.content-2 {
margin-top: 65rpx;
width: 50rpx;
height: 50rpx;
background-image: url('@/static/shengriPopup/close.png');
background-size: 100%;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="popup-tip">
<view class="popup-tip-content">
<view class="content-title">
基础生日礼领取成功
</view>
<view :class="`content-box sty-${type}`">
<view class="box-2">
<image :src="`/static/shengriPopup/${type}-1.png`" ></image>
<image :src="`/static/shengriPopup/${type}-2.png`" ></image>
</view>
<view class="box-3" @click="goUse">
<image :src="`/static/jingxuan/${type}-3.png`" ></image>
</view>
</view>
<view class="content-2" @click="closeBtn">
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
onMounted,
computed,
defineEmits,
onUnmounted
} from 'vue'
import { useUserStore } from "@/stores/user";
import { jump, JumpType } from '@/utils/index.js'
import md from '../../md';
// 接受父组件参数
const props = defineProps({
type: {
type: String,
default: '3', // 3 钻石、4 星光、5 星耀
}
})
// 用户信息
const userStore = useUserStore();
// 回调函数
const emit = defineEmits(['statusChange', 'close'])
// 跳转小程序配置
const configuration ={
url: "subPackages/xmhMainProcess/member/index?entrySource=xmh_wechatmp_points_recgoodsbot",
type: 2,
extra: {
appId: "wx4205ec55b793245e",
envVersion: "release"
}
}
// 前往使用按钮
const goUse = () => {
console.log("🚀 ~ goUse:")
// md.sensorLogTake({
// xcxClick: "积分服务页-首屏页面点击",
// pageName: "积分服务页-首屏",
// buttonName: `${item.name}`,
// });
const {url, type, extra} = configuration
jump({
type: type,
url: url,
extra:extra
})
emit('close')
}
// 关闭按钮
const closeBtn = () => {
emit('close')
}
onMounted(() => {
console.log('onMounted')
wx.setPageStyle({
style: {
overflow: 'hidden'
}
})
})
onUnmounted(() => {
// 弹窗关闭时恢复背景滚动
wx.setPageStyle({
style: {
overflow: 'auto'
}
})
})
</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.5);
&-content {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
overflow: hidden;
.content-title{
width: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 50rpx;
font-weight: 700;
color: #fff8e8;
}
.content-box {
margin-top: 20rpx;
width: 640rpx;
padding: 55rpx 22rpx 40rpx 25rpx;
overflow: hidden;
background-size: 100%;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: 24rpx;
overflow: hidden;
.box-2{
width: 100%;
display: flex;
justify-content: space-around;
align-items: center;
image{
width: 270rpx;
height: 160rpx;
}
}
.box-3{
margin-top: 50rpx;
width: 442rpx;
height: 85rpx;
image{
width: 100%;
height: 100%;
}
}
}
// 钻石
.sty-3 {
background-image: url('@/static/jingxuan/bg-3.png');
}
// 星光
.sty-4 {
background-image: url('@/static/jingxuan/bg-4.png');
}
// 星耀
.sty-5 {
background-image: url('@/static/jingxuan/bg-5.png');
}
.content-2 {
margin-top: 65rpx;
width: 50rpx;
height: 50rpx;
background-image: url('@/static/shengriPopup/close.png');
background-size: 100%;
}
}
}
</style>
\ No newline at end of file
...@@ -56,7 +56,6 @@ import { ...@@ -56,7 +56,6 @@ import {
defineEmits defineEmits
} from 'vue' } from 'vue'
import { useUserStore } from "@/stores/user"; import { useUserStore } from "@/stores/user";
import { console } from 'inspector';
// 接受父组件参数 // 接受父组件参数
const props = defineProps({ const props = defineProps({
type: { type: {
......
<template>
<view class="popup-tip">
<view class="popup-tip-content">
<view class="content-title">
新人礼券领取成功
</view>
<view :class="`content-box sty-${type}`">
<view class="box-2">
<image :src="`/static/xinren/${type}-2.png`" ></image>
</view>
<view class="box-3" @click="goUse">
<image :src="`/static/jingxuan/${type}-3.png`" ></image>
</view>
</view>
<view class="content-2" @click="closeBtn">
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
onMounted,
computed,
defineEmits,
onUnmounted
} from 'vue'
import { useUserStore } from "@/stores/user";
import { jump, JumpType } from '@/utils/index.js'
import md from '../../md';
// 接受父组件参数
const props = defineProps({
type: {
type: String,
default: '1', // 1 黄金、2 铂金、3 钻石、4 星光、5 星耀
}
})
// 用户信息
const userStore = useUserStore();
// 回调函数
const emit = defineEmits(['statusChange', 'close'])
// 跳转小程序配置
const configuration ={
url: "subPackages/xmhMainProcess/member/index?entrySource=xmh_wechatmp_points_recgoodsbot",
type: 2,
extra: {
appId: "wx4205ec55b793245e",
envVersion: "release"
}
}
// 前往使用按钮
const goUse = () => {
console.log("🚀 ~ goUse:")
// md.sensorLogTake({
// xcxClick: "积分服务页-首屏页面点击",
// pageName: "积分服务页-首屏",
// buttonName: `${item.name}`,
// });
const {url, type, extra} = configuration
jump({
type: type,
url: url,
extra:extra
})
emit('close')
}
// 关闭按钮
const closeBtn = () => {
emit('close')
}
onMounted(() => {
console.log('onMounted')
wx.setPageStyle({
style: {
overflow: 'hidden'
}
})
})
onUnmounted(() => {
// 弹窗关闭时恢复背景滚动
wx.setPageStyle({
style: {
overflow: 'auto'
}
})
})
</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.5);
&-content {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
overflow: hidden;
.content-title{
width: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 50rpx;
font-weight: 700;
color: #fff8e8;
}
.content-box {
margin-top: 20rpx;
width: 640rpx;
padding: 55rpx 22rpx 40rpx 25rpx;
overflow: hidden;
background-size: 100%;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: 24rpx;
overflow: hidden;
.box-2{
width: 591rpx;
height: 332rpx;
image{
width: 100%;
height: 100%;
}
}
.box-3{
margin-top: 50rpx;
width: 442rpx;
height: 85rpx;
image{
width: 100%;
height: 100%;
}
}
}
// 黄金
.sty-1 {
background-image: url('@/static/jingxuan/bg-1.png');
}
// 铂金
.sty-2 {
background-image: url('@/static/jingxuan/bg-2.png');
}
// 钻石
.sty-3 {
background-image: url('@/static/jingxuan/bg-3.png');
}
// 星光
.sty-4 {
background-image: url('@/static/jingxuan/bg-4.png');
}
// 星耀
.sty-5 {
background-image: url('@/static/jingxuan/bg-5.png');
}
.content-2 {
margin-top: 65rpx;
width: 50rpx;
height: 50rpx;
background-image: url('@/static/shengriPopup/close.png');
background-size: 100%;
}
}
}
</style>
\ No newline at end of file
...@@ -145,6 +145,17 @@ ...@@ -145,6 +145,17 @@
</view> </view>
<RegisterLayer v-model="showRegisterLayer" @confirm="onRegisterConfirm" /> <RegisterLayer v-model="showRegisterLayer" @confirm="onRegisterConfirm" />
</view> </view>
<!-- 生日弹窗 type 3 钻石、4 星光、5 星耀 -->
<!-- <popup-shengri v-if="isTip" type="3" @close="isTip = false"></popup-shengri> -->
<!-- 精选好卷弹窗 isUnlock // 是否解锁 商品兑换券 type 1 黄金、2 铂金、3 钻石、4 星光、5 星耀 -->
<!-- <popup-jingxuan v-if="isTip" type="1" isUnlock="true" @close="isTip = false"></popup-jingxuan> -->
<!-- 新人礼券弹窗 type 1 黄金、2 铂金、3 钻石、4 星光、5 星耀-->
<!-- <popup-xinren v-if="isTip" type="1" @close="isTip = false"></popup-xinren> -->
</template> </template>
<script setup> <script setup>
......
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