瑶都万能墙
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.1 KiB

7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
  1. <template>
  2. <view class="phone" v-if="phone" @click.stop="callPhone">
  3. <image src="/static/image/home/phone.png" mode="widthFix"></image>
  4. {{ title || '联系' + ta[sexName] }}
  5. </view>
  6. </template>
  7. <script>
  8. import mixinsSex from '@/mixins/sex.js'
  9. export default {
  10. mixins: [mixinsSex],
  11. props: ['phone', 'title', 'sexName', 'type', 'phoneTitle', 'pid'],
  12. data() {
  13. return {
  14. }
  15. },
  16. methods: {
  17. callPhone(){
  18. let data = {
  19. title : this.phoneTitle,
  20. type : this.type,
  21. id : this.pid
  22. }
  23. console.log(data);
  24. if(!data.id || !data.title){
  25. return uni.showToast({
  26. title: '缺少参数',
  27. icon: 'none'
  28. })
  29. }
  30. this.$api('checkGivePhone', data, res => {
  31. if(res.code == 200){
  32. uni.makePhoneCall({
  33. phoneNumber: this.phone
  34. })
  35. }
  36. })
  37. },
  38. }
  39. }
  40. </script>
  41. <style scoped lang="scss">
  42. .phone {
  43. background-color: rgba($uni-color, 0.2);
  44. color: $uni-color;
  45. padding: 8rpx 16rpx;
  46. border-radius: 10rpx;
  47. margin-left: auto;
  48. font-size: 26rpx;
  49. image {
  50. width: 20rpx;
  51. height: 20rpx;
  52. }
  53. }
  54. </style>