quanwei
2 days ago 04102f7237efefa744090ed7c25f7b5d0807b679
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
<template>
    <view class="diy-service drag optional drag__nomove"
      :style="{ right: itemData.style.right + '%', bottom: itemData.style.bottom + '%', opacity: itemData.style.opacity / 100 }">
      <view class="service-icon" v-if="itemData.params.type=='phone'" @click="callPhone">
          <image :src="itemData.params.image" mode="aspectFill"></image>
      </view>
      <button class="service-icon" open-type="contact" session-from="wxapp" v-if="itemData.params.type=='chat'">
          <image :src="itemData.params.image" mode="aspectFill"></image>
      </button>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {};
        },
        props: ['itemData'],
        methods: {
            /*拨打电话*/
            callPhone(){
                let self=this;
                uni.makePhoneCall({
                    phoneNumber: self.itemData.params.phone_num
                });
            }
        }
    };
</script>
 
<style>
    .diy-service{ position: fixed; width: 120rpx; height: 120rpx; z-index: 90; right: 0; bottom: 0;}
    .diy-service .service-icon{ width: 120rpx; height: 120rpx; }
    .diy-service button.service-icon{ padding: 0; background: none; }
    .diy-service .service-icon image{ width: 100%; height: 100%;}
</style>