1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<template>
<view class='draggable is-pointer-down is-dragging draggable_dom' id='qidian_dom'>
<text class="icon-service"></text>
</view>
</template>
<script>
export default{
data() {
return {
name: ''
}
},
mounted(){
var elem = document.querySelector('.draggable');
this.$draggable = new Draggabilly(elem, {
containment: true
});
// this.$draggable.$on('staticClick', function( event, pointer ) {
// // elem.click();
// })
}
}
</script>
<style lang="less">
.draggable_dom{
line-height: 1;
width: 84rpx;
height: 84rpx;
border-radius: 50%;
cursor: pointer;
text-align: center;
background: #ff9232;
position: fixed;
bottom: 180rpx;
right: 10rpx;
z-index:2000000000
}
.icon-service{
display: inline-block;
position: relative;
top: 20rpx;
width: 40rpx;
height: 40rpx;
vertical-align: middle;
background: url(https://bqq.gtimg.com/qidian/src/wpa/dist/4.1.0/images/icon-im-44-white-2x.png) no-repeat;
background-size: 40rpx 40rpx;
opacity: 1;
cursor: pointer;
}
</style>