123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <template>
- <uni-popup ref="telRef" :isMaskClick='true' type="center" border-radius="10px 10px 0 0" maskBackgroundColor='rgba(0, 0, 0, 0.1)'>
- <view class="tel-box">
- <view class="tel-title">请选择电话拨打</view>
- <view class="tel-number">
- <view class="tel-number-item" v-for="item in telList" @click.stop="onPhoneCall(item.phone)">
- <text>{{item.phone}}</text>
- <text style="margin-left: 15rpx;" v-if="item.remark">({{item.remark}})</text>
- </view>
- </view>
- <view class="tel-btns" @click.stop="onClose()">
- <view class="tel-btn">关闭</view>
- </view>
- </view>
- </uni-popup>
- </template>
- <script>
- import { PhoneCall } from "@/utils/tool.js";
- export default {
- data() {
- return {
- telList: []
- }
- },
- mounted() {
- // this.$refs.telRef.open()
- },
- methods: {
- open(parmas = {}) {
- const { tel } = parmas;
- console.log('-------打开地图列表-------' , this.$refs.telRef)
- if (tel) {
- if (tel.length === 1 && !tel[0].remark) {
- this.onPhoneCall(tel[0].phone)
- } else {
- this.telList = tel;
- this.$refs.telRef.open()
- }
- }
- },
- onPhoneCall(phone) {
- PhoneCall(phone).then(res => {
- this.onClose()
- })
- },
- onClose() {
- this.$refs.telRef.close()
- this.telList = [];
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .uni-popup {
- z-index: 1002;
- .tel-box {
- width: 80vw;
- min-height: 30vh;
- height: auto;
- max-height: 70vh;
- background-color: #fff;
- border-radius: 20rpx;
- display: flex;
- flex-direction: column;
- // justify-content: center;
- align-items: center;
- justify-content: space-between;
- .tel-title {
- font-size: 36rpx;
- padding: 20rpx 0;
- }
- .tel-number {
- height: 1px;
- flex: 1;
- overflow: hidden;
- overflow-y: auto;
- .tel-number-item {
- padding: 20rpx;
- color: #3291F8;
- }
- }
- .tel-btns {
- padding: 20rpx 0;
- .tel-btn {
- width: 260rpx;
- height: 80rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- color: #fff;
- border-radius: 10rpx;
- background-color: #3291F8;
- }
- }
- }
- }
- </style>
|