1.在newapp/components/putong.vue中:
<template>
<view class="putong">
<view class="padding-xl radius shadow-warp bg-cyan margin-top">
<view class="v-header">
<view class="pic">
<image :src="data1.data.wgz.img" mode=""></image>
</view>
<view class="pin">
<view class="l">
网格长:{{data1.data.wgz.name}}
</view>
<view class="l lz">
电话:{{data1.data.wgz.mobile}}
</view>
<view class="l btn margin-top">
<button class="cu-btn text-cyan" @tap="CallPhone" :data-url="data1.data.wgz.mobile">一键拨打</button>
</view>
</view>
</view>
</view>
<view class="padding-xl radius shadow-warp bg-cyan margin-top">
<view class="v-header">
<view class="pic">
<image :src="data1.data.wgy.img" mode=""></image>
</view>
<view class="pin">
<view class="l">
网格员:{{data1.data.wgy.name}}
</view>
<view class="l lz">
电话:{{data1.data.wgy.mobile}}
</view>
<view class="l btn margin-top">
<button class="cu-btn text-cyan" @tap="CallPhone" :data-url="data1.data.wgy.mobile">一键拨打</button>
</view>
</view>
</view>
</view>
<view class="bg-white margin-top">
<view class="cu-form-group">
<view class="title">楼长(街长):</view>
<input name="input" disabled="true" v-model="data1.data.lz.name"></input>
</view>
<view class="cu-form-group">
<view class="title">单元长(组长):</view>
<input name="input" disabled="true" v-model="data1.data.dyz.name"></input>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
data1:{}
},
data() {
return {
};
},
methods:{
// 拨打电话
CallPhone(e){uni.makePhoneCall({phoneNumber: e.currentTarget.dataset.url});},
},
created() {
console.log('普通用户组件')
}
}
</script>
<style>
</style>