<movable-area class="movableArea" v-if="suspension&&isSuspension">
<movable-view :x="moveX" :y="moveY" @change.stop="moveChangeAction" direction="all" damping="60" class="movableView">
<div>
<img class="template_suspension_img" v-if="suspension.suspension_img_url" :src="suspension.suspension_img_url" alt="" @click.stop="skipRedPacketAction()">
<img class="template_suspension_close" v-if="suspension.suspension_img_url" src="/static/images/index_adv_close2.png" alt="" @click.stop="closeRedPacketAction()">
</div>
</movable-view>
</movable-area>
// 红包悬浮按钮
moveChangeAction(e){
console.log('红包悬浮按钮');
console.log(e.mp.detail);
let getSysInfo = wx.getStorageSync("phoneMobile");
let ratio = getSysInfo.windowWidth/375;
let phoneCenter = getSysInfo.windowWidth / 2 - (60*ratio);
console.log(phoneCenter);
if(e.mp.detail.x!=0 || e.mp.detail.x!=getSysInfo.windowWidth-(180*ratio)) {
if(e.mp.detail.x<phoneCenter) {
this.moveX = 0;
this.moveY = e.mp.detail.y;
}else {
this.moveX = (750-180)*ratio;
this.moveY = e.mp.detail.y;
}
}
},
麻烦提供能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)