service.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <view class="diy-service drag optional drag__nomove"
  3. :style="{ right: itemData.style.right + '%', bottom: itemData.style.bottom + '%', opacity: itemData.style.opacity / 100 }">
  4. <view class="service-icon" v-if="itemData.params.type=='phone'" @click="callPhone">
  5. <image :src="itemData.params.image" mode="aspectFill"></image>
  6. </view>
  7. <button class="service-icon" open-type="contact" session-from="wxapp" v-if="itemData.params.type=='chat'">
  8. <image :src="itemData.params.image" mode="aspectFill"></image>
  9. </button>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. data() {
  15. return {};
  16. },
  17. props: ['itemData'],
  18. methods: {
  19. /*拨打电话*/
  20. callPhone(){
  21. let self=this;
  22. uni.makePhoneCall({
  23. phoneNumber: self.itemData.params.phone_num
  24. });
  25. }
  26. }
  27. };
  28. </script>
  29. <style>
  30. .diy-service{ position: fixed; width: 120rpx; height: 120rpx; z-index: 90; right: 0; bottom: 0;}
  31. .diy-service .service-icon{ width: 120rpx; height: 120rpx; }
  32. .diy-service button.service-icon{ padding: 0; background: none; }
  33. .diy-service .service-icon image{ width: 100%; height: 100%;}
  34. </style>