瑶都万能墙
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.

74 lines
1.3 KiB

11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
10 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 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. import { mapState } from 'vuex'
  10. export default {
  11. mixins: [mixinsSex],
  12. props: ['phone', 'title', 'sexName', 'type', 'phoneTitle', 'pid'],
  13. data() {
  14. return {
  15. }
  16. },
  17. computed : {
  18. ...mapState(['priceMap']),
  19. },
  20. methods: {
  21. callPhone(){
  22. let data = {
  23. title : this.phoneTitle,
  24. type : this.type,
  25. id : this.pid
  26. }
  27. console.log(data);
  28. if(!data.id || !data.title){
  29. return uni.showToast({
  30. title: '缺少参数',
  31. icon: 'none'
  32. })
  33. }
  34. uni.showModal({
  35. title: `确定消耗${this.priceMap.phone}积分呼叫吗?`,
  36. success : (r) => {
  37. if(r.confirm){
  38. this.$api('checkGivePhone', data, res => {
  39. if(res.code == 200){
  40. uni.makePhoneCall({
  41. phoneNumber: this.phone
  42. })
  43. }
  44. })
  45. }
  46. }
  47. })
  48. },
  49. }
  50. }
  51. </script>
  52. <style scoped lang="scss">
  53. .phone {
  54. background-color: rgba($uni-color, 0.2);
  55. color: $uni-color;
  56. padding: 8rpx 16rpx;
  57. border-radius: 10rpx;
  58. margin-left: auto;
  59. font-size: 26rpx;
  60. image {
  61. width: 20rpx;
  62. height: 20rpx;
  63. }
  64. }
  65. </style>