jiangchengfeiyi-xiaochengxu/pages/subPack/clothesPop/clothesPop.vue

101 lines
1.9 KiB
Vue

<template>
<view class="content">
<movable-area class="movableArea">
<movable-view class="movableView" :x="x" :y="y" direction="all" @tap="onTouchend">
<image :src="doll" mode="widthFix" class="iconImage"></image>
<view class="fontBubble">AI试衣</view>
</movable-view>
</movable-area>
</view>
</template>
<script setup>
import { ref, nextTick, onMounted, onUnmounted, defineProps } from 'vue'
import { storeHomeUrl,publicPath } from '../../../common/globalImagesUrl';
import emitter from '../../../utils/emitter';
const doll = ref(publicPath + 'test_OVXdpOvbYwpUHkEx_jimeng_2025_05_06_634.jpeg')
const x = ref(375)
const y = ref(378)
// const old = ref({
// x: 30,
// y: 30
// })
const props = defineProps({
clothesImgUrl : String
})
onMounted(()=>{
})
onUnmounted(()=>{})
const onTouchend =()=> { //点击的方法
console.log('按钮被触发');
uni.navigateTo({
url: '/pages/subPack/changeClothes/changeClothes?imgUrl=' + props.clothesImgUrl
})
}
const onChange = (e) => { //移动时的方法
// old.value.x = e.detail.x
// old.value.y = e.detail.y
// console.log('x---->',e.detail.x);
console.log('y---->',e.detail.y);
}
</script>
<style scoped>
.content {
position: relative;
top: 40;
left: 40;
/* height: 100vh; */
}
.movableArea {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 999;
text-align: center;
}
.movableView {
pointer-events: auto;
width: 100rpx;
height: 100rpx;
padding: 10rpx;
border-radius: 100%;
/* border: 2px solid #33A3DC; */
background-color: #FFFFFF;
}
.iconImage {
display: block;
width: 70rpx;
height: 70rpx;
margin-left: 14rpx;
}
.contact {
width: 60px;
height: 60px;
overflow: hidden;
position: absolute;
left: 0px;
top: 0px;
border-radius: 100%;
opacity: 0;
}
.fontBubble {
font-size: 20rpx;
}
</style>