对接设置接口

This commit is contained in:
zhouyanli
2026-05-12 14:28:40 +08:00
parent 78c69cdb10
commit f2f5c5e050
7 changed files with 344 additions and 379 deletions

View File

@@ -28,7 +28,7 @@
</view>
</view>
<!-- 值班电话 -->
<view class="phone-item" v-for="phoneItems,phoneIndex in item.phoneList" :key="phoneIndex">
<view class="phone-item" v-for="phoneItems,phoneIndex in item.phoneList" :key="phoneIndex" @click="callPhone(phoneItems.phoneNum)">
<text class="phone-label">值班电话</text>
<text class="phone-num">{{phoneItems.phoneNum}}</text>
<!-- <text class="phone-icon"></text> -->
@@ -44,40 +44,53 @@
</template>
<script setup>
import { ref } from 'vue';
import {getManagePhoneData} from '../api/apiSub.js'
import { ref, onMounted } from 'vue';
import { getManagePhoneData } from '../api/apiSub.js'
const statusBarHeight = ref(20)
const dataList = ref([
{
src: 'http://47.104.199.163:9090/images/propertyImgs/community1.png',
propertyName: '北境碧桂园小区物业中心',
propertyAddress: 'A栋3单元1801',
phoneList: [{
phoneNum: '080-12312312312',
},
{
phoneNum: '080-12312312312',
}
],
}
])
const dataList = ref([])
// ====方法=====
function callPhone(phone) {
uni.makePhoneCall({
phoneNumber: phone.replace(/-/g, "")
phoneNumber: phone.replace(/-/g, ""),
fail: (err) => {
console.log('用户取消拨号', err)
}
});
}
function goBack() {
uni.switchTab({
url: '/pages/serviceIndex/serviceIndex',
});
}
function goBack() {
uni.switchTab({
url: '/pages/serviceIndex/serviceIndex',
});
}
onMounted(() => {
const villageId = uni.getStorageSync('currentVillageId')
if (!villageId) {
uni.showToast({ title: '请先选择小区', icon: 'none' })
return
}
uni.showLoading({ title: '加载中...' })
getManagePhoneData({ villageId }).then(res => {
uni.hideLoading()
if (res.code === 200 && res.data) {
const d = res.data
dataList.value = [{
src: d.villageImageUrl || 'http://47.104.199.163:9090/images/propertyImgs/community1.png',
propertyName: d.villageName || '',
propertyAddress: d.address || '',
phoneList: d.managePhone ? [{ phoneNum: d.managePhone }] : []
}]
} else {
uni.showToast({ title: res.msg || '获取失败', icon: 'none' })
}
}).catch(() => {
uni.hideLoading()
uni.showToast({ title: '获取失败', icon: 'none' })
})
})
</script>
<style lang="scss">
page {