123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <template>
- <view class="phone-box">
- <block v-for="(item ,index) in telList">
- <view class="phone-item-box">
- <view class="pnone-headline">
- {{item.name}}
- </view>
- <block v-for="(subItem ,subIndex ) in item.list">
- <view class="sub-item">
- <view class="sub-item-label">{{subItem.label}}</view>
- <view class="sub-item-phone">
- <block v-for="(telItem ,telIndex ) in subItem.tel_list">
- <view class="phone-item" @click.stop="makingCall(telItem.tel)">
- <view class="phone-info">
- <text class="phone-num">{{telItem.tel}}</text>
- <text class="phone-hint" v-if="telItem.hint">{{telItem.hint}}</text>
- </view>
- <image v-if="telItem.tel" class="phone-icon" src="../static/phone.png"
- mode="aspectFit" />
- </view>
- </block>
- </view>
- </view>
- </block>
- </view>
- </block>
- </view>
- </template>
- <script>
- import phoneList from "./../json/phone.json"
- export default {
- data() {
- return {
- telList: []
- }
- },
- onLoad() {
- this.telList = phoneList.pnone || [];
- },
- methods: {
- makingCall(tel) {
- uni.makePhoneCall({
- phoneNumber: tel
- });
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- $h_num: 50rpx;
- .phone-box {
- padding: 30rpx;
- .phone-item-box {
- border-bottom: 1rpx solid #f9f7f7;
- padding: 30rpx 0;
- }
- .pnone-headline {
- line-height: 1.2;
- padding: 20rpx 0 20rpx 20rpx;
- // border-left: 10rpx solid skyblue;
- position: relative;
- display: flex;
- align-items: center;
- font-size: 36rpx;
- font-weight: 600;
- color: #1a1a1a;
- &::before {
- position: absolute;
- left: 0;
- top: 50%;
- transform: translateY(-50%);
- content: '';
- width: 10rpx;
- height: 60%;
- background-color: #3CBACF;
- }
- }
- .sub-item {
- width: 100%;
- font-size: 28rpx;
- padding: 10rpx 0;
- display: flex;
- .sub-item-label {
- flex-shrink: 0;
- width: 150rpx;
- height: $h_num;
- line-height: $h_num;
- color: #999999;
- }
- .sub-item-phone {
- width: calc(100% - 150rpx);
- color: #3CBACF;
- .phone-item {
- flex-shrink: 0;
- min-width: 51%;
- max-width: 100%;
- line-height: $h_num;
- display: inline-flex;
- align-items: center;
- flex-wrap: wrap;
- .phone-info {
- max-width: calc(100% - 40rpx);
- text {
- margin-right: 20rpx;
- }
- }
- .phone-icon {
- width: 40rpx;
- height: 40rpx;
- }
- }
- // <view class="phone-item">
- // <text class="phone-num">{{telItem.tel}}</text>
- // <text class="phone-hint"></text>
- // </view>
- // <image class="phone-icon" src="../static/phone.png" mode="aspectFit"></image>
- }
- }
- }
- </style>
|